/* ============================================
   心理测评 SPA - Apple Design Language
   Premium Mobile-First Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ================================================
     色彩系统 — 莫兰迪暖灰
     低饱和 · 高级感 · 温暖疗愈
     ================================================ */

  /* Primary — 雾蓝，沉稳专业 */
  --primary: #5b7fc7;
  --primary-light: #7a9ad4;
  --primary-dark: #4a6bb3;
  --primary-ultra-light: rgba(91,127,199,0.06);

  /* Accent — 藤紫，柔和点缀 */
  --accent: #8b7bae;
  --accent-warm: #a89bc4;

  /* 渐变色 — 同色系过渡，不跳跃 */
  --gradient-start: #4a6bb3;
  --gradient-mid: #6b82bf;
  --gradient-end: #8b7bae;

  /* Neutral — 暖灰体系，不冰冷 */
  --bg: #f7f6f3;
  --bg-secondary: #f0eeeb;
  --card-bg: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #636366;
  --text-light: #8e8e93;
  --text-ultra-light: #c7c7cc;
  --border: #e5e4e0;
  --border-light: #f2f1ee;

  /* Semantic */
  --success: #6b9e7a;
  --warning: #c49e6c;
  --error: #b07a7a;

  /* Shadows — 暖色系阴影 */
  --shadow-xs: 0 1px 2px rgba(60,54,44,0.04);
  --shadow-sm: 0 1px 3px rgba(60,54,44,0.06), 0 1px 2px rgba(60,54,44,0.03);
  --shadow-md: 0 4px 8px -1px rgba(60,54,44,0.07), 0 2px 4px -2px rgba(60,54,44,0.04);
  --shadow-lg: 0 12px 28px -4px rgba(60,54,44,0.1), 0 4px 10px -4px rgba(60,54,44,0.04);
  --shadow-xl: 0 24px 56px -12px rgba(60,54,44,0.14);
  --shadow-glow: 0 8px 32px rgba(91,127,199,0.18);
  --shadow-card-hover: 0 14px 32px rgba(60,54,44,0.1), 0 4px 10px rgba(60,54,44,0.04);

  /* Radii */
  --radius: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Safe Areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Backdrop blur */
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --blur-xl: 40px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* --- Page Transitions --- */
.page {
  position: absolute;
  top: 0; left: 0; right: 0;
  min-height: 100vh;
  min-height: 100dvh;
  will-change: transform, opacity;
}

.page-enter {
  animation: pageSlideIn 0.5s var(--ease-out) forwards;
}

.page-leave {
  animation: pageSlideOut 0.35s var(--ease-smooth) forwards;
}

@keyframes pageSlideIn {
  from { transform: translateX(40px) scale(0.98); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes pageSlideOut {
  from { transform: translateX(0) scale(1); opacity: 1; }
  to   { transform: translateX(-40px) scale(0.98); opacity: 0; }
}

/* ============================================
   HOME PAGE
   ============================================ */
.home-page {
  padding-bottom: calc(32px + var(--safe-bottom));
}

/* --- Top Header - Clean typographic, no animated decorations --- */
.home-header {
  background: linear-gradient(160deg, #1a2560 0%, #2d3a8c 40%, #3b4fd0 100%);
  padding: calc(28px + var(--safe-top)) 24px 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Subtle static noise texture for depth */
.home-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

/* Accent line at bottom */
.home-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.home-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
  line-height: 1.15;
}

.home-header p {
  font-size: 0.85rem;
  opacity: 0.65;
  margin-top: 8px;
  font-weight: 400;
  letter-spacing: 0.8px;
  position: relative;
  z-index: 1;
  text-transform: none;
}

/* --- Search Bar - Frosted Glass --- */
.search-wrap {
  padding: 0 16px;
  margin-top: -24px;
  position: relative;
  z-index: 2;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: blur(var(--blur-xl));
  backdrop-filter: blur(var(--blur-xl));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.6) inset;
  padding: 0 18px;
  height: 52px;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: box-shadow 0.3s var(--ease-smooth), background 0.3s;
}

.search-bar:focus-within {
  box-shadow: var(--shadow-lg), 0 6px 24px rgba(91,127,199,0.12);
  background: rgba(255,255,255,0.95);
}

.search-bar svg {
  flex-shrink: 0;
  color: var(--text-light);
  transition: color 0.2s;
}

.search-bar:focus-within svg {
  color: var(--primary);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  font-weight: 400;
}

.search-bar input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

/* --- Category Tabs - Pill style with glass --- */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 20px 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.35s var(--ease-spring);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  letter-spacing: 0.2px;
}

.cat-tab:active {
  transform: scale(0.95);
}

.cat-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(91,127,199,0.28);
  font-weight: 600;
  transform: scale(1);
}

/* --- Scale List --- */
.scale-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.scale-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-ultra-light), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.scale-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-card-hover);
}

.scale-card:active::before {
  opacity: 1;
}

.scale-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  color: #fff;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.scale-info { flex: 1; min-width: 0; position: relative; z-index: 1; }

.scale-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
  line-height: 1.35;
}

.scale-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--text-light);
}

.scale-meta span:first-child {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
  color: var(--text-secondary);
}

.scale-meta span + span::before {
  content: '·';
  margin-right: 6px;
  opacity: 0.4;
}

.scale-arrow {
  flex-shrink: 0;
  color: var(--text-ultra-light);
  position: relative;
  z-index: 1;
  transition: transform 0.2s var(--ease-out), color 0.2s;
}

.scale-card:active .scale-arrow {
  transform: translateX(2px);
  color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ============================================
   QUIZ PAGE
   ============================================ */
.quiz-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #faf9f7 0%, var(--bg) 30%, #f5f4f0 100%);
}

/* --- Quiz Header - frosted glass --- */
.quiz-header {
  padding: calc(14px + var(--safe-top)) 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(248,249,252,0.85);
  -webkit-backdrop-filter: blur(var(--blur-lg));
  backdrop-filter: blur(var(--blur-lg));
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.quiz-back {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease-out);
}

.quiz-back:active {
  background: rgba(0,0,0,0.08);
  transform: scale(0.92);
}

.quiz-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

.quiz-counter {
  font-size: 0.78rem;
  color: var(--text-light);
  flex-shrink: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  letter-spacing: 0.3px;
}

/* --- Progress Bar - Gradient with glow --- */
.progress-wrap {
  height: 3px;
  background: rgba(0,0,0,0.06);
  position: sticky;
  top: calc(66px + var(--safe-top));
  z-index: 10;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
  background-size: 200% 100%;
  border-radius: 0 2px 2px 0;
  transition: width 0.45s var(--ease-out);
  will-change: width;
  position: relative;
  box-shadow: 0 0 6px rgba(91,127,199,0.4);
  animation: progressShimmer 2.5s linear infinite;
}

@keyframes progressShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0; top: -1px; bottom: -1px;
  width: 20px;
  background: radial-gradient(ellipse at right, rgba(255,255,255,0.6) 0%, transparent 80%);
}

/* --- Question Slider --- */
.quiz-slider {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.quiz-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 32px 24px calc(28px + var(--safe-bottom));
  will-change: transform, opacity;
  transition: transform 0.45s var(--ease-out), opacity 0.4s var(--ease-smooth);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.quiz-slide.current { transform: translateX(0); opacity: 1; }
.quiz-slide.prev    { transform: translateX(-100%); opacity: 0; }
.quiz-slide.next    { transform: translateX(100%); opacity: 0; }

/* --- Question Content --- */
.q-number {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-number::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.q-text {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 32px;
  letter-spacing: -0.1px;
}

/* --- Options - Premium pill design --- */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.5;
  transition: all 0.3s var(--ease-spring);
  -webkit-user-select: none;
  user-select: none;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(91,127,199,0.04), rgba(139,123,174,0.04));
  opacity: 0;
  transition: opacity 0.3s;
}

.option-btn:active {
  transform: scale(0.97);
}

.option-btn .opt-marker {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
  transition: all 0.35s var(--ease-spring);
  position: relative;
  z-index: 1;
}

/* Checkmark inside marker for selected state */
.option-btn .opt-marker::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  position: absolute;
  top: 8px;
  transition: transform 0.3s var(--ease-spring);
  opacity: 0;
}

.option-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(91,127,199,0.04), rgba(139,123,174,0.03));
  box-shadow: 0 0 0 1px rgba(91,127,199,0.08), var(--shadow-md);
}

.option-btn.selected::before {
  opacity: 1;
}

.option-btn.selected .opt-marker {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  color: transparent;
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(91,127,199,0.25);
}

.option-btn.selected .opt-marker::after {
  transform: rotate(-45deg) scale(1);
  opacity: 1;
}

/* --- Intro Slide --- */
.intro-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 28px;
}

.intro-slide .intro-icon {
  width: 88px; height: 88px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 28px;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 12px 32px rgba(91,127,199,0.22), 0 0 0 6px rgba(91,127,199,0.06);
  position: relative;
}

.intro-slide .intro-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 30px;
  border: 2px solid rgba(91,127,199,0.12);
}

.intro-slide h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.intro-slide .intro-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 8px;
  max-width: 320px;
}

.intro-slide .intro-meta {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 36px;
}

.btn-start {
  padding: 15px 52px;
  border: none;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(91,127,199,0.28), 0 0 0 4px rgba(91,127,199,0.06);
  transition: all 0.3s var(--ease-spring);
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
}

.btn-start:active {
  transform: scale(0.95);
  box-shadow: 0 3px 12px rgba(91,127,199,0.2);
}

/* ============================================
   RESULT PAGE
   ============================================ */
.result-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(20px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
}

/* --- Result Card - Warm frosted glass, morandi tone --- */
.result-card {
  width: 100%;
  max-width: 400px;
  background:
    radial-gradient(ellipse at 15% 5%, rgba(91,127,199,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(139,123,174,0.05) 0%, transparent 45%),
    linear-gradient(170deg, #ffffff 0%, #faf9f7 50%, #f5f4f1 100%);
  border-radius: 32px;
  padding: 36px 28px 24px;
  color: var(--text);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 16px 48px rgba(0,0,0,0.06),
    0 4px 16px rgba(91,127,199,0.05),
    0 0 0 1px rgba(91,127,199,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Decorative blobs */
.result-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,127,199,0.07) 0%, transparent 70%);
}

.result-card::after {
  content: '';
  position: absolute;
  bottom: -50px; left: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,123,174,0.06) 0%, transparent 70%);
}

.result-card > * { position: relative; z-index: 1; }

.result-card .rc-title {
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--primary-dark);
}

.result-card .rc-score-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

/* SVG Score Ring */
.rc-score-ring {
  position: relative;
  width: 130px; height: 130px;
}

.rc-score-ring svg {
  width: 130px; height: 130px;
  transform: rotate(-90deg);
}

.rc-score-ring .ring-bg {
  fill: none;
  stroke: rgba(91,127,199,0.1);
  stroke-width: 7;
}

.rc-score-ring .ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 1.2s var(--ease-out);
  filter: drop-shadow(0 0 6px rgba(91,127,199,0.2));
}

.rc-score-ring .ring-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rc-score-ring .score-num {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.rc-score-ring .score-label {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
  letter-spacing: 1px;
}

.rc-level {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 1px;
  padding: 10px 28px;
  background: rgba(91,127,199,0.08);
  border-radius: 100px;
  display: inline-block;
  align-self: center;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(91,127,199,0.12);
  color: var(--primary-dark);
}

.rc-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,127,199,0.15), transparent);
  margin: 18px 0;
  width: 100%;
}

/* Multi-dimension bars - refined */
.rc-dimensions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
  width: 100%;
}

.rc-dim-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rc-dim-name {
  font-size: 0.8rem;
  width: 72px;
  flex-shrink: 0;
  text-align: right;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
  word-break: keep-all;
}

.rc-dim-bar {
  flex: 1;
  height: 8px;
  background: rgba(91,127,199,0.08);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.rc-dim-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 100px;
  transition: width 1s var(--ease-out);
  position: relative;
}

.rc-dim-score {
  font-size: 0.8rem;
  width: 36px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- Interpretation text inside card --- */
.rc-interp {
  font-size: 0.85rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 14px;
  width: 100%;
  text-align: left;
  padding: 0 4px;
  letter-spacing: 0.1px;
}

.rc-advice {
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 16px;
  width: 100%;
  text-align: left;
  background: rgba(91,127,199,0.04);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(91,127,199,0.08);
}

.rc-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.7;
  margin-bottom: 16px;
  width: 100%;
  text-align: left;
  background: rgba(255,59,48,0.06);
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,59,48,0.15);
  color: var(--text-secondary);
}

.rc-warning-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.7;
}

/* Footer with branding */
.rc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-light);
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  width: 100%;
}

/* Share bar inside card — visible in saved image */
.rc-share-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px solid var(--border-light);
  font-size: 0.72rem;
  color: var(--text-ultra-light);
  letter-spacing: 0.5px;
  width: 100%;
}

.rc-share-arrow {
  font-size: 0.8rem;
  animation: bounceUp 1.2s ease-in-out infinite;
}

@keyframes bounceUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Tip section — outside card, NOT in saved image */
.result-tip-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.result-tip-qr {
  width: 130px;
  height: 130px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.result-tip-text {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
  letter-spacing: 0.3px;
}

/* --- Disclaimer --- */
.result-disclaimer {
  width: 100%;
  max-width: 400px;
  margin-top: 14px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: 16px;
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.65;
  border: 1px solid var(--border-light);
}

/* (interpretation is now inline in result-card) */

/* --- Action Buttons --- */
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
}

.btn-action {
  flex: 1;
  padding: 14px 0;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  letter-spacing: 0.3px;
}

.btn-action:active {
  transform: scale(0.96);
}

.btn-action.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 20px rgba(91,127,199,0.25);
}

.btn-action.secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* --- Completion Transition Slide --- */
.completion-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.completion-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 8px 28px rgba(91,127,199,0.25);
  animation: completionPop 0.5s var(--ease-spring) forwards;
}

.completion-icon .check-path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawCheck 0.5s 0.3s var(--ease-out) forwards;
}

@keyframes completionPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.completion-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.completion-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ============================================
   LOADING
   ============================================ */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   TOAST - Frosted glass
   ============================================ */
.toast {
  position: fixed;
  bottom: calc(40px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,46,0.88);
  -webkit-backdrop-filter: blur(var(--blur-lg));
  backdrop-filter: blur(var(--blur-lg));
  color: #fff;
  padding: 11px 26px;
  border-radius: 28px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.4s var(--ease-spring);
  z-index: 999;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE - Desktop & Tablet
   ============================================ */

/* --- Tablet (481px ~ 768px) — 单列但更宽 --- */
@media (min-width: 481px) {
  #app {
    max-width: 600px;
    box-shadow:
      -1px 0 0 var(--border),
      1px 0 0 var(--border),
      0 0 40px rgba(0,0,0,0.04);
  }

  .home-header {
    padding-left: 32px;
    padding-right: 32px;
    border-radius: 0 0 24px 24px;
  }

  .home-header h1 {
    font-size: 2.2rem;
  }

  .scale-list {
    padding: 16px 20px;
  }

  .quiz-slide {
    padding: 40px 32px calc(28px + var(--safe-bottom));
  }

  .q-text {
    font-size: 1.2rem;
  }

  .option-btn {
    padding: 18px 22px;
  }

  .result-card {
    padding: 40px 32px 28px;
  }
}

/* --- Desktop (769px+) — 全宽 header + 居中网格 --- */
@media (min-width: 769px) {
  #app {
    max-width: 100%;
    box-shadow: none;
  }

  /* 首页 header 全宽居中 */
  .home-header {
    padding: calc(48px + var(--safe-top)) 48px 48px;
    border-radius: 0;
    text-align: center;
  }

  .home-header h1 {
    font-size: 2.6rem;
    letter-spacing: -0.8px;
  }

  .home-header p {
    font-size: 0.95rem;
    margin-top: 10px;
  }

  /* 搜索栏居中 */
  .search-wrap {
    padding: 0 24px;
    margin-top: -28px;
  }

  .search-bar {
    max-width: 520px;
    margin: 0 auto;
    height: 56px;
    border-radius: var(--radius);
  }

  /* 分类标签居中 */
  .category-tabs {
    padding: 24px 24px 12px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
  }

  /* 量表列表 — 居中双列 */
  .scale-list {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .scale-card {
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out);
  }

  .scale-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
  }

  .scale-card:hover .scale-arrow {
    transform: translateX(2px);
    color: var(--primary);
  }

  .empty-state {
    grid-column: 1 / -1;
  }

  /* 答题页 — 居中窄列 */
  .quiz-page {
    max-width: 640px;
    margin: 0 auto;
  }

  .quiz-slide {
    padding: 48px 48px calc(28px + var(--safe-bottom));
  }

  .q-text {
    font-size: 1.3rem;
    line-height: 1.8;
  }

  .option-btn {
    padding: 18px 24px;
    font-size: 0.96rem;
  }

  .option-btn:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 1px rgba(91,127,199,0.06), var(--shadow-md);
  }

  .option-btn:hover .opt-marker {
    border-color: var(--primary-light);
  }

  .intro-slide {
    padding: 64px 48px;
  }

  .intro-slide h2 {
    font-size: 1.6rem;
  }

  .intro-slide .intro-desc {
    font-size: 0.95rem;
    max-width: 420px;
  }

  .btn-start {
    padding: 16px 64px;
    font-size: 1.05rem;
  }

  .btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(91,127,199,0.32), 0 0 0 4px rgba(91,127,199,0.08);
  }

  /* 结果页 — 居中 + 解读区域更宽 */
  .result-page {
    padding-top: calc(40px + var(--safe-top));
    align-items: center;
  }

  .result-card {
    max-width: 480px;
  }

  .result-disclaimer {
    max-width: 480px;
  }

  .result-actions {
    max-width: 480px;
  }

  .btn-action:hover {
    transform: translateY(-1px);
  }

  .btn-action.primary:hover {
    box-shadow: 0 8px 24px rgba(91,127,199,0.3);
  }

  /* 完成过渡页居中 */
  .completion-slide {
    padding: 80px 48px;
  }

  /* loading 居中 */
  .loading-wrap {
    min-height: 50vh;
  }
}

/* --- Wide Desktop (1200px+) — 三列网格 --- */
@media (min-width: 1200px) {
  .scale-list {
    max-width: 1200px;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 20px 32px;
  }

  .category-tabs {
    max-width: 1200px;
    padding: 28px 32px 14px;
    gap: 10px;
  }

  .search-bar {
    max-width: 600px;
  }

  .home-header h1 {
    font-size: 2.8rem;
  }
}

/* ============================================
   ACCESSIBILITY - Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
