/* 私域 STUDIO · 新版视觉（2026-10-18）
   方向：青瓷台账 —— 纸白底色、墨绿主色、细线分隔，信息按重要性排，不做花活。
   这层放在最后加载，覆盖旧样式；不动任何业务选择器。 */

:root {
  --bg: #f4f6f3;
  --paper: #ffffff;
  --ink: #16211d;
  --muted: #5d6a64;
  --line: #e1e7e2;
  --accent: #1f6a55;
  --accent-soft: #e8f1eb;
  --red: #a5442f;
  --amber: #7a5a22;
  --shadow: none;
}

html, body { background: var(--bg); }
body { color: var(--ink); font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif; }

/* ---------- 外壳 ---------- */
.shell { grid-template-columns: 236px minmax(0, 1fr); }

.sidebar {
  background: #13221d;
  border-right: 0;
  padding: 26px 16px 18px;
}
.sidebar .brand { color: #fff; font-size: 21px; padding: 0 10px; }
.sidebar .brand span { color: rgba(255,255,255,.5); }
.sidebar-caption { color: rgba(255,255,255,.42); margin: 6px 10px 30px; font-size: 11px; }
.nav-label { color: rgba(255,255,255,.38); margin: 0 10px 8px; letter-spacing: .12em; }
.nav-item {
  color: #b9c7c0; border-radius: 7px; padding: 10px 11px; min-height: 40px;
  font-size: 13px; margin: 2px 0;
}
.nav-item svg { opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 500; }
.nav-item.active svg { opacity: 1; }
.nav-more { border-top: 1px solid rgba(255,255,255,.1); margin-top: 14px; padding-top: 6px; }
.nav-more > summary { color: rgba(255,255,255,.5); font-size: 11px; padding: 9px 10px; }
.nav-more > summary::after { color: rgba(255,255,255,.4); }
.nav-more > summary:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-more[open] > summary { color: rgba(255,255,255,.75); }
.sidebar-bottom { color: rgba(255,255,255,.38); padding: 20px 10px 0; }
.local-dot { background: #7fbfa8; }

.topbar { background: transparent; border-bottom: 1px solid var(--line); padding: 15px 40px; min-height: 64px; }
.merchant-name > span { color: #8a968f; }
.merchant-name strong { font-size: 14px; font-weight: 600; }
.user-menu { color: var(--muted); }
.user-role { border-color: var(--line); color: #7d8a83; }

.workspace main { max-width: 1340px; padding: 34px 40px 72px; }

/* 去掉英文小标，标题自己说话 */
.eyebrow { display: none !important; }

.page-head { margin-bottom: 26px; align-items: flex-start; }
.page-head h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.page-head > div > p:last-child { color: var(--muted); font-size: 13px; margin-top: 8px; max-width: 62ch; }

/* ---------- 面板与卡片 ---------- */
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: none; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 4px; }

.metric-grid { border-bottom: 1px solid var(--line); gap: 0; padding: 4px 0 24px; margin-bottom: 22px; }
.metric-grid > div { padding: 0 22px; border-right: 1px solid var(--line); }
.metric-grid > div:first-child { padding-left: 0; }
.metric-grid span { font-size: 12px; color: var(--muted); }
.metric-grid strong { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.metric-grid small { font-size: 11px; color: #7f8c85; }

/* ---------- 按钮与表单 ---------- */
.button {
  min-height: 36px; padding: 7px 14px; border-radius: 7px; border: 1px solid #d9e0da;
  background: #fff; color: #2b3a33; font-size: 13px; font-weight: 500;
}
.button:hover:not(:disabled) { background: #f7f9f7; border-color: #c3cec6; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: #185744; border-color: #185744; }
.button.text { color: var(--accent); }
.button.small { min-height: 30px; font-size: 12px; }

.field input, .field textarea, .field select, .knowledge-filter select {
  border: 1px solid #dbe2dc; border-radius: 7px; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,106,85,.12);
}
.field > span { color: #41504a; font-size: 12px; font-weight: 500; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: #d6e8dd; }

/* ---------- 状态色 ---------- */
.status-chip { border-radius: 999px; font-size: 11px; padding: 2px 9px; }
.status-chip.connected { background: var(--accent-soft); color: #185744; }
.status-chip.offline { background: #fbf1e3; color: var(--amber); }
.status-chip.unconfirmed { background: #f1f3f1; color: #64716b; }

.cw-recovery, .draft-recovery { background: #fbf6ea; border: 1px solid #efe0c4; color: #6c5626; border-radius: 8px; }
.cw-error, .feedback.error { background: #fdf1ee; border: 1px solid #f2d9d2; color: #8d3a28; }

/* ---------- 会话三栏 ---------- */
.cw-layout { gap: 18px; }
.cw-layout > aside, .cw-chat, .cw-customer {
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 16px;
}
.cw-item { border-radius: 8px; padding: 10px 11px; border-color: transparent; margin-bottom: 4px; }
.cw-item:hover { background: #f7f9f7; }
.cw-item.selected { background: var(--accent-soft); border-color: #cfe2d7; }
.cw-item .cw-item-top strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cw-item .cw-item-last { font-size: 12.5px; color: #66736c; }
.cw-item .cw-item-meta { font-size: 11px; color: #8a968f; }
.cw-dot { background: #b3bfb8; }
.cw-bubble { border-radius: 10px; }
.cw-bubble-owner { background: var(--accent-soft); border-color: #d3e5da; color: #1d3b31; }
.cw-judge { color: #5d6a64; }
.cw-judge-tag { background: var(--accent-soft); border-color: #cfe2d7; color: #185744; }
.cw-messages { background: transparent; }

/* ---------- 章节条 ---------- */
.cw-jump button { border-color: #dde4de; color: #52605a; border-radius: 999px; font-size: 12.5px; }
.cw-jump button:hover { border-color: #b9cfc3; color: var(--accent); }
.cw-jump--tabs button.is-active { background: var(--accent); border-color: var(--accent); }

/* ---------- 表格与列表 ---------- */
.cw-table-head { background: #f7f9f7; color: #5d6a64; font-size: 11.5px; letter-spacing: .02em; }
.cw-table { border-color: var(--line); }
.cw-stat { border-color: var(--line); }
.cw-metric { background: #f7f9f7; border-radius: 8px; }

@media (max-width: 1000px) {
  .topbar { padding: 13px 24px; }
  .workspace main { padding: 26px 24px 56px; }
}
@media (max-width: 640px) {
  .sidebar { background: #13221d; padding: 18px 14px 8px; }
  .nav-item { font-size: 12.5px; }
  .workspace main { padding: 22px 16px 48px; }
  .page-head h1 { font-size: 26px; }
  .metric-grid strong { font-size: 30px; }
}
/* ---------- 细节：标题一致、提示条收窄 ---------- */
.cw-layout h2, .cw-chat h2, .cw-customer h2, .cw-list h2 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.cw-layout h3 { font-size: 13px; font-weight: 600; }
.cw-chat > p, .cw-customer > p { font-size: 12.5px; color: var(--muted); }

.draft-recovery {
  background: #fbf7ec; border: 1px solid #eee0c6; border-radius: 8px;
  color: #6a5a35; padding: 12px 16px; margin: 0 0 20px; font-size: 12px;
}
.draft-recovery strong { font-size: 12px; font-weight: 600; }
.draft-recovery .actions { margin-top: 8px; gap: 8px; }

/* 会话页顶部状态行 */
.reception-state { background: #f7f9f7; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.reception-state-heading strong { color: var(--ink); }

/* 日期轴与图例 */
.cw-legend { color: var(--muted); font-size: 11px; }
.cw-bar i { background: #b9d8c8; border-radius: 3px 3px 0 0; }
.cw-bar b { background: var(--accent); border-radius: 3px 3px 0 0; }
.cw-legend i { background: #b9d8c8; }
.cw-legend b { background: var(--accent); }
.cw-bar span { color: #8a968f; }
/* 七日柱状图：用 scaleY 画，避免百分比高度在 flex 里算成 0 */
.cw-bars { height: 96px; align-items: stretch; gap: 12px; }
.cw-bar { position: relative; flex: 1; height: auto; display: block; }
.cw-bar i, .cw-bar b {
  position: absolute; bottom: 0; width: 9px; height: 100%;
  transform-origin: bottom; border-radius: 3px 3px 0 0;
}
.cw-bar i { left: calc(50% - 11px); }
.cw-bar b { left: calc(50% + 2px); }
.cw-bar span { position: absolute; bottom: -19px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.cw-bars { padding-bottom: 20px; }
/* 手机：顶部深色区收紧，别占掉半屏 */
@media (max-width: 640px) {
  .sidebar { padding: 14px 14px 10px; }
  .sidebar .brand { font-size: 18px; padding: 0 4px; }
  .sidebar-caption { display: none; }
  .sidebar nav { margin-top: 10px; }
  .nav-item { min-height: 34px; padding: 7px 10px; }
  .nav-more { margin-top: 6px; padding-top: 2px; border-top: 0; }
  .nav-more > summary { padding: 6px 4px; }
  .sidebar-bottom { display: none; }
  .topbar { min-height: 52px; }
}
/* ---------- 设置总览 ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hub-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.hub-card strong { font-size: 14px; font-weight: 600; }
.hub-card small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.hub-card:hover { border-color: #c3d4c9; background: #f8fbf9; }
.hub-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .hub-grid { grid-template-columns: 1fr; } .hub-card { padding: 16px; } }
/* 内容短的时候别露出白底 */
.shell, .workspace, .workspace main { background: var(--bg); }
.workspace { min-height: 100dvh; }
/* 字号整体加大一号：老板说窗口小时看不清 */
body { font-size: 15px; }
.conversation-workbench { font-size: 15px; }
.cw-item .cw-item-top strong { font-size: 14.5px; }
.cw-item .cw-item-last { font-size: 13.5px; }
.cw-chat, .cw-customer, .cw-messages, .cw-turn, .cw-message { font-size: 15px; }
.panel-head h2 { font-size: 15px; }
.nav-item { font-size: 13.5px; }
.button { font-size: 13.5px; }
@media (max-width: 640px) {
  body, .conversation-workbench { font-size: 16px; }
  .nav-item { font-size: 14px; }
  .page-head h1 { font-size: 28px; }
  .page-head > div > p:last-child { font-size: 14px; }
  .button { font-size: 14px; min-height: 40px; }
  .cw-item .cw-item-top strong { font-size: 15.5px; }
  .cw-item .cw-item-last { font-size: 14px; }
  .panel-head h2 { font-size: 16px; }
}
/* ===== 字号系统：一套阶梯，三档开关 ===== */
.text-size-btn {
  min-width: 30px; height: 28px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.text-size-btn:hover { border-color: #c3d4c9; color: var(--accent); }

:root {
  --fs-h1: 30px; --fs-h2: 16px; --fs-h3: 15px; --fs-p: 14px;
  --fs-small: 12.5px; --fs-btn: 14px; --fs-table: 13.5px; --fs-chat: 14.5px;
  --fs-item: 14px; --fs-item-sub: 13px; --fs-nav: 13.5px; --fs-judge: 12.5px;
}
html[data-text-size="lg"] {
  --fs-h1: 32px; --fs-h2: 17px; --fs-h3: 15.5px; --fs-p: 15px;
  --fs-small: 13px; --fs-btn: 15px; --fs-table: 14px; --fs-chat: 15.5px;
  --fs-item: 15px; --fs-item-sub: 14px; --fs-nav: 14px; --fs-judge: 13px;
}
html[data-text-size="xl"] {
  --fs-h1: 36px; --fs-h2: 19px; --fs-h3: 17px; --fs-p: 17px;
  --fs-small: 14.5px; --fs-btn: 17px; --fs-table: 15.5px; --fs-chat: 17px;
  --fs-item: 17px; --fs-item-sub: 15.5px; --fs-nav: 15.5px; --fs-judge: 14.5px;
}

main h1 { font-size: var(--fs-h1) !important; font-weight: 600 !important; letter-spacing: -.02em !important; line-height: 1.35 !important; }
main h2 { font-size: var(--fs-h2) !important; font-weight: 600 !important; line-height: 1.5 !important; }
main h3 { font-size: var(--fs-h3) !important; font-weight: 600 !important; }
main p { font-size: var(--fs-p) !important; line-height: 1.75 !important; }
main small, .page-footnote { font-size: var(--fs-small) !important; line-height: 1.7 !important; }
main button, .button { font-size: var(--fs-btn) !important; }
main .button.small { font-size: calc(var(--fs-btn) - 1.5px) !important; }
.cw-table, .cw-table th, .cw-table td, .cw-table-head { font-size: var(--fs-table) !important; }
.field > span, .field > small, fieldset > p { font-size: calc(var(--fs-p) - 1px) !important; }
.hub-card strong { font-size: var(--fs-h2) !important; }
.hub-card small { font-size: var(--fs-p) !important; }
.cw-bubble, .cw-message, .cw-turn { font-size: var(--fs-chat) !important; line-height: 1.75 !important; }
.cw-judge, .cw-judge small { font-size: var(--fs-judge) !important; }
.cw-item .cw-item-top strong { font-size: var(--fs-item) !important; }
.cw-item .cw-item-last { font-size: var(--fs-item-sub) !important; }
.cw-item .cw-item-meta { font-size: calc(var(--fs-item-sub) - 1px) !important; }
.nav-item { font-size: var(--fs-nav) !important; }
html[data-text-size="std"] {
  --fs-h1: 30px; --fs-h2: 16px; --fs-h3: 15px; --fs-p: 14px;
  --fs-small: 12.5px; --fs-btn: 14px; --fs-table: 13.5px; --fs-chat: 14.5px;
  --fs-item: 14px; --fs-item-sub: 13px; --fs-nav: 13.5px; --fs-judge: 12.5px;
}
/* ===== 间距与版式统一 ===== */
.page-head { margin-bottom: 22px; }
.page-head > div > p:last-child { margin-top: 6px; }
.panel-head { padding: 16px 20px; }
.panel-body, .cw-cust-page { padding: 0; }
.cw-cust-page { display: flex; flex-direction: column; gap: 16px; }
.cw-layout { gap: 16px; }
.cw-layout > aside, .cw-chat, .cw-customer { padding: 16px 16px; }
.cw-layout h2 { margin-bottom: 10px; }
.cw-list-panel .cw-table { margin-top: 4px; }

/* 今天该开口：标题栏做成真正的条，按钮不要再横贯整页 */
.cw-outreach .cw-table-head { padding: 16px 20px; background: #f7f9f7; border-bottom: 1px solid var(--line); }
.cw-outreach .cw-table-head h3 { font-size: var(--fs-h2) !important; margin-bottom: 2px; }
.cw-outreach > .button { width: auto; margin: 12px 20px; min-height: 32px; font-size: calc(var(--fs-btn) - 2px) !important; }
.cw-outreach-item { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.cw-outreach-item:last-child { border-bottom: 0; }
.cw-outreach-item header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cw-outreach-item header strong { font-size: var(--fs-item) !important; }
.cw-outreach-item p { margin: 6px 0 4px; font-size: calc(var(--fs-p) - .5px) !important; }
.cw-outreach-item small { font-size: calc(var(--fs-small) - .5px) !important; }
.cw-outreach-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.cw-outreach-actions .button { min-height: 30px; font-size: calc(var(--fs-btn) - 2px) !important; }

/* 会话页顶部状态行：收成一行说明 */
main > div > .reception-state, .conversation-entry-status { margin: 0 0 16px; }
/* 四个数字不再做成"卡片里套卡片"，用细线分隔 */
.cw-metric-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; }
.cw-metric-row .cw-metric { background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 2px 0 2px 18px; }
.cw-metric-row .cw-metric:first-child { border-left: 0; padding-left: 0; }
.cw-metric-row .cw-metric span { font-size: var(--fs-small) !important; color: var(--muted); }
.cw-metric-row .cw-metric strong { font-size: calc(var(--fs-h1) + 4px) !important; font-weight: 600 !important; letter-spacing: -.02em; }
.cw-metric-row .cw-metric small { font-size: var(--fs-small) !important; color: #7f8c85; }
@media (max-width: 900px) {
  .cw-metric-row { grid-template-columns: 1fr 1fr; }
  .cw-metric-row .cw-metric { border-left: 0; padding: 10px 0; border-top: 1px solid var(--line); }
  .cw-metric-row .cw-metric:nth-child(-n+2) { border-top: 0; }
}
/* ===== 客户详情：选中后详情排到名单上面（之前被重写样式表时冲掉了，重新加） ===== */
.cw-cust-page.has-detail { display: flex; flex-direction: column; gap: 16px; }
.cw-cust-page.has-detail > .cw-list-panel { order: 2; }
.cw-cust-page.has-detail > section:last-child { order: 1; }
.cw-cust-page.has-detail #b1-create { display: none; }
.cw-cust-page.has-detail #b1-customer > fieldset > p.mono { display: none; }
.cw-cust-page.has-detail #b1-customer > fieldset > p:nth-of-type(2),
.cw-cust-page.has-detail #b1-customer > fieldset > p:nth-of-type(4) { display: none; }
.cw-cust-page.has-detail #b1-customer > fieldset > h2 { font-size: calc(var(--fs-h1) - 8px) !important; font-weight: 600; margin-bottom: 6px; }

/* 没填的字段收在折叠里 */
.cw-facts-more { margin-top: 14px; border: 1px dashed var(--line); border-radius: 8px; padding: 12px 16px; }
.cw-facts-more > summary { cursor: pointer; font-size: var(--fs-small) !important; color: var(--muted); list-style: none; }
.cw-facts-more > summary::-webkit-details-marker { display: none; }
.cw-facts-more > summary::before { content: '＋ '; color: var(--accent); }
.cw-facts-more[open] > summary::before { content: '－ '; }
.cw-facts-more[open] > summary { margin-bottom: 10px; }
/* 点客户 = 独立的客户卡片：名单先收起，返回再出来 */
.cw-cust-page.has-detail > .cw-list-panel { display: none; }
.page-head .actions, .page-head button + button { margin-left: 8px; }


/* ---------- 模型通道（2026-10-18） ----------
   一张卡选「现在用哪家」，下面每家在同一个位置填自己的密钥。
   视觉沿用青瓷台账：细线分隔、绿边表示正在使用，不用色块堆信息。 */
.model-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.model-choice-card {
  border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 14px 16px;
  text-align: left; display: grid; gap: 6px; font: inherit; cursor: pointer;
}
.model-choice-card:hover { border-color: #c3d4c9; background: #f8fbf9; }
.model-choice-card.active { border-color: var(--accent); background: #fbfdfb; box-shadow: inset 0 0 0 1px var(--accent); }
.model-choice-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.model-choice-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.model-pills { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.model-pill {
  border: 1px solid #d9e0da; background: #fff; border-radius: 999px; padding: 4px 13px;
  font-size: 12px; color: #41504a; cursor: pointer; font-family: inherit;
}
.model-pill:hover { border-color: #c3cec6; background: #f7f9f7; }
.model-pill.focused { border-color: var(--accent); color: var(--accent); background: #fbfdfb; }
.model-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.model-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.model-pill.unverified { border-style: dashed; color: #7f8c85; }
.model-pill.unverified.active { color: #fff; }
.model-refresh {
  margin-left: auto; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 6px; padding: 3px 10px; font-size: 11px; cursor: pointer; font-family: inherit; font-weight: 500;
}
.model-refresh:hover { color: var(--accent); border-color: var(--accent); }
.model-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #cfd8d2; display: inline-block; }
.model-choice-card.active .model-dot { border-color: var(--accent); background: radial-gradient(circle at center, var(--accent) 0 3.5px, #fff 4px 100%); }
.model-choice-card.focused:not(.active) { border-color: var(--accent); background: #fbfdfb; box-shadow: inset 0 0 0 1px #cfe3d6; }
.model-current { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.model-current strong { color: var(--ink); font-weight: 600; }
.model-current-hint { margin: 6px 0 0; font-size: 12px; color: var(--accent); }
.model-choice-card > .status-chip { justify-self: start; }
.model-choice-meta { font-size: 12px; color: var(--muted); }

.model-key { padding: 16px 0; border-bottom: 1px solid var(--line); }
.model-key:first-child { padding-top: 0; }
.model-key:last-child { border-bottom: 0; padding-bottom: 0; }
.model-key-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.model-key-head strong { font-size: 13px; font-weight: 600; }
.model-key-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.model-key-row input { flex: 1; min-width: 220px; height: 38px; border: 1px solid #dbe2dc; border-radius: 7px; padding: 0 12px; font-size: 13px; background: #fff; }
.model-key-row input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.model-key-row + .model-key-row { margin-top: 8px; }
.model-key-row input[type=url] { color: #41504a; font-size: 12px; }
.model-key-row select { height: 38px; border: 1px solid #dbe2dc; border-radius: 7px; padding: 0 8px; font-size: 13px; background: #fff; }
.model-key-hint { font-size: 11px; color: #7f8c85; margin: 8px 0 0; line-height: 1.6; }
.model-key-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 11px; color: #7f8c85; }
.model-key-foot > span { flex: 1; }

.model-test { display: flex; align-items: baseline; gap: 12px; font-size: 13px; color: var(--muted); }
.model-test strong { font-size: 14px; }
.model-test.ok strong { color: var(--accent); }
.model-test.bad strong { color: var(--red); }
.model-test-reply { margin: 10px 0 0; font-size: 12px; color: var(--muted); word-break: break-all; }

@media (max-width: 760px) {
  .model-choice { grid-template-columns: 1fr; }
  .model-key-row input { min-width: 0; }
}
/* ===== 会话页顶部收拢：三条横带合成一条 ===== */
.conversation-workbench > header h1 { margin: 0 0 4px; }
.conversation-workbench > header p { margin: 0; color: var(--muted); }
.cw-readiness { border: 0; background: transparent; padding: 0; margin: 10px 0 0; display: block; }
.cw-readiness > summary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 13px; color: var(--muted); list-style: none; cursor: pointer;
}
.cw-readiness > summary::-webkit-details-marker { display: none; }
.cw-readiness[open] > summary { border-color: #c3d4c9; color: var(--accent); }
.cw-recovery {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 16px; margin: 12px 0 0; font-size: 13.5px; border-radius: 8px;
}
.cw-recovery .button { flex: none; min-height: 30px; font-size: 13px !important; }
.cw-layout { margin-top: 16px; }
/* 宽屏别把内容挤成一条：主区放宽，表单不拉满 */
.workspace main { max-width: 1560px; }
.model-choice { max-width: 900px; }
.model-key { max-width: 760px; }
.model-key-row { display: flex; gap: 10px; align-items: center; }
.model-key-row input { flex: 1 1 auto; max-width: 520px; }
.model-key-row .button { flex: none; }
.model-key-hint { color: var(--muted); }
.model-current { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.model-current strong { color: var(--ink); }
/* 不要给整页套绿框：main 只是接收焦点，不是选中态 */
main:focus, main:focus-visible { outline: none; }
/* 设置类页面：面板按内容宽度，不拉满整屏 */
.workspace main:has(.model-choice) > section.panel { max-width: 900px; }
/* ===== 视觉方向 B：浅色侧栏 + 米白纸感 + 更柔的卡片 ===== */
html[data-theme="b"] { --bg: #faf9f6; --line: #e7e4dd; --accent: #1d6b57; --accent-soft: #e8f1ec; }
html[data-theme="b"] .sidebar { background: #fff; border-right: 1px solid var(--line); }
html[data-theme="b"] .sidebar .brand { color: var(--ink); }
html[data-theme="b"] .sidebar .brand span { color: #9aa59f; }
html[data-theme="b"] .sidebar-caption { color: #9aa59f; }
html[data-theme="b"] .nav-label { color: #a7b0ab; }
html[data-theme="b"] .nav-item { color: #55635d; }
html[data-theme="b"] .nav-item:hover { background: #f4f3ef; color: var(--ink); }
html[data-theme="b"] .nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
html[data-theme="b"] .nav-more { border-top-color: var(--line); }
html[data-theme="b"] .nav-more > summary { color: #8b968f; }
html[data-theme="b"] .sidebar-bottom { color: #a0aaa4; }
html[data-theme="b"] .panel { border-radius: 12px; border-color: var(--line); box-shadow: 0 1px 2px rgba(22,33,29,.04); }
html[data-theme="b"] .topbar { background: transparent; }
html[data-theme="b"] .page-head h1 { font-size: calc(var(--fs-h1) + 2px) !important; }

/* ===== 视觉方向 C：紧凑两栏，把「客户情况」收起 ===== */
html[data-theme="c"] { --bg: #f1f4f2; }
html[data-theme="c"] .nav-item { min-height: 34px; padding: 6px 10px; }
html[data-theme="c"] .panel-head { padding: 12px 16px; }
html[data-theme="c"] .cw-layout { grid-template-columns: 264px minmax(0, 1fr) !important; }
html[data-theme="c"] .cw-customer { display: none; }
html[data-theme="c"] .page-head h1 { font-size: calc(var(--fs-h1) - 2px) !important; }
html[data-theme="c"] .workspace main { padding-top: 22px; }
/* ===== 模型通道页：不套卡片、整页收窄、底行对齐 ===== */
main:has(.model-choice) { max-width: 1080px; }
main:has(.model-choice) > section.panel { max-width: 760px; }
.model-choice { display: flex; flex-direction: column; }
.model-choice-card {
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; padding: 16px 20px; margin: 0; box-shadow: none;
}
.model-choice-card:last-child { border-bottom: 0; }
.model-choice-card.active { background: #f5faf7; }
.model-choice-card.focused { box-shadow: inset 2px 0 var(--accent); }
.model-choice-name { display: flex; align-items: center; gap: 10px; margin: 0; }
.model-choice-name strong, .model-name { font-size: 15px; font-weight: 600; }
.model-pills { margin-top: 10px; }
.model-current { padding: 12px 20px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.model-key { max-width: none; }
.model-key-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.model-key-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.model-key-hint { margin: 0 auto 0 0 !important; }
.model-key-row + .model-key-row { margin-top: 8px; }
.model-choice-card.focused { box-shadow: none; }
.model-key-foot { flex-wrap: wrap; }
.model-key-foot .model-price { margin-right: auto; color: var(--muted); }
.model-key-foot .model-saved { color: #8a968f; }
/* ===== 自适应屏幕：主区铺满，模型页宽屏两栏 ===== */
.workspace main { max-width: none; }
main:has(.model-choice) {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
main:has(.model-choice) > .page-head { grid-column: 1 / -1; }
main:has(.model-choice) > section.panel { max-width: none; }
main:has(.model-choice) .model-choice { max-width: none; }
main:has(.model-choice) .model-key { max-width: none; }
@media (max-width: 1320px) {
  main:has(.model-choice) { grid-template-columns: 1fr; }
}