/* ============================================================
   效期管理 —— 样式表
   设计参考：医用耗材效期预警系统 / 主流临期提醒 App
   风格：浅色 / 卡片 / 色带分级 / 大字号关键指标
   ============================================================ */

:root {
  /* 主题色 */
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;

  /* 语义色（分级） */
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --warn: #ea580c;
  --warn-soft: #fff7ed;
  --warn-border: #fed7aa;
  --alert: #ca8a04;
  --alert-soft: #fefce8;
  --alert-border: #fef08a;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --ok-border: #bbf7d0;

  /* 中性 */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 2px 8px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 关键：HTML 的 hidden 属性默认只是 display:none（最低优先级），
   一旦某个选择器给同一元素显式写了 display（如 .gate{display:grid}），
   hidden 就会被覆盖失效，导致"设了 hidden 却藏不住"。
   这里用 !important 强制兜底，保证 JS 里 el.hidden = true 永远有效。 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .28);
}
.brand-logo svg { width: 21px; height: 21px; }
.brand-text h1 { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.brand-text p { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #9ca3af; background: var(--surface-2); color: var(--text); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .28);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #f3f4f6; border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; color: var(--danger); }

/* ---------- 主体 ---------- */
.main { max-width: 1320px; margin: 0 auto; padding: 20px 24px 60px; }

/* Tab 切换 */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: #e9edf3; border-radius: 11px;
  width: fit-content; margin-bottom: 18px;
}
.tab {
  padding: 8px 26px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all .18s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--surface); color: var(--brand);
  box-shadow: 0 1px 4px rgba(16, 24, 40, .12);
}
.tab .tab-count {
  display: inline-block; margin-left: 7px; padding: 0 7px;
  font-size: 11.5px; font-weight: 600; line-height: 18px;
  border-radius: 9px; background: #dfe4ec; color: var(--text-2);
  vertical-align: 1px;
}
.tab.active .tab-count { background: var(--brand-soft); color: var(--brand); }

/* 统计卡 */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  position: relative; overflow: hidden;
  transition: all .18s;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--line-strong);
}
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stat-label { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.5px; }
.stat-unit { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }

.stat.s-all::before { background: #64748b; }
.stat.s-all .stat-value { color: #334155; }
.stat.s-expired::before { background: var(--danger); }
.stat.s-expired .stat-value { color: var(--danger); }
.stat.s-urgent::before { background: var(--warn); }
.stat.s-urgent .stat-value { color: var(--warn); }
.stat.s-watch::before { background: var(--alert); }
.stat.s-watch .stat-value { color: var(--alert); }

/* 工具条 */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-box {
  position: relative; flex: 1 1 260px; max-width: 380px;
}
.search-box svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.search-box input {
  width: 100%; padding: 9px 34px 9px 34px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: none;
  transition: all .15s;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; border-radius: 50%;
  display: none; place-items: center;
  background: #d1d5db; color: #fff;
}
.search-clear svg { position: static; transform: none; width: 11px; height: 11px; color: #fff; }
.search-box.has-value .search-clear { display: grid; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: #e9edf3; border-radius: var(--radius-sm);
}
.seg button {
  padding: 6px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: all .15s;
}
.seg button.active { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); }

.spacer { flex: 1; }

/* ---------- 表格 ---------- */
.table-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-scroll { overflow-x: auto; }
table.grid { min-width: 1020px; }

.grid thead th {
  background: var(--surface-2);
  padding: 11px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.grid thead th.sortable { cursor: pointer; user-select: none; }
.grid thead th.sortable:hover { color: var(--brand); background: #f3f6fa; }
.grid thead th .sort-ind {
  display: inline-block; width: 13px; margin-left: 3px;
  color: var(--brand); font-size: 11px;
}
.grid th.col-num, .grid td.col-num { text-align: right; width: 84px; }
.grid th.col-status, .grid td.col-status { width: 132px; }
.grid th.col-act, .grid td.col-act { width: 92px; text-align: center; }
.grid th.col-batch, .grid td.col-batch { width: 128px; max-width: 128px; }
.grid th.col-open, .grid td.col-open { width: 124px; }
.grid th.col-exp, .grid td.col-exp { width: 128px; }
.grid th.col-note, .grid td.col-note { min-width: 150px; max-width: 280px; }
.grid th.col-cat, .grid td.col-cat { width: 76px; text-align: center; }

/* 类别徽标（抢救车：物品 / 药品） */
.cat-badge {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.cat-item { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.cat-drug { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }

.dim { color: var(--text-3); }

/* 批号 */
.cell-batch {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 开瓶日期 */
.cell-open { white-space: nowrap; }
.open-date { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.open-days {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600;
  background: #f1f5f9; color: var(--text-2);
}
.open-days.open-new { background: var(--ok-soft); color: #15803d; }
.open-days.open-mid { background: var(--alert-soft); color: #a16207; }
.open-days.open-old { background: var(--danger-soft); color: var(--danger); }

/* 备注 */
.cell-note {
  font-size: 12.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.grid tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f3f6;
  vertical-align: middle;
}
.grid tbody tr { transition: background .12s; }
.grid tbody tr:hover { background: #f8fafc; }
.grid tbody tr:last-child td { border-bottom: none; }

/* 行左侧分级色带 */
.grid tbody tr.row-expired { box-shadow: inset 3px 0 0 var(--danger); }
.grid tbody tr.row-urgent  { box-shadow: inset 3px 0 0 var(--warn); }
.grid tbody tr.row-watch   { box-shadow: inset 3px 0 0 var(--alert); }
.grid tbody tr.row-ok      { box-shadow: inset 3px 0 0 #86efac; }

.cell-name { font-weight: 600; color: var(--text); }
.cell-name .mark { background: #fde68a; border-radius: 3px; padding: 0 1px; }
.cell-spec { color: var(--text-2); }
.cell-qty {
  font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--text);
}
.cell-expiry { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.cell-expiry strong { color: var(--text); font-weight: 600; }

/* 有效期进度条 */
.expiry-bar { margin-top: 5px; height: 4px; border-radius: 2px; background: #eef0f4; overflow: hidden; }
.expiry-bar > i { display: block; height: 100%; border-radius: 2px; transition: width .3s; }
.row-expired .expiry-bar > i { background: var(--danger); }
.row-urgent  .expiry-bar > i { background: var(--warn); }
.row-watch   .expiry-bar > i { background: var(--alert); }
.row-ok      .expiry-bar > i { background: var(--ok); }

/* 状态徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.b-expired { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.b-expired .dot { background: var(--danger); }
.b-urgent { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.b-urgent .dot { background: var(--warn); }
.b-watch { background: var(--alert-soft); color: #a16207; border-color: var(--alert-border); }
.b-watch .dot { background: var(--alert); }
.b-ok { background: var(--ok-soft); color: #15803d; border-color: var(--ok-border); }
.b-ok .dot { background: var(--ok); }
.badge-rest { font-size: 11.5px; font-weight: 500; opacity: .8; }

/* 行操作 */
.row-actions { display: flex; gap: 4px; justify-content: center; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  color: var(--text-3); transition: all .15s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: #eef2f7; color: var(--brand); }
.icon-btn.del:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 卡片视图 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px; padding: 14px;
}
.mini-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px 12px;
  transition: box-shadow .15s, transform .15s;
}
.mini-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.mini-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.mini-card.lv-expired::before { background: var(--danger); }
.mini-card.lv-urgent::before  { background: var(--warn); }
.mini-card.lv-watch::before   { background: var(--alert); }
.mini-card.lv-ok::before      { background: var(--ok); }
.mini-card.lv-unknown::before { background: var(--line-strong); }

.mini-head { display: flex; align-items: flex-start; gap: 8px; }
.mini-name { flex: 1; font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.mini-spec { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.mini-meta {
  margin-top: 6px; font-size: 12px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px;
  font-variant-numeric: tabular-nums;
}
.mini-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 9px;
}
.mini-nums { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.mini-nums b { color: var(--text); font-weight: 600; margin: 0 8px 0 3px; }
.mini-nums b:last-child { margin-right: 0; }
.mini-note {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 空状态 */
.empty { padding: 56px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 44px; height: 44px; opacity: .35; margin-bottom: 10px; }
.empty p { font-size: 13.5px; }
.empty .sub { font-size: 12.5px; opacity: .8; margin-top: 4px; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 14px;
  width: 100%; max-width: 470px;
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head {
  padding: 17px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.modal-head h3 { font-size: 15.5px; font-weight: 700; }
.modal-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.modal-close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-3);
}
.modal-close:hover { background: #f3f4f6; color: var(--text); }
.modal-close svg { width: 17px; height: 17px; }

.modal-body { padding: 18px 20px; overflow-y: auto; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.field label .req { color: var(--danger); margin-left: 2px; }
.field input[type="text"], .field input[type="number"], .field select,
.field input[type="date"], .field input[type="email"],
.field input[type="password"], .field textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; transition: all .15s;
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 56px; line-height: 1.6; }
.field input[type="date"] { cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input.invalid, .field textarea.invalid { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.hint.err { color: var(--danger); }
.field input.invalid { border-color: var(--danger); }

.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 9px; justify-content: flex-end;
}

/* 删除确认 */
.confirm-text { font-size: 14px; line-height: 1.7; }
.confirm-text b { color: var(--danger); }
.confirm-box {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--text-2);
}

/* ---------- 通知 ---------- */
.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 18px; border-radius: 10px;
  background: #1f2937; color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease-out;
  display: flex; align-items: center; gap: 8px;
  max-width: 88vw;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
.toast.ok { background: #15803d; }
.toast.err { background: var(--danger); }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }

/* 打印 */
@media print {
  .topbar-actions, .toolbar, .col-act, .tabs, .seg { display: none !important; }
  .stat.clickable { cursor: default; }
  body { background: #fff; }
  .table-card { box-shadow: none; }
}

@media (max-width: 720px) {
  .topbar-inner, .main { padding-left: 14px; padding-right: 14px; }
  .brand-text p { display: none; }
  .stat-value { font-size: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .tab { padding: 7px 16px; }
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .topbar-actions { width: 100%; margin-left: 0; }
}

/* ============================================================
   共享版新增组件
   ============================================================ */

/* ---------- 启动遮罩 ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(160deg, #2563eb 0%, #1e40af 100%);
  display: grid; place-items: center;
  transition: opacity .35s;
}
.boot.hide { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; color: #fff; }
.boot-logo {
  width: 58px; height: 58px; margin: 0 auto 16px;
  border-radius: 16px; background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
}
.boot-logo svg { width: 30px; height: 30px; }
.boot-title { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.boot-msg { margin-top: 8px; font-size: 13px; opacity: .8; }

/* ---------- 门禁（登录 / 口令） ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 26px 26px;
  box-shadow: var(--shadow-lg);
}
.gate-head { text-align: center; margin-bottom: 22px; }
.gate-icon {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 14px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.gate-icon svg { width: 26px; height: 26px; }
.gate-head h2 { font-size: 18px; font-weight: 700; }
.gate-sub { font-size: 12.5px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.gate .field { margin-bottom: 14px; }
.gate .btn-block { margin-top: 16px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; padding: 0 14px; }
.btn-block { width: 100%; justify-content: center; display: inline-flex; }
.linkish {
  background: none; color: var(--brand); font-size: 12.5px; font-weight: 500;
  margin-top: 10px; padding: 6px; border: none;
}
.linkish:hover { background: var(--brand-soft); }
.hint-center { text-align: center; margin-top: 10px; }
.hint-error { color: var(--danger); }

/* ---------- 记录人徽标 ---------- */
.who {
  font-size: 12px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 11px;
}

/* ---------- 顶部提醒条 ---------- */
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px; font-size: 13px;
  border-bottom: 1px solid transparent;
}
.banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.banner-warn {
  background: var(--warn-soft); color: #9a3412;
  border-bottom-color: var(--warn-border);
}
.banner .btn-sm { margin-left: auto; padding: 4px 12px; font-size: 12px; }

/* ---------- 视图切换（预警 / 全部） ---------- */
.viewswitch {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.viewswitch button {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: all .15s;
}
.viewswitch button svg { width: 16px; height: 16px; }
.viewswitch button:hover { border-color: var(--line-strong); }
.viewswitch button.active {
  background: var(--brand-soft); border-color: var(--brand);
  color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
.pill {
  font-size: 11.5px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 20px;
  background: var(--danger); color: #fff;
}
.pill-gray { background: var(--line-strong); color: #fff; }
.viewswitch button.active .pill-gray { background: var(--brand); }

/* ---------- 表格补充列 ---------- */
.lv-text-expired { color: var(--danger); }
.lv-text-urgent  { color: var(--warn); }
.lv-text-watch   { color: #a16207; }
.lv-text-ok      { color: #15803d; }
.exp-main { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.exp-sub { display: block; font-size: 11.5px; margin-top: 1px; opacity: .9; }
.note-text { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--text-3); }
.act {
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--brand); background: var(--brand-soft);
  border: 1px solid transparent; white-space: nowrap;
}
.act:hover { background: #dbeafe; }
.act + .act { margin-left: 4px; }
.act-arch { color: var(--text-2); background: var(--surface-2); }
.act-arch:hover { background: #eef2f7; color: var(--text); }
.act-restore { color: #15803d; background: var(--ok-soft); }
.act-restore:hover { background: #dcfce7; }

/* ---------- 卡片补充 ---------- */
.mini-rest { font-size: 12px; font-weight: 600; white-space: nowrap; margin-left: auto; }
.mini-open { margin-left: 8px; }
.mini-actions {
  display: flex; gap: 5px; margin-top: 9px;
  padding-top: 9px; border-top: 1px dashed var(--line);
}
.mini-actions .act { flex: 1; text-align: center; }
.mini-actions .act + .act { margin-left: 0; }
.mini-card .expiry-bar { margin-top: 8px; }

/* ---------- 数据更新时间 ---------- */
.updated-line {
  text-align: center; font-size: 12px; color: var(--text-3);
  padding: 16px 20px 26px; margin: 0;
}

/* ---------- 设置弹窗分区 ---------- */
.set-sec {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin: 20px 0 10px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.set-sec:first-child { margin-top: 0; }
.switch-line {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; line-height: 1.5;
}
.switch-line input { margin-top: 3px; width: auto; flex-shrink: 0; }
.set-actions {
  display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap;
}
.set-actions .btn { flex: 1; min-width: 100px; justify-content: center; }

/* ---------- 空状态补充 ---------- */
.empty-icon { margin-bottom: 10px; }
.empty-icon svg { width: 46px; height: 46px; opacity: .3; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-2); }
.empty-sub { font-size: 12.5px; opacity: .85; margin-top: 6px; line-height: 1.6; }

/* ---------- 搜索框有内容状态 ---------- */
.search-box.has-text { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- 打印：隐藏共享版控件 ---------- */
@media print {
  .btn, .viewswitch, .seg, .toolbar, .tabs, .col-act, .banner, .updated-line { display: none !important; }
  .boot, .gate { display: none !important; }
}

/* 统计卡「正常」绿 */
.stat.s-ok::before { background: var(--ok); }
.stat.s-ok .stat-value { color: #15803d; }
