/* ============================================================
   一人公司 · 设计系统「墨与朱」
   深墨蓝 + 暖纸白 + 朱砂强调。服务端渲染,无 build 工具链。
   所有页面共用本文件,页面内不再写 inline style。
   ============================================================ */

:root {
  /* 墨 — 主色阶 */
  --ink-900: #131c2e;
  --ink-800: #1a2740;
  --ink-700: #24344f;
  --ink-600: #33455f;
  --ink-500: #4a5b73;
  --ink-300: #93a1b5;
  --ink-150: #ccd4df;

  /* 朱 — 强调 */
  --cinnabar: #c8421d;
  --cinnabar-deep: #a83617;
  --cinnabar-soft: #fbeae4;

  /* 纸 — 背景 */
  --paper: #f6f5f1;
  --paper-deep: #edebe4;
  --card: #ffffff;

  /* 语义 */
  --text: #22272e;
  --muted: #707a87;
  --faint: #9aa3ae;
  --border: #e3e1da;
  --border-strong: #cfccc2;

  --ok: #2e7d4f;
  --ok-soft: #e4f2e9;
  --warn: #b97509;
  --warn-soft: #fcf3e1;
  --danger: #c0392b;
  --danger-soft: #fbe9e7;
  --info: #2c5f9e;
  --info-soft: #e7eef7;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(19, 28, 46, 0.05), 0 2px 8px rgba(19, 28, 46, 0.04);
  --shadow-pop: 0 4px 12px rgba(19, 28, 46, 0.12), 0 12px 40px rgba(19, 28, 46, 0.18);

  --font-ui: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
             "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
code { background: var(--paper-deep); padding: 1px 6px; border-radius: 4px; }

::selection { background: var(--cinnabar-soft); color: var(--cinnabar-deep); }

/* ---------- 顶栏 ---------- */

.topbar {
  background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
  color: #e8ecf2;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 2px 10px rgba(19,28,46,0.25);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: 1px;
  color: #fff; white-space: nowrap; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .seal {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--cinnabar);
  color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset;
}

.topnav { display: flex; gap: 2px; flex: 1; justify-content: center; min-width: 0; overflow: visible; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: rgba(232,236,242,0.78);
  padding: 6px 14px; border-radius: 7px;
  font-size: 13.5px; white-space: nowrap;
  transition: background .12s, color .12s;
}
.topnav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.topnav a.active {
  background: rgba(255,255,255,0.14); color: #fff; font-weight: 600;
  box-shadow: 0 -2px 0 var(--cinnabar) inset;
}

/* 顶部分组下拉(按业务闭环: 营销获客/交付售后/产品资产/系统) */
.navgroup { position: relative; display: flex; }
.navgroup-top, .navtop-link {
  color: rgba(232,236,242,0.78); padding: 6px 13px; border-radius: 7px;
  font-size: 13.5px; white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px; transition: background .12s, color .12s;
}
.navgroup-top:hover, .navtop-link:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.navgroup.active > .navgroup-top, .navtop-link.active {
  background: rgba(255,255,255,0.14); color: #fff; font-weight: 600;
  box-shadow: 0 -2px 0 var(--cinnabar) inset;
}
.navgroup .caret { font-size: 9px; opacity: 0.55; }
.navdrop {
  position: absolute; top: 100%; left: 0; min-width: 172px;
  background: #1b2230; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  padding: 8px 6px 6px; box-shadow: 0 10px 28px rgba(0,0,0,0.42);
  display: none; flex-direction: column; gap: 2px; z-index: 95;
}
.navgroup:hover .navdrop { display: flex; }
.navdrop a {
  color: rgba(232,236,242,0.82); padding: 8px 11px; border-radius: 7px;
  font-size: 13.5px; white-space: nowrap; display: flex; align-items: center; gap: 9px;
}
.navdrop a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.navdrop a.active { background: rgba(200,66,29,0.22); color: #fff; font-weight: 600; }
.navdrop .di { font-size: 14px; width: 18px; text-align: center; }
/* 更多面板(手机)按大类分组标题 */
.sheet-group { font-size: 12px; color: rgba(232,236,242,0.5); font-weight: 600; margin: 14px 4px 6px; }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-right a { color: rgba(232,236,242,0.6); font-size: 13px; padding: 5px 10px; border-radius: 6px; }
.topbar-right a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }

/* 手机端底部通栏 + 更多面板: 桌面隐藏, 手机端(媒体查询里)启用 */
.botnav { display: none; }
.sheet-mask { display: none; }

/* ---------- 页面骨架 ---------- */

.main { max-width: none; width: 100%; padding: 30px 28px 80px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: 0.5px; line-height: 1.3; }
.page-title .sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 4px; letter-spacing: 0; }
.page-desc { color: var(--muted); font-size: 13px; margin: -14px 0 20px; }

.crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--info); }

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.card-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: 0.3px; }
.card-head .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 16px 18px 14px;
  position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ink-300);
}
.stat.accent::before { background: var(--cinnabar); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 30px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.5px; line-height: 1.25; }
.stat .v small { font-size: 14px; color: var(--faint); font-weight: 400; }

/* ---------- 表格 ---------- */

.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  letter-spacing: 0.5px; padding: 8px 12px;
  border-bottom: 1.5px solid var(--border-strong);
  white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #fbfaf7; }
tbody tr.rowlink { cursor: pointer; }
td .cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ticket { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-600); font-weight: 600; white-space: nowrap; }
a.ticket:hover { color: var(--cinnabar); text-decoration: none; }

/* ---------- 徽章(圆点风格) ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550; white-space: nowrap;
  padding: 2px 9px 2px 7px; border-radius: 99px;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-ok     { color: var(--ok);     background: var(--ok-soft);     border-color: #cde5d6; }
.badge-warn   { color: var(--warn);   background: var(--warn-soft);   border-color: #f3e2bb; }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: #f2cfc9; }
.badge-info   { color: var(--info);   background: var(--info-soft);   border-color: #cddcef; }
.badge-muted  { color: var(--muted);  background: var(--paper-deep);  border-color: var(--border); }
.badge-plain::before { display: none; }

.chip {
  display: inline-block; font-size: 11.5px; color: var(--ink-500);
  background: var(--paper-deep); border-radius: 4px; padding: 1px 7px; margin: 1px 4px 1px 0;
  font-family: var(--font-mono);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 550;
  padding: 8px 16px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; line-height: 1.4;
  transition: background .12s, border-color .12s, transform .05s, box-shadow .12s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--ink-800); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset; }
.btn-primary:hover { background: var(--ink-700); }
.btn-accent { background: var(--cinnabar); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset; }
.btn-accent:hover { background: var(--cinnabar-deep); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #256b42; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--paper); border-color: var(--ink-300); }
.btn-sm { font-size: 12.5px; padding: 5px 11px; border-radius: 6px; }
.btn-lg { font-size: 15px; padding: 11px 24px; }

.btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 表单 ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-600); font-weight: 550; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--faint); margin-top: 4px; }

.input, .select, .textarea {
  width: 100%; font-family: var(--font-ui); font-size: 14px; color: var(--text);
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 9px 12px; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--ink-500);
  box-shadow: 0 0 0 3px rgba(36, 52, 79, 0.1);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.input.mono, .textarea.mono { font-family: var(--font-mono); font-size: 13px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23707a87' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.checkline input { width: 15px; height: 15px; accent-color: var(--cinnabar); }

/* ---------- 过滤条 ---------- */

.filterbar { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.pill {
  display: inline-block; font-size: 13px; padding: 5px 14px; border-radius: 99px;
  color: var(--ink-600); background: var(--card); border: 1px solid var(--border-strong);
  transition: all .12s;
}
.pill:hover { border-color: var(--ink-500); text-decoration: none; }
.pill.active { background: var(--ink-800); color: #fff; border-color: var(--ink-800); font-weight: 550; }
.filterbar .spacer { flex: 1; }

/* ---------- Tabs(项目详情页) ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs a {
  padding: 9px 16px 11px; font-size: 14px; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 500;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--cinnabar-deep); border-bottom-color: var(--cinnabar); font-weight: 650; }
.tabs .cnt { font-size: 11.5px; color: var(--faint); font-family: var(--font-mono); margin-left: 3px; }
.tabs a.active .cnt { color: var(--cinnabar); }

/* ---------- 提示横幅 / 空态 ---------- */

.banner { border-radius: var(--radius-sm); padding: 11px 15px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid; }
.banner-ok { background: var(--ok-soft); color: var(--ok); border-color: #cde5d6; }
.banner-warn { background: var(--warn-soft); color: var(--warn); border-color: #f3e2bb; }
.banner-danger { background: var(--danger-soft); color: var(--danger); border-color: #f2cfc9; }
.banner-info { background: var(--info-soft); color: var(--info); border-color: #cddcef; }

.empty {
  text-align: center; color: var(--faint); font-size: 13.5px;
  padding: 44px 20px; line-height: 1.8;
}
.empty .glyph { font-size: 30px; display: block; margin-bottom: 6px; opacity: 0.5; }

/* ---------- 元信息表(详情页) ---------- */

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 28px; }
.meta .item .k { font-size: 12px; color: var(--faint); margin-bottom: 2px; }
.meta .item .v { font-size: 13.5px; }

/* ---------- Markdown 阅读区 ---------- */

.md { font-size: 14.5px; line-height: 1.85; color: var(--text); }
.md h1 { font-size: 21px; font-weight: 700; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.md h2 { font-size: 17.5px; font-weight: 650; margin: 24px 0 10px; padding-left: 10px; border-left: 3px solid var(--cinnabar); }
.md h3 { font-size: 15.5px; font-weight: 650; margin: 18px 0 8px; }
.md h4 { font-size: 14px; font-weight: 650; margin: 14px 0 6px; color: var(--ink-600); }
.md p { margin: 7px 0; }
.md li { margin: 4px 0 4px 22px; }
.md pre {
  background: var(--ink-900); color: #dde4ee; border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.65; margin: 12px 0;
}
.md pre code { background: none; padding: 0; color: inherit; }
.md table { margin: 0; min-width: 100%; }
/* 宽表格(抖音分镜表)在窄屏可横滚而非撑破/被切 */
.md-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; }
.md-table-wrap table th, .md-table-wrap table td { white-space: nowrap; }
.md .mermaid { background: #fbfaf7; border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin: 12px 0; text-align: center; }
.md blockquote { border-left: 3px solid var(--ink-150); padding: 2px 14px; color: var(--muted); margin: 10px 0; }

/* ---------- Modal ---------- */

.modal-mask {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(19, 28, 46, 0.45);
  align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; animation: fadeIn .15s ease; }
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-pop);
  width: 100%; max-width: 640px; max-height: 88vh;
  display: flex; flex-direction: column;
  animation: popIn .18s cubic-bezier(.2,.9,.3,1.2);
}
.modal.wide { max-width: 940px; }
/* 弹窗里用 <form> 包住 body+foot 时,让 form 成为透明的 flex 直通层:
   否则 form 默认不收缩、会顶破 .modal 的 max-height,把 .modal-foot(创建/取消按钮)
   挤出屏幕外,小屏下点不到 → 无法提交。min-height:0 才允许 body 滚动。 */
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-x {
  border: none; background: none; font-size: 22px; line-height: 1; color: var(--faint);
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.modal-x:hover { background: var(--paper-deep); color: var(--text); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes sheetUp { from { transform: translateY(100%); } }

/* ---------- Toast ---------- */

#toast-root { position: fixed; top: 66px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink-800); color: #fff; font-size: 13.5px;
  padding: 11px 18px; border-radius: 9px; box-shadow: var(--shadow-pop);
  animation: toastIn .22s cubic-bezier(.2,.9,.3,1.15); max-width: 380px;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------- 加载态 ---------- */

.spin {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: rot .7s linear infinite; vertical-align: -2px;
}
.btn-ghost .spin, .inline-spin { border-color: var(--ink-150); border-top-color: var(--ink-600); }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 登录页 ---------- */

.login-stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(200, 66, 29, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(44, 95, 158, 0.07), transparent 60%),
    var(--paper);
  padding: 24px;
}
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-pop); padding: 38px 36px 32px; width: 100%; max-width: 380px;
}
.login-card .seal-lg {
  width: 46px; height: 46px; border-radius: 11px; background: var(--cinnabar); color: #fff;
  font-size: 21px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 4px 12px rgba(200,66,29,0.3);
}
.login-card h1 { font-size: 20px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

/* ---------- QR / 链接展示 ---------- */

.linkbox { display: flex; gap: 8px; align-items: center; }
.linkbox .input { flex: 1; font-family: var(--font-mono); font-size: 12.5px; background: #fbfaf7; }
.qrbox { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: inline-block; }

/* ---------- 危险区 ---------- */

.danger-zone { border-color: #f2cfc9; }
.danger-zone .card-head h2 { color: var(--danger); }

/* ---------- 工具类 ---------- */

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }
.w100 { width: 100%; }
details > summary { cursor: pointer; color: var(--muted); font-size: 13px; user-select: none; }
details[open] > summary { margin-bottom: 8px; }

@media (max-width: 820px) {
  /* ---- 顶栏: 只留 品牌 + 退出; 导航移到底部通栏 ---- */
  .topbar { padding: 0 12px; gap: 8px; }
  .brand span.txt { display: inline; }
  .topnav { display: none; }
  .topbar-right { margin-left: auto; }

  /* ---- 底部通栏(常用 4 项 + 更多, 等分不滚动, 适配 iPhone 安全区) ---- */
  .botnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
    box-shadow: 0 -2px 14px rgba(19,28,46,0.3);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .botnav > a, .botnav > .botmore-btn {
    flex: 1 1 0; min-width: 0; min-height: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 8px 2px 7px; border: none; background: transparent; cursor: pointer;
    font-family: inherit; font-size: 10.5px; letter-spacing: .2px;
    color: rgba(232,236,242,0.58); position: relative;
    transition: color .15s, background .12s;
    -webkit-tap-highlight-color: transparent;
  }
  .botnav .ic { font-size: 20px; line-height: 1; transition: transform .15s; }
  .botnav .tx { white-space: nowrap; }
  .botnav > a:hover, .botnav > .botmore-btn:hover { text-decoration: none; }
  .botnav > a:active, .botnav > .botmore-btn:active { background: rgba(255,255,255,0.06); }
  .botnav > a:active .ic, .botnav > .botmore-btn:active .ic { transform: scale(.9); }
  .botnav > a.active, .botnav > .botmore-btn.active { color: #fff; }
  .botnav > a.active .tx, .botnav > .botmore-btn.active .tx { font-weight: 600; }
  .botnav > a.active::before, .botnav > .botmore-btn.active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--cinnabar);
  }

  /* ---- 更多面板(从底部升起的 sheet) ---- */
  .sheet-mask {
    display: none; position: fixed; inset: 0; z-index: 110;
    background: rgba(19,28,46,0.5); align-items: flex-end; justify-content: center;
  }
  .sheet-mask.show { display: flex; animation: fadeIn .18s ease; }
  .sheet {
    width: 100%; max-width: 600px; background: var(--card); border-radius: 18px 18px 0 0;
    padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 40px rgba(19,28,46,0.25);
    animation: sheetUp .26s cubic-bezier(.16,1,.3,1);
  }
  .sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: var(--border-strong); margin: 4px auto 12px; }
  .sheet-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 2px 12px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .sheet-grid a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    min-height: 66px; padding: 12px 4px; border-radius: 13px;
    color: var(--text); font-size: 11.5px; text-align: center;
    background: var(--paper); border: 1px solid var(--border);
  }
  .sheet-grid a .ic { font-size: 22px; line-height: 1; }
  .sheet-grid a:hover { text-decoration: none; }
  .sheet-grid a:active { transform: scale(.96); background: var(--paper-deep); }
  .sheet-grid a.active { border-color: var(--cinnabar); color: var(--cinnabar-deep); background: var(--cinnabar-soft); }

  /* 顶栏: 退出 tap 区放大 */
  .topbar-right a { padding: 9px 12px; }

  /* ---- 骨架间距(底部留出通栏高度) ---- */
  .main { padding: 18px 12px calc(80px + env(safe-area-inset-bottom)); }
  .card { padding: 15px 14px; }
  .page-head { margin-bottom: 16px; }
  .page-title { font-size: 20px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .v { font-size: 24px; }

  /* ---- 触控目标 ≥ 手指尺寸 ---- */
  .btn { min-height: 40px; padding: 9px 16px; }
  .btn-sm { min-height: 34px; }
  .input, .select, .textarea { font-size: 16px; }  /* 16px 防 iOS 聚焦缩放 */
  .input, .select { min-height: 44px; }            /* 触控高度; textarea 不限(保留 80px 高度) */
  /* 手机端下拉/输入: 柔和填充 + 大箭头, 不再是生硬白盒 */
  .select {
    background-color: var(--paper); border-color: var(--border);
    background-position: right 13px center; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23707a87' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  .input { background-color: var(--paper); border-color: var(--border); }

  /* 筛选条: 2 列网格 — 搜索框独占整行, 下拉/按钮各半行(取代一长条全宽下拉墙) */
  .filterbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
  .filterbar > .input, .filterbar > textarea { grid-column: 1 / -1; }
  .filterbar.filterbar > .select { min-width: 0; width: auto; }  /* 网格自动撑满, 压掉某些页 min-width:180 */
  .filterbar > .btn, .filterbar > a.btn { width: 100%; }
  .filterbar > .spacer { display: none; }

  /* ---- 自定义下拉(替换原生 select 弹窗): 触发钮 + 主题化选项 sheet ---- */
  .msel { position: relative; width: 100%; }
  .msel-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .msel-trigger {
    width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--paper); color: var(--text); font-size: 16px; font-family: inherit; line-height: 1.3;
    text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: border-color .12s, box-shadow .12s;
  }
  .msel-trigger .msel-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .msel-trigger .msel-val.placeholder { color: var(--muted); }
  .msel-trigger .msel-cv {
    flex-shrink: 0; width: 12px; height: 8px;
    background: no-repeat center/12px 8px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23707a87' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    transition: transform .2s;
  }
  .msel-trigger[aria-expanded="true"] { border-color: var(--ink-500); box-shadow: 0 0 0 3px rgba(36,52,79,.1); }
  .msel-trigger[aria-expanded="true"] .msel-cv { transform: rotate(180deg); }

  .opt-list { margin-top: 2px; max-height: 56vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .opt-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 12px; border-radius: 10px; font-size: 15.5px; color: var(--text); cursor: pointer;
  }
  .opt-item:active { background: var(--paper-deep); }
  .opt-item.sel { color: var(--cinnabar-deep); font-weight: 600; background: var(--cinnabar-soft); }
  .opt-item .ck { flex-shrink: 0; color: var(--cinnabar); opacity: 0; }
  .opt-item.sel .ck { opacity: 1; }

  /* ---- 列表表格 → 卡片(JS 已按表头补 data-label) ---- */
  .table-wrap.cards { overflow: visible; margin: 0; padding: 0; }
  table.cards-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.cards-sm, table.cards-sm tbody { display: block; width: 100%; }
  table.cards-sm tr {
    display: block; background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-card); padding: 4px 14px; margin-bottom: 12px;
  }
  table.cards-sm tbody tr:hover { background: var(--card); }
  table.cards-sm td {
    display: block; padding: 9px 0; border-bottom: 1px dashed var(--border);
    font-size: 13.5px; white-space: normal;
  }
  table.cards-sm tr td:last-child { border-bottom: none; }
  table.cards-sm td::before {
    content: attr(data-label); display: block; margin-bottom: 4px;
    font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .3px;
  }
  table.cards-sm td:not([data-label])::before,
  table.cards-sm td[data-label=""]::before { content: none; }
  /* 卡片里放开原表格设的窄宽度限制, 让内容铺满整行 */
  table.cards-sm td .content-clamp { max-width: none; min-width: 0; -webkit-line-clamp: 4; }
  table.cards-sm td .att-inline-list { max-width: none; }

  /* ---- 弹窗占满小屏 ---- */
  .modal-mask { padding: 12px; }
  .modal { max-width: none; max-height: 92vh; }
  .modal.wide { max-width: none; }
  .tabs { gap: 2px; }
}

/* ---------- 可访问性 (键盘焦点 + 减少动效) ---------- */
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
