/* ============================================
   core.css — 合并: normalize.css + base.css + components.css + test.css
   生成日期: 2026-06-01
   ============================================ */
/* ========== normalize.css v8.0.1 ========== */
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}
main {
  display: block;
}
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}
hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}
pre {
  font-family: monospace, monospace;
  font-size: 1em;
}
a {
  background-color: transparent;
}
abbr[title] {
  border-bottom: none;
  text-decoration: underline;
  text-decoration: underline dotted;
}
b,strong {
  font-weight: bolder;
}
code,kbd,samp {
  font-family: monospace, monospace;
  font-size: 1em;
}
small {
  font-size: 80%;
}
sub,sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub {
  bottom: -0.25em;
}
sup {
  top: -0.5em;
}
img {
  border-style: none;
}
button,input,optgroup,select,textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}
button,input {
  overflow: visible;
}
button,select {
  text-transform: none;
}
button,[type="button"],[type="reset"],[type="submit"] {
  -webkit-appearance: button;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}
fieldset {
  padding: 0.35em 0.75em 0.625em;
}
legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal;
}
progress {
  vertical-align: baseline;
}
textarea {
  overflow: auto;
}
[type="checkbox"],[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}
[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button {
  height: auto;
}
[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}
::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}
details {
  display: block;
}
summary {
  display: list-item;
}
template {
  display: none;
}
[hidden] {
  display: none;
}


/* ========== base.css ========== */
/* ============================================
   Base Variables & Typography
   配色方案：紫色主色 + 暖色强调
   ============================================ */

:root {
  /* --- 主色系：紫色 --- */
  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-primary-active: #5b21b6;
  --color-primary-light: #a78bfa;
  --color-primary-lighter: #ddd6fe;
  --color-primary-bg: #f5f3ff;

  /* --- 强调色：琥珀 --- */
  --color-accent: #f59e0b;
  --color-accent-hover: #d97706;
  --color-accent-light: #fde68a;

  /* --- 中性色 --- */
  --color-white: #ffffff;
  --color-bg: #fafafa;
  --color-bg-alt: #f1f5f9;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* --- 文字 --- */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  /* --- 语义色 --- */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* --- 字体 --- */
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'Fira Code', 'SF Mono', 'Cascadia Code', Consolas, monospace;

  /* --- 字号系统（1.25 比例尺） --- */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */

  /* --- 间距系统（8px 基线） --- */
  --space-1: 0.25rem;     /* 4px */
  --space-2: 0.5rem;      /* 8px */
  --space-3: 0.75rem;     /* 12px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */

  /* --- 圆角 --- */
  --radius-sm: 0.375rem;    /* 6px */
  --radius-md: 0.5rem;      /* 8px */
  --radius-lg: 0.75rem;     /* 12px */
  --radius-xl: 1rem;        /* 16px */
  --radius-2xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;

  /* --- 阴影 --- */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgb(124 58 237 / 0.15);

  /* --- 过渡 --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* --- 布局 --- */
  --container-max: 1200px;
  --container-narrow: 800px;
  --header-height: 64px;
}

/* ====== 暗色主题 ====== */
[data-theme="dark"] {
  --color-primary: #a78bfa;
  --color-primary-hover: #c4b5fd;
  --color-primary-active: #ddd6fe;
  --color-primary-light: #7c3aed;
  --color-primary-lighter: #4c1d95;
  --color-primary-bg: #1e1b4b;

  --color-accent: #fbbf24;
  --color-accent-hover: #fcd34d;
  --color-accent-light: #92400e;

  --color-bg: #0f172a;
  --color-bg-alt: #1e293b;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-border-light: #1e293b;

  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-inverse: #0f172a;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4);
  --shadow-glow: 0 0 20px rgb(167 139 250 / 0.1);
}

/* ====== 基础重置 & 排版 ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  transition: background-color var(--transition-base), color var(--transition-base);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ====== 排版层级 ====== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

/* ====== 容器 ====== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ====== 主要内容区域 ====== */
.main-content {
  min-height: calc(100vh - var(--header-height) - 320px);
  padding-top: var(--header-height);
}

/* ====== Scroll-triggered Animation (animate-on-scroll) ====== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== 内容正文样式 ====== */
.content {
  font-size: var(--text-base);
  line-height: 1.8;
}

.content h2 {
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.content h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.content p {
  margin-bottom: var(--space-4);
}

.content ul,
.content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.content li {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.content blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-bg);
  border-radius: var(--radius-md);
}

/* ====== 选择器 ====== */
::selection {
  background-color: var(--color-primary-lighter);
  color: var(--color-text);
}

/* ====== 自定义滚动条（品牌紫色调） ====== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-primary) 25%, var(--color-text-muted));
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-primary) 50%, var(--color-text-secondary));
}

/* Firefox 滚动条（品牌紫色） */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-text-muted)) var(--color-bg-alt);
}

/* ====== 锚点定位修正（固定导航栏遮挡） ====== */
:target {
  scroll-margin-top: calc(var(--header-height) + var(--space-6));
}

/* 同时给所有带 ID 的 section/article 预设 scroll-margin */
section[id],
article[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-6));
}

/* ====== Animations ====== */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    /* transform omitted intentionally — prevents creating a containing block
       for position:fixed descendants (e.g. .quiz-nav inside .test-taking) */
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Staggered entrance for grid items */
.features-grid > .feature-card,
.tests-grid > .test-card,
.listing-grid > .test-card {
  animation: fade-in-up 0.6s ease both;
}

.features-grid > .feature-card:nth-child(1),
.tests-grid > .test-card:nth-child(1),
.listing-grid > .test-card:nth-child(1) {
  animation-delay: 0.05s;
}

.features-grid > .feature-card:nth-child(2),
.tests-grid > .test-card:nth-child(2),
.listing-grid > .test-card:nth-child(2) {
  animation-delay: 0.12s;
}

.features-grid > .feature-card:nth-child(3),
.tests-grid > .test-card:nth-child(3),
.listing-grid > .test-card:nth-child(3) {
  animation-delay: 0.19s;
}

.features-grid > .feature-card:nth-child(4),
.tests-grid > .test-card:nth-child(4),
.listing-grid > .test-card:nth-child(4) {
  animation-delay: 0.26s;
}

.features-grid > .feature-card:nth-child(5),
.tests-grid > .test-card:nth-child(5),
.listing-grid > .test-card:nth-child(5) {
  animation-delay: 0.33s;
}

.features-grid > .feature-card:nth-child(6),
.tests-grid > .test-card:nth-child(6),
.listing-grid > .test-card:nth-child(6) {
  animation-delay: 0.40s;
}

/* Hero entrance */
.hero-content {
  animation: fade-in 0.8s ease both;
}

.hero-stats {
  animation: fade-in-up 0.6s ease 0.3s both;
}

/* Section entrance — handled by .animate-on-scroll + IntersectionObserver */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ====== Scroll-triggered card entrance ====== */
/* Defined above with custom bezier — remove duplicate */

/* ====== Reading Progress Bar ====== */
/* Defined in pages.css with proper header offset */


/* ========== components.css ========== */
/* ============================================
   Components: 按钮、卡片、导航、页脚、徽章等
   ============================================ */

/* ====== Sticky Share Bar (test results page) ====== */
.sticky-share-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding: var(--space-2) var(--space-4);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

[data-theme="dark"] .sticky-share-bar {
  background: color-mix(in srgb, var(--color-bg-alt) 95%, transparent);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.sticky-share-bar.is-visible {
  transform: translateY(0);
}

.sticky-share-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  max-width: 500px;
  margin: 0 auto;
}

.sticky-share-inner .btn {
  min-width: 80px;
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
}

.sticky-share-inner .btn-icon-only {
  width: 44px;
  height: 44px;
}

/* ====== Share FAB ====== */
.share-fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  right: var(--space-6);
  z-index: 92;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: none;
  color: var(--color-text-inverse);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base),
              box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.share-fab.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.share-fab:hover {
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.5);
  transform: scale(1.05);
}

.share-fab:active {
  transform: scale(0.95);
}

.share-fab-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.share-fab:hover .share-fab-tooltip {
  opacity: 1;
}

/* ====== Share Modal ====== */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fade-in 0.2s ease;
}

.share-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.share-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
  animation: scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  z-index: 2;
}

.share-modal-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.share-modal-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.share-modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.share-modal-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.share-modal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  text-align: center;
}

.share-modal-actions .btn {
  width: 100%;
  justify-content: center;
}

.share-modal-wechat-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0;
}

/* ====== Share Card Preview ====== */
.share-card-preview {
  padding: var(--space-2);
}

.share-card {
  background: #ffffff;
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  max-width: 360px;
  margin: 0 auto;
}

.share-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid #f1f5f9;
}

.share-card-logo {
  font-size: var(--text-sm);
  font-weight: 800;
  color: #7c3aed;
}

.share-card-testname {
  font-size: var(--text-xs);
  font-weight: 600;
  color: #94a3b8;
}

.share-card-body {
  text-align: center;
}

.share-card-score-section {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  background: #fafafa;
}

.share-card-score-section[data-level="low"] {
  background: #ecfdf5;
}

.share-card-score-section[data-level="moderate"] {
  background: #fffbeb;
}

.share-card-score-section[data-level="high"] {
  background: #fef2f2;
}

.share-card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--space-2);
}

.share-card-score {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.share-card-score[data-level="low"] { color: #10b981; }
.share-card-score[data-level="moderate"] { color: #f59e0b; }
.share-card-score[data-level="high"] { color: #ef4444; }

.share-card-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
}

.share-card-label[data-level="low"] { color: #10b981; }
.share-card-label[data-level="moderate"] { color: #f59e0b; }
.share-card-label[data-level="high"] { color: #ef4444; }

.share-card-dims {
  margin-bottom: var(--space-3);
}

.share-card-dim {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
}

.share-card-dim-name {
  flex: 1;
  text-align: right;
  font-weight: 600;
  color: #475569;
}

.share-card-dim-score {
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.share-card-dim-score[data-level="low"] { color: #10b981; }
.share-card-dim-score[data-level="moderate"] { color: #f59e0b; }
.share-card-dim-score[data-level="high"] { color: #ef4444; }

.share-card-dim-track {
  flex: 0 0 80px;
  height: 6px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.share-card-dim-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.share-card-dim-fill[data-level="low"] { background: #10b981; }
.share-card-dim-fill[data-level="moderate"] { background: #f59e0b; }
.share-card-dim-fill[data-level="high"] { background: #ef4444; }

.share-card-desc {
  font-size: var(--text-xs);
  color: #64748b;
  line-height: 1.5;
  margin-top: var(--space-3);
}

.share-card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid #f1f5f9;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

/* ====== Social Proof Bar (home page) ====== */
.social-proof-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 8%, transparent), color-mix(in srgb, var(--color-accent) 5%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 10%, transparent);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

/* Subtle shimmer across the proof bar */
.social-proof-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-primary) 3%, transparent), transparent);
  animation: social-shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes social-shimmer {
  0% { transform: translateX(0); }
  50% { transform: translateX(200%); }
  100% { transform: translateX(200%); }
}

.social-proof-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.social-proof-strong {
  font-weight: 700;
  color: var(--color-text);
}

.social-proof-divider {
  color: var(--color-border);
  user-select: none;
}

/* ====== User Dropdown Menu (navbar, authenticated) ====== */
.nav-user-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-user-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.nav-user-dropdown-btn:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.nav-user-dropdown-btn .dropdown-arrow {
  transition: transform var(--transition-fast);
}

.nav-user-dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 200;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.nav-user-dropdown.is-open .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.dropdown-item svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.dropdown-item:hover svg {
  color: var(--color-primary);
}

/* Mobile: collapse dropdown into full-width items */
@media (max-width: 767px) {
  .nav-user-dropdown {
    display: block;
    width: 100%;
  }

  .nav-user-dropdown-btn {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-lg);
    border-bottom: 1px solid var(--color-border-light);
    border-radius: 0;
  }

  .nav-user-dropdown-btn:hover {
    background: var(--color-primary-bg);
    border-left: 3px solid var(--color-primary);
    padding-left: calc(var(--space-5) - 3px);
  }

  .nav-user-dropdown.is-open .nav-user-dropdown-btn {
    background: var(--color-primary-bg);
    border-left: 3px solid var(--color-primary);
    font-weight: 600;
    color: var(--color-primary);
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    display: none;
    background: color-mix(in srgb, var(--color-bg-alt) 50%, transparent);
  }

  .nav-user-dropdown.is-open .dropdown-menu {
    display: block;
  }

  .dropdown-item {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
  }
}

/* ====== Test Quiz UI Components ====== */
.quiz-progress-top {
  margin-bottom: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-bg);
  padding-top: var(--space-3);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.progress-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.question-stepper {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-5);
  overflow-x: auto;
  padding: var(--space-1) 0;
  -webkit-overflow-scrolling: touch;
}

.question-stepper::-webkit-scrollbar {
  display: none;
}

.stepper-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.stepper-dot.is-active {
  background: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.stepper-dot.is-completed {
  background: var(--color-primary-light);
}

.keyboard-hint {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

/* ====== Result Header Share Quick ====== */
.result-header-share-quick {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  border: 1px solid var(--color-primary-lighter);
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.result-header-share-quick:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
  transform: translateY(-1px);
}

.result-header-share-quick:active {
  transform: scale(0.97);
}

/* ====== Result Stats Row ====== */
.result-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

/* ============================================
   Share Buttons
   ============================================ */
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.share-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-right: var(--space-1);
}

.share-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  min-width: 64px;
  height: 64px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-sans);
}

.share-btn:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.share-btn:active {
  transform: scale(0.95);
}

.share-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.share-btn-label {
  font-size: 10px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}

.share-btn svg {
  transition: transform var(--transition-fast);
}

.share-btn:hover svg {
  transform: scale(1.15);
}

.share-btn-native {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-lighter);
  color: var(--color-primary);
}

.share-btn-native:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.share-btn-native:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ====== Test Detail Page ====== */
.test-detail-page {
  min-height: 60vh;
}

.test-content.card {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: var(--space-8);
}

.test-description {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.test-description h2,
.test-description h3 {
  color: var(--color-text);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.test-description ul,
.test-description ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.test-description li {
  margin-bottom: var(--space-2);
}




/* ====== Result Disclaimer ====== */
.result-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
  line-height: 1.5;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.result-footer {
  margin-top: var(--space-6);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  padding: var(--space-3) var(--space-5);
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

/* Keyboard focus ring */
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

/* Primary */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px rgb(124 58 237 / 0.3);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 6px 20px rgb(124 58 237 / 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--color-primary-active);
  box-shadow: 0 2px 8px rgb(124 58 237 / 0.3);
  transform: translateY(0) scale(0.97);
}

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}

.btn-secondary:active {
  background: var(--color-border);
  transform: translateY(0) scale(0.97);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

/* Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
  gap: var(--space-3);
}

.btn svg {
  transition: transform var(--transition-fast);
}

.btn:hover svg {
  transform: translateX(3px);
}

/* ====== Back to Top Button ====== */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 96;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgb(124 58 237 / 0.35);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base), box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 6px 20px rgb(124 58 237 / 0.45);
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: scale(0.92);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ====== Loading Spinner State ====== */
/* Add class "is-loading" to show spinner and disable interaction */
.btn.is-loading {
  position: relative;
  pointer-events: none;
  cursor: default;
  color: transparent !important;
  gap: 0;
}

.btn.is-loading svg {
  opacity: 0;
  transform: none;
}

/* ====== Icon Only Button ====== */
.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-icon-only:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-icon-only:active {
  transform: scale(0.92);
}

.btn-icon-only:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ====== Full-width Button Block ====== */
.btn-block {
  width: 100%;
  justify-content: center;
}

/* Spinner via pseudo-element — uses explicit color, not currentColor */
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

/* ====== Toast Notification ====== */
.toast-container {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  pointer-events: none;
  width: 100%;
  max-width: 360px;
  padding: 0 var(--space-4);
}

/* On test pages (no mobile bottom nav), offset less */
body.has-test-page .toast-container {
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* On result pages, above sticky share bar (shift-up class added by JS) */
body.has-test-page .toast-container.shift-up {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.toast {
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  pointer-events: auto;
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .toast {
  background: var(--color-bg-alt);
  color: var(--color-text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.is-closing {
  animation: toast-out 0.25s cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}

.btn-primary.is-loading::after {
  border-color: rgba(255,255,255,0.6);
  border-top-color: #ffffff;
}

.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after {
  border-color: rgba(100,116,139,0.4);
  border-top-color: var(--color-text-secondary);
}

.btn-sm.is-loading::after {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.btn-lg.is-loading::after {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ====== Card ====== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

/* Hover effect only on devices that support hover (desktop with mouse).
   On touch devices, :hover can be sticky and the transform creates a containing
   block for position:fixed descendants — see audit 2026-06-03. */
@media (hover: hover) {
  .card:hover {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 1px var(--color-primary-light), var(--shadow-glow);
    transform: translateY(-3px);
  }
}

/* Press feedback for touch/mobile — scale in slightly instead of translate */
.card:active {
  transform: scale(0.98);
  border-color: var(--color-primary-light);
}

.card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ====== Navigation ====== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

/* 页面顶部 — 全透明玻璃效果，内容透过模糊层显示 */
.site-header:not(.is-scrolled) {
  background: color-mix(in srgb, var(--color-bg) 55%, transparent);
  border-bottom-color: color-mix(in srgb, var(--color-border) 40%, transparent);
}

/* 滚动后 — 更实心的背景 + 阴影，导航更清晰 */
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  box-shadow: 0 1px 8px rgb(0 0 0 / 0.08);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .site-header.is-scrolled {
  box-shadow: 0 1px 8px rgb(0 0 0 / 0.3);
}

/* Mobile nav backdrop overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  top: var(--header-height);
  z-index: 98;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .nav-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Logo */
.nav-brand {
  flex-shrink: 0;
}

/* Desktop: nav links centered */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  justify-content: center;
}

/* Theme toggle on the right */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: var(--space-1);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
  border-color: var(--color-text-muted);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--color-text);
  padding: 6px 0;
  min-height: 44px;
}

.logo-icon {
  font-size: 1.6em;
  line-height: 1;
  transition: transform var(--transition-base);
}

.nav-logo:hover .logo-icon {
  transform: scale(1.1) rotate(-10deg);
}

.logo-text {
  color: var(--color-primary); /* fallback for older browsers */
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.nav-link {
  position: relative;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-link.active {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  animation: nav-indicator-in 0.4s ease both;
}

@keyframes nav-indicator-in {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 20px;
    opacity: 1;
  }
}

/* ====== User Dropdown Menu ====== */
.nav-user-dropdown {
  position: relative;
  display: inline-flex;
}

.nav-user-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.nav-user-dropdown-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

.nav-user-dropdown-btn .dropdown-arrow {
  transition: transform var(--transition-fast);
}

.nav-user-dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 4px 24px rgba(0,0,0,0.12));
  padding: var(--space-1);
  display: none;
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.nav-user-dropdown.is-open .dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

/* Close dropdown when clicking outside */
.nav-user-dropdown.is-open::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
}

/* Mobile: dropdown in full-screen nav */
@media (max-width: 768px) {
  .nav-user-dropdown {
    width: 100%;
  }
  .nav-user-dropdown-btn {
    width: 100%;
    justify-content: center;
  }
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    background: transparent;
  }
  .nav-user-dropdown.is-open .dropdown-menu {
    display: flex;
    flex-direction: column;
  }
  .dropdown-item {
    justify-content: center;
    padding: var(--space-3);
  }
}

/* ====== Navigation Link ====== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: var(--space-2);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 101;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ====== Footer ====== */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-16);
  position: relative;
}

/* Subtle gradient accent line at footer top */
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--color-primary-lighter) 20%,
    var(--color-primary-light) 50%,
    var(--color-primary-lighter) 80%,
    transparent 100%);
  opacity: 0.4;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer-brand {
  margin-bottom: var(--space-8);
}

.footer-brand .logo-icon {
  font-size: 1.4em;
}

.footer-brand .logo-text {
  font-size: var(--text-xl);
  font-weight: 800;
}

.footer-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.footer-links {
  display: flex;
  gap: var(--space-12);
  margin-bottom: var(--space-10);
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-heading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-primary);
}

.footer-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ====== Footer Social & Newsletter ====== */
.footer-social {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  justify-content: center;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.footer-social-link:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.footer-social-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: var(--space-1);
}

/* ====== Newsletter ====== */
.newsletter-section {
  max-width: var(--container-narrow);
  margin: 0 auto var(--space-10);
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle animated gradient border effect */
.newsletter-section::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, 
    var(--color-primary-lighter), 
    transparent 30%, 
    transparent 70%, 
    var(--color-accent-light)
  );
  opacity: 0.4;
  z-index: 0;
  animation: newsletter-border-glow 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes newsletter-border-glow {
  0% { opacity: 0.2; }
  100% { opacity: 0.5; }
}

.newsletter-section > * {
  position: relative;
  z-index: 1;
}

.newsletter-section h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-2xl);
}

.newsletter-section p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
}

.newsletter-form {
  display: flex;
  gap: var(--space-2);
  max-width: 420px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  min-height: 44px;
  transition: all var(--transition-fast);
}

.newsletter-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.newsletter-submit {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 700;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.newsletter-submit:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgb(124 58 237 / 0.3);
}

.newsletter-submit:active {
  transform: scale(0.97);
}

.newsletter-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  opacity: 0.7;
}

[data-theme="dark"] .newsletter-section {
  background: var(--color-bg-alt);
}

[data-theme="dark"] .newsletter-input {
  background: var(--color-surface);
}

/* ====== Testimonials / Social Proof Reviews ====== */
.reviews-section {
  max-width: var(--container-max);
  margin: 0 auto var(--space-12);
  padding: 0 var(--space-6);
}

.reviews-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--transition-base);
}

.review-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.review-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-2);
  color: #f59e0b;
  font-size: var(--text-sm);
}

.review-text {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
  font-style: italic;
}

.review-author {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

.review-author::before {
  content: '— ';
}

/* ====== Scroll Progress Bar (article pages) ====== */
.scroll-progress {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  z-index: 99;
  transition: width 50ms linear;
  pointer-events: none;
}

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-bottom p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.footer-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: var(--space-3) auto 0;
  line-height: 1.6;
}

/* ====== Badge ====== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulse-dot 2s ease-in-out infinite;
  vertical-align: middle;
}

/* ====== Trust Bar (Media mentions) ====== */
.trust-bar {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border-light);
  text-align: center;
  animation: fade-in 0.6s ease 0.2s both;
}

.trust-bar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.trust-bar-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  opacity: 0.6;
}

.trust-bar-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.trust-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
  opacity: 0.55;
  transition: all var(--transition-fast);
  white-space: nowrap;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  background: transparent;
}

.trust-logo:hover {
  opacity: 1;
  color: var(--color-text);
  background: var(--color-bg-alt);
  transform: translateY(-1px);
}

.trust-logo:active {
  transform: scale(0.96);
}

/* Subtle gradient border glow on trusted publications section */
.trust-bar-inner {
  position: relative;
}
.trust-bar-inner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 400px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary-lighter), transparent);
  opacity: 0.4;
}

/* ====== Social Proof Bar Animated Entrance ====== */
.social-proof-bar {
  animation: social-proof-slide 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes social-proof-slide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Focus-visible outlines for accessibility on interactive cards */
.test-card:focus-visible,
.article-card:focus-visible,
.review-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Publication logo emoji icon */
.trust-logo-icon {
  font-size: 1.1em;
  line-height: 1;
  display: inline-block;
}

/* Featured-in label style enhancement */
.trust-bar-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.trust-logo-dot {
  display: none;
}

@media (max-width: 767px) {
  .trust-bar {
    padding: var(--space-4) 0;
    overflow: hidden;
  }
  .trust-logo {
    font-size: 11px;
    padding: var(--space-1) var(--space-2);
    gap: 2px;
  }
  .trust-logo-icon {
    font-size: 0.95em;
  }
  .trust-bar-logos {
    gap: var(--space-1);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-1);
    justify-content: flex-start;
  }
  .trust-bar-logos::-webkit-scrollbar {
    display: none;
  }
  .trust-logo {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
  .trust-bar-label {
    margin-bottom: var(--space-3);
    font-size: 10px;
  }
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 40%, transparent);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.6);
    box-shadow: 0 0 8px 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
  }
}

/* ====== Tag/Tag ====== */
.test-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--tag-color, #7c3aed) 15%, transparent);
  color: var(--tag-color, #7c3aed);
}

/* ====== Hero Section ====== */
.hero-section {
  position: relative;
  padding: var(--space-20) 0 var(--space-16);
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--color-primary-bg) 0%, transparent 60%);
  z-index: 0;
  overflow: hidden;
}

/* Animated gradient overlay */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, color-mix(in srgb, var(--color-primary) 8%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, color-mix(in srgb, var(--color-accent) 5%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, color-mix(in srgb, var(--color-primary-light) 6%, transparent) 0%, transparent 50%);
  animation: hero-gradient-shift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes hero-gradient-shift {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1) rotate(2deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotate(-1deg);
    opacity: 0.5;
  }
}

/* Subtle breathing aura overlay */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(ellipse at 50% 30%, var(--color-primary-light) 0%, transparent 50%);
  opacity: 0;
  animation: hero-aura 8s ease-in-out infinite;
  pointer-events: none;
}

/* Hero CTA button with subtle breathing glow */
.hero-actions .btn-primary {
  position: relative;
  animation: hero-cta-glow 4s ease-in-out infinite;
  overflow: visible;
}

.hero-actions .btn-primary::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: inherit;
  opacity: 0.3;
  filter: blur(12px);
  z-index: -1;
  animation: hero-cta-glow-ring 4s ease-in-out infinite;
}

@keyframes hero-cta-glow {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.4), 0 0 0 3px rgba(124, 58, 237, 0.1);
    transform: scale(1.02);
  }
}

@keyframes hero-cta-glow-ring {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.06);
  }
}

/* Dark mode darkens the glow */
[data-theme="dark"] .hero-actions .btn-primary {
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.2);
}
[data-theme="dark"] .hero-actions .btn-primary::after {
  opacity: 0.15;
}

@media (prefers-color-scheme: dark) {
  .hero-actions .btn-primary {
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.2);
  }
  .hero-actions .btn-primary::after {
    opacity: 0.15;
  }
}

/* Floating particles (CSS-only, no JS) */
.hero-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary-light);
  opacity: 0;
  pointer-events: none;
}

.hero-particle:nth-child(1) {
  top: 15%;
  left: 10%;
  animation: particle-float 12s ease-in-out infinite;
  animation-delay: 0s;
  width: 10px;
  height: 10px;
  opacity: 0.25;
}

.hero-particle:nth-child(2) {
  top: 60%;
  right: 15%;
  animation: particle-float 15s ease-in-out infinite;
  animation-delay: 2s;
  width: 6px;
  height: 6px;
  opacity: 0.18;
}

.hero-particle:nth-child(3) {
  top: 30%;
  right: 25%;
  animation: particle-float 10s ease-in-out infinite;
  animation-delay: 4s;
  width: 5px;
  height: 5px;
  opacity: 0.2;
}

.hero-particle:nth-child(4) {
  bottom: 20%;
  left: 20%;
  animation: particle-float 14s ease-in-out infinite;
  animation-delay: 1s;
  width: 7px;
  height: 7px;
  opacity: 0.15;
}

.hero-particle:nth-child(5) {
  top: 10%;
  right: 40%;
  animation: particle-float 11s ease-in-out infinite;
  animation-delay: 6s;
  width: 4px;
  height: 4px;
  opacity: 0.25;
}

@keyframes particle-float {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: var(--particle-opacity, 0.12);
  }
  25% {
    transform: translateY(-30px) translateX(15px) scale(1.3);
  }
  50% {
    transform: translateY(-60px) translateX(-10px) scale(0.8);
    opacity: calc(var(--particle-opacity, 0.12) * 0.5);
  }
  75% {
    transform: translateY(-30px) translateX(20px) scale(1.1);
  }
}

@keyframes hero-aura {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.3; transform: scale(1.15); }
}

/* ====== Hero Search Bar ====== */
.hero-search {
  max-width: 480px;
  margin: 0 auto var(--space-8);
}

.hero-search-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.hero-search-form:focus-within {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent), var(--shadow-md);
}

.hero-search-icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
  padding: var(--space-3) 0;
  min-height: 44px;
  font-family: var(--font-sans);
}

.hero-search-input::placeholder {
  color: var(--color-text-muted);
}

.hero-search-submit {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 44px;
}

.hero-search-submit:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.hero-search-submit:active {
  transform: scale(0.96);
}

/* ====== Hero Category Pills ====== */
.hero-category-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: calc(-1 * var(--space-4)) 0 var(--space-6);
}

.hero-category-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.hero-category-pill:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  background: var(--color-primary-bg);
  transform: translateY(-1px);
}

.hero-category-pill:active {
  transform: scale(0.96);
}

.pill-emoji {
  font-size: 0.9em;
  line-height: 1;
}

[data-theme="dark"] .hero-bg {
  background: radial-gradient(ellipse at 50% 0%, var(--color-primary-bg) 0%, transparent 60%);
}

[data-theme="dark"] .hero-bg::after {
  background: radial-gradient(ellipse at 50% 30%, var(--color-primary-lighter) 0%, transparent 50%);
}

/* === Dark mode for new components === */

[data-theme="dark"] .hero-category-pill {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

[data-theme="dark"] .hero-category-pill:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-light);
}

[data-theme="dark"] .hero-search-form {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .hero-search-input {
  color: var(--color-text);
}

[data-theme="dark"] .filter-tag {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

[data-theme="dark"] .filter-tag.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

[data-theme="dark"] .filter-tag:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-light);
}

[data-theme="dark"] .social-proof-bar {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .trust-bar {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .trust-logo {
  opacity: 0.4;
}

[data-theme="dark"] .trust-logo:hover {
  opacity: 0.85;
  background: var(--color-bg);
  color: var(--color-text);
}

[data-theme="dark"] .back-to-top {
  box-shadow: 0 4px 14px rgb(124 58 237 / 0.5);
}

[data-theme="dark"] .share-btn {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

[data-theme="dark"] .share-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-primary-light);
}

[data-theme="dark"] .share-btn-native {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

[data-theme="dark"] .share-btn-native:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ====== Dark mode: new components ====== */
[data-theme="dark"] .sticky-share-bar {
  background: var(--color-bg-alt);
  border-top-color: var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .sticky-test-cta {
  background: var(--color-bg-alt);
  border-top-color: var(--color-border);
}

[data-theme="dark"] .share-modal-content {
  background: var(--color-bg-alt);
}

[data-theme="dark"] .review-item {
  background: var(--color-surface);
}

[data-theme="dark"] .review-item:hover {
  background: var(--color-primary-bg);
}

[data-theme="dark"] .recommend-card {
  background: var(--color-surface);
}

[data-theme="dark"] .stat-badge {
  background: var(--color-surface);
}

[data-theme="dark"] .sticky-share-inner .btn-icon-only {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

.sticky-share-inner .btn-icon-only:active {
  transform: scale(0.92);
}

[data-theme="dark"] .sticky-share-inner .btn-icon-only:hover {
  background: var(--color-surface);
}

[data-theme="dark"] .reading-progress {
  background: transparent;
}

[data-theme="dark"] .reading-progress-fill {
  box-shadow: 0 0 8px rgb(167 139 250 / 0.25);
}

[data-theme="dark"] .article-category {
  background: var(--color-primary-bg);
  color: var(--color-primary-light);
}

[data-theme="dark"] .article-meta-bar {
  color: var(--color-text-muted);
}

[data-theme="dark"] .article-card-excerpt {
  color: var(--color-text-secondary);
}

/* ====== Dark mode: new components ====== */
[data-theme="dark"] .review-card {
  background: var(--color-bg-alt);
}

[data-theme="dark"] .review-text {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .footer-social-link {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

[data-theme="dark"] .footer-social-link:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* ====== Hero Content ====== */
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary-bg), color-mix(in srgb, var(--color-primary-bg) 80%, var(--color-primary-light)));
  color: var(--color-primary);
  border: 1px solid var(--color-primary-lighter);
  margin-bottom: var(--space-6);
  box-shadow: 0 2px 8px rgba(124,58,237,0.08);
  animation: badge-glow 3s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(124,58,237,0.08); }
  50% { box-shadow: 0 2px 16px rgba(124,58,237,0.18); }
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
  color: var(--color-text); /* fallback for older browsers */
  background: linear-gradient(135deg, var(--color-text), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-10);
  flex-wrap: wrap;
  animation: fade-in-up 0.6s ease 0.3s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
  animation: stat-count-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

@keyframes stat-count-in {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ====== Features Section ====== */
.features-section {
  padding: var(--space-16) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
  padding: 0 var(--space-6);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0.6;
}

/* Animate underline when parent scrolls into view — prevents animation from
   playing on page load before user scrolls to the section. */
.animate-on-scroll .section-title::after {
  width: 0;
  opacity: 0;
}
.animate-on-scroll.is-visible .section-title::after {
  width: 48px;
  opacity: 0.6;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s,
              opacity 0.6s ease 0.3s;
}

/* Section underline entrance: grows from center alongside section fade-in */
@keyframes section-underline-in {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 48px;
    opacity: 0.6;
  }
}

.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto;
  margin-top: var(--space-5);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.feature-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--icon-color, #7c3aed) 12%, transparent);
  color: var(--icon-color, #7c3aed);
  margin-bottom: var(--space-5);
  transition: all var(--transition-base);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
  box-shadow: 0 0 30px color-mix(in srgb, var(--icon-color, #7c3aed) 25%, transparent);
}

.feature-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ====== Tests Section ====== */
.tests-section {
  padding: var(--space-16) 0;
  background: var(--color-bg-alt);
}

/* ====== Articles Section (Homepage) ====== */
.articles-section {
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.articles-section .article-grid {
  margin-bottom: var(--space-4);
}

.tests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.test-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-base);
}

.test-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.test-duration {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Test card popularity indicator — social proof at card level */
.test-popularity {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.test-card:hover .test-popularity {
  opacity: 1;
}

.test-popularity .popularity-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse-dot 2s ease-in-out infinite;
}

.test-popularity .popularity-num {
  font-weight: 700;
  color: var(--color-primary);
}

.test-card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  line-height: 1.3;
  transition: color var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Emoji — fixed size for uniform appearance */
.test-card-title .test-card-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 26px;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.test-card:hover .test-card-emoji {
  transform: scale(1.2) rotate(-5deg);
}

/* Category color accent at card top */
.test-card {
  position: relative;
}

.test-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-6);
  right: var(--space-6);
  height: 3px;
  background: var(--tag-color, var(--color-primary));
  border-radius: 0 0 var(--radius-full) var(--radius-full);
  opacity: 0.5;
  transition: opacity var(--transition-base), height var(--transition-base);
}

.test-card:hover::before {
  opacity: 1;
  height: 4px;
}

.test-card:hover .test-card-title {
  color: var(--color-primary);
}

/* ====== Mobile-First Test Card Hover ====== */
.test-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.test-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
}

.test-card:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-border);
}

.test-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.test-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-light);
}

.test-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.test-questions {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.test-arrow {
  color: var(--color-primary);
  opacity: 0.5;
  transform: translateX(-3px);
  transition: all var(--transition-base);
}

.test-card:hover .test-arrow,
.test-card:focus-visible .test-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* ====== Test Card Quick-Start Badge ====== */
.test-card-start {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}

.test-card-start:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,58,237,0.35);
}

.test-card-start:active {
  transform: scale(0.95);
}

.test-card-start svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Hover state: card shows the quick-start button — always visible */
.test-card .test-card-start {
  opacity: 1;
  transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  pointer-events: auto;
}

.test-card:hover .test-card-start,
.test-card:focus-within .test-card-start {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124,58,237,0.35);
}

/* On mobile/touch, more prominent */
@media (hover: none) {
  .test-card .test-card-start {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding: var(--space-3) var(--space-5);
  }
}

.section-actions {
  text-align: center;
  margin-top: var(--space-8);
  animation: fade-in-up 0.5s ease 0.45s both;
}

/* ====== CTA Section ====== */
.cta-section {
  padding: var(--space-20) 0;
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary-bg) 0%, var(--color-bg) 50%, var(--color-primary-bg) 100%);
  background-size: 200% 200%;
  animation: cta-gradient-shift 12s ease-in-out infinite alternate;
}

@keyframes cta-gradient-shift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* CTA content scales subtly on hover */
.cta-section:hover .cta-content {
  transform: scale(1.01);
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  transition: transform var(--transition-slow);
}

.cta-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
}

.cta-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

/* ====== Page Header ====== */
.page-header {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-8);
  text-align: center;
}

.page-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--tag-color, #7c3aed) 15%, transparent);
  color: var(--tag-color, #7c3aed);
  margin-bottom: var(--space-4);
}

.page-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
}

.page-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* Entrance animation */
.page-header {
  animation: fade-in-up 0.6s ease both;
}

.page-content {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-16);
}

/* ====== Listing Page ====== */
.listing-page {
  padding: 0 0 var(--space-16);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section-content {
  max-width: var(--container-narrow);
  margin: var(--space-10) auto 0;
  padding: 0 var(--space-6);
}

/* ====== Empty State ====== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.empty-state h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--color-text-muted);
}

/* ============================================
   Shared Components (Gap Fixes)
   ============================================ */

/* ====== Sticky Share Bar (result page bottom) ====== */
.sticky-share-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sticky-share-bar.is-visible {
  transform: translateY(0);
}

.sticky-share-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 640px;
  margin: 0 auto;
}

.sticky-share-inner .btn {
  flex: 1;
  justify-content: center;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
}

.sticky-share-inner .btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sticky-share-inner .btn-icon-only:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.sticky-share-inner .btn-icon-only:active {
  transform: scale(0.92);
}

/* ====== Sticky Test CTA (test detail page mobile) ====== */
.sticky-test-cta {
  display: none;
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  animation: fade-in-up 0.3s ease;
}

.sticky-test-cta .btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 767px) {
  .sticky-test-cta {
    display: flex;
    justify-content: center;
    bottom: 60px;
    z-index: 100;
  }
  .test-content.card {
    margin-bottom: 80px;
  }
  /* Add bottom padding to main content for sticky CTA on mobile (handled via .test-content.card margin) */
}

/* ====== Share Card Preview Modal (moved below) ====== */
/* Share card styles defined in the Share Card Preview Modal section below */

/* ====== Review Summary ====== */
.review-summary {
  animation: fade-in 0.3s ease;
}

.review-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.review-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-2);
}

.review-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.review-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  max-height: 50vh;
  overflow-y: auto;
}

.review-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.review-item:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-bg);
}

.review-item:active {
  transform: scale(0.99);
}

.review-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.review-body {
  flex: 1;
  min-width: 0;
}

.review-question {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-answer {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 2px;
}

.review-edit {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.review-item:hover .review-edit {
  color: var(--color-primary);
}

.review-actions {
  display: flex;
  gap: var(--space-3);
}

.review-actions .btn {
  flex: 1;
  justify-content: center;
}
/* ====== Filter Bar (test listing page) ====== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-6);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.filter-tag:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.filter-tag.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.filter-tag:active {
  transform: scale(0.96);
}

.filter-emoji {
  font-size: 0.9em;
  line-height: 1;
}

.search-result-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-4);
}

.search-result-info p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* ====== How It Works Section ====== */
.how-section {
  padding: var(--space-16) 0;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  position: relative;
}

/* Connecting line between steps (desktop) */
.how-grid::before {
  content: '';
  position: absolute;
  top: 28px; /* center of .how-step-number (56px/2) */
  left: calc(100% / 6 + 28px);
  right: calc(100% / 6 + 28px);
  height: 2px;
  background: linear-gradient(90deg,
    var(--color-primary-light) 0%,
    var(--color-primary-lighter) 50%,
    var(--color-primary-light) 100%);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

/* Animated dash effect on the connecting line */
.how-grid::after {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(100% / 6 + 28px);
  right: calc(100% / 6 + 28px);
  height: 2px;
  background: repeating-linear-gradient(90deg,
    var(--color-primary) 0px,
    var(--color-primary) 8px,
    transparent 8px,
    transparent 16px);
  opacity: 0;
  animation: how-line-dash 2s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.how-section:hover .how-grid::after {
  opacity: 0.4;
}

@keyframes how-line-dash {
  0% { transform: translateX(0); }
  100% { transform: translateX(-16px); }
}

.how-step {
  text-align: center;
  animation: fade-in-up 0.6s ease both;
}

.how-step:nth-child(1) { animation-delay: 0.05s; }
.how-step:nth-child(2) { animation-delay: 0.15s; }
.how-step:nth-child(3) { animation-delay: 0.25s; }

.how-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-text-inverse);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 14px rgba(124,58,237,0.3);
  animation: scale-in 0.5s ease both;
}

.how-step-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.how-step-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 300px;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .how-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .how-step-number {
    width: 48px;
    height: 48px;
    font-size: var(--text-lg);
  }
}

/* ====== Hero Scroll Indicator ====== */
.hero-scroll-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  font-family: var(--font-sans);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  opacity: 0.5;
}

.hero-scroll-indicator:hover {
  opacity: 0.8;
  background: var(--color-bg-alt);
}

.scroll-arrow {
  animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ====== Breadcrumb ====== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  padding: 11px 8px;
  display: inline-block;
  min-height: 44px;
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb-sep {
  color: var(--color-border);
}

/* ====== Keyboard Hint ====== */
.keyboard-hint {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  opacity: 0.6;
}

@media (max-width: 767px) {
  .keyboard-hint {
    display: none;
  }
}

/* ====== Review Summary ====== */
.review-summary {
  padding: var(--space-4);
}

.review-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.review-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.review-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.review-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.review-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.review-item:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-bg);
  transform: translateX(3px);
}

.review-item:active {
  transform: scale(0.98);
}

.review-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.review-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.review-question {
  font-size: var(--text-sm);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-answer {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
}

.review-edit {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.review-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (max-width: 767px) {
  .review-summary {
    padding: var(--space-2);
  }
  .review-list {
    max-height: 300px;
  }
}

/* ====== Recommend Section ====== */
.recommend-section {
  animation: fade-in-up 0.5s ease both;
}

.recommend-header {
  text-align: center;
  margin-bottom: var(--space-5);
}

.recommend-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.recommend-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.recommend-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.recommend-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 1px var(--color-primary-light), var(--shadow-glow);
  transform: translateY(-2px);
}

.recommend-card:active {
  transform: scale(0.97);
}

.recommend-card-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recommend-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}

.recommend-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

@media (max-width: 767px) {
  .recommend-grid {
    grid-template-columns: 1fr;
  }
}

/* ====== Share Card Preview Modal ====== */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fade-in 0.2s ease;
}

.share-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.share-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
  animation: scale-in 0.3s ease;
}

.share-modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  z-index: 1;
}

.share-modal-close:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.share-modal-header {
  text-align: center;
  margin-bottom: var(--space-5);
}

.share-modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.share-modal-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.share-card-preview {
  margin-bottom: var(--space-5);
}

/* === 增强版分享卡片 — 16Personalities/Truity 风格 === */
.share-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  position: relative;
}

/* 顶部渐变装饰条 */
.share-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa, #f59e0b);
  z-index: 2;
}

/* 背景装饰光晕 */
.share-card::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(124,58,237,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  z-index: 1;
}

.share-card-logo {
  font-weight: 800;
  font-size: var(--text-sm);
  color: #7c3aed;
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-card-logo::before {
  content: '🧠';
  font-size: 14px;
}

.share-card-testname {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  max-width: 180px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-card-body {
  padding: var(--space-5);
  position: relative;
  z-index: 1;
}

.share-card-score-section {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border-radius: 16px;
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

/* 分数区域的微光晕 */
.share-card-score-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 60%);
  pointer-events: none;
}

.share-card-icon {
  font-size: 2.5rem;
  display: block;
  line-height: 1;
}

.share-card-score {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.share-card-label {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.share-card-dims {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: 0 var(--space-1);
}

.share-card-dim {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1);
  align-items: center;
}

.share-card-dim-name {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.share-card-dim-score {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.share-card-dim-track {
  grid-column: 1 / -1;
  height: 5px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}

.share-card-dim-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.share-card-dim-score[data-level="low"] { color: #10b981 !important; }
.share-card-dim-score[data-level="moderate"] { color: #f59e0b !important; }
.share-card-dim-score[data-level="high"] { color: #ef4444 !important; }
.share-card-dim-fill[data-level="low"] { background: linear-gradient(90deg, #10b981, #6ee7b7) !important; }
.share-card-dim-fill[data-level="moderate"] { background: linear-gradient(90deg, #f59e0b, #fde68a) !important; }
.share-card-dim-fill[data-level="high"] { background: linear-gradient(90deg, #ef4444, #fca5a5) !important; }

.share-card-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  text-align: center;
  padding: 0 var(--space-2);
}

.share-card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid #f1f5f9;
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
}

.share-card-footer span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.share-card-footer span::before {
  content: '🧠';
  font-size: 10px;
}

.share-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.share-modal-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ====== Stat Badge (result stats row) ====== */
.result-stats-row {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  animation: fade-in-up 0.4s ease 0.6s both;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
}

.stat-badge-icon {
  font-size: 0.9em;
}

/* ====== Radar Chart ====== */
.radar-chart-wrap {
  text-align: center;
  margin: var(--space-6) 0;
  animation: fade-in-up 0.5s ease 0.3s both;
}

.radar-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.radar-svg {
  max-width: 260px;
  height: auto;
}

/* ====== Result Level Badge ====== */
#result-level-badge-container {
  margin-bottom: var(--space-4);
}

.result-level-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  animation: scale-in 0.4s ease 0.15s both;
}

.badge-level-icon {
  font-size: 1.1em;
  line-height: 1;
}

.result-level-badge.level-low {
  background: color-mix(in srgb, #10b981 15%, transparent);
  color: #10b981;
  border: 1px solid color-mix(in srgb, #10b981 30%, transparent);
}

.result-level-badge.level-moderate {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #f59e0b;
  border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
}

.result-level-badge.level-high {
  background: color-mix(in srgb, #ef4444 15%, transparent);
  color: #ef4444;
  border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
}

/* ====== Result Stats Row ====== */
.result-stats-row {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-4) 0;
  animation: fade-in-up 0.5s ease 0.3s both;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-light);
}

.stat-badge-icon {
  font-size: 1em;
  line-height: 1;
}

/* ====== Share this test section (test detail page) ====== */
.share-this-test {
  text-align: center;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.share-this-test h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.share-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ====== Copied state for share buttons ====== */
.share-btn.copied {
  background: color-mix(in srgb, #10b981 15%, transparent) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
  transform: scale(1.05);
}

/* ====== Test Detail Page Content ====== */
.test-content.card {
  max-width: var(--container-narrow);
  margin: 0 auto var(--space-8);
  padding: var(--space-8);
}

.test-description {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.test-description h2,
.test-description h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.test-description ul,
.test-description ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.test-body {
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.test-scoring,
.test-interpretation {
  margin-top: var(--space-6);
  padding: var(--space-5);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
}

.test-scoring h3,
.test-interpretation h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--color-primary);
}

.test-interpretation ul {
  margin: var(--space-3) 0;
  padding-left: var(--space-5);
}

.test-interpretation li {
  margin-bottom: var(--space-1);
  color: var(--color-text-secondary);
}

.test-cta {
  text-align: center;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.test-cta .btn {
  animation: cta-pulse 3s ease-in-out 1;
}

/* ====== Test Meta Bar ====== */
.test-meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.meta-item {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ====== Related Sections (test/article detail) ====== */
.related-section {
  max-width: var(--container-max);
  margin: var(--space-12) auto;
  padding: 0 var(--space-6);
}

.related-section .section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  text-align: center;
  display: block;
}

.related-section .section-title::after {
  display: none;
}

/* ====== Recommend Section (after test results) ====== */
.recommend-section {
  animation: fade-in-up 0.6s ease;
}

.recommend-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.recommend-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.recommend-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.recommend-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.recommend-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.recommend-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-glow);
  transform: translateX(4px);
}

.recommend-card:active {
  transform: scale(0.99);
}

.recommend-card-tag {
  display: inline-flex;
  padding: var(--space-1) var(--space-2);
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--tag-color, #7c3aed) 15%, transparent);
  color: var(--tag-color, #7c3aed);
  flex-shrink: 0;
}

.recommend-card-title {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.recommend-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ====== Breadcrumb ====== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-primary);
  font-weight: 500;
  transition: opacity var(--transition-fast);
  padding: 11px 8px;
  display: inline-block;
  min-height: 44px;
}

.breadcrumb a:hover {
  opacity: 0.8;
}

.breadcrumb-sep {
  color: var(--color-text-muted);
  opacity: 0.4;
}

/* ====== Article Meta Bar ====== */
.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.article-category {
  display: inline-flex;
  padding: var(--space-1) var(--space-2);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.article-date {
  font-weight: 500;
}

.article-read-time {
  font-weight: 500;
}

/* ====== Article Content Wrapper ====== */
.article-content.card {
  max-width: var(--container-narrow);
  margin: 0 auto var(--space-8);
  padding: var(--space-8);
  font-size: var(--text-base);
  line-height: 1.9;
  color: var(--color-text-secondary);
}

.article-content.card h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: var(--space-8) 0 var(--space-4);
  color: var(--color-text);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.article-content.card h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: var(--space-6) 0 var(--space-3);
  color: var(--color-text);
}

.article-content.card p {
  margin-bottom: var(--space-4);
}

.article-content.card ul,
.article-content.card ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.article-content.card li {
  margin-bottom: var(--space-2);
}

.article-content.card blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-bg);
  border-radius: var(--radius-md);
  font-style: italic;
}

.article-content.card img {
  border-radius: var(--radius-lg);
  margin: var(--space-6) auto;
}

.article-content.card code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
}

.article-content.card pre {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

.article-content.card pre code {
  background: none;
  padding: 0;
}

/* Article card excerpt */
.article-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.article-card .read-more {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  transition: gap var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.article-card:hover .read-more {
  gap: var(--space-2);
}

/* Article meta in listing */
.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ====== Result Gauge Container ====== */
.result-score-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-gauge {
  position: relative;
  width: 140px;
  height: 80px;
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.gauge-svg {
  width: 140px;
  height: 80px;
  transform: rotate(0deg) scale(1, -1);
  /* Scale Y to invert for the half-circle look */
}

.gauge-track {
  stroke: var(--color-bg-alt);
}

.gauge-glow {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.gauge-fill {
  stroke-linecap: round;
}

.gauge-center {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.gauge-center .result-score {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  animation: score-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

/* ====== Result Icon Crest (particle burst effect from wrapResultIconInCrest) ====== */
.result-icon-crest {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.result-icon-crest #result-icon {
  position: relative;
  z-index: 2;
}

.crest-particle-container {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.crest-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  animation: crest-burst 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes crest-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--px, 0), var(--py, 0)) scale(0.2);
  }
}

/* ====== Tablet adjustments ====== */
@media (max-width: 1023px) {
  .share-modal-content {
    max-width: 440px;
  }
}

/* ====== Mobile adjustments ====== */
@media (max-width: 767px) {
  .share-modal-content {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
  }

  .share-card {
    max-width: 100%;
  }

  .share-modal-actions {
    flex-direction: column;
  }

  .review-actions {
    flex-direction: column;
  }

  .review-actions .btn {
    width: 100%;
  }

  .test-content.card {
    padding: var(--space-5);
    margin-left: var(--space-4);
    margin-right: var(--space-4);
  }

  .article-content.card {
    padding: var(--space-5);
    margin-left: var(--space-4);
    margin-right: var(--space-4);
  }

  .recommend-card {
    padding: var(--space-3) var(--space-4);
  }

  .result-gauge {
    width: 120px;
    height: 68px;
  }

  .gauge-svg {
    width: 120px;
    height: 68px;
  }

  .gauge-center .result-score {
    font-size: var(--text-2xl);
  }

  .sticky-share-bar {
    padding: var(--space-2) var(--space-3);
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  }
}

/* ====== Category SVG Icons ====== */
.category-svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.test-card-emoji .category-svg {
  width: 24px;
  height: 24px;
}

.filter-emoji .category-svg {
  width: 16px;
  height: 16px;
}

.pill-emoji .category-svg {
  width: 18px;
  height: 18px;
}

/* Category-specific colors for test cards */
.test-card[data-category="personality"] .category-svg { color: #7c3aed; }
.test-card[data-category="emotion"] .category-svg { color: #ec4899; }
.test-card[data-category="anxiety"] .category-svg { color: #f59e0b; }
.test-card[data-category="relationships"] .category-svg { color: #ef4444; }
.test-card[data-category="thinking-patterns"] .category-svg { color: #3b82f6; }
.test-card[data-category="positive-psychology"] .category-svg { color: #f97316; }
.test-card[data-category="self-awareness"] .category-svg { color: #14b8a6; }
.test-card[data-category="sexual-psychology"] .category-svg { color: #a855f7; }
.test-card[data-category="sexual-health"] .category-svg { color: #e11d48; }
.test-card[data-category="comprehensive"] .category-svg { color: #6b7280; }
.test-card[data-category="sexual-orientation"] .category-svg { color: #8b5cf6; }
.test-card[data-category="cbt"] .category-svg { color: #10b981; }

/* ============================================
   Auth Page (Login/Signup) Styles
   ============================================ */
.auth-page {
  min-height: calc(100vh - var(--header-height) - 320px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8) var(--space-4) var(--space-16);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-lg);
  animation: fade-in-up 0.5s ease both;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-logo {
  display: block;
  margin-bottom: var(--space-4);
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Condensed form: tight spacing when providers come first */
.auth-form-condensed {
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.form-control {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: all var(--transition-fast);
  width: 100%;
}

.form-control::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.form-control:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.form-actions {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.auth-errors {
  background: color-mix(in srgb, var(--color-error) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-error) 20%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
}

.auth-error-text {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin: 0;
}

.field-errors {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-errors span {
  font-size: var(--text-xs);
  color: var(--color-error);
}

.form-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.4;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-divider span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
  padding: 0 var(--space-1);
}

.auth-providers {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.btn-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-provider:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-provider:active {
  transform: scale(0.98);
}

.provider-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.provider-icon svg {
  display: block;
}

.provider-label {
  line-height: 1;
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

.auth-footer p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.auth-footer a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  padding: 11px 0;
  display: inline-block;
  min-height: 44px;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-switch {
  margin-bottom: var(--space-2);
}

.auth-switch a {
  display: inline-block;
  padding: 11px 4px;
  min-height: 44px;
  line-height: 22px;
}

[data-theme="dark"] .auth-card {
  background: var(--color-bg-alt);
}

[data-theme="dark"] .form-control {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .form-control:focus {
  border-color: var(--color-primary-light);
}

[data-theme="dark"] .btn-provider {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

[data-theme="dark"] .btn-provider:hover {
  background: var(--color-surface);
  border-color: var(--color-text-muted);
}

@media (max-width: 767px) {
  .auth-page {
    padding: var(--space-6) var(--space-4) var(--space-24);
    align-items: stretch;
  }

  .auth-card {
    padding: var(--space-6) var(--space-5);
  }

  .auth-title {
    font-size: var(--text-xl);
  }
}

/* ====== Profile Page ====== */
.profile-page {
  padding: var(--space-12) var(--space-4);
  max-width: 800px;
  margin: 0 auto;
}

.profile-page .profile-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.profile-page .profile-section-danger {
  background: var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-error) 30%, transparent);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

[data-theme="dark"] .profile-page .profile-section {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

[data-theme="dark"] .profile-page .profile-section-danger {
  background: var(--color-bg-alt);
  border-color: color-mix(in srgb, var(--color-error) 40%, transparent);
}

.profile-page .profile-section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0 0 var(--space-1);
}

.profile-page .profile-section-subtitle {
  color: var(--color-text-muted);
  margin: 0;
}

.profile-page .profile-message {
  background: var(--color-success);
  color: var(--color-text-inverse);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

.profile-page .profile-info-card {
  padding: 0;
}

.profile-page .profile-info-card h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}

.profile-page .profile-info-card p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: var(--text-sm);
}

.profile-page .profile-info-card .profile-email {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.profile-page .profile-danger-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  color: var(--color-error);
}

.profile-page .profile-action {
  margin-top: var(--space-8);
}

.profile-page .btn-delete-data {
  background: none;
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.profile-page .btn-delete-data:hover {
  background: color-mix(in srgb, var(--color-error) 10%, transparent);
}

.profile-page .btn-delete-data:active {
  transform: scale(0.96);
}

.test-card[data-category="sexuality"] .category-svg { color: #f43f5e; }


/* ========== test.css ========== */
/* ====== Skeleton / Loading States ====== */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-bg-alt) 25%,
    color-mix(in srgb, var(--color-primary) 5%, var(--color-bg-alt)) 50%,
    var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  width: 100%;
  margin-bottom: var(--space-2);
}

.skeleton-text-short {
  height: 1em;
  width: 60%;
  margin-bottom: var(--space-2);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ====== Result Actions ====== */
.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-light);
}

.result-actions .share-buttons {
  justify-content: center;
}

/* ============================================
   Test Taking Page Styles
   ============================================ */

/* ====== Test Error State ====== */
.test-error {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--color-text-muted);
}

.test-error p {
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

/* ====== Result Level Badge Container ====== */
#result-level-badge-container {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ====== Test Intro ====== */
.test-intro {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Intro section for quiz */
.intro-icon {
  font-size: 3rem;
  display: block;
  text-align: center;
  margin-bottom: var(--space-4);
  animation: scale-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.intro-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-3);
}

.intro-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 480px;
  margin: 0 auto var(--space-4);
  line-height: 1.6;
}

.intro-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.meta-dot {
  color: var(--color-border);
  user-select: none;
}

/* ====== Recommend Section ====== */
/* ====== Test Info Grid ====== */
.test-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.test-info-item {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  animation: fade-in-up 0.5s ease both;
}

.test-info-item:nth-child(1) { animation-delay: 0.1s; }
.test-info-item:nth-child(2) { animation-delay: 0.2s; }
.test-info-item:nth-child(3) { animation-delay: 0.3s; }

.test-info-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.test-info-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.test-disclaimer {
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-warning) 10%, transparent);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ====== Test Taking ====== */
.test-taking {
  display: none;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.test-taking.is-active {
  display: block;
  /* fade-in used instead of fade-in-up — fade-in-up uses transform: translateY(24px)
     in its from keyframe, which creates a containing block for position:fixed
     descendants (e.g. .quiz-nav), causing it to be positioned relative to this
     transformed element instead of the viewport. See audit 2026-06-03. */
  animation: fade-in 0.4s ease both;
}

/* Progress bar */
.progress-container {
  margin-bottom: var(--space-8);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.progress-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  width: 0%;
}

/* Question */
.question-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Fade transition when switching questions */
.question-container.is-transitioning {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.question-number {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.question-text {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: var(--space-6);
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.option-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  animation: fade-in-up 0.35s ease both;
  position: relative;
}

/* Likert scale: horizontal bar layout */
.option-item.is-likert {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-3) var(--space-2);
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-md);
  border-width: 2px;
}

.option-item.is-likert .option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 28px;
  font-weight: 700;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.option-item.is-likert.is-selected .option-letter {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.option-item.is-likert .option-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

.option-item.is-likert:hover .option-letter {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
}

/* Likert scale color gradient hint - green (agree) to red (disagree) */
.option-item.is-likert[data-value="5"],
.option-item.is-likert[data-value="4"] {
  border-color: color-mix(in srgb, var(--color-success) 15%, var(--color-border));
}
.option-item.is-likert[data-value="5"]:hover,
.option-item.is-likert[data-value="4"]:hover {
  border-color: color-mix(in srgb, var(--color-success) 40%, var(--color-border));
  background: color-mix(in srgb, var(--color-success) 5%, transparent);
}
.option-item.is-likert[data-value="5"].is-selected,
.option-item.is-likert[data-value="4"].is-selected {
  border-color: var(--color-success);
  background: color-mix(in srgb, var(--color-success) 10%, transparent);
}
.option-item.is-likert[data-value="5"].is-selected .option-letter,
.option-item.is-likert[data-value="4"].is-selected .option-letter {
  background: var(--color-success);
  color: white;
}
.option-item.is-likert[data-value="1"],
.option-item.is-likert[data-value="2"] {
  border-color: color-mix(in srgb, var(--color-error) 15%, var(--color-border));
}
.option-item.is-likert[data-value="1"]:hover,
.option-item.is-likert[data-value="2"]:hover {
  border-color: color-mix(in srgb, var(--color-error) 40%, var(--color-border));
  background: color-mix(in srgb, var(--color-error) 5%, transparent);
}
.option-item.is-likert[data-value="1"].is-selected,
.option-item.is-likert[data-value="2"].is-selected {
  border-color: var(--color-error);
  background: color-mix(in srgb, var(--color-error) 10%, transparent);
}
.option-item.is-likert[data-value="1"].is-selected .option-letter,
.option-item.is-likert[data-value="2"].is-selected .option-letter {
  background: var(--color-error);
  color: white;
}

.option-item.is-likert.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.options-list.is-likert-grid {
  display: flex;
  flex-direction: row;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}

.option-item:nth-child(1) { animation-delay: 0.05s; }
.option-item:nth-child(2) { animation-delay: 0.10s; }
.option-item:nth-child(3) { animation-delay: 0.15s; }
.option-item:nth-child(4) { animation-delay: 0.20s; }
.option-item:nth-child(5) { animation-delay: 0.25s; }
.option-item:nth-child(6) { animation-delay: 0.30s; }
.option-item:nth-child(7) { animation-delay: 0.35s; }

.option-item:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-bg);
}

.option-item:active {
  transform: scale(0.98);
}

/* Tap ripple effect on option cards */
.option-item {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.option-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--tap-x, 50%) var(--tap-y, 50%), 
    color-mix(in srgb, var(--color-primary) 15%, transparent) 0%, 
    transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.option-item:active::after {
  opacity: 1;
}

.option-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.option-item.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.option-item.is-selected .option-label {
  color: var(--color-primary);
  font-weight: 600;
}

.option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.option-item.is-selected .option-radio {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  transform: scale(0);
  transition: transform var(--transition-fast);
}

.option-item.is-selected .option-radio::after {
  transform: scale(1);
}

.option-label {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
  transition: color var(--transition-fast), font-weight var(--transition-fast);
}

/* Standard (non-Likert) option body — label + shortcut hint side by side */
.option-body {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

/* Keyboard shortcut number badge */
.option-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-border-light);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.option-item.is-selected .option-shortcut {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
}

/* Navigation buttons — desktop: inline */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.quiz-nav .btn {
  min-width: 120px;
}

.question-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-bg);
  border: 1px solid var(--color-primary-lighter);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ====== Test Results ====== */
.test-results {
  display: none;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.test-results.is-active {
  display: block;
  animation: result-reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ====== Result Header with Visual Type Crest ====== */
.result-header {
  text-align: center;
  margin-bottom: var(--space-8);
  position: relative;
  padding: var(--space-6) var(--space-4);
  border-radius: var(--radius-2xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: background var(--transition-base), border-color var(--transition-base);
}

/* Particle burst behind crest on result reveal */
.result-header .crest-particle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 0;
  pointer-events: none;
}

.result-header .crest-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--result-color, var(--color-primary));
  opacity: 0;
  animation: crest-particle-burst 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes crest-particle-burst {
  0% {
    opacity: 0.8;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--px, 80px), var(--py, -80px)) scale(0);
  }
}

/* Quick share button in result header */
.result-header-share {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.result-header-share:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  transform: scale(1.1);
}

/* Quick-share button inside result header — always visible pill-style */
.result-header-share-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(124,58,237,0.3);
  position: relative;
  z-index: 1;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

.result-header-share-quick:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.4);
}

.result-header-share-quick:active {
  transform: scale(0.96);
}

.result-header-share-quick svg {
  flex-shrink: 0;
}

.result-header-share:active {
  transform: scale(0.92);
}

[data-theme="dark"] .result-header-share {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

[data-theme="dark"] .result-header-share:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-light);
  color: var(--color-primary-light);
}

/* Animated gradient orb in background */
.result-header::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--result-color, var(--color-primary)) 12%, transparent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: result-orb-float 8s ease-in-out infinite;
}

.result-header::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--result-color, var(--color-primary-light)) 8%, transparent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: result-orb-float 10s ease-in-out infinite reverse;
}

@keyframes result-orb-float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(10px, -10px); }
  66% { transform: translate(-5px, 8px); }
}

/* Result icon — large emoji display with crest background */
#result-icon {
  font-size: 3.5rem;
  display: block;
  line-height: 1;
  margin-bottom: var(--space-3);
  position: relative;
  z-index: 1;
  animation: score-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

/* Large visual crest/badge behind the result icon — like 16Personalities */
.result-icon-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto var(--space-3);
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at 35% 35%, 
    color-mix(in srgb, var(--result-color, var(--color-primary)) 20%, transparent) 0%,
    color-mix(in srgb, var(--result-color, var(--color-primary)) 8%, transparent) 100%);
  border: 3px solid color-mix(in srgb, var(--result-color, var(--color-primary)) 25%, transparent);
  animation: crest-pop-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
  box-shadow: 0 0 30px color-mix(in srgb, var(--result-color, var(--color-primary)) 15%, transparent);
}

.result-icon-crest::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--result-color, var(--color-primary)) 15%, transparent);
  animation: crest-rotate 30s linear infinite;
  pointer-events: none;
}

.result-icon-crest::after {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, 
    color-mix(in srgb, var(--result-color, var(--color-primary)) 6%, transparent) 0%,
    transparent 60%);
  pointer-events: none;
  animation: crest-pulse 4s ease-in-out infinite;
}

.result-icon-crest #result-icon {
  font-size: 2.8rem;
  margin-bottom: 0;
  animation: score-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes crest-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-15deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.1) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes crest-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes crest-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Result score with color coding */
.result-score {
  font-size: var(--text-5xl);
  font-weight: 800;
  color: var(--result-color, var(--color-primary));
  line-height: 1;
  margin-bottom: var(--space-1);
  position: relative;
  z-index: 1;
  animation: score-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes score-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Result label — bold type name */
.result-label {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--result-color, var(--color-text));
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
}

/* Result description */
.result-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.result-breakdown {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.result-dimension {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--transition-base);
}

.result-dimension:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.dimension-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.dimension-name {
  font-weight: 700;
  font-size: var(--text-base);
}

.dimension-score {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  min-width: 36px;
  text-align: right;
}

/* Semantic color coding for dimension scores via data-level attribute */
.dimension-bar-fill[data-level="low"] {
  background: linear-gradient(90deg, #059669, #34d399, #6ee7b7);
}

.dimension-bar-fill[data-level="moderate"] {
  background: linear-gradient(90deg, #d97706, #f59e0b, #fde68a);
}

.dimension-bar-fill[data-level="high"] {
  background: linear-gradient(90deg, #dc2626, #ef4444, #fca5a5);
}

.dimension-score[data-level="low"] {
  color: var(--color-success) !important;
}

.dimension-score[data-level="moderate"] {
  color: #d97706 !important;
}

.dimension-score[data-level="high"] {
  color: var(--color-error) !important;
}

.dimension-bar-track {
  width: 100%;
  height: 6px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.dimension-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%;
  position: relative;
  overflow: hidden;
}

/* Animated shimmer overlay on dimension bars */
.dimension-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.15) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: shimmer-slide 2.5s ease-in-out infinite;
  pointer-events: none;
  border-radius: var(--radius-full);
}

@keyframes shimmer-slide {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dark mode shimmer is a bit brighter */
[data-theme="dark"] .dimension-bar-fill::after {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.08) 50%,
    transparent 100%);
  background-size: 200% 100%;
}

/* Animate dimension bars when they scroll into view — JS adds .is-animated */
.dimension-bar-fill.is-animated {
  width: var(--bar-width, 0%);
}

.dimension-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ====== Result Dimension Staggered Entrance ====== */
.result-breakdown > .result-dimension {
  animation: fade-in-up 0.5s ease both;
}

.result-breakdown > .result-dimension:nth-child(1) { animation-delay: 0.05s; }
.result-breakdown > .result-dimension:nth-child(2) { animation-delay: 0.15s; }
.result-breakdown > .result-dimension:nth-child(3) { animation-delay: 0.25s; }
.result-breakdown > .result-dimension:nth-child(4) { animation-delay: 0.35s; }
.result-breakdown > .result-dimension:nth-child(5) { animation-delay: 0.45s; }

.result-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

/* ====== Skeleton Loading ====== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-border) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
  width: 100%;
}

.skeleton-text-short {
  width: 60%;
}

.skeleton-block {
  height: 80px;
  width: 100%;
}

/* Skeleton result dimension (matches .result-dimension layout) */
.skeleton-dimension {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.skeleton-dimension .skeleton-text {
  height: 1.2em;
  width: 40%;
  margin-bottom: var(--space-3);
}

.skeleton-dimension .skeleton-block {
  height: 6px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-2);
}

.skeleton-dimension .skeleton-text:last-child {
  width: 80%;
  height: 0.9em;
}

/* ====== Utility ====== */
.text-center {
  text-align: center;
}
.mt-8 {
  margin-top: var(--space-8);
}

/* mt-8 is used globally, need to verify before removing */

/* ====== Result Share Buttons (mobile) ====== */
.confetti-piece:nth-child(9) { left: 90%; background: #7c3aed; animation-delay: 0.18s; animation-duration: 2.6s; }
.confetti-piece:nth-child(10) { left: 15%; background: #34d399; animation-delay: 0.25s; animation-duration: 3.0s; }

/* Dark mode confetti adjusted */
[data-theme="dark"] .confetti-piece {
  opacity: 0.7;
}

/* ====== Responsive ====== */
@media (max-width: 767px) {
  .test-info-grid {
    grid-template-columns: 1fr;
  }

  .question-container {
    padding: var(--space-5);
  }

  .question-text {
    font-size: var(--text-lg);
  }

  /* Mobile: sticky bottom nav bar for quiz */
  .quiz-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-3));
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  }

  /* On test pages: quiz nav sits ABOVE the mobile bottom nav */
  body.has-test-page .quiz-nav {
    bottom: 60px;
    padding-bottom: var(--space-3);
    z-index: 100;
  }

  [data-theme="dark"] .quiz-nav {
    background: var(--color-surface);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  }

  .quiz-nav .btn {
    flex: 1;
    max-width: 160px;
    min-width: unset;
    height: 48px;
    font-size: var(--text-sm);
    justify-content: center;
  }

  .question-counter {
    flex-shrink: 0;
  }

  /* Vertical options (non-Likert): scrollable on mobile so Next button stays visible */
  .options-list {
    max-height: 55vh;
    overflow-y: auto;
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  /* Add bottom padding to question container so content isn't hidden behind sticky nav */
  .question-container {
    margin-bottom: calc(280px + var(--space-8));
  }

  /* Quiz nav on mobile: transparent to clicks so options below are tappable */
  body.has-test-page .quiz-nav {
    pointer-events: none;
  }
  body.has-test-page .quiz-nav * {
    pointer-events: auto;
  }

  /* Likert options: vertical stacked layout on mobile */
  .options-list.is-likert-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    overflow-y: auto;
    max-height: 55vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
  }

  .option-item.is-likert {
    flex: none;
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
    border-width: 2.5px;
    justify-content: flex-start;
    -webkit-tap-highlight-color: transparent;
  }

  .option-item.is-likert .option-label {
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    word-break: break-word;
  }

  .option-item.is-likert .option-letter {
    width: 32px;
    height: 32px;
    font-size: var(--text-sm);
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .option-item.is-likert:active {
    transform: scale(0.98);
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
  }

  /* Likert scale color gradient hint - warm (agree) to cool (disagree) */
  .option-item.is-likert[data-value="5"],
  .option-item.is-likert[data-value="4"] {
    border-color: color-mix(in srgb, var(--color-success) 20%, var(--color-border));
  }
  .option-item.is-likert[data-value="5"].is-selected,
  .option-item.is-likert[data-value="4"].is-selected {
    border-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 8%, transparent);
  }
  .option-item.is-likert[data-value="1"],
  .option-item.is-likert[data-value="2"] {
    border-color: color-mix(in srgb, var(--color-error) 20%, var(--color-border));
  }
  .option-item.is-likert[data-value="1"].is-selected,
  .option-item.is-likert[data-value="2"].is-selected {
    border-color: var(--color-error);
    background: color-mix(in srgb, var(--color-error) 8%, transparent);
  }

  /* Timer: slightly larger for mobile readability */
  .timer-display {
    font-size: 13px;
  }

  .result-score {
    font-size: var(--text-4xl);
  }

  .result-header {
    padding: var(--space-4) var(--space-3);
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Slightly smaller crest on mobile */
  .result-icon-crest {
    width: 80px;
    height: 80px;
  }

  .result-icon-crest::before {
    inset: -6px;
  }

  .result-icon-crest::after {
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
  }

  .result-icon-crest #result-icon {
    font-size: 2.2rem;
  }

  /* Share quick pill — full width on mobile for easier tap */
  .result-header-share-quick {
    width: 100%;
    max-width: 280px;
    padding: var(--space-3) var(--space-5);
  }

  .result-actions {
    flex-direction: column;
    align-items: center;
  }

  .result-actions .btn {
    width: 100%;
    max-width: 320px;
  }

  /* Mobile share buttons: larger touch targets */
  .share-buttons {
    gap: var(--space-2);
    justify-content: center;
  }

  .share-btn {
    min-width: 56px;
    padding: var(--space-2) var(--space-2);
    height: 56px;
  }

  .share-btn-label {
    font-size: 10px;
  }

  /* Make the native share button more prominent */
  .share-btn-native {
    background: var(--color-primary-bg);
    border-color: var(--color-primary-light);
    min-width: 64px;
  }

  .result-description {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
  }

  /* Mobile: compact result section - maximize visible dimension scores */
  .result-header {
    margin-bottom: var(--space-4);
  }

  .result-gauge {
    width: 100px;
    height: 56px;
    margin-bottom: var(--space-2);
  }

  .gauge-svg {
    width: 100px;
    height: 56px;
  }

  .gauge-center .result-score {
    font-size: var(--text-xl);
  }

  .radar-chart-wrap {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .radar-title {
    font-size: var(--text-base);
    margin-bottom: var(--space-2);
  }

  .radar-svg {
    width: 200px;
    height: 200px;
  }

  .result-dimension {
    padding: var(--space-3);
  }

  /* Stepper dots on mobile */
  .question-stepper {
    gap: var(--space-1);
    padding: var(--space-1) 0;
    margin-bottom: var(--space-4);
  }

  .stepper-dot {
    width: 8px;
    min-width: 8px;
    height: 8px;
  }

  /* Celebration on mobile */
  .test-celebration {
    padding: var(--space-8) var(--space-4);
  }
  .celebration-icon {
    font-size: 3rem;
  }
  .celebration-text {
    font-size: var(--text-xl);
  }
}

/* ============================================
   Radar Chart — SVG-based dimension overview
   ============================================ */
.radar-chart-wrap {
  text-align: center;
  margin-bottom: var(--space-8);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.radar-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.radar-svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: 280px;
  height: 280px;
}

@media (min-width: 768px) {
  .radar-svg {
    width: 320px;
    height: 320px;
  }
}

/* ====== Share Button Colors ====== */
.share-btn-twitter {
  color: #000000 !important;
}
.share-btn-twitter:hover {
  background: color-mix(in srgb, #000000 8%, transparent) !important;
  border-color: #000000 !important;
  color: #000000 !important;
}

.share-btn-telegram {
  color: #0088cc !important;
}
.share-btn-telegram:hover {
  background: color-mix(in srgb, #0088cc 12%, transparent) !important;
  border-color: #0088cc !important;
  color: #0088cc !important;
}

.share-btn-whatsapp {
  color: #25D366 !important;
}
.share-btn-whatsapp:hover {
  background: color-mix(in srgb, #25D366 12%, transparent) !important;
  border-color: #25D366 !important;
  color: #25D366 !important;
}

.share-btn-wechat {
  color: #07C160 !important;
}
.share-btn-wechat:hover {
  background: color-mix(in srgb, #07C160 12%, transparent) !important;
  border-color: #07C160 !important;
  color: #07C160 !important;
}

/* Copied state for share buttons — brief green flash */
.share-btn.copied,
.btn-icon-only.copied {
  border-color: var(--color-success) !important;
  background: color-mix(in srgb, var(--color-success) 12%, transparent) !important;
  color: var(--color-success) !important;
  animation: share-copied-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes share-copied-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.share-btn.copied .share-btn-label {
  font-weight: 800;
}

/* Dark mode share button adjustments */
[data-theme="dark"] .share-btn-twitter {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .share-btn-twitter:hover {
  background: color-mix(in srgb, #e2e8f0 10%, transparent) !important;
  border-color: #e2e8f0 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .share-btn-telegram {
  color: #60a5fa !important;
}
[data-theme="dark"] .share-btn-telegram:hover {
  background: color-mix(in srgb, #60a5fa 10%, transparent) !important;
  border-color: #60a5fa !important;
  color: #60a5fa !important;
}
[data-theme="dark"] .share-btn-whatsapp {
  color: #6ee7b7 !important;
}
[data-theme="dark"] .share-btn-whatsapp:hover {
  background: color-mix(in srgb, #6ee7b7 10%, transparent) !important;
  border-color: #6ee7b7 !important;
  color: #6ee7b7 !important;
}
[data-theme="dark"] .share-btn-wechat {
  color: #34d399 !important;
}
[data-theme="dark"] .share-btn-wechat:hover {
  background: color-mix(in srgb, #34d399 10%, transparent) !important;
  border-color: #34d399 !important;
  color: #34d399 !important;
}

/* Mobile: compact share bar icons */
@media (max-width: 500px) {
  .sticky-share-inner {
    gap: var(--space-1);
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sticky-share-inner::-webkit-scrollbar {
    display: none;
  }
  .sticky-share-inner .btn {
    font-size: 0;
    padding: var(--space-2) var(--space-3);
    min-width: 0;
    min-height: 44px;
    flex: 0 0 auto;
  }
  .sticky-share-inner .btn svg {
    font-size: initial;
  }
  .sticky-share-inner .btn span {
    display: none;
  }
  .sticky-share-inner .btn-icon-only {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
}

/* Sticky Share Bar keyframes — base styles in components.css */
@keyframes share-bar-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes share-btn-pulse {
  0%, 100% {
    box-shadow: 0 4px 14px rgb(124 58 237 / 0.3);
  }
  50% {
    box-shadow: 0 4px 24px rgb(124 58 237 / 0.55), 0 0 0 4px rgb(124 58 237 / 0.12);
  }
}

/* Share bar animation triggers — overrides components.css defaults */
.sticky-share-bar.is-visible {
  animation: share-bar-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sticky-share-bar.is-visible .btn-primary {
  animation: share-btn-pulse 2s ease-in-out 2;
}

/* ====== Result Gauge (SVG speedometer) ====== */
.result-gauge {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto var(--space-3);
  z-index: 1;
}

@media (min-width: 768px) {
  .result-gauge {
    width: 160px;
    height: 160px;
  }
}

.gauge-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  stroke: var(--color-bg-alt);
  opacity: 0.5;
}

.gauge-fill {
  stroke: var(--result-color, var(--color-primary));
  transition: stroke-dashoffset 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--result-color, var(--color-primary)) 0.4, transparent));
}

.gauge-glow {
  stroke: var(--result-color, var(--color-primary));
  opacity: 0.15;
  filter: blur(4px);
  transition: stroke-dashoffset 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .gauge-track {
  stroke: var(--color-border);
  opacity: 0.4;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(0deg); /* Counter-rotate from SVG */
}

/* Result score inside gauge */
.gauge-center .result-score {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--result-color, var(--color-primary));
  line-height: 1;
  margin-bottom: 0;
  animation: score-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@media (min-width: 768px) {
  .gauge-center .result-score {
    font-size: var(--text-5xl);
  }
}

/* ====== Question Stepper Dots ====== */
.question-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.question-stepper::-webkit-scrollbar {
  display: none;
}

.stepper-dot {
  display: block;
  min-width: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.stepper-dot.is-active {
  width: 28px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
  transform: none;
}

.stepper-dot.is-completed {
  background: var(--color-primary-lighter);
}

/* Stepper dot sizing for long tests */
.question-stepper[data-count="large"] .stepper-dot {
  min-width: 8px;
  width: 8px;
  height: 8px;
}

.question-stepper[data-count="large"] .stepper-dot.is-active {
  width: 22px;
  transform: none;
}

.question-stepper[data-count="xlarge"] .stepper-dot {
  min-width: 6px;
  width: 6px;
  height: 6px;
}

.question-stepper[data-count="xlarge"] .stepper-dot.is-active {
  width: 18px;
  transform: none;
}

/* ====== Test Error State ====== */
.test-error {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-error);
}

.test-error p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

/* ====== No Items Empty State ====== */
.no-items {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-muted);
}

/* ====== Test Badge Featured ====== */
.test-badge-featured {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  margin-right: var(--space-1);
}
.result-level-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: var(--space-2);
  animation: scale-in 0.4s ease 0.15s both;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.result-level-badge.level-low {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-success) 18%, transparent), transparent);
  color: var(--color-success);
  border: 1.5px solid color-mix(in srgb, var(--color-success) 35%, transparent);
  box-shadow: 0 2px 12px rgba(16,185,129,0.15);
}

.result-level-badge.level-moderate {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-warning) 18%, transparent), transparent);
  color: #d97706;
  border: 1.5px solid color-mix(in srgb, var(--color-warning) 35%, transparent);
  box-shadow: 0 2px 12px rgba(245,158,11,0.15);
}

.result-level-badge.level-high {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-error) 18%, transparent), transparent);
  color: var(--color-error);
  border: 1.5px solid color-mix(in srgb, var(--color-error) 35%, transparent);
  box-shadow: 0 2px 12px rgba(239,68,68,0.15);
}

.badge-level-icon {
  font-size: 1.3em;
  line-height: 1;
}

/* ====== Result Stats Row ====== */
.result-stats-row {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.stat-badge-icon {
  font-size: 0.85em;
}

/* ====== Test Intro Section ====== */
.test-intro {
  text-align: center;
  padding: var(--space-8) 0;
}

.intro-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.intro-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
}

.intro-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 400px;
  margin: 0 auto var(--space-6);
  line-height: 1.6;
}

.intro-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.meta-dot {
  color: var(--color-border);
}

/* ====== Quiz Progress Top ====== */
.quiz-progress-top {
  margin-bottom: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-bg);
  padding-top: var(--space-3);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.progress-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.timer-display {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* ====== Keyboard Hint ====== */
.keyboard-hint {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

/* ====== Review Summary ====== */
.review-summary {
  animation: fade-in-up 0.4s ease both;
}

.review-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.review-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.review-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.review-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: var(--space-6);
}

.review-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.review-item:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-lighter);
}

.review-item:active {
  transform: scale(0.98);
}

.review-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.review-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.review-question {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-answer {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
}

.review-edit {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.review-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.review-actions .btn {
  min-width: 140px;
}

/* ====== Recommend Section ====== */
.recommend-section {
  padding: 0 var(--space-4);
  margin: var(--space-6) auto;
  max-width: 640px;
}

.recommend-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.recommend-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.recommend-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.recommend-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.recommend-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  padding-left: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

/* Color accent bar on left */
.recommend-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-3);
  bottom: var(--space-3);
  width: 3px;
  background: var(--tag-color, var(--color-primary));
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.recommend-card:hover::before {
  opacity: 1;
}

.recommend-card:hover {
  border-color: var(--tag-color, var(--color-primary-light));
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.recommend-card-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--tag-color, var(--color-primary));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recommend-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}

.recommend-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ====== Share Card Modal ====== */
@keyframes share-modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.share-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.share-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: share-modal-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  z-index: 1;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.share-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.share-modal-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.share-modal-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.share-modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.share-modal-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.share-card-preview {
  margin-bottom: var(--space-6);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.share-card {
  background: var(--color-surface);
  width: 100%;
  overflow: hidden;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #4f46e5 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.share-card-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(167,139,250,0.3) 0%, transparent 60%);
  pointer-events: none;
}

.share-card-logo {
  font-weight: 800;
  font-size: var(--text-sm);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.share-card-testname {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.7);
  position: relative;
  z-index: 1;
  font-weight: 500;
}

.share-card-body {
  padding: var(--space-5);
}

.share-card-score-section {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
  position: relative;
  overflow: hidden;
}

.share-card-score-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.4) 0%, transparent 60%);
  pointer-events: none;
}

.share-card-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-3);
  position: relative;
  z-index: 1;
}

.share-card-score {
  font-size: 3rem;
  font-weight: 900;
  display: block;
  line-height: 1;
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.share-card-label {
  font-size: var(--text-lg);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.share-card-dims {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.share-card-dim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.share-card-dim-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  width: 80px;
  flex-shrink: 0;
}

.share-card-dim-score {
  font-size: var(--text-xs);
  font-weight: 700;
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.share-card-dim-track {
  flex: 1;
  height: 5px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 60px;
}

.share-card-dim-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.share-card-dim-fill[data-level="low"] {
  background: linear-gradient(90deg, #059669, #34d399);
}

.share-card-dim-fill[data-level="moderate"] {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.share-card-dim-fill[data-level="high"] {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.share-card-dim-score[data-level="low"] {
  color: #059669 !important;
}

.share-card-dim-score[data-level="moderate"] {
  color: #d97706 !important;
}

.share-card-dim-score[data-level="high"] {
  color: #dc2626 !important;
}

.share-card-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.share-card-footer {
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #4f46e5 100%);
  display: flex;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.share-card-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(167,139,250,0.25) 0%, transparent 50%);
  pointer-events: none;
}

.share-card-footer span {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.03em;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.share-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.share-modal-actions .btn {
  width: 100%;
  justify-content: center;
}

.share-modal-wechat-hint {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0;
  line-height: 1.5;
}

/* ====== Share Result FAB (Floating Action Button) ====== */
.share-fab {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  right: var(--space-4);
  z-index: 95;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgb(124 58 237 / 0.4);
  transform: scale(0) rotate(-45deg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

/* On test pages, mobile bottom nav is hidden, so FAB can sit lower */
body.has-test-page .share-fab {
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.share-fab.is-visible {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  pointer-events: auto;
  animation: share-fab-pulse 1.5s ease-in-out 0.5s;
}

@keyframes share-fab-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgb(124 58 237 / 0.4); }
  50% { box-shadow: 0 4px 24px rgb(124 58 237 / 0.7), 0 0 40px rgb(124 58 237 / 0.3); }
}

.share-fab:active {
  transform: scale(0.92) !important;
}

.share-fab:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 6px 24px rgb(124 58 237 / 0.5);
  transform: scale(1.08);
}

.share-fab-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.share-fab:hover .share-fab-tooltip {
  opacity: 1;
}

[data-theme="dark"] .share-fab-tooltip {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

/* ====== Result Reveal Enhanced Animations ====== */
@keyframes result-reveal {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95) translateY(20px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0);
  }
}


/* ====== Share Card Polished Design — Premium Style ====== */
.share-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  font-family: var(--font-sans);
}

/* Dark mode share card: used for in-app preview, not exported */
[data-theme="dark"] .share-card {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ====== Share Card Header with decorative pattern ====== */
.share-card-header {
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #4f46e5 100%);
  color: white;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
}

/* Decorative floating circles */
.share-card-header::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -10%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,0.25) 0%, transparent 60%);
  pointer-events: none;
}

.share-card-header::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -5%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,181,253,0.15) 0%, transparent 55%);
  pointer-events: none;
}

/* ====== Share Card Body ====== */
.share-card-body {
  padding: var(--space-5);
  background: #ffffff;
}

/* ====== Score Section with Glow Background ====== */
.share-card-score-section {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
  position: relative;
  overflow: hidden;
}

.share-card-score-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.5) 0%, transparent 60%);
  pointer-events: none;
}

.share-card-score-section[data-level="low"] {
  background: #ecfdf5;
}
.share-card-score-section[data-level="low"] .share-card-score,
.share-card-score-section[data-level="low"] .share-card-label {
  color: #059669 !important;
}
.share-card-score-section[data-level="moderate"] {
  background: #fffbeb;
}
.share-card-score-section[data-level="moderate"] .share-card-score,
.share-card-score-section[data-level="moderate"] .share-card-label {
  color: #d97706 !important;
}
.share-card-score-section[data-level="high"] {
  background: #fef2f2;
}
.share-card-score-section[data-level="high"] .share-card-score,
.share-card-score-section[data-level="high"] .share-card-label {
  color: #dc2626 !important;
}

.share-card-score-section[data-level] .share-card-score,
.share-card-score-section[data-level] .share-card-label {
  position: relative;
  z-index: 1;
}

.share-card-icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
  line-height: 1;
}

.share-card-score {
  font-size: 3.2rem;
  font-weight: 900;
  display: block;
  line-height: 1;
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
  letter-spacing: -0.03em;
}

.share-card-label {
  font-size: var(--text-lg);
  font-weight: 700;
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}

/* ====== Dimension Bars in Share Card ====== */
.share-card-dims {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.share-card-dim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.share-card-dim-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: #475569;
  width: 80px;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.share-card-dim-score {
  font-size: var(--text-xs);
  font-weight: 700;
  width: 42px;
  text-align: right;
  flex-shrink: 0;
}

.share-card-dim-track {
  flex: 1;
  height: 6px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 60px;
}

.share-card-dim-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.share-card-dim-fill[data-level="low"] {
  background: linear-gradient(90deg, #059669, #34d399);
}

.share-card-dim-fill[data-level="moderate"] {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.share-card-dim-fill[data-level="high"] {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.share-card-dim-score[data-level="low"] {
  color: #059669 !important;
}

.share-card-dim-score[data-level="moderate"] {
  color: #d97706 !important;
}

.share-card-dim-score[data-level="high"] {
  color: #dc2626 !important;
}

.share-card-desc {
  font-size: var(--text-xs);
  color: #64748b;
  line-height: 1.6;
  text-align: center;
  padding: 0 var(--space-2);
}

/* ====== Share Card Footer ====== */
.share-card-footer {
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #4f46e5 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 30px;
}

.share-card-footer::before {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -5%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,0.2) 0%, transparent 55%);
  pointer-events: none;
}

.share-card-footer span {
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.03em;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ====== Share Link Preview Card (for Open Graph) ====== */
.share-preview-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  max-width: 400px;
  margin: var(--space-4) auto;
  transition: all var(--transition-fast);
}

.share-preview-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-glow);
}

.share-preview-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  border-radius: var(--radius-lg);
}

.share-preview-text {
  flex: 1;
  min-width: 0;
}

.share-preview-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-preview-url {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====== Scroll-to-top after results ====== */
.result-scroll-anchor {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

/* ====== Mobile Page Header Responsive ====== */
@media (max-width: 767px) {
  .page-header {
    padding: var(--space-8) var(--space-4) var(--space-5);
  }
  .page-title {
    font-size: var(--text-3xl);
  }
  .page-subtitle {
    font-size: var(--text-base);
  }
  .breadcrumb {
    font-size: var(--text-xs);
    gap: var(--space-1);
  }

  .share-fab {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: var(--space-3);
    width: 50px;
    height: 50px;
  }

  .share-fab-tooltip {
    display: none;
  }
}

/* ====== Lightweight scrollbar for test container ====== */
.test-container.card::-webkit-scrollbar {
  width: 4px;
}

.test-container.card::-webkit-scrollbar-track {
  background: transparent;
}

.test-container.card::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

/* ====== Question validation ====== */
.q-validate-shake {
  animation: qshake 0.5s ease-in-out;
}
@keyframes qshake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.q-validate-hint {
  text-align: center;
  color: var(--color-error);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: color-mix(in srgb, var(--color-error) 10%, transparent);
  border-radius: var(--radius-md);
  animation: hint-fade 3s ease forwards;
}
@keyframes hint-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
/* Page entrance handled by staggered card animations in base.css */

/* ====== Floating share URL input (inline copy) ====== */
.inline-share-url {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-top: var(--space-3);
}

.inline-share-url input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  outline: none;
  padding: var(--space-1) 0;
}

.inline-share-url button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.inline-share-url button:hover {
  background: var(--color-primary-hover);
}

.inline-share-url button:active {
  transform: scale(0.96);
}

/* ====== Share Guide Toast ====== */
.share-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.share-guide-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.share-guide-toast {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, rgba(124,58,237,0.97), rgba(91,33,182,0.97));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px 24px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(124,58,237,0.25);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.share-guide-toast.is-visible {
  transform: translateY(0);
}

.share-guide-text {
  color: white;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}
.share-guide-sub {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 2px;
}

.share-guide-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.share-guide-btn {
  white-space: nowrap;
  background: white;
  color: #7c3aed;
  border: none;
  border-radius: 30px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.share-guide-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.share-guide-btn:active {
  transform: scale(0.97);
}

.share-guide-close {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.share-guide-close:hover {
  background: rgba(255,255,255,0.25);
}

/* Dark mode */
[data-theme="dark"] .share-guide-toast {
  background: linear-gradient(135deg, rgba(91,33,182,0.98), rgba(76,29,149,0.98));
}
[data-theme="dark"] .share-guide-overlay {
  background: rgba(0,0,0,0.3);
}

/* ====== Confetti Animation (test completion celebration) ====== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9997;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ====== Review Summary (before final submission) ====== */
.review-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  animation: fade-in-up 0.4s ease both;
}
.review-header {
  text-align: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}
.review-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-2);
}
.review-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}
.review-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}
.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  max-height: 50vh;
  overflow-y: auto;
}
.review-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.review-item:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-bg);
}
.review-item:active {
  transform: scale(0.98);
}
.review-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.review-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.review-question {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-answer {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
}
.review-edit {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}
.review-item:hover .review-edit {
  color: var(--color-primary);
}
.review-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}
.review-actions .btn {
  width: 100%;
  justify-content: center;
}
