/* ==========================================================================
   JurisMap · UI 规范
   1. Design tokens（颜色 / 字体 / 圆角 / 阴影 / 间距）
   2. 基础与通用组件（按钮、输入、标签、面板、进度条）
   3. 布局（登录、侧栏、主区）
   4. 业务模块（流程切换、报告栏、时间轴、事件、节点、清单、投标）
   5. 浮层（API 设置、解析抽屉、拖拽遮罩、toast）
   6. 显示规则与响应式
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;
  /* 中性色 */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #e3e6ec;
  --border-strong: #cfd4dd;
  --text: #101828;
  --text-2: #475467;
  --muted: #8a94a6;
  /* 品牌色：墨蓝 */
  --brand: #1d2b53;
  --brand-ink: #ffffff;
  --accent: #3157d5;
  --accent-soft: #e8eefc;
  /* 程序类型色（主程序 / 纠错 / 执行） */
  --k-main: #2f6fec;
  --k-main-soft: #e7effd;
  --k-correction: #d9822b;
  --k-correction-soft: #fcf1e5;
  --k-exec: #12976b;
  --k-exec-soft: #e2f5ee;
  /* 状态色 */
  --ok: #12976b;
  --ok-soft: #e2f5ee;
  --warn: #c77a12;
  --warn-soft: #fdf3e2;
  --danger: #d6453d;
  --danger-soft: #fdecea;
  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  /* 圆角 / 阴影 / 间距 */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --gap: 16px;
  --sidebar-w: 288px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0e1117;
    --surface: #161a22;
    --surface-2: #1b2029;
    --surface-3: #232935;
    --border: #2a303c;
    --border-strong: #3a4250;
    --text: #e8ebf1;
    --text-2: #a9b1c0;
    --muted: #747e90;
    --brand: #c9d4f5;
    --brand-ink: #10162a;
    --accent: #7b9bff;
    --accent-soft: #1f2a48;
    --k-main: #6b9bff;
    --k-main-soft: #1b2843;
    --k-correction: #f0a55a;
    --k-correction-soft: #3a2a18;
    --k-exec: #3fc596;
    --k-exec-soft: #15342a;
    --ok: #3fc596;
    --ok-soft: #15342a;
    --warn: #f0a55a;
    --warn-soft: #3a2a18;
    --danger: #ff7b72;
    --danger-soft: #3d1d1b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- 2. 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs) / 1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type='checkbox'] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
}
::selection {
  background: var(--accent-soft);
}

/* 输入框 */
.fld,
.case-form input,
.case-form select,
.group-form input,
.group-form select,
.group-form textarea,
.api-card input,
.search-box input,
.amb-opts select,
.insp-assign select,
.dp-since input {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.fld:focus,
.case-form :is(input, select):focus,
.group-form :is(input, select, textarea):focus,
.api-card input:focus,
.search-box input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin: 12px 0 5px;
}

/* 按钮 */
.btn-primary,
.btn-dark,
.auth-btn,
.gf-btns .save {
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--brand-ink);
  padding: 8px 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.05s;
}
.btn-primary:hover,
.btn-dark:hover,
.auth-btn:hover,
.gf-btns .save:hover {
  filter: brightness(1.12);
}
.btn-primary:active,
.btn-dark:active,
.auth-btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-ghost,
.gf-btns .cancel,
.btn-share,
.ev-modal-x {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  padding: 7px 14px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover,
.gf-btns .cancel:hover,
.btn-share:hover,
.ev-modal-x:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.link {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 4px 0;
  font-size: var(--fs-sm);
}
.link:hover {
  text-decoration: underline;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 16px;
}
.icon-btn:hover {
  background: var(--surface-2);
}

/* 标签 / 徽标 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-style: normal;
  line-height: 18px;
  white-space: nowrap;
}
.tag.t-step {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag.t-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.tag.t-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag.t-local {
  background: var(--k-exec-soft);
  color: var(--k-exec);
}
.pill {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.k-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  background: var(--k-main);
}
.k-dot.k-correction {
  background: var(--k-correction);
}
.k-dot.k-exec {
  background: var(--k-exec);
}

/* 面板 */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-top: var(--gap);
}
.p-kicker {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}
.p-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}
.p-title-row h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.p-hint {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 2px;
}
.empty,
.empty-sm {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  font-size: var(--fs-sm);
}
.empty-sm {
  padding: 14px 8px;
}

/* 进度条 */
.bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 8px;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.3s var(--ease);
}
.bar.sm {
  height: 4px;
}
.ts-prog {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.ts-prog.full {
  color: var(--ok);
  font-weight: 600;
}

/* 清单 */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--surface-3);
}
.checklist li:last-child {
  border-bottom: 0;
}
.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 7px 0;
  font-size: var(--fs);
  color: var(--text);
  cursor: pointer;
  flex: 1;
}
.checklist label input {
  margin-top: 3px;
}
.checklist input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}
.checklist li.plain {
  padding: 7px 0 7px 16px;
  position: relative;
}
.checklist li.plain::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}
.checklist .ck-at {
  flex: none;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.checklist .ck-at.word {
  color: var(--accent);
}
.ck-chain {
  margin: 10px 0 4px;
  font-size: var(--fs-sm);
}
.ck-chain summary {
  cursor: pointer;
  color: var(--text-2);
}
.ck-chain summary i {
  font-style: normal;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
}
.ck-chain ol {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.ck-chain li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
}
.ck-chain li b {
  flex: none;
  min-width: 26px;
  color: var(--accent);
}
.ck-chain li span {
  flex: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ck-chain li em {
  font-style: normal;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.checklist li.sub span {
  color: var(--text-2);
}
.checklist .x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
  padding: 0 4px;
}
.checklist .x:hover {
  color: var(--danger);
}

/* ---------- 3. 登录 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
}
.auth-logo,
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  font-family: Georgia, serif;
}
.auth-logo .t,
.brand .t {
  font-weight: 800;
  font-size: var(--fs-lg);
  letter-spacing: 0.01em;
}
.brand .s {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.auth-sub {
  margin: 10px 0 18px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.auth-tabs {
  display: flex;
  background: var(--surface-3);
  border-radius: var(--r);
  padding: 3px;
  gap: 2px;
}
.auth-tabs button {
  flex: 1;
  border: 0;
  background: none;
  border-radius: 8px;
  padding: 7px 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.auth-tabs button.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.auth-btn {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
}
.auth-plain {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 4px 0;
  font-size: var(--fs-sm);
  margin-top: 8px;
}
.auth-plain:disabled {
  color: var(--muted);
}
.auth-msg {
  min-height: 18px;
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.auth-msg[data-kind='error'] {
  color: var(--danger);
}
.auth-msg[data-kind='ok'] {
  color: var(--ok);
}
.auth-link {
  margin-top: 10px;
  font-size: var(--fs-sm);
}
.auth-link a {
  color: var(--accent);
  cursor: pointer;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--fs-xs);
  margin: 18px 0 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-guest {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-weight: 600;
}
.auth-guest:hover {
  border-color: var(--border-strong);
}
.auth-guest-note,
.auth-demo {
  margin-top: 10px;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.6;
}
.auth-demo {
  padding: 8px 10px;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--r-sm);
}

/* ---------- 3. 应用布局 ---------- */
.guest-banner {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 16px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-sm);
  text-align: center;
}
.guest-banner button {
  border: 1px solid currentColor;
  background: none;
  color: inherit;
  border-radius: var(--r-pill);
  padding: 3px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sec-head .tt {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.add-case {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  line-height: 1;
}
.add-case:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.case-form {
  display: none;
  padding: 4px 12px 12px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.case-form.open {
  display: block;
}
.form-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.form-btns > * {
  flex: 1;
}
.case-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.case-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.case-item:hover {
  background: var(--surface-2);
}
.case-item.on {
  background: var(--accent-soft);
}
.case-item.on .cn {
  color: var(--accent);
}
.ci-body {
  flex: 1;
  min-width: 0;
}
.ci-body .cn {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-body .cs {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.ci-del {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
  opacity: 0;
  padding: 0 4px;
}
.case-item:hover .ci-del,
.ci-del:focus-visible {
  opacity: 1;
}
.ci-del:hover {
  color: var(--danger);
}
.btn-share {
  width: 100%;
}
.share-hint {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 6px;
}
.search-box input {
  padding-left: 32px;
  background: var(--surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.2' fill='none' stroke='%238a94a6' stroke-width='1.4'/%3E%3Cpath d='M9.2 9.2 L12.4 12.4' stroke='%238a94a6' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat 11px center;
}
.chip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.chip-grid button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 4px 0;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.chip-grid button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.dl-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dl-cap {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 6px 0 2px;
}
.dl-item {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
}
.dl-item:hover {
  background: var(--surface-3);
}
.dl-t {
  font-weight: 600;
  font-size: var(--fs-sm);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.dl-d {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.dl-b {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.dl-foot {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 4px;
}
.u-ok {
  border-left-color: var(--ok);
}
.u-soon {
  border-left-color: var(--warn);
}
.u-urgent,
.u-overdue {
  border-left-color: var(--danger);
}
.u-urgent b,
.u-overdue b {
  color: var(--danger);
}
.u-soon b {
  color: var(--warn);
}
.user-box {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.user-box .av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex: none;
}
.user-box .em {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
}
.user-box button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.user-box button:hover {
  color: var(--danger);
}
.sync-chip {
  flex: none;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  white-space: nowrap;
  background: var(--ok-soft);
  color: var(--ok);
}
.sync-chip.s-saving {
  background: var(--accent-soft);
  color: var(--accent);
}
.sync-chip.s-offline {
  background: var(--warn-soft);
  color: var(--warn);
}
.sync-chip.s-error {
  background: var(--danger-soft);
  color: var(--danger);
}
.main {
  min-width: 0;
  padding: 22px 28px 60px;
}

/* ---------- 4. 流程切换 ---------- */
.wf-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wf-nav {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
  color: var(--text-2);
}
.wf-nav:hover {
  background: var(--surface-2);
}
.wf-track {
  flex: 1;
  min-width: 0;
  display: flex;
  overflow: hidden;
  border-radius: var(--r-lg);
}
.wf-card {
  flex: 0 0 100%;
  padding: 22px 26px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--accent)));
  color: var(--brand-ink);
  cursor: pointer;
  user-select: none;
  transform: translateX(calc(var(--wf-i, 0) * -100%));
  transition: transform 0.35s var(--ease);
}
.wf-card[data-wf='bid'] {
  background: linear-gradient(135deg, #3b2a63, #6b4bb8);
  color: #fff;
}
.wf-card .kicker {
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  opacity: 0.7;
  font-weight: 600;
}
.wf-card h1 {
  font-size: 26px;
  margin: 4px 0 2px;
  font-weight: 800;
}
.wf-card p {
  opacity: 0.8;
  font-size: var(--fs-sm);
}
.wf-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 4px;
}
.wf-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: width 0.2s var(--ease);
}
.wf-dots button.on {
  width: 20px;
  background: var(--brand);
}
.view-bar {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}
.view-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-3);
  border-radius: var(--r);
}
.view-switch button {
  border: 0;
  background: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.view-switch button.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ---------- 4. 报告栏 ---------- */
.report-bar {
  margin-top: 14px;
}
.report-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.import-zone {
  flex: 1 1 320px;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.import-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.import-zone.has-files {
  border-style: solid;
  border-color: var(--border);
}
.iz-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.iz-empty i {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.iz-ico {
  font-size: 18px;
}
.iz-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.iz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  max-width: 100%;
}
.iz-chip:hover {
  border-color: var(--accent);
}
.iz-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.iz-size {
  color: var(--muted);
}
.iz-st {
  font-style: normal;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
}
.iz-st.st-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.iz-st.st-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.iz-st.st-err {
  background: var(--danger-soft);
  color: var(--danger);
}
.iz-st.st-busy {
  background: var(--accent-soft);
  color: var(--accent);
}
.iz-rm {
  border: 0;
  background: none;
  color: var(--muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  line-height: 1;
}
.iz-rm:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.report-ctl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.model-wrap {
  position: relative;
}
.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  max-width: 260px;
}
.model-pill:hover {
  border-color: var(--border-strong);
}
.mp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.model-pill[data-sandbox='1'] .mp-dot {
  background: var(--warn);
}
.mp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-chev {
  color: var(--muted);
  flex: none;
}
.model-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.mm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.mm-search input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  padding: 4px 0;
}
.mm-auto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.mm-auto-txt b {
  display: block;
  color: var(--text);
  font-size: var(--fs);
}
.mm-auto-txt i {
  font-style: normal;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}
.switch .knob {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: background 0.2s;
}
.switch .knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .knob {
  background: var(--accent);
}
.switch input:checked + .knob::after {
  transform: translateX(16px);
}
.switch input:focus-visible + .knob {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mm-list {
  max-height: 300px;
  overflow-y: auto;
  padding-top: 4px;
}
.mm-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
}
.mm-item:hover {
  background: var(--surface-2);
}
.mm-item.on {
  background: var(--accent-soft);
}
.mm-item.on .mm-name::after {
  content: ' ✓';
  color: var(--accent);
}
.mm-name {
  font-size: var(--fs-sm);
  font-weight: 600;
}
.mm-tags {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mm-prov {
  font-style: normal;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.mm-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.btn-export {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  white-space: nowrap;
}
.btn-export:hover {
  filter: brightness(1.12);
}
.btn-export.running {
  background: var(--danger);
  color: #fff;
}
.gen-progress {
  margin-top: 10px;
}
.gp-track {
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.gp-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--k-exec));
  transition: width 0.3s var(--ease);
}
.gp-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 4. 图例 / 时间轴 ---------- */
.legend {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.l-main i {
  background: var(--k-main);
}
.l-corr i {
  background: var(--k-correction);
}
.l-exec i {
  background: var(--k-exec);
}
.tl-scroll {
  overflow-x: auto;
  padding: 0 4px 6px;
}
.tl-track,
.tl-progress {
  position: relative;
  min-width: 560px;
  margin: 0 40px;
}
.tl-track {
  height: 64px;
}
#btTrack {
  height: 82px;
}
.tl-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 2px;
  background: var(--border);
}
.tl-node {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.tl-node i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  transition: all 0.2s var(--ease);
}
.tl-node em {
  font-style: normal;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.tl-node.done {
  color: var(--text-2);
}
.tl-node.done i {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface);
}
.tl-node.cur {
  color: var(--text);
  font-weight: 700;
}
.tl-node.cur i {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tl-node:hover i {
  border-color: var(--accent);
}
.tl-progress {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  margin-top: 4px;
  margin-bottom: 4px;
}
#btProgress {
  cursor: pointer;
}
.tl-progress .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--k-exec));
  transition: width 0.4s var(--ease);
}
.tl-progress .dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  transform: translate(-50%, -50%);
  transition: left 0.4s var(--ease);
  z-index: 1;
}
.tl-progress.empty .dot {
  display: none;
}
.tl-stop {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--border-strong);
  transform: translateY(-50%);
}

/* ---------- 4. 事件 ---------- */
.ev-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.ev-filter button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 3px 12px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.ev-filter button i {
  font-style: normal;
  color: var(--muted);
  margin-left: 2px;
}
.ev-filter button.on {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}
.ev-modal {
  display: none;
}
.ev-modal.open {
  display: block;
  margin-bottom: 14px;
  animation: drop-in 0.18s var(--ease);
}
@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.ev-modal-card {
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  padding: 16px 18px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.ev-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ev-modal-head h3 {
  font-size: var(--fs-md);
}
.ev-modal-x {
  padding: 4px 10px;
  font-size: var(--fs-sm);
}
.gf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0 14px;
}
.gf-grid .full {
  grid-column: 1 / -1;
}
.contact-pair {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px;
}
.gf-btns {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.group-cards > .empty {
  grid-column: 1 / -1;
}
.ev-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.ev-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.ev-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ev-head h4 {
  font-size: var(--fs-md);
  line-height: 1.4;
  word-break: break-word;
}
.ver-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 0 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 20px;
}
.ver-badge b {
  font-weight: 400;
  opacity: 0;
  width: 0;
  transition: all 0.15s;
  overflow: hidden;
}
.ver-badge:hover b,
.ver-badge:focus-visible b {
  opacity: 1;
  width: 10px;
}
.ev-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ev-tags:empty {
  display: none;
}
.ev-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 0;
}
.ev-fields .full {
  grid-column: 1 / -1;
}
.ev-fields dt {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.ev-fields dd {
  margin: 0;
  font-size: var(--fs-sm);
  word-break: break-word;
  white-space: pre-wrap;
}
.ev-history {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.ev-history summary {
  cursor: pointer;
  color: var(--muted);
}
.evh-item {
  padding: 6px 0 6px 10px;
  border-left: 2px solid var(--border);
  margin: 6px 0 0 4px;
}
.evh-item em {
  font-style: normal;
  color: var(--warn);
  display: block;
}
.evh-body {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
}
.ev-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--surface-3);
  padding-top: 8px;
  margin-top: auto;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.ev-acts {
  display: flex;
  gap: 2px;
}
.ev-acts button {
  border: 0;
  background: none;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-xs);
}
.ev-acts button:hover {
  background: var(--surface-2);
}
.ev-acts .danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* 澄清卡片 */
.amb-card {
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.amb-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.amb-head b {
  font-size: var(--fs-md);
}
.amb-head .p-kicker {
  color: var(--warn);
}
.amb-more {
  font-size: var(--fs-xs);
  color: var(--warn);
  white-space: nowrap;
}
.amb-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.amb-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font-weight: 600;
}
.amb-opt em {
  font-style: normal;
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.amb-opt.best {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.amb-opt:hover {
  border-color: var(--accent);
}
.amb-opts select {
  width: auto;
  min-width: 140px;
}
.amb-foot {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.amb-foot .btn-ghost {
  padding: 4px 12px;
  font-size: var(--fs-sm);
}

/* ---------- 4. 节点卡片 + 详情 ---------- */
.cards-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--gap);
  align-items: start;
}
.cards-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.cards-scroll > .empty {
  flex: 1;
}
.phase-col {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-snap-align: start;
}
.phase-col h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--text-2);
  padding: 0 4px 2px;
}
.phase-col h3 i {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.node-card {
  --k: var(--k-main);
  --k-soft: var(--k-main-soft);
  text-align: left;
  width: 100%;
  border: 1px solid var(--border);
  border-left: 3px solid var(--k);
  border-radius: var(--r);
  background: var(--surface);
  padding: 10px 12px;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.k-main {
  --k: var(--k-main);
  --k-soft: var(--k-main-soft);
}
.k-correction {
  --k: var(--k-correction);
  --k-soft: var(--k-correction-soft);
}
.k-exec {
  --k: var(--k-exec);
  --k-soft: var(--k-exec-soft);
}
.node-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.node-card.sel {
  border-color: var(--k);
  box-shadow: 0 0 0 3px var(--k-soft);
}
.node-card.cur {
  background: var(--k-soft);
}
.nc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nc-kind {
  font-size: var(--fs-xs);
  color: var(--k);
  font-weight: 600;
}
.nc-cur {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #fff;
  background: var(--k, var(--accent));
  border-radius: var(--r-pill);
  padding: 0 7px;
  line-height: 18px;
}
.nc-title {
  font-weight: 700;
  margin: 2px 0 3px;
}
.nc-sum {
  font-size: var(--fs-xs);
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.nc-meta:empty {
  display: none;
}
.detail-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.dp-head {
  padding: 18px 20px 14px;
  border-top: 4px solid var(--k);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(180deg, var(--k-soft), transparent);
}
.dp-head .p-kicker {
  color: var(--k);
  letter-spacing: 0.04em;
}
.dp-head h3 {
  font-size: var(--fs-lg);
  margin: 4px 0;
}
.dp-head p {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.dp-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.dp-acts > * {
  padding: 5px 12px;
  font-size: var(--fs-sm);
}
.badge-cur {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-sm);
  background: var(--k);
  color: #fff;
  font-weight: 600;
}
.dp-sec {
  padding: 12px 20px;
  border-top: 1px solid var(--surface-3);
}
.dp-sec h4 {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-bottom: 6px;
}
.dp-sec h4 i {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}
.dp-since {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 8px;
}
.dp-since input {
  min-height: 30px;
  padding: 3px 8px;
}
.dp-since i {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.dp-dl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dp-dl li {
  padding: 7px 10px;
  border-left: 3px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.basis {
  margin: 0;
  padding-left: 18px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.next-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.next-chips button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: var(--fs-sm);
}
.next-chips button:hover {
  border-color: var(--k);
  background: var(--k-soft);
}

/* ---------- 4. 执行清单 ---------- */
.task-phase {
  margin-top: 18px;
}
.task-phase h3 {
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.task-step {
  border: 1px solid var(--border);
  border-left: 3px solid var(--k);
  border-radius: var(--r);
  margin-bottom: 6px;
  background: var(--surface);
}
.task-step.cur {
  box-shadow: 0 0 0 3px var(--k-soft);
}
.task-step > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
.task-step > summary::-webkit-details-marker {
  display: none;
}
.task-step[open] > summary {
  border-bottom: 1px solid var(--surface-3);
}
.ts-kind {
  font-size: var(--fs-xs);
  color: var(--k);
}
.task-step .checklist,
.task-step .link {
  margin: 0 14px;
}
.task-step .link {
  display: inline-block;
  margin-bottom: 8px;
}

/* ---------- 4. 投标 ---------- */
.bid-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: var(--gap);
}
.bid-head h2 {
  font-size: var(--fs-lg);
}
.bid-progress {
  font-size: var(--fs-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.bid-stage {
  margin-top: 16px;
}
.bid-stage h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--fs-md);
  margin-bottom: 8px;
}
.bid-stage h3 em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.bid-stage .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  font-size: var(--fs-xs);
  flex: none;
}
.bid-stage.cur .num {
  background: var(--accent);
  color: #fff;
}
.bid-item {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  margin-bottom: 6px;
}
.bid-item.open {
  box-shadow: var(--shadow);
}
.bi-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
}
.circle {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  transition: all 0.15s;
}
.circle:hover {
  border-color: var(--ok);
}
.bid-item.done .circle {
  background: var(--ok);
  border-color: var(--ok);
}
.bid-item.done .bi-txt b {
  color: var(--muted);
  text-decoration: line-through;
}
.bi-txt {
  flex: 1;
  min-width: 0;
}
.bi-txt span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chev {
  color: var(--muted);
  transition: transform 0.15s;
  font-size: 18px;
}
.bid-item.open .chev {
  transform: rotate(90deg);
}
.bi-body {
  padding: 4px 14px 12px 48px;
  border-top: 1px solid var(--surface-3);
}
.bid-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  margin-top: var(--gap);
  overflow-x: auto;
  padding-bottom: 8px;
}
.bid-col.cur h3 {
  color: var(--accent);
}
.bid-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 12px 14px;
}
.bid-card.done {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.bc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.bid-card .nc-sum {
  margin-bottom: 4px;
}
.sub-add input {
  width: 100%;
  border: 1px dashed var(--border);
  background: transparent;
  border-radius: var(--r-sm);
  padding: 5px 8px;
  font-size: var(--fs-sm);
  margin-top: 6px;
}
.sub-add input:focus {
  outline: none;
  border-style: solid;
  border-color: var(--accent);
}
.notes {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.notes li {
  font-size: var(--fs-xs);
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  margin-top: 4px;
}
.notes li::before {
  content: '⚖ ';
}
.bc-events {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 8px;
}

/* ---------- 5. API 设置 ---------- */
.api-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 14, 24, 0.45);
  backdrop-filter: blur(2px);
}
.api-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
}
.confirm-card {
  max-width: 420px;
}
.confirm-card p {
  margin: 0 0 16px;
  white-space: pre-line;
  line-height: 1.6;
}
.confirm-card .gf-btns {
  justify-content: flex-end;
}
.api-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.api-head h3 {
  font-size: var(--fs-lg);
}
.api-key-row {
  display: flex;
  gap: 6px;
}
.api-key-row input {
  font-family: var(--mono);
}
.api-adv {
  margin-top: 14px;
  font-size: var(--fs-sm);
}
.api-adv summary {
  cursor: pointer;
  color: var(--text-2);
}
.api-ids {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.api-id {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.api-id input {
  min-height: 30px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
}
.api-note {
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* ---------- 5. 解析抽屉 ---------- */
.insp-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 14, 24, 0.35);
}
.inspector {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  width: 520px;
  max-width: 100vw;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slide-in 0.2s var(--ease);
}
@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
.insp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.insp-ttl {
  min-width: 0;
}
.insp-ttl h3 {
  font-size: var(--fs-md);
  word-break: break-all;
  margin-top: 4px;
}
.insp-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 20px;
}
.insp-sec {
  padding: 14px 0;
  border-bottom: 1px solid var(--surface-3);
}
.insp-sec h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-bottom: 8px;
}
.insp-meta,
.insp-ent {
  display: grid;
  gap: 8px;
  margin: 0;
}
.insp-meta {
  grid-template-columns: repeat(4, 1fr);
}
.insp-meta dt,
.insp-ent dt {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.insp-meta dd,
.insp-ent dd {
  margin: 0;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.insp-ent > div {
  display: grid;
  grid-template-columns: 48px 1fr;
}
.insp-ent dd i {
  font-weight: 400;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.insp-warn {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-sm);
}
.insp-warn.err {
  background: var(--danger-soft);
  color: var(--danger);
}
.scores {
  list-style: none;
  margin: 0;
  padding: 0;
}
.scores li {
  display: grid;
  grid-template-columns: 130px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  padding: 3px 0;
}
.scores i {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--k-main);
}
.scores i.k-correction {
  background: var(--k-correction);
}
.scores i.k-exec {
  background: var(--k-exec);
}
.scores em {
  font-style: normal;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.insp-assign {
  margin-top: 10px;
}
.insp-img {
  max-width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.insp-text {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r);
  font: var(--fs-sm) / 1.7 var(--font);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 5. 拖拽遮罩 / Toast ---------- */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 82%, transparent);
  pointer-events: none;
}
.do-card {
  text-align: center;
  color: #fff;
  padding: 40px 48px;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  border-radius: 24px;
}
.do-plus {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
}
.do-title {
  font-size: 26px;
  font-weight: 800;
}
.do-sub {
  opacity: 0.85;
  margin-top: 6px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: calc(100vw - 32px);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 18px;
  border-radius: var(--r);
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  transition: all 0.2s var(--ease);
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.t-ok {
  background: var(--ok);
  color: #fff;
}
#toast.t-warn {
  background: var(--warn);
  color: #fff;
}
#toast.t-error {
  background: var(--danger);
  color: #fff;
}

/* ---------- 6. 显示规则 ---------- */
#app {
  display: none;
}
body[data-auth='guest'] #app,
body[data-auth='user'] #app {
  display: block;
}
body[data-auth='guest'] #authView,
body[data-auth='user'] #authView,
body:not([data-auth]) #authView {
  display: none;
}
body[data-guest='1'] .guest-banner {
  display: flex;
}
body[data-workflow='bid'] #civilFlow,
body[data-workflow='bid'] .litigation-block {
  display: none !important;
}
body[data-workflow='civil'] #bidFlow {
  display: none;
}
body[data-view='grid'] .view-tasks,
body[data-view='tasks'] .view-grid {
  display: none !important;
}

/* ---------- 6. 响应式 ---------- */
@media (max-width: 1180px) {
  .cards-wrap {
    grid-template-columns: 1fr;
  }
  .detail-panel {
    position: static;
    max-height: none;
  }
}
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .user-box {
    margin-top: 0;
  }
  .main {
    padding: 16px 16px 48px;
  }
  .panel {
    padding: 16px;
  }
  .wf-card {
    padding: 18px;
  }
  .wf-card h1 {
    font-size: 22px;
  }
  .wf-nav {
    display: none;
  }
  .report-ctl {
    width: 100%;
  }
  .model-wrap {
    flex: 1;
  }
  .model-pill {
    width: 100%;
    max-width: none;
  }
  .model-menu {
    left: 0;
    right: auto;
  }
  .p-title-row {
    flex-wrap: wrap;
  }
  .ev-fields,
  .insp-meta {
    grid-template-columns: 1fr 1fr;
  }
  .tl-track,
  .tl-progress {
    margin: 0 30px;
  }
  .bi-body {
    padding-left: 14px;
  }
  .api-id {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .scores li {
    grid-template-columns: 100px 1fr 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 期限备注 / 审限暂停 ---------- */
.dl-n {
  font-size: var(--fs-xs);
  color: var(--warn);
  margin-top: 2px;
}
.dl-tag {
  font-style: normal;
  font-weight: 500;
  font-size: 10px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: var(--r-pill);
  background: var(--warn-soft);
  color: var(--warn);
}
.pause-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.pause-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--surface-3);
}
.pause-list li span {
  flex: 1;
  color: var(--text-2);
}
.pause-list .x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
}
.pause-add {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pause-add select,
.pause-add input {
  flex: 1 1 120px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
}

/* ---------- 管辖扫描 ---------- */
.jx-item {
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border-left: 3px solid var(--border-strong);
}
.jx-item.jx-high {
  background: var(--danger-soft);
  border-left-color: var(--danger);
}
.jx-item.jx-medium {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}
.jx-t {
  font-weight: 600;
  font-size: var(--fs-sm);
}
.jx-high .jx-t {
  color: var(--danger);
}
.jx-item blockquote {
  margin: 6px 0;
  padding-left: 8px;
  border-left: 2px solid var(--border-strong);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.jx-item p {
  margin: 4px 0;
  font-size: var(--fs-sm);
}
.jx-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.insp-clauses {
  list-style: none;
  margin: 0;
  padding: 0;
}
.insp-clauses li {
  font-size: var(--fs-sm);
  padding: 6px 0;
  border-bottom: 1px solid var(--surface-3);
}
.insp-clauses .tag {
  margin-right: 6px;
}

/* ---------- 投标 · 一票否决项 ---------- */
.veto {
  margin-bottom: 18px;
}
.veto.busy {
  opacity: 0.6;
  pointer-events: none;
}
.veto-acts {
  display: flex;
  gap: 6px;
}
.veto-sum {
  margin-left: 8px;
  font-weight: 600;
  color: var(--text);
}
.veto-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.veto-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-3);
  font-size: var(--fs-sm);
}
.veto-t {
  flex: 1;
}
.veto-ok .veto-t {
  color: var(--muted);
}
.veto-st {
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  padding: 2px 10px;
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.veto-st.st-ok {
  background: var(--ok-soft);
  border-color: var(--ok-soft);
  color: var(--ok);
}
.veto-st.st-risk {
  background: var(--danger-soft);
  border-color: var(--danger-soft);
  color: var(--danger);
}

/* ---------- 律所技能库 ---------- */
.view-bar {
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.skills-badge {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.skills-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.skill-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}
.skill-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-3);
}
.skill-list li:not(.live) b {
  color: var(--muted);
}
.skill-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-row b {
  flex: 1;
  font-size: var(--fs);
}
.skill-row .x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
}
.skills-card .switch input {
  min-height: 0;
  padding: 0;
}
.skill-list details,
.skill-new {
  margin-top: 6px;
  font-size: var(--fs-sm);
}
.skill-list summary,
.skill-new summary {
  cursor: pointer;
  color: var(--accent);
}
.skill-list pre {
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: var(--fs-sm);
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  margin: 6px 0 0;
}
.skill-new form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.skill-new select,
.skill-new textarea {
  width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
}
.dl-t .dl-tag {
  margin-right: auto;
}

/* ---------- 扩展视图：大事记 / 叙述备忘 / 分支推演 ---------- */
.view-chronicle,
.view-memo,
.view-branches {
  display: none;
}
body[data-view='chronicle'] .view-chronicle,
body[data-view='memo'] .view-memo,
body[data-view='branches'] .view-branches {
  display: block;
}
body:is([data-view='chronicle'], [data-view='memo'], [data-view='branches']) :is(.view-grid, .view-tasks) {
  display: none !important;
}
body[data-workflow='bid'] .civil-only-view {
  display: none;
}
.chr-month h3 {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 18px 0 6px;
}
.chr-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  border-left: 2px solid var(--surface-3);
}
.chr-list li {
  display: grid;
  grid-template-columns: 22px 48px 1fr;
  gap: 6px;
  align-items: baseline;
  padding: 7px 0 7px 6px;
  margin-left: -11px;
}
.chr-list li > i {
  font-style: normal;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
}
.chr-list time {
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chr-list b {
  font-size: var(--fs-sm);
}
.chr-list p {
  margin: 2px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.chr-step > i {
  color: var(--k-main);
}
.chr-event > i {
  color: var(--accent);
}
.chr-pause > i {
  color: var(--warn);
}
.chr-deadline > i,
.chr-deadline b {
  color: var(--danger);
}
.chr-list li.future {
  opacity: 0.75;
  border-top: 1px dashed var(--border);
}
.chr-today {
  display: block !important;
  padding: 4px 0 !important;
}
.chr-today span {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 1px 10px;
}
.memo-body {
  font-size: var(--fs);
  line-height: 1.8;
}
.memo-body h2 {
  font-size: var(--fs-md);
  margin: 16px 0 6px;
}
.memo-body p {
  margin: 4px 0;
}
.br-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.br-tabs button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: var(--fs-sm);
}
.br-tabs button.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.br-tree,
.br-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.br-tree ul {
  margin-left: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--surface-3);
}
.br-node {
  padding-top: 8px;
}
.br-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.br-box b {
  font-size: var(--fs-sm);
}
.br-box p {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.br-good > .br-box {
  border-left-color: var(--ok);
}
.br-bad > .br-box {
  border-left-color: var(--danger);
}

/* ---------- 解析透视：全文分页 ---------- */
.insp-full {
  max-height: 520px;
  overflow: auto;
}
.insp-full .insp-text {
  max-height: none;
  overflow: visible;
}
.insp-page {
  position: sticky;
  top: 0;
  margin: 10px 0 4px;
  font-size: var(--fs-xs);
  color: var(--muted);
  background: var(--surface);
}
.insp-note {
  margin-top: 8px;
  font-size: var(--fs-xs);
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: var(--r-sm);
  padding: 4px 8px;
}

/* ---------- 联系人置顶 / 跟踪备注 ---------- */
.contact-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 4px;
}
.cs-title {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-right: 2px;
}
.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 3px 10px 3px 4px;
  font-size: var(--fs-sm);
}
.cs-chip:hover {
  border-color: var(--accent);
}
.cs-chip i {
  font-style: normal;
  font-size: var(--fs-xs);
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
}
.cs-chip.court i {
  background: var(--k-main-soft);
  color: var(--k-main);
}
.cs-chip.client i {
  background: var(--ok-soft);
  color: var(--ok);
}
.cs-chip span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.cs-chip em {
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--accent);
}
.note-add {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}
.note-add textarea,
.note-add input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  min-height: 0;
}
.note-add div {
  display: flex;
  gap: 6px;
}
.note-add input {
  flex: 1;
}
.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.note-list li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--surface-3);
  font-size: var(--fs-sm);
}
.note-list time {
  color: var(--muted);
  font-size: var(--fs-xs);
  flex: none;
}
.note-list span {
  flex: 1;
}
.note-list .x {
  border: 0;
  background: none;
  color: var(--muted);
}
.profile {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--surface-2);
}
.profile h4 {
  margin: 0 0 6px;
}
.profile h4 i {
  font-style: normal;
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.profile h5 {
  margin: 8px 0 2px;
  font-size: var(--fs-sm);
}
.profile ul {
  margin: 0;
  padding-left: 18px;
  font-size: var(--fs-sm);
}
.profile li i {
  font-style: normal;
  color: var(--muted);
  font-size: var(--fs-xs);
  margin-left: 6px;
}
.profile-ai {
  font-size: var(--fs-sm);
  margin: 8px 0;
}

/* ---------- 版本差异 ---------- */
.evh-diff {
  margin-top: 4px;
  font-size: var(--fs-xs);
}
.evh-diff div {
  display: flex;
  gap: 6px;
}
.evh-diff dt {
  color: var(--muted);
  flex: none;
}
.evh-diff dd {
  margin: 0;
}
.evh-diff ins {
  text-decoration: none;
  background: var(--ok-soft);
  color: var(--ok);
}
.evh-diff del {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- 转发与交接 ---------- */
#handoffBtn {
  margin-top: 6px;
}
.handoff-opts {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.handoff-opts button {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}
.handoff-opts button:hover {
  border-color: var(--accent);
}
.handoff-opts span {
  font-size: var(--fs-xs);
  color: var(--text-2);
}

/* 转发与交接：范围、内容、渠道 */
.ho-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 8px;
}
.ho-scope button {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
.ho-scope button.on {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.ho-scope span {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.ho-event {
  width: 100%;
  margin-bottom: 4px;
}
.ho-h {
  margin: 10px 0 4px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.ho-parts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ho-parts li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.ho-parts label {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  margin: 0;
}
.ho-parts input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
}
.ho-parts i {
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.ho-channels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 6px;
}
.ho-channels button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font-size: var(--fs-sm);
}
.ho-channels button:hover {
  border-color: var(--accent);
}
.ho-channels span {
  font-size: 20px;
}
.ho-sent {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: var(--fs-sm);
}
.ho-sent li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.ho-sent li i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.ho-sent time {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* ---------- MCP 连接器 ---------- */
.mcp-settings h4 {
  margin: 16px 0 6px;
  font-size: var(--fs-sm);
}
.mcp-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  color: var(--text);
}
.api-card .mcp-check input,
.mcp-settings .switch input {
  width: auto;
  min-height: 0;
  padding: 0;
}
.mcp-settings .switch input {
  width: 100%;
}
.mcp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mcp-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-3);
}
.mcp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mcp-row b {
  flex: 1;
  font-size: var(--fs-sm);
}
.mcp-row .x {
  border: 0;
  background: none;
  color: var(--muted);
}
.mcp-url {
  font: var(--fs-xs) / 1.6 var(--mono);
  color: var(--muted);
  margin: 2px 0 4px 44px;
  word-break: break-all;
}
.mcp-list input[data-token] {
  min-height: 30px;
  font-size: var(--fs-sm);
}
.mcp-st {
  font-size: var(--fs-xs);
  margin-top: 4px;
  color: var(--text-2);
}
.mcp-st.ok {
  color: var(--ok);
}
.mcp-st.err {
  color: var(--danger);
}
.mcp-add {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.mcp-add input {
  flex: 1 1 140px;
}

/* Word 任务窗格：紧凑面板 */
.word-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--gap);
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-sm);
}
.word-panel:empty {
  display: none;
}
/* Word 任务窗格里只显示紧凑面板，完整网页版隐藏 */
body.in-word #app {
  display: none !important;
}
body.in-word .word-panel {
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body:not([data-auth='guest']):not([data-auth='user']) .word-panel {
  display: none;
}
.wp-who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-status.waiting {
  background: var(--surface-2);
}
.wp-status.unsupported {
  background: var(--warn-soft);
}
.wp-new summary {
  cursor: pointer;
  color: var(--accent);
}
.wp-new form {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.wp-open {
  align-self: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.wp-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
}
.wp-avatar {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.wp-card {
  padding: 10px 12px;
  background: var(--surface-2, var(--surface-3));
  border-radius: var(--r);
}
.wp-card select {
  width: 100%;
  font: inherit;
  font-weight: 600;
}
.wp-case {
  font-size: var(--fs);
}
.wp-step {
  margin-top: 2px;
  color: var(--danger);
  font-size: var(--fs-xs);
}
.wp-muted {
  color: var(--muted);
}
.wp-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--ok-soft);
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.wp-status .btn-ghost {
  margin-left: auto;
  flex: none;
}
.wp-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.wp-dot.ok {
  background: var(--ok);
}
.wp-dot.warn {
  background: var(--warn);
}
.wp-sec h4 {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.wp-hint {
  margin: 0;
  color: var(--muted);
}
.wp-vers {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wp-vers li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
}
.wp-vers li.on {
  background: var(--accent-soft);
}
.wp-vers b {
  flex: none;
  padding: 0 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  font-size: var(--fs-xs);
}
.wp-vers li.on b {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wp-vers span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-vers em {
  flex: none;
  font-style: normal;
  color: var(--muted);
}

/* 庭前准备画像：特征卡 */
.traits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.trait {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
.trait-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.trait-head b {
  flex: none;
  white-space: nowrap;
}
.trait-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.trait .lv {
  flex: none;
}
.trait .lv {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
}
.trait .lv em {
  width: 10px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
}
.trait .lv em.on {
  background: var(--accent);
}
.trait details {
  margin-top: 4px;
}
.trait summary {
  cursor: pointer;
  color: var(--accent);
  font-size: var(--fs-xs);
}
.trait ul {
  margin: 4px 0 0;
  padding-left: 0;
  list-style: none;
  color: var(--text-2);
}
.trait li time {
  margin-right: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.profile .prep {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
}
.profile .prep h5 {
  margin: 0 0 4px;
}
.profile .prep ul {
  margin: 0;
  padding-left: 18px;
}

/* 律所技能：排版改动预览 */
.skill-preview {
  margin: 8px 0 4px;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
.skill-preview div {
  display: flex;
  gap: 10px;
  padding: 3px 0;
}
.skill-preview dt {
  flex: none;
  width: 4.5em;
  color: var(--muted);
}
.skill-preview dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.skill-preview s {
  color: var(--muted);
}
.skill-preview span {
  color: var(--accent);
}
.skill-preview.off span {
  color: var(--text-2);
}
.skill-preview i {
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--muted);
}
