/*
 * 是道道呀 2026 Youth UI
 * 独立视觉覆盖层：不改题库、计分、结果数据和分享逻辑。
 */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg-primary: oklch(0.975 0.018 86);
  --bg-secondary: oklch(0.952 0.027 86);
  --bg-card: oklch(0.995 0.006 80);
  --bg-card-hover: oklch(0.985 0.014 78);
  --bg-elevated: oklch(0.995 0.006 80);
  --text-primary: oklch(0.235 0.032 292);
  --text-secondary: oklch(0.41 0.034 290);
  --text-muted: oklch(0.54 0.028 286);
  --accent-main: oklch(0.66 0.205 27);
  --accent-main-dim: oklch(0.92 0.055 28);
  --accent-blue: oklch(0.68 0.14 243);
  --accent-pink: oklch(0.68 0.18 350);
  --accent-green: oklch(0.63 0.15 150);
  --accent-orange: oklch(0.7 0.17 55);
  --accent-purple: oklch(0.58 0.18 306);
  --accent-red: oklch(0.57 0.21 24);
  --grape: oklch(0.58 0.18 306);
  --lime: oklch(0.84 0.19 128);
  --cyan: oklch(0.78 0.13 206);
  --surface: oklch(0.995 0.006 80);
  --border: oklch(0.88 0.026 82);
  --nav-bg: oklch(0.975 0.018 86 / 0.96);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --font-display: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --shadow-sm: 0 5px 16px oklch(0.3 0.04 292 / 0.08);
  --shadow-md: 0 16px 40px oklch(0.3 0.04 292 / 0.12);
  --shadow-lg: 0 28px 72px oklch(0.3 0.04 292 / 0.15);
  --shadow-glow: 0 16px 42px oklch(0.66 0.205 27 / 0.16);
  --youth-ease: cubic-bezier(.16, 1, .3, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: oklch(0.19 0.035 292);
  --bg-secondary: oklch(0.225 0.04 292);
  --bg-card: oklch(0.255 0.04 292);
  --bg-card-hover: oklch(0.29 0.045 292);
  --bg-elevated: oklch(0.27 0.045 292);
  --text-primary: oklch(0.96 0.014 84);
  --text-secondary: oklch(0.79 0.025 86);
  --text-muted: oklch(0.67 0.026 290);
  --surface: oklch(0.255 0.04 292);
  --border: oklch(0.42 0.04 292);
  --nav-bg: oklch(0.19 0.035 292 / 0.96);
}

html {
  background: var(--bg-primary);
  scroll-padding-top: 82px;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
}

body::selection { background: var(--lime); color: var(--text-primary); }

a,
button,
input,
summary { -webkit-tap-highlight-color: transparent; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
.quiz-option:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.container,
.portal-section-inner,
.trust-bar-inner,
.pf-inner,
.pf-bottom { max-width: 1240px; }

.gradient-text,
.stat-num,
.result-code {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--grape) !important;
}

/* Navigation */
.nav,
.nav.scrolled {
  padding: 11px 0;
  background: var(--nav-bg);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 78%, transparent);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-inner { max-width: 1240px; min-height: 48px; padding: 0 24px; }

.nav-logo,
.pf-brand .logo {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.nav-logo { font-size: 1.18rem; }
.logo-mark,
.pf-brand .logo .mark { color: var(--accent-main) !important; }
.logo-submark { color: var(--text-muted); font-size: .65em; letter-spacing: 0; margin-left: 5px; }

.nav-links { gap: 4px; }
.nav-links a,
.nav-dropdown-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 650;
}

.nav-links a:hover,
.nav-dropdown:hover .nav-dropdown-toggle { color: var(--text-primary); background: var(--accent-main-dim); }

.nav-lang-btn {
  border-color: var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-secondary) !important;
}
.nav-lang-btn:hover { color: var(--text-primary) !important; transform: translateY(-1px); }

.nav-search-btn,
.theme-toggle,
.hamburger {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-primary);
}
.nav-search-btn:hover,
.theme-toggle:hover { background: var(--accent-main-dim); color: var(--accent-main); }

.nav-dropdown-menu,
.nav-search-popover,
.search-suggest,
.mobile-menu {
  background: var(--bg-elevated);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.mobile-menu { padding: 16px; }
.mobile-menu a { min-height: 46px; border-radius: 14px; }

/* Shared controls */
.btn {
  min-height: 48px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms var(--youth-ease), box-shadow 180ms var(--youth-ease), background 180ms var(--youth-ease);
}
.btn-primary,
.hero-search-btn,
.share-action-save {
  background: var(--accent-main) !important;
  color: oklch(0.985 0.008 80) !important;
  box-shadow: 0 8px 20px oklch(0.66 0.205 27 / .24);
}
.btn-primary:hover,
.hero-search-btn:hover,
.share-action-save:hover { background: oklch(0.59 0.205 27) !important; transform: translateY(-2px); }
.btn:active,
.hero-search-btn:active,
.share-action-btn:active { transform: scale(.98); }
.btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--accent-main-dim); border-color: color-mix(in oklch, var(--accent-main) 35%, var(--border)); }

.hero-search {
  min-height: 58px;
  padding: 6px 6px 6px 18px;
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.hero-search:focus-within {
  border-color: var(--accent-main) !important;
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent-main) 16%, transparent), var(--shadow-sm) !important;
}
.hero-search input[type="search"] { color: var(--text-primary) !important; font-size: 1rem; }
.hero-search-btn { min-height: 46px; padding: 10px 22px; border-radius: 999px; }

.nav-search-form { background: var(--bg-primary) !important; border-color: var(--border) !important; border-radius: 14px; }
.nav-search-form input[type="search"] { color: var(--text-primary) !important; }
.suggest-item { border-bottom-color: var(--border); }
.suggest-item:hover { background: var(--accent-main-dim); }
.suggest-more { color: var(--accent-main); background: var(--accent-main-dim); border-color: var(--border); }

/* Portal hero */
.portal-hero {
  min-height: min(840px, 92vh);
  padding: clamp(132px, 15vh, 176px) 0 90px;
  text-align: left;
  overflow: hidden;
}
.portal-hero::before {
  top: 112px;
  left: auto;
  right: max(24px, calc((100vw - 1240px) / 2));
  width: min(36vw, 430px);
  height: min(36vw, 430px);
  border-radius: 44% 56% 62% 38% / 42% 38% 62% 58%;
  background: var(--grape);
  opacity: 1;
  transform: rotate(7deg);
  box-shadow: 46px 44px 0 var(--lime), -34px 58px 0 var(--cyan);
}
.portal-hero::after {
  content: "🧠\A　 𖦹　💬\A ✦　　🔍";
  white-space: pre;
  position: absolute;
  z-index: 1;
  top: 190px;
  right: max(70px, calc((100vw - 1120px) / 2));
  width: min(29vw, 350px);
  color: oklch(0.98 0.01 80);
  font-size: clamp(2rem, 4vw, 4.3rem);
  line-height: 1.55;
  text-align: center;
  transform: rotate(-5deg);
  text-shadow: 0 10px 24px oklch(0.2 0.04 292 / .16);
}
.portal-hero-inner { max-width: 1240px; padding: 0 24px; margin: 0 auto; }
.portal-hero-inner > * { max-width: 660px; }
.portal-badge,
.hero-badge {
  position: static !important;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 16px;
  color: var(--grape);
  background: color-mix(in oklch, var(--grape) 10%, var(--bg-card));
  border: 1px solid color-mix(in oklch, var(--grape) 25%, var(--border));
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}
.portal-badge { margin-top: 18px; }
.portal-h1 {
  max-width: 700px;
  font-size: clamp(3.1rem, 6vw, 6.15rem);
  line-height: .98;
  letter-spacing: -.075em;
  margin-bottom: 26px;
}
.portal-h1 .gradient-text { color: var(--accent-main) !important; }
.portal-desc { margin: 0 0 30px; max-width: 620px; color: var(--text-secondary); font-size: clamp(1rem, 1.5vw, 1.15rem); }
.hero-search-wrap { width: min(620px, 100%); margin: 0 0 24px; }
.portal-cta-row { justify-content: flex-start; margin-bottom: 38px; }
.portal-stats {
  justify-content: flex-start;
  max-width: 330px;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.pstat { padding: 8px 24px 8px 0; text-align: left; border-color: var(--border); }
.pstat + .pstat { padding-left: 24px; }
.pstat-num { color: var(--grape); font-family: var(--font-display); font-size: 1.8rem; font-weight: 900; }
.pstat-label { color: var(--text-secondary); font-size: .76rem; }
.portal-hero-note { margin-top: 14px; }

.trust-bar { background: var(--text-primary); border: 0; padding: 14px 24px; }
.trust-bar-inner { justify-content: space-between; }
.trust-item { color: var(--bg-primary); font-weight: 650; }
.trust-sep { color: color-mix(in oklch, var(--bg-primary) 30%, transparent); }

/* Discovery sections and cards */
.portal-section { padding: clamp(64px, 8vw, 108px) 0; }
.portal-section:nth-of-type(even) { background: var(--bg-secondary); }
.portal-section-head { align-items: flex-end; gap: 28px; margin-bottom: 34px; }
.portal-section-head h2 { font-size: clamp(1.75rem, 3vw, 2.8rem); letter-spacing: -.045em; line-height: 1.08; }
.portal-section-head h2 .dot { color: var(--accent-main); }
.portal-section-sub { color: var(--text-secondary); font-size: .92rem; }
.portal-more { min-height: 44px; display: inline-flex; align-items: center; color: var(--grape); font-weight: 800; }

.cat-group { margin-bottom: 76px; }
.cat-group-header,
.tests-category-head,
.tidx-section-head { border-bottom-color: var(--border); }
.cat-group-badge { font-family: var(--font-body); letter-spacing: .02em; text-transform: none; border: 0; }
.cat-group-badge-science { background: color-mix(in oklch, var(--grape) 13%, var(--bg-card)); color: var(--grape); }
.cat-group-badge-relation { background: color-mix(in oklch, var(--accent-pink) 13%, var(--bg-card)); color: var(--accent-pink); }
.cat-group-badge-career { background: color-mix(in oklch, var(--cyan) 17%, var(--bg-card)); color: oklch(0.49 0.12 220); }
.cat-group-badge-emotion { background: color-mix(in oklch, var(--accent-green) 13%, var(--bg-card)); color: var(--accent-green); }
.cat-group-badge-internet { background: color-mix(in oklch, var(--accent-main) 12%, var(--bg-card)); color: var(--accent-main); }

.tests-grid { gap: 18px; }
.tests-grid-featured { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; }
.tests-grid-featured > .test-card:first-child { grid-column: span 2; grid-row: span 2; min-height: 390px; }
.tests-grid-featured > .test-card:nth-child(4n + 2) { background: color-mix(in oklch, var(--lime) 24%, var(--bg-card)); }
.tests-grid-featured > .test-card:nth-child(4n + 3) { background: color-mix(in oklch, var(--cyan) 16%, var(--bg-card)); }
.tests-grid-featured > .test-card:nth-child(4n + 4) { background: color-mix(in oklch, var(--accent-main) 8%, var(--bg-card)); }

.test-card,
.preview-card,
.rank-card,
.pathway-card,
.search-browse-card,
.tidx-card,
.mbti-dim-card,
.test-dim-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.test-card {
  min-height: 224px;
  padding: 25px 22px 22px;
  transition: transform 220ms var(--youth-ease), box-shadow 220ms var(--youth-ease), border-color 220ms var(--youth-ease);
}
.test-card::before,
.test-dim-card::before { display: none !important; }
.test-card:hover,
.pathway-card:hover,
.search-browse-card:hover,
.tidx-card:hover {
  background: var(--bg-card-hover);
  border-color: color-mix(in oklch, var(--grape) 38%, var(--border));
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.tc-emoji,
.test-card-emoji { font-size: 2.2rem; filter: saturate(1.08); }
.tests-grid-featured > .test-card:first-child .tc-emoji { font-size: 4.1rem; }
.tc-tag,
.test-card-badge,
.tests-category-kicker,
.tidx-kicker { font-family: var(--font-body); letter-spacing: .025em; text-transform: none; font-weight: 800; }
.tc-name,
.test-card h3 { color: var(--text-primary); font-size: 1.12rem; line-height: 1.35; }
.tests-grid-featured > .test-card:first-child .tc-name { font-size: clamp(1.65rem, 2.4vw, 2.35rem); max-width: 14ch; }
.tc-desc,
.test-card p { color: var(--text-secondary); }
.tc-arrow { background: var(--text-primary); color: var(--bg-card); }
.test-card:hover .tc-arrow { background: var(--accent-main); color: oklch(0.98 0.01 80); }
.tc-chip { border-radius: 999px; padding: 5px 10px; }
.tc-chip-hot { background: var(--accent-main); color: oklch(0.98 0.01 80); }
.tc-chip-new { background: var(--lime); color: var(--text-primary); }
.tc-chip-scale { background: color-mix(in oklch, var(--grape) 14%, var(--bg-card)); color: var(--grape); }

.all-tests-archive { background: var(--bg-card); border-color: var(--border); border-radius: var(--radius-lg); }
.all-tests-archive > summary { min-height: 64px; color: var(--text-primary); }

/* All tests page, override its inline legacy styles */
body .tests-hero { padding: 132px 0 76px; text-align: left; }
body .tests-hero h1 { max-width: 760px; font-size: clamp(3rem, 7vw, 6.2rem); line-height: .98; letter-spacing: -.07em; margin-bottom: 22px; }
body .tests-hero p { max-width: 620px; margin: 0; color: var(--text-secondary); }
body .tests-search-panel {
  max-width: 960px;
  margin: -28px auto 42px;
  padding: 14px;
  background: var(--bg-card);
  border-color: var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
}
body .tests-search-form { min-height: 56px; background: var(--bg-primary); border-color: var(--border); }
body .tests-search-form input { color: var(--text-primary); }
body .tests-search-form button { min-height: 42px; padding: 8px 20px; background: var(--accent-main); color: oklch(0.98 0.01 80); }
body .tests-filter-tabs { justify-content: flex-start; gap: 8px; }
body .tests-filter-btn,
body .tidx-tab {
  min-height: 44px;
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-secondary);
  transition: transform 180ms var(--youth-ease), background 180ms var(--youth-ease), color 180ms var(--youth-ease);
}
body .tests-filter-btn:hover,
body .tests-filter-btn.active,
body .tidx-tab:hover,
body .tidx-tab.active { background: var(--grape); border-color: var(--grape); color: oklch(0.98 0.01 80); }
body .tests-scenario-grid { grid-template-columns: 1.2fr .9fr 1.05fr .85fr 1.1fr; gap: 14px; }
body .tests-scenario-card {
  min-height: 146px;
  padding: 18px;
  background: var(--bg-card);
  border-color: var(--border);
  border-radius: 22px;
  box-shadow: none;
}
body .tests-scenario-card:nth-child(1) { background: color-mix(in oklch, var(--lime) 26%, var(--bg-card)); }
body .tests-scenario-card:nth-child(2) { background: color-mix(in oklch, var(--cyan) 19%, var(--bg-card)); }
body .tests-scenario-card:nth-child(3) { background: color-mix(in oklch, var(--accent-pink) 10%, var(--bg-card)); }
body .tests-scenario-card:hover { border-color: var(--grape); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
body .tests-scenario-card span { color: var(--text-secondary); }
body .tests-catalog { gap: 68px; }
body .tests-category-kicker { color: var(--accent-main); }
body .tests-category-count { font-family: var(--font-body); }
body .tests-no-results { background: var(--bg-card); border-color: var(--border); }
body .tests-category-section .tests-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  padding-bottom: 0;
}
body .tests-category-section .test-card {
  grid-column: auto;
  display: block;
  height: 100%;
  min-height: 350px;
  padding: 26px 24px 118px;
}
body .tests-category-section .test-card:nth-child(5n + 2) { background: color-mix(in oklch, var(--lime) 18%, var(--bg-card)); }
body .tests-category-section .test-card:nth-child(5n + 3) { background: color-mix(in oklch, var(--cyan) 11%, var(--bg-card)); }
body .tests-category-section .test-card::before { display: none; }
body .tests-category-section .test-card-meta {
  position: absolute;
  right: 24px;
  bottom: 76px;
  left: 24px;
  margin: 0;
}
body .test-card-badge { background: var(--grape); color: oklch(0.98 0.01 80); }
body .test-card-badge.new { background: var(--lime); color: var(--text-primary); }
body .tests-category-section .test-card-link {
  position: absolute;
  bottom: 24px;
  left: 24px;
  margin: 0;
  color: var(--accent-main);
  font-weight: 850;
}

/* Individual test landing */
.hero { min-height: auto; padding: 148px 0 88px; }
.hero-bg {
  top: 104px;
  left: auto;
  right: max(24px, calc((100vw - 1150px) / 2));
  width: clamp(220px, 28vw, 370px);
  height: clamp(220px, 28vw, 370px);
  border-radius: 48% 52% 38% 62% / 55% 42% 58% 45%;
  background: var(--grape);
  box-shadow: 32px 32px 0 var(--lime);
  opacity: .96;
  transform: rotate(8deg);
}
.hero-bg::after {
  content: "✦  🧠\A  🔍   𖦹\A 💬   ✷";
  white-space: pre;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: oklch(0.98 0.01 80);
  font-size: clamp(1.65rem, 3vw, 3rem);
  line-height: 1.8;
  text-align: center;
  transform: rotate(-8deg);
  text-shadow: 0 8px 20px oklch(0.2 0.04 292 / .18);
}
.hero-content { text-align: left; }
.hero-content > .hero-badge,
.hero-content > .hero-title,
.hero-content > .hero-desc,
.hero-content > .hero-gallery-hint,
.hero-content > .hero-actions { max-width: 650px; }
.hero-title { font-size: clamp(3rem, 6.6vw, 6rem); line-height: .98; letter-spacing: -.07em; }
.hero-desc { margin: 0 0 28px; color: var(--text-secondary); }
.hero-gallery-hint { margin: -12px 0 28px; text-align: left; }
.hero-actions { justify-content: flex-start; }
.stats-row { max-width: 760px; margin-top: 70px; gap: 12px; }
.stat-card { padding: 22px 20px; text-align: left; background: var(--bg-card); border-color: var(--border); border-radius: 20px; }
.stat-card:hover { transform: translateY(-3px); border-color: var(--grape); box-shadow: var(--shadow-sm); }
.stat-num { font-size: 2.25rem; color: var(--accent-main) !important; }

.test-dims-grid,
.mbti-dims-grid { gap: 16px; }
.test-dim-card,
.mbti-dim-card { padding: 24px; }
.mbti-type-chip { background: var(--bg-card); border-color: var(--border); border-radius: 16px; }
.mbti-type-chip:hover { background: var(--accent-main-dim); border-color: var(--accent-main); }

.test-seo-search,
.test-seo-faq { background: var(--bg-secondary); border-color: var(--border); }
.test-seo-search-side,
.test-seo-faq-dl { background: var(--bg-card); border-color: var(--border); border-radius: var(--radius-lg); }

/* Quiz */
.quiz-section { padding: 112px 0 70px; background: var(--bg-primary); }
.quiz-wrapper { max-width: 820px; padding: 0 24px; }
.quiz-header { margin-bottom: 18px; }
.quiz-back { min-height: 44px; color: var(--text-secondary); font-weight: 700; }
.quiz-progress-text { color: var(--grape); font-weight: 900; }
.quiz-progress-bar { height: 9px; background: color-mix(in oklch, var(--grape) 12%, var(--bg-secondary)); }
.quiz-progress-fill { background: var(--accent-main); box-shadow: none; transition: transform 350ms var(--youth-ease), width 350ms var(--youth-ease); }
.quiz-body {
  margin-top: 30px;
  padding: clamp(24px, 5vw, 48px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
}
.quiz-question { max-width: 24ch; margin: 0 auto 32px; color: var(--text-primary); font-size: clamp(1.35rem, 3vw, 2.05rem); line-height: 1.45; text-align: center; }
.quiz-options { gap: 12px; }
.quiz-option {
  min-height: 58px;
  padding: 14px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 17px;
  color: var(--text-primary);
  transition: transform 180ms var(--youth-ease), border-color 180ms var(--youth-ease), background 180ms var(--youth-ease);
}
.quiz-option:hover { background: color-mix(in oklch, var(--cyan) 10%, var(--bg-card)); border-color: var(--cyan); transform: translateX(3px); }
.quiz-option.selected { background: var(--accent-main-dim); border-color: var(--accent-main); box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent-main) 14%, transparent); }
.quiz-option-marker { border-color: var(--border); background: var(--bg-card); }
.quiz-option.selected .quiz-option-marker { background: var(--accent-main); border-color: var(--accent-main); }
.quiz-footer { background: var(--bg-primary); border-top-color: var(--border); box-shadow: none; }

/* Result */
.result-section { background: var(--bg-primary); padding: 112px 0 80px; }
.result-wrapper {
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(330px, .82fr) minmax(0, 1.18fr);
  align-items: start;
  gap: clamp(32px, 6vw, 78px);
}
.result-card {
  position: sticky;
  top: 102px;
  padding: 34px;
  margin-bottom: 0;
  background: var(--grape);
  border: 0;
  border-radius: 32px;
  box-shadow: 22px 22px 0 color-mix(in oklch, var(--lime) 76%, var(--bg-primary));
}
.result-card-bg { background: transparent; }
.result-badge { color: oklch(0.91 0.08 307); font-family: var(--font-body); font-weight: 800; letter-spacing: .05em; }
.result-img { max-width: min(100%, 360px); max-height: none; border-radius: 24px; background: oklch(0.98 0.01 80); filter: none; box-shadow: 0 18px 36px oklch(0.2 0.04 292 / .22); }
.result-code { color: oklch(0.98 0.01 80) !important; font-size: clamp(2.6rem, 6vw, 5.3rem); }
.result-name { color: oklch(0.98 0.01 80); font-size: clamp(1.45rem, 2.6vw, 2rem); }
.result-tagline { color: oklch(0.91 0.03 88); }
.result-match { color: var(--text-primary); background: var(--lime); font-family: var(--font-body); font-weight: 850; }
.result-global-rank { background: oklch(0.27 0.05 295 / .9); border-color: oklch(0.8 0.05 300 / .3); color: oklch(0.9 0.03 88); }
.result-details { min-width: 0; }
.result-section-block {
  margin-bottom: 0;
  padding: 34px 0;
  border-bottom: 1px solid var(--border);
}
.result-section-block:first-child { padding-top: 0; }
.result-section-block h3 { color: var(--text-primary); font-size: clamp(1.25rem, 2vw, 1.65rem); letter-spacing: -.025em; }
.result-section-block p { color: var(--text-secondary); font-size: .98rem; line-height: 1.92; }
.share-actions { gap: 10px; }
.share-action-btn { min-height: 50px; border-radius: 999px; font-weight: 800; }
.share-action-challenge { background: var(--text-primary); color: var(--bg-primary); border: 0; }
.share-action-challenge:hover { background: var(--grape); color: oklch(0.98 0.01 80); }
.dim-bar-track,
.dim-bar-wrap { background: var(--bg-secondary); }
.result-disclaimer { color: var(--text-muted); background: var(--bg-secondary); border-color: var(--border); border-radius: 16px; }
.result-actions { justify-content: flex-start; padding-top: 32px; }

/* Gallery, search and secondary pages */
.tidx-hero,
.search-hero { padding-top: 132px; text-align: left; }
.tidx-hero h1,
.search-hero h1 { font-size: clamp(2.7rem, 6vw, 5.2rem); line-height: 1; letter-spacing: -.06em; }
.tidx-toolbar { background: var(--bg-primary); border-color: var(--border); backdrop-filter: none; }
.tidx-search { background: var(--bg-card) !important; border-color: var(--border) !important; }
.tidx-card { min-height: 108px; padding: 18px; }
.tidx-card-count,
.tidx-kicker { color: var(--grape); }
.search-group-head { border-color: var(--border); }
.search-browse-card { min-height: 150px; }
.test-card mark,
.suggest-name mark { background: var(--lime); color: var(--text-primary); }

/* Footer */
.contact-page {
  min-height: 100vh;
  padding: 138px 0 88px;
}
.contact-page-inner { max-width: 1120px; }
.contact-page-header { max-width: 720px; margin-bottom: 44px; }
.contact-page-header h2 {
  margin: 14px 0 14px;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 1;
  letter-spacing: -.06em;
}
.contact-page-header p { color: var(--text-secondary); font-size: 1.05rem; }
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(390px, 1.18fr);
  gap: 20px;
  align-items: stretch;
}
.contact-card,
.contact-social-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
}
.contact-primary-card { display: flex; flex-direction: column; justify-content: center; padding: 8px 0; overflow: hidden; }
.contact-item { gap: 18px; padding: 28px 30px; }
.contact-item + .contact-item { border-top-color: var(--border); }
.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-main-dim);
  color: var(--accent-main);
  font-size: 1.2rem;
  font-weight: 900;
}
.contact-info { min-width: 0; }
.contact-label { color: var(--text-muted); font-family: var(--font-body); font-weight: 800; letter-spacing: .02em; }
.contact-value {
  display: inline-block;
  max-width: 100%;
  color: var(--text-primary);
  font-size: clamp(.98rem, 2vw, 1.15rem);
  overflow-wrap: anywhere;
}
.contact-value:hover { color: var(--accent-main); }
.contact-note { margin-top: 6px; color: var(--text-muted); font-size: .8rem; line-height: 1.55; }
.contact-social-card {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(160px, .65fr) minmax(220px, 1fr);
  gap: 22px;
  align-items: center;
  background: color-mix(in oklch, var(--accent-main) 8%, var(--bg-card));
}
.contact-social-copy h3 { margin: 10px 0 10px; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.15; }
.contact-social-copy p { color: var(--text-secondary); font-size: .88rem; line-height: 1.7; }
.contact-social-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-main);
  color: oklch(0.985 0.008 80);
  font-size: .72rem;
  font-weight: 900;
}
.contact-social-id { margin-top: 22px; display: grid; gap: 4px; }
.contact-social-id span { color: var(--text-muted); font-size: .72rem; font-weight: 700; }
.contact-social-id strong { color: var(--grape); font-size: 1rem; letter-spacing: .02em; }
.contact-social-image {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: 18px;
  background: oklch(0.99 0.005 80);
}
.contact-back { margin-top: 32px; }

.portal-footer { margin-top: 70px; padding: 62px 24px 34px; background: var(--text-primary); border: 0; }
.pf-brand .logo { color: var(--bg-primary); font-size: 1.22rem; }
.pf-brand p,
.pf-col a,
.pf-col h4,
.pf-bottom,
.pf-muted { color: color-mix(in oklch, var(--bg-primary) 76%, transparent); }
.pf-col a { min-height: 36px; }
.pf-col a:hover { color: var(--lime); }
.pf-bottom { border-top-color: color-mix(in oklch, var(--bg-primary) 16%, transparent); }
.pf-col-qr,
.mp-follow-card,
.mp-follow-qr,
.wechat-section { display: none !important; }

@media (max-width: 980px) {
  .contact-layout { grid-template-columns: 1fr; }
  .contact-social-card { grid-template-columns: minmax(180px, .55fr) minmax(260px, 1fr); }
  .portal-hero::before { right: -90px; opacity: .28; }
  .portal-hero::after { right: 0; opacity: .38; }
  .portal-hero-inner > * { max-width: 70%; }
  .tests-grid-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tests-grid-featured > .test-card:first-child { grid-column: span 2; min-height: 330px; }
  body .tests-scenario-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body .tests-category-section .tests-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .tests-category-section .test-card { grid-column: auto; }
  .hero-bg { opacity: .25; right: -70px; }
  .result-wrapper { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 42px; }
  .result-card { padding: 26px; box-shadow: 14px 14px 0 color-mix(in oklch, var(--lime) 70%, var(--bg-primary)); }
}

@media (max-width: 760px) {
  .contact-page { padding: 112px 0 62px; }
  .contact-page-inner { padding-inline: 16px; }
  .contact-page-header { margin-bottom: 30px; }
  .contact-page-header h2 { font-size: clamp(2.6rem, 13vw, 4rem); }
  .contact-item { padding: 24px 20px; }
  .contact-social-card { grid-template-columns: 1fr; padding: 20px; }
  .contact-social-image { max-height: none; }
  .nav-inner { padding: 0 16px; }
  .portal-hero { min-height: auto; padding: 118px 0 68px; }
  .portal-hero::before { top: 120px; right: -110px; width: 300px; height: 300px; opacity: .16; box-shadow: none; }
  .portal-hero::after { display: none; }
  .portal-hero-inner { padding: 0 18px; }
  .portal-hero-inner > * { max-width: 100%; }
  .portal-h1 { font-size: clamp(2.75rem, 13vw, 4.25rem); }
  .portal-desc br { display: none; }
  .portal-cta-row { gap: 10px; }
  .portal-cta-row .btn { flex: 1; justify-content: center; padding-inline: 16px; }
  .trust-bar-inner { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .trust-bar-inner::-webkit-scrollbar { display: none; }
  .trust-sep { display: none; }
  .trust-item { flex: 0 0 auto; padding: 4px 16px 4px 0; }
  .portal-section { padding: 62px 0; }
  .portal-section-inner { padding: 0 16px; }
  .portal-section-head { align-items: flex-start; flex-direction: column; margin-bottom: 26px; }
  .tests-grid-featured { grid-template-columns: 1fr; }
  .tests-grid-featured > .test-card:first-child { grid-column: auto; grid-row: auto; min-height: 300px; }
  .tests-grid-featured > .test-card:first-child .tc-emoji { font-size: 3rem; }
  body .tests-hero { padding: 118px 0 58px; }
  body .tests-search-panel { margin: -12px 16px 30px; }
  body .tests-filter-tabs { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
  body .tests-filter-btn { flex: 0 0 auto; }
  body .tests-scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .tests-category-head { align-items: flex-start; flex-direction: column; }
  body .tests-category-section .tests-grid { grid-template-columns: 1fr; }
  body .tests-category-section .test-card,
  body .tests-category-section .test-card:nth-child(5n + 1),
  body .tests-category-section .test-card:nth-child(5n + 2),
  body .tests-category-section .test-card:nth-child(5n + 3) { grid-column: auto; min-height: 280px; }
  body .tests-category-section .test-card { padding: 24px 20px 112px; }
  body .tests-category-section .test-card-meta { right: 20px; left: 20px; }
  body .tests-category-section .test-card-link { left: 20px; }
  .hero { padding: 118px 0 64px; }
  .hero-bg { display: none; }
  .hero-title { font-size: clamp(2.8rem, 13vw, 4.2rem); }
  .hero-desc { font-size: .98rem; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 46px; }
  .stat-card { padding: 18px 12px; text-align: center; }
  .stat-num { font-size: 1.7rem; }
  .stat-label { font-size: .8rem; }
  .stat-sub { display: none; }
  .quiz-section { padding-top: 92px; }
  .quiz-wrapper { padding: 0 16px; }
  .quiz-body { margin-top: 22px; padding: 26px 18px; border-radius: 24px; }
  .quiz-question { margin-bottom: 24px; }
  .quiz-option { min-height: 60px; padding: 14px; }
  .result-section { padding: 92px 0 58px; }
  .result-wrapper { display: block; padding: 0 16px; }
  .result-card { position: relative; top: auto; margin-bottom: 48px; padding: 26px 20px 30px; box-shadow: 10px 10px 0 color-mix(in oklch, var(--lime) 70%, var(--bg-primary)); }
  .result-img { border-radius: 19px; }
  .result-section-block { padding: 28px 0; }
  .share-actions { flex-direction: column; }
  .result-actions .btn { flex: 1; justify-content: center; }
  .tidx-hero,
  .search-hero { padding-top: 112px; }
  .pf-inner { grid-template-columns: 1fr 1fr; }
  .pf-brand { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  .container { padding-inline: 16px; }
  .portal-h1 { font-size: 2.8rem; }
  .hero-search { padding-left: 14px; }
  .hero-search-btn { padding-inline: 16px; }
  .portal-stats { max-width: 100%; }
  .portal-cta-row .btn { flex-basis: 100%; }
  body .tests-scenario-grid { grid-template-columns: 1fr; }
  body .tests-scenario-card { min-height: 126px; }
  .stats-row { margin-top: 38px; }
  .quiz-footer { gap: 10px; }
  .quiz-footer .btn { padding-inline: 18px; }
  .pf-inner { grid-template-columns: 1fr; }
  .pf-brand { grid-column: auto; }
  .pf-bottom { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .test-card:hover,
  .pathway-card:hover,
  .quiz-option:hover,
  .btn-primary:hover { transform: none !important; }
}
