/* ================================================================
   HealthLens Design System v2.0
   Professional Medical-Grade Design Language
   Inspired by Mayo Clinic, Cleveland Clinic, Oura Ring
   ================================================================ */

/* ==================== Design Tokens ==================== */
:root {
  /* --- Color Palette --- */
  --accent: #10b981;
  --accent-hover: #059669;
  --accent2: #0ea5e9;
  --accent-light: rgba(16, 185, 129, 0.15);
  --accent2-light: rgba(14, 165, 233, 0.15);
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(16,185,129,0.1) 0%, rgba(14,165,233,0.08) 100%);

  --data-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --data-gradient-solid: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

  --dark-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --dark-surface: #1e293b;
  --dark-border: rgba(255,255,255,0.08);

  /* 暗色主题核心变量 */
  --bg: #0f172a;
  --surface: rgba(30, 41, 59, 0.8);
  --surface-raised: rgba(51, 65, 85, 0.5);
  --ink: #f1f5f9;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --muted-light: #7a8ba0;
  --rule: rgba(255, 255, 255, 0.08);
  --rule-light: rgba(255, 255, 255, 0.05);

  /* Semantic Colors - 提高亮度以适配暗色背景 */
  --success: #4ade80;
  --success-light: rgba(74, 222, 128, 0.15);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.15);
  --info: #60a5fa;
  --info-light: rgba(96, 165, 250, 0.15);

  /* Report type colors - 保持 */
  --report-checkup: #60a5fa;
  --report-gene: #a78bfa;
  --report-imaging: #22d3ee;
  --report-lab: #fbbf24;

  /* --- Radius --- */
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* --- Shadows (multi-layer) --- */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.15);
  --shadow-md: 0 1px 3px rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.25);
  --shadow-lg: 0 2px 4px rgba(0,0,0,0.3), 0 12px 48px rgba(0,0,0,0.35);
  --shadow-xl: 0 4px 8px rgba(0,0,0,0.3), 0 24px 64px rgba(0,0,0,0.4);
  --shadow-accent: 0 4px 16px rgba(16, 185, 129, 0.25);
  --shadow-accent-lg: 0 8px 32px rgba(16, 185, 129, 0.3);

  /* --- Typography --- */
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
  --font-size-base: 15px;
  --line-height-body: 1.75;
  --letter-spacing-heading: -0.025em;
  --letter-spacing-tight: -0.01em;
  --paragraph-spacing: 1.2em;

  /* --- Spacing --- */
  --sidebar-width: 260px;
  --page-padding: 2.5rem;
  --card-padding: 2.5rem;
  --card-gap: 1.5rem;

  /* --- Spacing Scale --- */
  --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 */

  /* --- Surface tokens --- */
  --card: rgba(30, 41, 59, 0.6);
  --border: rgba(255, 255, 255, 0.1);

  /* --- Motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-tight);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

p {
  margin-bottom: var(--paragraph-spacing);
}

p:last-child {
  margin-bottom: 0;
}

/* Tabular nums for data */
.data-numeric,
.score-number,
.stat-number,
.indicator-value,
.repair-score-status,
.pillar-score,
.hero-stat .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

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

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes sparklineDraw {
  from { stroke-dashoffset: 200; }
  to { stroke-dashoffset: 0; }
}

/* Page transition */
.page.active {
  animation: fadeIn 0.35s var(--ease);
}

/* Card entrance animation */
.card,
.feature-card,
.step-card,
.pillar-card,
.recipe-card,
.nonpharma-card,
.advice-card,
.indicator-card,
.stat-card,
.report-file-card {
  animation: fadeInUp 0.45s var(--ease) both;
}

.card:nth-child(1), .feature-card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2), .feature-card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3), .feature-card:nth-child(3) { animation-delay: 120ms; }
.card:nth-child(4), .feature-card:nth-child(4) { animation-delay: 180ms; }
.card:nth-child(5), .feature-card:nth-child(5) { animation-delay: 240ms; }
.card:nth-child(6), .feature-card:nth-child(6) { animation-delay: 300ms; }

/* ==================== Landing Page ==================== */
.landing-view {
  background: var(--surface);
}

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background var(--transition);
}

.landing-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: var(--letter-spacing-heading);
}

.landing-logo.light span { color: white; }

.landing-nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Hero */
.hero {
  padding: 9rem 2.5rem 5rem;
  background: linear-gradient(168deg, #f0faf6 0%, #ffffff 35%, #f5f8ff 65%, #f0f5ff 100%);
 min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13,138,106,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,119,182,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: 1.5rem;
}

.hero-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1875rem;
  color: var(--muted);
  line-height: var(--line-height-body);
  margin-bottom: 2.5rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat .num {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-stat .label {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Hero Mockup */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-mockup {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.03);
  overflow: hidden;
  width: 100%;
  max-width: 540px;
  transform: perspective(900px) rotateY(-4deg) rotateX(1.5deg);
  transition: transform 0.6s var(--ease);
}

.hero-mockup:hover {
  transform: perspective(900px) rotateY(0deg) rotateX(0deg);
}

.mockup-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.125rem;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.mockup-dots {
  display: flex;
  gap: 5px;
}

.mockup-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.mockup-dots span:nth-child(1) { background: #ff5f57; }
.mockup-dots span:nth-child(2) { background: #ffbd2e; }
.mockup-dots span:nth-child(3) { background: #28ca42; }

.mockup-body {
  display: flex;
  min-height: 300px;
}

.mockup-sidebar {
  width: 52px;
  background: var(--bg);
  border-right: 1px solid var(--rule);
  padding: 0.875rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mockup-nav-item {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--rule);
}

.mockup-nav-item.active {
  background: var(--accent);
}

.mockup-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.mockup-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.mockup-score-label {
  font-size: 0.6875rem;
  color: var(--muted);
}

.mockup-charts {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 88px;
  flex: 1;
}

.mockup-chart-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, var(--accent-light), var(--accent));
  opacity: 0.7;
}

.mockup-cards {
  display: flex;
  gap: 0.625rem;
  width: 100%;
}

.mockup-card-sm {
  flex: 1;
  height: 36px;
  border-radius: var(--radius-xs);
}

.mockup-card-sm.warning { background: rgba(255,149,0,0.12); border: 1px solid rgba(255,149,0,0.18); }
.mockup-card-sm.success { background: rgba(52,199,89,0.12); border: 1px solid rgba(52,199,89,0.18); }

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.5rem;
   border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: var(--letter-spacing-tight);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #0a7a5c 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--rule);
}

.btn-secondary:hover {
  background: var(--rule-light);
   border-color: var(--muted-light);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--rule-light);
   color: var(--ink);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--rule);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-white {
  background: white;
  color: var(--ink);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,255,255,0.35);
}

.btn-outline-white {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.45);
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.8);
}

.btn-block {
  width: 100%;
  padding: 0.9375rem;
}

.btn-sm {
  padding: 0.4375rem 1rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

/* ==================== Features Section ==================== */
.section-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.section-title {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.0625rem;
  margin-bottom: 3.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.features-section {
  padding: 6rem 0;
  background: var(--surface);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}

.feature-card {
  padding: 2.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  transition: all var(--transition);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-6px);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: transform var(--transition);
}

.feature-card:hover .feature-icon-wrap {
  transform: scale(1.08);
}

.feature-icon-wrap.blue { background: #e3f2fd; color: #1976d2; }
.feature-icon-wrap.green { background: #e8f5e9; color: #2e7d32; }
.feature-icon-wrap.teal { background: var(--accent-light); color: var(--accent); }
.feature-icon-wrap.amber { background: #fff3e0; color: #e65100; }
.feature-icon-wrap.rose { background: #fce4ec; color: #c62828; }
.feature-icon-wrap.purple { background: #f3e5f5; color: #7b1fa2; }

.feature-card h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: var(--line-height-body);
  margin-bottom: 1.25rem;
}

.feature-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.feature-tags span {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-weight: 500;
  border: 1px solid var(--rule-light);
}

/* ==================== Steps Section ==================== */
.how-section {
  padding: 6rem 0;
  background: var(--bg);
}

.steps-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 3rem;
}

.step-card {
  text-align: center;
  max-width: 260px;
  padding: 2.25rem 1.75rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  transition: all var(--transition);
}

.step-card:hover {
  box-shadow: var(--shadow-md);
   transform: translateY(-4px);
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 1.25rem;
}

.step-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
}

.step-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.step-arrow {
  color: var(--rule);
  flex-shrink: 0;
}

/* ==================== CTA Section ==================== */
.cta-section {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: 1rem;
  position: relative;
}

.cta-section p {
  font-size: 1.0625rem;
  opacity: 0.92;
  margin-bottom: 2.5rem;
  position: relative;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  position: relative;
}

/* ==================== Footer ==================== */
.landing-footer {
  padding: 4rem 0 2.5rem;
  background: linear-gradient(180deg, #0f172a 0%, #1a1a2e 100%);
  color: rgba(255,255,255,0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-desc {
  font-size: 0.875rem;
  margin-top: 1rem;
  line-height: var(--line-height-body);
  opacity: 0.7;
  max-width: 320px;
}

.footer-links h4 {
  color: white;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-links a {
  display: block;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  padding: 0.375rem 0;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.75rem;
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.45;
}

/* ==================== Auth Modal ==================== */
.auth-modal-content {
  max-width: 520px;
  width: 90%;
}

.auth-modal-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg);
 padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.auth-modal-tabs .auth-tab {
  flex: 1;
  padding: 0.625rem 1.5rem;
  border: none;
  background: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  border-radius: 10px;
  transition: all var(--transition);
}

.auth-modal-tabs .auth-tab.active {
 color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s var(--ease);
}

.form-group {
  margin-bottom: 1.375rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8125rem 1.125rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all var(--transition);
  background: var(--surface);
  color: var(--ink);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted-light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 138, 106, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.875rem;
  text-align: center;
}

/* ==================== App Layout ==================== */
.app-view {
  display: flex;
  min-height: 100vh;
}

.app-view.hidden,
.hidden {
  display: none !important;
}

/* ==================== Sidebar ==================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--dark-bg);
  border-right: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.75rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--dark-border);
  position: relative;
}

.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.4;
}

.sidebar-brand {
  font-size: 1.375rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: var(--letter-spacing-heading);
}

.sidebar-brand .nav-icon {
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(13, 138, 106, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.8125rem 1rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(13, 138, 106, 0.15);
  color: #ffffff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  padding: 0.1875rem 0.5rem;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-pill);
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.nav-badge.new { background: var(--accent); color: white; }

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--dark-border);
}

.sidebar-footer .btn {
  color: rgba(255,255,255,0.6);
}

.sidebar-footer .btn:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13, 138, 106, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.user-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

/* ==================== Main Content ==================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg);
}

/* ==================== Topbar ==================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 2.5rem;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: var(--letter-spacing-heading);
  color: var(--ink);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.125rem;
}

.notification-bell {
  position: relative;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.notification-bell:hover {
  background: var(--rule-light);
  color: var(--ink);
}

.notification-dot {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* ==================== Pages ==================== */
.page {
  display: none;
  padding: 2rem var(--page-padding);
}

.page.active {
  display: block;
}

.page-header {
 margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: var(--letter-spacing-heading);
}

.page-desc {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 0.375rem;
  line-height: var(--line-height-body);
}

/* ==================== Card System ==================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--card-padding);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
  position: relative;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Card with left accent indicator */
.card-accent-left {
  border-left: 4px solid var(--accent);
}

.card-accent-left.card-accent-warning {
  border-left-color: var(--warning);
}

.card-accent-left.card-accent-danger {
  border-left-color: var(--danger);
}

.card-accent-left.card-accent-info {
  border-left-color: var(--info);
}

.card-accent-left.card-accent-success {
  border-left-color: var(--success);
}

/* Card with dark header */
.card-dark-header {
  overflow: hidden;
}

.card-dark-header .card-header {
  background: var(--dark-bg);
  margin: -2.5rem -2.5rem 0;
  padding: 1.25rem 2.5rem;
  border-radius: 13px 13px 0 0;
}

.card-dark-header .card-header h3 {
  color: #ffffff;
}

.card-highlight {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(13, 138, 106, 0.08), var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.card-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: var(--letter-spacing-heading);
}

.card-subtitle {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

.card-footer-text {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.card-wide {
  grid-column: 1 / -1;
}

.card-center {
  max-width: 720px;
  margin: 0 auto;
}

/* ==================== Badges ==================== */
.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6875rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-success {
  background: var(--success-light);
  color: #15803d;
}

.badge-warning {
  background: var(--warning-light);
  color: #b45309;
}

.badge-info {
  background: var(--info-light);
  color: #1d4ed8;
}

.badge-danger {
  background: var(--danger-light);
  color: #b91c1c;
}

/* ==================== Links ==================== */
.link-sm {
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.link-sm:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition);
}

.link:hover {
  color: var(--accent-hover);
}

/* ==================== Dashboard Grid ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}

/* ==================== Health Score ==================== */
.health-score {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.score-circle {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.score-circle svg {
  width: 100%;
  height: 100%;
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.score-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.score-details {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
}

.score-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==================== Diagnosis List ==================== */
.diagnosis-list {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.diagnosis-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: all var(--transition);
}

.diagnosis-item:hover {
  background: var(--rule-light);
}

.diagnosis-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}

.diagnosis-icon.warning { background: rgba(255, 149, 0, 0.08); }
.diagnosis-icon.info { background: rgba(0, 122, 255, 0.08); }
.diagnosis-icon.success { background: rgba(52, 199, 89, 0.08); }

.diagnosis-info {
  flex: 1;
}

.diagnosis-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.diagnosis-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.125rem;
}

/* ==================== Trend Tabs ==================== */
.trend-tabs {
  display: flex;
  gap: 0;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  position: relative;
}

.trend-tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: none;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.trend-tab::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--transition);
}

.trend-tab.active {
  color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.trend-tab.active::after {
  transform: translateX(-50%) scaleX(1);
}

.trend-tab:hover:not(.active) {
  color: var(--ink);
}

/* ==================== Todo List ==================== */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0.5rem;
  border-radius: 8px;
  transition: background var(--transition);
}

.todo-item:hover {
  background: var(--rule-light);
}

.todo-check {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

.todo-text {
  flex: 1;
  font-size: 0.9375rem;
  transition: all var(--transition);
}

.todo-text.done {
  text-decoration: line-through;
  color: var(--muted-light);
}

.todo-tag {
  font-size: 0.75rem;
  padding: 0.1875rem 0.625rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-weight: 500;
}

/* ==================== Records Layout ==================== */
.records-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--card-gap);
}

.records-sidebar {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: var(--shadow-sm);
}

.records-sidebar h3 {
  font-size: 1.0625rem;
  margin-bottom: 1.25rem;
  letter-spacing: var(--letter-spacing-heading);
}

.report-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.report-item {
  padding: 1.125rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}

.report-item:hover {
  background: var(--rule-light);
}

.report-item.active {
  background: var(--accent-light);
  border-color: rgba(13, 138, 106, 0.25);
}

.report-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.375rem;
}

.report-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
}

.report-tags {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  padding: 0.1875rem 0.625rem;
  background: var(--bg);
  border-radius: var(--radius-pill);
  color: var(--muted);
  border: 1px solid var(--rule-light);
}

.report-detail {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: var(--shadow-sm);
}

.report-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.report-detail-header h2 {
  font-size: 1.375rem;
  letter-spacing: var(--letter-spacing-heading);
}

.report-status {
  font-size: 0.8125rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.report-status.processed {
  background: var(--success-light);
  color: #15803d;
}

.indicators-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.indicator-card {
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--rule);
  transition: all var(--transition);
  position: relative;
}

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

.indicator-card.abnormal {
  border-color: rgba(255, 149, 0, 0.25);
  background: rgba(255, 149, 0, 0.02);
}

.indicator-card.abnormal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--warning);
  border-radius: 3px 0 0 3px;
}

.indicator-card.normal {
  border-color: rgba(52, 199, 89, 0.2);
}

.indicator-name {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.625rem;
}

.indicator-value {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.indicator-value small {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
}

.indicator-range {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.375rem;
}

.indicator-trend {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 0.625rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.indicator-trend.up {
  color: var(--warning);
}

.report-actions {
  display: flex;
  gap: 0.875rem;
}

/* ==================== TCM Layout ==================== */
.tcm-layout {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.constitution-result {
  text-align: center;
  padding: 1.5rem 0;
}

.result-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}

.result-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.result-type {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: var(--letter-spacing-heading);
}

.result-percent {
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
  padding: 0.375rem 1.25rem;
  border-radius: var(--radius-pill);
}

.result-secondary {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.tcm-advice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--card-gap);
}

.advice-card {
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: all var(--transition);
}

.advice-card:hover {
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.advice-icon {
  font-size: 1.625rem;
  margin-bottom: 1rem;
}

.advice-card h4 {
  font-size: 1rem;
  margin-bottom: 0.875rem;
  font-weight: 600;
}

.advice-card ul {
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted);
}

.advice-card ul li {
  padding: 0.375rem 0;
  position: relative;
  padding-left: 1.125rem;
  line-height: 1.5;
}

.advice-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ==================== Recipe Grid ==================== */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}

.recipe-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.recipe-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.recipe-card.featured {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 138, 106, 0.06), var(--shadow-sm);
}

.recipe-image {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent2-light) 100%);
}

.recipe-emoji {
  font-size: 3.5rem;
}

.recipe-tag {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 0.3125rem 0.875rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.recipe-body {
  padding: 1.5rem;
}

.recipe-body h3 {
  font-size: 1.125rem;
  margin-bottom: 0.625rem;
  font-weight: 600;
}

.recipe-effect {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.875rem;
  line-height: 1.5;
}

.recipe-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.ingredient {
  font-size: 0.8125rem;
  padding: 0.25rem 0.625rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.recipe-method {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.875rem;
}

.recipe-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ==================== Non-pharma Grid ==================== */
.nonpharma-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}

.nonpharma-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.nonpharma-card:hover {
  box-shadow: var(--shadow-md);
}

.nonpharma-icon {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.nonpharma-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.625rem;
  font-weight: 600;
}

.nonpharma-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: var(--line-height-body);
}

.nonpharma-detail {
  margin-bottom: 1.25rem;
}

.point-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--rule-light);
  font-size: 0.875rem;
}

.point-item:last-child {
  border-bottom: none;
}

.point-name {
  font-weight: 600;
  min-width: 90px;
}

.point-loc {
  flex: 1;
  color: var(--muted);
}

.point-effect {
  font-size: 0.8125rem;
  padding: 0.1875rem 0.625rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-pill);
}

.nonpharma-guide {
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--bg);
  padding: 1rem;
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

.baduanjin-sections {
  margin-bottom: 1.25rem;
}

.section-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0;
  font-size: 0.875rem;
}

.section-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==================== Risk Grid ==================== */
.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}

.risk-gauge {
  display: flex;
  justify-content: center;
  padding: 1.25rem 0;
}

.gauge-container {
  width: 220px;
}

.risk-factors h4 {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.factor-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.factor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: background var(--transition);
}

.factor-item.warning {
  background: rgba(255, 149, 0, 0.05);
}

.factor-item.normal {
  background: rgba(52, 199, 89, 0.05);
}

.factor-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--warning);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
}

.factor-badge.ok {
  background: var(--success);
}

.improvement-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.improvement-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.improvement-item:hover {
  background: var(--rule-light);
}

.improvement-icon {
  font-size: 1.625rem;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.improvement-content {
  flex: 1;
}

.improvement-content h4 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
  font-weight: 600;
}

.improvement-content p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

.improvement-impact {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
}

/* ==================== Doctor Stats ==================== */
.doctor-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--card-gap);
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

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

.stat-number {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.375rem;
}

.doctor-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--card-gap);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.review-item:hover {
  background: var(--rule-light);
}

.review-patient {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 170px;
}

.patient-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  font-weight: 600;
  flex-shrink: 0;
}

.patient-info {
  display: flex;
  flex-direction: column;
}

.patient-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.patient-meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.review-diagnosis {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.ai-diagnosis {
  font-size: 0.875rem;
  font-weight: 500;
}

.ai-confidence {
  font-size: 0.8125rem;
  color: var(--muted);
}

.review-actions {
  display: flex;
  gap: 0.625rem;
}

.prescription-form .form-group {
  margin-bottom: 1.125rem;
}

.prescription-form .form-group label {
  font-size: 0.8125rem;
}

.prescription-form .form-group input,
.prescription-form .form-group select,
.prescription-form .form-group textarea {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
}

/* ==================== Modal ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleIn 0.3s var(--ease);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--rule-light);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 8px;
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--ink);
  background: var(--rule-light);
}

.modal-body {
  padding: 2rem;
}

.upload-area {
  border: 2px dashed var(--rule);
  border-radius: var(--radius-md);
  padding: 3rem 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.upload-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.625rem;
}

.upload-progress {
  margin-top: 1.75rem;
}

.progress-bar {
  height: 8px;
  background: var(--rule-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.4s var(--ease);
}

.progress-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.625rem;
}

/* ==================== Demo Mode Banner ==================== */
.demo-banner {
  background: linear-gradient(90deg, #ff9500 0%, #ff6b00 100%);
  color: white;
  text-align: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  transition: background var(--transition);
}

.demo-banner:hover {
  background: linear-gradient(90deg, #ff6b00 0%, #ff5200 100%);
}

.demo-banner-icon { font-size: 1.125rem; }

/* ==================== Loading States ==================== */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius-md);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--rule-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s var(--ease-in-out) infinite;
}

.spinner-lg {
  width: 52px;
  height: 52px;
  border-width: 4px;
}

.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--muted);
  gap: 1.25rem;
}

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 1.25rem; opacity: 0.4; }
.empty-state-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.625rem; }
.empty-state-text { font-size: 0.9375rem; line-height: 1.5; }

/* ================================================================
   Cell Repair Dashboard
   ================================================================ */
.repair-dashboard { padding: 0 0 2.5rem; }

.repair-score-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  margin-bottom: var(--card-gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.repair-score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-gradient);
  border-radius: 4px 0 0 4px;
}

.repair-score-main {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.repair-score-info {
  flex: 1;
}

.repair-score-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.375rem;
}

.repair-score-status {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.625rem;
}

.repair-age {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.repair-age strong {
  color: var(--accent);
  font-size: 1.125rem;
}

.repair-age-diff {
  color: var(--muted);
  font-size: 0.8125rem;
}

.repair-score-trend {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }

/* Trend Arrow SVG */
.trend-arrow {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.trend-arrow svg {
  width: 14px;
  height: 14px;
}

.trend-arrow.up svg { color: var(--success); }
.trend-arrow.down svg { color: var(--danger); }

/* Damage Mode */
.repair-damage-mode {
  background: linear-gradient(135deg, var(--bg) 0%, var(--rule-light) 100%);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
}

.damage-mode-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.damage-mode-tags {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.damage-tag {
  font-size: 0.8125rem;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.damage-tag:hover {
  transform: translateY(-1px);
}

.damage-tag.primary {
  background: rgba(254, 226, 226, 0.8);
  color: #991b1b;
  border-color: rgba(254, 202, 202, 0.6);
}

.damage-tag.secondary {
  background: rgba(254, 243, 199, 0.8);
  color: #92400e;
  border-color: rgba(253, 230, 138, 0.6);
}

.damage-mode-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ==================== Pillars ==================== */
.repair-pillars-section { margin-bottom: 2rem; }

.section-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--ink);
  letter-spacing: var(--letter-spacing-heading);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}

.pillar-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.pillar-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.pillar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.pillar-card:hover::after {
  opacity: 1;
}

.pillar-card.wide {
  grid-column: 1 / -1;
}

.pillar-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.pillar-icon { font-size: 1.375rem; }

.pillar-name {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}

.pillar-score {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--accent);
}

.pillar-bar-wrap {
  height: 8px;
  background: var(--rule-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.pillar-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 1s var(--ease);
  background: var(--accent-gradient);
}

.pillar-detail {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.625rem;
  line-height: 1.5;
}

.pillar-priority {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.pillar-priority.high { background: rgba(254, 226, 226, 0.8); color: #991b1b; }
.pillar-priority.medium { background: rgba(254, 243, 199, 0.8); color: #92400e; }
.pillar-priority.low { background: rgba(220, 252, 231, 0.8); color: #166534; }

/* ==================== Plan Timeline ==================== */
.repair-plan-section { margin-bottom: 2rem; }

.plan-timeline {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.plan-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem 0;
  position: relative;
}

.plan-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 29px;
  top: 52px;
  bottom: -8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--rule) 100%);
  border-radius: 1px;
}

.plan-item:last-child { padding-bottom: 0; }

.plan-time {
  width: 60px;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
  padding-top: 0.25rem;
  font-family: var(--font-mono);
}

.plan-content {
  flex: 1;
  padding-left: 0.5rem;
}

.plan-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.75rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 1;
}

.plan-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.plan-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.625rem;
  line-height: 1.6;
}

.plan-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.plan-tag.sleep { background: rgba(224, 242, 254, 0.8); color: #0369a1; }
.plan-tag.nutrition { background: rgba(236, 253, 245, 0.8); color: #166534; }
.plan-tag.exercise { background: rgba(254, 243, 199, 0.8); color: #92400e; }
.plan-tag.frequency { background: rgba(243, 232, 255, 0.8); color: #7c3aed; }
.plan-tag.tcm { background: rgba(254, 226, 226, 0.8); color: #991b1b; }

/* ==================== Trend Chart ==================== */
.repair-trend-section { margin-bottom: 2rem; }

.trend-chart-mini {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  padding: 2rem;
  height: 280px;
  box-shadow: var(--shadow-sm);
}

/* ==================== Sparkline Styles ==================== */
.sparkline-container {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.sparkline-svg {
  display: block;
}

.sparkline-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 0;
  animation: sparklineDraw 1.5s var(--ease) forwards;
}

.sparkline-area {
  fill: url(#sparklineGradient);
  opacity: 0.3;
}

.sparkline-dot {
  fill: var(--accent);
  stroke: white;
  stroke-width: 2;
}

/* Data visualization gradient */
.data-viz-gradient {
  background: var(--data-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================================
   Report Center
   ================================================================ */
.report-center {
  padding: 0 0 2.5rem;
}

.report-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.report-center-header h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: var(--letter-spacing-heading);
}

.report-filters {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.report-filter-btn {
  padding: 0.5rem 1.125rem;
  border: 1.5px solid var(--rule);
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}

.report-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.report-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Report File Cards */
.report-file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--card-gap);
}

.report-file-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.report-file-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.report-file-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.report-file-icon.checkup {
  background: rgba(59, 130, 246, 0.1);
  color: var(--report-checkup);
}

.report-file-icon.gene {
  background: rgba(139, 92, 246, 0.1);
  color: var(--report-gene);
}

.report-file-icon.imaging {
  background: rgba(6, 182, 212, 0.1);
  color: var(--report-imaging);
}

.report-file-icon.lab {
  background: rgba(245, 158, 11, 0.1);
  color: var(--report-lab);
}

.report-file-info {
  flex: 1;
  min-width: 0;
}

.report-file-name {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-file-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.report-file-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.report-type-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.report-type-badge.checkup {
  background: rgba(59, 130, 246, 0.1);
  color: var(--report-checkup);
}

.report-type-badge.gene {
  background: rgba(139, 92, 246, 0.1);
  color: var(--report-gene);
}

.report-type-badge.imaging {
  background: rgba(6, 182, 212, 0.1);
  color: var(--report-imaging);
}

.report-type-badge.lab {
  background: rgba(245, 158, 11, 0.1);
  color: var(--report-lab);
}

/* Upload Area (Large Drag & Drop) */
.upload-area-large {
  border: 2.5px dashed var(--rule);
  border-radius: var(--radius-md);
  padding: 4rem 3rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  position: relative;
}

.upload-area-large::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient-subtle);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: inherit;
}

.upload-area-large:hover {
  border-color: var(--accent);
}

.upload-area-large:hover::before {
  opacity: 1;
}

.upload-area-large.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
}

.upload-area-large .upload-icon {
  font-size: 3.5rem;
  opacity: 0.6;
}

.upload-area-large .upload-hint {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 1rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.upload-area-large .upload-hint strong {
  color: var(--accent);
}

/* ==================== Responsive Design ==================== */

/* Desktop Large: 1440px+ */
@media (min-width: 1440px) {
  .section-inner {
    max-width: 1400px;
  }

  .hero-inner {
    max-width: 1400px;
    gap: 6rem;
  }

  .hero-text h1 {
    font-size: 3.75rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet: 768px - 1440px */
@media (max-width: 1440px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-wide {
    grid-column: 1 / -1;
  }

  .tcm-advice-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .records-layout {
    grid-template-columns: 1fr;
  }

  .records-sidebar {
    max-height: 360px;
    overflow-y: auto;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-inner {
    gap: 3rem;
  }

  .hero-text h1 {
    font-size: 2.75rem;
  }
}

/* Mobile breakpoint: < 768px */
@media (max-width: 768px) {
  :root {
    --page-padding: 1.25rem;
    --card-padding: 1.5rem;
    --card-gap: 1rem;
  }

  .sidebar {
    width: 72px;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 1.25rem 0.75rem;
  }

  .sidebar-brand span,
  .nav-label,
  .user-info,
  .sidebar-footer .btn {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0.875rem;
  }

  .nav-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    margin: 0;
  }

  .user-mini {
    justify-content: center;
  }

  .main-content {
    margin-left: 72px;
  }

  .topbar {
    padding: 1rem 1.25rem;
  }

  .page {
    padding: 1.25rem;
  }

  .page-title {
    font-size: 1.375rem;
  }

  .hero {
    padding: 7rem 1.5rem 3rem;
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.25rem;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    flex-direction: column;
  }

  .step-arrow {
    transform: rotate(90deg);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .section-inner {
    padding: 0 1.25rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .recipe-grid,
  .nonpharma-grid,
  .risk-grid {
    grid-template-columns: 1fr;
  }

  .doctor-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .doctor-layout {
    grid-template-columns: 1fr;
  }

  .indicators-grid {
    grid-template-columns: 1fr;
  }

  .tcm-advice-grid {
    grid-template-columns: 1fr;
  }

  .health-score {
    flex-direction: column;
    text-align: center;
  }

  .repair-score-card {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .report-file-list {
    grid-template-columns: 1fr;
  }

  .review-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .review-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .auth-container {
    flex-direction: column;
  }

  .auth-brand {
    padding: 2rem;
    min-height: auto;
  }

  .auth-form-wrapper {
    padding: 2rem;
  }
}

/* Small Mobile: < 480px */
@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.875rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .doctor-stats {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .report-center-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ==================== Utility Classes ==================== */
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.bg-gradient-dark {
  background: var(--dark-bg);
}

.glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.divider {
  height: 1px;
  background: var(--rule);
  margin: 1.5rem 0;
}

.divider-light {
  height: 1px;
  background: var(--rule-light);
  margin: 1.5rem 0;
}

/* Smooth page transitions */
.fade-enter {
  opacity: 0;
  transform: translateY(8px);
}

.fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.35s var(--ease);
}

/* Focus visible styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

/* ==================== Sleep Module ==================== */
.sleep-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.sleep-score-card { text-align: center; padding: 2rem; }
.sleep-score-circle { margin: 0 auto 1rem; }
.sleep-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; }
.sleep-metric { background: var(--rule-light); border-radius: 10px; padding: 1rem; text-align: center; }
.sleep-metric .sm-value { font-size: 1.5rem; font-weight: 700; color: var(--ink); display: block; }
.sleep-metric .sm-label { font-size: 0.8rem; color: var(--muted); }
.sleep-metric.highlight .sm-value { color: var(--warning); }

/* Score Breakdown */
.score-breakdown-section { margin-top: 1.5rem; }
.breakdown-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.breakdown-item { display: grid; grid-template-columns: 80px 40px 1fr 50px; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.bk-label { color: var(--ink-secondary); }
.bk-weight { color: var(--muted); font-size: 0.75rem; text-align: center; }
.bk-bar { height: 8px; background: var(--rule-light); border-radius: 4px; overflow: hidden; }
.bk-bar::after { content: ''; display: block; height: 100%; background: var(--accent-gradient); border-radius: 4px; width: inherit; }
.bk-value { font-weight: 600; text-align: right; color: var(--accent); }
.data-source-note { font-size: 0.75rem; color: var(--muted); margin-top: 0.75rem; padding: 0.5rem 0.75rem; background: var(--rule-light); border-radius: 6px; }

/* Five Tone Player */
.five-tone-section { margin-top: 2rem; }
.tone-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; }
.tone-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.tone-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(13,138,106,0.1); }
.tone-card.active { border-color: var(--accent); background: var(--accent-light); }
.tone-name { font-size: 0.9rem; font-weight: 600; display: block; margin-bottom: 0.25rem; }
.tone-effect { font-size: 0.75rem; color: var(--muted); display: block; margin-bottom: 0.5rem; }
.tone-progress { height: 4px; background: var(--rule-light); border-radius: 2px; overflow: hidden; margin: 0.5rem 0; }
.tone-progress-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.tone-controls { display: flex; justify-content: center; gap: 0.5rem; }
.tone-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--rule); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tone-btn:hover { background: var(--accent-light); }

/* Sleep Checklist */
.sleep-checklist { margin-top: 2rem; }
.checklist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.checklist-item { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.checklist-item.checked { border-color: var(--accent); background: var(--accent-light); }
.checklist-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.checklist-item .cl-text { font-size: 0.9rem; }

/* Timer */
.timer-section { margin-top: 1rem; padding: 1rem; background: var(--rule-light); border-radius: 10px; text-align: center; }
.timer-display { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); margin: 0.5rem 0; }
.timer-label { font-size: 0.8rem; color: var(--muted); }
.timer-controls { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; }

/* Medical Disclaimer */
.medical-disclaimer { margin-top: 2rem; padding: 1rem 1.25rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 0.8rem; color: #92400e; line-height: 1.5; }

/* Topbar Search */
.topbar-search { position: relative; margin-right: 0.75rem; }
.topbar-search .search-input { padding: 6px 12px 6px 32px; border: 1px solid var(--rule); border-radius: 8px; font-size: 13px; width: 220px; background: var(--surface); color: var(--ink); outline: none; transition: border-color 0.2s; }
.topbar-search .search-input:focus { border-color: var(--accent); width: 280px; }
.topbar-search::before { content: '\1F50D'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; }

/* Sidebar links */
.sidebar-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; color: rgba(255,255,255,0.7); font-size: 0.8rem; text-decoration: none; border-radius: 6px; transition: background 0.2s; margin: 0 0.5rem; }
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: white; }
.msg-dot { width: 6px; height: 6px; background: var(--danger); border-radius: 50%; margin-left: auto; }

/* Score transparency */
.score-transparency { margin-top: 0.75rem; text-align: center; }
.score-transparency a { font-size: 0.8rem; }

/* Nonpharma interactive buttons */
.nonpharma-card .btn-outline { margin-top: 0.5rem; font-size: 0.8rem; padding: 4px 10px; }

/* Responsive */
@media (max-width: 768px) {
  .sleep-dashboard { grid-template-columns: 1fr; }
  .tone-grid { grid-template-columns: repeat(3, 1fr); }
  .checklist-grid { grid-template-columns: 1fr; }
  .breakdown-item { grid-template-columns: 60px 30px 1fr 40px; }
}

/* ==================== Unified Diagnosis ==================== */
.nav-badge.accent { background: var(--accent); color: white; font-size: 0.65rem; padding: 1px 6px; border-radius: 8px; }

.diag-sources { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.source-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; gap: 0.5rem; }
.source-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(13,138,106,0.08); transform: translateY(-2px); }
.source-icon { font-size: 1.75rem; }
.source-info strong { display: block; font-size: 0.95rem; color: var(--ink); }
.source-info span { font-size: 0.8rem; color: var(--muted); }
.source-status { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; align-self: flex-start; }
.source-status.done { background: #dcfce7; color: #166534; }
.source-status.pending { background: #f1f5f9; color: #64748b; }
.source-status.warning { background: #fef3c7; color: #92400e; }

.repair-score-hero { text-align: center; padding: 1.5rem 0; }
.hero-age { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.95rem; }
.age-current span, .age-calendar span { font-size: 0.75rem; color: var(--muted); }
.age-sep { color: var(--muted); }
.age-delta { font-weight: 700; font-size: 0.85rem; padding: 2px 8px; border-radius: 12px; }
.age-delta.good { background: #dcfce7; color: #166534; }
.age-delta.bad { background: #fee2e2; color: #991b1b; }

.damage-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.damage-card { background: var(--surface); border-radius: 12px; padding: 1.25rem; border-left: 4px solid; }
.damage-card.high { border-left-color: #dc2626; }
.damage-card.moderate { border-left-color: #d97706; }
.damage-card.low { border-left-color: #16a34a; }
.damage-card .dc-pattern { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 0.25rem; }
.damage-card .dc-severity { font-size: 0.7rem; padding: 1px 6px; border-radius: 4px; display: inline-block; margin-bottom: 0.5rem; }
.damage-card .dc-severity.high { background: #fee2e2; color: #991b1b; }
.damage-card .dc-severity.moderate { background: #fef3c7; color: #92400e; }
.damage-card .dc-desc { font-size: 0.85rem; color: #475569; margin-bottom: 0.5rem; }
.damage-card .dc-markers { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.damage-card .dc-marker { font-size: 0.7rem; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: #475569; }
.damage-card .dc-tcm { font-size: 0.75rem; color: var(--accent); margin-top: 0.5rem; }

.tcm-cell-bridge { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.bridge-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem; }
.bridge-card .bc-tcm { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 0.5rem; }
.bridge-card .bc-arrow { color: var(--accent); font-size: 0.8rem; margin-bottom: 0.5rem; }
.bridge-card .bc-pathway { font-size: 0.85rem; color: #475569; }
.bridge-card .bc-evidence { font-size: 0.7rem; color: var(--muted); margin-top: 0.25rem; }

.gene-risk-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.gene-risk-header { padding: 1rem 1.25rem; background: var(--bg2); color: white; font-size: 0.9rem; font-weight: 600; }
.gene-row { display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--rule); font-size: 0.85rem; align-items: center; }
.gene-row:last-child { border-bottom: none; }
.gene-row .gr-gene { font-weight: 600; color: var(--ink); }
.gene-row .gr-function { color: #475569; }
.gene-row .gr-risk { font-weight: 600; }
.gene-row .gr-risk.high { color: #dc2626; }
.gene-row .gr-risk.moderate { color: #d97706; }
.gene-row .gr-risk.low { color: #16a34a; }
.gene-row .gr-action { font-size: 0.75rem; color: var(--accent); }

/* Plan Page */
.plan-pillars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; margin-bottom: 2rem; }
.pillar-card { text-align: center; padding: 1.25rem 0.75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; cursor: pointer; transition: all 0.2s; }
.pillar-card:hover, .pillar-card.active { border-color: var(--accent); background: rgba(13,138,106,0.04); }
.pillar-icon { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }
.pillar-name { font-size: 0.85rem; font-weight: 600; display: block; color: var(--ink); }
.pillar-score { font-size: 0.75rem; color: var(--muted); display: block; margin-top: 0.25rem; }

.plan-timeline { position: relative; padding-left: 2rem; }
.plan-timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--rule); }
.timeline-node { position: relative; margin-bottom: 1.25rem; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.timeline-node::before { content: ''; position: absolute; left: -1.65rem; top: 1.15rem; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; border: 2px solid white; }
.timeline-time { font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-bottom: 0.5rem; }
.timeline-content { font-size: 0.9rem; color: var(--ink); }
.timeline-tags { display: flex; gap: 0.25rem; margin-top: 0.5rem; flex-wrap: wrap; }
.timeline-tag { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; background: #f1f5f9; color: #475569; }
.timeline-tag.sleep { background: #dbeafe; color: #1e40af; }
.timeline-tag.nutrition { background: #dcfce7; color: #166534; }
.timeline-tag.exercise { background: #fef3c7; color: #92400e; }
.timeline-tag.tcm { background: #e0e7ff; color: #4338ca; }
.timeline-tag.frequency { background: #fce7f3; color: #9d174d; }

.plan-herbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.herb-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
.herb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.herb-name { font-size: 1rem; font-weight: 700; color: var(--ink); }
.herb-category { font-size: 0.75rem; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; color: #475569; }
.herb-pathway { font-size: 0.85rem; color: var(--accent); margin-bottom: 0.5rem; font-weight: 500; }
.herb-mechanism { font-size: 0.8rem; color: #475569; line-height: 1.5; }

@media (max-width: 768px) {
  .diag-sources { grid-template-columns: repeat(2, 1fr); }
  .damage-cards { grid-template-columns: 1fr; }
  .plan-pillars { grid-template-columns: repeat(3, 1fr); }
  .gene-row { grid-template-columns: 1.5fr 1fr 1fr; font-size: 0.75rem; }
  .gene-row .gr-action { display: none; }
}

/* 新增：板块标题样式 */
.section-subtitle { font-size: 0.85rem; color: var(--muted); margin-top: -0.25rem; margin-bottom: 1rem; }

/* 调理方卡片新样式 */
.fm-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; position: relative; overflow: hidden; }
.fm-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.fm-card.fm-green::before { background: #0d8a6a; }
.fm-card.fm-orange::before { background: #d97706; }
.fm-card.fm-blue::before { background: #0284c7; }
.fm-card.fm-red::before { background: #dc2626; }
.fm-card.fm-purple::before { background: #7c3aed; }

.fm-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.fm-name { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.fm-form { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; background: #f1f5f9; color: #475569; }
.fm-target { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-bottom: 0.35rem; }
.fm-pathway { font-size: 0.8rem; color: #475569; line-height: 1.5; margin-bottom: 0.75rem; }
.fm-ingredients { font-size: 0.8rem; color: var(--ink); margin-bottom: 0.5rem; }
.fm-ingredients strong { font-weight: 600; }
.fm-usage { font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 0.5rem; display: flex; justify-content: space-between; align-items: center; }
.fm-evidence { font-size: 0.7rem; padding: 1px 6px; border-radius: 4px; }
.fm-source { font-size: 0.7rem; color: var(--muted); }

/* 证据等级样式 */
.fm-evidence.evidence-a { background: #dcfce7; color: #166534; }
.fm-evidence.evidence-b { background: #fef3c7; color: #92400e; }

/* 时间线标签新颜色 */
.timeline-tag.food_med { background: #fef3c7; color: #92400e; }
.timeline-tag.frequency { background: #fce7f3; color: #9d174d; }

/* ==================== Bottom Tab Navigation ==================== */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  color: var(--muted-light);
  text-decoration: none;
  font-size: 0.6rem;
  transition: color 0.2s;
  cursor: pointer;
  min-width: 48px;
}

.tab-item .tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.tab-item.active {
  color: var(--accent);
}

.tab-item:hover {
  color: var(--ink-secondary);
}

/* ==================== App Layout for Bottom Tab ==================== */
.app-view .main-content {
  margin-left: 0 !important;
  padding-bottom: 80px !important;
}

.app-view .sidebar {
  display: none !important;
}

/* ==================== Dark Theme Optimizations ==================== */
.app-view .topbar {
  background: transparent;
  border-bottom: 1px solid var(--rule);
}

.topbar-search .search-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--rule);
  color: var(--ink);
}
.topbar-search .search-input:focus {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
}

.topbar-search::before {
  content: '\1F50D';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
}

/* Card glass effect for dark theme */
.card,
.source-card,
.pillar-card,
.damage-card,
.bridge-card,
.gene-row,
.fm-card,
.checklist-item,
.timeline-node {
  background: var(--surface) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Page backgrounds */
.page {
  background: transparent;
}

/* Medical disclaimer dark theme */
.medical-disclaimer {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

/* Score circle glow effect */
.hero-score-circle svg circle:last-of-type,
.repair-score-circle svg circle:last-of-type {
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.3));
}

/* Badge styles */
.nav-badge.accent,
.source-status.done,
.source-status.pending {
  backdrop-filter: blur(4px);
}

/* Landing page stays light theme */
.landing-view,
.landing-view *,
.landing-view body {
  --bg: #fafbfc;
  --surface: #ffffff;
  --ink: #1a1a2e;
  --ink-secondary: #374151;
  --muted: #6b7280;
  --rule: #e5e7eb;
  --rule-light: #f3f4f6;
}

/* ========== Fusion Chain - Causal Chain UI ========== */
.fusion-chain {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1rem 0;
}

.fusion-layer {
  position: relative;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 0;
  animation: fadeInUp 0.4s ease both;
}

.fusion-layer[data-layer="1"] { animation-delay: 0.05s; }
.fusion-layer[data-layer="2"] { animation-delay: 0.12s; }
.fusion-layer[data-layer="3"] { animation-delay: 0.19s; }
.fusion-layer[data-layer="4"] { animation-delay: 0.26s; }
.fusion-layer[data-layer="5"] { animation-delay: 0.33s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Layer connector arrow */
.fusion-connector {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
  position: relative;
}

.fusion-connector::before {
  content: '';
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), rgba(16,185,129,0.3));
}

.fusion-connector::after {
  content: '▼';
  position: absolute;
  bottom: -2px;
  font-size: 0.65rem;
  color: var(--accent);
}

.fusion-connector .connector-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--bg);
  padding: 0 0.4rem;
  white-space: nowrap;
  font-style: italic;
}

/* Layer specific colors */
.fusion-layer[data-layer="1"] {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.fusion-layer[data-layer="2"] {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.fusion-layer[data-layer="3"] {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.fusion-layer[data-layer="4"] {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.fusion-layer[data-layer="5"] {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.fusion-layer-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.fusion-layer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.fusion-layer[data-layer="1"] .fusion-layer-badge { background: rgba(239, 68, 68, 0.8); }
.fusion-layer[data-layer="2"] .fusion-layer-badge { background: rgba(59, 130, 246, 0.8); }
.fusion-layer[data-layer="3"] .fusion-layer-badge { background: rgba(16, 185, 129, 0.8); }
.fusion-layer[data-layer="4"] .fusion-layer-badge { background: rgba(168, 85, 247, 0.8); }
.fusion-layer[data-layer="5"] .fusion-layer-badge { background: rgba(245, 158, 11, 0.8); }

.fusion-layer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.fusion-layer-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
  font-weight: 400;
}

/* Layer content items */
.fusion-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fusion-item {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.fusion-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.fusion-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.fusion-item-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.tag-pathogenic { background: rgba(239,68,68,0.15); color: #f87171; }
.tag-likely-pathogenic { background: rgba(245,158,11,0.15); color: #fbbf24; }
.tag-benign { background: rgba(34,197,94,0.15); color: #4ade80; }
.tag-severe { background: rgba(239,68,68,0.15); color: #f87171; }
.tag-moderate { background: rgba(245,158,11,0.15); color: #fbbf24; }
.tag-mild { background: rgba(34,197,94,0.15); color: #4ade80; }
.tag-normal { background: rgba(100,116,139,0.15); color: #94a3b8; }
.tag-validated { background: rgba(16,185,129,0.15); color: #4ade80; }
.tag-predicted { background: rgba(59,130,246,0.15); color: #60a5fa; }
.tag-preliminary { background: rgba(168,85,247,0.15); color: #c084fc; }

.fusion-item-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.fusion-item-detail {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.fusion-tcm-bridge {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: rgba(168,85,247,0.06);
  border-radius: 6px;
  border-left: 3px solid rgba(168,85,247,0.4);
  font-size: 0.78rem;
  color: var(--muted);
}

.fusion-tcm-bridge::before {
  content: '💫';
  flex-shrink: 0;
}

/* Pathway score bar */
.fusion-pathway-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.fusion-pathway-bar-label {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 2.5rem;
}

.fusion-pathway-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.fusion-pathway-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.bar-severe .fusion-pathway-bar-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.bar-moderate .fusion-pathway-bar-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-mild .fusion-pathway-bar-fill { background: linear-gradient(90deg, #10b981, #4ade80); }
.bar-normal .fusion-pathway-bar-fill { background: linear-gradient(90deg, #64748b, #94a3b8); }

.fusion-pathway-bar-value {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 2.5rem;
  text-align: right;
}

/* Intervention type badges */
.intervention-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.badge-food-medicine { background: rgba(16,185,129,0.12); color: #4ade80; }
.badge-gene-therapy { background: rgba(59,130,246,0.12); color: #60a5fa; }
.badge-targeted-drug { background: rgba(239,68,68,0.12); color: #f87171; }
.badge-pharmacogenomic { background: rgba(168,85,247,0.12); color: #c084fc; }

.fusion-mechanism {
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 0.3rem;
  font-style: italic;
}

.fusion-usage {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Fusion summary card */
.fusion-summary {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.fusion-summary h4 {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.fusion-summary-text {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.7;
}

.fusion-evidence-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Responsive */
@media (max-width: 600px) {
  .fusion-layer { padding: 1rem; }
  .fusion-items { gap: 0.4rem; }
  .fusion-item { padding: 0.6rem 0.75rem; }
}

/* ========== Profile Page ========== */
.profile-menu-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule, rgba(255,255,255,0.06));
  cursor: pointer;
  transition: background 0.2s;
}
.profile-menu-item:last-child {
  border-bottom: none;
}
.profile-menu-item:hover {
  background: rgba(255,255,255,0.03);
}
</arg_value>