/* ============================================================
   主题变量 + 设计令牌（Design Token）— 全院唯一口径
   参照：阿里 Ant Design 基准 14px / 8px 间距栅格；
        Apple HIG 触控目标 ≥44px；Material 8dp 栅格；WCAG 对比度/焦点
   ============================================================ */
:root{
  /* —— 语义色标（全院唯一，禁止各子系统各写各的） —— */
  --bg:#eef1f5; --panel:#fff; --border:#dde3ea; --line:#f0f3f6;
  --primary:#1a5b8c; --primary-dark:#164a73; --primary-bg:#e8f2fa;
  --text:#2b2f36; --text2:#5b636e; --muted:#8a929c; --hd-bg:#f7f9fb;

  --c-red:#d93025;    --c-red-bg:#fde8e6;    --c-red-bd:#f5c6c2;    --c-red-dark:#b3261e;
  --c-orange:#b26a00; --c-orange-bg:#fef3e2; --c-orange-bd:#f5d7a8;
  --c-yellow:#8a6d00; --c-yellow-bg:#fff8e1; --c-yellow-bd:#f5e0a3;
  --c-green:#1e7e34;  --c-green-bg:#e6f4ea;  --c-green-bd:#b7e0c2;
  --c-gray:#6b7280;   --c-gray-bg:#f2f4f6;   --c-gray-bd:#dde3ea;

  /* —— 字体尺度（基准 14px，符合中文界面/临床远观可读性；行高 1.6 最佳） —— */
  --fs-xs:12px;                       /* 辅助、注脚、表格次要 */
  --fs-sm:13px;                       /* 次要文本、标签内文 */
  --fs-base:14px;                     /* 正文基准 */
  --fs-md:15px;                       /* 强调正文、面板头 */
  --fs-lg:16px;                       /* 小标题、关键数据 */
  --fs-xl:18px;                       /* 模块标题 */
  --fs-2xl:22px;                      /* 页面大标题 */
  --lh-base:1.6;                      /* 正文行高 */
  --lh-tight:1.4;                     /* 标题/控件行高 */

  /* —— 间距栅格（8px 基准：4/8/12/16/20/24/32） —— */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px;
  --sp-5:20px; --sp-6:24px; --sp-8:32px;

  /* —— 圆角 —— */
  --r-sm:4px; --r-md:6px; --r-lg:8px; --r-pill:999px;

  /* —— 阴影（elevation） —— */
  --sh-1:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --sh-2:0 4px 14px rgba(16,24,40,.12);
  --sh-3:0 10px 30px rgba(16,24,40,.18);

  /* —— 控件尺寸 —— */
  --ctrl-h:34px;                      /* 桌面控件高（鼠标） */
  --ctrl-h-lg:40px;                   /* 大控件/主操作 */
  --touch:44px;                       /* 床旁/触屏终端触控目标下限 */
  --fs-ctrl:14px;                     /* 控件字号 */

  /* —— 框架尺寸 —— */
  --topbar-h:52px; --sidebar-w:220px; --banner-h:48px; --status-h:30px;

  /* —— 内容宽度上限（超宽屏防失真，居中可用） —— */
  --content-max:1680px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font:var(--fs-base)/var(--lh-base) "Microsoft YaHei","PingFang SC","Segoe UI",sans-serif;
  color:var(--text); background:var(--bg);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
button{font:inherit;cursor:pointer}
input,select,textarea{font:inherit;color:inherit}

/* —— 语义色标标签 —— */
.tag{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:var(--r-sm);
  border:1px solid transparent;white-space:nowrap;font-size:var(--fs-xs);line-height:1.5}
.tag-red{background:var(--c-red-bg);color:var(--c-red);border-color:var(--c-red-bd);font-weight:700}
.tag-orange{background:var(--c-orange-bg);color:var(--c-orange);border-color:var(--c-orange-bd)}
.tag-yellow{background:var(--c-yellow-bg);color:var(--c-yellow);border-color:var(--c-yellow-bd)}
.tag-green{background:var(--c-green-bg);color:var(--c-green);border-color:var(--c-green-bd)}
.tag-gray{background:var(--c-gray-bg);color:var(--c-gray);border-color:var(--c-gray-bd)}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex:none}
.dot-red{background:var(--c-red)} .dot-orange{background:var(--c-orange)}
.dot-yellow{background:var(--c-yellow)} .dot-green{background:var(--c-green)}
.dot-gray{background:var(--c-gray)}
.tx-red{color:var(--c-red);font-weight:700}
.tx-muted{color:var(--muted)}

/* —— 通用焦点态（WCAG 可见焦点，键盘可达） —— */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--primary); outline-offset:1px;
}
