/* feedbot 控制台的样式。颜色和字体照模拟页面里的 FeedMob 设计系统（project/ds/feedmob/tokens.json）。
   不连外网：不从 Google Fonts 拉 Lato，本机装了 Lato 就用，中文用系统的苹方。 */

:root {
  --teal: #00B5AD;
  --teal-hover: #00A39C;
  --teal-dark: #008682;
  --teal-tint: #E6F7F6;
  --navy: #31404E;
  --navy-dark: #1D262F;
  --charcoal: #444444;
  --muted: #4C5864;
  --line-strong: #B2B7BD;
  --line: #E5E7E9;
  --bg: #F7F8F9;
  --white: #FFFFFF;
  --blue: #1B9BC2;
  --coral: #EE6969;
  --yellow: #F7BD63;
  --yellow-tint: #FDF2DF;
  --coral-tint: #FDECEC;
  --ink: #1D262F;
  --font: 'Lato', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: Menlo, Consolas, 'SF Mono', monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--charcoal);
  background: var(--bg);
}
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 50;
  background: var(--white); color: var(--ink); padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }

/* 装成 App 后（iPhone 主屏幕打开）状态栏是透明的，页面从屏幕最上面开始画：留出状态栏和刘海的位置，
   状态栏下面垫一条深色（和手机上的顶栏一个颜色），白色的时间和电量才看得清。浏览器里这些值都是 0。 */
body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
body::before {
  content: ''; position: fixed; z-index: 60; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px); background: var(--navy-dark); pointer-events: none;
}

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.push-right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.loading { margin: 0; padding: 12px 0; color: var(--muted); }

/* ---------- 外框：左侧导航 + 正文 ---------- */

.shell { display: flex; min-height: calc(100vh - env(safe-area-inset-top, 0px)); }

.sidenav {
  flex: 0 0 232px;
  position: sticky; top: env(safe-area-inset-top, 0px); height: calc(100vh - env(safe-area-inset-top, 0px)); overflow-y: auto;
  background: var(--navy-dark); color: var(--white);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.logo {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  background: var(--teal); color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 19px;
}
.logo-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 17px; font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--line-strong); }

.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-links .nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 40px; padding: 0 12px; border-radius: 8px;
  color: var(--line); text-decoration: none; font-size: 14px;
}
.nav-links .nav-item:hover { background: rgba(255, 255, 255, 0.07); color: var(--white); }
.nav-links .nav-item[aria-current="page"] { background: var(--navy); color: var(--white); font-weight: 700; }
/* 侧栏分组（10/31 晚）：每天看、协作（原来叫"要处理"）、更多（默认收起）、设置放最下面 */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 10px; }
.nav-group-label, .nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0 12px; min-height: 24px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--line-strong);
}
.nav-group-toggle { border: none; background: none; cursor: pointer; text-align: left; border-radius: 6px; min-height: 32px; }
.nav-group-toggle:hover { color: var(--white); background: rgba(255, 255, 255, 0.07); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; }
.nav-group-bottom { padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.nav-more-wrap { display: none; } /* 宽屏上所有页面都在侧栏里 */
.nav-short { display: none; } /* 手机底部放不下的长名字用短的 */
.nav-count { font-size: 12px; color: var(--line-strong); font-weight: 400; }
.nav-count-alert {
  background: var(--yellow); color: var(--navy-dark); font-weight: 700;
  border-radius: 999px; padding: 1px 8px;
}

.nav-foot {
  margin-top: auto; padding: 0 6px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--line-strong); line-height: 1.5;
}
.conn { display: inline-flex; align-items: center; gap: 6px; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.conn[data-state="ok"] .dot { background: var(--teal); }
.conn[data-state="warn"] .dot { background: var(--yellow); }
.conn[data-state="error"] .dot { background: var(--coral); }

.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#main { outline: none; flex: 1 0 auto; }

/* 顶栏：右边是当前账号。窄屏上还放品牌和连接状态（左侧导航挪到底部了） */
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  min-height: 48px; padding: 6px 32px; background: var(--white); border-bottom: 1px solid var(--line);
}
.topbar-brand, .topbar-conn { display: none; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.acct-who { min-width: 0; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who.acct-dev {
  font-weight: 400; font-size: 12px; color: var(--ink);
  background: var(--yellow-tint); border: 1px solid var(--yellow); border-radius: 999px; padding: 1px 10px;
}
.acct-link { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; color: var(--navy); }

/* 顶栏右边的环境标记（10/31 晚：替代每页一行的"开发模式"横幅）：点开看说明 */
.env-badge { position: relative; flex: none; }
.env-badge > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 28px;
  padding: 0 10px; border-radius: 999px; border: 1px dashed var(--navy-dark); background: var(--yellow-tint);
  font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.env-badge > summary::-webkit-details-marker { display: none; }
.env-badge[open] > summary { background: var(--yellow); }
.env-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: min(340px, 86vw);
  padding: 10px 12px; border-radius: 10px; background: var(--white); border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(29, 38, 47, 0.18); font-size: 12px; line-height: 1.6; color: var(--ink);
}
.env-pop ul { display: flex; flex-direction: column; gap: 4px; }

/* ---------- 页头和正文 ---------- */

.page-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 18px 32px; background: var(--white); border-bottom: 1px solid var(--line);
}
.page-head .titles { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); outline: none; }
.page-head .sub { margin: 0; font-size: 13px; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.updated { font-size: 12px; color: var(--muted); }

.content {
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 24px 32px 40px;
  display: flex; flex-direction: column; gap: 18px;
}
.content h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); outline: none; }
.content > div:empty { display: none; } /* 空着的占位（出错、定位的那条）不占间距 */

/* ---------- 按钮和标签 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--white); color: var(--ink);
  font-size: 13px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-lg { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn-primary { border-color: transparent; background: var(--teal); font-weight: 700; }
.btn-primary:hover { border-color: transparent; background: var(--teal-hover); }
.btn-danger { border-color: transparent; background: var(--coral); font-weight: 700; }
.btn-danger:hover { border-color: transparent; background: #E85A5A; }
.btn:disabled { opacity: 0.6; cursor: default; }

.linklike {
  border: none; background: none; padding: 0; margin: 0; text-align: left; cursor: pointer;
  color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 3px; overflow-wrap: anywhere;
}
.linklike:hover { text-decoration-color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 12px; line-height: 1.6; border-radius: 999px; padding: 0 8px;
  color: var(--ink); background: var(--line);
}
.pill-teal { background: var(--teal); font-weight: 700; }
.pill-yellow { background: var(--yellow); font-weight: 700; }
.pill-blue { background: var(--blue); font-weight: 700; }
.pill-coral { background: var(--coral); font-weight: 700; }
.pill-grey { background: var(--line); }
.pill-outline { background: transparent; border: 1px solid var(--line-strong); padding: 0 7px; }

code.cmd {
  font-family: var(--mono); font-size: 12px;
  background: var(--line); color: var(--ink); border-radius: 6px; padding: 2px 8px;
}
.cmd-block {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: var(--navy-dark); color: var(--line);
  font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all;
}

/* ---------- 卡片、统计、空状态 ---------- */

.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.panel-accent { border: 2px solid var(--teal); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.panel > p { margin: 0; line-height: 1.6; }

.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat {
  flex: 1 1 140px; min-width: 0;
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
  color: inherit; text-decoration: none;
}
a.stat:hover { border-color: var(--muted); border-left-color: var(--yellow); }
.stat strong { font-size: 24px; font-weight: 700; color: var(--ink); }
.stat span { font-size: 13px; color: var(--muted); }
.stat-teal { border-left-color: var(--teal); }
.stat-yellow { border-left-color: var(--yellow); }
.stat-blue { border-left-color: var(--blue); }
.stat-grey { border-left-color: var(--line-strong); }

.state {
  background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--teal);
  border-radius: 12px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.state-wait { border-top-color: var(--blue); }
.state-warn { border-top-color: var(--yellow); }
.state-error { border-top-color: var(--coral); }
.state-label { font-size: 12px; color: var(--muted); }
.state h2 { margin: 0; font-size: 16px; }
.state p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); }

/* ---------- 等你开工 ---------- */

.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.task {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.task-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--ink); background: var(--line-strong);
}
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.meta > * { min-width: 0; overflow-wrap: anywhere; }
.brief {
  margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg);
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px;
  font-size: 13px; line-height: 1.6; color: var(--ink);
}
.brief dt { font-weight: 700; color: var(--muted); }
.brief dd { margin: 0; overflow-wrap: anywhere; }
.task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-summary { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.hint {
  border: 1px solid var(--teal); background: var(--teal-tint); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; line-height: 1.7; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px;
}
.hint-title { margin: 0; font-weight: 700; }
.hint ol { margin: 0; padding-left: 20px; }

/* ---------- 确认请求 ---------- */

.approval-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
}
.approval {
  background: var(--white); border: 2px solid var(--yellow); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; outline: none;
}
.approval.is-allowed { border-color: var(--teal); }
.approval.is-denied { border-color: var(--coral); }
.approval.is-stale { border-color: var(--line-strong); }
.approval-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.countdown { margin-left: auto; color: var(--ink); font-weight: 700; }
.approval h3 { margin: 0; font-size: 17px; color: var(--ink); }
.cmdline {
  margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg);
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto;
}
.facts { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.fact { display: flex; gap: 10px; min-width: 0; }
.fact dt { flex: none; width: 56px; color: var(--muted); }
.fact dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-allow { flex: 2 1 180px; min-height: 52px; font-size: 16px; border-radius: 10px; }
.btn-deny { flex: 1 1 110px; min-height: 52px; font-size: 15px; border-radius: 10px; }
.deny-form { display: flex; flex-direction: column; gap: 8px; }
.deny-form .btn { min-height: 44px; padding: 0 16px; }
.deny-form label { font-size: 12px; font-weight: 700; color: var(--ink); }
textarea {
  width: 100%; min-height: 64px; resize: vertical;
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; color: var(--ink);
}
.card-status { margin: 0; font-size: 13px; color: var(--muted); }
.card-status:empty { display: none; }
.card-status.is-error { color: #B42318; }
.card-result { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.approval h3 { outline: none; }
/* 来自哪个会话：和命令摘要一起，一眼看清 */
.origin {
  margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px;
  font-size: 13px; color: var(--ink); line-height: 1.5;
}
.origin > * { min-width: 0; overflow-wrap: anywhere; }
.origin-label { font-size: 12px; font-weight: 700; color: var(--muted); }
/* 点通知打开的那一条 */
.approval.is-focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.approval { scroll-margin-top: calc(16px + env(safe-area-inset-top, 0px)); }
.focus-outcome { scroll-margin-top: calc(16px + env(safe-area-inset-top, 0px)); }
.focus-outcome h2 { outline: none; }
.focus-outcome .cmdline { max-height: 120px; }

/* 实时更新的状态，在页头"刷新"旁边 */
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live:empty { display: none; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.live[data-state="open"]::before { background: var(--teal); }
.live[data-state="retrying"]::before { background: var(--yellow); }

.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hist:first-child { border-top: none; padding-top: 0; }
.hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hist-cmd { margin: 0; font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }
.hist p.small { margin: 0; }

/* ---------- 事件记录 ---------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.grow { flex: 2 1 240px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink); }
.field input, .field select {
  min-height: 40px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--white); color: var(--ink); padding: 0 10px; font-size: 14px;
}
.field select { min-width: 110px; max-width: 220px; }
.field.grow input { width: 100%; }
.custom-range { gap: 12px; align-items: flex-end; }
.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  font-size: 13px; color: var(--ink); cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal-dark); }
.filter-buttons { margin-left: auto; }
.filter-fields { display: contents; }
.filters-toggle { display: none; }

.events-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.events-list {
  min-width: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.result-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.result-line:empty { display: none; }
.result-line .btn { margin-left: auto; }
.events-scroll { overflow-x: auto; }
.events-scroll > .state, .events-scroll > .loading { margin: 14px; }

table.events { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ink); }
table.events th {
  text-align: left; color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.events td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.events tbody tr:last-child td { border-bottom: none; }
table.events tbody tr { cursor: pointer; }
table.events tbody tr:hover { background: #FBFBFC; }
table.events tr.selected { background: var(--bg); box-shadow: inset 3px 0 0 var(--teal); }
table.events td:nth-child(2) { min-width: 120px; }
table.events td:nth-child(3) { min-width: 260px; }
table.events tr.detail-row { cursor: default; background: var(--bg); box-shadow: inset 3px 0 0 var(--teal); }
table.events tr.detail-row:hover { background: var(--bg); }
table.events tr.detail-row > td { padding: 0 12px 14px; }
.inline-detail {
  background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.detail-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.sub { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.change { display: block; font-size: 12px; color: var(--ink); overflow-wrap: anywhere; margin-top: 2px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.badges .pill { font-size: 11px; }

.event-detail {
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto;
}
.event-detail:empty { display: none; }
@media (min-width: 1200px) {
  .events-layout { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); }
}
.detail-dl {
  margin: 0; display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.7fr); gap: 8px 12px;
  font-size: 13px; line-height: 1.5; color: var(--ink);
}
.detail-dl dt { font-weight: 700; }
.detail-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.change-block { display: flex; flex-direction: column; gap: 4px; }
.change-block .mono { font-size: 12px; }
.related { display: flex; flex-direction: column; gap: 2px; }
.plain-list { margin: 0; padding-left: 18px; }
details.raw summary { cursor: pointer; font-size: 13px; color: var(--navy); }
details.raw pre {
  margin: 8px 0 0; padding: 10px; border-radius: 8px; background: var(--bg);
  font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all;
  max-height: 320px; overflow: auto; color: var(--ink);
}

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

.content-narrow { max-width: 600px; }
.login-card { align-items: flex-start; gap: 14px; padding: 24px; }
.login-card > * { max-width: 100%; }
.login-card h2 { font-size: 20px; }
.login-card > p { color: var(--ink); }
.login-card > p.muted { color: var(--muted); }
#login-dev-note { align-self: stretch; }
.logo-lg { width: 48px; height: 48px; border-radius: 12px; font-size: 26px; }
.btn-login { min-width: 240px; min-height: 48px; font-size: 15px; }
/* 账号密码登录（10/31） */
.login-form { align-self: stretch; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.login-form h3 { margin: 0; font-size: 15px; color: var(--ink); }
.login-form .field input { width: 100%; max-width: 360px; }
.login-form .btn-login { align-self: flex-start; }
.login-or { margin: 0; font-size: 12px; color: var(--muted); }
.login-google { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

/* ---------- 设置 ---------- */

.settings .panel h2 { font-size: 17px; }
.switch-row {
  display: flex; align-items: center; gap: 16px; min-height: 56px; cursor: pointer;
  padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.switch-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.switch-text strong { font-size: 15px; }
/* 开关：就是一个复选框，画成拨动开关的样子 */
.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 52px; height: 32px; border-radius: 999px; position: relative;
  background: var(--line-strong); transition: background 0.15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 3px rgba(29, 38, 47, 0.3); transition: transform 0.15s;
}
.switch:checked { background: var(--teal-dark); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.5; cursor: default; }
.switch-row:has(.switch:disabled) { cursor: default; }
.push-status { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); }
.push-status[data-state="on"] { font-weight: 700; }
.push-status[data-state="unavailable"], .push-status[data-state="denied"], .push-status[data-state="unsupported"] {
  background: var(--yellow-tint); border: 1px solid var(--yellow); border-radius: 8px; padding: 8px 10px;
}
.push-status[data-state="error"] { color: #B42318; }
.hint ul { margin: 0; padding-left: 18px; }

/* ---------- 今日 ---------- */

.stat-coral { border-left-color: var(--coral); }
.anomaly-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.anomaly {
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.anomaly-critical, .anomaly-high { border-left-color: var(--coral); }
.anomaly-warn { border-left-color: var(--yellow); }
.anomaly h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.anomaly-object { font-size: 13px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
/* 期望和实际并排，一眼看出差在哪 */
.expect { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.expect > div { background: var(--bg); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.expect dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.expect dd { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.anomaly-warn .expect-actual { background: var(--yellow-tint); }
.anomaly-critical .expect-actual, .anomaly-high .expect-actual { background: var(--coral-tint); }
.evidence { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink); min-width: 0; }
.evidence-label { font-weight: 700; color: var(--muted); }
.evidence ul { margin: 0; padding-left: 18px; }
.evidence li { overflow-wrap: anywhere; }
.run-list { list-style: none; margin: 0; padding: 0; }
.run-list li + li { border-top: 1px solid var(--line); }
.run-list a {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  min-height: 44px; padding: 6px 8px; border-radius: 8px; color: var(--ink); text-decoration: none;
}
.run-list a:hover { background: var(--bg); }
.run-list a[aria-current="true"] { background: var(--bg); box-shadow: inset 3px 0 0 var(--teal); font-weight: 700; }
.run-time { font-family: var(--mono); min-width: 88px; }

/* ---------- 期望状态 ---------- */

.filters-note { margin: 0 0 0 auto; align-self: center; max-width: 360px; }
.desired-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.desired {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.desired.is-draft { border-color: var(--yellow); box-shadow: inset 4px 0 0 var(--yellow); }
.desired h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); outline: none; overflow-wrap: anywhere; }

/* ---------- 读数 ---------- */

.result-plain { background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.plan {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.plan.is-overdue { border-color: var(--coral); box-shadow: inset 4px 0 0 var(--coral); }
.plan h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.checkpoints { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.checkpoints li {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; color: var(--ink);
}
.checkpoints li.is-overdue { border-color: var(--coral); background: var(--coral-tint); }
.readout { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.readout-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink); }
.readout p { margin: 0; }
.readout-conclusion { font-size: 13px; line-height: 1.6; color: var(--ink); background: var(--teal-tint); border-radius: 8px; padding: 8px 10px; }
.metrics-scroll { overflow-x: auto; }
table.metrics { border-collapse: collapse; font-size: 13px; color: var(--ink); min-width: 100%; }
table.metrics th, table.metrics td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.metrics thead th { font-size: 12px; color: var(--muted); font-weight: 700; }
table.metrics tbody th { font-weight: 400; white-space: normal; min-width: 120px; }
table.metrics td { font-variant-numeric: tabular-nums; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.checks li { display: flex; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.checks li.is-ok > span:first-child { color: var(--teal-dark); }
.checks li.is-bad { color: #B42318; font-weight: 700; }

/* ---------- 设置：模型登记 ---------- */

.notice {
  margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink);
  background: var(--yellow-tint); border: 1px solid var(--yellow); border-radius: 8px; padding: 8px 10px;
}
.route-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.route:first-child { border-top: none; padding-top: 0; }
.route-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.route-kind { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.route-models { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.route-confirm {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; background: var(--coral-tint); color: var(--ink);
}
.route-form {
  flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px 12px;
  padding: 12px; border: 1px solid var(--teal); border-radius: 10px; background: var(--teal-tint);
}
.route-form .field input { width: 100%; }
.route-form .form-buttons, .route-form .card-status { grid-column: 1 / -1; }
.field-error { font-size: 12px; color: #B42318; }
.field input[aria-invalid="true"] { border-color: #B42318; }

/* ---------- 里程碑 B、P0b 的页面：共用的 ---------- */

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.input {
  min-height: 40px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--white); color: var(--ink); padding: 0 10px; font-size: 14px;
}
.pre-line { white-space: pre-line; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.content-narrow-wide { max-width: 920px; }

/* 栏目里的几页：页头下面的标签 */
.tabs {
  flex: 1 1 100%; display: flex; gap: 4px; margin: 4px 0 -18px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  color: var(--muted); text-decoration: none; font-size: 14px; border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--teal); }

/* 演练、假模型：做的事不是真的，一眼看出来（虚线框 + 黄底） */
.pill-mark {
  background: var(--yellow-tint); border: 1px dashed var(--navy-dark); padding: 0 7px; font-weight: 700; color: var(--ink);
}
.pill-mark-rehearsal { background: var(--yellow); }
.mark-banner {
  margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 10px 12px; border-radius: 10px; border: 2px dashed var(--navy-dark);
  background: repeating-linear-gradient(135deg, var(--yellow-tint) 0 14px, #FBE7C4 14px 28px);
  font-size: 13px; line-height: 1.6; color: var(--ink);
}
.mark-banner strong {
  flex: none; background: var(--yellow); border-radius: 999px; padding: 0 10px; font-size: 13px;
}
.env-marks { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.env-label { font-size: 12px; color: var(--muted); }
.plan.is-rehearsal, .panel.is-rehearsal { border-style: dashed; border-color: var(--navy-dark); }

.pill-risk { white-space: nowrap; }
.web-only {
  margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--coral-tint); border: 1px solid var(--coral); color: var(--ink); font-size: 13px; line-height: 1.6;
}
.web-only strong { color: #B42318; }

/* 方案卡：逐项 diff */
.diff { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.diff-group { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.diff-resource { padding: 6px 10px; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
table.diff-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ink); }
table.diff-table th, table.diff-table td { text-align: left; padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.diff-table thead th { font-size: 12px; color: var(--muted); font-weight: 700; border-top: none; }
table.diff-table tbody th { font-weight: 700; min-width: 100px; }
.diff-from { background: var(--coral-tint); text-decoration: line-through; text-decoration-color: rgba(29, 38, 47, 0.35); }
.diff-to { background: var(--teal-tint); font-weight: 700; }
table.diff-table tr.is-same td { background: var(--bg); text-decoration: none; font-weight: 400; }
.plan-dl { margin-top: 4px; }
.plan-preview { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plan.is-selected, .task.is-selected { border-color: var(--teal); box-shadow: inset 4px 0 0 var(--teal); }
.plan.is-waiting { border-color: var(--yellow); box-shadow: inset 4px 0 0 var(--yellow); }
.task.is-bad { border-color: var(--coral); box-shadow: inset 4px 0 0 var(--coral); }
.desired.is-old, .route.is-old { opacity: 0.7; }

/* 审批：授权粒度。手机上三个选项一排、够大好点 */
.approval.is-commitment { border-color: var(--coral); }
fieldset.grant { margin: 0; padding: 0; border: none; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.grant legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--ink); }
.grant-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.grant-option {
  position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 52px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--white); cursor: pointer; color: var(--ink);
}
.grant-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.grant-option:has(input:focus-visible) { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
.grant-option.is-picked { border: 2px solid var(--teal-dark); padding: 7px 9px; background: var(--teal-tint); }
.grant-option.is-disabled { cursor: not-allowed; background: var(--bg); color: var(--muted); border-style: dashed; }
.grant-option.is-disabled input { cursor: not-allowed; }
.grant-label { font-size: 15px; font-weight: 700; }
.grant-desc { font-size: 11px; line-height: 1.4; color: var(--muted); }
.grant-why { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--coral-tint); color: var(--ink); line-height: 1.6; }

/* 行内的小表单（改派、推迟、豁免、月度上限） */
.inline-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px;
  padding: 12px; border: 1px solid var(--teal); border-radius: 10px; background: var(--teal-tint);
}
.inline-form .field input, .inline-form .field select { width: 100%; }
.inline-form .field.grow { flex: 2 1 240px; }
.route-form .field-wide { grid-column: 1 / -1; }
.route-form textarea { min-height: 56px; }
.route-confirm .input { flex: 1 1 200px; }

/* Claude Code：会话 */
.session-group { display: flex; flex-direction: column; gap: 8px; }
.session-group + .session-group { margin-top: 6px; }
.session-project { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.task.session-waiting { border-color: var(--yellow); box-shadow: inset 4px 0 0 var(--yellow); }

/* 任务的每一步 */
table.steps-table td.wrap { white-space: normal; min-width: 180px; overflow-wrap: anywhere; }

/* 部署进度：每台一张，步骤一行一行 */
.host-progress { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.host-card { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.host-ok { border-left-color: var(--teal); }
.host-running { border-left-color: var(--blue); }
.host-failed { border-left-color: var(--coral); background: var(--coral-tint); }
.host-rolled_back { border-left-color: var(--yellow); background: var(--yellow-tint); }
.host-name { font-weight: 700; color: var(--ink); }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--ink); min-width: 0; }
.step-mark { flex: none; width: 18px; text-align: center; font-weight: 700; }
.step-teal .step-mark { color: var(--teal-dark); }
.step-coral .step-mark { color: #B42318; }
.step-name { min-width: 96px; }
.step-out { flex: 1 1 100%; padding-left: 26px; color: var(--muted); overflow-wrap: anywhere; }

/* 锁和排队 */
.plan.has-queue { border-color: var(--yellow); }
.queue { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.queue li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.queue-pos { font-weight: 700; color: var(--ink); min-width: 48px; }

/* 阶段与关卡 */
.stage-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.stage-track li { padding: 6px 4px; text-align: center; font-size: 12px; border-radius: 8px; background: var(--bg); color: var(--muted); }
.stage-track li.is-past { background: var(--teal-tint); color: var(--ink); }
.stage-track li.is-now { background: var(--teal); color: var(--ink); font-weight: 700; }
.gate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gate { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gate-failed, .gate-unknown { border-color: var(--coral); }
.gate-waived { border-style: dashed; border-color: var(--yellow); }
.gate-name { font-size: 13px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.gate-detail { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.gate p { margin: 0; }
.plan.has-gaps { border-color: var(--yellow); }

/* 报告：草稿全文 */
pre.draft {
  margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg);
  font-family: var(--font); font-size: 13px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 60vh; overflow: auto;
}

/* Bots */
.bot-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.bot-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.bot-card.is-disabled { opacity: 0.7; }
.bot-card h3 { margin: 0; font-size: 16px; color: var(--ink); }
.bot-dl dd { display: flex; flex-direction: column; gap: 4px; }
.run-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 2px; background: var(--line-strong); vertical-align: middle; }
.run-dot-teal { background: var(--teal); }
.run-dot-coral { background: var(--coral); }
.run-dot-blue { background: var(--blue); }

/* 协作：上限的条和时间线 */
.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px 16px; }
.cap { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink); min-width: 0; }
.cap-bar { display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cap-bar > span { display: block; height: 100%; background: var(--teal); }
.cap.is-near .cap-bar > span { background: var(--yellow); }
.cap.is-over .cap-bar > span { background: var(--coral); }
.cap.is-over .cap-label { color: #B42318; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.tl:first-child { border-top: none; }
.tl-time { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.tl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--ink); }
.tl-handoff .tl-body, .tl-approval .tl-body { font-weight: 700; }

/* 用量 */
table.usage-table th a { font-weight: 700; }
.share { display: inline-block; width: 80px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.share-bar { display: block; height: 100%; background: var(--blue); }

/* 今日的提醒 */
.anomaly.is-read { opacity: 0.75; }
.anomaly.is-focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); scroll-margin-top: 16px; }
.anomaly h3 { outline: none; }

/* ---------- 和控制面最终约定对齐时加的（10/22 下午） ---------- */

.tight { margin: 0; }
.notice-strong { border-width: 2px; font-weight: 700; }
.notice-strong strong { color: #B42318; }
.evidence-refs li { overflow-wrap: anywhere; }
table.metrics td.wrap { white-space: normal; min-width: 180px; overflow-wrap: anywhere; }
table.metrics tr.is-bad td, table.metrics tr.is-bad th { background: var(--coral-tint); }
table.metrics tr.is-selected th, table.metrics tr.is-selected td { background: var(--teal-tint); }

/* 周报的历次版本 */
.versions { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.version-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.version-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--bg); min-width: 0; }
.version-list li.is-picked { background: var(--teal-tint); box-shadow: inset 3px 0 0 var(--teal); }

/* 协作里的交接：交给你的描边 */
.handoff-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.handoff { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; overflow-wrap: anywhere; }
.handoff.is-mine { border-color: var(--yellow); box-shadow: inset 4px 0 0 var(--yellow); }

/* 事件订阅 */
.sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sub { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.sub:first-child { border-top: none; padding-top: 0; }
.sub.is-disabled { opacity: 0.7; }
.sub-draft {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px 12px;
  margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0;
}
.sub-draft[aria-invalid="true"] { border-color: #B42318; }
.sub-draft legend { font-weight: 700; color: var(--ink); padding: 0 4px; }
.sub-draft .field-wide, .sub-draft .field-error { grid-column: 1 / -1; }
.sub-draft input, .sub-draft textarea { width: 100%; }

/* 部署的暂停、继续、取消 */
.deploy-controls .route-confirm .grow-full { flex: 1 1 100%; margin: 0; }
.inline-form .grow-full { flex: 1 1 100%; margin: 0; }

/* ---------- P1：模型管理 ---------- */

.recon { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.recon-chart { width: 100%; max-width: 720px; height: auto; display: block; }
.recon-grid { stroke: var(--line); stroke-width: 1; }
.recon-tick { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.recon-predicted { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 6 4; }
.recon-actual { fill: none; stroke: var(--navy); stroke-width: 2.5; }
.recon-dot { fill: var(--navy); }
.recon-dot-high, .recon-dot-low { fill: var(--coral); }
.recon-gap { fill: var(--white); stroke: var(--line-strong); stroke-width: 1.5; }
.recon-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: var(--ink); }
.recon-legend span::before { content: ''; display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; }
.legend-predicted::before { border-top: 2px dashed var(--blue); }
.legend-actual::before { border-top: 3px solid var(--navy); }
.legend-gap::before { width: 8px !important; height: 8px !important; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.eval-block { padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.eval-block p { margin: 0; }
.candidate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.candidate { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.candidate.is-recommended { border-color: var(--teal); box-shadow: inset 4px 0 0 var(--teal); }
.candidate h4 { margin: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.candidate p { margin: 0; }
.model-actions { border-top: 1px solid var(--line); padding-top: 10px; }
/* "预测 vs 实际"带一句原因：给够宽度，手机上不挤成一条窄柱子（表格本身横着滑） */
table.model-table td:last-child { white-space: normal; min-width: 220px; }
/* 请模型管理员出卡：进影子、换上两个单选 */
.propose-modes { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.propose-modes legend { padding: 0; margin-bottom: 2px; font-weight: 700; color: var(--ink); }
.propose-modes .check { align-items: flex-start; min-height: 32px; }
.propose-modes .check input { margin-top: 2px; flex: none; }
/* 模型管理员日报：worker 写的整份文字，照原样换行，不当 HTML */
.report-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 14px; line-height: 1.6; margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }

/* ---------- P1：模板库、一句话新建 ---------- */

.tpl-card.is-open { border-color: var(--teal); }
.install-panel { padding: 12px; border: 1px solid var(--teal); border-radius: 10px; background: var(--teal-tint); }
.install-panel p { margin: 0; }
blockquote.sentence { margin: 0; padding: 8px 12px; border-left: 4px solid var(--line-strong); background: var(--bg); color: var(--ink); border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.trial { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.trial.is-bad { border-color: var(--coral); background: var(--coral-tint); }
.trial p { margin: 0; }

/* ---------- P1：对话 ---------- */

.chat-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .chat-layout { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
}
.thread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.thread a { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0; }
.thread:first-child a { border-top: none; }
.thread a:hover { background: var(--bg); }
.thread.is-selected a { background: var(--teal-tint); box-shadow: inset 3px 0 0 var(--teal); }
.thread-title { overflow-wrap: anywhere; }
.chat-notice { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.6; color: var(--ink); background: var(--bg); border: 1px solid var(--line); }
.chat-notice-coral { background: var(--coral-tint); border-color: var(--coral); font-weight: 700; }
.chat-notice-yellow { background: var(--yellow-tint); border-color: var(--yellow); }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.message { align-self: flex-start; max-width: min(640px, 92%); display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-radius: 12px; background: var(--bg); min-width: 0; }
.message.is-bot { background: var(--white); border: 1px solid var(--line); }
.message.is-mine { align-self: flex-end; background: var(--teal-tint); }
.message.is-system { align-self: center; background: none; color: var(--muted); font-size: 12px; text-align: center; padding: 2px 8px; }
.message-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ink); }
.message-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); line-height: 1.6; }
.mention { color: var(--teal-dark); }
.message-tasks { display: flex; flex-direction: column; gap: 4px; font-size: 13px; padding-top: 6px; border-top: 1px dashed var(--line); }
.composer { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.composer textarea {
  width: 100%; min-height: 64px; border-radius: 8px; border: 1px solid var(--line-strong); padding: 8px 10px; font-size: 14px; color: var(--ink); background: var(--white);
}
.composer textarea:disabled { background: var(--bg); }
.mention-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-picks { border: none; margin: 0; padding: 0; min-width: 0; }

/* ---------- 10/23：读数不读了、改 bot 的只读工具 ---------- */

/* 计划卡片上的勾选框，和一次取消好几个的那一条 */
.plan-pick { min-height: 32px; font-weight: 700; }
.plan.is-picked { border-color: var(--teal); box-shadow: inset 4px 0 0 var(--teal); }
.plan.is-cancelled { opacity: 0.8; }
.plan h3[tabindex] { outline: none; } /* 取消完、刷新完焦点挪到标题上（读屏会念），不画框 */
.bulk-bar { gap: 10px; }
.bulk-result { display: flex; flex-direction: column; gap: 6px; outline: none; }
.bulk-result .btn { align-self: flex-start; }
/* 改工具：五个勾选框 */
.tool-picks { border: none; margin: 0; padding: 0; min-width: 0; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 0 16px; }
.tool-picks legend { padding: 0; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--ink); }

/* ---------- 第 0 步：Morning Brief（早报和时间线、目标契约、工具状态，10/24） ---------- */

/* 最近几晚：一排小卡片，手机上横着滑 */
.night-picker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.night-picker a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); text-decoration: none;
}
.night-picker a:hover { border-color: var(--muted); }
.night-picker a[aria-current="true"] { border: 2px solid var(--teal-dark); padding: 3px 11px; background: var(--teal-tint); font-weight: 700; }
.night-picker-day { white-space: nowrap; }
.night-contracts li { overflow-wrap: anywhere; }

/* 时间线的标签：中文和颜色（英文写在提示里） */
.night-tag { font-weight: 700; }
.night-tag-PLAN { background: var(--blue); }
.night-tag-READ { background: var(--line); font-weight: 400; }
.night-tag-FOUND { background: var(--yellow); }
.night-tag-DRAFTED { background: var(--coral); }
.night-tag-CHALLENGED { background: var(--navy); color: var(--white); }
.night-tag-RULE { background: var(--teal); }
.night-tag-GAP { background: transparent; border: 1px dashed var(--navy-dark); padding: 0 7px; }
.night-tag-BRIEF { background: var(--teal-tint); border: 1px solid var(--teal-dark); padding: 0 7px; }
.night-tag-OTHER { background: var(--line); }

/* 早报 */
.brief-headline { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.brief-section { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); min-width: 0; }
.brief-section h3 { margin: 0; font-size: 14px; color: var(--ink); }
.brief-summary { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 6px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; line-height: 1.6; color: var(--ink); }
.brief-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.brief-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; font-size: 13px; line-height: 1.6; color: var(--ink); }
.brief-item.is-strong .brief-text { font-weight: 700; }
.brief-id { color: var(--muted); font-size: 12px; padding-top: 1px; }
.brief-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.refs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 12px; }
.refs-label { color: var(--muted); font-weight: 700; }
.ref { overflow-wrap: anywhere; }
.decision { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 2px solid var(--yellow); border-radius: 12px; }
.decision.is-commitment { border-color: var(--coral); }
.decision-question { margin: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; font-size: 15px; line-height: 1.6; color: var(--ink); }
.decision-question .brief-id { padding-top: 3px; }
.decision .approval-actions .btn { min-height: 48px; }
.decision-confirm textarea { flex: 1 1 100%; }
/* 批准、确认生效、继续这类往前走的确认：青色底（取消、结束、退回照旧是红色底） */
.route-confirm.decision-confirm.is-allow, .route-confirm.is-positive { background: var(--teal-tint); }
.decision p.small { margin: 0; }
.panel.last-night { border-left: 4px solid var(--teal); }
.last-night-decision { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--ink); line-height: 1.6; }

/* 回放：播放、暂停、速度、上一步下一步、拖动 */
.replay-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.replay-play { min-width: 72px; }
.replay-speed { display: inline-flex; gap: 0; }
.replay-speed .btn { border-radius: 0; margin-left: -1px; min-width: 44px; }
.replay-speed .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.replay-speed .btn:last-child { border-radius: 0 8px 8px 0; }
.replay-speed .btn[aria-pressed="true"] { background: var(--teal-tint); border-color: var(--teal-dark); font-weight: 700; position: relative; }
.replay-range { flex: 1 1 200px; min-width: 160px; height: 32px; accent-color: var(--teal-dark); }
.replay-pos { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.replay-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 1000px) {
  .replay-layout { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
  .replay-side { position: sticky; top: 16px; }
}
/* 一栏的时候（手机、窄屏）：到这一刻为止的计数放在时间线上面，翻一步就能看到变化 */
@media (max-width: 999px) {
  .replay-side { order: -1; }
}
.night-timeline { position: relative; list-style: none; margin: 0; padding: 0 4px 0 0; max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; }
.nt { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 8px 8px 8px 10px; border-top: 1px solid var(--line); border-left: 3px solid var(--line-strong); }
.nt:first-child { border-top: none; }
.nt-time { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.nt-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--ink); }
.nt-title { font-weight: 700; }
.nt-PLAN { border-left-color: var(--blue); }
.nt-FOUND { border-left-color: var(--yellow); }
.nt-DRAFTED { border-left-color: var(--coral); }
.nt-CHALLENGED { border-left-color: var(--navy); }
.nt-RULE { border-left-color: var(--teal); }
.nt-GAP { border-left-style: dashed; border-left-color: var(--navy-dark); }
.nt-BRIEF { border-left-color: var(--teal-dark); }
.nt.is-current { background: var(--teal-tint); box-shadow: inset 0 0 0 2px var(--teal-dark); }
.replay-side { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; }
.replay-side h3, .replay-side h4 { margin: 0; font-size: 14px; color: var(--ink); }
.tag-counts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.tag-counts li { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-variant-numeric: tabular-nums; }
.tag-counts li.is-zero { opacity: 0.55; }
.replay-sa { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink); }
.replay-sa li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* 影子动作 */
.sa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sa { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-margin-top: 16px; }
.sa h3 { margin: 0; font-size: 15px; color: var(--ink); outline: none; overflow-wrap: anywhere; }
.sa p { margin: 0; }
.sa.is-challenged { border-left-color: var(--navy); }
.sa.has-failed .sa-checks { border-color: var(--coral); }
.sa.is-focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.sa-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sa-checks > .card-status { grid-column: 1 / -1; font-weight: 700; }
.checks li.is-note { color: var(--ink); }
.checks li.is-note > span:first-child { color: #9A6700; font-weight: 700; }
.sa-review { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.sa-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sa-verify.is-done strong { color: var(--teal-dark); }
.line-list { display: inline; }
.line-item { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* 工具状态：一行一个工具 */
.tool-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tool {
  display: grid; grid-template-columns: minmax(150px, 1.1fr) 96px minmax(0, 2fr) minmax(200px, 1.4fr); gap: 6px 16px; align-items: start;
  padding: 12px 16px; border-top: 1px solid var(--line); border-left: 4px solid var(--line-strong); min-width: 0; scroll-margin-top: 16px;
}
.tool:first-child { border-top: none; }
.tool-working { border-left-color: var(--teal); }
.tool-limited { border-left-color: var(--yellow); }
.tool-blocked { border-left-color: var(--coral); background: #FFFBFB; }
.tool-planned { border-left-style: dashed; }
.tool.is-focus { box-shadow: inset 0 0 0 2px var(--teal-dark); background: var(--teal-tint); }
.tool-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-name h3 { margin: 0; font-size: 15px; color: var(--ink); outline: none; overflow-wrap: anywhere; }
.tool-detail { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.tool-call { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }

/* 目标契约 */
.contract-dl { grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.8fr); }
.contract-dl .pill { margin-left: 6px; }
.contract-hit { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; color: var(--ink); }
.contract-actions { align-items: flex-start; }
.contract-actions .stack-sm { max-width: 320px; }
.contract-form { gap: 14px; }
.cf-group {
  margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 10px; min-width: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px 14px; align-items: start;
}
.cf-group legend { padding: 0 4px; font-weight: 700; color: var(--ink); }
.cf-group > .muted, .cf-group > p { margin: 0; }
.cf-wide { grid-column: 1 / -1; }
.cf-group .field input, .cf-group .field select, .cf-group textarea { width: 100%; max-width: none; }
.field-help { font-size: 12px; line-height: 1.5; color: var(--muted); }
.field label .pill { margin-left: 4px; vertical-align: 1px; }
.cf-mode { margin: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--bg); color: var(--ink); }
.cf-lever { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.cf-lever.is-on { border-color: var(--teal); background: var(--teal-tint); }
.cf-lever .check { align-items: flex-start; min-height: 32px; }
.cf-lever .check input { margin-top: 2px; flex: none; }
.cf-lever-limits { align-items: flex-end; }
.cf-lever-limits .field { flex: 0 1 200px; }
.cf-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.cf-control { min-height: 0; }
.cf-control .grant-desc { font-size: 12px; }

/* 旋钮和钱的图 */
.series { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.series-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; color: var(--ink); }
.series-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.line-key { flex: none; vertical-align: middle; }
.legend-hollow { display: inline-block; width: 9px; height: 9px; border: 2px solid var(--muted); border-radius: 50%; background: var(--white); }
.legend-change { display: inline-block; width: 0; height: 14px; border-left: 2px dashed var(--muted); }
.series-box { position: relative; min-width: 0; }
.series-chart { display: block; max-width: 100%; height: auto; outline: none; touch-action: pan-y; }
.series-chart:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
.series-title { font-size: 12px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.series-grid { stroke: var(--line); stroke-width: 1; }
.series-tick { font-size: 11px; fill: var(--muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series-line-provisional { stroke-dasharray: 3 4; }
.series-control .series-line { stroke: var(--muted); stroke-dasharray: 6 4; }
.series-dot { stroke-width: 2; }
.series-change line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.series-change text { font-size: 11px; fill: var(--ink); font-weight: 700; font-family: var(--font); }
.series-cross { stroke: var(--navy-dark); stroke-width: 1; }
.series-hit { fill: transparent; cursor: crosshair; }
.series-tip {
  position: absolute; top: 4px; transform: translateX(-50%); z-index: 5; max-width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 8px;
  background: var(--white); border: 1px solid var(--line-strong); box-shadow: 0 6px 18px rgba(29, 38, 47, 0.16);
  font-size: 12px; color: var(--ink); pointer-events: none;
}
.series-tip table { border-collapse: collapse; }
.series-tip th, .series-tip td { padding: 2px 6px; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.series-tip td { font-weight: 700; }
.series-tip th { font-weight: 400; color: var(--muted); }
.series-tip tbody th { color: var(--ink); }
.series-changes { margin: 0; padding-left: 22px; color: var(--ink); }

@media (max-width: 699px) {
  .tool { grid-template-columns: minmax(0, 1fr) auto; }
  .tool-detail, .tool-call { grid-column: 1 / -1; }
  .nt { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 8px 6px 8px 8px; }
  .night-timeline { max-height: 60vh; }
  .replay-controls .btn { min-height: 44px; }
  .replay-range { flex: 1 1 100%; order: 9; }
  .replay-pos { flex: 1 1 auto; }
  .brief-item, .decision-question { grid-template-columns: 26px minmax(0, 1fr); gap: 6px; }
  .decision { padding: 10px; }
  .contract-dl { grid-template-columns: minmax(0, 1fr); }
  .cf-group { padding: 10px; }
  .series-tip { position: static; transform: none; max-width: none; box-shadow: none; overflow-x: auto; }
}

/* ---------- 价格臂日报和模型体检（10/31） ---------- */

/* 今日页的两张卡：宽屏并排 */
.today-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 900px) {
  .today-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.today-card { border-left: 4px solid var(--teal); }
.today-card.is-empty, .today-card.is-unsupported, .today-card.is-error, .today-card.is-loading { border-left-color: var(--line-strong); }
.today-card-line { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.today-card.is-empty .today-card-line, .today-card.is-unsupported .today-card-line, .today-card.is-error .today-card-line { font-weight: 400; }
.today-card p.small { margin: 0; color: var(--ink); line-height: 1.6; }

/* 选日子：一项写着几条线、几条建议，比一般的下拉框宽 */
.field select.bw-day { max-width: 340px; }

/* 报告的头：窗、抽样、"出价和成交是抽样，花费是全量" */
.bw-sample-note strong { margin-right: 4px; }
.bw-head-dl { grid-template-columns: minmax(64px, max-content) minmax(0, 1fr); }
.bw-head-dl .pill { margin-left: 4px; }

/* 一条线一块 */
.bw-line { scroll-margin-top: 16px; }
.bw-line.has-suggestion { border-left: 4px solid var(--yellow); }
.bw-line-head h2 a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.bw-line-head h2 a:hover { text-decoration-color: var(--ink); }
.bw-model { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.bw-winrate { font-size: 13px; color: var(--muted); }
.bw-winrate strong { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bw-marks { gap: 4px; }
table.metrics.bw-arms th.bw-segment { font-weight: 700; vertical-align: top; min-width: 72px; border-right: 1px solid var(--line); }
table.metrics.bw-arms tbody + tbody { border-top: 2px solid var(--line-strong); }
table.metrics.bw-arms tbody th[scope="row"] { min-width: 110px; }
.bw-sub { display: block; }
/* 样本太少的臂：灰掉（不参与比较） */
table.metrics tr.is-thin td, table.metrics tr.is-thin th[scope="row"] { color: var(--muted); background: var(--bg); }

/* 建议：注意（红）、建议（黄）、提示（灰）三种样式 */
.insight-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.insight {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 12px;
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 8px; color: var(--ink);
}
.insight p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.insight-title { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.insight-warn { border-left-color: var(--coral); background: var(--coral-tint); }
.insight-suggest { border-left-color: var(--yellow); background: var(--yellow-tint); }
.insight-info { border-left-color: var(--line-strong); }

/* 一条线的历史：建议的历史 */
.bw-line-history h3 { margin: 0; font-size: 14px; color: var(--ink); }
.bw-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bw-history > li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.bw-history > li:first-child { border-top: none; }
.bw-history-day { font-family: var(--mono); font-size: 13px; }
.bw-history-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink); }
.bw-history-items li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; overflow-wrap: anywhere; }

/* 模型体检：一条线一行（窄屏上格子换行），展开是检查、登记、每天的表现 */
.health-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.health-row { border-top: 1px solid var(--line); border-left: 4px solid var(--line-strong); scroll-margin-top: 16px; min-width: 0; }
.health-row:first-child { border-top: none; }
.health-retrain { border-left-color: var(--coral); }
.health-watch { border-left-color: var(--yellow); }
.health-ok { border-left-color: var(--teal); }
.health-row.is-focus { box-shadow: inset 0 0 0 2px var(--teal-dark); }
.health-main {
  display: grid; gap: 8px 16px; align-items: start; padding: 12px 16px;
  grid-template-columns: minmax(96px, 0.7fr) minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(0, 0.7fr) auto;
}
.health-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--ink); }
.health-cell strong { font-variant-numeric: tabular-nums; }
.health-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.health-name { flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 6px; }
.health-name h3 { margin: 0; font-size: 15px; color: var(--ink); outline: none; }
.health-toggle { align-self: center; }
.health-more { display: flex; flex-direction: column; gap: 8px; padding: 4px 16px 16px; border-top: 1px dashed var(--line); background: #FCFCFD; min-width: 0; }
.health-more h4 { margin: 8px 0 0; font-size: 13px; color: var(--ink); }
.health-more > p { margin: 0; }
.hcheck-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hcheck { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 8px; background: var(--white); color: var(--ink); min-width: 0; }
.hcheck p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.hcheck-retrain { border-left-color: var(--coral); }
.hcheck-watch { border-left-color: var(--yellow); }
.hcheck-ok { border-left-color: var(--teal); }
/* 每天的表现：provisional 的天标灰（数还会变） */
table.metrics tr.is-provisional td, table.metrics tr.is-provisional th { color: var(--muted); background: var(--bg); }

@media (max-width: 1099px) {
  .health-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-name { grid-column: 1 / -2; }
  .health-toggle { grid-column: -2 / -1; grid-row: 1; justify-self: end; }
}
@media (max-width: 699px) {
  .health-main { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .health-model { grid-column: 1 / -1; }
  .health-more { padding: 4px 12px 12px; }
  .bw-history > li { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
  .bw-head-dl { grid-template-columns: minmax(0, 1fr); }
  table.metrics.bw-arms tbody th[scope="row"] { min-width: 76px; }
  table.metrics.bw-arms th.bw-segment { min-width: 52px; }
}

/* ---------- 10/31 晚：控制台重排（第一眼是要处理的事，细节点开看、默认收起） ---------- */

/* "今天先看"、"今天要看的"：一条一行（标记 + 线号 + 一句话 + 去处理） */
.focus-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.focus-item { display: flex; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; color: var(--ink); }
.focus-item:first-child { border-top: none; }
.focus-line { flex: none; font-size: 13px; font-weight: 700; }
.focus-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.focus-go { flex: none; font-size: 13px; white-space: nowrap; }
.focus-empty { margin: 0; font-size: 14px; color: var(--ink); }
.focus-more { margin: 6px 0 0; }
.today-focus { border-left: 4px solid var(--teal); }

/* 三张小卡：宽屏并排，手机上竖排 */
.today-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini-card {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px;
  color: inherit; text-decoration: none;
}
.mini-card:hover { border-color: var(--muted); }
.mini-card.is-alert { border-left-color: var(--yellow); }
.mini-title { font-size: 12px; font-weight: 700; color: var(--muted); }
.mini-value { font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.mini-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.today-line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; color: var(--ink); }
.today-line-text { min-width: 0; overflow-wrap: anywhere; }

/* 一直没解决的、提醒：一条一行 */
.ongoing-list, .note-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ongoing-list li, .note-lines li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.ongoing-list li:first-child, .note-lines li:first-child { border-top: none; }
.ongoing-text, .note-title { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }

/* 收起来的一块：summary 里放标题和一句话 */
details.panel > summary, .bw-notes > summary, .mh-ok > summary {
  cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; list-style-position: outside;
}
details.panel > summary h2 { display: inline; }
.patrol-record-title, .mh-ok-title { font-size: 16px; }
details.panel[open] > summary { margin-bottom: 4px; }
.bw-notes-title { font-weight: 700; color: var(--ink); }

/* 价格臂：一条线收成一行 */
.bw-filters { align-items: flex-end; }
.bw-only { font-weight: 700; }
.bw-focus .panel-head { justify-content: space-between; }
.bw-report-line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 13px; color: var(--ink); }
details.bw-line { padding: 0; gap: 0; }
details.bw-line > summary.bw-line-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 16px; cursor: pointer; list-style: none;
}
details.bw-line > summary.bw-line-row::-webkit-details-marker { display: none; }
details.bw-line > summary.bw-line-row::before { content: '▸'; color: var(--muted); font-size: 12px; }
details.bw-line[open] > summary.bw-line-row::before { content: '▾'; }
details.bw-line[open] > summary.bw-line-row { border-bottom: 1px solid var(--line); }
.bw-line-id { font-size: 15px; font-weight: 700; color: var(--ink); }
.bw-cell { font-size: 13px; color: var(--ink); white-space: nowrap; }
.bw-cell strong { font-variant-numeric: tabular-nums; }
.bw-model { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.bw-line-body { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 16px; min-width: 0; }
.bw-minor > summary { cursor: pointer; color: var(--navy); }
.bw-minor[open] > summary { margin-bottom: 6px; }
/* 建议默认一行标题，点"详情"看正文和证据 */
.insight { padding: 0; }
.insight > details > summary.insight-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 12px; cursor: pointer; list-style: none; }
.insight > details > summary.insight-head::-webkit-details-marker { display: none; }
.insight-more { margin-left: auto; font-size: 12px; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.insight > details[open] .insight-more { color: var(--muted); }
.insight-body { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 10px; }
.insight-body p { margin: 0; }

/* 模型体检：要看的一条一行，正常的收起来 */
.mh-note > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--ink); }
.mh-note-more { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.mh-note p { margin: 6px 0 0; line-height: 1.6; color: var(--ink); }
.mh-counts { margin: 0; font-size: 13px; color: var(--muted); }
.health-row > details > summary.health-sum {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.3fr) minmax(0, 1.9fr) minmax(0, 1.4fr) minmax(0, 1.3fr);
  gap: 6px 14px; align-items: center; padding: 10px 16px; cursor: pointer; list-style: none;
}
.health-row > details > summary.health-sum::-webkit-details-marker { display: none; }
.health-id { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.health-line { font-size: 15px; font-weight: 700; color: var(--ink); }
.health-reason { font-weight: 700; }
.health-reason .pill { margin-right: 6px; font-weight: 400; }
.health-row.is-stale, .health-ok-row.is-stale { opacity: 0.8; }
.health-dl { grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.5fr); }
.mh-ok { gap: 8px; }
.health-ok-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.health-ok-row { border-top: 1px solid var(--line); }
.health-ok-row:first-child { border-top: none; }
.health-ok-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 4px; cursor: pointer; font-size: 13px; color: var(--ink); }
.health-ok-row.is-focus > details > summary, .health-row.is-focus > details > summary { background: var(--teal-tint); }

@media (max-width: 1099px) {
  .health-row > details > summary.health-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-id, .health-reason { grid-column: 1 / -1; }
}
@media (max-width: 699px) {
  .today-mini { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mini-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 12px; }
  .mini-value { font-size: 15px; }
  .focus-item { flex-wrap: wrap; }
  .focus-text { flex: 1 1 100%; order: 3; }
  .focus-go { margin-left: auto; }
  details.bw-line > summary.bw-line-row { padding: 10px 12px; gap: 4px 10px; }
  .bw-model { max-width: 46vw; }
  .bw-line-body { padding: 10px 12px 12px; }
  .health-row > details > summary.health-sum { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .health-dl { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 离线页（offline.html） ---------- */

.offline {
  min-height: calc(100vh - env(safe-area-inset-top, 0px));
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}
.offline-card { max-width: 520px; align-items: flex-start; padding: 28px 24px; gap: 14px; }
.offline-card h1 { margin: 0; font-size: 22px; color: var(--ink); }
.offline-card p { color: var(--ink); }
.offline-card p.muted { color: var(--muted); }
.offline-logo { width: 56px; height: 56px; }

/* ---------- 提示条 ---------- */

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px));
}
.toast {
  background: var(--navy-dark); color: var(--white); border-radius: 10px; padding: 10px 14px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(29, 38, 47, 0.2); border-left: 4px solid var(--teal);
}
.toast-warn { border-left-color: var(--yellow); }
.toast-error { border-left-color: var(--coral); }
.toast a { color: var(--white); font-weight: 700; }

/* ---------- 窄屏：导航挪到底部，表格变成一张张卡片 ---------- */

@media (max-width: 899px) {
  .shell { flex-direction: column; }
  .sidenav {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30;
    height: auto; overflow: visible;
    flex-direction: row; gap: 0;
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: var(--white); color: var(--ink); border-top: 1px solid var(--line);
  }
  .sidenav .brand, .sidenav .nav-foot { display: none; }
  .nav-links { flex: 1 1 auto; flex-direction: row; gap: 4px; }
  .nav-group, .nav-group-items { display: contents; }
  .nav-group-label, .nav-group-toggle { display: none; }
  .nav-links .nav-item, .nav-more {
    flex: 1 1 0; justify-content: center; flex-wrap: wrap; gap: 4px;
    min-height: 52px; padding: 0 6px; color: var(--muted); font-size: 13px; text-align: center;
  }
  .nav-links .nav-item:hover, .nav-more:hover { background: var(--bg); color: var(--ink); }
  .nav-links .nav-item[aria-current="page"], .nav-more[data-current], .nav-more[aria-expanded="true"] { background: var(--teal-tint); color: var(--ink); }
  /* 底部只放今日、价格臂、模型体检、审批四个（顺序照 data-mobile-order），别的收进"更多"（照分组排） */
  .nav-links .nav-item.nav-secondary { display: none; }
  .nav-links .nav-item[data-mobile-order="1"] { order: 1; }
  .nav-links .nav-item[data-mobile-order="2"] { order: 2; }
  .nav-links .nav-item[data-mobile-order="3"] { order: 3; }
  .nav-links .nav-item[data-mobile-order="4"] { order: 4; }
  .nav-more-wrap { order: 9; }
  .nav-full {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .nav-short { display: inline; }
  .nav-more-wrap { display: flex; flex: 1 1 0; position: relative; min-width: 0; }
  .nav-more {
    display: flex; align-items: center; width: 100%;
    border: none; border-radius: 8px; background: none; cursor: pointer;
  }
  .nav-more-menu {
    position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 31; min-width: 176px;
    display: flex; flex-direction: column; padding: 6px;
    background: var(--white); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(29, 38, 47, 0.18);
  }
  .nav-more-menu a {
    display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 8px;
    color: var(--ink); text-decoration: none; font-size: 15px;
  }
  .nav-more-menu a:hover { background: var(--bg); }
  .nav-more-menu a[aria-current="page"] { background: var(--teal-tint); font-weight: 700; }
  .nav-more-menu { max-height: 70vh; overflow-y: auto; }
  .nav-more-group { display: flex; flex-direction: column; }
  .nav-more-group + .nav-more-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
  .nav-more-label { padding: 4px 14px 2px; font-size: 11px; font-weight: 700; color: var(--muted); }
  .nav-count { color: var(--muted); }
  .main-col { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar {
    justify-content: flex-start; padding: 8px 16px;
    background: var(--navy-dark); color: var(--white); border-bottom: none;
  }
  .topbar-brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
  .topbar-conn { display: inline-flex; font-size: 12px; color: var(--line-strong); }
  .topbar-conn .conn-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .account { margin-left: auto; gap: 6px; }
  .acct-who { color: var(--white); max-width: 46vw; }
  /* 环境的小标记在手机顶栏上也看得到：不跟账号抢地方，账号先缩 */
  .env-badge + .account .acct-who { max-width: 30vw; }
  .env-badge > summary { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 26px; }
  .acct-link { color: var(--line); }
  .page-head { padding: 14px 16px; }
  .page-head h1 { font-size: 20px; }
  .tabs { margin-bottom: -14px; }
  .tabs a { min-height: 44px; padding: 0 10px; }
  .content { padding: 16px 16px 28px; gap: 14px; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* 确认请求：手机上一屏看清命令和来源，按钮够大。点通知打开的那条，允许、拒绝贴在屏幕下边，命令再长也不用滚到底才能点 */
  .approval { padding: 14px; gap: 10px; }
  .approval h3 { font-size: 16px; }
  .cmdline { font-size: 12.5px; max-height: 40vh; }
  .facts { font-size: 12px; gap: 3px; }
  .fact dt { width: 52px; }
  .btn-allow, .btn-deny { min-height: 56px; font-size: 17px; }
  .grant-option { min-height: 56px; padding: 8px; }
  .grant-option.is-picked { padding: 7px; }
  .grant-desc { font-size: 11px; }
  .mark-banner { font-size: 12px; }
  .approval.is-focus .approval-actions {
    position: sticky; z-index: 5; bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    margin: 0 -14px; padding: 10px 14px;
    background: var(--white); box-shadow: 0 -8px 12px -10px rgba(29, 38, 47, 0.35);
  }
}

@media (max-width: 699px) {
  .head-actions { width: 100%; }
  .head-actions .btn { margin-left: auto; }
  .panel { padding: 14px; }
  .task-actions .push-right { margin-left: 0; width: 100%; }
  .task-actions .push-right .btn { flex: 1 1 0; }
  .filters { padding: 12px; }
  .field { flex: 1 1 140px; }
  .field select, .field input { width: 100%; }
  .filter-buttons { width: 100%; margin-left: 0; }
  .filter-buttons .btn { flex: 1 1 0; }
  .filters-toggle { display: inline-flex; flex: none; min-height: 40px; }
  .filters:not(.is-open) .filter-fields { display: none; }

  /* 等你开工：四个数字两行排紧一点，活在第一屏就能看到 */
  .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { flex-direction: row; align-items: baseline; gap: 8px; padding: 8px 10px; }
  .stat strong { font-size: 20px; }
  .stat span { font-size: 12px; }

  /* 今日、期望状态、读数、模型登记 */
  .expect { grid-template-columns: minmax(0, 1fr); }
  .filters-note { margin-left: 0; max-width: none; }
  .plan { padding: 14px; }
  .anomaly, .desired { padding: 12px; }
  table.metrics th, table.metrics td { padding: 6px; }
  table.metrics tbody th { min-width: 88px; }
  table.metrics td:last-child { white-space: normal; } /* "+1.90 个百分点"在手机上换行，不用横着滑 */

  table.events, table.events tbody, table.events tr, table.events td { display: block; width: 100%; }
  table.events thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  table.events tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
  }
  table.events td:nth-child(3), table.events td:nth-child(4) { grid-column: 1 / -1; }
  table.events tr.detail-row { display: block; }
  table.events tbody tr:last-child { border-bottom: none; }
  table.events td { border: none; padding: 2px 0; min-width: 0 !important; }
  table.events td::before {
    content: attr(data-label); display: block; font-size: 11px; color: var(--muted); font-weight: 700;
  }
  table.events td:nth-child(3)::before, table.events td:nth-child(4)::before { margin-top: 6px; }
  table.events td.empty-cell { display: none; } /* 手机上没有核实信息就不占一行 */
  table.events tr.detail-row { padding: 0 10px 12px; }
  table.events tr.detail-row > td { padding: 0; }
  table.events tr.detail-row > td::before { content: none; }
  .inline-detail { padding: 12px; }
  .detail-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .detail-dl dd { margin-bottom: 8px; }

  /* 里程碑 B、P0b 的页面 */
  .tl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .step-name { min-width: 0; }
  .step-out { padding-left: 0; }
  .bot-card { padding: 12px; }
  table.diff-table th, table.diff-table td { padding: 6px 8px; }
  table.diff-table tbody th { min-width: 72px; }
  .inline-form .field { flex: 1 1 100%; }
  .inline-form .form-buttons .btn { flex: 1 1 0; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- 协作台：等你、分工（10/31，docs/tech-design/collab-desk.md §6） ---------- */

/* 等你：一件一行（标题 + 一行小字），详情、怎么做收起来，回答的按钮在下面；手机上不横着滚 */
.asks-main { gap: 10px; }
.asks-approvals { margin: 0; font-size: 14px; font-weight: 700; }
.ask-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ask-group + .ask-group { margin-top: 8px; }
.ask-group-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.ask-group-today .ask-group-title { color: var(--ink); }
.ask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ask {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 0 12px;
  border-top: 1px solid var(--line); scroll-margin-top: 16px;
}
.ask:first-child { border-top: none; }
.ask.is-focus { margin: 0 -10px; padding: 10px; border-radius: 10px; background: var(--teal-tint); box-shadow: inset 3px 0 0 var(--teal); }
.ask-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ask-title { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; outline: none; }
.ask.is-closed .ask-title { font-weight: 400; }
.ask-meta { margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ask-late { color: #B42318; font-weight: 700; }
.ask-soon { color: var(--ink); font-weight: 700; }
.ask-more > summary { cursor: pointer; width: fit-content; font-size: 13px; color: var(--navy); }
.ask-more[open] > summary { margin-bottom: 6px; }
.ask-dl { padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.ask-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 6px; }
.btn.ask-option {
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  min-height: 44px; padding: 6px 10px; white-space: normal; text-align: left; overflow-wrap: anywhere;
}
.btn.ask-option.is-recommended { border: 2px solid var(--teal-dark); padding: 5px 9px; background: var(--teal-tint); }
.ask-option-label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.ask-option-note { font-size: 12px; color: var(--muted); }
.ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ask-write { display: flex; flex-direction: column; gap: 4px; }
.ask-write label { font-size: 12px; font-weight: 700; color: var(--ink); }
.ask-answer { margin: 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.asks-fold-title { font-size: 16px; }

/* 分工：头上的分布；一项一行，点开看细节、管理员改级别 */
.roles-dist { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 14px; color: var(--ink); }
.roles-dist dt { font-weight: 700; color: var(--muted); }
.roles-dist dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.roles-summary > p.roles-below { font-weight: 700; color: var(--ink); }
.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.role-row { border-top: 1px solid var(--line); min-width: 0; scroll-margin-top: 16px; }
.role-row:first-child { border-top: none; }
.role-row > details > summary.role-sum {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; padding: 10px 4px; cursor: pointer; list-style: none;
}
.role-row > details > summary.role-sum::-webkit-details-marker { display: none; }
.role-row > details > summary.role-sum::before { content: '▸'; color: var(--muted); font-size: 12px; }
.role-row > details[open] > summary.role-sum::before { content: '▾'; }
.role-row.is-focus > details > summary { background: var(--teal-tint); }
.role-name { min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.role-cell { min-width: 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.role-cell.muted { color: var(--muted); }
.role-levels { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.role-bad { color: #B42318; }
.role-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 4px 4px 14px 22px; }
.role-dl { grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.8fr); }
.role-edit {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px;
  padding: 10px 12px; border: 1px solid var(--teal); border-radius: 10px; background: var(--teal-tint);
}
.role-edit .card-status { flex: 1 1 100%; }
.levels-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink); }
.roles-levels > p { margin: 0; }

@media (max-width: 699px) {
  .ask-options { grid-template-columns: minmax(0, 1fr); }
  .ask-actions .btn { flex: 1 1 auto; }
  .ask.is-focus { margin: 0 -8px; padding: 10px 8px; }
  .roles-dist { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .roles-dist dd { margin-bottom: 6px; }
  .role-body { padding: 4px 0 12px; }
  .role-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .role-dl dd { margin-bottom: 8px; }
  .role-edit .field { flex: 1 1 140px; }
}

/* ---------- 11/4：目标与体检（每日体检、目标和线卡） ---------- */

/* 每日体检：一条线一行，格子照模型体检；"为什么"那一格宽一些 */
.health-row > details > summary.goal-sum {
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1.2fr) minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr);
}
.goal-day select { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--white); color: var(--ink); }
.goal-series > summary { cursor: pointer; color: var(--navy); }
.goal-inv { margin: 10px 0 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); min-width: 0; }
.goal-inv h4 { margin: 0 0 4px; }
.goal-inv-causes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.goal-inv-causes p { margin: 2px 0 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.goal-inv-score { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.goal-inv-facts { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; overflow-wrap: anywhere; }

/* 目标和线卡：客户一行一个、线卡一行一条；起草的左边一道黄 */
.goal-clients, .goal-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.goal-client, .goal-card { border-top: 1px solid var(--line); border-left: 4px solid transparent; padding: 10px 4px 10px 10px; min-width: 0; scroll-margin-top: 16px; }
.goal-client:first-child, .goal-card:first-child { border-top: none; }
.goal-client.is-draft, .goal-card.is-draft { border-left-color: var(--yellow); }
.goal-card.is-focus { background: var(--teal-tint); }
.goal-client-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--ink); }
.goal-card-main {
  display: grid; gap: 4px 14px; align-items: center; color: var(--ink);
  grid-template-columns: minmax(130px, 0.9fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.8fr) minmax(0, 0.8fr) auto;
}
.goal-card-id { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.goal-card-cell { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.goal-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.goal-notes { margin: 6px 0 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.goal-drafts { margin: 0; }
.goal-confirm-all { margin-left: auto; }
/* 目标：一行现在多少、从哪天起、建议值、改目标；下面是改动记录 */
.goal-target { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.goal-target-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--ink); }
.goal-suggest { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 0 8px; overflow-wrap: anywhere; }
.goal-target-form { margin-top: 4px; }
.goal-changes > summary { cursor: pointer; color: var(--navy); }
.goal-changes ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink); }
/* 最近的改动、谁能定目标 */
.goal-recent, .goal-editors { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.goal-editors li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.goal-clients-pick { border: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.goal-clients-pick legend { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }

/* 编辑表单：两列，手机上一列 */
.goal-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 10px;
  padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: #FCFCFD;
}
.goal-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 0; }
.goal-form input, .goal-form select, .goal-form textarea {
  min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; font-weight: 400; color: var(--ink); background: var(--white); min-width: 0;
}
.goal-form textarea { min-height: 60px; resize: vertical; }
.goal-form label.goal-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.goal-form label.goal-check input { min-height: 0; width: 18px; height: 18px; }
.goal-wide { grid-column: 1 / -1; }
.goal-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1099px) {
  .health-row > details > summary.goal-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-card-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-actions { grid-column: 1 / -1; margin-left: 0; }
}
@media (max-width: 699px) {
  .goal-form { grid-template-columns: minmax(0, 1fr); }
  .goal-card-main { grid-template-columns: minmax(0, 1fr); }
}
/* 模型排查（line-goals.md §4.2）：和规则的排查单并排，左边一道线区分 */
.goal-inv-model { border-left: 3px solid var(--blue); }
