/* ============================================================
   格局 · 生命教育学员名册
   美学方向：Editorial / magazine（编辑设计 · 杂志排版）
   色板：暖调矿物色 —— 铁锈红 / 松绿 / 赭黄 / 石板青 / 棕土
   字体：Playfair Display（标题）· Archivo（正文）· IBM Plex Mono（数据）
   无 purple / violet / indigo / fuchsia，无蓝紫渐变
   无 Inter / Roboto / Arial / Helvetica / system-ui / -apple-system
   ============================================================ */

:root {
  /* 纸张与墨 */
  --paper:      #F4F0E6;
  --paper-2:    #EFEADC;   /* 次级底 */
  --sheet:      #FBF9F3;   /* 内容块底色 */
  --ink:        #17150F;
  --ink-2:      #4A4437;
  --ink-3:      #857C69;
  --ink-4:      #B3AB97;

  /* 矿物强调色 */
  --rust:       #B0432A;
  --rust-deep:  #8A3320;
  --rust-wash:  #F2E1D9;
  --pine:       #2C6851;
  --pine-wash:  #DCE8E0;
  --ochre:      #BC8324;
  --ochre-wash: #F3E7CE;
  --slate:      #33606F;
  --slate-wash: #DCE6E9;
  --umber:      #77502D;
  --umber-wash: #EBE0D3;

  /* 模块语义色（JS 中以 var(--m1/--m2/--m3/--coach) 引用） */
  --m1:    var(--slate);
  --m2:    var(--pine);
  --m3:    var(--ochre);
  --coach: var(--umber);

  /* 兼容既有 JS 中的变量名 */
  --brand:      var(--rust);
  --brand-soft: var(--rust-wash);
  --ok:         var(--pine);
  --warn:       var(--ochre);
  --danger:     #A32B22;
  --line:       #D8D1BF;   /* 发丝线 */
  --line-soft:  #E6E0D0;

  /* 字体 */
  --f-display: 'Playfair Display', 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --f-body:    'Archivo', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --f-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --rail: 196px;
  --spine: 30px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

/* 纸张颗粒叠层：印刷质感，不拦截交互 */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

.app { display: flex; min-height: 100vh; }

/* ============================================================
   书脊（装订线）：纵向刊名
   ============================================================ */
.spine {
  width: var(--spine); flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 16px 0 12px;
  position: sticky; top: 0; height: 100vh;
}
.spine-text {
  writing-mode: vertical-rl;
  font-family: var(--f-mono);
  font-size: 9px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 18px;
}
.spine-mark {
  font-family: var(--f-display);
  font-size: 17px; font-weight: 700;
  color: var(--rust);
  writing-mode: horizontal-tb;
}

/* ============================================================
   索引式导航
   ============================================================ */
.index-col {
  width: var(--rail); flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 26px 0 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  background: var(--paper-2);
}
.masthead-brand { padding: 0 18px 20px; border-bottom: 2px solid var(--ink); margin: 0 0 4px; }
.mb-name {
  font-family: var(--f-display); font-size: 30px; font-weight: 900;
  letter-spacing: .01em; line-height: 1; color: var(--ink);
}
.mb-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 7px; letter-spacing: .02em; }
.mb-vol {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--rust); margin-top: 9px;
}

.nav { display: flex; flex-direction: column; flex: 1; padding-top: 8px; }
.nav-item {
  display: grid;
  grid-template-columns: 24px 17px 1fr;
  align-items: center; gap: 9px;
  padding: 11px 18px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--f-body); font-size: 13.5px; color: var(--ink-2);
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  transition: color .16s, background .16s;
  position: relative;
}
.nav-item:first-child { border-top: 1px solid var(--line-soft); }
.nav-num {
  font-family: var(--f-mono); font-size: 10px; color: var(--ink-4);
  letter-spacing: .06em; transition: color .16s;
}
.nav-ico { width: 17px; height: 17px; color: var(--ink-3); transition: color .16s; }
.nav-label { letter-spacing: .01em; }
.nav-item:hover { background: var(--sheet); color: var(--ink); }
.nav-item:hover .nav-ico { color: var(--rust); }
/* 选中态：左侧粗竖条 + 墨色加重，不用圆角胶囊 */
.nav-item.active { color: var(--ink); font-weight: 600; background: var(--sheet); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rust);
}
.nav-item.active .nav-num { color: var(--rust); }
.nav-item.active .nav-ico { color: var(--rust); }

.index-foot { padding: 14px 18px 0; display: flex; flex-direction: column; gap: 7px; }
.foot-rule { height: 1px; background: var(--line); margin-bottom: 6px; }

/* ============================================================
   主区
   ============================================================ */
.main { flex: 1; min-width: 0; padding: 30px 34px 60px; }

/* 报头式页头：元信息压左窄栏，大号衬线标题，发丝线贯穿 */
.masthead {
  display: grid;
  grid-template-columns: 78px auto 1fr auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.mh-meta { display: flex; flex-direction: column; gap: 6px; padding-bottom: 5px; }
.mh-num {
  font-family: var(--f-display); font-size: 34px; font-weight: 700;
  line-height: 1; color: var(--rust);
}
.mh-kicker {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-3);
}
.mh-title {
  font-family: var(--f-display); font-size: 40px; font-weight: 700;
  line-height: .95; letter-spacing: -.01em; color: var(--ink);
  white-space: nowrap;
}
.mh-rule { height: 1px; background: var(--line); margin-bottom: 13px; }
.mh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 6px; }

/* ============================================================
   统计：主视觉块 + 错落小指标
   ============================================================ */
.stat-band {
  display: grid; grid-template-columns: minmax(230px, 1.05fr) 2.6fr;
  gap: 0; margin-bottom: 26px;
  border: 1px solid var(--line); background: var(--sheet);
}
.stat-hero {
  padding: 24px 26px 22px;
  border-right: 1px solid var(--line);
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 148px;
}
.stat-hero .sh-kicker {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-4);
}
.stat-hero .sh-num {
  font-family: var(--f-display); font-size: 62px; font-weight: 900;
  /* 行高略大于 1，给数字留出下伸部空间，避免与下方标签挤在一起 */
  line-height: 1.04; color: var(--paper);
  margin: 16px 0 10px;
}
.stat-hero .sh-num em {
  font-style: normal; font-size: 26px; color: var(--ink-4);
  margin-left: 9px; letter-spacing: .01em;
}
.stat-hero .sh-lbl { font-size: 13px; line-height: 1.6; color: #D9D2C0; }
.stat-hero .sh-foot {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--ochre);
  letter-spacing: .04em; line-height: 1.6; margin-top: 16px;
}

.stat-rest { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
.stat-cell {
  padding: 18px 18px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
  position: relative;
}
.stat-cell:nth-child(even) { background: var(--paper-2); }   /* 交替底色，避免均质 */
.stat-cell .sc-num {
  font-family: var(--f-display); font-size: 27px; font-weight: 700;
  line-height: 1.2; color: var(--ink);
}
.stat-cell .sc-num.mono { font-family: var(--f-mono); font-size: 21px; font-weight: 600; }
.stat-cell .sc-lbl { font-size: 11.5px; line-height: 1.55; color: var(--ink-2); margin-top: 8px; }
.stat-cell .sc-sub { font-family: var(--f-mono); font-size: 10px; line-height: 1.5; color: var(--ink-3); margin-top: 5px; }
.stat-cell.accent .sc-num { color: var(--rust); }

/* 独立使用的指标带（谱系页 / 缴费页） */
.stat-rest.tight {
  border: 1px solid var(--line); border-bottom: none; margin-bottom: 26px; background: var(--sheet);
}
.stat-rest.tight .stat-cell:last-child { border-right: none; }

/* ============================================================
   面板（非对称栅格）
   ============================================================ */
.grid-asym { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; margin-bottom: 22px; }
.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.grid-asym.flip .col-5 { order: -1; }

.panel {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 20px 22px 22px;
  margin-bottom: 22px;
  min-width: 0;
}
.grid-asym .panel { margin-bottom: 0; }
.panel.bleed { padding: 0; }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-family: var(--f-display); font-size: 18px; font-weight: 700; letter-spacing: 0;
}
.panel-tag {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}

/* ============================================================
   模块进度分布
   ============================================================ */
.mod-dist { display: flex; flex-direction: column; }
.mod-dist-item { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.mod-dist-item:last-child { border-bottom: none; padding-bottom: 0; }
.mod-dist-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; gap: 10px; }
.mod-dist-head .t { font-family: var(--f-display); font-size: 15px; font-weight: 700; }
.mod-dist-head .t::before {
  content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 8px;
  vertical-align: 1px;
}
.mod-dist-item.m-MODULE_1 .t::before { background: var(--m1); }
.mod-dist-item.m-MODULE_2 .t::before { background: var(--m2); }
.mod-dist-item.m-MODULE_3 .t::before { background: var(--m3); }
.mod-dist-head .n { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 11px; padding: 3px 9px; background: var(--paper-2);
  color: var(--ink-2); border: 1px solid var(--line);
}
.chip b { font-family: var(--f-mono); font-weight: 600; margin-left: 4px; }
.chip.on-m1 { border-color: var(--m1); color: var(--m1); background: var(--slate-wash); }
.chip.on-m2 { border-color: var(--m2); color: var(--m2); background: var(--pine-wash); }
.chip.on-m3 { border-color: var(--m3); color: var(--ochre); background: var(--ochre-wash); }

/* ============================================================
   漏斗（阶梯栏线式，非居中条形）
   ============================================================ */
.funnel { display: flex; flex-direction: column; }
.funnel-row {
  display: grid; grid-template-columns: 92px 1fr 62px;
  align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dotted var(--line);
}
.funnel-row:last-child { border-bottom: none; }
.funnel-row .name { font-size: 11.5px; color: var(--ink-2); text-align: right; }
.funnel-track { position: relative; height: 24px; display: flex; align-items: center; }
.funnel-bar {
  height: 24px; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; padding: 0 9px;
  font-family: var(--f-mono); font-size: 11.5px; font-weight: 600;
  min-width: 34px; transition: width .5s cubic-bezier(.2,.7,.3,1);
}
.funnel-row:nth-child(1) .funnel-bar { background: var(--rust); }
.funnel-row:nth-child(2) .funnel-bar,
.funnel-row:nth-child(3) .funnel-bar,
.funnel-row:nth-child(4) .funnel-bar,
.funnel-row:nth-child(5) .funnel-bar { background: var(--slate); }
.funnel-row:nth-child(6) .funnel-bar,
.funnel-row:nth-child(7) .funnel-bar,
.funnel-row:nth-child(8) .funnel-bar { background: var(--pine); }
.funnel-rate { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); text-align: right; }

/* ============================================================
   横条（教练分布 / 容量）
   ============================================================ */
.bars { display: flex; flex-direction: column; }
.bar-row {
  display: grid; grid-template-columns: 84px 1fr 32px;
  align-items: center; gap: 11px; padding: 7px 0;
  border-bottom: 1px dotted var(--line);
}
.bar-row:last-child { border-bottom: none; }
.bar-row .name { font-size: 11.5px; color: var(--ink-2); }
.bar-row .track { background: var(--paper-2); height: 14px; border: 1px solid var(--line-soft); }
.bar-row .fill { height: 100%; background: var(--umber); transition: width .5s; }
.bar-row .val { font-family: var(--f-mono); font-size: 11.5px; text-align: right; font-weight: 600; }

/* 缴费统计定义列表 */
.ledger { display: flex; flex-direction: column; }
.ledger-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0; border-bottom: 1px dotted var(--line);
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row dt { font-size: 12px; color: var(--ink-2); }
.ledger-row dd { font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.ledger-row.major dd { font-size: 19px; color: var(--rust); }
.ledger-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 26px; }
.ledger-split > div:first-child { border-right: 1px solid var(--line); padding-right: 24px; }

/* 容量总览 */
.cap-group { margin-bottom: 15px; }
.cap-group:last-child { margin-bottom: 0; }
.cap-group-title {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.cap-line {
  display: grid; grid-template-columns: 1fr 96px 52px;
  align-items: center; gap: 12px; padding: 5px 0; font-size: 12px;
}
.cap-line .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.cap-line .ct { background: var(--paper-2); height: 8px; border: 1px solid var(--line-soft); }
.cap-line .cv { font-family: var(--f-mono); font-size: 10.5px; text-align: right; color: var(--ink-3); }
.cap-fill { height: 100%; background: var(--pine); transition: width .5s; }
.cap-fill.warn { background: var(--ochre); }
.cap-fill.full { background: var(--rust); }

/* ============================================================
   筛选轨
   ============================================================ */
.filter-rail {
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
  padding: 11px 14px; margin-bottom: 0;
  background: var(--paper-2); border: 1px solid var(--line); border-bottom: none;
}
.rail-label {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); margin-right: 3px;
}
.filter-count { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); }

/* ============================================================
   表格（发丝线 · 无边框 · 小型大写表头）
   ============================================================ */
.sheet-table { background: var(--sheet); border: 1px solid var(--line); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-family: var(--f-mono); font-size: 9px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
  text-align: left; padding: 11px 12px; white-space: nowrap;
  background: var(--paper-2);
  border-bottom: 1px solid var(--ink);
  position: sticky; top: 0; z-index: 2;
}
.tbl td {
  padding: 10px 12px; font-size: 12.5px; vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
}
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: var(--rust-wash); }
.tbl tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--rust); }
.tbl td.nowrap, .tbl td.actions { white-space: nowrap; }
.tbl td.actions { cursor: default; }
.truncate { max-width: 148px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.muted { color: var(--ink-4); }

/* 级数：等宽数字 + 小型上标 */
.lv { font-family: var(--f-mono); font-size: 12px; font-weight: 600; color: var(--rust); }
.lv em { font-style: normal; font-size: 9px; color: var(--ink-4); margin-left: 2.5px; }

/* ============================================================
   模块节点标记（列表内的进度刻度）
   ============================================================ */
.steps { display: flex; gap: 2px; align-items: center; }
.step {
  width: 17px; height: 15px;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 9px; font-weight: 600;
  color: var(--ink-4);
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.step.on { color: var(--paper); border-color: transparent; }
.step.on-m1 { background: var(--m1); }
.step.on-m2 { background: var(--m2); }
.step.on-m3 { background: var(--m3); }
.step.fail { background: var(--danger); color: var(--paper); border-color: transparent; }
.step-done {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .1em;
  color: var(--pine); margin-left: 5px; text-transform: uppercase;
}

/* ============================================================
   标签（方角 · 细边 · 小字距）
   ============================================================ */
.badge {
  display: inline-block; padding: 2px 7px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid; white-space: nowrap; line-height: 1.5;
}
.badge-ink    { color: var(--ink);    border-color: var(--ink);    background: transparent; }
.badge-brand  { color: var(--rust);   border-color: var(--rust);   background: var(--rust-wash); }
.badge-ok     { color: var(--pine);   border-color: var(--pine);   background: var(--pine-wash); }
.badge-warn   { color: #96681A;       border-color: var(--ochre);  background: var(--ochre-wash); }
.badge-danger { color: var(--danger); border-color: var(--danger); background: #F6E0DC; }
.badge-gray   { color: var(--ink-3);  border-color: var(--line);   background: var(--paper-2); }
.badge-coach  { color: var(--umber);  border-color: var(--umber);  background: var(--umber-wash); }
.badge-slate  { color: var(--slate);  border-color: var(--slate);  background: var(--slate-wash); }

.link { color: var(--rust); cursor: pointer; text-decoration: none; border-bottom: 1px solid var(--rust-wash); }
.link:hover { border-bottom-color: var(--rust); }

/* ============================================================
   按钮 / 表单
   ============================================================ */
button { font-family: var(--f-body); }
.btn-ico { width: 13px; height: 13px; flex-shrink: 0; }

.btn-solid {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  padding: 8px 14px; font-size: 12.5px; cursor: pointer; letter-spacing: .01em;
  transition: background .15s, color .15s;
}
.btn-solid:hover { background: var(--rust); border-color: var(--rust); }
.btn-solid:disabled { background: var(--ink-4); border-color: var(--ink-4); cursor: not-allowed; }

.btn-line {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
  padding: 7px 12px; font-size: 12.5px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-line:hover { border-color: var(--rust); color: var(--rust); background: var(--rust-wash); }
.btn-line.sm { padding: 5px 9px; font-size: 11.5px; }

.btn-sm {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; font-size: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--sheet); color: var(--ink-2);
  transition: .15s;
}
.btn-sm:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-sm.primary:hover { background: var(--rust); border-color: var(--rust); }
.btn-sm.danger { color: var(--danger); border-color: #E2C4BF; }
.btn-sm.danger:hover { background: var(--danger); color: var(--paper); border-color: var(--danger); }
.btn-sm:disabled { opacity: .4; cursor: not-allowed; }

.btn-danger {
  background: var(--danger); color: var(--paper); border: 1px solid var(--danger);
  padding: 8px 14px; font-size: 12.5px; cursor: pointer;
}
.icon-btn {
  border: 1px solid transparent; background: transparent; cursor: pointer;
  color: var(--ink-3); padding: 5px; display: grid; place-items: center; line-height: 0;
}
.icon-btn:hover { color: var(--rust); border-color: var(--line); }

input, select, textarea {
  font-family: var(--f-body); font-size: 12.5px; color: var(--ink);
  padding: 7px 9px; border: 1px solid var(--line); background: var(--sheet);
  outline: none; max-width: 100%; border-radius: 0;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--rust); }
input::placeholder { color: var(--ink-4); }
select { cursor: pointer; }
textarea { resize: vertical; }

/* 带图标的搜索域 */
.field-search { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--sheet); padding-left: 8px; }
.field-search:focus-within { border-color: var(--rust); }
.fs-ico { width: 13px; height: 13px; color: var(--ink-3); flex-shrink: 0; }
.field-search input { border: none; background: transparent; width: 208px; }
.field-search input:focus { border: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid.one { grid-template-columns: 1fr; }
label.fld { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--ink-2); }
label.fld.full { grid-column: 1 / -1; }
.hint { font-size: 11px; color: var(--ink-3); line-height: 1.5; }

/* ============================================================
   弹窗
   ============================================================ */
.modal { position: fixed; inset: 0; background: rgba(23,21,15,.52); display: grid; place-items: center; z-index: 60; padding: 22px; }
.modal-card {
  background: var(--sheet); border: 1px solid var(--ink);
  box-shadow: 12px 12px 0 rgba(23,21,15,.13);   /* 硬边偏移投影，印刷错版感 */
  width: 100%; max-width: 570px; max-height: 88vh;
  display: flex; flex-direction: column;
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translate(4px,-4px); opacity: .7; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 2px solid var(--ink);
}
.modal-head h2 { font-family: var(--f-display); font-size: 19px; font-weight: 700; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot {
  display: flex; gap: 9px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper-2);
}
.modal-foot .spacer { flex: 1; }

/* ============================================================
   学员档案侧滑
   ============================================================ */
.dossier { position: fixed; inset: 0; z-index: 55; }
.dossier-mask { position: absolute; inset: 0; background: rgba(23,21,15,.42); }
.dossier-card {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 588px; max-width: 95vw;
  background: var(--paper); border-left: 2px solid var(--ink);
  display: flex; flex-direction: column;
  animation: slideIn .2s cubic-bezier(.2,.7,.3,1);
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .5; } to { transform: none; opacity: 1; } }
.dossier-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 20px 24px 14px; border-bottom: 2px solid var(--ink); background: var(--paper-2);
}
.dossier-body { padding: 22px 24px 60px; overflow-y: auto; flex: 1; }

.dossier-name {
  font-family: var(--f-display); font-size: 27px; font-weight: 700; line-height: 1.1;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.dossier-meta {
  font-size: 11.5px; color: var(--ink-2); margin-top: 9px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.dossier-meta .dm-item { display: inline-flex; align-items: center; gap: 4px; }
.dossier-meta .dm-item svg { width: 11px; height: 11px; color: var(--ink-3); }
.dossier-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }

/* 档案区块：编号 + 标题 + 发丝线 */
.block { margin-bottom: 26px; }
.block-title {
  display: flex; align-items: baseline; gap: 9px;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); padding-bottom: 7px; margin-bottom: 13px;
  border-bottom: 1px solid var(--ink);
}
.block-title .bt-name { color: var(--ink); font-weight: 600; }
.block-title .bt-actions { margin-left: auto; display: flex; gap: 6px; }

.kv { display: grid; grid-template-columns: 82px 1fr; gap: 0; font-size: 12.5px; }
.kv dt {
  color: var(--ink-3); padding: 6px 0; border-bottom: 1px dotted var(--line);
  font-size: 11.5px;
}
.kv dd {
  color: var(--ink); padding: 6px 0; border-bottom: 1px dotted var(--line);
  word-break: break-word;
}
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: none; }

/* 模块进度流转条 */
.mod-card {
  border: 1px solid var(--line); background: var(--sheet);
  padding: 15px 16px; margin-bottom: 12px;
  border-left: 3px solid var(--line);
}
.mod-card.m-MODULE_1 { border-left-color: var(--m1); }
.mod-card.m-MODULE_2 { border-left-color: var(--m2); }
.mod-card.m-MODULE_3 { border-left-color: var(--m3); }
.mod-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.mod-card-name { font-family: var(--f-display); font-size: 16px; font-weight: 700; }
.mod-card-name.m1 { color: var(--m1); }
.mod-card-name.m2 { color: var(--m2); }
.mod-card-name.m3 { color: var(--m3); }

.flow { display: flex; align-items: flex-start; margin-bottom: 12px; }
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; }
.flow-dot {
  width: 20px; height: 20px; border: 1px solid var(--line); background: var(--sheet);
  display: grid; place-items: center; color: var(--ink-4);
}
.flow-dot svg { width: 11px; height: 11px; }
.flow-dot.done { border-color: transparent; color: var(--paper); }
.flow-dot.done.m1 { background: var(--m1); }
.flow-dot.done.m2 { background: var(--m2); }
.flow-dot.done.m3 { background: var(--m3); }
.flow-dot.fail { background: var(--danger); border-color: transparent; color: var(--paper); }
.flow-label { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.flow-label.done { color: var(--ink); font-weight: 600; }
.flow-line { flex: 1; height: 1px; background: var(--line); margin-top: 10px; min-width: 14px; }
.flow-line.done { background: var(--pine); }

.mod-meta {
  font-family: var(--f-mono); font-size: 10px; color: var(--ink-3);
  display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px;
  padding-top: 9px; border-top: 1px dotted var(--line);
}
.mod-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 记录行 */
.row-list { display: flex; flex-direction: column; }
.row-item {
  display: flex; justify-content: space-between; align-items: center; gap: 11px;
  padding: 10px 0; border-bottom: 1px dotted var(--line); font-size: 12.5px; flex-wrap: wrap;
}
.row-item:last-child { border-bottom: none; }
.row-item .ri-main { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-item .ri-sub { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); }
.row-item .ri-amt { font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.row-item.past { opacity: .58; }

/* 时间线 */
.timeline { list-style: none; }
.timeline li { display: flex; gap: 11px; padding: 0 0 14px; position: relative; }
.timeline li:not(:last-child)::before {
  content: ''; position: absolute; left: 3px; top: 12px; bottom: 0; width: 1px; background: var(--line);
}
.tl-dot { width: 7px; height: 7px; background: var(--ink-3); flex-shrink: 0; margin-top: 5px; z-index: 1; }
.tl-dot.PAYMENT { background: var(--pine); }
.tl-dot.ENROLLMENT { background: var(--m2); }
.tl-dot.DOE { background: var(--m3); }
.tl-dot.COACH_CHANGE { background: var(--umber); }
.tl-dot.STAGE_CHANGE { background: var(--slate); }
.tl-dot.REFERRAL { background: var(--rust); }
.tl-body { flex: 1; min-width: 0; }
.tl-text { font-size: 12.5px; }
.tl-meta { font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-4); margin-top: 2px; letter-spacing: .02em; }
.tl-del { border: none; background: transparent; color: var(--danger); cursor: pointer; font-size: 10.5px; opacity: 0; padding: 0 2px; }
.timeline li:hover .tl-del { opacity: 1; }

.inline-add { display: flex; gap: 6px; margin-bottom: 13px; }
.inline-add input { flex: 1; }
.inline-add select { width: 104px; }

/* ============================================================
   班级卡片（票据式）
   ============================================================ */
.cohort-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px; }
.cohort-card {
  background: var(--sheet); border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
  padding: 17px 18px 16px; position: relative;
}
.cohort-card.m-MODULE_1 { border-top-color: var(--m1); }
.cohort-card.m-MODULE_2 { border-top-color: var(--m2); }
.cohort-card.m-MODULE_3 { border-top-color: var(--m3); }
.cohort-card.m-COACH_TRAINING { border-top-color: var(--umber); }
.cc-vol {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px;
}
.cohort-card h3 { font-family: var(--f-display); font-size: 17px; font-weight: 700; line-height: 1.25; margin-bottom: 3px; }
.cc-sub { font-size: 11.5px; color: var(--ink-2); margin-bottom: 14px; }
.cc-count { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cc-count .num { font-family: var(--f-mono); font-size: 22px; font-weight: 600; line-height: 1.3; }
.cc-count .num em { font-style: normal; font-size: 12px; color: var(--ink-3); margin-left: 5px; }
.cap-bar { background: var(--paper-2); height: 8px; border: 1px solid var(--line-soft); margin: 9px 0 8px; }
.cc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.cc-meta { display: flex; align-items: center; gap: 4px; }
.cc-meta svg { width: 11px; height: 11px; }
.cc-actions { display: flex; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dotted var(--line); flex-wrap: wrap; }

/* ============================================================
   谱系图
   ============================================================ */
.lineage-legend {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 12px 18px; border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
  font-size: 11.5px; color: var(--ink-2);
}
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lineage-legend .lg { display: inline-block; width: 9px; height: 9px; }
.lg-m1 { background: var(--m1); } .lg-m2 { background: var(--m2); }
.lg-m3 { background: var(--m3); } .lg-coach { background: var(--umber); }
.legend-hint { margin-left: auto; font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: .02em; }

.lineage-canvas {
  height: calc(100vh - 330px); min-height: 430px;
  background: var(--sheet);
  background-image: radial-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: grab; overflow: hidden; position: relative;
}
.lineage-canvas.dragging { cursor: grabbing; }
.lineage-canvas svg { display: block; width: 100%; height: 100%; }

.node-box { cursor: pointer; }
.node-box rect.nb-body {
  fill: var(--sheet); stroke: var(--ink); stroke-width: 1;
  transition: stroke-width .12s;
}
.node-box:hover rect.nb-body { stroke-width: 2; }
.node-box.hit rect.nb-body { fill: var(--rust-wash); stroke: var(--rust); stroke-width: 2; }
.node-lv { font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; fill: var(--rust); }
.node-name { font-family: var(--f-display); font-size: 13.5px; font-weight: 700; fill: var(--ink); }
.node-tag { font-family: var(--f-body); font-size: 9px; fill: var(--paper); font-weight: 600; }
.node-link { fill: none; stroke: var(--ink-4); stroke-width: 1; }
.toggle-btn { cursor: pointer; }
.toggle-btn rect { fill: var(--sheet); stroke: var(--ink); stroke-width: 1; }
.toggle-btn text { font-family: var(--f-mono); font-size: 9px; fill: var(--ink); font-weight: 600; }
.toggle-btn:hover rect { fill: var(--rust); stroke: var(--rust); }
.toggle-btn:hover text { fill: var(--paper); }

/* ============================================================
   其他
   ============================================================ */
.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.loading { padding: 34px; text-align: center; color: var(--ink-4); font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 11px 20px; font-size: 13px; z-index: 100; max-width: 78vw;
  border-left: 3px solid var(--paper);
  box-shadow: 6px 6px 0 rgba(23,21,15,.16);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast.ok { border-left-color: var(--pine); }
.toast.err { background: var(--danger); border-left-color: #F0C9C4; }

/* 载入错落揭示：栏线先延展，内容依次上移 */
.reveal { animation: rise .42s cubic-bezier(.2,.7,.3,1) both; animation-delay: calc(var(--d, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.masthead { animation: ruleIn .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes ruleIn { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   响应式收敛
   ============================================================ */
@media (max-width: 1180px) {
  .grid-asym { grid-template-columns: 1fr; }
  .col-7, .col-5 { grid-column: 1 / -1; }
  .grid-asym.flip .col-5 { order: 0; }
  .stat-band { grid-template-columns: 1fr; }
  .stat-hero { border-right: none; border-bottom: 1px solid var(--line); }
  .ledger-split { grid-template-columns: 1fr; }
  .ledger-split > div:first-child { border-right: none; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
}
@media (max-width: 900px) {
  .spine { display: none; }
  .index-col { width: 168px; }
  .main { padding: 22px 18px 48px; }
  .masthead { grid-template-columns: 60px 1fr; row-gap: 10px; }
  .mh-rule { display: none; }
  .mh-actions { grid-column: 1 / -1; }
  .mh-title { font-size: 31px; }
}

/* ============================================================
   登录页（编辑设计：左刊头 / 右表单，非对称分栏）
   ============================================================ */
.login-body { min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: minmax(300px, 38%) 1fr; min-height: 100vh; }

.login-brand {
  background: var(--ink); color: var(--paper);
  padding: 34px 34px 26px 22px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-brand::after {   /* 斜向纹理，避免纯色块 */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .06;
  background: repeating-linear-gradient(126deg, transparent 0 22px, var(--paper) 22px 23px);
}
.lb-spine {
  position: absolute; left: 10px; top: 34px;
  writing-mode: vertical-rl;
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .34em;
  text-transform: uppercase; color: #6E6653;
}
.lb-main { padding-left: 28px; max-width: 340px; }
.lb-mark {
  width: 44px; height: 44px; background: var(--rust); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: 24px; font-weight: 700; margin-bottom: 22px;
}
.lb-title { font-family: var(--f-display); font-size: 52px; font-weight: 900; line-height: .95; }
.lb-sub { font-size: 14px; color: #CFC7B4; margin-top: 8px; letter-spacing: .04em; }
.lb-rule { height: 1px; background: #453F32; margin: 22px 0 18px; }
.lb-desc { font-size: 12.5px; color: #A69D89; line-height: 1.85; }
.lb-foot {
  padding-left: 28px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ochre);
}

.login-panel { display: grid; place-items: center; padding: 40px 34px; }
.login-card { width: 100%; max-width: 352px; }
.lp-kicker {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-3);
}
.lp-title { font-family: var(--f-display); font-size: 34px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.lp-rule { height: 2px; background: var(--ink); margin: 14px 0 26px; }

.field-icon {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--sheet); padding-left: 9px;
}
.field-icon:focus-within { border-color: var(--rust); }
.field-icon input { border: none; background: transparent; flex: 1; padding: 9px 10px 9px 0; }
.field-icon input:focus { border: none; }

.login-submit { width: 100%; justify-content: center; margin-top: 22px; padding: 11px; letter-spacing: .16em; }
.login-error {
  display: flex; align-items: center; gap: 7px; margin-top: 14px;
  padding: 9px 11px; font-size: 12px;
  color: var(--danger); background: #F6E0DC; border-left: 3px solid var(--danger);
}
.lp-hint { margin-top: 20px; font-size: 11px; color: var(--ink-3); line-height: 1.7; }

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 26px 22px; }
  .lb-spine { display: none; }
  .lb-main { padding-left: 0; }
  .lb-title { font-size: 38px; }
  .lb-foot { padding-left: 0; margin-top: 18px; }
  .login-panel { padding: 32px 22px 48px; }
}

/* ============================================================
   顶部用户条（当前身份 / 数据范围 / 登出）
   ============================================================ */
.userbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 18px;
  background: var(--ink); color: var(--paper);
}
.ub-who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ub-name { font-family: var(--f-display); font-size: 15px; font-weight: 700; }
.ub-role {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ochre); border: 1px solid #4A4437; padding: 2px 7px;
}
.ub-scope { font-size: 11.5px; color: #A69D89; }
.ub-scope b { color: #D9D2C0; font-weight: 500; }
.ub-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.ub-actions .btn-line { border-color: #4A4437; color: #CFC7B4; padding: 5px 10px; font-size: 11.5px; }
.ub-actions .btn-line:hover { border-color: var(--ochre); color: var(--ochre); background: transparent; }

/* 数据范围提示条 */
.scope-note {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; margin-bottom: 16px;
  background: var(--ochre-wash); border-left: 3px solid var(--ochre);
  font-size: 11.5px; color: #7A5518;
}
.scope-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ============================================================
   用户 / 团队 / 审计 管理页
   ============================================================ */
.admin-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--ink); }
.admin-tab {
  padding: 9px 18px; border: none; background: transparent; cursor: pointer;
  font-family: var(--f-body); font-size: 13px; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.admin-tab:hover { color: var(--rust); }
.admin-tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--rust); }

.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 15px; }
.role-card {
  background: var(--sheet); border: 1px solid var(--line);
  border-left: 4px solid var(--ink); padding: 15px 16px;
}
.role-card.r-SUPER_ADMIN { border-left-color: var(--rust); }
.role-card.r-GM { border-left-color: var(--ink); }
.role-card.r-FINANCE { border-left-color: var(--pine); }
.role-card.r-TEAM_LEAD { border-left-color: var(--slate); }
.role-card.r-ADVISOR { border-left-color: var(--ochre); }
.role-card.r-VIEWER { border-left-color: var(--ink-4); }
.role-card h3 { font-family: var(--f-display); font-size: 16px; font-weight: 700; }
.role-card .rc-scope {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 5px 0 10px;
}
.perm-list { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chip {
  font-size: 10.5px; padding: 2px 7px; background: var(--paper-2);
  border: 1px solid var(--line-soft); color: var(--ink-2);
}

.pw-strip {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em;
  background: var(--ink); color: var(--ochre); padding: 10px 12px; margin-top: 12px;
  word-break: break-all;
}

/* ============================================================
   08 知识库
   ============================================================ */

/* 数量 + 单位：单位弱化并留出间距。
   中文与数字直接相邻会显得挤，这里统一留 3px，
   下面所有「N 份 / N 块 / N 页」都走这个类。 */
.qty { font-family: var(--f-mono); font-size: 12px; font-weight: 600; color: var(--ink); }
.qty em {
  font-style: normal; font-family: var(--f-body); font-size: 10.5px; font-weight: 400;
  color: var(--ink-3); margin-left: 3px; letter-spacing: .02em;
}
.is-warn   { color: #96681A; }
.is-danger { color: var(--danger); }
.is-warn .qty, .is-danger .qty { color: inherit; }

/* 这两个类原先只在局部定义过，知识库的表格与卡片里也要用 */
.ri-sub { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); }
.ri-sub.is-warn { color: #96681A; }
.ri-sub.is-danger { color: var(--danger); }
.spacer { flex: 1; }

/* ---------- 库卡片 ---------- */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(316px, 1fr)); gap: 16px; }

.kb-card {
  background: var(--sheet); border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  padding: 16px 17px 14px;
  display: flex; flex-direction: column; gap: 11px;
}
.kb-card.tone-slate { border-top-color: var(--slate); }
.kb-card.tone-pine  { border-top-color: var(--pine); }
.kb-card.tone-ochre { border-top-color: var(--ochre); }
.kb-card.tone-rust  { border-top-color: var(--rust); }
.kb-card.tone-umber { border-top-color: var(--umber); }
.kb-card.tone-gray  { border-top-color: var(--ink-4); }
.kb-card.is-archived { opacity: .62; background: var(--paper-2); }

.kbc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kbc-head h3 {
  font-family: var(--f-display); font-size: 17px; font-weight: 700;
  line-height: 1.3; margin: 0 0 3px;
}
.kbc-type { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }

.kbc-desc {
  font-size: 12px; line-height: 1.65; color: var(--ink-2); margin: 0;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}

.kbc-nums { display: flex; flex-wrap: wrap; gap: 14px; }

.kbc-strategy {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 11.5px; line-height: 1.6; color: var(--ink-2);
  background: var(--paper-2); border-left: 2px solid var(--line);
  padding: 8px 10px;
}
.kbc-ico { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 2px; color: var(--ink-3); }

.kbc-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.kbc-roles-k {
  font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em;
  margin-right: 3px; text-transform: uppercase;
}
.perm-chip.is-write { border-color: var(--pine); color: var(--pine); background: var(--pine-wash); }

.kbc-acts {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line-soft);
}

/* ---------- 文档表格 ---------- */
.doc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.doc-tags .tag {
  font-size: 10px; color: var(--ink-2); background: var(--paper-2);
  border: 1px solid var(--line-soft); padding: 1px 5px; letter-spacing: .02em;
}

/* ---------- 检索测试台 ---------- */
.kb-search-bar { display: flex; gap: 9px; align-items: stretch; margin-bottom: 12px; }
.field-search.big { flex: 1; padding-left: 11px; }
.field-search.big input { width: 100%; font-size: 14px; padding: 11px 10px; }

.kb-scope-pick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 18px;
  background: var(--sheet); border: 1px solid var(--line);
}
.kb-scope-pick .pick {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.kb-scope-pick .hint { margin-left: auto; }

.kb-search-meta {
  display: flex; align-items: center; gap: 9px;
  font-size: 11.5px; color: var(--ink-2);
  padding-bottom: 9px; margin-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}
.kb-search-meta b { font-family: var(--f-mono); font-size: 14px; color: var(--rust); }
.kb-search-meta .sep { color: var(--ink-4); }

/* 命中条目 */
.hit {
  background: var(--sheet); border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  padding: 13px 15px 11px; margin-bottom: 11px;
}
.hit:hover { border-left-color: var(--rust); }
.hit-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; }
.hit-no { font-family: var(--f-mono); font-size: 11px; color: var(--ink-4); }
.hit-cite { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }
.hit-score { font-family: var(--f-mono); font-size: 11px; color: var(--ink-4); }

.hit-snip {
  font-size: 13px; line-height: 1.85; color: var(--ink); margin: 0 0 10px;
  white-space: pre-wrap; word-break: break-word;
}
/* 关键词高亮：底色而非荧光，保持纸面观感 */
mark.hl {
  background: var(--ochre-wash); color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--ochre);
  padding: 0 1px; border-radius: 0;
}

.hit-foot {
  display: flex; align-items: center; gap: 8px;
  padding-top: 9px; border-top: 1px solid var(--line-soft);
}

/* ---------- 切片预览 ---------- */
.chunk-list { display: flex; flex-direction: column; gap: 11px; }

.chunk { border: 1px solid var(--line); background: var(--sheet); }
.chunk.is-hit { border-color: var(--rust); border-left-width: 3px; }
.chunk > header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.ck-idx { font-family: var(--f-mono); font-size: 11px; color: var(--ink-4); }
.ck-head { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.ck-tag {
  font-family: var(--f-mono); font-size: 10px; color: var(--ink-3);
  border: 1px solid var(--line); padding: 1px 5px;
}
.ck-tag.is-warn { color: #96681A; border-color: var(--ochre); background: var(--ochre-wash); }
.ck-tag.is-hit { color: var(--rust); border-color: var(--rust); background: var(--rust-wash); }
.ck-tag .qty { font-size: 10px; }
.ck-tag .qty em { font-size: 9.5px; margin-left: 2px; }

.ck-body {
  margin: 0; padding: 11px 13px;
  font-family: var(--f-body); font-size: 12.5px; line-height: 1.85; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}

/* 侧滑面板标题里的两段文字 */
.sh-name { font-family: var(--f-display); font-size: 17px; font-weight: 700; }
.sh-meta { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* 提示条 */
.notice {
  font-size: 12px; line-height: 1.7; padding: 10px 12px; margin-bottom: 12px;
  border-left: 3px solid var(--line); background: var(--paper-2); color: var(--ink-2);
}
.notice.is-warn { border-left-color: var(--ochre); background: var(--ochre-wash); color: #7A5414; }
.notice.is-danger { border-left-color: var(--danger); background: #F6E0DC; color: var(--danger); }

/* ---------- 授权勾选表 ---------- */
.acl-table { border: 1px solid var(--line); background: var(--sheet); }
.acl-row {
  display: grid; grid-template-columns: 1fr 72px 72px;
  align-items: center; padding: 9px 13px;
  border-bottom: 1px solid var(--line-soft);
}
.acl-row:last-child { border-bottom: none; }
.acl-row > span:not(.acl-role) { text-align: center; }
.acl-head {
  background: var(--ink); color: var(--paper);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
}
.acl-role { font-size: 12.5px; color: var(--ink); }
.acl-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--rust); cursor: pointer; }
.acl-row input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .35; }

@media (max-width: 900px) {
  .kb-grid { grid-template-columns: 1fr; }
  .kb-search-bar { flex-direction: column; }
  .kb-scope-pick .hint { margin-left: 0; }
}

/* 写入文本的正文框：长文录入，行高与宽度都要放开 */
#nt_content {
  width: 100%; line-height: 1.85; font-size: 13px; padding: 10px 12px;
}
#nt_count { font-family: var(--f-mono); }

/* 零命中表只有三列，整幅铺开会显得空。
   让「查询词」吃掉多余宽度，次数与时间保持紧凑。 */
.kb-zero-tbl th:nth-child(2), .kb-zero-tbl td:nth-child(2) { width: 96px; }
.kb-zero-tbl th:nth-child(3), .kb-zero-tbl td:nth-child(3) { width: 152px; }

/* ============================================================
   大模型配置
   ============================================================ */

/* 四个能力的就绪状态一览 */
.ai-status {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.ai-cap {
  background: var(--sheet); border: 1px solid var(--line);
  border-left: 3px solid var(--line-soft); padding: 12px 14px;
}
.ai-cap.is-on { border-left-color: var(--pine); }
.ai-cap-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ai-cap-h strong { font-size: 13px; }
.ai-dot {
  width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%;
  background: var(--ink-4);
}
.ai-cap.is-on .ai-dot { background: var(--pine); }
.ai-cap-d { font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }

/* 模型名输入框 + 选择按钮 */
.ai-model-row { display: flex; gap: 7px; align-items: stretch; }
.ai-model-row input { flex: 1; }

/* 启用开关 */
.ai-switches { display: flex; flex-wrap: wrap; gap: 20px; }
.ai-switch {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.ai-switch input { width: 15px; height: 15px; accent-color: var(--rust); cursor: pointer; }

/* 连通性测试结果 */
.ai-testout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr));
  gap: 11px; margin-bottom: 22px;
}
.ai-test-item {
  background: var(--sheet); border: 1px solid var(--line);
  border-left: 3px solid var(--line); padding: 11px 13px;
  font-size: 12px; line-height: 1.65;
}
.ai-test-item strong { display: inline-block; margin-right: 7px; font-size: 12.5px; }
.ai-test-item.is-ok   { border-left-color: var(--pine); }
.ai-test-item.is-warn { border-left-color: var(--ochre); background: var(--ochre-wash); }
.ai-test-item.is-bad  { border-left-color: var(--danger); background: #F8E7E4; }
.ai-test-item.is-skip { border-left-color: var(--ink-4); color: var(--ink-3); }

/* 模型选择弹窗 */
.model-pick { max-height: 400px; overflow-y: auto; border: 1px solid var(--line); }
.model-row {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: none; border-bottom: 1px solid var(--line-soft);
  background: var(--sheet); cursor: pointer;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--ink);
}
.model-row:last-child { border-bottom: none; }
.model-row:hover { background: var(--rust-wash); color: var(--rust-deep); }

/* OCR 提示条与预估 */
.ocr-bar {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  margin-bottom: 16px;
}
.ocr-bar > div { flex: 1; }

.ocr-est {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  border: 1px solid var(--line); background: var(--sheet);
}
.ocr-est > div {
  padding: 11px 13px; border-right: 1px solid var(--line-soft);
}
.ocr-est > div:last-child { border-right: none; }
.ocr-est span {
  display: block; font-size: 10.5px; color: var(--ink-3);
  letter-spacing: .06em; margin-bottom: 5px;
}
.ocr-est b { font-family: var(--f-mono); font-size: 15px; color: var(--ink); }

@media (max-width: 760px) {
  .ocr-bar { flex-direction: column; align-items: stretch; }
}

/* 两路召回对比：三列并排，看同一个查询在关键词路与语义路上的排名差异 */
.ex-wrap {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); margin-bottom: 4px;
}
.ex-col { background: var(--sheet); padding: 10px 12px; min-width: 0; }
.ex-col h4 {
  font-size: 10.5px; letter-spacing: .07em; color: var(--ink-3);
  margin: 0 0 8px; font-weight: 600; text-transform: none;
}
.ex-row {
  display: flex; align-items: baseline; gap: 7px;
  padding: 3px 0; border-bottom: 1px dotted var(--line-soft); font-size: 12px;
}
.ex-row:last-child { border-bottom: none; }
.ex-rank {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-4);
  min-width: 15px; text-align: right; flex: none;
}
.ex-cite {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2);
}
.ex-num {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--rust); flex: none;
}
.ex-empty { font-size: 12px; color: var(--ink-4); padding: 4px 0; }

@media (max-width: 900px) {
  .ex-wrap { grid-template-columns: 1fr; }
}

/* ============================================================
   09 智能管理
   ============================================================ */

/*
 * 对话区高度固定，内部各自滚动。
 *
 * 关键是那些 min-height: 0 —— flex/grid 子项的 min-height 默认是 auto，
 * 含义为「至少和内容一样高」，于是内容一多就把容器顶开，
 * overflow-y: auto 形同失效，答复会溢出到框外面去。
 * 必须显式写 0 才允许它收缩并出现滚动条。
 */
.chat-wrap {
  display: grid; grid-template-columns: 208px 1fr;
  border: 1px solid var(--line); background: var(--sheet);
  height: calc(100vh - 250px); min-height: 420px; max-height: 860px;
  overflow: hidden;                 /* 兜底：任何情况下内容都不越出边框 */
}

/* 会话列表 */
.chat-side {
  border-right: 1px solid var(--line); background: var(--paper-2);
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
}
.chat-side-h {
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.chat-convs { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.chat-conv {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 13px; border: none; border-bottom: 1px solid var(--line-soft);
  background: transparent; font-family: var(--f-body);
}
.chat-conv:hover { background: var(--sheet); }
.chat-conv.active { background: var(--sheet); box-shadow: inset 3px 0 0 var(--rust); }
.cc-title {
  display: block; font-size: 12.5px; color: var(--ink); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-meta { display: block; font-family: var(--f-mono); font-size: 10px; color: var(--ink-4); margin-top: 3px; }
.chat-empty { padding: 20px 13px; font-size: 11.5px; color: var(--ink-4); }

/* 对话区 */
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-log {
  flex: 1 1 auto; min-height: 0;      /* 没有这两项就不会滚动，只会溢出 */
  overflow-y: auto; overflow-x: hidden;
  padding: 20px 24px;
  overscroll-behavior: contain;       /* 滚到底不再带动整页 */
}

/* 长英文串、长链接、代码不能把宽度撑破 */
.msg { margin-bottom: 20px; max-width: 760px; min-width: 0; overflow-wrap: anywhere; }
.msg-who {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 5px;
}
.msg.is-user .msg-who { color: var(--rust); }
.msg-body { font-size: 13.5px; line-height: 1.85; color: var(--ink); }
.msg-body p { margin: 0 0 9px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul { margin: 0 0 9px; padding-left: 18px; }
.msg-body li { margin-bottom: 4px; }
/* 用户的话加底色与竖线，助手的答复保持在纸面上，读长文更舒服 */
.msg.is-user .msg-body {
  background: var(--paper-2); border-left: 2px solid var(--rust);
  padding: 9px 13px;
}
.msg.is-bot { padding-left: 2px; }
.msg.is-bot .msg-body { color: var(--ink); }
.msg.is-bot .msg-body p:first-child { margin-top: 0; }
.msg-meta { font-family: var(--f-mono); font-size: 10px; color: var(--ink-4); margin-top: 6px; }

/* 等待动画：三个点，不用 emoji */
.thinking { color: var(--ink-3); font-size: 12.5px; }
.thinking i {
  display: inline-block; width: 4px; height: 4px; margin-left: 3px;
  background: var(--ink-4); border-radius: 50%;
  animation: think 1.2s infinite ease-in-out;
}
.thinking i:nth-child(2) { animation-delay: .18s; }
.thinking i:nth-child(3) { animation-delay: .36s; }
@keyframes think { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* 开场说明 */
.chat-welcome { max-width: 660px; }
.chat-welcome h2 {
  font-family: var(--f-display); font-size: 20px; font-weight: 700; margin: 0 0 10px;
}
.cw-scope {
  font-size: 12.5px; color: var(--ink-2); padding-bottom: 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.cw-examples { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.cw-ex {
  cursor: pointer; padding: 7px 11px; background: var(--paper-2);
  border: 1px solid var(--line); font-family: var(--f-body);
  font-size: 12px; color: var(--ink-2);
}
.cw-ex:hover { border-color: var(--rust); color: var(--rust-deep); background: var(--rust-wash); }
.cw-note { font-size: 11.5px; line-height: 1.75; color: var(--ink-3); }
.cw-note p { margin: 0 0 8px; }
.cw-note b { color: var(--ink-2); }

/* 待确认操作。卡片多时自身滚动，不挤压上面的对话区 */
.chat-actions {
  border-top: 1px solid var(--line); background: var(--ochre-wash);
  flex: 0 0 auto; max-height: 42%; overflow-y: auto;
}
.chat-actions:empty { display: none; }
.pend-head {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 24px 0; font-size: 11.5px; color: #7A5414;
}
.pend-ico { width: 14px; height: 14px; flex: 0 0 14px; }
.pend-card { padding: 11px 24px 13px; }
.pend-sum { font-size: 13px; line-height: 1.6; color: var(--ink); margin-bottom: 5px; }
.pend-args {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3);
  margin-bottom: 9px; word-break: break-all;
}
.pend-btns { display: flex; gap: 7px; }

/* 已处理动作的痕迹 */
.act-history { margin: 4px 0 20px; max-width: 760px; }
.act-hist {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2);
  padding: 7px 11px; margin-bottom: 5px;
  background: var(--paper-2); border-left: 2px solid var(--line);
}
.act-hist.is-ok { border-left-color: var(--pine); }
.act-hist.is-bad { border-left-color: var(--danger); }
.act-hist.is-skip { border-left-color: var(--ink-4); color: var(--ink-3); }

/* 输入区固定在底部，不参与压缩 */
.chat-input {
  display: flex; gap: 9px; align-items: flex-end;
  flex: 0 0 auto;
  padding: 12px 24px; border-top: 1px solid var(--line); background: var(--paper-2);
}
.chat-input textarea {
  flex: 1; resize: none; font-size: 13px; line-height: 1.6; padding: 9px 11px;
}
.chat-input textarea:disabled { background: var(--paper-2); color: var(--ink-4); }

/* 能力清单 */
.cap-list { border: 1px solid var(--line); }
.cap-row {
  display: grid; grid-template-columns: 62px 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.cap-row:last-child { border-bottom: none; }
.cap-row.is-off { color: var(--ink-4); }

@media (max-width: 900px) {
  /* 窄屏收掉会话侧栏，但高度仍需是确定值 ——
     改成 auto 的话内部就没有可滚动的参照高度，配上 overflow:hidden 会裁掉内容 */
  .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - 210px); min-height: 380px; }
  .chat-side { display: none; }
  .chat-log { padding: 16px 14px; }
  .chat-input { padding: 10px 14px; }
  .pend-head, .pend-card { padding-left: 14px; padding-right: 14px; }
}

/* ---------- 助手输出的 Markdown ---------- */
.msg-status { margin-bottom: 4px; }
.msg-status:empty { display: none; }

.msg-body strong { font-weight: 700; color: var(--ink); }
.msg-body em { font-style: italic; }
.msg-body del { color: var(--ink-4); }
.msg-body a { color: var(--rust); border-bottom: 1px solid var(--rust-wash); text-decoration: none; }
.msg-body a:hover { border-bottom-color: var(--rust); }

.md-h {
  font-family: var(--f-display); font-weight: 700; color: var(--ink);
  margin: 14px 0 7px; line-height: 1.35;
}
h3.md-h { font-size: 15.5px; }
h4.md-h { font-size: 14px; }
h5.md-h, h6.md-h { font-size: 13px; }
.msg-body > .md-h:first-child { margin-top: 0; }

.md-list { margin: 0 0 9px; padding-left: 20px; }
.md-list li { margin-bottom: 4px; }
.md-list li::marker { color: var(--ink-4); }

.md-quote {
  margin: 0 0 9px; padding: 7px 12px;
  border-left: 2px solid var(--line); background: var(--paper-2);
  color: var(--ink-2); font-size: 13px;
}
.md-hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

.md-code {
  font-family: var(--f-mono); font-size: 11.5px;
  background: var(--paper-2); border: 1px solid var(--line-soft);
  padding: 1px 5px; color: var(--rust-deep);
}
.md-pre {
  margin: 0 0 10px; padding: 11px 13px; overflow-x: auto;
  background: var(--paper-2); border: 1px solid var(--line);
}
.md-pre code { font-family: var(--f-mono); font-size: 11.5px; line-height: 1.7; color: var(--ink); }

/* 表格：模型很爱用表格给数据，样式跟系统里其他表保持一致 */
.md-table-wrap { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--line); }
.md-table { width: 100%; border-collapse: collapse; background: var(--sheet); }
.md-table th {
  text-align: left; padding: 7px 11px; white-space: nowrap;
  background: var(--ink); color: var(--paper);
  font-size: 10.5px; letter-spacing: .06em; font-weight: 600;
}
.md-table td {
  padding: 7px 11px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink);
}
.md-table tr:last-child td { border-bottom: none; }
.md-table tr:nth-child(even) td { background: var(--paper-2); }

/* ============================================================
   10 图片管理
   ============================================================ */

/* ---- 相册网格 ---- */
.album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px;
}
.album-grid.is-dim { opacity: .62; }

.album-card {
  position: relative; border: 1px solid var(--line); background: var(--sheet);
  cursor: pointer; transition: border-color .16s, transform .16s;
  display: flex; flex-direction: column;
}
.album-card:hover { border-color: var(--rust); transform: translateY(-2px); }

.ac-cover {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--paper-2); border-bottom: 1px solid var(--line-soft);
}
.ac-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-blank {
  width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-4);
}
.ac-blank svg { width: 34px; height: 34px; }
.ac-count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(26,26,26,.78); color: #fff; font-family: var(--f-mono);
  font-size: 10.5px; padding: 2px 7px; letter-spacing: .04em;
}
.ac-body { padding: 11px 13px 13px; flex: 1; }
.ac-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.ac-head strong { font-size: 14px; }
.ac-desc {
  font-size: 12px; color: var(--ink-3); line-height: 1.55; margin: 0 0 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ac-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.ac-meta .sep { color: var(--ink-4); }
.ac-ops {
  position: absolute; top: 7px; right: 7px; display: flex; gap: 4px;
  opacity: 0; transition: opacity .16s;
}
.album-card:hover .ac-ops { opacity: 1; }
.ac-ops .btn-sm { background: rgba(255,255,255,.94); }

/* ---- 图片网格 ---- */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 12px;
}
.photo-tile {
  margin: 0; border: 1px solid var(--line); background: var(--sheet);
  cursor: pointer; transition: border-color .16s, transform .16s; overflow: hidden;
}
.photo-tile:hover { border-color: var(--rust); transform: translateY(-2px); }
.photo-tile img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  background: var(--paper-2); border-bottom: 1px solid var(--line-soft);
}
.photo-tile figcaption { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.pt-title {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pt-meta { font-size: 10.5px; color: var(--ink-4); font-family: var(--f-mono); }
.pt-tags {
  font-size: 11px; color: var(--pine); display: flex; align-items: center; gap: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pt-tags svg { width: 12px; height: 12px; flex: none; }
.pt-tags.is-none { color: var(--ink-4); }
.pt-desc { font-size: 10.5px; color: var(--slate); }

/* ---- 详情查看 ---- */
.viewer { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 18px; }
.vw-stage {
  background: var(--paper-2); border: 1px solid var(--line);
  display: grid; place-items: center; padding: 10px; min-height: 300px;
}
.vw-stage img { max-width: 100%; max-height: 62vh; object-fit: contain; display: block; }
.vw-side { min-width: 0; }
.vw-h {
  font-size: 10.5px; letter-spacing: .07em; color: var(--ink-3);
  margin: 18px 0 8px; display: flex; align-items: center; gap: 5px; font-weight: 600;
}
.vw-h svg { width: 13px; height: 13px; }
.vw-h5 { font-size: 10.5px; color: var(--ink-3); margin: 10px 0 5px; letter-spacing: .06em; }
.vw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.vw-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  border: 1px solid var(--pine); color: var(--pine); background: var(--pine-wash);
  padding: 2px 8px;
}
.vw-tag.is-dim { border-color: var(--line); color: var(--ink-3); background: var(--paper-2); }
.vw-desc { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin: 0 0 8px; }
.vw-ocr {
  font-family: var(--f-mono); font-size: 11.5px; line-height: 1.65;
  background: var(--paper-2); border: 1px solid var(--line-soft);
  padding: 9px 11px; margin: 0 0 8px; white-space: pre-wrap; word-break: break-all;
  max-height: 180px; overflow: auto;
}
/* 抽屉没有 footer 槽，操作按钮放在侧栏底部 */
.vw-ops {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line);
}

/* ---- 标注选择器 ---- */
.tp-chosen { margin-bottom: 10px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.tp-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  border: 1px solid var(--rust); color: var(--rust); background: var(--rust-wash);
  padding: 2px 4px 2px 8px;
}
.tp-chip button {
  border: none; background: none; cursor: pointer; color: inherit;
  display: grid; place-items: center; padding: 0;
}
.tp-chip button svg { width: 12px; height: 12px; }
.tp-list {
  border: 1px solid var(--line); background: var(--sheet);
  max-height: 260px; overflow: auto; padding: 4px;
}
.tp-row {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; cursor: pointer;
  border-bottom: 1px dotted var(--line-soft); font-size: 13px;
}
.tp-row:last-child { border-bottom: none; }
.tp-row:hover { background: var(--paper-2); }
.tp-name { font-weight: 600; }

/* ---- 上传预览 ---- */
.u-preview { margin-top: 10px; max-height: 160px; overflow: auto; }
.u-item {
  display: flex; align-items: center; gap: 9px; font-size: 12px;
  padding: 4px 0; border-bottom: 1px dotted var(--line-soft);
}
.u-item > span:first-child {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- 按学员查 ---- */
.bs-list { border: 1px solid var(--line); background: var(--sheet); max-width: 520px; }
.bs-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 12px; border: none; border-bottom: 1px solid var(--line-soft);
  background: none; cursor: pointer; font-size: 13px; text-align: left;
  font-family: inherit; color: var(--ink);
}
.bs-row:last-child { border-bottom: none; }
.bs-row:hover { background: var(--paper-2); }

@media (max-width: 900px) {
  .viewer { grid-template-columns: 1fr; }
  .vw-stage img { max-height: 44vh; }
}

/* 助手回答下方附带的照片。图片内容从不经过模型，这里是前端凭 id 单独取的 */
.chat-photos { margin-top: 12px; border-top: 1px dotted var(--line); padding-top: 10px; }
.cp-h {
  font-size: 11px; color: var(--ink-3); letter-spacing: .05em;
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.cp-h svg { width: 13px; height: 13px; }
.cp-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.cp-item {
  display: block; width: 92px; height: 70px; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-2);
  transition: border-color .16s, transform .16s;
}
.cp-item:hover { border-color: var(--rust); transform: translateY(-2px); }
.cp-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
