/* ============================================
   智能导诊 - 设计系统 v3.0
   专业医疗界面 · 老年人友好
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

/* ============================================
   1. 设计令牌
   ============================================ */
:root {
  /* 品牌色 - 沉稳医疗蓝绿 */
  --brand-50: #f0fdfa;
  --brand-100: #ccfbf1;
  --brand-200: #99f6e4;
  --brand-300: #5eead4;
  --brand-400: #2dd4bf;
  --brand-500: #14b8a6;
  --brand-600: #0d9488;
  --brand-700: #0f766e;
  --brand-800: #115e59;
  --brand-900: #134e4a;

  /* 中性色 - 温暖灰 */
  --neutral-0: #ffffff;
  --neutral-50: #fafaf9;
  --neutral-100: #f5f5f4;
  --neutral-200: #e7e5e4;
  --neutral-300: #d6d3d1;
  --neutral-400: #a8a29e;
  --neutral-500: #78716c;
  --neutral-600: #57534e;
  --neutral-700: #44403c;
  --neutral-800: #292524;
  --neutral-900: #1c1917;

  /* 语义色 */
  --success-bg: #f0fdf4;
  --success-border: #86efac;
  --success-text: #166534;
  --success-icon: #22c55e;

  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --warning-icon: #f59e0b;

  --danger-bg: #fef2f2;
  --danger-border: #fca5a5;
  --danger-text: #991b1b;
  --danger-icon: #ef4444;

  /* 页面背景 */
  --page-bg: #f8fafb;

  /* 内容区 */
  --surface-bg: #ffffff;
  --surface-border: #e5e7eb;

  /* 文字 */
  --text-heading: #1e293b;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --text-on-brand: #ffffff;

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* 字号 */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* 过渡 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* 容器 */
  --container: 520px;
  --container-lg: 640px;

  /* 字号档位 */
  --font-scale: 1;
}

/* ============================================
   2. 字号放大档位
   ============================================ */
[data-font-size="large"] {
  --fs-xs: 0.875rem;
  --fs-sm: 1rem;
  --fs-base: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 2.75rem;
}

[data-font-size="xl"] {
  --fs-xs: 1rem;
  --fs-sm: 1.125rem;
  --fs-base: 1.375rem;
  --fs-lg: 1.5rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.125rem;
  --fs-3xl: 2.75rem;
  --fs-4xl: 3.25rem;
}

/* ============================================
   3. 暗色主题
   ============================================ */
[data-theme="dark"] {
  --page-bg: #0f1419;
  --surface-bg: #1a2332;
  --surface-border: #2a3441;
  --text-heading: #f1f5f9;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.4);
  --success-bg: rgba(34,197,94,0.1);
  --success-border: rgba(34,197,94,0.25);
  --success-text: #86efac;
  --warning-bg: rgba(245,158,11,0.1);
  --warning-border: rgba(245,158,11,0.25);
  --warning-text: #fde68a;
  --danger-bg: rgba(239,68,68,0.1);
  --danger-border: rgba(239,68,68,0.25);
  --danger-text: #fca5a5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page-bg: #0f1419;
    --surface-bg: #1a2332;
    --surface-border: #2a3441;
    --text-heading: #f1f5f9;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.4);
    --success-bg: rgba(34,197,94,0.1);
    --success-border: rgba(34,197,94,0.25);
    --success-text: #86efac;
    --warning-bg: rgba(245,158,11,0.1);
    --warning-border: rgba(245,158,11,0.25);
    --warning-text: #fde68a;
    --danger-bg: rgba(239,68,68,0.1);
    --danger-border: rgba(239,68,68,0.25);
    --danger-text: #fca5a5;
  }
}

/* ============================================
   4. 重置与基础
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: var(--fs-lg);
  line-height: 1.7;
  color: var(--text-body);
  background: var(--page-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--duration-slow) var(--ease),
              color var(--duration-slow) var(--ease);
}

/* 老年用户触摸目标 */
button, a, input, select, textarea {
  min-height: 48px;
  font-size: var(--fs-lg);
}

:focus-visible {
  outline: 3px solid var(--brand-400);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--brand-100);
  color: var(--brand-900);
}

[data-theme="dark"] ::selection {
  background: rgba(20, 184, 166, 0.3);
  color: var(--brand-100);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 3px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--neutral-700); }

img { max-width: 100%; display: block; }

/* ============================================
   5. 排版
   ============================================ */
h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-heading);
}

h1 { font-size: var(--fs-4xl); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { line-height: 1.7; }

a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

a:hover { color: var(--brand-700); }

/* ============================================
   6. 布局
   ============================================ */
.page {
  min-height: 100vh;
  padding: var(--sp-5) var(--sp-5) var(--sp-12);
  padding-top: calc(64px + var(--sp-5));
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

.hidden { display: none !important; }

/* ============================================
   7. 顶栏
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  background: var(--surface-bg);
  border-bottom: 1px solid var(--surface-border);
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease);
}

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

.header-inner {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--sp-4);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-500);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  transition: transform var(--duration-normal) var(--ease);
  position: relative;
  overflow: hidden;
}

.header-logo-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
}

.header-logo:hover .header-logo-icon {
  transform: scale(1.05);
}

.header-logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.logo-hospital {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  line-height: 1.3;
  transition: color var(--duration-fast) var(--ease);
}

.header-logo:hover .logo-hospital {
  color: var(--brand-600);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

/* ============================================
   8. 顶栏控件
   ============================================ */

/* 主题切换 */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  padding: 3px;
  flex-shrink: 0;
}

[data-theme="dark"] .theme-toggle {
  background: var(--neutral-800);
}

.theme-toggle-btn {
  width: 32px;
  height: 32px;
  min-height: unset;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease);
}

.theme-toggle-btn:hover {
  color: var(--text-body);
  background: var(--neutral-200);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: var(--neutral-700);
}

.theme-toggle-btn.active {
  background: var(--brand-500);
  color: white;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.3);
}

.theme-toggle-btn .label { display: none; }

@media (min-width: 480px) {
  .theme-toggle-btn {
    width: auto;
    height: 30px;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-full);
    gap: 4px;
    font-size: var(--fs-sm);
  }
  .theme-toggle-btn .label { display: inline; }
}

/* 字号按钮 */
.font-size-toggle {
  min-height: 36px;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  background: var(--surface-bg);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
  position: relative;
  white-space: nowrap;
}

.font-size-toggle:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
}

.font-size-toggle:active { transform: scale(0.97); }

.font-size-toggle .size-icon {
  font-size: var(--fs-base);
  font-weight: 800;
  font-family: "Times New Roman", serif;
  line-height: 1;
}

.font-size-toggle .size-text {
  font-size: var(--fs-sm);
  font-weight: 500;
}

.font-size-toggle .size-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--brand-500);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(13,148,136,0.3);
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--duration-fast) var(--ease);
}

.font-size-toggle .size-badge.show {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 479px) {
  .font-size-toggle {
    min-height: 34px;
    padding: var(--sp-1) var(--sp-2);
  }
  .font-size-toggle .size-text { display: none; }
}

/* AI 按钮 */
.ai-status-btn {
  min-height: 36px;
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  background: var(--surface-bg);
  color: var(--text-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 500;
}

.ai-status-btn:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
}

.ai-status-btn.active {
  border-color: var(--brand-400);
  color: var(--brand-600);
  background: var(--brand-50);
}

[data-theme="dark"] .ai-status-btn.active {
  background: rgba(20,184,166,0.1);
  border-color: rgba(20,184,166,0.3);
}

.ai-status-btn .ai-icon { font-size: 0.875rem; line-height: 1; }
.ai-status-btn .ai-label { font-weight: 600; letter-spacing: 0.02em; }

@media (min-width: 480px) {
  .ai-status-btn {
    padding: var(--sp-1) var(--sp-3);
    gap: 6px;
  }
  .ai-status-btn .ai-label { font-size: var(--fs-sm); }
}

/* ============================================
   9. 英雄区域
   ============================================ */
.hero {
  text-align: center;
  padding: var(--sp-8) 0 var(--sp-6);
}

.hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--brand-50);
  margin-bottom: var(--sp-5);
  position: relative;
}

[data-theme="dark"] .hero-icon {
  background: rgba(20,184,166,0.1);
}

.hero-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-xl) + 4px);
  background: linear-gradient(135deg, var(--brand-200), var(--brand-400));
  opacity: 0.3;
  z-index: -1;
}

.hero-icon svg {
  width: 36px;
  height: 36px;
  color: var(--brand-600);
}

[data-theme="dark"] .hero-icon svg {
  color: var(--brand-400);
}

.hero h1 {
  font-size: var(--fs-3xl);
  color: var(--text-heading);
  margin-bottom: var(--sp-3);
}

.hero p {
  font-size: var(--fs-base);
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================
   10. 快速症状选择
   ============================================ */
.quick-symptoms {
  max-width: var(--container);
  margin: 0 auto var(--sp-5);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease),
              box-shadow var(--duration-slow) var(--ease);
}

.quick-symptoms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.quick-symptoms-header h2 {
  font-size: var(--fs-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.quick-symptoms-header h2::before {
  content: '';
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--brand-500);
  flex-shrink: 0;
}

.symptom-categories {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.symptom-categories::-webkit-scrollbar { display: none; }

.category-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: var(--sp-1) var(--sp-4);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
}

.category-btn:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
  background: var(--brand-50);
}

[data-theme="dark"] .category-btn:hover {
  background: rgba(20,184,166,0.08);
}

.category-btn.active {
  background: var(--brand-500);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}

.symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  min-height: 40px;
}

.symptom-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4);
  background: var(--neutral-100);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text-body);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  user-select: none;
  white-space: nowrap;
}

[data-theme="dark"] .symptom-chip {
  background: var(--neutral-800);
  color: var(--text-body);
}

.symptom-chip:hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
  transform: translateY(-1px);
}

[data-theme="dark"] .symptom-chip:hover {
  background: rgba(20,184,166,0.12);
  border-color: rgba(20,184,166,0.3);
  color: var(--brand-300);
}

.symptom-chip:active { transform: translateY(0); }

.symptom-chip.selected {
  background: var(--brand-500);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}

.symptom-chip .chip-icon { font-size: 0.9rem; line-height: 1; }

/* 持续时间芯片 */
.duration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.duration-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  background: var(--neutral-100);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  user-select: none;
  white-space: nowrap;
  min-height: 36px;
  font-family: inherit;
}

[data-theme="dark"] .duration-chip {
  background: var(--neutral-800);
}

.duration-chip:hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
  transform: translateY(-1px);
}

[data-theme="dark"] .duration-chip:hover {
  background: rgba(20,184,166,0.12);
  color: var(--brand-300);
}

.duration-chip.selected {
  background: var(--brand-500);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}

/* ============================================
   11. 表单
   ============================================ */
.form-card {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  max-width: var(--container);
  margin: 0 auto var(--sp-5);
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease),
              box-shadow var(--duration-slow) var(--ease);
}

.form-group { margin-bottom: var(--sp-5); }
.form-group:last-of-type { margin-bottom: var(--sp-6); }

.form-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--sp-2);
}

.form-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--brand-500);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
}

.input-wrapper textarea { flex: 1; }

textarea, input, select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--neutral-50);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font-size: var(--fs-lg);
  font-family: inherit;
  transition: all var(--duration-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

[data-theme="dark"] textarea,
[data-theme="dark"] input,
[data-theme="dark"] select {
  background: var(--neutral-800);
  border-color: var(--neutral-700);
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
  background: var(--surface-bg);
}

textarea::placeholder, input::placeholder {
  color: var(--text-faint);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
  cursor: pointer;
}

.form-hint {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-faint);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  line-height: 1.5;
}

.form-hint svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand-400);
}

/* 语音按钮 */
.voice-btn {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  min-height: unset;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--surface-border);
  background: var(--neutral-50);
  color: var(--text-faint);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease);
  position: relative;
}

[data-theme="dark"] .voice-btn {
  background: var(--neutral-800);
  border-color: var(--neutral-700);
}

.voice-btn:hover {
  border-color: var(--brand-300);
  color: var(--brand-500);
  background: var(--brand-50);
}

[data-theme="dark"] .voice-btn:hover {
  background: rgba(20,184,166,0.1);
}

.voice-btn:active { transform: scale(0.95); }

.voice-btn.listening {
  border-color: var(--danger-icon);
  color: var(--danger-icon);
  background: var(--danger-bg);
  animation: pulseRing 1.5s ease-in-out infinite;
}

.voice-btn .voice-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--neutral-800);
  color: white;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease);
}

.voice-btn:hover .voice-tooltip { opacity: 1; }

/* ============================================
   12. 按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-lg);
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease);
  min-height: 52px;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--brand-500);
  color: white;
  box-shadow: 0 2px 8px rgba(13,148,136,0.25);
  width: 100%;
  font-size: var(--fs-xl);
  min-height: 56px;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,148,136,0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(13,148,136,0.2);
}

.btn-secondary {
  background: var(--surface-bg);
  color: var(--text-body);
  border: 1px solid var(--surface-border);
  width: 100%;
  font-size: var(--fs-base);
  min-height: 48px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--neutral-50);
  border-color: var(--brand-300);
  color: var(--brand-600);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-secondary:hover:not(:disabled) {
  background: var(--neutral-800);
}

.btn-icon {
  width: 40px;
  height: 40px;
  min-height: unset;
  padding: 0;
  border-radius: 50%;
  background: var(--neutral-100);
  border: 1px solid var(--surface-border);
  color: var(--text-faint);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}

[data-theme="dark"] .btn-icon {
  background: var(--neutral-800);
}

.btn-icon:hover {
  background: var(--brand-50);
  color: var(--brand-600);
  border-color: var(--brand-300);
  transform: rotate(180deg);
}

/* ============================================
   13. 卡片
   ============================================ */
.card {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease),
              box-shadow var(--duration-slow) var(--ease);
}

/* ============================================
   14. 结果页
   ============================================ */
.result-header {
  text-align: center;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--surface-border);
}

.result-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  margin-bottom: var(--sp-3);
  color: var(--success-icon);
}

.result-header h1 {
  font-size: var(--fs-2xl);
  color: var(--text-heading);
  margin-bottom: var(--sp-1);
}

.result-header p {
  font-size: var(--fs-base);
  color: var(--text-muted);
}

/* 诊断来源 */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.source-ai {
  background: var(--brand-50);
  color: var(--brand-600);
  border: 1px solid var(--brand-200);
}

[data-theme="dark"] .source-ai {
  background: rgba(20,184,166,0.1);
  border-color: rgba(20,184,166,0.2);
}

.source-local {
  background: var(--neutral-100);
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
}

.source-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.source-dot-ai {
  background: var(--brand-500);
  box-shadow: 0 0 4px rgba(13,148,136,0.4);
}

.source-dot-local { background: var(--neutral-400); }

.result-section {
  padding: var(--sp-4) 0;
}

.result-section + .result-section {
  border-top: 1px solid var(--surface-border);
}

.result-section-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.result-section-title svg {
  width: 14px;
  height: 14px;
  color: var(--brand-400);
}

.result-section-content {
  font-size: var(--fs-xl);
  color: var(--text-heading);
  line-height: 1.6;
  font-weight: 500;
}

/* 科室推荐 */
.department-result {
  background: var(--brand-500);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: var(--sp-2) 0;
}

.department-result::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.department-result-icon {
  font-size: 1.5rem;
  margin-bottom: var(--sp-2);
  display: block;
  position: relative;
  color: rgba(255,255,255,0.8);
}

.department-result-label {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  position: relative;
}

.department-result-name {
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: white;
  letter-spacing: 0.02em;
  position: relative;
}

/* 症状标签 */
.symptom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}

.symptom-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  color: var(--text-body);
  font-size: var(--fs-base);
  font-weight: 500;
}

[data-theme="dark"] .symptom-tag {
  background: var(--neutral-800);
}

/* 风险等级 */
.risk-display { text-align: center; padding: var(--sp-3); }

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-full);
  font-size: var(--fs-xl);
  font-weight: 700;
  min-width: 140px;
  justify-content: center;
}

.risk-low {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1.5px solid var(--success-border);
}

.risk-medium {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1.5px solid var(--warning-border);
}

.risk-high {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1.5px solid var(--danger-border);
}

.risk-description {
  margin-top: var(--sp-3);
  font-size: var(--fs-base);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   15. 急诊警报
   ============================================ */
.emergency-alert {
  background: var(--danger-icon);
  border: none;
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  color: white;
  text-align: center;
  margin-bottom: var(--sp-6);
  animation: emergencyPulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.emergency-alert::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.emergency-alert-icon {
  font-size: 2.5rem;
  margin-bottom: var(--sp-3);
  display: block;
  animation: alertShake 0.8s ease-in-out infinite;
}

.emergency-alert h2 {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: white;
  margin-bottom: var(--sp-2);
}

.emergency-alert p {
  font-size: var(--fs-base);
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
}

.emergency-actions { margin-top: var(--sp-4); }

.emergency-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-full);
  font-size: var(--fs-lg);
  font-weight: 600;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.12);
  color: white;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease);
  text-decoration: none;
}

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

/* ============================================
   16. 提示框
   ============================================ */
.tip-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}

.tip-box-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.tip-box-header-icon {
  display: flex;
  align-items: center;
  color: var(--warning-icon);
}

.tip-box-header h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--warning-text);
}

.tip-box ul { list-style: none; padding: 0; }

.tip-box li {
  font-size: var(--fs-base);
  color: var(--warning-text);
  padding: var(--sp-1) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  line-height: 1.6;
}

.tip-box li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warning-icon);
  flex-shrink: 0;
  margin-top: 8px;
}

/* 温馨提示卡片 */
.info-card {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  max-width: var(--container);
  margin: 0 auto var(--sp-5);
  box-shadow: var(--shadow-xs);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.info-card-header-icon {
  display: flex;
  align-items: center;
  color: var(--brand-500);
}

.info-card-header h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-heading);
}

.info-card ul { list-style: none; padding: 0; }

.info-card li {
  font-size: var(--fs-base);
  color: var(--text-muted);
  padding: var(--sp-1) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  line-height: 1.6;
}

.info-card li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-400);
  flex-shrink: 0;
  margin-top: 8px;
}

/* ============================================
   17. 历史记录
   ============================================ */
.history-section {
  max-width: var(--container);
  margin: 0 auto var(--sp-5);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 60px;
}

.history-item {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--shadow-xs);
}

.history-item:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

[data-theme="dark"] .history-item:hover {
  border-color: rgba(20,184,166,0.3);
}

.history-item-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.history-item-dept-icon { font-size: 0.875rem; flex-shrink: 0; }

.history-item-dept {
  font-size: var(--fs-sm);
  color: var(--brand-600);
  font-weight: 600;
  padding: 2px var(--sp-2);
  background: var(--brand-50);
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .history-item-dept {
  background: rgba(20,184,166,0.12);
  color: var(--brand-400);
}

.history-item-risk {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
}

.history-item-symptoms {
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.history-item-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.history-item-date {
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

.history-item-source {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
}

.history-item-source.source-ai {
  background: var(--brand-50);
  color: var(--brand-600);
}

.history-item-source.source-local {
  background: var(--neutral-100);
  color: var(--text-muted);
}

[data-theme="dark"] .history-item-source.source-local {
  background: var(--neutral-800);
}

.history-item-arrow {
  margin-left: auto;
  color: var(--text-faint);
  font-size: var(--fs-sm);
  transition: transform var(--duration-fast) var(--ease);
}

.history-item:hover .history-item-arrow {
  transform: translateX(3px);
  color: var(--brand-500);
}

.history-empty {
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
  color: var(--text-faint);
}

.history-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--neutral-100);
  margin-bottom: var(--sp-3);
  color: var(--text-faint);
}

[data-theme="dark"] .history-empty-icon {
  background: var(--neutral-800);
}

.history-empty p {
  font-size: var(--fs-base);
  color: var(--text-muted);
}

/* ============================================
   18. 加载状态
   ============================================ */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.loading-spinner {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  text-align: center;
  box-shadow: var(--shadow-xl);
  max-width: 260px;
  width: 90%;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--neutral-200);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.7s cubic-bezier(0.6, 0, 0.4, 1) infinite;
  margin: 0 auto var(--sp-4);
}

[data-theme="dark"] .spinner {
  border-color: var(--neutral-700);
  border-top-color: var(--brand-400);
}

.loading-spinner p {
  font-size: var(--fs-base);
  color: var(--text-heading);
  font-weight: 500;
}

.btn-loading { pointer-events: none; opacity: 0.85; }
.btn-loading .btn-text { visibility: hidden; }
.btn-loading::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

/* ============================================
   19. 操作栏
   ============================================ */
.action-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.action-bar .btn { min-height: 48px; font-size: var(--fs-base); }

/* 底部导航 */
.bottom-nav {
  max-width: var(--container);
  margin: 0 auto var(--sp-5);
}

.bottom-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  color: var(--text-heading);
  font-size: var(--fs-base);
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease);
}

.bottom-nav-item:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

[data-theme="dark"] .bottom-nav-item:hover {
  border-color: rgba(20,184,166,0.3);
}

.bottom-nav-arrow {
  margin-left: auto;
  color: var(--text-faint);
  font-size: var(--fs-xl);
  transition: transform var(--duration-fast) var(--ease);
}

.bottom-nav-item:hover .bottom-nav-arrow {
  transform: translateX(4px);
  color: var(--brand-500);
}

/* ============================================
   20. 弹窗
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
}

.modal-overlay.hidden { display: none !important; }

.modal-container {
  background: var(--surface-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
  animation: slideUpModal 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}

.modal-container-sm {
  max-width: 420px;
  border-radius: var(--radius-xl);
  margin: auto;
  max-height: 80vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--surface-border);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  min-height: unset;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  font-size: var(--fs-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease);
}

.modal-close-btn:hover {
  background: var(--neutral-100);
  color: var(--text-heading);
}

[data-theme="dark"] .modal-close-btn:hover {
  background: var(--neutral-800);
}

.modal-body {
  padding: var(--sp-5);
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--surface-border);
  flex-shrink: 0;
}

.modal-footer .btn { min-height: 48px; font-size: var(--fs-base); }

/* 预约区块 */
.appt-section { margin-bottom: var(--sp-5); }

.appt-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.appt-department-display {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--brand-600);
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand-50);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1.5px solid var(--brand-200);
}

[data-theme="dark"] .appt-department-display {
  background: rgba(20,184,166,0.1);
  border-color: rgba(20,184,166,0.2);
  color: var(--brand-400);
}

.appt-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.appt-options-row { flex-direction: row; flex-wrap: wrap; }

.appt-option { display: block; cursor: pointer; }

.appt-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.appt-option-content {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--neutral-50);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease);
}

[data-theme="dark"] .appt-option-content {
  background: var(--neutral-800);
}

.appt-option:hover .appt-option-content {
  border-color: var(--brand-300);
}

.appt-option.selected .appt-option-content {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.1);
}

[data-theme="dark"] .appt-option.selected .appt-option-content {
  background: rgba(20,184,166,0.1);
}

.appt-option-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-heading);
}

.appt-option-desc {
  font-size: var(--fs-sm);
  color: var(--text-faint);
  margin-left: auto;
  white-space: nowrap;
}

.appt-option-sm { flex: 1; min-width: 80px; }

.appt-option-sm .appt-option-content {
  justify-content: center;
  padding: var(--sp-3);
  text-align: center;
}

.appt-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.appt-field-wide { grid-column: 1 / -1; }

.appt-field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}

.appt-field input {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--neutral-50);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-size: var(--fs-base);
  font-family: inherit;
  transition: border-color var(--duration-fast) var(--ease);
}

[data-theme="dark"] .appt-field input {
  background: var(--neutral-800);
  border-color: var(--neutral-700);
}

.appt-field input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.1);
}

.appt-row { display: flex; gap: var(--sp-4); }

.appt-success-card {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

[data-theme="dark"] .appt-success-card {
  background: rgba(20,184,166,0.06);
  border-color: rgba(20,184,166,0.15);
}

.appt-success-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.appt-success-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-bg);
  border-radius: var(--radius-sm);
}

.appt-success-label {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.appt-success-value {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-heading);
}

/* ============================================
   21. 入口页
   ============================================ */
.entry-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: var(--sp-4) 0;
}

.entry-brand {
  text-align: center;
  margin-bottom: var(--sp-6);
}

.entry-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--brand-500);
  margin-bottom: var(--sp-4);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  position: relative;
}

[data-theme="dark"] .entry-brand-icon {
  box-shadow: 0 4px 16px rgba(13,148,136,0.3);
}

.entry-brand-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
}

.entry-brand-title {
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: var(--sp-2);
}

.entry-brand-desc {
  font-size: var(--fs-base);
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

.entry-hospital-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 55vh;
  overflow-y: auto;
  padding: var(--sp-1);
  margin: 0 calc(-1 * var(--sp-1));
}

.entry-hospital-list::-webkit-scrollbar { width: 4px; }
.entry-hospital-list::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 2px;
}

.entry-hospital-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-bg);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  position: relative;
  min-height: 68px;
  box-shadow: var(--shadow-xs);
}

.entry-hospital-card:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

[data-theme="dark"] .entry-hospital-card:hover {
  border-color: rgba(20,184,166,0.3);
}

.entry-hospital-card.selected {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.1);
}

[data-theme="dark"] .entry-hospital-card.selected {
  background: rgba(20,184,166,0.08);
}

.hospital-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  background: var(--brand-500);
  color: white;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  align-self: flex-start;
  margin-top: 2px;
}

.hospital-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hospital-name {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
}

.hospital-full {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.hospital-addr {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  line-height: 1.3;
}

.hospital-check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-500);
  color: white;
  font-size: var(--fs-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--duration-fast) var(--ease);
}

.entry-hospital-card.selected .hospital-check {
  opacity: 1;
  transform: scale(1);
}

.entry-footer {
  margin-top: var(--sp-6);
  text-align: center;
}

.entry-hint {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-faint);
}

/* ============================================
   22. 动画
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes emergencyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
}

@keyframes alertShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-6deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(4deg); }
}

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

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

.animate-slide-up {
  animation: slideUp 0.35s var(--ease) forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

/* ============================================
   23. 响应式
   ============================================ */

/* 小屏手机 */
@media (max-width: 479px) {
  .header-inner { padding: 0 var(--sp-3); }
  .header-logo-icon { width: 32px; height: 32px; }
  .logo-main { font-size: var(--fs-sm); }
  .logo-hospital { max-width: 90px; font-size: 0.65rem; }
  .header-controls { gap: 4px; }
  .theme-toggle-btn { width: 30px; height: 30px; }
  .ai-status-btn { min-height: 30px; padding: 2px var(--sp-2); }
  .font-size-toggle { min-height: 30px; padding: 2px var(--sp-2); }

  .hero { padding: var(--sp-5) 0 var(--sp-4); }
  .hero-icon { width: 56px; height: 56px; }
  .hero-icon svg { width: 28px; height: 28px; }
  .hero h1 { font-size: var(--fs-2xl); }
  .hero p { font-size: var(--fs-sm); }

  .quick-symptoms { padding: var(--sp-4); border-radius: var(--radius-lg); }
  .quick-symptoms-header h2 { font-size: var(--fs-base); }
  .category-btn { min-height: 32px; padding: 2px var(--sp-3); font-size: var(--fs-xs); }
  .symptom-chip { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); min-height: 36px; }

  .form-card { padding: var(--sp-4); border-radius: var(--radius-lg); }
  .form-label { font-size: var(--fs-base); }
  textarea, input, select { font-size: var(--fs-base); padding: var(--sp-2) var(--sp-3); }
  textarea { min-height: 80px; }
  .voice-btn { width: 44px; height: 44px; }
  .duration-chip { padding: 2px var(--sp-2); font-size: var(--fs-xs); min-height: 32px; }
  .btn-primary { min-height: 52px; font-size: var(--fs-lg); }

  .btn { padding: var(--sp-2) var(--sp-4); }
  .action-bar { gap: var(--sp-2); }
  .action-bar .btn { min-height: 44px; font-size: var(--fs-sm); }

  .card { padding: var(--sp-4); border-radius: var(--radius-lg); }
  .result-header h1 { font-size: var(--fs-xl); }
  .result-section { padding: var(--sp-3) 0; }
  .result-section-content { font-size: var(--fs-base); }
  .department-result { padding: var(--sp-4); }
  .department-result-name { font-size: var(--fs-2xl); }
  .risk-badge { font-size: var(--fs-lg); padding: var(--sp-2) var(--sp-4); min-width: 100px; }
  .symptom-tag { font-size: var(--fs-sm); padding: 2px var(--sp-2); }
  .tip-box, #ai-advice-section { padding: var(--sp-3); border-radius: var(--radius-md); }
  .emergency-alert { padding: var(--sp-4); border-radius: var(--radius-lg); }
  .emergency-alert h2 { font-size: var(--fs-xl); }

  .entry-container { padding: var(--sp-2) 0; }
  .entry-brand { margin-bottom: var(--sp-4); }
  .entry-brand-icon { width: 56px; height: 56px; font-size: 1.25rem; }
  .entry-brand-title { font-size: var(--fs-2xl); }
  .entry-brand-desc { font-size: var(--fs-sm); }
  .entry-hospital-list { max-height: 50vh; gap: var(--sp-1); }
  .entry-hospital-card { padding: var(--sp-2) var(--sp-3); min-height: 60px; border-radius: var(--radius-md); }
  .hospital-name { font-size: var(--fs-sm); }
  .hospital-full { font-size: var(--fs-xs); }

  .history-section { border: none; padding: 0; }
  .history-item { padding: var(--sp-3); border-radius: var(--radius-md); }
  .history-item-symptoms { font-size: var(--fs-sm); -webkit-line-clamp: 3; }

  .modal-container { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }
  .modal-header { padding: var(--sp-3) var(--sp-4); }
  .modal-body { padding: var(--sp-3) var(--sp-4); }
  .modal-footer { padding: var(--sp-3) var(--sp-4); }
  .modal-footer .btn { min-height: 44px; font-size: var(--fs-sm); }
  .appt-row { flex-direction: column; gap: var(--sp-3); }
  .appt-department-display { font-size: var(--fs-base); padding: var(--sp-2) var(--sp-3); }

  .bottom-nav-item { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); }
  .info-card { padding: var(--sp-3); border-radius: var(--radius-md); }
}

/* 平板 */
@media (min-width: 768px) {
  .page {
    padding: var(--sp-8) var(--sp-8) var(--sp-12);
    padding-top: calc(64px + var(--sp-8));
  }
  .form-card { padding: var(--sp-8); }
  .card { padding: var(--sp-8); }
  .hero { padding: var(--sp-10) 0 var(--sp-8); }
  .hero h1 { font-size: var(--fs-4xl); }
  .hero p { font-size: var(--fs-xl); }
  .department-result { padding: var(--sp-8); }
  .department-result-name { font-size: var(--fs-4xl); }
  .symptom-chips { gap: var(--sp-3); }
  .symptom-chip { padding: var(--sp-2) var(--sp-5); font-size: var(--fs-lg); }
}

/* 桌面 */
@media (min-width: 1024px) {
  .page {
    padding: var(--sp-12);
    padding-top: calc(64px + var(--sp-12));
  }
  .form-card { padding: var(--sp-10); }
  .header-inner { max-width: var(--container-lg); }
}

/* 桌面端弹窗居中 */
@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: var(--sp-6);
  }
  .modal-container {
    border-radius: var(--radius-xl);
    max-height: 85vh;
    animation: scaleIn 0.25s var(--ease);
  }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================================
   24. 工具类
   ============================================ */
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
