/* ============================================================
   面料外贸跟单工具 · 设计系统（暖纸版）
   ------------------------------------------------------------
   视觉方向参考：北欧纸品品牌（FÅNGA）的暖米白 + 陶土红
     · 底色像未漂白的纸，不用纯白，长时间看不刺眼
     · 主色用陶土红（clay），来自染厂、坯布、朱砂印泥的联想
     · 标题用衬线体，正文用无衬线，拉开气质层次
     · 大圆角 + 细线，弱化「后台系统」的硬度
   全部纯 CSS / 本地字体，离线可用。
   ============================================================ */

/* ---------- 1. 设计令牌：暖纸（默认） ---------- */
:root {
  /* 纸张层次 */
  --bg-0: #f2ebdf;   /* 页面底 */
  --bg-1: #fbf7f0;   /* 卡片 */
  --bg-2: #f0e8da;   /* 次级填充 */
  --bg-3: #ffffff;   /* 浮起 */
  --bg-hover: #ece2d2;

  /* 描边：暖灰，不用冷灰 */
  --line: #e5dbcb;
  --line-2: #d9cbb6;
  --line-strong: #c4b39a;

  /* 墨色：带一点暖褐，不用纯黑 */
  --text: #1f1a15;
  --text-2: #6a5d51;
  --text-3: #6f6355;
  --text-inv: #fdf8f1;

  /* 主色：陶土红 */
  --accent: #b4532a;
  --accent-ink: #a34a25;
  --accent-2: #c96a3e;
  --accent-soft: rgba(180, 83, 42, 0.1);
  --accent-line: rgba(180, 83, 42, 0.32);

  /* 功能色：都往暖里调，避免突兀 */
  --ok: #53704d;
  --warn: #8a5e1d;
  --bad: #a63a2e;
  --info: #7a6a52;
  --ok-soft: rgba(95, 127, 92, 0.12);
  --warn-soft: rgba(184, 128, 42, 0.13);
  --bad-soft: rgba(166, 58, 46, 0.11);
  --info-soft: rgba(122, 106, 82, 0.1);

  /* 圆角：整体更圆，贴近纸品调性 */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-full: 999px;

  /* 阴影：暖调、极淡 */
  --sh-1: 0 1px 2px rgba(74, 55, 38, 0.05);
  --sh-2: 0 6px 20px rgba(74, 55, 38, 0.07);
  --sh-3: 0 18px 48px rgba(74, 55, 38, 0.12);

  /* 间距 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", sans-serif;
  /* 标题衬线：中文优先宋体，西文回落 Georgia，避免系统缺字 */
  --font-display: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC",
    SimSun, Georgia, serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", monospace;

  /* 字号 */
  --fs-11: 12.5px;
  --fs-12: 13.5px;
  --fs-13: 14.5px;
  --fs-14: 15.5px;
  --fs-16: 18px;
  --fs-20: 23px;
  --fs-26: 30px;
  --fs-32: 36px;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;

  --sidebar-w: 252px;
  --header-h: 68px;
}

/* ---------- 1b. 夜间：暖炭（可选） ---------- */
[data-theme='dark'] {
  --bg-0: #17130f;
  --bg-1: #1f1a15;
  --bg-2: #262019;
  --bg-3: #2d261e;
  --bg-hover: #332b22;

  --line: #322a21;
  --line-2: #403628;
  --line-strong: #57493a;

  --text: #f2e9dc;
  --text-2: #b8a894;
  --text-3: #a89a95;
  --text-inv: #1a1511;

  --accent: #d97757;
  --accent-ink: #e89b80;
  --accent-2: #e58f70;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --accent-line: rgba(217, 119, 87, 0.38);

  --ok: #9dbb93;
  --warn: #e3b45f;
  --bad: #d9705f;
  --info: #b8a894;
  --ok-soft: rgba(143, 170, 134, 0.14);
  --warn-soft: rgba(217, 168, 78, 0.14);
  --bad-soft: rgba(217, 112, 95, 0.14);
  --info-soft: rgba(184, 168, 148, 0.12);

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sh-2: 0 6px 20px rgba(0, 0, 0, 0.32);
  --sh-3: 0 18px 48px rgba(0, 0, 0, 0.45);
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸张的细微颗粒与顶部暖光 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 250, 240, 0.9) 0%, rgba(255, 250, 240, 0) 55%),
    radial-gradient(80% 60% at 100% 0%, rgba(180, 83, 42, 0.05) 0%, rgba(180, 83, 42, 0) 60%);
}

[data-theme='dark'] body::before {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(217, 119, 87, 0.07) 0%, rgba(217, 119, 87, 0) 55%);
}

::selection { background: rgba(180, 83, 42, 0.18); color: var(--text); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--r-full);
  border: 3px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 3. 框架 ---------- */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  height: var(--header-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-8);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-1) 86%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: calc(var(--sidebar-w) - var(--s-6));
  user-select: none;
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(180, 83, 42, 0.28);
  flex: 0 0 auto;
  overflow: hidden;
  cursor: pointer;
}

.brand-mark svg { width: 16px; height: 16px; color: #fff; transition: transform 420ms var(--ease-out); }
.brand:hover .brand-mark svg { transform: rotate(90deg); }

.brand-mark::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
  transform: translateX(-120%);
  pointer-events: none;
}

.brand:hover .brand-mark::after { animation: weave-sweep 620ms var(--ease-out); }

@keyframes weave-sweep { to { transform: translateX(120%); } }

/* 品牌名用衬线，跟参考一致 */
.brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-sub {
  font-size: var(--fs-11);
  color: var(--text-3);
  padding-left: var(--s-2);
  border-left: 1px solid var(--line-2);
  margin-left: var(--s-1);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.topbar .sp { flex: 1; }

/* 侧边栏 */
.body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-1), color-mix(in srgb, var(--bg-1) 65%, var(--bg-0)));
  display: flex;
  flex-direction: column;
  padding: var(--s-4) var(--s-3);
  gap: 2px;
}

.nav-group-label {
  font-size: var(--fs-11);
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: var(--s-4) var(--s-3) var(--s-2);
  font-weight: 700;
}

.nav-group-label:first-child { padding-top: var(--s-1); }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px var(--s-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  font-size: var(--fs-13);
  letter-spacing: 0.01em;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  user-select: none;
}

.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.7; }
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--bg-3);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--sh-1);
}

.nav-item.active svg { opacity: 1; color: var(--accent); }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: var(--r-full);
  background: var(--accent);
}

.nav-item .badge {
  margin-left: auto;
  font-size: var(--fs-11);
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--bad-soft);
  color: var(--bad);
  font-weight: 700;
  line-height: 17px;
}

.sidebar-foot {
  margin-top: auto;
  padding: var(--s-3);
  font-size: var(--fs-11);
  color: var(--text-3);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

/* 主内容 */
.content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: var(--s-8) var(--s-10) var(--s-10);
  scroll-behavior: smooth;
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.page-eyebrow {
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 6px;
}

/* 页面标题用衬线，是整套视觉的记忆点 */
.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.18;
  color: var(--text);
}

.page-desc {
  color: var(--text-2);
  font-size: var(--fs-13);
  margin: var(--s-2) 0 0;
  max-width: 66ch;
  line-height: 1.65;
}

.page-head .sp { flex: 1; }

/* ---------- 4. 按钮：药丸形 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  /* 次按钮：只留描边，不抢主按钮的视线 */
  background: transparent;
  color: var(--text);
  font-size: var(--fs-13);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.btn svg { width: 16px; height: 16px; opacity: 0.85; }

.btn:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }

/* 主按钮：深墨药丸，和参考里的黑 CTA 一致；全页只它是实心 */
.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--text-inv);
  font-weight: 600;
  box-shadow: var(--sh-1);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--text) 88%, var(--accent));
  border-color: transparent;
}

.btn-primary svg { opacity: 0.95; }

/* 次强调：陶土红描边 */
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  box-shadow: none;
}

.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm { height: 32px; padding: 0 14px; gap: 6px; font-size: var(--fs-12); }
.btn-sm svg { width: 14px; height: 14px; }

.btn-danger:hover { border-color: var(--bad); color: var(--bad); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.icon-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; }

/* ---------- 5. 卡片 ---------- */
.card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-5);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

/* 卡头与卡身共用同一条左右边距（--s-5），标题、表格首列、说明文字竖向对齐 */
.card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  min-height: 56px;
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--line);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text);
}

.card-title .count {
  font-family: var(--font);
  color: var(--text-3);
  font-weight: 500;
  margin-left: 8px;
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
}

.card-head .sp { flex: 1; }
.card-body { padding: var(--s-5); }
.card-body.flush { padding: 0; }

.card-note {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-11);
  line-height: 1.7;
  background: color-mix(in srgb, var(--bg-2) 45%, transparent);
}

/* 焦点卡：左上角一抹陶土暖光 */
.card-focus {
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(180, 83, 42, 0.09), transparent 60%),
    var(--bg-1);
  border-color: var(--accent-line);
}

/* ---------- 6. 指标 ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-3);
}

/* 指标卡：平铺在页面底上，不再浮起加阴影；数字是主角，标签退后 */
.metric {
  min-width: 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--bg-1);
  border: 1px solid var(--line);
}

.metric-k {
  font-size: var(--fs-11);
  color: var(--text-3);
  letter-spacing: 0.02em;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-v {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric-v.sm { font-size: var(--fs-16); }
.metric-v.muted { color: var(--text-3); font-weight: 500; }
.metric-sub { font-size: var(--fs-11); color: var(--text-3); margin-top: 3px; }

/* ---------- 7. 标签 ---------- */
.pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 17px;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.pill.no-dot::before { display: none; }

.pill.GREEN { background: var(--ok-soft); color: var(--ok); }
.pill.AMBER { background: var(--warn-soft); color: var(--warn); }
.pill.RED { background: var(--bad-soft); color: var(--bad); }
.pill.WARN { background: var(--warn-soft); color: var(--warn); }
.pill.BLUE { background: var(--info-soft); color: var(--info); }
.pill.GRAY { background: var(--bg-2); color: var(--text-3); }

.text-bad { color: var(--bad); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }
.text-ok { color: var(--ok); font-weight: 600; }
.text-dim { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }

.mono {
  font-family: var(--mono);
  font-size: var(--fs-11);
  color: var(--text-3);
  letter-spacing: -0.01em;
}

/* ---------- 8. 表格 ---------- */
.table-wrap { overflow: auto; max-height: 62vh; }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-13);
}

/* 表头：去掉大写字距和底色块，只靠浅字 + 一条略深的线和表身分开 */
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-weight: 500;
  font-size: var(--fs-11);
  color: var(--text-3);
  letter-spacing: 0.02em;
  padding: 10px var(--s-4);
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

tbody td {
  padding: 11px var(--s-4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--text);
  white-space: nowrap;
  vertical-align: middle;
}

/* 首尾列与卡片内边距对齐 */
thead th:first-child, tbody td:first-child { padding-left: var(--s-5); }
thead th:last-child, tbody td:last-child { padding-right: var(--s-5); }

tbody tr { transition: background var(--t-fast) var(--ease); }
tbody tr:hover td { background: var(--bg-2); }
tbody tr:last-child td { border-bottom: none; }

/* 数字列右对齐、等宽数字，竖着一眼能比大小。
   td.num 在部分表里也用于日期/单号且表头未标，所以只在表头也标了 num 的表里右对齐，避免表头和数据错位 */
th.num, th.t-right, td.t-right,
table:has(th.num) td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions, th.actions { text-align: right; }
td .btn + .btn { margin-left: 6px; }

tr.rowdone td { color: var(--text-3); }
tr.rowfocus td { background: var(--accent-soft); }
tr.rowfocus:hover td { background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-2)); }

/* ---------- 9. 步骤时间轴 ---------- */
.steps { display: flex; flex-direction: column; }

.step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: var(--s-3);
  position: relative;
}

.step::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 34px;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--line-2);
}

.step:last-child::before { display: none; }
.step.is-done::before { background: linear-gradient(180deg, var(--ok), color-mix(in srgb, var(--ok) 35%, transparent)); }

.step-node {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-11);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--bg-1);
  border: 1.5px solid var(--line-strong);
  color: var(--text-2);
  margin-top: 6px;
  position: relative;
  z-index: 1;
  transition: all var(--t-base) var(--ease);
}

.step.is-done .step-node {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  animation: stitch-pop 360ms var(--ease-out);
}

.step.is-overdue .step-node {
  background: var(--bad-soft);
  border-color: var(--bad);
  color: var(--bad);
}

.step.is-next .step-node {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-1);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.step.is-next .step-node::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: needle-pulse 2.4s var(--ease) infinite;
}

@keyframes needle-pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  70% { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

@keyframes stitch-pop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.step-main { padding: 7px 0 var(--s-3); min-width: 0; }

.step-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  row-gap: 6px;
}

.step-name {
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.step.is-done .step-name { color: var(--text-2); }

.step-meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: 4px;
  font-size: var(--fs-12);
  color: var(--text-3);
  flex-wrap: wrap;
}

.step-meta b { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

.step-actions { margin-left: auto; display: flex; gap: 6px; }

.step-detail {
  margin: var(--s-2) 0 var(--s-3) 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  padding: var(--s-4);
  animation: detail-in var(--t-base) var(--ease-out);
}

@keyframes detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s-3) var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px dashed var(--line-2);
  margin-bottom: var(--s-3);
}

.detail-item .k {
  font-size: var(--fs-11);
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.detail-item .v { font-size: var(--fs-12); color: var(--text); margin-top: 2px; }

.log-list { display: flex; flex-direction: column; gap: var(--s-2); }

.log {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: var(--s-3);
  padding-left: var(--s-3);
  border-left: 2px solid var(--accent-line);
  font-size: var(--fs-12);
}

.log-time { color: var(--text-3); font-family: var(--mono); font-size: var(--fs-11); padding-top: 1px; }
.log-action { color: var(--text); }
.log-diff { margin-top: 3px; font-size: var(--fs-11); color: var(--text-3); line-height: 1.7; }
.log-diff .k { color: var(--text-3); }
.log-diff .v { color: var(--text-2); }
.log-effect { margin-top: 3px; font-size: var(--fs-11); color: var(--warn); }

/* ---------- 10. 空态 / 加载 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-8) var(--s-4);
  text-align: center;
  color: var(--text-2);
  font-size: var(--fs-13);
}

/* 空态图标缩小、去边框：它只是提示，不该比数据还显眼 */
.empty-art {
  width: 64px;
  height: 64px;
  margin-bottom: var(--s-1);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  color: var(--text-3);
}

.empty-art svg { width: 28px; height: 28px; opacity: 0.6; }

.empty-title {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  color: var(--text);
}

.empty-desc { font-size: var(--fs-13); color: var(--text-3); max-width: 42ch; line-height: 1.7; }

.empty-mini {
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-12);
  line-height: 1.7;
  white-space: normal;
}
.empty-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 37%, var(--bg-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
  height: 12px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- 11. 提示条 ---------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--fs-12);
  line-height: 1.7;
  margin-bottom: var(--s-4);
  border: 1px solid transparent;
}

.banner svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }
.banner .sp { flex: 1; }

.banner-info { background: var(--info-soft); border-color: var(--line-2); color: var(--info); }
.banner-warn { background: var(--warn-soft); border-color: rgba(184, 128, 42, 0.28); color: var(--warn); }
.banner-bad { background: var(--bad-soft); border-color: rgba(166, 58, 46, 0.26); color: var(--bad); }
.banner-ok { background: var(--ok-soft); border-color: rgba(95, 127, 92, 0.26); color: var(--ok); }

.banner-body { color: var(--text); flex: 1; min-width: 0; }
.banner-body b { color: inherit; }

/* ---------- 12. Toast ---------- */
.toast-stack {
  position: fixed;
  right: var(--s-6);
  bottom: var(--s-6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-width: min(420px, calc(100vw - 48px));
  pointer-events: none;
}

/* Toast：去掉陶土色左边条，改用一个小圆点；阴影降一档，不再像弹窗 */
.toast {
  position: relative;
  pointer-events: auto;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 10px var(--s-4) 10px calc(var(--s-4) + 14px);
  font-size: var(--fs-12);
  line-height: 1.65;
  color: var(--text);
  box-shadow: var(--sh-2);
  animation: toast-in var(--t-base) var(--ease-out);
  white-space: pre-wrap;
  word-break: break-word;
}

.toast::before {
  content: '';
  position: absolute;
  left: var(--s-4);
  top: calc(10px + 0.825em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 13. 说明书 ---------- */
.manual-layout {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}

.manual-toc {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--s-1);
}

.toc-item {
  padding: 7px var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-12);
  color: var(--text-2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--t-fast) var(--ease);
}

.toc-item:hover { background: var(--bg-2); color: var(--text); }

.toc-item.active {
  color: var(--accent-ink);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.doc h2 {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: 700;
  margin: var(--s-6) 0 var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}

.doc h2:first-child { margin-top: 0; }

.doc h3 {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  margin: var(--s-5) 0 var(--s-2);
}

.doc p { margin: 0 0 var(--s-3); color: var(--text-2); line-height: 1.8; }
.doc ul, .doc ol { margin: 0 0 var(--s-3); padding-left: 1.4em; color: var(--text-2); line-height: 1.9; }
.doc li { margin-bottom: 3px; }
.doc strong { color: var(--text); font-weight: 600; }
.doc code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  color: var(--accent-ink);
}

.doc .kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-11);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  color: var(--text-2);
}

.doc-steps { counter-reset: dstep; list-style: none; padding: 0; }

.doc-steps li {
  position: relative;
  padding-left: 34px;
  margin-bottom: var(--s-3);
  color: var(--text-2);
  line-height: 1.8;
}

.doc-steps li::before {
  counter-increment: dstep;
  content: counter(dstep);
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-11);
  font-weight: 700;
  display: grid;
  place-items: center;
}

.callout {
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin: var(--s-3) 0;
  font-size: var(--fs-12);
  line-height: 1.75;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.callout-key { border-left: 3px solid var(--accent); }
.callout-warn { border-left: 3px solid var(--warn); }
.callout-ok { border-left: 3px solid var(--ok); }

.callout-title { font-weight: 700; color: var(--text); margin-bottom: 3px; }

.manual-search { position: relative; margin-bottom: var(--s-4); max-width: 520px; }

.manual-search input {
  width: 100%;
  height: 38px;
  padding: 0 var(--s-3) 0 36px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--text);
  font-size: var(--fs-12);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.manual-search input::placeholder { color: var(--text-3); }

.manual-search input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.manual-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

/* ---------- 14. 分区标题 ---------- */
.section-title {
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: var(--s-5) 0 var(--s-3);
}

.section-title:first-child { margin-top: 0; }

/* ---------- 15. 工具条 ---------- */
.toolbar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.toolbar .sp { flex: 1; }

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--line);
  gap: 2px;
}

.seg button {
  height: 26px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: var(--r-full);
  font-size: var(--fs-11);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}

.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg-3); color: var(--text); box-shadow: var(--sh-1); font-weight: 600; }

/* ---------- 16. 进场动画 ---------- */
.fade-up { animation: fade-up var(--t-slow) var(--ease-out) both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stagger > * { animation: fade-up var(--t-slow) var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }

/* ---------- 17. 首次启动引导 ---------- */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg-0) 78%, transparent);
  backdrop-filter: blur(10px);
  animation: fade-in var(--t-slow) var(--ease) both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.welcome-card {
  width: min(580px, calc(100vw - 48px));
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: var(--s-8);
  animation: welcome-in 420ms var(--ease-out) both;
}

@keyframes welcome-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(180, 83, 42, 0.3);
  margin-bottom: var(--s-4);
}

.welcome-mark svg { width: 26px; height: 26px; color: #fff; }

.welcome h2 {
  font-family: var(--font-display);
  font-size: var(--fs-26);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2);
}

.welcome p { color: var(--text-2); margin: 0 0 var(--s-5); line-height: 1.8; }

.welcome-list { display: flex; flex-direction: column; gap: var(--s-4); margin-bottom: var(--s-6); }

.welcome-item { display: grid; grid-template-columns: 26px 1fr; gap: var(--s-3); align-items: start; }

.welcome-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-11);
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.welcome-item b { font-weight: 600; }
.welcome-item span { color: var(--text-2); font-size: var(--fs-12); display: block; line-height: 1.75; }

.welcome-foot { display: flex; align-items: center; gap: var(--s-2); }
.welcome-foot .sp { flex: 1; }

/* ---------- 18. 品牌记忆点 ---------- */
.thread { display: inline-flex; align-items: center; gap: 8px; }

.thread-track {
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}

.thread-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--t-slow) var(--ease-out);
}

.roll-art { width: 124px; height: 96px; opacity: 0.95; }
.roll-art .roll { animation: roll-breathe 5s var(--ease) infinite; transform-origin: center; }
.roll-art .roll:nth-child(2) { animation-delay: 0.4s; }
.roll-art .roll:nth-child(3) { animation-delay: 0.8s; }

@keyframes roll-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.kbd-hint { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-11); color: var(--text-3); }

.kbd-hint kbd {
  font-family: var(--mono);
  font-size: var(--fs-11);
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  color: var(--text-2);
}

.weave-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 7px,
    rgba(180, 83, 42, 0.07) 7px 8px
  );
  opacity: 0;
  animation: weave-flash 900ms var(--ease) forwards;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

@keyframes weave-flash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

td.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.step-node svg { width: 13px; height: 13px; }

/* ---------- 19. 响应式 ---------- */
@media (max-width: 1180px) {
  :root { --sidebar-w: 190px; }
  .content { padding: var(--s-5) var(--s-5) var(--s-8); }
  .brand-sub { display: none; }
  .page-title { font-size: var(--fs-26); }
}

@media (max-width: 900px) {
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 20. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 21. 打印 ---------- */
@media print {
  .topbar, .sidebar, .toast-stack { display: none !important; }
  .content { padding: 0; overflow: visible; }
}

/* ---------- 22. 说明书搜索命中 ---------- */
.search-hit {
  background: rgba(180, 83, 42, 0.18);
  color: var(--text);
  border-radius: 3px;
  padding: 0 1px;
  box-shadow: 0 0 0 1px rgba(180, 83, 42, 0.25);
}

.search-hit.current {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(180, 83, 42, 0.3);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  max-width: 620px;
}

.search-count {
  font-size: var(--fs-11);
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.search-nav {
  display: inline-flex;
  gap: 2px;
}

.search-nav button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--text-2);
  cursor: pointer;
  font-size: var(--fs-12);
  line-height: 1;
}

.search-nav button:hover { border-color: var(--accent); color: var(--accent); }
.search-nav button[disabled] { opacity: 0.35; cursor: default; }

/* 归档表：操作列固定在右侧，行多也不会被挤掉 */
.archive-table td.actions,
.archive-table th.actions {
  position: sticky;
  right: 0;
  background: var(--bg-1);
  box-shadow: -8px 0 12px -8px rgba(74, 55, 38, 0.18);
}

.archive-table tbody tr:hover td.actions { background: var(--bg-2); }

/* ---------- 23. 轻量弹窗（补日期等） ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg-0) 70%, transparent);
  backdrop-filter: blur(6px);
  animation: fade-in var(--t-base) var(--ease) both;
}

.modal {
  width: min(400px, calc(100vw - 40px));
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: var(--s-6);
  /* 768 高的屏上长表单也不顶出窗口 */
  max-height: calc(100vh - 48px);
  overflow: auto;
  animation: welcome-in 260ms var(--ease-out) both;
}

.modal h3 {
  margin: 0 0 var(--s-2);
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.modal p {
  margin: 0 0 var(--s-4);
  color: var(--text-2);
  font-size: var(--fs-12);
  line-height: 1.7;
}

.modal input[type='date'] {
  width: 100%;
  height: 38px;
  padding: 0 var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text);
  font-size: var(--fs-13);
}

.modal input[type='date']:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-tip {
  margin-top: var(--s-2);
  font-size: var(--fs-11);
  color: var(--text-3);
  line-height: 1.6;
}

/* 底部按钮区：主按钮靠最右，窄弹窗里按钮可折行 */
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
  margin-top: var(--s-5);
}

/* ---------- 24. 录卷页 ---------- */
.re-field {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-11);
  color: var(--text-3);
}

.re-field > span {
  letter-spacing: 0.06em;
}

.re-field select,
.re-field input {
  height: 34px;
  min-width: 150px;
  padding: 0 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text);
  font-size: var(--fs-13);
}

.re-field select:focus,
.re-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.re-table input.re-in {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-13);
  font-variant-numeric: tabular-nums;
}

.re-table input.re-in:hover { border-color: var(--line-2); }
.re-table input.re-in:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.re-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-2) 45%, transparent); }

/* ---------- 25. 对话界面 ---------- */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 48px);
  max-width: 920px;
  margin: 0 auto;
}

.chat-head {
  display: flex;
  align-items: flex-end;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
}

.chat-head .sp { flex: 1; }

.chat-scroll {
  flex: 1;
  overflow: auto;
  padding: var(--s-3) var(--s-1) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  scroll-behavior: smooth;
}

.chat-msg { display: flex; flex-direction: column; gap: 6px; }
.chat-msg-user { align-items: flex-end; }

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  font-size: var(--fs-13);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-user .chat-bubble {
  background: var(--text);
  color: var(--text-inv);
  border-bottom-right-radius: 6px;
}

.chat-msg-ai .chat-bubble {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  max-width: 88%;
}

.chat-msg-ai .chat-bubble:empty { display: none; }

/* 欢迎区 */
.chat-welcome {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-4);
}

.chat-welcome-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.chat-welcome-mark svg { width: 26px; height: 26px; }
.chat-welcome-title { font-family: var(--font-display); font-size: var(--fs-20); font-weight: 700; }
.chat-welcome-desc { color: var(--text-2); font-size: var(--fs-12); max-width: 44ch; line-height: 1.8; }

.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: var(--s-2); }

.chat-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: var(--fs-12);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}

.chat-chip:hover { border-color: var(--accent); color: var(--accent-ink); }

/* 输入区 */
.chat-input-box {
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--bg-1);
  padding: var(--s-3);
  box-shadow: var(--sh-1);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.chat-input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-input-box.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chat-input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-13);
  line-height: 1.7;
  max-height: 140px;
}

.chat-input::placeholder { color: var(--text-3); }

.chat-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.chat-actions .sp { flex: 1; }
.chat-hint { font-size: var(--fs-11); color: var(--text-3); }

/* 附件 */
.chat-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.chat-att {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: var(--fs-11);
  color: var(--text-2);
}

.chat-att-x {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.chat-att-x:hover { color: var(--bad); }

.chat-att-inline {
  font-size: var(--fs-11);
  color: var(--text-3);
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--bg-2);
}

/* 工具卡片 */
.tool-card {
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-2);
  padding: 10px 12px;
}

.tool-card.is-running {
  border-color: var(--accent-line);
  animation: tool-pulse 1.6s var(--ease) infinite;
}

@keyframes tool-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 83, 42, 0); }
  50% { box-shadow: 0 0 0 3px var(--accent-soft); }
}

.tool-card-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.tool-card-name { font-size: var(--fs-12); font-weight: 600; }
.tool-card-head .pill { margin-left: auto; }

.tool-card-body {
  margin-top: 6px;
  font-size: var(--fs-12);
  color: var(--text-2);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 演示模式开关 */
.ai-mock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-12);
  color: var(--text-2);
  margin: 10px 0 4px;
  cursor: pointer;
}

.ai-mock-row input { width: 15px; height: 15px; accent-color: var(--accent); }

/* ---------- 26. 对话工作台（会话侧栏） ---------- */
.wb {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: var(--s-4);
  height: calc(100vh - var(--header-h) - 32px);
}

.wb-side {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-1);
  overflow: hidden;
}

.wb-side-head { padding: var(--s-3); border-bottom: 1px solid var(--line); }
.wb-side-list { flex: 1; overflow: auto; padding: var(--s-2); display: flex; flex-direction: column; gap: 4px; }
.wb-empty { color: var(--text-3); font-size: var(--fs-12); text-align: center; padding: var(--s-5) 0; }

.sess {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.sess:hover { background: var(--bg-2); }
.sess.active { background: var(--bg-3); border-color: var(--line-2); box-shadow: var(--sh-1); }

.sess-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sess-pin { font-size: var(--fs-11); }

.sess-ops {
  display: none;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.sess:hover .sess-ops { display: flex; }

.sess-ops button {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-11);
  cursor: pointer;
  padding: 1px 4px;
  border-radius: var(--r-xs);
}

.sess-ops button:hover { background: var(--bg-2); color: var(--accent-ink); }

.wb-side-foot {
  border-top: 1px solid var(--line);
  padding: 8px 12px;
}

.wb-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-11);
  color: var(--text-3);
  cursor: pointer;
}

.wb-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.wb-main .chat-scroll { flex: 1; }

/* 设置弹窗里的分区标题 */
.ai-sec {
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 14px 0 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-2);
}

.ai-sec:first-of-type { border-top: none; padding-top: 0; margin-top: 6px; }

/* 会话搜索 */
.sess-search {
  width: 100%;
  margin-top: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text);
  font-size: var(--fs-11);
}

.sess-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sess-snippet {
  margin-top: 3px;
  font-size: var(--fs-11);
  color: var(--text-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 手机远程状态块 */
.im-status {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: var(--fs-11);
  color: var(--text-2);
  line-height: 1.8;
}

/* IM 行与二维码 */
.im-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.im-row .mono { flex: 1; }
.im-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 8px; }
.im-qr img { background: #fff; padding: 6px; }

/* 权限模式条 */
.perm-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 10px;
  border-bottom: 1px dashed var(--line-2);
  margin-bottom: 10px;
}
.perm-label { font-size: var(--fs-11); letter-spacing: .14em; color: var(--text-3); text-transform: uppercase; }
.perm-chip {
  height: 26px; padding: 0 10px; border-radius: var(--r-full);
  border: 1px solid var(--line-2); background: var(--bg-1); color: var(--text-2);
  font-size: var(--fs-11); cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.perm-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.perm-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.perm-desc { flex: 1; min-width: 220px; font-size: var(--fs-11); color: var(--text-3); line-height: 1.6; }

/* 思考过程 */
.chat-reason {
  max-width: 88%; margin-bottom: 6px; border-left: 2px solid var(--accent-line, var(--line-2));
  padding: 4px 10px; background: var(--bg-2); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.chat-reason summary {
  cursor: pointer; font-size: var(--fs-11); color: var(--text-3); list-style: none; outline: none;
}
.chat-reason summary::-webkit-details-marker { display: none; }
.chat-reason-body {
  margin-top: 6px; font-size: var(--fs-11); color: var(--text-2); line-height: 1.75;
  max-height: 220px; overflow: auto; white-space: pre-wrap;
}

/* 等待反馈：气泡出现后、第一个字到达前那一两秒，屏幕上得有东西在动。
   周工的探测看的是页面上 animation 的条数（anims=0 就是「没在干活」）。 */
.chat-thinking {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 88%; padding: 8px 12px; margin-bottom: 6px;
  background: var(--bg-2); border-radius: var(--r-sm);
}
.chat-think-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-3);
  animation: chat-blink 1.2s ease-in-out infinite;
}
.chat-think-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-think-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-blink {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* 审批卡片 */
.approval-card {
  max-width: 88%; margin: 6px 0; padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--accent); background: var(--accent-soft);
}
.approval-card.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); font-size: var(--fs-12); }
.approval-card.no { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); font-size: var(--fs-12); }
.approval-title { font-size: var(--fs-12); font-weight: 600; margin-bottom: 4px; }
.approval-args { font-size: var(--fs-11); color: var(--text-3); word-break: break-all; margin-bottom: 8px; }
.approval-actions { display: flex; gap: 8px; }

/* ---------- 插件页 ---------- */
.plugin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.plugin-row:last-child { border-bottom: none; }
.plugin-main { flex: 1; min-width: 0; }
.plugin-name { font-size: var(--fs-13); font-weight: 600; color: var(--text); }
.plugin-desc { font-size: var(--fs-11); color: var(--text-3); margin-top: 3px; line-height: 1.6; }
.plugin-tools { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.plugin-ops { display: flex; gap: 6px; }
.plugin-empty {
  padding: 26px 10px; text-align: center; color: var(--text-3);
  font-size: var(--fs-12); line-height: 2;
}
.tag {
  font-size: var(--fs-11); padding: 2px 8px; border-radius: var(--r-full);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2);
}

/* 开关 */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; background: var(--line-2); border-radius: 999px;
  transition: background var(--t-fast) var(--ease); cursor: pointer;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform var(--t-fast) var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }

/* 代码查看 */
.code-view {
  max-height: 52vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px; font-size: var(--fs-11); line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; color: var(--text-2);
}

/* ═══════════════════════════════════════════════════════════
   现货 / 报价 / 应收（P0 三件套）
   与既有暖纸主题同一套 token，不引入新色。
   ═══════════════════════════════════════════════════════════ */

.row-between { display: flex; align-items: center; justify-content: space-between; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: var(--fs-11); line-height: 1; white-space: nowrap;
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
}
.chip-warn {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.chip-bad {
  background: color-mix(in srgb, var(--bad) 13%, transparent);
  color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent);
}
.chip-muted {
  background: var(--bg-2); color: var(--text-3); border-color: var(--line);
}

.bad { color: var(--bad); font-variant-numeric: tabular-nums; }

/* 表单栅格：弹窗里的两列排布 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 12px 0 4px; }
.grid-2 .field { margin: 0; }

.field { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.field label { font-size: var(--fs-11); color: var(--text-3); letter-spacing: .02em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; font-size: var(--fs-13); font-family: inherit;
  color: var(--text); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--r-md);
  outline: none; transition: border-color 120ms, box-shadow 120ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.field textarea { resize: vertical; line-height: 1.6; }

.input, .input-sm {
  padding: 7px 10px; font-size: var(--fs-12); font-family: inherit;
  color: var(--text); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--r-md); outline: none;
}
.input-sm { height: 32px; padding: 0 10px; }
.input:focus, .input-sm:focus { border-color: var(--accent); }

/* 报价文本预览：等宽、可整体复制，行距略松便于核对 */
.quote-pre {
  max-height: 46vh; overflow: auto;
  margin: 10px 0 4px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-12); line-height: 1.85; white-space: pre-wrap; word-break: break-word;
  color: var(--text);
}

/* 四列表单（窗帘算料） */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin: 12px 0 4px; }
.grid-4 .field { margin: 0; }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.plain-list { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.plain-list li { margin: 3px 0; }
.plain-list b { color: var(--text); font-weight: 600; }

/* 现货导入结果 */
.imp-sum { font-size: var(--fs-13); color: var(--text-2); margin: 4px 0 10px; }
.imp-sum b { color: var(--text); }
.imp-warn { font-size: var(--fs-12); line-height: 1.6; color: var(--warn); background: var(--bg-2); border-left: 2px solid var(--warn); padding: 8px 10px; border-radius: 6px; margin-bottom: 10px; }
.imp-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.imp-row { display: grid; grid-template-columns: 1.4fr 90px 70px 1.6fr; gap: 8px; align-items: center; padding: 7px 10px; font-size: var(--fs-12); border-top: 1px solid var(--line); }
.imp-row:first-child { border-top: 0; }
.imp-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-kind { color: var(--ok); }
.imp-kind.dim { color: var(--text-3); }
.imp-num { color: var(--text-2); }
.imp-reason { color: var(--text-3); font-size: var(--fs-11); }
.imp-detail { margin-top: 10px; font-size: var(--fs-12); color: var(--text-2); }
.imp-detail summary { cursor: pointer; color: var(--accent-ink); }
.imp-skip { padding: 3px 0; border-bottom: 1px dashed var(--line); }

/* ---------- 24. 侧边栏分组折叠 ---------- */
.nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 calc(var(--s-2) * -1);
  padding: 0 var(--s-2);
  scrollbar-width: thin;
}
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.nav-group { margin-top: 2px; }
.nav-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--s-4) var(--s-3) var(--s-2);
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--accent);
  font: inherit;
  text-align: left;
  border-radius: var(--r-sm);
}
.nav-group-head:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.nav-group-title {
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav-group-hint {
  flex: 1;
  font-size: var(--fs-11);
  letter-spacing: 0.02em;
  color: var(--text-3);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-chev {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  transition: transform 0.16s ease;
  opacity: 0.75;
}
.nav-group.collapsed .nav-chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-hint { opacity: 0.6; }
.nav-group.collapsed .nav-group-body { display: none; }

/* 折叠时，组里若有当前页，头部也标一下，别让人找不到自己 */
.nav-group.collapsed:has(.nav-item.active) .nav-group-head {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.sidebar-foot { flex-direction: column; align-items: stretch; gap: var(--s-2); }
.foot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 0 var(--s-3);
  font-size: var(--fs-11);
  color: var(--text-3);
}
.nav-settings { margin: 0; }

/* ---------- 25. 设置页 ---------- */
.set-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: var(--s-5) 0 var(--s-4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-3);
}
.set-tab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-3);
  cursor: pointer;
  font: inherit;
  color: var(--text-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.set-tab:hover { border-color: var(--accent); }
.set-tab.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-3)); color: var(--text); }
.set-tab-name { font-size: var(--fs-13); font-weight: 600; }
.set-tab-hint { font-size: var(--fs-11); color: var(--text-3); letter-spacing: 0.02em; }

.set-body { padding-bottom: var(--s-10); }
.set-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: 8px; }
.set-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: var(--fs-12);
  color: var(--text-2);
  flex-wrap: wrap;
}
.set-list li > span:first-child {
  flex: 0 0 92px;
  color: var(--text-3);
  font-size: var(--fs-11);
  letter-spacing: 0.06em;
}
.set-list code { font-size: var(--fs-11); word-break: break-all; }
.skeleton-row {
  height: 92px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--bg-2), var(--bg-1), var(--bg-2));
  background-size: 200% 100%;
  animation: sk 1.4s ease-in-out infinite;
}

/* 设置里嵌入的插件页/说明书页，去掉各自的多余留白 */
.set-body .plugins-wrap > .page-head,
.set-body .manual-shell > .page-head { display: none; }

/* ---------- 26. 自适应强化 ---------- */
/* 表格永远能横向滚动，不把内容挤扁 */
.card > table, .table-wrap { display: block; overflow-x: auto; }
.card > table { display: table; min-width: 100%; }

/* 卡片内边距随窗口收 */
@media (max-width: 1320px) {
  :root { --sidebar-w: 206px; }
  .content { padding: var(--s-5) var(--s-6) var(--s-9); }
}
@media (max-width: 1100px) {
  :root { --sidebar-w: 188px; }
  .page-title { font-size: var(--fs-26); }
  .metric-v { font-size: var(--fs-20); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .sidebar { padding: var(--s-3) var(--s-2); }
  .content { padding: var(--s-4) var(--s-4) var(--s-8); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-head, .card-body { padding-left: var(--s-4); padding-right: var(--s-4); }
  thead th:first-child, tbody td:first-child { padding-left: var(--s-4); }
  thead th:last-child, tbody td:last-child { padding-right: var(--s-4); }
  .set-tab-hint { display: none; }
}

/* 5 张指标卡：宁可 3+2，也不要 4+1 落单 */
.metrics:has(> :nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1360px) {
  .metrics:has(> :nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* 27. 窄窗口下不横向塌：内容区不整体滚动，表格在卡片内滚 */
.content { overflow-x: clip; }
.card { overflow-x: auto; }
.card > table { display: table; min-width: 100%; }
@media (max-width: 1240px) {
  .row-between { gap: 10px !important; }
  .row-between > div:last-child { width: 100%; }
  .row-between > div:last-child .btn { flex: 1 1 auto; justify-content: center; }
}

/* 28. 侧栏分组标题 */
.nav-group-head { padding: 10px 10px 5px; }
@media (max-height: 820px) {
  .nav-item { padding: 8px 10px; }
  .nav-group-head { padding: 7px 10px 4px; }
  .foot-meta { font-size: var(--fs-11); }
}
.foot-meta { white-space: nowrap; }
.foot-meta .ver { overflow: hidden; text-overflow: ellipsis; }

/* 空态在窄窗口允许折行，不再被卡片切掉 */
.card .empty, .card .empty-state, .card td.empty { white-space: normal; }

/* 29. 窄窗指标卡固定两列，最后一张横跨，不留空格 */
@media (max-width: 1180px) {
  .metrics,
  .metrics:has(> :nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics:has(> :nth-child(5)) > :nth-child(5) { grid-column: span 2; }
}

/* 30. 插件分组：工具栏 + 折叠组 + 新标 */
.plugin-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 55%, var(--bg-1));
}
.plugin-search { flex: 1 1 260px; max-width: 420px; }
.plugin-groups { padding: 6px 0 10px; }
.plugin-group + .plugin-group { border-top: 1px solid var(--line); }
.plugin-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--s-5);
  cursor: pointer; user-select: none;
}
.plugin-group-head:hover { background: var(--bg-2); }
.plugin-chev { color: var(--text-3); font-size: var(--fs-12); transition: transform var(--t-fast) var(--ease); }
.plugin-group.collapsed .plugin-chev { transform: rotate(-90deg); }
.plugin-group.collapsed .plugin-group-body { display: none; }
.plugin-group-name { font-family: var(--font-display); font-size: var(--fs-16); font-weight: 700; }
.plugin-group-hint { color: var(--text-3); font-size: var(--fs-12); }
.plugin-group-count { color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.plugin-group-body .plugin-row { padding-left: calc(var(--s-5) + 18px); }
.plugin-badge-new {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: var(--fs-11); font-weight: 700; vertical-align: 2px;
}
@media (max-width: 1180px) {
  .plugin-group-hint { display: none; }
}


/* 30. 订阅倒计时条（试用/付费期） */
.plan-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  font-size: 13.5px;
  line-height: 1.5;
  background: #eef0ff;
  color: #2f3fb5;
  border-bottom: 1px solid #dcdffb;
}
.plan-bar b { font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-bar.warn { background: #fff6e0; color: #8a5c00; border-bottom-color: #f4e0b0; }
.plan-bar.bad { background: #fdecea; color: #b32b1c; border-bottom-color: #f5c9c2; }
.plan-bar .sp { flex: 1; }
.plan-bar button {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
}
.plan-bar button:hover { background: rgba(0, 0, 0, 0.05); }
@media (max-width: 720px) {
  .plan-bar { padding: 8px 14px; font-size: 12.5px; }
}

/* 31. 对话页高度约束：消息区自己滚，输入框钉在底部
   （原来 .wb-main 作为 flex item 默认 min-height:auto 被内容撑到 1128px，
     超出 .content 的 793px 后被 overflow:hidden 裁掉 → 输入框看不见） */
#view {
  min-height: 0;
}
.wb-main {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.wb-main .chat-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wb-main .chat-compose,
.wb-main .chat-input-box {
  flex: 0 0 auto;
}

/* 32. 现货细码视图切换（阶段 0） */
.stock-views {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-2);
}
.stock-view-btn {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}
.stock-view-btn:hover { background: var(--bg-hover); color: var(--text); }
.stock-view-btn.on {
  background: var(--bg-1);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
@media (max-width: 720px) {
  .stock-views { display: flex; width: 100%; overflow-x: auto; }
  .stock-view-btn { flex: 1 0 auto; padding: 0 12px; font-size: 12.5px; }
}

/* 33. 采购进货（阶段 1） */
.pur-bar {
  display: inline-block;
  width: 96px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}
.pur-bar > span {
  display: block;
  height: 100%;
  background: var(--accent, #4f5bd5);
  border-radius: 999px;
}
.pur-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
}
.pur-OPEN { background: #eef0ff; color: #2f3fb5; }
.pur-PARTIAL { background: #fff6e0; color: #8a5c00; }
.pur-DONE { background: #e8f5ec; color: #1e7a3c; }
.pur-CANCELLED { background: var(--bg-2); color: var(--text-3); }
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.38);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 12px;
  overflow-y: auto;
  z-index: 900;
}
.modal-mask .modal {
  background: var(--bg-1);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22);
  width: min(720px, 94vw);
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}
.modal-mask .modal-head,
.modal-mask .modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}
.modal-mask .modal-head { border-bottom: 1px solid var(--line-2); }
.modal-mask .modal-foot { border-top: 1px solid var(--line-2); }
.modal-mask .modal-head h3 { margin: 0; font-size: 16px; }
.modal-mask .modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-mask .modal-body .input { width: 100%; }
.modal-mask table .input { width: 100%; min-width: 68px; }
