/* 食堂采购汇总 — 后台式布局（参照校园平台 one.walestun.cn 的 Element Plus 风格）
   左侧深藏青导航栏 + 右侧主区；主色品牌蓝，浅蓝灰底，纯白卡片，深灰文字。
   层级靠留白 + 极浅边框建立，不用重色块与氛围渐变。 */

:root {
  /* ── 主色：品牌蓝 ── */
  --primary: #2877c5;
  --primary-dark: #1f5f9e;   /* hover / 按下轻微加深 */
  --primary-light: #5b9bd5;
  --primary-soft: #e8f1fb;   /* 极浅蓝底（选中、标签底） */

  /* ── 侧栏：深藏青 ── */
  --navy: #12345a;
  --navy-hover: #1b4373;
  --navy-text: #a9bfd6;
  --navy-dim: rgba(255, 255, 255, .08);

  /* 旧名别名（既有组件仍引用 --gold*） */
  --gold: #5b9bd5;
  --gold-light: #8fbce4;
  --gold-soft: #eef5fc;

  /* ── 中性 ── */
  --bg: #f4f7fb;
  --surface: #ffffff;
  --bg-soft: #fafbfd;
  --ink: #303133;            /* 深灰，不用纯黑 */
  --ink-2: #606266;
  --ink-3: #909399;
  --line: #e3eaf3;
  --line-2: #d4deeb;

  /* ── 语义色（沿用主色体系，避开黄/橙/绿）── */
  --ok: #2877c5;       --ok-bg: #e8f1fb;
  --warn: #7a8699;     --warn-bg: #f4f4f5;
  --bad: #e5504c;      --bad-bg: #fdecec;
  --mute: #909399;     --mute-bg: #f4f4f5;
  --info: #2877c5;     --info-bg: #e8f1fb;

  /* 旧名别名 */
  --accent: #2877c5;
  --accent-strong: #1f5f9e;
  --accent-soft: #e8f1fb;
  --accent-ink: #1f5f9e;

  --m-green: #5b9bd5;
  --m-blue: #7fb0dd;
  --m-yellow: #2877c5;
  --m-coral: #1f5f9e;
  --m-purple: #8fbce4;
  --m-pink: #b3d1ee;

  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(18, 52, 90, .05);
  --shadow: 0 2px 12px rgba(18, 52, 90, .08);
  --shadow-lg: 0 8px 24px rgba(18, 52, 90, .12);

  /* ── 排版体系：字号只允许这 7 档，层级靠字重 + 颜色 + 间距建立 ──
     ⚠️ 这组变量曾被误删，导致 var(--fs-*) 全部失效、字号回落到继承值 —— 务必保留。 */
  --fs-2xs: 11.5px;
  --fs-xs:  12.5px;
  --fs-sm:  13.5px;
  --fs-md:  14.5px;
  --fs-lg:  17px;
  --fs-xl:  21px;
  --fs-2xl: 30px;

  --lh-tight: 1.3;
  --lh-snug: 1.5;
  --lh-normal: 1.75;

  --ls-tight: -.01em;
  --ls-normal: 0;
  --ls-wide: .04em;

  /* ── 间距刻度 ── */
  --sp-1: 6px;
  --sp-2: 10px;
  --sp-3: 14px;
  --sp-4: 20px;
  --sp-5: 28px;
  --sp-6: 40px;

  /* ── 布局尺寸 ── */
  --side-w: 224px;
  --top-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font: 400 var(--fs-md)/var(--lh-normal) "Microsoft YaHei", "PingFang SC", "Segoe UI", -apple-system, sans-serif;
  letter-spacing: var(--ls-normal);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;                 /* 左：侧栏  |  右：主区 */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- 左侧导航栏（深藏青） ---------- */
.side {
  flex: none; width: var(--side-w);
  background: var(--navy);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 20px; flex: none;
  color: #fff; text-decoration: none;
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: .02em;
  border-bottom: 1px solid var(--navy-dim);
}
.side-logo {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary); color: #fff;
}
.side-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.side-nav a {
  display: flex; align-items: center;
  height: 42px; padding: 0 14px; margin-bottom: 4px;
  border-radius: var(--radius-sm);
  color: var(--navy-text); text-decoration: none;
  font-size: var(--fs-md); font-weight: 500;
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--navy-hover); color: #fff; }
.side-nav a.on { background: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 主区：顶栏 + 内容 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top-h); flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.page-title {
  font-size: var(--fs-lg); font-weight: 600; color: var(--ink);
  letter-spacing: var(--ls-tight); white-space: nowrap;
}
/* 页面说明并入顶栏，与页名同行（内容区不再重复标题） */
.page-desc {
  font-size: var(--fs-sm); color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me { display: flex; align-items: center; gap: 14px; flex: none; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }
.who { font-size: var(--fs-sm); color: var(--ink-3); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.who i {
  font-style: normal; font-size: var(--fs-2xs); color: var(--primary-dark);
  background: var(--primary-soft); border-radius: 999px; padding: 2px 9px; font-weight: 600;
}
.logout-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: var(--fs-sm); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.logout-btn:hover { background: var(--bg); border-color: var(--primary-light); color: var(--primary-dark); }
.inline { display: inline; }

.wrap { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: var(--sp-5) var(--sp-5) var(--sp-6); }
.wrap.bare {
  max-width: 460px; padding-top: 8vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh;
}

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap;
}
/* 页名已在顶栏显示，内容区不再重复大标题，只留一句说明与操作按钮 */
.page-head h1 { display: none; }
.page-head p { font-size: var(--fs-sm); line-height: var(--lh-snug); color: var(--ink-3); }
.page-actions { display: flex; gap: var(--sp-2); flex: none; flex-wrap: wrap; }

/* ---------- 提示条 ---------- */
.flash {
  padding: 12px 16px; border-radius: var(--radius); font-size: var(--fs-md); line-height: var(--lh-snug);
  margin-bottom: 18px; border: 1px solid; font-weight: 500;
}
.flash.ok { background: var(--ok-bg); border-color: #d8dee5; color: var(--ok); }
.flash.bad { background: var(--bad-bg); border-color: #e8d3d1; color: var(--bad); }

/* ---------- 统计条 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
/* 统计卡左侧色条：统一雾霾蓝单色，简约不花 */
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary); opacity: .9;
}
.stat:nth-child(4n+2)::before,
.stat:nth-child(4n+3)::before,
.stat:nth-child(4n)::before { background: var(--primary-light); }
.stat-label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 500; letter-spacing: var(--ls-wide); }
.stat-value {
  margin-top: 8px; font-size: var(--fs-2xl); font-weight: 700; line-height: 1.15;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--primary-dark);
}
.stat-sub { margin-top: 6px; font-size: var(--fs-xs); line-height: var(--lh-snug); color: var(--ink-3); }
.stat-value.bad { color: var(--bad); }
.stat-value.ok { color: var(--accent); }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: var(--sp-3); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.card-head h2 {
  font-size: var(--fs-lg); font-weight: 700; line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight); color: var(--primary-dark);
  display: flex; align-items: center; gap: 9px;
}
.card-head h2::before {
  content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--accent);
  display: inline-block;
}
.card-body { padding: 22px; }
.card-note { font-size: var(--fs-xs); color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: var(--fs-md); font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--bg); color: var(--ink); }
.btn:active { background: var(--line); }
/* 主按钮：低饱和雾霾蓝实心，hover 轻微加深 —— 不做渐变、不上浮 */
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-danger { color: var(--bad); border-color: #e8d3d1; }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: var(--fs-sm); border-radius: 6px; }
.btn-lg { min-height: 48px; padding: 0 26px; font-size: var(--fs-md); }
.btn-ghost, .ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-ghost:hover, .ghost:hover { background: var(--bg); color: var(--ink); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 表单 ---------- */
label {
  display: block; font-size: var(--fs-sm); font-weight: 600; line-height: var(--lh-snug);
  color: var(--ink-2); margin-bottom: 7px;
}

/* 关键修复：原先写的是 input[type=text]，未显式声明 type 的 input（如 name=username）
   不会被命中，导致回落到浏览器默认样式、宽度与圆角都和其他输入框不一致。
   这里同时用属性选择器与 .field 作用域兜底。 */
input[type=text], input[type=password], input[type=date], input[type=month],
input[type=number], input[type=file], input[type=search], input:not([type]),
select, textarea {
  width: 100%; min-height: 42px; padding: 10px 13px; margin-top: 7px;
  border: 1.5px solid var(--line); border-radius: 9px;
  font: inherit; font-size: var(--fs-md); color: var(--ink); background: var(--bg-soft);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 122, 153, .16);
}
/* 复选框/单选框跟随主题色（默认是浏览器亮蓝，与雾霾蓝不搭） */
input[type=checkbox], input[type=radio] { accent-color: var(--primary); cursor: pointer; }
input::placeholder, textarea::placeholder { color: #9aa3ad; }
select { cursor: pointer; }
textarea { line-height: 1.7; resize: vertical; }
.field { margin-bottom: var(--sp-3); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-3); }
.hint { margin-top: 6px; font-size: var(--fs-xs); line-height: var(--lh-snug); color: var(--ink-3); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
/* 表格：线条淡化，只留极浅灰分隔线；表头不铺色块，保持纯白 */
th, td { border-bottom: 1px solid var(--line); padding: 14px 16px; text-align: left; }
th {
  font-weight: 600; color: var(--ink-3); font-size: var(--fs-xs);
  letter-spacing: .06em; white-space: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: 2;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow: auto; max-height: 72vh; }
.row-missing td { background: var(--bad-bg); }
.row-missing td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

/* 状态标签 */
.tag { display: inline-flex; align-items: center; font-size: var(--fs-2xs); padding: 2px 9px; border-radius: 999px; font-weight: 600; border: 1px solid transparent; }
.tag.ok { color: var(--primary-dark); border-color: #d8dee5; background: var(--ok-bg); }
.tag.warn { color: var(--warn); border-color: #d8e0e8; background: var(--warn-bg); }
.tag.bad { color: var(--bad); border-color: #e3c4c1; background: var(--bad-bg); }
.tag.mute { color: var(--mute); border-color: #e4e8ed; background: var(--mute-bg); }
.tag.info { color: var(--info); border-color: #c3d3e3; background: var(--info-bg); }
/* 过敏备注：班级填写的纠错说明，厨房端红字提醒 */
.remark-warn { color: var(--bad); font-weight: 600; font-size: var(--fs-xs); }

/* ---------- 空状态 ---------- */
.empty { padding: 52px 20px; text-align: center; color: var(--ink-3); font-size: var(--fs-md); line-height: var(--lh-normal); }
.empty p { margin-bottom: 14px; }

/* ---------- 登录 / 注册 ----------
   品牌语言：卡片顶部藏青→金渐变条、居中标题带字距、藏青调深投影。 */
.auth-card {
  position: relative; overflow: hidden; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 38px 34px; box-shadow: var(--shadow-lg);
}
.auth-card::before {
  content: ""; display: block; height: 5px;
  margin: -38px -34px 28px;
  background: var(--primary);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .mark {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--primary);
  color: var(--gold); box-shadow: 0 6px 16px rgba(47, 54, 64, .3);
  border: 1px solid rgba(255, 255, 255, .25);
}
.auth-brand .mark svg { width: 26px; height: 26px; }
.auth-brand .txt { line-height: 1.25; }
.auth-brand .txt b {
  display: block; font-size: var(--fs-xl); font-weight: 700; letter-spacing: 3px;
  color: var(--primary-dark);
}
.auth-brand .txt span { font-size: var(--fs-2xs); letter-spacing: 1.8px; color: var(--gold); font-weight: 600; }
.auth-card h1 {
  text-align: center; font-size: var(--fs-xl); font-weight: 700; letter-spacing: 4px;
  color: var(--primary-dark); margin-bottom: 8px;
}
.auth-card .sub { text-align: center; font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: 26px; }
.auth-card .btn-primary { width: 100%; margin-top: 14px; }
.auth-foot { margin-top: 20px; font-size: var(--fs-sm); color: var(--ink-3); text-align: center; }
.auth-foot a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { color: var(--gold); text-decoration: underline; }

/* 带图标前缀的输入框
   修复：图标与切换按钮必须相对「输入框本身」居中，而不是相对含 label 的 .field。
   .field 里同时有 label 与 input，若用 top:50% 定位，50% 落在「标签+输入框」整体中点，
   图标会骑到输入框上边框上（错行）。这里用 .input-wrap 单独包住 input 作为定位上下文。 */
.field-ic { position: relative; }
.input-wrap { position: relative; display: block; }
.input-wrap > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
  transition: color .2s;
  z-index: 1;
}
/* 全局输入框有 margin-top:7px；在 .input-wrap 内它会把输入框整体下移，
   导致 translateY(-50%) 的中点与输入框真实中心错开约 4px。此处归零，
   间距已由 label 的 margin-bottom 提供。 */
.input-wrap input { padding-left: 42px; margin-top: 0; }
.input-wrap:focus-within > svg { color: var(--gold); }
.input-wrap input:focus { box-shadow: 0 0 0 3px rgba(91, 122, 153, .16); border-color: var(--primary); }

/* 密码可见切换 */
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background .15s, color .15s;
}
.pw-toggle:hover { background: var(--accent-soft); color: var(--primary-dark); }
.pw-toggle svg { width: 17px; height: 17px; }

.auth-wrap { width: 100%; max-width: 420px; }
.auth-note {
  margin-top: 18px; text-align: center; font-size: var(--fs-xs); color: var(--ink-3);
}

/* ---------- 首页双栏：趋势图 + 上报进度 ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.dash + .card { margin-top: 0; }
.dash .card { margin-top: 0; }

/* 趋势柱图 */
.chart { display: block; width: 100%; height: auto; }
.chart.trend { height: 116px; }
.trend-axis { stroke: var(--line); stroke-width: 1; }
.trend-bar { fill: var(--primary); opacity: .88; transition: opacity .1s; }
.trend-bar:hover { opacity: 1; }
.trend-bar.zero { fill: var(--line-2); opacity: .6; }
.trend-label { fill: var(--ink-3); font-size: 10px; }

/* 上报进度环 */
.ring-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chart.ring { width: 104px; height: 104px; flex: none; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; }
.ring-num { fill: var(--primary-dark); font-size: 21px; font-weight: 700; }
.ring-den { fill: var(--ink-3); font-size: 12px; }
.ring-cap { fill: var(--ink-3); font-size: 11px; }
.ring-side { flex: 1; min-width: 140px; }
.ring-side .btn { margin-top: 12px; }
.ring-ok { font-size: var(--fs-md); color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.miss-list { list-style: none; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.miss-list li {
  font-size: var(--fs-xs); color: var(--bad); background: var(--bad-bg);
  border: 1px solid #e8d3d1; border-radius: 999px; padding: 2px 10px; font-weight: 500;
}

/* 占比条 */
td.share { width: 42%; min-width: 90px; }
.bar {
  display: block; height: 8px; border-radius: 5px;
  background: var(--m-green); min-width: 3px;
}

/* 危险区卡片 */
.card.danger { border-color: #e8d3d1; }
.card.danger .card-head { background: var(--bad-bg); border-bottom-color: #e8d3d1; }
.card.danger .card-head h2 { color: var(--bad); }
.card.danger .card-head h2::before { background: var(--bad); }

/* ---------- 首页快捷入口宫格 ---------- */
.entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.entry {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: border-color .12s, background .12s, transform .08s;
  box-shadow: var(--shadow-sm);
}
.entry:hover { border-color: var(--line-2); background: #fff; transform: translateY(-2px); }
.entry .entry-ic {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--primary);
}
/* 首页入口图标块：统一浅雾霾蓝底 + 雾霾蓝图标 */
.entry:nth-child(4n+1) .entry-ic,
.entry:nth-child(4n+2) .entry-ic,
.entry:nth-child(4n+3) .entry-ic,
.entry:nth-child(4n) .entry-ic { background: var(--primary-soft); color: var(--primary); }
.entry strong { display: block; font-weight: 700; font-size: var(--fs-md); line-height: var(--lh-snug); }
.entry span { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; line-height: var(--lh-snug); }

/* ---------- 采购流程可视化 ---------- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.flow-step {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 16px 18px; box-shadow: var(--shadow-sm);
}
.flow-step::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px;
  background: var(--primary);
}
.flow-step.b::before, .flow-step.c::before, .flow-step.d::before { background: var(--primary-light); }
.flow-step .fs-ic {
  width: 38px; height: 38px; border-radius: 11px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--primary);
}
.flow-step.b .fs-ic { background: #f2f4f7; color: var(--primary-light); }
.flow-step.c .fs-ic { background: var(--gold-soft); color: #6b8aa6; }
.flow-step.d .fs-ic { background: #eef1f5; color: var(--primary-dark); }
.flow-step h3 { font-size: var(--fs-md); font-weight: 700; margin-bottom: 4px; }
.flow-step p { font-size: var(--fs-xs); color: var(--ink-3); line-height: var(--lh-snug); }
.flow-step .fs-num { font-size: var(--fs-xl); font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.flow-step .fs-num small { font-size: var(--fs-2xs); color: var(--ink-3); font-weight: 500; }
.flow-arrow { display: none; }
.flow-foot { margin-top: 14px; font-size: var(--fs-xs); line-height: var(--lh-snug); color: var(--ink-3); }

/* ---------- 列表工具条（搜索 / 排序） ---------- */
.list-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box input { padding-left: 38px; border-radius: 999px; background: var(--bg-soft); }
.sort-box { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-3); }
.sort-box select { min-height: 40px; width: auto; padding: 0 30px 0 12px; border-radius: 999px; background: var(--bg-soft); }
.tool-count { font-size: var(--fs-sm); color: var(--ink-3); margin-left: auto; }
.tool-count b { color: var(--ink); }

/* ---------- 上传页：三卡层次 + 上传区 + 识别模式胶囊 ---------- */
/* 主卡：白底 + 顶部强调条；次卡：白底；备卡：浅底退后 */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--sp-4); position: relative; }
.box + .box { margin-top: 18px; }
.box--primary { border-color: #e7ebef; box-shadow: var(--shadow); padding: 26px; }
.box--primary::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--accent); opacity: .85;
}
.box--muted { background: var(--bg-soft); box-shadow: none; }
.box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.box-head h2, .box-head h3 {
  font-size: var(--fs-lg); font-weight: 700; line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight); color: var(--primary-dark);
  display: flex; align-items: center; gap: 9px;
}
.box-head .bi {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.box--muted .box-head .bi { background: #f2f4f7; color: var(--text-2); }
.box-note { font-size: var(--fs-sm); color: var(--ink-2); line-height: var(--lh-normal); margin-bottom: 18px; max-width: 68ch; }
.box-note b { color: var(--ink); font-weight: 600; }
.box-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-xs); background: #f2f4f7; border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; color: var(--ink-2); white-space: nowrap;
}

/* 上传区：虚线框，视觉重做但底层仍是原生 input */
.dz {
  position: relative; display: block; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  background: var(--bg-soft); padding: 22px 18px; text-align: center;
  transition: border-color .15s, background .15s;
}
.dz:hover { border-color: var(--accent); background: var(--surface); }
.dz:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dz input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dz-ic {
  width: 42px; height: 42px; border-radius: 12px; margin: 0 auto 10px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.dz-title { display: block; font-size: var(--fs-md); font-weight: 600; }
.dz-hint { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 5px; }
.dz-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.dz-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.dz-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* 识别模式 / provider 单选胶囊 */
.pp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pp-label { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; margin-right: 2px; }
.pp-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1.5px solid var(--line-2); border-radius: 999px;
  font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; user-select: none;
  background: var(--surface);
  transition: border-color .12s, background .12s, color .12s;
}
.pp-item:hover { border-color: var(--line-2); background: var(--bg-soft); }
.pp-item input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pp-item.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.pp-wrap { margin-bottom: 18px; }

/* 上传动作区 */
.upload-actions { margin-top: 20px; }
.hint-inline { font-size: var(--fs-xs); line-height: var(--lh-snug); color: var(--ink-3); margin-top: 10px; }

/* ---------- 月度矩阵表 ---------- */
.matrix td, .matrix th { padding: 8px 9px; font-size: var(--fs-xs); white-space: nowrap; }
.matrix .rowlabel { position: sticky; left: 0; background: var(--surface); font-weight: 600; z-index: 1; }
.matrix thead th { position: sticky; top: 0; z-index: 2; }
.matrix tbody th { background: var(--surface); text-align: right; font-weight: 400; color: var(--ink-3); }
.matrix .total { background: #f7f9fb; font-weight: 700; }

/* ---------- 催报回执 ---------- */
.remind {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(47, 54, 64, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.remind[hidden] { display: none; }
.remind-panel {
  background: var(--surface); border-radius: var(--radius-lg); padding: 30px 26px;
  max-width: 360px; width: 100%; text-align: center; box-shadow: var(--shadow);
  border-top: 6px solid var(--m-coral);
}
.remind-panel h2 { font-size: var(--fs-xl); font-weight: 700; margin-bottom: 8px; }
.remind-panel p { font-size: var(--fs-md); color: var(--ink-2); margin-bottom: 22px; }
.remind-stop {
  width: 100%; min-height: 48px; padding: 0 16px; border: 0; border-radius: 13px;
  background: var(--bad); color: #fff; font: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer;
}
.remind-stop:active { background: #b4635f; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.remind-pulse { animation: pulse 1.1s ease-in-out infinite; color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .remind-pulse { animation: none; } }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; padding: 11px 20px; border-radius: 999px;
  background: var(--primary-dark); color: #fff; font-size: var(--fs-md); font-weight: 500; box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }

.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;
}

/* ---------- 响应式：平板 / 手机 ---------- */
@media (max-width: 1024px) {
  :root { --side-w: 190px; }
  .wrap { padding: var(--sp-4); }
}
/* ≤900px：侧栏由竖排转为顶部横排；主区顶栏改 static，避免两条 sticky 互相压盖 */
@media (max-width: 900px) {
  body { display: block; }
  .side {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 12px; padding: 0 14px;
    border-bottom: 1px solid var(--navy-dim);
  }
  .side-brand { height: 56px; padding: 0; border-bottom: 0; flex: none; font-size: var(--fs-md); }
  .side-logo { width: 26px; height: 26px; border-radius: 7px; }
  .side-nav { display: flex; gap: 4px; padding: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { height: 34px; margin-bottom: 0; padding: 0 11px; font-size: var(--fs-sm); white-space: nowrap; }
  .topbar { position: static; height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .dash { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: var(--sp-4) var(--sp-3) var(--sp-5); }
}
@media (max-width: 720px) {
  .side-name { display: none; }    /* 窄屏侧栏只留 logo，菜单横向滚动 */
  .who { display: none; }          /* 顶栏只留退出按钮 */
  .page-head { flex-direction: column; gap: 12px; }
  .page-head h1 { font-size: var(--fs-lg); }
  .stat-value { font-size: 24px; }
  .chart.trend { height: 92px; }
  .entries { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr; }
  .card-body { padding: 16px; }
  .field-row { grid-template-columns: 1fr; gap: 12px; }
  .table-scroll { max-height: none; }
  /* 触控区不小于 44px */
  .btn, .btn-primary, .btn-lg { min-height: 46px; }
  .btn-sm { min-height: 38px; }
  input, select, textarea { min-height: 46px; font-size: 16px; }  /* 16px 防 iOS 聚焦缩放 */
}
@media (max-width: 420px) {
  .entries { grid-template-columns: 1fr; }
  .wrap.bare { padding: 20px 14px 40px; }
  .auth-card { padding: 30px 22px; }
  .auth-card::before { margin: -30px -22px 24px; }
  .auth-card h1 { font-size: var(--fs-lg); letter-spacing: 2px; }
  .auth-brand .mark { width: 42px; height: 42px; }
  .auth-brand .txt b { font-size: var(--fs-lg); }
  .btn-lg { width: 100%; }
}
