/* ============================================================
   睿格致内账核算系统 · 现代配色（v2，2026-10-16 重做）
   设计基调：中性灰阶打底 + 单一主色（靛蓝），轻阴影、大圆角、
   弱化边框线、强化留白与层级；支持深色模式自动切换。
   ============================================================ */
:root {
  /* 主色：靛蓝（财务场景稳重又不呆板） */
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --primary-ring: rgba(79, 70, 229, .18);

  /* 中性色阶 */
  --bg: #f6f7f9;
  --card: #ffffff;
  --surface-2: #f9fafb;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;
  --text: #1a1f2b;
  --text-2: #4b5565;
  --muted: #8b95a5;

  /* 语义色 */
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;

  /* 形状与层级 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-3: 0 16px 48px rgba(16, 24, 40, .16);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ============================================================
   左侧可收缩导航栏（侧栏）
   ============================================================ */
:root {
  --side-w: 232px;
  --side-w-collapsed: 68px;
  --side-bg: #ffffff;
  --side-bg2: #fbfcfe;
}

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--side-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 60;
  transition: width .18s ease;
}

/* 顶部品牌 */
.side-head {
  height: 60px; flex: 0 0 60px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.side-head .logo {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .3px;
  box-shadow: 0 4px 12px var(--primary-ring);
}
.side-title { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.side-title b { font-size: 14px; font-weight: 650; color: var(--text); white-space: nowrap; }
.side-title span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* 菜单滚动区 */
.side-scroll {
  flex: 1 1 auto; overflow-x: hidden; overflow-y: auto;
  padding: 10px 10px 4px; scrollbar-width: thin;
}
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.nav-group { margin-bottom: 14px; }
/* v1.70：分组标题行 = 收放按钮（button 重置成文字观感）。
   原来这里是 div，现在要能点，所以补了 border/background/font 的重置。 */
.nav-cap {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; margin: 0; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: .6px; padding: 6px 10px; white-space: nowrap; text-align: left;
  border-radius: var(--r-sm);
}
.nav-cap:hover { color: var(--text-2); background: var(--surface-2); }
.nav-cap:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: -2px; }
.nav-cap .cap-arrow {
  flex: 0 0 12px; width: 12px; height: 12px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  /* 默认就要看得见（淡），否则没人知道标题能点 */
  opacity: .38; transition: transform .16s ease, opacity .16s ease;
}
.nav-cap:hover .cap-arrow,
.nav-cap:focus-visible .cap-arrow { opacity: .85; }
/* 收起后箭头转向右（组标题仍可点，再点就展开） */
.nav-group.folded > .nav-cap { color: var(--text-2); }
.nav-group.folded .cap-arrow { transform: rotate(-90deg); opacity: .55; }
.nav-group.folded .nav-items { display: none; }
/* 折叠组里正好有当前页 → 标题变主色 + 挂个小圆点，别让人找不到自己在哪 */
.nav-group.folded:has(.nav-item.active) > .nav-cap { color: var(--primary-dark); }
.nav-group.folded:has(.nav-item.active) > .nav-cap > span::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 6px;
  border-radius: 50%; background: var(--primary); vertical-align: middle;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px; margin-bottom: 2px;
  border-radius: var(--r-sm); color: var(--text-2);
  font-size: 13.5px; white-space: nowrap;
  transition: background .14s, color .14s;
}
.sidebar .nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar .nav-item.active {
  background: var(--primary-soft); color: var(--primary-dark); font-weight: 600;
}
.sidebar .nav-item.active::before {
  content: ""; position: absolute; left: 0; width: 3px; height: 20px;
  border-radius: 0 3px 3px 0; background: var(--primary);
}
.sidebar .nav-item { position: relative; }
.sidebar .ico {
  width: 18px; height: 18px; flex: 0 0 18px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-label { overflow: hidden; text-overflow: ellipsis; }

/* 底部：用户 + 退出 + 收缩按钮 */
.side-foot {
  flex: 0 0 auto; border-top: 1px solid var(--border);
  padding: 8px 10px 10px; background: var(--side-bg2);
  display: flex; flex-direction: column; gap: 4px;
}
.side-foot .who {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: var(--r-sm); overflow: hidden;
}
.side-foot .avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 13px;
}
.side-foot .who-txt { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.side-foot .who-txt b { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.side-foot .who-txt em { font-size: 11.5px; color: var(--muted); font-style: normal; white-space: nowrap; }

.side-foot .logout {
  display: flex; align-items: center; gap: 10px; height: 34px;
  padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13px; white-space: nowrap;
}
.side-foot .logout:hover { background: var(--danger-soft); color: var(--danger); }

.collapse-btn {
  display: flex; align-items: center; gap: 10px; height: 34px;
  padding: 0 10px; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--muted);
  font-size: 13px; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: background .14s, color .14s;
}
.collapse-btn:hover { background: var(--surface-2); color: var(--text); }
.collapse-btn .ico-expand { display: none; }

/* 主体区 */
.main-wrap {
  margin-left: var(--side-w);
  transition: margin-left .18s ease;
  min-height: 100vh;
}
/* v1.51 页脚（备案号，公网访问后常驻展示） */
.site-foot {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 22px 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-foot .sep { margin: 0 6px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text-2); text-decoration: underline; }

.container { max-width: 1400px; margin: 0 auto; padding: 20px 22px 40px; }

/* 收缩态 */
body.nav-collapsed .sidebar { width: var(--side-w-collapsed); }
body.nav-collapsed .main-wrap { margin-left: var(--side-w-collapsed); }
body.nav-collapsed .side-title,
body.nav-collapsed .nav-label,
body.nav-collapsed .who-txt { display: none; }
body.nav-collapsed .side-head { padding: 0 17px; }
/* 收缩后分组标题变成一条分隔线 */
body.nav-collapsed .nav-cap {
  height: 1px; margin: 10px 12px; padding: 0; font-size: 0;
  background: var(--border); overflow: hidden;
}
/* v1.70：收成窄条时只显示图标，分组折叠必须失效——否则被折的组连图标都不见了 */
body.nav-collapsed .nav-group.folded .nav-items,
html.pre-collapsed .nav-group.folded .nav-items { display: block; }
body.nav-collapsed .nav-cap .cap-arrow,
html.pre-collapsed .nav-cap .cap-arrow { display: none; }
html.pre-collapsed .nav-cap {
  height: 1px; margin: 10px 12px; padding: 0; font-size: 0;
  background: var(--border);
}
body.nav-collapsed .sidebar .nav-item,
body.nav-collapsed .side-foot .logout,
body.nav-collapsed .collapse-btn { justify-content: center; padding: 0; }
body.nav-collapsed .collapse-btn .ico-collapse { display: none; }
body.nav-collapsed .collapse-btn .ico-expand { display: block; }
body.nav-collapsed .side-foot .who { justify-content: center; padding: 6px 0; }
body.nav-collapsed .highlight-tip { display: none; }

/* 首屏防闪：由 head 脚本加在 html 上 */
html.pre-collapsed .sidebar { width: var(--side-w-collapsed); }
html.pre-collapsed .main-wrap { margin-left: var(--side-w-collapsed); }
html.pre-collapsed .side-title,
html.pre-collapsed .nav-label,
html.pre-collapsed .who-txt { display: none; }

.main-wrap.no-side { margin-left: 0; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow-1);
}
.card h3 {
  font-size: 15px; font-weight: 650; margin-bottom: 14px;
  color: var(--text); letter-spacing: -.1px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card p { color: var(--text-2); }

/* ---------- 表格 ---------- */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th, table.list td {
  padding: 10px 12px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.list th {
  background: var(--surface-2); color: var(--muted);
  font-weight: 600; font-size: 12.5px; letter-spacing: .2px;
  position: sticky; top: 0px; z-index: 5;
}
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover td { background: var(--primary-soft); }
table.list tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }

/* ---------- 明细表（2026-10-20 重排：列宽协调 + 操作横排） ---------- */
.table-wrap {
  width: 100%; overflow-x: auto; scrollbar-width: thin;
  margin-bottom: 2px;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
/* 表格宽度取满容器，但不小于内容所需宽度 → 列多时出横向滚动条，而不是把文字挤成一团 */
.table-wrap > table.list { min-width: max-content; }

table.list.dense th, table.list.dense td { padding: 9px 12px; }
table.list.dense th { font-size: 12px; font-weight: 600; }
table.list.dense td { vertical-align: middle; }

/* 操作列固定在右侧：列多时可横向滚动，但按钮始终看得见 */
table.list th.ops, table.list td.ops {
  text-align: right; white-space: nowrap;
  position: sticky; right: 0; z-index: 3;
  background: var(--card);
  box-shadow: -10px 0 12px -10px rgba(16, 24, 40, .18);
}
table.list th.ops { z-index: 6; background: var(--surface-2); }
table.list.dense tbody tr:hover td.ops { background: var(--primary-soft); }

/* 单元格语义 */
td.cell-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.cell-date .sid {
  display: block; font-size: 11px; line-height: 1.35;
  color: var(--muted); font-weight: 400;
}
table.list td.cell-wrap { white-space: normal; min-width: 140px; max-width: 240px; line-height: 1.45; }
table.list td.cell-wrap .cw { display: block; max-width: 240px; }
table.list td.cell-opp .cw-nowrap {
  display: block; max-width: 220px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
td.cell-amt { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
td.cell-src { white-space: nowrap; }
td.cell-src .who { display: block; font-size: 11px; line-height: 1.35; color: var(--muted); }

/* 窄屏：备注、来源两列收起（备注进摘要下方，来源进日期下方小字），给主要列腾空间 */
.sub-note, .src-inline { display: none; }
.src-inline { font-style: normal; }
@media (max-width: 1360px) {
  table.list .col-note, table.list .col-src { display: none; }
  table.list td.cell-wrap .sub-note {
    display: block; margin-top: 2px;
    font-size: 11.5px; line-height: 1.4; color: var(--muted); font-weight: 400;
  }
  .src-inline { display: inline; }
  .src-inline::before { content: " · "; }
  table.list.dense th, table.list.dense td { padding: 9px 8px; }
  table.list td.cell-wrap { min-width: 100px; max-width: 170px; }
  /* 摘要最多两行，超出裁掉（悬停看全文） */
  table.list td.cell-wrap .cw {
    max-width: 150px; max-height: 2.95em; overflow: hidden;
    overflow-wrap: anywhere;
  }
  /* 对方单位过长时单行省略（悬停看全名），把宽度留给摘要 */
  table.list td.cell-opp .cw-nowrap { max-width: 128px; }
  table.list .row-actions .btn.sm { padding: 4px 10px; }
}

/* 账户单元格：宽屏「主体 · 账户」一行，窄屏上下两行（账户在上、主体小字在下） */
.acc-box { display: flex; align-items: baseline; white-space: nowrap; }
.co-name { color: var(--muted); }
.co-sep { color: var(--border-strong); margin: 0 3px; }
@media (max-width: 1360px) {
  .acc-box { flex-direction: column-reverse; align-items: flex-start; }
  .co-name { font-size: 11px; line-height: 1.35; }
  .co-sep { display: none; }
}
.tag.mini { padding: 1px 7px; font-size: 11px; }

/* 行内操作按钮：一律横排，不再竖着叠 */
.row-actions { display: inline-flex; align-items: center; gap: 6px; }
.row-actions form { display: inline-flex; margin: 0; }
.btn.ghost {
  background: transparent; border-color: var(--border-strong); color: var(--text-2);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.ghost.danger { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn.ghost.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* 表单网格：字段自动分行，按钮落在同一行末尾，窄屏不会挤成一团 */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; align-items: end;
}
.form-grid > label.f > input,
.form-grid > label.f > select { width: 100%; }
.form-grid > .btn { justify-self: start; }

/* 卡片顶栏：左标题 + 右操作，替代孤零零的浮空按钮 */
.card-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.card-bar .ttl { font-size: 13.5px; font-weight: 650; letter-spacing: -.1px; }
.card-bar .sub { font-size: 12px; color: var(--muted); }
.card-bar .spacer { flex: 1 1 auto; }

.empty { padding: 44px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 余额情况模块 ---------- */
.bal-top {
  display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  padding: 4px 0 16px; border-bottom: 1px dashed var(--border);
}
.bal-main .t {
  font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px;
}
.bal-main .v {
  font-size: 30px; font-weight: 650; letter-spacing: -.6px; line-height: 1.2;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.bal-main .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bal-main .src-note { margin-left: 8px; color: var(--muted); opacity: .85; }
.bal-side { display: flex; gap: 22px; flex-wrap: wrap; }
.bal-side .r { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.bal-side .r b {
  font-size: 15px; font-weight: 650; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bal-side .r b.plain { font-size: 13px; font-weight: 500; color: var(--text-2); }

.bal-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(166px, 1fr));
  gap: 8px; margin-top: 14px;
}
.bal-item {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 9px 11px; background: var(--surface-2);
}
.bal-item.is-bill { background: transparent; border-style: dashed; }
.bal-item .h { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.bal-item .h .co-name { font-size: 11.5px; }
.bal-item .n {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bal-item .b {
  font-size: 17.5px; font-weight: 650; margin-top: 2px;
  font-variant-numeric: tabular-nums; letter-spacing: -.3px;
}
.bal-item .d {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bal-hint {
  margin-top: 14px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--warn-bg); color: var(--warn); font-size: 12px;
}
.bal-hint b { font-weight: 650; }
.bal-hint a { color: var(--warn); text-decoration: underline; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--primary-soft);
  color: var(--primary-dark);
}
.tag.gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.blue  { background: var(--surface-2); color: var(--link, #2563eb); border: 1px solid var(--border); }
.tag.amber { background: var(--warn-bg); color: var(--warn); }

/* ---------- 表单 ---------- */
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
label.f {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted); font-weight: 500;
}
input, select, textarea {
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 7px 10px; font-size: 13px; font-family: inherit;
  background: var(--card); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
input::placeholder, textarea::placeholder { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 8px 18px; background: var(--primary); color: #fff;
  cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit;
  transition: background .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--primary-dark); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }
.btn.gray {
  background: var(--card); color: var(--text-2); border-color: var(--border-strong);
}
.btn.gray:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn.sm { padding: 4px 12px; font-size: 12px; }

/* 凭证模板卡片操作区：修改/停用/删除 三个按钮同宽同高 */
.tpl-ops .btn { min-width: 64px; }
.tpl-ops form.inline { margin: 0; }

/* ---------- 弹窗 ---------- */
dialog {
  border: none; border-radius: var(--r-lg); padding: 0;
  /* 全局 reset 的 * {margin:0} 会覆盖 UA 默认的 margin:auto → 弹窗贴左上角，这里显式恢复居中 */
  margin: auto;
  width: 580px; max-width: 94vw; box-shadow: var(--shadow-3);
  background: var(--card); color: var(--text);
}
dialog.wide {
  /* 合同类弹窗字段多、还带产品明细表（7 列），580 太挤 → 单独加宽一档 */
  width: 920px; max-width: 96vw;
}
dialog.xwide {
  /* v1.77（⑦B）：合同新增/编辑弹窗内嵌明细表后 920 仍挤（右侧金额列被压窄），再宽一档 */
  width: 1120px; max-width: 97vw;
}
/* 弹窗里的明细表：横向放不下时才滚动，不压窄列宽（韵姐：一眼看全一条明细） */
.itbl-box { overflow-x: auto; }
.itbl-box table { width: 100%; min-width: 820px; }
.itbl-box table input { width: 100%; }
/* 合同表单里的「有效收入 / 预计利润」实时测算条 */
.calc-bar {
  display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline;
  padding: 9px 12px; margin-top: 2px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px;
}
.calc-bar b { font-weight: 650; }
.calc-bar .lb { color: var(--muted); }
.calc-bar .val { font-variant-numeric: tabular-nums; }
dialog.mid {
  /* 往来单位等「字段都是短文本、两列够用」的弹窗 → 介于 580 与 920 之间 */
  width: 780px; max-width: 95vw;
}
dialog::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); }
dialog .dlg-head {
  padding: 16px 20px; font-weight: 650; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
dialog form { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
dialog form .full { grid-column: 1 / -1; }
dialog .dlg-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2);
}

/* ---------- 消息 ---------- */
.alert {
  padding: 11px 15px; border-radius: var(--r-md); margin-bottom: 14px;
  background: var(--primary-soft); border: 1px solid #dfe4ff; color: var(--primary-dark);
}
.alert.warn { background: var(--warn-bg); border-color: #fde9c0; color: var(--warn); }

/* ---------- 筛选条 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters label.f { min-width: 130px; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; gap: 8px; align-items: center; margin-top: 14px;
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
/* v1.67 银行流水页：分页挪到明细表头上方 + 直接选页 */
.bnk-pager { margin: 0 0 10px; }
.pg-jump { display: inline-flex; gap: 6px; align-items: center; }
.pg-jump input[type="number"] {
  width: 64px; padding: 4px 6px; text-align: center;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--card); color: var(--text); font-size: 13px;
}
/* v1.67 银行流水页：明细区内部滚动 + 表头吸顶（暗色主题走 CSS 变量不硬编码） */
.bnk-scroll { max-height: 62vh; overflow: auto; scrollbar-width: thin; }
.bnk-scroll thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-2);
  box-shadow: 0 1px 0 var(--border);
}
.bnk-scroll thead th.ops { z-index: 7; }   /* 右侧操作列：上下+左右双吸顶 */
/* v1.76（⑦C）账簿三表共用的滚动容器 —— 照抄 .bnk-scroll，别另发明写法。
   ⚠️ 表头吸顶缺的不是 sticky（table.list th 全局已有 position:sticky），而是**滚动容器**：
      没有固定高度的容器时，表头要等整个页面滚到顶部才吸住，观感上等于没固定。
   ⚠️ 包的时候别再套一层 .table-wrap（overflow-x:auto 会把它变成滚动容器 → sticky 相对它、失效）。 */
.tbl-scroll { max-height: 62vh; overflow: auto; scrollbar-width: thin; }
.tbl-scroll thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-2);
  box-shadow: 0 1px 0 var(--border);
}
.tbl-scroll.tall { max-height: 70vh; }   /* 科目余额表 253 行，可略高 */
/* 合计行吸底：滚到哪儿都看得见合计 */
.tbl-scroll tfoot td, .tbl-scroll tr.tot td {
  position: sticky; bottom: 0; z-index: 4;
  background: #f7f9fb; box-shadow: 0 -1px 0 var(--border);
}
.pager a {
  padding: 5px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: var(--card); color: var(--text-2);
}
.pager a:hover { background: var(--surface-2); }
.pager a.cur {
  background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600;
}

/* ---------- 仪表盘 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1);
}
.stat .t { color: var(--muted); font-size: 12px; }
.stat .v {
  font-size: 24px; font-weight: 650; margin-top: 4px;
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .container { padding: 16px 14px 32px; }
}
@media (max-width: 700px) {
  /* 小屏自动收成图标条 */
  .sidebar { width: var(--side-w-collapsed); }
  .main-wrap { margin-left: var(--side-w-collapsed); }
  .side-title, .nav-label, .who-txt { display: none; }
  .sidebar .nav-item, .side-foot .logout, .collapse-btn { justify-content: center; padding: 0; }
  .side-foot .who { justify-content: center; padding: 6px 0; }
  .nav-cap { height: 1px; margin: 10px 12px; padding: 0; font-size: 0; background: var(--border); overflow: hidden; }
  /* v1.70：小屏同理——只显示图标，分组折叠与本组箭头一并失效 */
  .nav-group.folded .nav-items { display: block; }
  .nav-cap .cap-arrow { display: none; }
  .collapse-btn { display: none; }
}

/* ---------- 条形图 ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.bar-row .lbl { width: 110px; color: var(--text-2); text-align: right; }
.bar-row .bar {
  height: 18px; border-radius: 5px; min-width: 2px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
}
.bar-row .val { font-variant-numeric: tabular-nums; }

/* ---------- 工具类 ---------- */
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 12px; }

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #818cf8;
    --primary-dark: #a5b4fc;
    --primary-soft: #1e1b4b;
    --primary-ring: rgba(129, 140, 248, .25);
    --bg: #0f1115;
    --card: #171a21;
    --surface-2: #1e222b;
    --border: #2a2f3a;
    --border-strong: #353b48;
    --text: #e8eaee;
    --text-2: #b6bcc8;
    --muted: #7d8593;
    --danger: #f87171;
    --danger-soft: #2a1518;
    --ok: #34d399;
    --ok-soft: #10261f;
    --warn: #fbbf24;
    --warn-bg: #2a2013;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-3: 0 16px 48px rgba(0, 0, 0, .6);
  }
  .sidebar { --side-bg: #13161c; --side-bg2: #101319; }
  .side-foot .avatar { box-shadow: inset 0 0 0 1px var(--border); }
  table.list th { background: #1b1f27; }
  table.list tbody tr:hover td { background: #1c2130; }
  .alert { border-color: #3730a3; }
}

/* ===== B6 主体切换：左上角 = 当前账套，点开列可访问账套 ===== */
details.side-head.co-switch {
  display: block; height: auto; flex: 0 0 auto; padding: 0; overflow: visible;
  border-bottom: 1px solid var(--border); position: relative; z-index: 70;
}
details.side-head.co-switch > summary {
  height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  cursor: pointer; list-style: none; overflow: hidden;
}
details.side-head.co-switch > summary::-webkit-details-marker { display: none; }
details.side-head.co-switch > summary:hover,
details.side-head.co-switch[open] > summary { background: var(--surface-2); }
body.nav-collapsed details.side-head.co-switch > summary { padding: 0 17px; }

.co-menu {
  position: absolute; left: 10px; right: 10px; top: 62px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16); padding: 6px;
  max-height: 62vh; overflow: auto; z-index: 80;
}
.co-menu form { margin: 0; }
.co-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text); cursor: pointer; text-align: left; font: inherit;
}
.co-item:hover { background: var(--surface-2); }
.co-item.cur { background: var(--primary-ring); }
.co-item b { flex: 1 1 auto; font-size: 13px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.co-item span { font-size: 11.5px; color: var(--muted); }
.co-item i { font-style: normal; font-size: 10.5px; color: var(--primary); }
.co-manage { display: block; margin-top: 4px; padding: 8px 10px; font-size: 12px;
  color: var(--muted); border-top: 1px solid var(--border); text-decoration: none; }
.co-manage:hover { color: var(--primary); }

/* ===== v1.56 好会计式凭证表格（录入/编辑页 + 预览页调整弹窗共用） ===== */
.hk-vch{border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--card);}
.hk-head{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:10px 14px;
         border-bottom:1px solid var(--border);background:var(--surface-2);}
.hk-head .hk-title{font-weight:700;font-size:14px;}
.hk-head label{font-size:12.5px;color:var(--text-2);display:flex;align-items:center;gap:5px;}
.hk-head input{font-size:12.5px;padding:3px 6px;}
table.hk-table{width:100%;border-collapse:collapse;font-size:13px;}
table.hk-table th{background:var(--primary);color:var(--card);font-weight:600;
                  padding:7px 6px;border:1px solid var(--primary);font-size:12.5px;text-align:center;}
table.hk-table td{border:1px solid var(--border);padding:6px 8px;vertical-align:top;background:var(--card);}
.hk-digits{display:block;font-size:10px;font-weight:400;opacity:.78;margin-top:1px;letter-spacing:.5px;}
.hk-idx{width:36px;text-align:center;color:var(--muted);vertical-align:middle;}
.hk-op{width:44px;text-align:center;vertical-align:middle;}
.hk-amt{width:150px;}
input.hk-num{width:100%;text-align:right;border:none;background:transparent;font-size:14px;
             font-variant-numeric:tabular-nums;padding:3px 2px;box-shadow:none;}
input.hk-num:focus{background:var(--primary-soft);outline:none;}
.hk-subj select{width:100%;font-size:13px;}
.hk-del{border:none;background:none;color:var(--muted);cursor:pointer;font-size:15px;padding:2px 4px;line-height:1;}
.hk-del:hover{color:var(--danger);}
.hk-addrow{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;
           border-radius:50%;border:none;background:var(--primary);color:var(--card);
           font-size:18px;cursor:pointer;margin:8px 0 0 6px;box-shadow:var(--shadow-1);}
.hk-addrow:hover{background:var(--primary-dark);}
tr.hk-total td{font-weight:700;background:var(--surface-2);font-variant-numeric:tabular-nums;}
tr.hk-total .hk-up{font-weight:600;color:var(--text-2);}
.hk-foot{display:flex;align-items:center;gap:14px;padding:10px 14px;border-top:1px solid var(--border);
         font-size:12.5px;color:var(--muted);}

/* ===== v1.57 凭证表格增强：行内插入 + 固定表头滚动 + 未建档提示 ===== */
.hk-idx{position:relative;}
.hk-seq{display:inline-block;}
button.hk-ins{display:none;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:22px;height:22px;border-radius:50%;border:none;background:var(--primary);color:var(--card);
  font-size:14px;line-height:1;cursor:pointer;padding:0;box-shadow:var(--shadow-1);
  align-items:center;justify-content:center;text-align:center;}
button.hk-ins:hover{background:var(--primary-dark);}
tr:hover button.hk-ins{display:inline-flex;}
tr:hover .hk-seq{visibility:hidden;}
/* 弹窗内：行区滚动（精确高度由 voucher_gen.js fitScroll() 按实测 4 行算，此处仅兜底防 JS 未跑时的极限撑爆）、
   表头吸顶、合计固定在滚动区外 */
.hk-scroll{max-height:60vh;overflow-y:auto;scrollbar-gutter:stable;}
.hk-scroll .hk-table thead th{position:sticky;top:0;z-index:2;}
.hk-tot{border-top:none;}
.hk-tot td{border-top:none;}
#vedit-dlg .hk-table{table-layout:fixed;}
#vedit-dlg .hk-table td{word-break:break-all;}
.vg-newp{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--warn,#b45309);}
button.hk-newp{border:1px dashed var(--primary);background:var(--primary-soft);color:var(--primary);
  font-size:11.5px;border-radius:10px;padding:1px 8px;cursor:pointer;}
button.hk-newp:hover{background:var(--primary);color:var(--card);}
.vg-newp-hint{color:var(--warn,#b45309);}

/* ===== v1.58 凭证表格统一打磨（韵姐截图五点） ===== */
/* ③ 金额格按 11 等分画数位竖线（亿/千万/…/角/分），输入框透明让线透出来 */
.hk-table td:has(> input.hk-num),
tr.hk-total td.hk-amt-cell{
  background-image:repeating-linear-gradient(to right,
    transparent 0, transparent calc(100%/11 - 1px),
    var(--border) calc(100%/11 - 1px), var(--border) calc(100%/11));
  background-color:var(--card);
  padding:2px 4px;
}
tr.hk-total td.hk-amt-cell{background-color:var(--surface-2);text-align:right;
  font-variant-numeric:tabular-nums;padding-right:8px;}
input.hk-num{position:relative;z-index:1;}
/* ④ 摘要输入框去圆角（与好会计一致的直角边） */
.hk-table input[name=e_summary], .hk-table input.e-sum{border-radius:2px;}
/* ⑤ 科目余额小字（科目格内，点击数字开明细账新窗口） */
.subjbal{margin-top:3px;font-size:11.5px;color:var(--muted);}
.subjbal a{color:var(--primary);text-decoration:none;font-variant-numeric:tabular-nums;}
.subjbal a:hover{text-decoration:underline;}

/* v1.58 凭证弹窗：全局 `dialog form` 是两列网格（给档案类弹窗用的），
   凭证弹窗的表单是整表布局，必须覆盖回块级，否则内容被挤成一列 */
#vform-dlg form{display:block;padding:0;}
#vform-dlg .hk-vch{border:none;border-radius:0;}
#vform-dlg .hk-scroll{max-height:60vh;overflow-y:auto;scrollbar-gutter:stable;}
#vform-dlg .hk-scroll .hk-table thead th{position:sticky;top:0;z-index:2;}

/* ===== v1.60 往来单位「完整档案」建档弹窗 + 辅助提示按钮 ===== */
#pqa-dlg{min-width:520px;max-width:660px;}
#pqa-dlg form{display:block;}
.pqa-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;}
.pqa-grid .f{display:flex;flex-direction:column;gap:3px;font-size:12.5px;color:var(--muted,#64748b);}
.pqa-grid input,.pqa-grid select{width:100%;box-sizing:border-box;padding:5px 7px;
  border:1px solid var(--line,#e2e8f0);border-radius:6px;background:var(--card,#fff);
  color:var(--text,#0f172a);font-size:13px;}
.pqa-hint:empty{display:none;}
.pqa-warn{margin:4px 0 8px;padding:7px 10px;border-radius:6px;font-size:12.5px;
  background:var(--warn-soft,#fff7ed);color:var(--warn,#b45309);border:1px dashed var(--warn,#f59e0b);}
.pqa-simrow{display:flex;align-items:center;gap:8px;justify-content:space-between;
  padding:2px 0;}
.pqa-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;}
.pqa-toast{position:fixed;left:50%;bottom:38px;transform:translateX(-50%);z-index:9999;
  background:rgba(15,23,42,.92);color:#fff;padding:8px 16px;border-radius:18px;font-size:13px;}
/* 辅助提示里的「用它 / ＋新增往来单位」 */
.auxhint-sim{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:3px;}
.auxhint-btn{border:1px dashed var(--primary,#6366f1);background:var(--primary-soft,#eef2ff);
  color:var(--primary,#6366f1);font-size:11.5px;border-radius:10px;padding:1px 8px;
  cursor:pointer;white-space:nowrap;}
.auxhint-btn:hover{background:var(--primary,#6366f1);color:#fff;}

/* ============================================================
   v1.69 · 多页签工作区外壳（01 章九 / 对话⑥）
   结构：.wshell（列向 flex，占满视口）
           ├ .tab-strip  顶部页签栏（横向滚，页签多时不挤压）
           ├ .tab-pages  页签容器（每个 .tab-page 内一个 iframe，独立滚动）
           └ .site-foot  备案号（外壳也要展示）
   注意：本文件有全局 reset *{margin:0;padding:0}，尺寸一律显式写。
   ============================================================ */
.wshell { display: flex; flex-direction: column; height: 100vh; min-height: 0; }

.tab-strip {
  flex: 0 0 auto; display: flex; align-items: stretch; gap: 10px;
  /* v1.69b：底色用 --bg（浅灰）而不是近白色 —— 白页签必须浮在灰底上，
     否则页签白底→栏底→内容白底连成一片，看不出"小框"下边界，字看着就飘在上面 */
  padding: 7px 14px 0; background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.tab-strip::-webkit-scrollbar { height: 5px; }
.tab-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.tab-list { display: flex; align-items: flex-end; gap: 3px; flex: 1 1 auto; min-width: 0; }

.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px;
  /* v1.69b：左右内边距对称（原来左 12 / 右 5 → 首页没有 × 时文字偏左）；
     文字用 line-height:30px 让汉字墨迹在 30px 内垂直居中 */
  max-width: 190px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 8px 8px 0 0; background: var(--surface-2); color: var(--text-2);
  font-size: 13px; line-height: 28px; white-space: nowrap;
  transition: background .14s, color .14s;
}
.tab:hover { background: var(--card); color: var(--text); }
.tab.active {
  background: var(--card); color: var(--primary-dark); font-weight: 600;
  /* 激活页签底部投 1px 本色线，盖住 .tab-strip 的下边框 → 页签与内容区连通，
     页签的"框"到这条线为止，不会视觉上拖进内容区 */
  box-shadow: 0 1px 0 0 var(--card);
}
.tab .t { overflow: hidden; text-overflow: ellipsis; }
.tab .x {
  flex: 0 0 15px; width: 15px; height: 15px; line-height: 14px;
  margin-right: -6px;   /* 抵消右侧 padding，关闭按钮贴边但不悬空 */
  text-align: center; border-radius: 50%; font-size: 13px; color: var(--muted);
}
.tab .x:hover { background: var(--danger-soft); color: var(--danger); }
.tab.home .x { display: none; }          /* 首页不可关闭 */

.tab-tools { flex: 0 0 auto; display: flex; align-items: center; padding-bottom: 5px; }
.tab-btn {
  height: 24px; padding: 0 9px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); border-radius: var(--r-sm);
  font-size: 12px; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.tab-btn:hover { background: var(--card); color: var(--text-2); }

/* 页签容器：相对定位 + 每个页签绝对铺满，只显示激活的那一个 */
.tab-pages { flex: 1 1 auto; position: relative; min-height: 0; overflow: hidden; background: var(--bg); }
.tab-page { position: absolute; inset: 0; display: none; }
.tab-page.active { display: block; }
.tab-page iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; }

/* 外壳下的页脚（备案号）压扁一点，别抢工作区高度 */
.wshell .site-foot { flex: 0 0 auto; padding: 6px 22px 10px; }

/* ===== v1.91 · 通用表头筛选（grid_filter.js，像多维表点表头筛）===== */
th.gf-th { position: relative; cursor: pointer; user-select: none; }
th.gf-th .gf-ico {
  display: inline-block; margin-right: 3px; font-size: 10px; line-height: 1;
  color: var(--muted); transition: color .15s;
}
th.gf-th:hover .gf-ico { color: var(--primary); }
th.gf-on { color: var(--primary-dark); }
th.gf-on .gf-ico { color: var(--primary); }
th.gf-on .gf-ico::after { content: "•"; margin-left: 1px; }

.gf-pop {
  position: absolute; z-index: 300; min-width: 230px; max-width: 300px;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(26, 31, 43, .16);
  padding: 10px 10px 8px; display: none;
}
.gf-tip { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.gf-search {
  width: 100%; box-sizing: border-box; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px;
  font-size: 12px; background: var(--surface-2);
}
.gf-list { max-height: 240px; overflow-y: auto; margin-bottom: 6px; }
.gf-opt {
  display: flex; align-items: center; gap: 6px; padding: 4px 4px;
  border-radius: 6px; font-size: 12px; color: var(--text-2); cursor: pointer;
}
.gf-opt:hover { background: var(--primary-soft); }
.gf-opt input { flex: 0 0 auto; }
.gf-range { display: flex; align-items: center; gap: 4px; }
.gf-range .gf-inp { width: 100px; }
.gf-sep { font-size: 11px; color: var(--muted); }
.gf-inp {
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px;
  font-size: 12px; background: var(--surface-2); box-sizing: border-box;
}
.gf-bar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.gf-bar .gf-n { flex: 1; font-size: 11px; color: var(--primary); }
.gf-b { font-size: 12px; padding: 3px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2); }
.gf-bp { background: var(--primary); border-color: var(--primary); color: #fff; }
.gf-clearall {
  margin: 0 0 8px; font-size: 12px; padding: 3px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
}
.gf-clearall-on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ===== v1.92 ⑭ 附件组件 ===== */
.att-drop {
  border: 2px dashed var(--border); border-radius: 8px; padding: 14px 10px;
  text-align: center; font-size: 12.5px; color: var(--muted); cursor: pointer;
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.att-drop:hover, .att-drop.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.att-drop b { color: var(--text-2); }
.att-list { margin-top: 8px; }
.att-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 12.5px;
  border-bottom: 1px solid var(--border); border-radius: 6px;
}
.att-row:hover { background: var(--surface-2); }
.att-name { flex: 1; min-width: 0; }
.att-name a { color: var(--primary); text-decoration: none; word-break: break-all; }
.att-meta { flex: 0 0 auto; color: var(--muted); font-size: 11.5px; }
.att-kind { flex: 0 0 auto; }
.att-ops { flex: 0 0 auto; display: flex; gap: 4px; }
.att-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.att-btn { position: relative; }
.att-badge {
  position: absolute; top: -6px; right: -8px; min-width: 15px; height: 15px;
  border-radius: 8px; background: var(--primary); color: #fff; font-size: 10px;
  line-height: 15px; padding: 0 3px; font-style: normal;
}
.att-zero { color: var(--muted); }
.att-mount .att-row { padding: 4px 6px; }
.att-err { color: #b00020; font-size: 12px; margin-top: 4px; }
.att-ok { color: #1d9e75; font-size: 12px; margin-top: 4px; }

/* ================= v1.93 · ⑧B-3 首页改版 ================= */
/* 三块并排（宽屏）／两列（中屏）／单列（窄屏）。只影响首页，不动任何现有页面。 */
.home-top { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.home-top h3 { margin: 0 0 2px; }
.home-top p { margin: 0; font-size: 12.5px; }
.home-acts { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.home-grid {
  display: grid; gap: 14px;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.05fr) minmax(320px, 1.35fr);
  align-items: start;
}
@media (max-width: 1180px) { .home-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px)  { .home-grid { grid-template-columns: 1fr; } }

.home-card { padding: 14px 16px; }
.home-card h3 { margin: 0 0 10px; font-size: 14px; }
.home-tip { font-size: 11.5px; line-height: 1.6; margin: 10px 0 0; }

/* ① 常用工作区：一个大按钮，不做多入口平铺 */
.ws-entry {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 16px; border-radius: 10px; text-decoration: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; box-shadow: var(--shadow-1); transition: transform .12s;
}
.ws-entry:hover { transform: translateY(-1px); }
.ws-entry b { font-size: 19px; letter-spacing: .5px; }
.ws-entry span { font-size: 12px; opacity: .85; }
.ws-entry i { font-style: normal; font-size: 12.5px; margin-top: 6px; opacity: .95; }

/* ③ 通知 */
.notice-item { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.notice-item:last-of-type { border-bottom: none; }
.notice-item.pinned { background: var(--warn-bg); border-radius: 8px; padding: 9px 10px; }
.notice-hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.notice-hd b { font-size: 13.5px; }
.notice-hd .muted { font-size: 11.5px; }
.notice-bd {
  font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-top: 4px;
  white-space: pre-wrap; word-break: break-word;
}
.notice-ops { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.notice-pub { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.notice-pub summary { cursor: pointer; font-size: 12.5px; color: var(--primary); }
.notice-pub form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.notice-pub label { font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.notice-pub label.inline { flex-direction: row; align-items: center; gap: 6px; }
.notice-pub input[name=title] { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; }
.notice-pub textarea { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; resize: vertical; font-family: inherit; }
.notice-targets { margin-top: 4px; }

/* ================= v1.93 · ⑧B-5 反馈入口 ================= */
.fb-fab {
  position: fixed; right: 22px; bottom: 26px; z-index: 60;
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 22px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 13px;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
}
.fb-fab:hover { background: var(--primary-dark); }
.fb-fab-ico { font-size: 14px; line-height: 1; }
@media (max-width: 700px) { .fb-fab-txt { display: none; } .fb-fab { padding: 10px 12px; } }

.fb-body { padding: 10px 16px 14px; max-height: 78vh; overflow: auto; }
.fb-path { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.fb-path code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.fb-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.fb-body textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: 8px; font-family: inherit; font-size: 13px; resize: vertical;
}
.fb-count { font-size: 11.5px; text-align: right; margin: 2px 2px 8px; }
.fb-shots { border-top: 1px dashed var(--border); padding-top: 10px; }
.fb-shots-hd { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.fb-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 6px 3px 8px; max-width: 260px;
}
.fb-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-chip button {
  border: none; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 14px; line-height: 1; padding: 0 2px;
}
.fb-foot { margin: 10px 0 4px; }
.fb-mine { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 10px; }
.fb-mine-hd { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.fb-mine-row {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; padding: 4px 0; border-bottom: 1px dotted var(--border);
}
.fb-mine-mod { color: var(--muted); font-size: 11.5px; }

/* 侧栏「反馈管理」角标 */
.fb-badge {
  margin-left: auto; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10.5px; line-height: 16px;
  text-align: center; padding: 0 4px;
}

/* ===== v1.95 ⑧B-2 知识库 ===== */
.kb-layout { display: flex; gap: 14px; align-items: flex-start; }
.kb-cats { flex: 0 0 228px; padding-bottom: 10px; }
.kb-main { flex: 1 1 auto; min-width: 0; }
.kb-cat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; margin: 2px 4px; border-radius: 6px;
  color: var(--text); font-size: 13px; text-decoration: none;
}
.kb-cat:hover { background: var(--surface-2); }
.kb-cat.on { background: var(--surface-2); font-weight: 600; }
.kb-cat-row { display: flex; align-items: center; }
.kb-cat-row .kb-cat { flex: 1 1 auto; }
.kb-cat-ops { display: inline-flex; gap: 4px; padding-right: 8px; font-size: 12px; }
.kb-cat-ops a { color: var(--muted); text-decoration: none; }
.kb-cat-ops a:hover { color: var(--text); }
/* 阅读区：服务端渲染的 Markdown（标题/表格/代码块与全站表格风格一致） */
.kb-content { padding: 10px 16px; font-size: 14px; line-height: 1.75; overflow-x: auto; }
.kb-content h3, .kb-content h4, .kb-content h5 { margin: 14px 0 6px; }
.kb-content h3:first-child { margin-top: 2px; }
.kb-content table { border-collapse: collapse; margin: 8px 0 14px; }
.kb-content th, .kb-content td {
  border: 1px solid var(--border); padding: 5px 10px; font-size: 13px; text-align: left;
}
.kb-content th { background: var(--surface-2); font-weight: 600; }
.kb-content pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5;
}
.kb-content pre code { background: none; padding: 0; }
.kb-content code {
  background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-size: 12.5px;
}
.kb-content blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--border);
  color: var(--muted); background: var(--surface-2); border-radius: 0 6px 6px 0;
}
.kb-content a { color: var(--link, #2563eb); }
.kb-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
/* 卡片标题行里的小内联表单（停用/删除文字按钮） */
.inline-form { display: inline; }
button.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--link, #2563eb); font-size: 13px; text-decoration: underline;
}
button.linkish:hover { opacity: .8; }
@media (max-width: 920px) {
  .kb-layout { flex-direction: column; }
  .kb-cats { flex: 1 1 auto; width: 100%; }
}
