/* ============================================================
   心灵档案馆 · 统一设计系统 v3.0
   Healthcare 医疗健康风格 · Teal/Mint 配色体系
   ============================================================ */

/* ---------- CSS 变量（设计 Token） ---------- */
:root {
  /* 背景 */
  --bg: #F0FDFA;
  --surface: #FFFFFF;
  --surface-alt: #F0FDFB;

  /* 主色（Teal） */
  --primary: #14B8A6;
  --primary-dark: #0D9488;
  --primary-light: #CCFBF1;
  --primary-fade: #5EEAD4;

  /* 辅助色（Indigo） */
  --secondary: #6366F1;
  --secondary-light: #EEF2FF;

  /* 强调色（Amber） */
  --accent: #F59E0B;
  --accent-light: #FFFBEB;

  /* 情感警示色 */
  --success: #10B981;
  --danger: #EF4444;
  --danger-light: #FEF2F2;

  /* 文字 */
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  /* 分隔线 */
  --line: #E2E8F0;
  --line-strong: #CBD5E1;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(14,148,136,0.08), 0 1px 2px rgba(14,148,136,0.04);
  --shadow: 0 4px 16px rgba(14,148,136,0.10), 0 2px 6px rgba(14,148,136,0.06);
  --shadow-lg: 0 8px 32px rgba(14,148,136,0.14), 0 4px 12px rgba(14,148,136,0.08);

  /* 圆角 */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* 字体 */
  --serif: Georgia, 'Times New Roman', 'Noto Serif SC', 'SimSun', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;

  /* 过渡 */
  --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 通用组件 ---------- */

/* 页面容器 */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* 通用卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* 标签徽章 */
.tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tag.tag-2 {
  background: var(--secondary-light);
  color: var(--secondary);
}
.tag.tag-warn {
  background: var(--accent-light);
  color: #B45309;
}
.tag.tag-danger {
  background: var(--danger-light);
  color: var(--danger);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(14,148,136,0.3);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary-fade);
}
.btn-outline:hover {
  background: var(--primary-light);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}
.btn-lg {
  padding: 13px 28px;
  font-size: 16px;
}
.btn-block { width: 100%; }

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--r-pill);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 渐变顶带 */
.gradient-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* 动画 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.animate-in { animation: fadeInUp 0.4s ease both; }
.animate-scale { animation: scaleIn 0.3s ease both; }

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--primary-dark); }
.toast.error { background: var(--danger); }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state svg {
  margin: 0 auto 16px;
  opacity: 0.4;
}
.empty-state p { font-size: 14px; }

/* 分隔线 */
.divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

/* 通用表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--surface-alt);
  color: var(--text-2);
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  word-break: break-all;
}
.data-table tr:hover td {
  background: var(--surface-alt);
}
.data-table tr:last-child td { border-bottom: none; }

/* 工具类 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
