/* 预案工作台 · 页面样式（设计 v4 · 聚合平台）
   工具面用无彩色，成品预览才切回暖纸色 —— 一眼分得清「我在干活」
   和「这是给客户看的东西」。 */

:root {
  color-scheme: light;

  /* ── 工具面：无彩 ── */
  --bg: #F9F8F6;
  --surface: #FFFFFF;
  --surface-2: #F4F2EE;
  --surface-3: #FAF9F7;
  --line: #E8E5DF;
  --line-soft: #F0EEE9;
  --ink: #1F1E1C;
  --ink-2: #6B6862;
  --ink-3: #A09B93;
  --ok: #3D7A52;   --ok-w: #EAF2EC;
  --warn: #B4453A; --warn-w: #FBEDEB;
  --run: #3A6EA5;  --run-w: #EAF1F8;   /* 「在做」的蓝，区别于强调色 */

  /* ── 成品面：暖（只在成品预览里用） ── */
  --paper: #F7F3EE;
  --paper-line: #E6DDD2;
  --paper-ink: #2B2420;
  --acc: #A8573E;      /* 品牌强调色 */
  --acc-wash: #F4E3DA;
  --art: #2E5F63;      /* 艺术馆 */

  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);
  --ease-back: cubic-bezier(.34, 1.4, .5, 1);
  --t-fast: 130ms; --t: 220ms; --t-slow: 300ms;

  /* 旧变量名 → 新 token：老代码继续可用，不必一次改完 */
  --card: var(--surface);
  --soft: var(--ink-2);
  --faint: var(--ink-3);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: var(--acc-wash); color: var(--ink); }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { accent-color: var(--acc); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ══════════════════ 外壳：左栏聚合导航 + 主区（v4）══════════════════ */
.app { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }
.app a { color: inherit; text-decoration: none; }

/* ── 左栏 ── */
.side { width: 242px; flex-shrink: 0; background: var(--surface-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; }
.side-nav { padding: 14px 8px 0; }
.side-nav a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); cursor: pointer; font-size: 13.5px;
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io); }
.side-nav a:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.side-nav a.on { background: #E6E3DD; color: var(--ink); font-weight: 600; }
.side-nav a .ico { width: 16px; text-align: center; font-size: 13px; opacity: .75; }
.side-nav a .caret { margin-left: auto; font-size: 10px; opacity: .55;
  transition: transform var(--t) var(--ease-back); }
.side-nav a.open .caret { transform: rotate(90deg); }

/* ★ 品牌树 */
.brands { padding: 2px 8px 4px; display: flex; flex-direction: column; gap: 1px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height var(--t-slow) var(--ease), opacity var(--t) var(--ease), padding var(--t) var(--ease); }
.brands.open { max-height: 340px; opacity: 1; }
.brands .b { display: flex; align-items: center; gap: 9px; padding: 7px 10px 7px 26px;
  border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); font-size: 13px;
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io); }
.brands .b:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.brands .b.on { background: #E6E3DD; color: var(--ink); font-weight: 600; }
.brands .b .sw { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; display: block; }
.brands .b .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brands .b .cnt { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.brands .b.soon .nm { color: var(--ink-3); }
.brands .b .soonflag { font-size: 9.5px; padding: 1px 5px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); white-space: nowrap; }

.side .grouphd { display: flex; align-items: center; gap: 6px; padding: 16px 14px 6px;
  font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; }
.side .grouphd .sp { flex: 1; }
.side .grouphd .mini { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center;
  border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--ink-3);
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io); }
.side .grouphd .mini:hover { background: rgba(0, 0, 0, .055); color: var(--ink); }

.side .list { flex: 1; overflow-y: auto; padding: 0 8px 10px; scrollbar-width: thin; }
.side .item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--ink-2); font-size: 13.5px;
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io); }
.side .item:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.side .item.on { background: #E6E3DD; color: var(--ink); font-weight: 600; }
.side .item .dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line);
  flex-shrink: 0; background: var(--surface);
  transition: background var(--t) var(--ease-io), border-color var(--t) var(--ease-io); }
.side .item.done .dot { background: var(--ok); border-color: var(--ok); }
.side .item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .item .mini2 { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono);
  font-variant-numeric: tabular-nums; }

/* margin-top:auto 把 footer 钉在左栏底部 —— 不能靠 .list 的 flex:1 撑，
   因为只读管理（viewer）的 .list 是隐藏的，那样 footer 会浮到导航下面去。 */
.side .foot { margin-top: auto; position: relative; padding: 9px 12px; border-top: 1px solid var(--line); }
/* 备案号（左栏底）：工信部要求展示。只读管理（viewer）也看得到 —— .foot 两种角色都在。 */
.side .legal { padding: 0 12px 10px; }
.side .legal a { font-size: 10.5px; color: var(--ink-3); text-decoration: none;
  transition: color var(--t-fast) var(--ease-io); }
.side .legal a:hover { color: var(--ink-2); }
.side .foot .me { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 7px;
  border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: left;
  transition: background var(--t-fast) var(--ease-io); }
.side .foot .me:hover { background: rgba(0, 0, 0, .045); }
.side .foot .me[aria-expanded="true"] { background: #E6E3DD; }
.side .foot .av { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.side .foot .who { flex: 1; min-width: 0; }
.side .foot .who b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.side .foot .who span { display: block; font-size: 10.5px; color: var(--ink-3); }
.side .foot .up { font-size: 10px; color: var(--ink-3); flex-shrink: 0;
  transition: transform var(--t) var(--ease-back); }
.side .foot .me[aria-expanded="true"] .up { transform: rotate(180deg); }

/* ★ 左下角弹出菜单（规则 / 全店看板 / 设置 / 退出）
   照 Claude Code 的左下角菜单：贴在下缘往上弹，不占主导航。 */
.side .mmenu { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 12px 32px rgba(31, 30, 28, .14), 0 2px 6px rgba(31, 30, 28, .06);
  padding: 5px; z-index: 70; opacity: 0; transform: translateY(6px) scale(.985);
  transform-origin: bottom center;
  transition: opacity var(--t-fast) var(--ease-io), transform var(--t-fast) var(--ease-back); }
.side .mmenu.open { opacity: 1; transform: none; }
.side .mmenu .mi { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px;
  border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: left;
  color: var(--ink-2); font-size: 13px; font-family: inherit;
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io); }
.side .mmenu .mi:hover { background: var(--surface-3); color: var(--ink); }
.side .mmenu .mi .ico { width: 16px; text-align: center; font-size: 13px; opacity: .75; }
.side .mmenu .mdiv { height: 1px; background: var(--line); margin: 4px 6px; }
.side .mmenu .mi.quit { color: var(--ink-2); }
.side .mmenu .mi.quit:hover { color: var(--warn); background: var(--warn-w); }

/* 抽屉（窄屏）：JS 动态插入 .burger 与 .scrim */
.burger { display: none; width: 34px; height: 34px; margin: 12px 14px 0; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  color: var(--ink-2); cursor: pointer; place-items: center; font-size: 15px; line-height: 1; }
.burger:hover { background: var(--surface-3); color: var(--ink); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(31, 30, 28, .38);
  opacity: 0; visibility: hidden; transition: opacity var(--t) var(--ease), visibility var(--t); }
.scrim.on { opacity: 1; visibility: visible; }

/* ── 主区 ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); min-height: 0; }
/* 窄屏：汉堡 + 页面顶栏同一行。汉堡在桌面端 display:none，不占位。 */
.nav-wrap { flex-shrink: 0; display: flex; align-items: flex-start; }
/* .main 是 column flex：这里只能用 flex-shrink:0（不要 flex:1，
   那会让顶栏在竖方向长到几百像素高，把正文挤下去）。宽度靠默认 stretch 撑满。 */
.topbar { flex-shrink: 0; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px; }
.topbar h1 { font-size: 16.5px; font-weight: 600; margin: 0; letter-spacing: .01em; }
.topbar .sub { font-size: 12.5px; color: var(--ink-3); }
.topbar .sp { flex: 1; }
.topbar .acts { display: flex; gap: 7px; }
.body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px 24px; scrollbar-width: thin; }
/* 登录页要满屏，不能被容器夹成一张居中的卡片 */
.body.fs { padding: 0; }

/* 登录页 / 首次设置：左栏不出现，避免一条空侧栏挂在左边。
   汉堡按钮（.nav-wrap 里）是 JS 插进 .main 的，不是 .side 的子节点 ——
   只藏 .side 的话窄屏登录页左上角会露出一个点不开的 ☰。 */
body.bare .side,
body.bare .nav-wrap { display: none; }

/* ── 底部对话条（v4）：铺在 .main 底部，与内容区各占一行 ──
   注意：这里的选择器都收在 .composer 里。设计稿用的是裸 .box / .right，
   但本仓库里 .box 已经是「设置页卡片」的类名，裸写会把设置页压扁。 */
.composer { flex-shrink: 0; padding: 6px 24px 14px; background: var(--bg); }
.composer .chipsrow { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; flex-wrap: wrap; }
.composer .chipx { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px;
  cursor: pointer; transition: background var(--t-fast) var(--ease-io), transform var(--t-fast) var(--ease-back),
             border-color var(--t-fast) var(--ease-io); }
.composer .chipx:hover { background: var(--surface-2); transform: translateY(-1px); border-color: var(--ink-3); }
.composer .box { position: relative; display: flex; align-items: flex-end; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px 12px;
  box-shadow: 0 1px 3px rgba(31, 30, 28, .045); margin-bottom: 0;
  transition: border-color var(--t-fast) var(--ease-io), box-shadow var(--t-fast) var(--ease-io); }
.composer .box:focus-within { border-color: #C9C5BD; box-shadow: 0 2px 10px rgba(31, 30, 28, .09); }
.composer .box textarea { flex: 1; min-width: 0; resize: none; border: 0; background: none; outline: none;
  font: inherit; font-size: 14px; line-height: 1.6; max-height: 140px; min-height: 22px; color: var(--ink); padding: 4px 0; }
.composer .box textarea::placeholder { color: var(--ink-3); }
.composer .box .right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.composer .box .mchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 99px;
  padding: 4px 10px; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io); }
.composer .box .mchip:hover { background: var(--surface-3); border-color: var(--line); }
.composer .box .mchip .car { font-size: 9px; opacity: .55; }
.composer .box .send { width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: var(--ink);
  color: #fff; font-size: 15px; cursor: pointer; display: grid; place-items: center;
  transition: transform var(--t-fast) var(--ease-back), opacity var(--t-fast) var(--ease-io); }
.composer .box .send:hover { transform: translateY(-1px); }
.composer .box .send:active { transform: scale(.92); }
.composer .box .send[disabled] { opacity: .3; cursor: not-allowed; transform: none; }
.composer .under { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 0 2px;
  font-size: 11.5px; color: var(--ink-3); }
.composer .under .sp { flex: 1; }
.composer .under .kbd { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; background: var(--surface); }
.composer .menu { position: absolute; bottom: calc(100% + 8px); right: 0; width: 342px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 14px 40px rgba(31, 30, 28, .17); padding: 6px; z-index: 60;
  animation: menuin var(--t) var(--ease) both; }
@keyframes menuin { from { opacity: 0; transform: translateY(6px) scale(.985) } to { opacity: 1; transform: none } }
/* 菜单条目：v4 的 .mhd/.mi/.mdiv/.mft。这里是按钮不是 div，
   因为要能被 Tab 到、能用方向键走，所以补上 button 的复位样式。 */
.composer .menu .mhd { padding: 8px 10px 6px; font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em;
  display: flex; align-items: center; }
.composer .menu .mhd .sp { flex: 1; }
.composer .menu .mi { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; width: 100%;
  border: 0; background: none; text-align: left; font: inherit; color: inherit;
  border-radius: var(--r-sm); cursor: pointer;
  transition: background var(--t-fast) var(--ease-io); }
.composer .menu .mi:hover, .composer .menu .mi:focus-visible { background: var(--surface-2); outline: none; }
.composer .menu .mi .ck { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line);
  flex-shrink: 0; margin-top: 2px; display: grid; place-items: center; font-size: 9px; color: transparent;
  transition: background var(--t) var(--ease-io), border-color var(--t) var(--ease-io), color var(--t) var(--ease-io); }
.composer .menu .mi[aria-checked="true"] .ck { background: var(--ink); border-color: var(--ink); color: #fff; }
.composer .menu .mi .tx { flex: 1; min-width: 0; }
.composer .menu .mi .tx b { display: block; font-size: 13px; font-weight: 600; }
.composer .menu .mi .tx span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; line-height: 1.55; }
.composer .menu .mdiv { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.composer .menu .mft { padding: 7px 10px 5px; font-size: 11.5px; color: var(--ink-3); }

/* 无订单上下文那几屏：往来摊在输入条上面（否则回答只闪一下就没了）。 */
.composer .cmsgthread { max-height: 260px; overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 11px; padding: 2px 0 10px; margin-bottom: 4px; }
.composer .cgo { display: flex; padding-top: 2px; }
.composer .box .mchip[aria-expanded="true"] { background: var(--surface-3); border-color: var(--line); }

/* ══════════════════ 排版 ══════════════════ */
h1 { font-family: var(--serif); font-weight: 500; font-size: 25px; margin: 0 0 6px; letter-spacing: .01em; }
h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 14.5px; margin: 0 0 6px; }
h1, h2, h3 { line-height: 1.45; }
.lead { color: var(--ink-2); margin: 0 0 22px; max-width: 68ch; font-size: 13.5px; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }

/* ══════════════════ 按钮 ══════════════════ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; line-height: 1.5; padding: 7px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; font-size: 13.5px;
  transition: transform var(--t-fast) var(--ease-back), background var(--t-fast) var(--ease-io),
              border-color var(--t-fast) var(--ease-io), box-shadow var(--t) var(--ease-io); }
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--ink-3);
  box-shadow: 0 3px 10px rgba(31, 30, 28, .07); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); box-shadow: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(31, 30, 28, .2); }
.btn.big { padding: 12px 26px; font-size: 15px; border-radius: var(--r); min-height: 48px; }
.btn[disabled] { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.danger { color: var(--warn); }
.btn.danger:hover:not(:disabled) { border-color: var(--warn); }
.link { border: 0; background: none; color: var(--ink-2); cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

/* ══════════════════ 卡片 ══════════════════ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px 16px; margin-bottom: 12px; overflow: hidden; }
.card .ttl { font-family: var(--serif); font-size: 17px; }
.card .sub { color: var(--ink-2); font-size: 12.5px; }
/* 带头部的卡片（v4 屏 5 起统一用 .chd/.cbd，见下面 .card.v4）。
   .card-head/.card-body 是旧名字，已无引用，去掉。 */
.card.v4 { padding: 0; }
.card .chd { display: flex; align-items: center; gap: 9px; padding: 12px 15px;
  border-bottom: 1px solid var(--line-soft); }
.card .chd b { font-size: 13.5px; font-weight: 600; }
.card .chd .note { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.card .chd .sp { flex: 1; }
.card .cbd { padding: 14px 15px; }
.card .cbd.flush { padding: 0; }

/* 四步横条（v4 屏 3）：原本是 168px 的竖排左栏，改成卡片内一条横向进度 */
.phasebar { display: flex; align-items: center; padding: 11px 15px 12px; flex-wrap: wrap; }
.phasebar .p { display: flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--ink-3); padding: 5px 0; background: none; border: 0; font-family: inherit; }
.phasebar .p .d { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; font-size: 9px; background: var(--surface); flex-shrink: 0;
  transition: background var(--t) var(--ease-io), border-color var(--t) var(--ease-io), color var(--t) var(--ease-io); }
.phasebar .p.done .d { background: var(--ok); border-color: var(--ok); color: #fff; }
.phasebar .p.done { color: var(--ink-2); }
.phasebar .p.cur { color: var(--ink); font-weight: 600; }
.phasebar .p.cur .d { border-color: var(--ink); border-width: 2px; }
.phasebar .p[disabled] { opacity: .55; cursor: default; }
/* 可点的步骤：只有已经走到的步能点回去看 */
.phasebar button.p { cursor: pointer; border-radius: var(--r-sm); padding: 5px 7px; margin: 0 -7px;
  transition: background var(--t-fast) var(--ease-io); }
.phasebar button.p:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); }
.phasebar .sep { width: 22px; height: 1px; background: var(--line); margin: 0 8px; flex-shrink: 0; }

/* 店长轨道（超期）：挂在四步那张卡里的第二行。
   和四步是两条独立轨道，所以中间隔一条细线，视觉上不混成一条。 */
.bossstrip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 15px 10px; border-top: 1px solid var(--line-soft); }
.bossstrip[hidden] { display: none; }
.bossstrip .bs-k { font-size: 12.5px; color: var(--ink-3); }
.bossstrip .bs-note { flex-shrink: 0; }
.bossstrip .sp { flex: 1; }
.bossstrip .link { font-size: 12.5px; }

/* 客情（v4）：整段原文，保留换行；顶上标谁、什么时候、怎么记的 */
.kq { background: var(--surface-3); border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.75; white-space: pre-wrap; }
.kq .from { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 7px;
  padding-bottom: 7px; border-bottom: 1px dashed var(--line); }
.kq .from b { color: var(--ink-2); font-weight: 600; }

/* 问题卡（v4 屏 3 前期沟通）：一题一卡，选项做成药丸 */
.qa { border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px;
  margin-bottom: 9px; transition: border-color var(--t) var(--ease-io), box-shadow var(--t) var(--ease-io); }
.qa:hover { border-color: var(--ink-3); }
.qa.flash { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-wash); }
.qa .q { font-size: 13.5px; margin: 0 0 10px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.sec { border-top: 1px solid var(--line-soft); padding: 18px 0 4px; }
.sec:first-of-type { border-top: 0; padding-top: 0; }
.sec > h3 { font-family: var(--serif); font-weight: 500; font-size: 16px; margin-bottom: 10px; }

/* v4 用 .btn.sm 表小按钮；旧代码里写的是 .btn.small，两个名字都留着，
   不然会有一半按钮突然变成大号。 */
.btn.sm, .btn.small { min-height: 29px; padding: 5px 11px; font-size: 12.5px; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(31, 30, 28, .2); }

/* ══════════════════ 表单 ══════════════════ */
.field { min-width: 0; display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--r); padding: 10px 13px; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-io), box-shadow var(--t-fast) var(--ease-io); }
.field input, .field select { min-height: 44px; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none;
  border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-wash); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.err { color: var(--warn); font-size: 13px; min-height: 1.4em; }
.switch-row { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; flex-shrink: 0; }
/* Key 框：看起来是圆点，但不是密码框（浏览器就不会把口令自动填进来） */
.masked { -webkit-text-security: disc; font-family: var(--mono); letter-spacing: .04em; }
.masked:placeholder-shown { -webkit-text-security: none; font-family: inherit; letter-spacing: 0; }

.staff-accounts { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.staff-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.staff-row input { flex: 1 1 180px; min-height: 44px; }
.staff-row b { min-width: 4em; }

/* ══════════════════ 登录 · 海报式（v4 屏 1）══════════════════ */
.login { display: flex; min-height: 100vh; background: var(--surface); }

/* 左：海报，纯 CSS 画的，不依赖任何图片 */
.poster { flex: 1; min-width: 0; position: relative; overflow: hidden;
  background: linear-gradient(158deg, #F7F3EE 0%, #F2EAE2 46%, #EFE3D9 100%); }
.poster .blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; }
.poster .b1 { width: 340px; height: 340px;
  background: radial-gradient(circle at 34% 32%, #DCE7E4, #EFF3EE 68%, transparent 72%);
  right: -70px; top: -60px; }
.poster .b2 { width: 270px; height: 270px;
  background: radial-gradient(circle at 42% 40%, #F0DCCF, #F6E9E0 66%, transparent 72%);
  left: -80px; bottom: 70px; }
.poster .b3 { width: 190px; height: 190px;
  background: radial-gradient(circle at 40% 40%, #E8E2D6, #F4F0E8 70%, transparent 76%);
  right: 110px; bottom: -40px; }
.poster .rule { position: absolute; left: 72px; right: 72px; height: 1px; background: var(--paper-line); }
.poster .rule.r1 { top: 148px; }
.poster .rule.r2 { bottom: 148px; }
.poster .inner { position: relative; height: 100%; display: flex; flex-direction: column;
  justify-content: center; padding: 0 72px; max-width: 620px; }
.poster .mark { font-family: var(--serif); font-size: 12.5px; letter-spacing: .32em; color: var(--acc);
  text-transform: uppercase; margin-bottom: 26px; }
.poster h1 { font-family: var(--serif); font-weight: 500; font-size: 46px; line-height: 1.28;
  margin: 0 0 22px; color: var(--paper-ink); letter-spacing: .02em; }
.poster .psub { font-size: 14.5px; color: #6B5D52; line-height: 1.85; max-width: 34ch; margin: 0; }
.poster .brandsline { display: flex; align-items: center; margin-top: 44px; flex-wrap: wrap; }
.poster .brandsline .n { font-family: var(--serif); font-size: 14.5px; color: #7A6D62;
  padding: 0 13px; position: relative; }
.poster .brandsline .n:first-child { padding-left: 0; }
.poster .brandsline .n + .n::before { content: ""; position: absolute; left: 0; top: 50%;
  width: 1px; height: 12px; background: var(--paper-line); transform: translateY(-50%); }
.poster .pfoot { position: absolute; left: 72px; bottom: 34px; font-size: 11.5px; color: #9A8B7E;
  letter-spacing: .04em; display: flex; align-items: center; gap: 7px; }
/* 备案号：要能点进工信部，所以是链接不是纯文字。颜色跟页脚一致，别抢眼。 */
.pfoot .pdot { opacity: .55; }
.pfoot .beian { color: inherit; text-decoration: none; border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io); }
.pfoot .beian:hover { color: var(--ink-2); border-bottom-color: currentColor; }

/* 右：登录窗 */
.loginside { width: 496px; flex-shrink: 0; background: var(--surface);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center;
  padding: 0 62px; }
.loginside .brandtop { font-family: var(--serif); font-size: 20px; margin: 0 0 5px; letter-spacing: .03em; }
.loginside .lead { font-size: 13px; color: var(--ink-3); margin: 0 0 30px; }
.loginside .btn-main { width: 100%; min-height: 48px; border-radius: var(--r); border: 0;
  background: var(--ink); color: #fff; font-size: 15px; cursor: pointer; font-family: var(--sans);
  letter-spacing: .04em; margin-top: 4px;
  transition: transform var(--t-fast) var(--ease-back), box-shadow var(--t) var(--ease-io); }
.loginside .btn-main:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(31, 30, 28, .2); }
.loginside .btn-main:active { transform: translateY(0) scale(.985); }
.loginside .btn-main[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.loginside .xtra { display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; font-size: 12.5px; color: var(--ink-3); }
.loginside .notice { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ink-3); line-height: 1.8; }
.loginside .notice b { color: var(--ink-2); font-weight: 600; }

/* 首次设置：沿用同一套表单，但内容更长，改成单列滚动 */
.gate { max-width: 520px; margin: 8vh auto 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 34px 36px; }
.gate h1 { margin-bottom: 4px; }
.gate .sec { border-top: 1px solid var(--line-soft); }
.staff-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

/* ══════════════════ 单子列表（v4 屏2） ══════════════════ */
/* 卡片网格 .orders/.order 已被表格取代，那几条规则删掉了。 */
/* KPI 只剩三格时不要拉成四格宽（设计稿是 4 格，但「待交付」没数据源），
   auto-fit + 下限，缺一格也不会留一个空洞。 */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; }
.stat .k { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }
.stat .v { font-size: 17px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }

.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px;
  border: 1px solid currentColor; }
.tag.final { color: var(--ok); }
/* 名字不能叫 busy：.busy 已经是「转圈容器」这个块类的名字，
   修饰类同名会被它的 padding:40px 0 撑成一根竖条。 */
.tag.live { color: var(--run); }
.tag.muted { color: var(--ink-3); border-color: var(--line); }
.empty { text-align: center; padding: 64px 20px; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--r-lg); }

/* 表格（v4） */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px;
  letter-spacing: .05em; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--surface-3); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; line-height: 1.65; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.tbl tr.clickable { cursor: pointer; transition: background var(--t-fast) var(--ease-io); }
.tbl tr.clickable:hover { background: var(--surface-3); }

/* 提示条（v4） */
.strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r);
  font-size: 13px; margin-bottom: 12px; }
.strip.run { background: var(--run-w); color: var(--run); }
.strip.warn { background: var(--warn-w); color: var(--warn); }
.strip.plain { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.strip .sp { flex: 1; }
.strip .dotp { width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  animation: pulse 1.6s var(--ease-io) infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }

/* ══════════════════ 新建一单 ══════════════════ */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
.raw textarea { min-height: 300px; font-size: 13.5px; }
.intake-import { padding: 16px; margin-bottom: 22px; border: 1px dashed var(--line);
  border-radius: var(--r); background: var(--surface-2); }
.intake-import p { margin-bottom: 0; }
.confirmed-rows { display: grid; gap: 10px; margin-bottom: 10px; }
.confirmed-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 10px; }
.confirmed-row input, .confirmed-row select { min-width: 0; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 12px; background: var(--surface); }
.confirmed-field { min-width: 0; }
.confirmed-field > .check { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.confirmed-field .field { margin-bottom: 6px; }
.confirmed-field .hint { margin: 0 0 16px; font-size: 12px; color: var(--ink-3); }
.confirmed-tools { display: grid; gap: 10px; margin-bottom: 10px; }
.confirmed-tools > .btn { justify-self: start; }
.venue-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.venue-picks button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 9px 18px; border-radius: 99px; cursor: pointer;
  transition: background var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io),
              transform var(--t-fast) var(--ease-back); }
.venue-picks button:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.venue-picks button.on { border-color: var(--acc); color: var(--acc); background: var(--acc-wash); }

/* ══════════════════ 单子工作页 ══════════════════ */
/* 工作页（v4 屏3）：正文一列。「跟 AI 说」的输入条挪到了 .main 底部的 .composer，
   正文列里只留还没用上的修改卡（点「用这个」要在旁边）。 */
.work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.work > * { min-width: 0; }
.work > .card { margin-bottom: 0; grid-column: 1 / -1; }

.panel { overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px 26px 28px; min-height: 420px; }
.pbody { overflow-wrap: anywhere; }
.now { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 16px; margin: -4px -6px 20px; background: var(--surface-2); border-radius: var(--r); }
.now .say { font-size: 14px; }
.now .say b { color: var(--acc); font-weight: 600; }
.busy { display: flex; align-items: center; gap: 12px; color: var(--run); padding: 40px 0; justify-content: center; }
.spin { width: 18px; height: 18px; border: 2px solid var(--run-w); border-top-color: var(--run);
  border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.joberr { color: var(--warn); background: var(--warn-w); border-radius: var(--r-sm); padding: 12px 14px;
  margin-bottom: 16px; font-size: 13px; }
.problems { border: 1px solid #EBC9C3; background: var(--warn-w); color: var(--warn);
  border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }
.problems ul { margin: 4px 0 0; padding-left: 18px; }
.warnbox { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r);
  background: var(--warn-w); border: 1px solid #EBC9C3; color: var(--warn); font-size: 13px; }

/* 内容块 */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 4px 11px; border-radius: 99px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2);
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io),
              transform var(--t-fast) var(--ease-back), border-color var(--t-fast) var(--ease-io); }
.chip.warn { color: var(--warn); border-color: #EBC9C3; background: var(--warn-w); }
.chip.acc { color: var(--acc); border-color: #E8C8BA; background: var(--acc-wash); }
.pts { list-style: none; margin: 0; padding: 0; }
.pts li { display: grid; grid-template-columns: 40px 84px 1fr; gap: 10px; padding: 7px 0;
  border-bottom: 1px dashed var(--line); font-size: 13.5px; align-items: start; }
.pts .chip { white-space: nowrap; }
.pts .id { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.chapters .card { margin: 0; padding: 10px 12px; font-size: 13px; }
.quote { border-left: 2px solid var(--acc); padding-left: 12px; color: var(--ink-2); font-size: 13.5px;
  margin: 8px 0; }
.editbox textarea { width: 100%; min-height: 360px; font-family: var(--mono); font-size: 12.5px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; background: var(--surface); }

/* 节点 4：三个方向 */
.looks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.look { border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 16px; cursor: pointer;
  background: var(--surface); display: flex; flex-direction: column; gap: 8px;
  transition: transform var(--t-fast) var(--ease-back), border-color var(--t-fast) var(--ease-io),
              box-shadow var(--t) var(--ease-io); }
.look:hover { transform: translateY(-2px); border-color: var(--ink-3);
  box-shadow: 0 8px 22px rgba(31, 30, 28, .07); }
.look.on { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-wash); }
.look .sw { display: flex; height: 26px; border-radius: 6px; overflow: hidden; }
.look .sw i { flex: 1; }
.look .im { font-family: var(--serif); font-size: 16px; line-height: 1.5; }
.look .end { font-family: var(--serif); color: var(--acc); }

/* 出图 */
.arts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.art { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.art img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface-2); }
.art .cap { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 12.5px; }
.art .ph { aspect-ratio: 3 / 2; display: grid; place-items: center; color: var(--ink-3);
  background: var(--surface-2); font-size: 12.5px; }
audio { width: 100%; margin-top: 10px; }

/* 组装和检查 */
.checks { list-style: none; margin: 0 0 18px; padding: 0; }
.checks li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.checks .y { color: var(--ok); font-weight: 600; }
.checks .n { color: var(--warn); font-weight: 600; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 22px; }
.refgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ref { position: relative; border: 1px dashed var(--ink-3); border-radius: var(--r); overflow: hidden;
  background: var(--surface-2); cursor: pointer; }
.ref.has { border-style: solid; border-color: var(--line); }
.ref .box { margin: 0; border: 0; border-radius: 0; position: relative; aspect-ratio: 524 / 560;
  display: grid; place-items: center; text-align: center; color: var(--ink-3); font-size: 12.5px; padding: 8px; }
.ref .box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ref .lb { padding: 6px 8px; font-size: 11.5px; background: var(--surface); border-top: 1px solid var(--line); }
.ref .lb b { display: block; font-weight: 500; font-size: 12px; }
.ref.over { border-color: var(--acc); background: var(--acc-wash); }
.final-box { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px;
  background: var(--surface-2); margin-top: 22px; }
.final-box h3 { margin-top: 0; }

/* 新建一单：主题定了没有 */
.theme-names textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 12px; background: var(--surface); min-height: 70px; }

/* 前期沟通：一题一块 */
/* v4 里问答题做成了 .qa 卡片，选项是 .chip 药丸。
   旧的 .q / .opt 只留「自己写一句」那个输入框要用的部分。 */
.qa .why { font-size: 12.5px; color: var(--ink-3); margin: -6px 0 10px; }
.qa .own, .qa textarea { width: 100%; margin-top: 9px; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 8px 12px; background: var(--surface); font-size: 13.5px; }
.qa textarea { min-height: 70px; resize: vertical; }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 22px; }
.raw-text { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--surface-2);
  border-radius: var(--r-sm); padding: 12px 14px; color: var(--ink-2); }

/* 一键生成：进度 */
.prog { list-style: none; margin: 4px 0 10px; padding: 0; }
.prog li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--line); color: var(--ink-3); font-size: 13.5px; }
.prog li.doing { color: var(--run); }
.prog li.done { color: var(--ink); }
.prog li.stopped { color: var(--ink-2); }
.prog .mk { text-align: center; font-weight: 600; }
.prog li.done .mk { color: var(--ok); }

/* 看成品：页签 */
.ptabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 18px; }
.ptabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px;
  transition: color var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io); }
.ptabs button.on { color: var(--acc); border-bottom-color: var(--acc); }

/* ══════════════════ 成品预览：到这儿才切暖纸色 ══════════════════ */
.preview { background: var(--paper); border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line); border-radius: var(--r); overflow: hidden; }
.preview .phd { padding: 9px 15px; font-size: 11.5px; letter-spacing: .07em; color: #8B7D72;
  background: rgba(255, 255, 255, .5); border-bottom: 1px solid var(--paper-line);
  display: flex; align-items: center; gap: 8px; }
.preview .phd .sp { flex: 1; }
.preview .pbd { padding: 16px 18px; }
.preview h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin: 0 0 6px; color: var(--paper-ink); }
.preview .q { font-family: var(--serif); font-size: 14px; color: #4B4540; line-height: 1.7; margin: 0;
  border: 0; padding: 0; }
.preview .meta { font-size: 12px; color: #7A6D62; margin-top: 9px; }

/* ══════════════════ 右边：对话 ══════════════════ */
/* v4 屏3 把「跟 AI 说」改成了底部对话条，右栏那一列没有了。
   正文列里只剩那张「还没用上的修改」卡（点「用这个」得在旁边），
   下面是它自己的样式；.cseg/.msgs/.msg 这几个类名两边共用，继续保留。 */
.cseg { display: flex; gap: 4px; margin: 0 0 8px; }
.cseg button { flex: 1; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: var(--r-sm); padding: 5px 8px; font-size: 12.5px; cursor: pointer; color: var(--ink-2);
  transition: background var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io),
              color var(--t-fast) var(--ease-io); }
.cseg button.on { border-color: var(--acc); background: var(--acc-wash); color: var(--acc); }
.msgs { overscroll-behavior: contain; scrollbar-width: thin;
  max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 11px;
  padding: 0 0 12px; min-height: 60px; }
.msgs:empty::before { content: "还没说过话。"; color: var(--ink-3); font-size: 12.5px; }
.msg { overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; max-width: 88%;
  animation: msgin var(--t) var(--ease) both; }
@keyframes msgin { from { opacity: 0; transform: translateY(7px) } to { opacity: 1; transform: none } }
.msg.me { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line);
  padding: 9px 13px; border-radius: 12px 12px 3px 12px; }
.msg.ai { align-self: flex-start; max-width: 92%; }
.msg .k { color: var(--ink-3); font-size: 11.5px; margin-bottom: 4px; }
.msg .act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.msg .act .btn { padding: 4px 12px; font-size: 12.5px; min-height: 32px; }
.card .cbd > .cseg { margin: 0 0 8px; }
.card .cbd > .msgs { padding: 0; }
/* 对话里的引导与冲突说明（它们现在挂在 .card 上，不是 .cbd 里） */
.guidebox { margin: 12px 15px 0; padding: 12px 15px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-soft); }
.guidebox b { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--acc); }
.guidebox p { margin: 0 0 4px; font-size: 13px; line-height: 1.65; }
.guidebox p:last-child { margin-bottom: 0; }
.conflict { margin-top: 8px; padding: 10px 13px; border-radius: var(--r-sm);
  background: #FDF8EC; border: 1px solid #EBDCC0; }
.conflict b { display: block; margin-bottom: 2px; font-size: 12.5px; color: #8A6A21; }
.conflict p { margin: 0 0 3px; font-size: 12.5px; line-height: 1.6; }
.conflict p:last-child { margin-bottom: 0; }

/* ══════════════════ 超期台 ══════════════════ */
/* v4 屏4 已改成表格；.boss-list / .boss-row 那套 flex 行不再渲染，
   留着的是屏5 之外没人用的死规则，一并删掉以免误用。 */
.swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; display: inline-block; }
.vencell { display: inline-flex; align-items: center; gap: 6px; }
.tbl td .rowacts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tbl td select { min-height: 32px; padding: 3px 8px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); font-size: 12.5px; }

/* 超期方案三栏（对齐 PNG 版式） */
.otgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column; }
.ot .h { display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft); background: var(--surface-3); }
.ot .h .tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: var(--ink); color: #fff; border: 0; letter-spacing: .03em; }
.ot .h .tag.b1 { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.ot .h .ttl { font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot .b { padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.ot .f { display: flex; flex-direction: column; gap: 2px; }
.ot .f .k { font-size: 11px; color: var(--ink-3); letter-spacing: .03em; }
.ot .f .v { color: var(--ink); line-height: 1.65; }

/* ══════════════════ 设置 ══════════════════ */
.settings { max-width: 900px; margin: 0 auto; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 24px; margin-bottom: 16px; }
.settings .box { padding: 26px 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-heading h2 { margin: 0; }
.worker-list { margin: 22px 0; }
.worker-row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line); }
.worker-row > div:first-child { min-width: 0; }
.worker-row p { margin: 4px 0 0; }
.worker-row strong { font-size: 15px; font-weight: 600; }
.local-binding { padding: 18px 20px; background: var(--ok-w); border: 1px solid #D6E4D9; border-radius: var(--r); }
.worker-state { display: inline-flex; padding: 4px 11px; border-radius: 99px; background: var(--surface-2);
  color: var(--ink-2); font-size: 11.5px; white-space: nowrap; }
.worker-state.ready { color: var(--ok); background: var(--ok-w); }
.worker-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.worker-subtitle { font-size: 13.5px; font-weight: 600; margin: 24px 0 14px; }
.worker-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.worker-fields .field { min-width: 0; margin-bottom: 0; }
.worker-fields .field > span { min-height: 22px; }
.worker-fields input { height: 44px; }
.worker-box > .hint { margin: 10px 0 18px; }
.worker-credentials { margin-top: 20px; padding: 20px; background: var(--surface-2); border-radius: var(--r); }
.worker-credentials[hidden] { display: none; }
.worker-help { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.worker-help summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.worker-help p { margin-top: 12px; }
.network-address { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 12px; }
.network-address code { overflow-wrap: anywhere; }

/* ══════════════════ 规则页 ══════════════════ */
.rules-page { max-width: 1000px; }
.rules-page fieldset { border: 0; padding: 0; min-width: 0; }
.rules-page .btn + .btn { margin-left: 10px; }
.rule-fields { margin: 18px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rule-fields select { width: 100%; padding: 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); color: inherit; font: inherit; }
.rule-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.rule-toggle { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.rule-toggle input { width: 18px; height: 18px; accent-color: var(--acc); }
.rule-history { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-soft); }
.order-structure summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.order-structure textarea { width: 100%; }

/* ══════════════════ 配图对话框 ══════════════════ */
.reference-tile { min-width: 0; }
.reference-tile > .btn { width: 100%; justify-content: center; margin-top: 8px; }
.reference-source { overflow-wrap: anywhere; margin: 6px 0; }
.reference-dialog { width: min(960px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto;
  box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px;
  background: var(--bg); color: var(--ink); }
.reference-dialog::backdrop { background: rgba(31, 30, 28, .45); }
.reference-heading { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: 8px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.reference-heading h2 { margin: 0; }
.reference-actions { display: flex; gap: 8px; margin-top: 10px; }
.reference-actions .btn { flex: 1; justify-content: center; }
.reference-import { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.reference-import input { flex: 1 1 300px; min-width: 0; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px; background: var(--surface); }
.reference-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.6; }
.reference-consent input { flex: none; margin-top: 5px; }
.reference-candidates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.reference-candidate { min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow-wrap: anywhere; }
.reference-candidate p { margin: 0; }
.reference-candidate > .btn { margin-top: auto; justify-content: center; }
.reference-candidate > a { font-size: 12.5px; margin-bottom: 5px; }
.reference-thumb { aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.reference-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.reference-thumb img[hidden] { display: none; }
.reference-thumb > span { display: none; padding: 16px; color: var(--ink-2); font-size: 12.5px; }
.reference-thumb.missing > span { display: block; }
.auto-reference { margin: 22px 0; padding: 20px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface-2); overflow-wrap: anywhere; }
.auto-reference h3 { margin-top: 0; }
.auto-reference-status { line-height: 1.6; }
.auto-reference textarea { width: 100%; box-sizing: border-box; margin: 12px 0; }

/* ══════════════════ 管理看板 ══════════════════ */
/* 只读管理（viewer）只看全店看板：品牌树 / 分组头 / 单子列表 / 除看板外的导航都收掉
   （route() 会把 viewer 的任何 hash 都落到全店看板，留着别的入口就是「点了没反应」）。
   「全店看板」这一项对 viewer 反向显示 —— .viewer-only 只在 viewer 身上出现。 */
body:not(.viewer) .viewer-only,
body.viewer .side .side-nav a:not(.viewer-only),
body.viewer .side .brands,
body.viewer .side .grouphd,
body.viewer .side .list { display: none; }
.manager-board { display: grid; gap: 14px; }
.manager-card h2 { margin-bottom: 12px; }

/* ══════════════════ 提示、断网 ══════════════════ */
.toast { z-index: 30; overflow-wrap: anywhere; position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: var(--r-sm); font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: opacity var(--t), transform var(--t); max-width: 80vw; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.offlinebar { position: sticky; top: 0; z-index: 40; padding: 9px 16px; background: var(--warn-w);
  color: var(--warn); border-bottom: 1px solid #EBC9C3; font-size: 13px; text-align: center; }

/* ══════════════════ 响应式 ══════════════════ */
@media (max-width: 1100px) {
  /* 工作页已经是单列（底部对话条不占列），这里只收窄固定宽的两栏。 */
  .loginside { width: 420px; padding: 0 44px; }
  .poster .inner { padding: 0 44px; }
  .poster h1 { font-size: 38px; }
  .poster .rule { left: 44px; right: 44px; }
  .poster .pfoot { left: 44px; }
}
@media (max-width: 900px) {
  /* 海报收窄：留品牌与一句话，登录窗优先 */
  .login { flex-direction: column; min-height: 0; }
  .poster { flex: none; min-height: 240px; }
  .poster .inner { padding: 40px 28px 32px; max-width: none; }
  .poster h1 { font-size: 30px; margin-bottom: 12px; }
  .poster .mark { margin-bottom: 14px; }
  .poster .brandsline { margin-top: 22px; }
  .poster .rule, .poster .b3 { display: none; }
  .poster .pfoot { position: static; margin: 0 28px 24px; }
  .loginside { width: auto; border-left: 0; border-top: 1px solid var(--line);
    padding: 32px 28px 44px; justify-content: flex-start; }
}
@media (max-width: 760px) {
  /* 左栏改抽屉：默认收起在屏幕外，点汉堡拉开，点遮罩/Esc/点导航项收回 */
  .burger { display: grid; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: 262px;
    transform: translateX(-100%); transition: transform var(--t) var(--ease); }
  body.drawer .side { transform: none; box-shadow: 0 0 40px rgba(31, 30, 28, .22); }
  .topbar { flex-wrap: wrap; padding: 8px 14px 10px; }
  .body { padding: 0 14px 40px; }
  .phasebar { overflow-x: auto; flex-wrap: nowrap; }
  .phasebar .p { white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .looks, .grid3, .chapters, .grid2, .otgrid { grid-template-columns: 1fr; }
  .work > * { min-width: 0; }
  .panel { padding: 18px 16px 22px; }
  .now { flex-direction: column; align-items: stretch; margin: -2px -4px 18px; }
  .now .btn { justify-content: center; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .pts li { grid-template-columns: 34px 1fr; }
  .pts li > :nth-child(2) { grid-column: 2; }
  .pts li > :nth-child(3) { grid-column: 2; }
  .checks li { flex-wrap: wrap; }
  .refgrid { grid-template-columns: repeat(2, 1fr); }
  .files { flex-direction: column; align-items: stretch; }
  .btn { white-space: normal; text-align: center; }
  .gate { margin-top: 4vh; padding: 24px 20px; }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  /* 表格：窄屏不拆列、不折字，改成整张横滑。
     压列宽会让「赵小天（小天）」折成三个字一行，反而更难扫。 */
  .card .cbd.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card .cbd.flush > .tbl { min-width: 560px; }
}
@media (max-width: 640px) {
  .confirmed-row { grid-template-columns: 82px minmax(0, 1fr); }
  .confirmed-row .btn { grid-column: 2; justify-self: end; }
}
@media (max-width: 600px) {
  .settings .box { padding: 20px 16px; }
  .worker-fields { grid-template-columns: 1fr; gap: 14px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .worker-row, .worker-actions { flex-wrap: wrap; }
  .worker-actions { gap: 10px; }
  .worker-credentials { padding: 16px; }
  .reference-dialog { padding: 16px; width: calc(100vw - 20px); max-height: 94vh; }
  .reference-candidates { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .reference-candidate { padding: 8px; font-size: 12.5px; }
  .reference-candidate .btn { padding: 8px 6px; font-size: 12.5px; }
  .reference-heading { align-items: flex-start; }
  .rule-history { flex-wrap: wrap; }
  .tbl td .rowacts { flex-direction: column; align-items: stretch; }
  .poster h1 { font-size: 26px; }
}
@media (max-width: 480px) {
  .form-grid, .rule-fields { grid-template-columns: minmax(0, 1fr); }
  .form-grid .wide { grid-column: 1 / -1; }
  .prog li { grid-template-columns: 22px minmax(0, 1fr); gap: 6px 10px; }
  .prog li > :last-child { grid-column: 2; }
  .reference-actions .btn { flex-basis: 100%; }
  .arts { grid-template-columns: minmax(0, 1fr); }
  .ptabs button, .phasebar button.p, .composer .chipx { min-height: 40px; }
  .field input, .field textarea, .field select, .composer .box textarea,
  .confirmed-row input, .confirmed-row select { font-size: 16px; }
  .toast { bottom: 16px; max-width: calc(100vw - 28px); width: max-content; }
  .loginside { padding: 28px 20px 40px; }
}

/* ══════════════════ 无障碍：动画必须能降级 ══════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .look:hover, .btn:hover, .venue-picks button:hover,
  .chip:hover, .phasebar button.p:hover:not([disabled]),
  .composer .chipx:hover, .composer .box .send:hover, .composer .box .mchip:hover,
  .tile:hover, .loginside .btn-main:hover { transform: none; }
  .side .foot .me:hover, .side .mmenu .mi:hover { background: inherit; }
  /* 菜单弹出：降级成直接出现，不做位移缩放 */
  .side .mmenu { transform: none; }
  .side .mmenu.open { transform: none; }
  .spin { animation: spin 1.2s linear infinite !important; }   /* 转动是状态指示，不是装饰 */
  .strip .dotp { animation: pulse 1.6s var(--ease-io) infinite !important; }
  .msg { animation: none !important; }
  .composer .menu { animation: none !important; }
}
