/* ============================================================
   Ontos AI · 本体智能 —— 路演前端主题（模块D）
   浅色投影友好：白底 / 深灰正文 / 品牌深青蓝
   零外部依赖：系统字体栈，无 webfont
   ============================================================ */

:root {
  /* 品牌与中性色 */
  --brand: #0f6e84;
  --brand-dark: #0b5568;
  --brand-ink: #083d4b;
  --brand-weak: #e2f0f4;
  --brand-weak2: #f1f8fa;
  --ink: #273239;
  --ink-soft: #58656f;
  --ink-faint: #8a97a1;
  --bg: #f3f5f7;
  --card: #ffffff;
  --line: #e1e7eb;
  --line-strong: #cdd6dc;

  /* 结论徽章配色：通过=绿 / 挂起=橙 / 拦截=红 / 需人工=紫 */
  --green: #1e8a4c;
  --green-bg: #e6f4ec;
  --green-line: #b8dfc7;
  --orange: #b3620a;
  --orange-bg: #fcf0de;
  --orange-line: #f0d5ac;
  --red: #bf3028;
  --red-bg: #fbeae8;
  --red-line: #f0c4bf;
  --purple: #6d3fb8;
  --purple-bg: #f1ebfa;
  --purple-line: #d8c8f0;
  --olive: #67721b;
  --olive-bg: #f3f6dd;
  --olive-line: #dde3b3;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Cascadia Mono", "Liberation Mono", "Courier New", monospace;
  --shadow: 0 1px 2px rgba(15, 35, 45, .05), 0 6px 20px rgba(15, 35, 45, .07);
  --shadow-soft: 0 1px 2px rgba(15, 35, 45, .04), 0 3px 10px rgba(15, 35, 45, .05);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 15px; }
body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); }

h1, h2, h3 { margin: 0; font-weight: 650; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; color: var(--ink); }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 40px; height: 40px; color: var(--brand); flex: none; }
.brand-name { font-size: 1.22rem; font-weight: 700; letter-spacing: .01em; color: var(--brand-ink); }
.brand-sub { font-size: .85rem; color: var(--ink-soft); margin-top: 1px; }

.topbar-badges { display: flex; align-items: center; gap: 10px; }
.tb-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--brand-weak2);
  white-space: nowrap;
}
.tb-label { font-size: .78rem; color: var(--ink-soft); }
.tb-badge strong { font-size: .95rem; color: var(--brand-ink); font-weight: 700; }

.tb-live {
  background: var(--green-bg);
  border-color: var(--green-line);
  color: var(--green);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  align-items: center;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 138, 76, .45); }
  50%      { box-shadow: 0 0 0 5px rgba(30, 138, 76, 0); }
}

/* 版本号跳动动画（发布 / 回滚后触发） */
.tb-badge.bump {
  animation: badgeBump .9s cubic-bezier(.2, 1.4, .4, 1);
  border-color: var(--brand);
  background: var(--brand-weak);
}
@keyframes badgeBump {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(15, 110, 132, .18); }
  55%  { transform: scale(.96); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(15, 110, 132, 0); }
}

/* ---------------- 导航 ---------------- */
.mainnav {
  display: flex;
  gap: 6px;
  padding: 10px 28px 0;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.nav-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 11px 20px 13px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  border-bottom: 3px solid transparent;
  transition: color .15s, background .15s;
}
.nav-tab:hover { color: var(--brand-dark); background: var(--brand-weak2); }
.nav-tab.active {
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
  background: linear-gradient(180deg, transparent, var(--brand-weak2));
}
.nav-tab-minor { margin-left: auto; font-size: .92rem; }

/* ---------------- 布局骨架 ---------------- */
.main { max-width: 1760px; margin: 0 auto; padding: 22px 28px 60px; }
/* 栅格子项默认 min-width:auto 会撑破布局，统一收敛，让内部 overflow-x 生效 */
.brand-text, .compare-main, .build-main, .evo-left, .evo-right,
.agent-col, .rejudge-col, .evolve-bottom > .panel { min-width: 0; }
.view { animation: viewIn .25s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 1.06rem; color: var(--brand-ink); }
.panel-hint { font-size: .82rem; color: var(--ink-faint); }
.sub-h { font-size: .93rem; color: var(--ink-soft); margin: 16px 0 9px; font-weight: 650; }
.sub-h:first-child { margin-top: 0; }

.boot-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1760px;
  margin: 14px auto -6px;
  padding: 10px 18px;
  border: 1px solid var(--orange-line);
  background: var(--orange-bg);
  color: var(--orange);
  border-radius: 10px;
  font-size: .9rem;
}

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-size: .93rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, transform .08s, box-shadow .15s, opacity .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-lg { font-size: 1.02rem; padding: 12px 26px; }
.btn-sm { font-size: .82rem; padding: 5px 12px; }
.btn-ghost {
  background: transparent;
  color: var(--brand-dark);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--brand-weak2); border-color: var(--brand); }
.btn-green { background: var(--green); border-color: var(--green); }
.btn-green:hover { background: #17753f; border-color: #17753f; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: var(--red-line); }
.btn-danger-ghost:hover { background: var(--red-bg); }

.icon-btn {
  appearance: none; border: none; background: transparent;
  font-size: 1rem; color: var(--ink-soft); cursor: pointer;
  padding: 6px 9px; border-radius: 8px;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

.select, .text-input, .mono-area {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: .92rem;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.select:focus, .text-input:focus, .mono-area:focus, .ask-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 110, 132, .13);
}
.select-sm { padding: 5px 8px; font-size: .85rem; }
.mono-area { font-family: var(--mono); font-size: .88rem; width: 100%; resize: vertical; line-height: 1.6; }
.text-input { width: 100%; }
.field-label { display: block; font-size: .8rem; color: var(--ink-soft); margin: 10px 0 5px; }

/* ---------------- 空状态 ---------------- */
.empty-state {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 34px 22px;
  text-align: center;
  color: var(--ink-soft);
}
.empty-state.slim { padding: 20px 16px; }
.empty-title { font-weight: 650; font-size: .96rem; }
.empty-hint { font-size: .83rem; color: var(--ink-faint); margin-top: 5px; }
.empty-state .btn { margin-top: 15px; }

/* ---------------- 徽章 / chips ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .76rem;
  font-weight: 650;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-brand  { color: var(--brand-dark); background: var(--brand-weak); border-color: #bcdce6; }
.chip-gray   { color: var(--ink-soft); background: var(--bg); border-color: var(--line); }
.chip-green  { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.chip-orange { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-line); }
.chip-red    { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.chip-purple { color: var(--purple); background: var(--purple-bg); border-color: var(--purple-line); }
.chip-olive  { color: var(--olive); background: var(--olive-bg); border-color: var(--olive-line); }
.chip .mono, .chip.mono { font-family: var(--mono); }

/* 结论大徽章 */
.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 750;
  padding: 6px 17px;
  border-radius: 999px;
  border: 1.5px solid transparent;
}
.verdict-badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.vd-pass    { color: var(--green);  background: var(--green-bg);  border-color: var(--green-line); }
.vd-flags   { color: var(--olive);  background: var(--olive-bg);  border-color: var(--olive-line); }
.vd-hold    { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-line); }
.vd-blocked { color: var(--red);    background: var(--red-bg);    border-color: var(--red-line); }
.vd-human   { color: var(--purple); background: var(--purple-bg); border-color: var(--purple-line); }

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--bg);
}
.mode-chip.live { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-chip {
  appearance: none; cursor: pointer;
  font-size: .82rem; font-weight: 600;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft);
  transition: all .12s;
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.filter-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- ① 对比演示 ---------------- */
.compare-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.case-panel { position: sticky; top: 16px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.case-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.case-item {
  appearance: none; text-align: left; cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 10px 13px;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.case-item:hover { border-color: var(--brand); background: var(--brand-weak2); }
.case-item.active {
  border-color: var(--brand);
  background: var(--brand-weak);
  box-shadow: inset 3px 0 0 var(--brand);
}
.case-item-id { font-family: var(--mono); font-size: .74rem; color: var(--brand-dark); font-weight: 700; }
.case-item-name { font-weight: 650; font-size: .92rem; margin: 2px 0; }
.case-item-brief { font-size: .8rem; color: var(--ink-soft); }

/* 单据摘要（四流分组） */
.case-summary-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.case-summary-title { font-size: 1.05rem; font-weight: 700; color: var(--brand-ink); }
.case-summary-brief { font-size: .88rem; color: var(--ink-soft); }
.flow-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.flow-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--brand-weak2), #fff 45%);
  min-width: 0;
}
.flow-title {
  font-size: .78rem; font-weight: 750; color: var(--brand-dark);
  letter-spacing: .05em; margin-bottom: 7px;
  display: flex; align-items: center; gap: 6px;
}
.flow-title::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--brand); opacity: .65; }
.flow-entity { margin-bottom: 8px; }
.flow-entity-name { font-size: .78rem; font-weight: 650; color: var(--ink-soft); }
.kv-row { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; padding: 1.5px 0; min-width: 0; }
.kv-key { color: var(--ink-faint); white-space: nowrap; }
.kv-val { font-family: var(--mono); font-size: .78rem; text-align: right; word-break: break-all; }
.missing { color: var(--ink-faint); font-style: italic; font-family: var(--mono); }
.list-sub { font-size: .78rem; color: var(--ink-soft); padding-left: 8px; border-left: 2px solid var(--line); margin: 3px 0; }

.ask-panel { padding: 14px 20px; }
.ask-row { display: flex; gap: 10px; align-items: center; }
.ask-input {
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: .97rem;
  outline: none;
}
.ask-hint { font-size: .8rem; color: var(--ink-faint); margin-top: 8px; }

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.agent-col {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.agent-bare { border-top: 4px solid var(--ink-faint); }
.agent-ontos { border-top: 4px solid var(--brand); box-shadow: var(--shadow); }
.agent-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.agent-bare .agent-head { background: #f7f8f9; }
.agent-ontos .agent-head { background: var(--brand-weak2); }
.agent-title { font-weight: 750; font-size: 1rem; }
.agent-bare .agent-title { color: var(--ink-soft); }
.agent-ontos .agent-title { color: var(--brand-dark); }
.agent-sub { font-size: .78rem; color: var(--ink-faint); margin-top: 1px; }
.agent-body { padding: 15px 18px 18px; }
.agent-answer { font-size: .95rem; white-space: pre-wrap; }
.agent-answer.flash { animation: answerFlash 1s ease; }
@keyframes answerFlash { 0% { background: var(--orange-bg); } 100% { background: transparent; } }
.agent-basis { font-size: .82rem; color: var(--ink-faint); margin-top: 10px; font-style: italic; }

.bare-history { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.bare-history-title { font-size: .78rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.bare-history-item {
  font-size: .8rem; color: var(--ink-soft);
  padding: 5px 9px; border-left: 3px solid var(--line-strong);
  margin-bottom: 5px; background: #fafbfc; border-radius: 0 7px 7px 0;
}
.bare-history-item .hi-tag { font-weight: 700; color: var(--ink-faint); margin-right: 6px; font-size: .74rem; }
.bare-history-item.changed { border-left-color: var(--orange); }
.bare-history-item.changed .hi-tag { color: var(--orange); }

.ontos-ribbon {
  position: absolute;
  top: 13px;
  right: -42px;
  transform: rotate(38deg);
  background: var(--green);
  color: #fff;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
  padding: 4px 46px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  z-index: 2;
  animation: ribbonIn .4s ease;
}
@keyframes ribbonIn { from { opacity: 0; transform: rotate(38deg) scale(1.25); } to { opacity: 1; transform: rotate(38deg) scale(1); } }

/* ---------------- 判决卡片（三层下钻） ---------------- */
.judgment-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.jc-top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 16px;
  background: linear-gradient(180deg, var(--brand-weak2), #fff);
  border-bottom: 1px solid var(--line);
}
.jc-summary { font-size: .93rem; font-weight: 600; flex: 1; min-width: 200px; }
.jc-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.jc-meta .chip { font-weight: 600; }
.jc-meta.flash .chip-brand { animation: metaFlash 1.1s ease; }
@keyframes metaFlash {
  0% { box-shadow: 0 0 0 0 rgba(15, 110, 132, .5); }
  60% { box-shadow: 0 0 0 7px rgba(15, 110, 132, 0); }
  100% { box-shadow: none; }
}
.jc-conf { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--ink-soft); }
.conf-bar { width: 74px; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.conf-fill { height: 100%; border-radius: 4px; background: var(--brand); }

.jc-section { padding: 11px 16px; }
.jc-section + .jc-section { border-top: 1px solid var(--line); }
.jc-sec-title { font-size: .8rem; font-weight: 750; color: var(--ink-soft); margin-bottom: 8px; letter-spacing: .03em; }

.vio-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vio {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.vio.act-block { border-left: 4px solid var(--red); }
.vio.act-hold  { border-left: 4px solid var(--orange); }
.vio.act-flag  { border-left: 4px solid var(--olive); }
.vio-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
}
.vio-head:hover { background: var(--brand-weak2); }
.vio-rid { font-family: var(--mono); font-weight: 750; font-size: .82rem; color: var(--brand-dark); }
.vio-name { font-weight: 650; font-size: .9rem; flex: 1; min-width: 140px; }
.vio-src { font-size: .77rem; color: var(--ink-faint); }
.vio-caret { color: var(--ink-faint); font-size: .8rem; transition: transform .18s; }
.vio.open .vio-caret { transform: rotate(180deg); }
.vio-msg { font-size: .85rem; color: var(--ink-soft); padding: 0 12px 9px 12px; }

.vio-detail { border-top: 1px dashed var(--line); background: #fafcfd; animation: detailIn .22s ease; }
@keyframes detailIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.vio-detail-inner { padding: 12px 14px; }
.detail-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.when-block {
  font-family: var(--mono);
  font-size: .84rem;
  background: var(--brand-ink);
  color: #d9eef4;
  border-radius: 9px;
  padding: 10px 13px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  margin: 6px 0 10px;
}
.detail-label { font-size: .76rem; font-weight: 750; color: var(--ink-faint); letter-spacing: .04em; margin-top: 10px; }
.detail-desc { font-size: .84rem; color: var(--ink-soft); margin-top: 4px; }

.ev-table { margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ev-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 11px; font-size: .83rem; background: #fff; }
.ev-row + .ev-row { border-top: 1px solid var(--line); }
.ev-field { font-family: var(--mono); color: var(--brand-dark); }
.ev-val { font-family: var(--mono); font-weight: 650; }

.exc-item {
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 11px; margin-top: 6px; font-size: .83rem; background: #fff;
}
.exc-item .mono { font-size: .78rem; color: var(--ink-soft); }

.src-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  border: 1px solid var(--brand);
  background: #fff; color: var(--brand-dark);
  font-size: .84rem; font-weight: 650;
  padding: 6px 14px; border-radius: 8px;
  transition: background .12s;
}
.src-btn:hover { background: var(--brand-weak); }

.waived-item {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  border: 1px solid var(--green-line);
  background: var(--green-bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .86rem;
  margin-bottom: 7px;
}
.waived-reason { color: var(--ink-soft); font-size: .82rem; flex-basis: 100%; }

.gap-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.gap-hint { font-size: .78rem; color: var(--ink-faint); margin-top: 7px; }

.trace-details summary {
  cursor: pointer; font-size: .8rem; color: var(--ink-soft); font-weight: 650;
  padding: 4px 0; user-select: none;
}
.trace-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: 6px; }
.trace-table td { padding: 4px 8px; border-top: 1px solid var(--line); }
.trace-table td:first-child { font-family: var(--mono); color: var(--brand-dark); width: 70px; }

/* ---------------- ② 本体构建 ---------------- */
.build-layout { display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; gap: 18px; align-items: start; }
.doc-panel { position: sticky; top: 16px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.doc-body { overflow-y: auto; font-size: .88rem; padding-right: 6px; }

.doc-h1 { font-size: 1.1rem; font-weight: 750; color: var(--brand-ink); margin: 14px 0 6px; }
.doc-h2 { font-size: 1rem; font-weight: 750; color: var(--brand-ink); margin: 14px 0 5px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc-h3 { font-size: .92rem; font-weight: 700; color: var(--brand-dark); margin: 11px 0 4px; }
.doc-h4 { font-size: .88rem; font-weight: 700; margin: 9px 0 3px; }
.doc-p { margin: 3px 0; color: var(--ink); }
.doc-li { margin: 2px 0 2px 16px; position: relative; padding-left: 12px; }
.doc-li::before { content: "·"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.doc-quote { border-left: 3px solid var(--brand-weak); padding-left: 10px; color: var(--ink-soft); margin: 4px 0; }
.doc-tline { font-family: var(--mono); font-size: .78rem; white-space: pre; overflow-x: auto; color: var(--ink-soft); }
.doc-hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.doc-hit { background: #fff6d8; box-shadow: inset 3px 0 0 var(--orange); border-radius: 0 6px 6px 0; }
.doc-hit-first { animation: hitFlash 1.6s ease; }
@keyframes hitFlash { 0%, 30% { background: #ffe9a8; } 100% { background: #fff6d8; } }

.extract-steps { display: flex; flex-direction: column; gap: 13px; }
.ex-step { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; opacity: .45; transition: opacity .3s; }
.ex-step.on { opacity: 1; }
.ex-step-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: var(--brand-weak2);
  border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: .93rem; color: var(--brand-ink);
}
.ex-step-no {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 750; flex: none;
}
.ex-step.done .ex-step-no { background: var(--green); }
.ex-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--brand-weak); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
  margin-left: auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ex-step-count { margin-left: auto; font-size: .78rem; color: var(--ink-faint); }
.ex-items { padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.ex-item {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  font-size: .86rem;
  padding: 4px 8px;
  border-radius: 7px;
  background: #fbfcfd;
  animation: itemIn .4s ease both;
}
@keyframes itemIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.ex-item .mono { font-size: .78rem; color: var(--brand-dark); font-weight: 700; }
.ex-item-src { font-size: .75rem; color: var(--ink-faint); margin-left: auto; }

.extract-confirm { text-align: center; padding: 18px 0 6px; }
.confirm-note { font-size: .9rem; color: var(--ink-soft); margin-bottom: 12px; }
#btn-confirm { animation: confirmPulse 1.8s ease-in-out infinite; }
@keyframes confirmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 138, 76, .35); }
  50%      { box-shadow: 0 0 0 9px rgba(30, 138, 76, 0); }
}

.graph-wrap { width: 100%; }
.graph-wrap svg { width: 100%; height: auto; display: block; }
.g-node { cursor: pointer; }
.g-node circle { fill: #fff; stroke: var(--brand); stroke-width: 1.8; transition: all .15s; }
.g-node.center circle { fill: var(--brand); }
.g-node text { font-size: 15px; font-weight: 650; fill: var(--brand-ink); text-anchor: middle; pointer-events: none; }
.g-node.center text { fill: #fff; }
.g-node .g-id { font-family: var(--mono); font-size: 10px; font-weight: 400; fill: var(--ink-faint); }
.g-node.center .g-id { fill: #bfe0ea; }
.g-edge path { stroke: #9fb4bd; stroke-width: 1.5; fill: none; transition: all .15s; }
.g-elabel {
  font-size: 12px; fill: var(--ink-soft);
  text-anchor: middle;
  paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round;
  transition: all .15s;
}
.graph-focus .g-edge:not(.hl) path { stroke: var(--line); opacity: .35; }
.graph-focus .g-edge:not(.hl) .g-elabel { opacity: .25; }
.graph-focus .g-node:not(.hl):not(.hover) circle { opacity: .35; }
.graph-focus .g-node:not(.hl):not(.hover) text { opacity: .35; }
.g-edge.hl path { stroke: var(--brand); stroke-width: 2.4; }
.g-edge.hl .g-elabel { fill: var(--brand-dark); font-weight: 700; }
.g-node.hover circle { stroke-width: 3; filter: drop-shadow(0 2px 6px rgba(15, 110, 132, .35)); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.data-table th {
  text-align: left; font-size: .76rem; letter-spacing: .05em;
  color: var(--ink-faint); font-weight: 750;
  padding: 7px 10px; border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tbody tr { transition: background .1s; }
.data-table.clickable tbody tr { cursor: pointer; }
.data-table.clickable tbody tr:hover { background: var(--brand-weak2); }
.rule-detail-row td { background: #fafcfd; padding: 12px 16px; }
.delivery-table td { font-size: .9rem; }

/* ---------------- ③ 运行与进化 ---------------- */
.audit-row { display: flex; gap: 10px; margin-bottom: 14px; }
.audit-row .select { min-width: 340px; }

.gap-callout {
  margin-top: 14px;
  border: 1.5px solid var(--purple-line);
  background: var(--purple-bg);
  border-radius: 12px;
  padding: 13px 16px;
  animation: viewIn .3s ease;
}
.gap-callout-head { font-weight: 750; color: var(--purple); font-size: .95rem; }
.gap-callout-sub { font-size: .82rem; color: var(--ink-soft); margin: 3px 0 9px; }
.gap-callout textarea {
  width: 100%; border: 1px solid var(--purple-line); border-radius: 9px;
  padding: 8px 11px; font-size: .88rem; resize: vertical; outline: none;
}
.gap-callout-actions { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.gap-reported { font-size: .84rem; color: var(--green); font-weight: 650; }

.draft-banner {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #bcdce6;
  background: var(--brand-weak);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: .88rem;
  color: var(--brand-ink);
  font-weight: 600;
}
.draft-banner .btn { margin-left: auto; }
.draft-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); animation: livePulse 1.6s infinite; }

.evo-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 22px; align-items: start; }

.param-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 9px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.param-info { min-width: 0; }
.param-name { font-weight: 650; font-size: .89rem; }
.param-id { font-family: var(--mono); font-size: .74rem; color: var(--ink-faint); }
.param-input { width: 130px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 9px; font-size: .88rem; font-family: var(--mono); }
.param-unit { font-size: .78rem; color: var(--ink-faint); margin-left: 4px; }
.param-row.dirty .param-input { border-color: var(--orange); background: var(--orange-bg); }

.rule-editor { border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: #fbfcfd; }
.rule-editor .select { width: 100%; }
.editor-row { display: flex; gap: 20px; align-items: center; }
.editor-enabled { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }
.rule-editor .btn { margin-top: 13px; }
.expr-error {
  margin-top: 6px; font-size: .82rem; color: var(--red);
  background: var(--red-bg); border: 1px solid var(--red-line);
  border-radius: 8px; padding: 7px 11px;
  font-family: var(--mono);
}

.eval-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.eval-head-actions { display: flex; align-items: center; gap: 12px; }
.eval-progress { font-size: .85rem; color: var(--ink-soft); font-weight: 650; font-variant-numeric: tabular-nums; }
.eval-cells-wrap { min-height: 60px; }
.eval-cells {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 7px;
}
.eval-cells .empty-state { grid-column: 1 / -1; }
.cell {
  appearance: none; border: none; cursor: default;
  aspect-ratio: 1; border-radius: 7px;
  background: var(--line);
  transition: transform .1s;
  position: relative;
}
.cell.pass { background: var(--green); animation: cellIn .28s ease; }
.cell.fail { background: var(--red); cursor: pointer; animation: cellIn .28s ease; }
.cell.fail:hover { transform: scale(1.18); box-shadow: 0 3px 8px rgba(191, 48, 40, .4); z-index: 1; }
.cell.pass:hover { transform: scale(1.12); cursor: pointer; }
@keyframes cellIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.eval-summary { margin-top: 12px; font-size: .92rem; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eval-summary .ok { color: var(--green); }
.eval-summary .bad { color: var(--red); }

/* 发布按钮：locked（灰+锁）→ armed（绿+脉冲） */
.publish-row { display: flex; gap: 10px; margin-top: 14px; }
.publish-row .text-input { flex: 1; }
.btn-publish { min-width: 165px; justify-content: center; }
.btn-publish .lock-icon { width: 14px; height: 14px; fill: currentColor; }
.btn-publish.locked {
  background: #eef1f3; border-color: var(--line-strong); color: var(--ink-faint);
}
.btn-publish.locked:hover { background: #e4e9ec; }
.btn-publish.armed {
  background: var(--green); border-color: var(--green); color: #fff;
  animation: armedPulse 1.6s ease-in-out infinite;
}
.btn-publish.armed .lock-icon { display: none; }
@keyframes armedPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 138, 76, .4); }
  50%      { box-shadow: 0 0 0 8px rgba(30, 138, 76, 0); }
}
.publish-hint { font-size: .79rem; color: var(--ink-faint); margin-top: 7px; }

/* 发布被拦截 / 成功的大横幅（路演画面） */
.publish-blocked {
  margin-top: 14px;
  border: 1.5px solid var(--red-line);
  border-left: 6px solid var(--red);
  background: linear-gradient(180deg, #fdf1f0, var(--red-bg));
  border-radius: 12px;
  padding: 16px 20px;
  animation: bannerIn .35s cubic-bezier(.2, 1.1, .4, 1);
}
.publish-blocked .pb-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.16rem; font-weight: 800; color: var(--red);
}
.pb-icon { width: 26px; height: 26px; fill: var(--red); flex: none; }
.publish-blocked .pb-msg { margin-top: 7px; font-size: .9rem; color: var(--ink); }
.publish-blocked .pb-note { margin-top: 8px; font-size: .82rem; color: var(--ink-soft); }
@keyframes bannerIn {
  0% { opacity: 0; transform: translateY(-8px) scale(.98); }
  60% { transform: translateY(2px) scale(1.005); }
  100% { opacity: 1; transform: none; }
}

.publish-success {
  margin-top: 14px;
  border: 1.5px solid var(--green-line);
  border-left: 6px solid var(--green);
  background: linear-gradient(180deg, #eefaf2, var(--green-bg));
  border-radius: 12px;
  padding: 16px 20px;
  animation: bannerIn .35s cubic-bezier(.2, 1.1, .4, 1);
}
.publish-success .pb-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.12rem; font-weight: 800; color: var(--green);
}
.publish-success .pb-icon { fill: var(--green); }
.publish-success .pb-msg { margin-top: 6px; font-size: .9rem; color: var(--ink); }
.publish-success .pb-actions { margin-top: 11px; display: flex; gap: 10px; }

/* 新旧判决对比 */
.rejudge-grid { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 10px; align-items: start; }
.rejudge-arrow { text-align: center; font-size: 1.5rem; color: var(--brand); align-self: center; font-weight: 700; }
.rejudge-col-title { font-size: .84rem; font-weight: 750; color: var(--ink-soft); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.jc-compact { border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: #fbfcfd; }
.jc-compact .verdict-badge { font-size: .92rem; padding: 4px 13px; }
.jc-compact-summary { font-size: .86rem; margin: 8px 0; }
.jc-compact-rules { display: flex; gap: 6px; flex-wrap: wrap; }
.rejudge-delta {
  margin-top: 12px; font-size: .9rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--brand-weak2); padding: 10px 14px;
}
.rejudge-delta strong { color: var(--brand-dark); }

.evolve-bottom { display: grid; grid-template-columns: 5fr 7fr; gap: 18px; align-items: start; }

/* 版本时间线 */
.vtimeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.vt-item { position: relative; padding: 0 0 18px 26px; }
.vt-item::before {
  content: ""; position: absolute; left: 6px; top: 18px; bottom: -2px;
  width: 2px; background: var(--line);
}
.vt-item:last-child::before { display: none; }
.vt-dot {
  position: absolute; left: 0; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--line-strong);
}
.vt-item.active .vt-dot { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-weak); }
.vt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vt-version { font-family: var(--mono); font-weight: 750; font-size: .95rem; color: var(--brand-ink); }
.vt-time { font-size: .78rem; color: var(--ink-faint); }
.vt-item .btn { margin-left: auto; }

/* 日志表 */
#logs-table-wrap { max-height: 300px; overflow-y: auto; }
.log-summary { font-size: .78rem; color: var(--ink-faint); }

/* 缺口卡 */
.gap-card {
  border: 1px solid var(--purple-line);
  border-left: 4px solid var(--purple);
  border-radius: 11px;
  padding: 11px 14px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #faf8fd, #fff);
  animation: viewIn .3s ease;
}
.gap-card-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.gap-id { font-family: var(--mono); font-weight: 750; font-size: .8rem; color: var(--purple); }
.gap-time { font-size: .76rem; color: var(--ink-faint); margin-left: auto; }
.gap-line { font-size: .85rem; margin-top: 5px; }
.gap-line .lbl { color: var(--ink-faint); font-size: .78rem; margin-right: 6px; }
.gap-suggestion {
  margin-top: 8px; font-size: .84rem; color: var(--ink);
  background: var(--purple-bg); border-radius: 8px; padding: 8px 11px;
}
.gap-suggestion::before { content: "Supervisor 建议 · "; font-weight: 750; color: var(--purple); font-size: .78rem; }

/* ---------------- ④ 交付映射 ---------------- */
.price-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.price-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--brand-weak2), #fff 55%);
  position: relative;
}
.price-card-hero { border: 1.5px solid var(--brand); box-shadow: var(--shadow); }
.price-tag {
  position: absolute; top: 14px; right: 16px;
  font-size: .72rem; font-weight: 750; letter-spacing: .05em;
  color: var(--brand-dark); background: var(--brand-weak);
  padding: 3px 10px; border-radius: 999px;
}
.price-title { font-size: 1rem; font-weight: 750; color: var(--brand-ink); }
.price-num { font-size: 1.7rem; font-weight: 800; color: var(--brand); margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.price-num span { font-size: .85rem; font-weight: 650; color: var(--ink-soft); }
.price-desc { font-size: .85rem; color: var(--ink-soft); }

.boundary-panel { border-left: 5px solid var(--orange); }
.boundary-list { list-style: none; margin: 0; padding: 0; }
.boundary-list li {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.boundary-name { font-weight: 700; font-size: .94rem; }
.boundary-name::before { content: "✕ "; color: var(--orange); font-weight: 800; }
.boundary-why { font-size: .84rem; color: var(--ink-soft); }
.boundary-note {
  margin-top: 13px; font-size: .9rem; color: var(--brand-ink);
  background: var(--brand-weak2); border-radius: 10px; padding: 10px 14px;
  border: 1px solid var(--line);
}

/* ---------------- 抽屉（制度原文，第三层下钻） ---------------- */
.drawer-mask, .modal-mask {
  position: fixed; inset: 0;
  background: rgba(18, 34, 42, .38);
  z-index: 40;
  animation: maskIn .2s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(620px, 46vw);
  background: var(--card);
  z-index: 41;
  box-shadow: -8px 0 30px rgba(15, 35, 45, .18);
  display: flex; flex-direction: column;
  animation: drawerIn .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes drawerIn { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--brand-weak2);
}
.drawer-head h3 { font-size: 1rem; color: var(--brand-ink); }
.drawer-note {
  padding: 8px 20px;
  font-size: .84rem;
  background: #fff6d8;
  color: #7a5b00;
  border-bottom: 1px solid #f0e2ad;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px 30px; font-size: .89rem; }

/* ---------------- 弹窗 ---------------- */
.modal-mask { display: flex; align-items: center; justify-content: center; }
.modal {
  width: min(680px, 90vw);
  max-height: 84vh;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(15, 35, 45, .3);
  display: flex; flex-direction: column;
  animation: modalIn .22s cubic-bezier(.2, 1.1, .4, 1);
}
@keyframes modalIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 1rem; color: var(--brand-ink); }
.modal-body { padding: 16px 20px 22px; overflow-y: auto; }

.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.diff-box { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.diff-box-title { font-size: .78rem; font-weight: 750; color: var(--ink-faint); margin-bottom: 7px; letter-spacing: .04em; }
.diff-text {
  font-size: .87rem; background: var(--red-bg);
  border: 1px solid var(--red-line); border-radius: 9px;
  padding: 9px 12px; color: var(--ink); margin-top: 8px;
}

/* ---------------- toast ---------------- */
.toasts {
  position: fixed; right: 22px; bottom: 22px;
  display: flex; flex-direction: column; gap: 9px;
  z-index: 60;
}
.toast {
  min-width: 260px; max-width: 430px;
  padding: 11px 15px;
  border-radius: 10px;
  background: #223038;
  color: #fff;
  font-size: .88rem;
  box-shadow: 0 8px 26px rgba(15, 35, 45, .3);
  display: flex; align-items: baseline; gap: 9px;
  animation: toastIn .25s cubic-bezier(.2, 1.1, .4, 1);
}
.toast::before { content: "●"; font-size: .7rem; position: relative; top: -1px; }
.toast-error { background: #7e211b; }
.toast-error::before { color: #ffb4ad; }
.toast-success { background: #14532d; }
.toast-success::before { color: #86efac; }
.toast-info { background: var(--brand-ink); }
.toast-info::before { color: #7fd0e4; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------------- 响应式（1280–1920 投影） ---------------- */
@media (max-width: 1440px) {
  .flow-grid { grid-template-columns: repeat(3, 1fr); }
  .price-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1330px) {
  .compare-layout { grid-template-columns: 260px 1fr; }
  .evo-grid, .evolve-bottom { grid-template-columns: 1fr; }
  .build-layout { grid-template-columns: minmax(340px, 4fr) 6fr; }
}

/* ==========================================================================
   v0.2 工作台改版 —— 壳层布局 / 角色切换 / 队列 / 统计 / 单据详情
   ========================================================================== */

[hidden] { display: none !important; }

/* ---- 壳层：左侧窄导航 + 主区 ---- */
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.main { padding: 22px 26px 48px; min-width: 0; }
.main.role-fade { animation: viewIn .28s ease; }

.sidenav { border-right: 1px solid var(--line); background: #fbfcfd; padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer; font-size: .9rem; color: var(--ink-soft, #4a5a62); text-align: left; width: 100%; transition: background .15s, color .15s; }
.side-item:hover { background: #eef3f5; color: var(--brand-ink); }
.side-item.active { background: #e3eef1; border-color: #cfe0e6; color: var(--brand-ink); font-weight: 650; }
.side-ico { width: 20px; text-align: center; flex: none; opacity: .85; }

/* ---- 顶栏右侧：徽章 + 角色切换器 ---- */
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-badges { display: flex; align-items: center; gap: 10px; }

.role-switch { position: relative; }
.role-switch-btn { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.role-switch-btn:hover { border-color: #b9ccd3; box-shadow: 0 2px 8px rgba(15,110,132,.08); }
.role-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--brand); font-size: .95rem; flex: none; }
.role-avatar.sm { width: 26px; height: 26px; font-size: .8rem; }
.av-submitter  { background: #0f6e84; }
.av-reviewer   { background: #7c5cb8; }
.av-manager    { background: #b26a1b; }
.av-consultant { background: #2c7a4b; }
.role-id-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.role-name { font-size: .88rem; font-weight: 650; color: var(--ink); }
.role-title { font-size: .72rem; color: var(--ink-faint); }
.role-caret { color: var(--ink-faint); font-size: .7rem; margin-left: 2px; }

.role-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 32px rgba(20,40,50,.14); padding: 6px; min-width: 240px; z-index: 60; }
.role-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; background: none; border-radius: 9px; cursor: pointer; text-align: left; }
.role-opt:hover { background: #f0f5f7; }
.role-opt.active { background: #e3eef1; }
.role-opt-main { display: flex; flex-direction: column; line-height: 1.2; }
.role-opt-name { font-size: .88rem; font-weight: 650; color: var(--ink); }
.role-opt-title { font-size: .74rem; color: var(--ink-faint); }

.panel-head .head-actions { display: flex; align-items: center; gap: 10px; }

/* ---- 财务经理 · 运行概览 ---- */
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(20,40,50,.04); }
.stat-label { font-size: .8rem; color: var(--ink-faint); }
.stat-num { font-size: 1.9rem; font-weight: 750; color: var(--brand-ink); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .76rem; color: var(--ink-faint); }
.stat-card.stat-red .stat-num { color: var(--red); }
.stat-card.stat-purple .stat-num { color: var(--purple, #7c5cb8); }
.overview-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 18px; align-items: start; }

.tr-row { display: grid; grid-template-columns: 52px minmax(0,1fr) minmax(120px, 38%) 40px; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-soft, #eef2f4); font-size: .86rem; }
.tr-row:last-child { border-bottom: none; }
.tr-id { color: var(--brand-ink); font-weight: 650; }
.tr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-bar { height: 8px; border-radius: 5px; background: #eef2f4; overflow: hidden; }
.tr-bar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand), #3c94a8); }
.tr-count { text-align: right; color: var(--ink-soft, #4a5a62); }

/* ---- 审核专员 · 队列布局 ---- */
.review-layout { display: grid; grid-template-columns: minmax(320px, 5fr) 8fr; gap: 18px; align-items: start; }
.queue-panel { position: sticky; top: 14px; }
.queue-scroll { max-height: calc(100vh - 210px); overflow-y: auto; padding-right: 2px; }
.q-group { margin-bottom: 6px; }
.q-group-title { display: flex; align-items: center; gap: 8px; font-size: .76rem; font-weight: 700; color: var(--ink-faint); letter-spacing: .04em; padding: 10px 4px 6px; }
.q-count { background: #eef2f4; border-radius: 999px; padding: 1px 8px; font-size: .72rem; color: var(--ink-soft, #4a5a62); }
.q-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 11px; background: none; cursor: pointer; text-align: left; transition: background .12s, border-color .12s; }
.q-row:hover { background: #f2f6f8; }
.q-row.active { background: #e9f2f5; border-color: #cfe0e6; }
.q-main { min-width: 0; flex: 1; }
.q-title { font-size: .88rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sub { font-size: .74rem; color: var(--ink-faint); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.q-amt { font-size: .82rem; color: var(--brand-ink); font-weight: 650; flex: none; }
.review-detail-panel { min-height: 420px; }

/* ---- 经办人 · 我的申请表格 / 新建申请 ---- */
.wb-table td { vertical-align: middle; }
.wb-row { cursor: pointer; }
.wb-row:hover td { background: #f4f8f9; }
.wb-row.row-new td { animation: rowNew 1.6s ease; }
@keyframes rowNew { 0% { background: #d9efe2; } 100% { background: transparent; } }
.wb-amt-cell { text-align: right; font-weight: 650; color: var(--brand-ink); }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tpl-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; cursor: pointer; background: #fff; transition: border-color .13s, box-shadow .13s; }
.tpl-card:hover { border-color: #b9ccd3; box-shadow: 0 2px 10px rgba(15,110,132,.07); }
.tpl-card.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15,110,132,.16); background: #f5fafb; }
.tpl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tpl-name { font-weight: 650; font-size: .9rem; color: var(--ink); }
.tpl-amt { color: var(--brand-ink); font-weight: 650; font-size: .86rem; white-space: nowrap; }
.tpl-meta { font-size: .74rem; color: var(--ink-faint); margin: 4px 0 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-brief { font-size: .8rem; color: var(--ink-soft, #4a5a62); line-height: 1.5; }

.submit-bar { border-top: 1px dashed var(--line); padding-top: 14px; }
.submit-row { display: flex; gap: 10px; margin-top: 6px; }
.submit-row .text-input { flex: 1; }

/* ---- 单据详情（抽屉 & 审核详情共用） ---- */
.drawer-wb { width: min(680px, 92vw); }
.wb-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.wb-detail-title { font-size: 1.02rem; font-weight: 700; color: var(--ink); }
.wb-detail-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-faint); margin-bottom: 12px; }
.wb-sec-title { font-size: .8rem; font-weight: 700; color: var(--ink-faint); letter-spacing: .05em; margin: 16px 0 8px; }
.wb-ctx { margin-bottom: 4px; }
.wb-flow .flow-card { background: #fbfcfd; }
.wb-judgment { margin-top: 4px; }
.wb-title { font-weight: 650; }
.wb-sub { font-size: .76rem; color: var(--ink-faint); }
.wb-amt { color: var(--brand-ink); font-weight: 650; }

.wb-actions { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 14px; }
.wb-comment { width: 100%; margin: 8px 0 10px; }
.wb-action-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.wb-actor { font-size: .76rem; color: var(--ink-faint); margin-top: 8px; }

.wb-history { margin-top: 4px; }
.wbh-item { display: flex; flex-direction: column; gap: 3px; padding: 9px 0; border-bottom: 1px solid var(--line-soft, #eef2f4); }
.wbh-item:last-child { border-bottom: none; }
.wbh-main { display: flex; align-items: center; gap: 10px; font-size: .84rem; flex-wrap: wrap; }
.wbh-comment { font-size: .82rem; color: var(--ink-soft, #4a5a62); background: #f7f9fa; border-radius: 8px; padding: 7px 10px; }

/* ---- 顾问 · 实验室 / 资产页容器 ---- */
.lab-note { border: 1px solid #d8e6ea; background: #f2f8fa; color: var(--brand-ink); border-radius: 12px; padding: 12px 16px; font-size: .86rem; line-height: 1.6; margin-bottom: 16px; }
.compare-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.build-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---- Supervisor 缺口上报（审核详情内嵌） ---- */
.gap-expected-input { width: 100%; margin: 8px 0 10px; }
.gap-reported-tag { font-size: .78rem; color: var(--green, #1d7a46); font-weight: 650; }
.pb-msg { font-size: .86rem; }
.pb-note { font-size: .78rem; color: var(--ink-faint); margin-top: 4px; }
.pb-actions { margin-top: 10px; display: flex; gap: 10px; }
.param-apply { flex: none; }
.btn-danger-ghost { background: none; border: 1px solid #e5b8b8; color: var(--red); }
.btn-danger-ghost:hover { background: #fdf3f3; }

/* ---- 响应式 ---- */
@media (max-width: 1380px) {
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .review-layout { grid-template-columns: minmax(300px, 4fr) 7fr; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 176px minmax(0, 1fr); }
  .review-layout { grid-template-columns: 1fr; }
  .queue-panel { position: static; }
}

/* 四流卡自适应换行：窄容器下不再逐字竖排 */
.flow-grid { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.flow-card { min-width: 0; }
.kv-val { overflow-wrap: anywhere; }

/* ---- API 凭证输入（docs/11c 落地步 2：角色菜单底部的管理 key 设置区） ---- */
.role-menu-keybox {
  border-top: 1px solid var(--line, #e4e9ee);
  margin-top: 6px;
  padding: 10px 12px 8px;
}
.keybox-label {
  display: block;
  font-size: 12px;
  color: var(--ink-3, #7a8794);
  margin-bottom: 6px;
}
.keybox-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line, #d8dfe6);
  border-radius: 8px;
  background: #fff;
}
.keybox-input:focus { outline: 2px solid rgba(15, 110, 132, .25); border-color: #0f6e84; }
.keybox-hint {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3, #93a0ac);
}
