:root {
  --ink: #16302b;
  --ink-2: #2b4a43;
  --muted: #62766f;
  --line: #dce6e2;
  --line-strong: #c3d3cd;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #f8fbf9;
  --brand: #146b5a;
  --brand-2: #0e5448;
  --brand-soft: #e3f0eb;
  --gold: #b98a2e;
  --gold-soft: #fbf3e2;
  --danger: #b23b32;
  --danger-soft: #fbeceb;
  --warn: #a86a12;
  --warn-soft: #fdf2df;
  --ok: #1f7a4d;
  --ok-soft: #e6f4ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 49, 44, .06), 0 8px 24px rgba(20, 49, 44, .06);
  --sans: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 14px;
  text-align: center; color: var(--muted); background: var(--bg);
}
.boot-mark {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 14px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  color: #fff; font-family: var(--serif); font-size: 28px;
  display: grid; place-items: center;
}

/* ------------------------------------------------------------ 登录 */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr;
  background: radial-gradient(1200px 600px at 10% 0%, #1b7a66 0%, #0d3f36 48%, #0a2f29 100%);
  color: #eaf4f0;
}
.login-hero { padding: 72px 64px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.login-hero .eyebrow { letter-spacing: .22em; font-size: 12px; color: #9fd2c4; }
.login-hero h1 { font-family: var(--serif); font-size: 42px; font-weight: 600; line-height: 1.25; color: #fff; }
.login-hero p { max-width: 520px; color: #c6ded7; font-size: 15px; }
.login-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.login-tags span {
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: #d7ebe5;
}
.login-card {
  align-self: center; justify-self: center; width: min(420px, 88%);
  background: var(--surface); color: var(--ink); border-radius: 18px;
  padding: 36px 34px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.login-card h2 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-hint {
  margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2);
  border: 1px dashed var(--line-strong); font-size: 12px; color: var(--muted); line-height: 1.9;
}
.login-hint b { color: var(--ink-2); }

/* ------------------------------------------------------------ 外壳 */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0f3f36 0%, #0d3a32 55%, #0a302a 100%);
  color: #dcece7; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #2c9a82, #14604f); color: #fff; font-family: var(--serif); font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-text b { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: .04em; color: #fff; font-weight: 600; }
.brand-text span { font-size: 11px; color: #8fbfb2; letter-spacing: .12em; }
.nav-group { margin-top: 12px; }
.nav-group-title { font-size: 11px; letter-spacing: .16em; color: #79ab9e; padding: 6px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #cfe3dd; font-size: 13.5px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.13); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.nav-ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 11px; color: #7fae9f; line-height: 1.8; border-top: 1px solid rgba(255,255,255,.09); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 26px; background: rgba(244,247,245,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-family: var(--serif); font-weight: 600; }
.topbar .crumb { color: var(--muted); font-size: 12px; }
.topbar-spacer { flex: 1; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); font-size: 12px; border: 1px solid #cbe6d8;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
/* 专线状态：橙色警示，跨页面常驻顶栏。 */
.status-pill.leased { background: #fdf3e3; color: #9a5b00; border-color: #f0dcb6; }
.status-pill.leased i { background: #d9a227; box-shadow: 0 0 0 3px rgba(217, 162, 39, .16); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.content { padding: 24px 26px 56px; max-width: 1320px; width: 100%; }

/* ------------------------------------------------------------ 通用 */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-family: var(--serif); font-weight: 600; }
.page-head .desc { color: var(--muted); font-size: 13px; max-width: 720px; }
.page-head .spacer { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 28px; font-weight: 700; font-family: var(--serif); margin-top: 4px; line-height: 1.1; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat.high .value { color: var(--danger); }
.stat.warn .value { color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  cursor: pointer; font-size: 13px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { color: var(--danger); border-color: #e5c3c0; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.field .help { font-size: 11.5px; color: var(--muted); }
.field .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; outline: none; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,107,90,.1); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
.input.invalid, .textarea.invalid { border-color: var(--danger); background: #fffafa; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  /* 状态徽标必须单行：台账列表状态列过窄时“草稿/已确认”曾被逐字竖排。 */
  white-space: nowrap; flex: none;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #cbe6d8; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb6; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: #ecc9c6; }
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: #ead9b6; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: #c7e2da; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: #fbfdfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.diff-pos { color: var(--danger); font-weight: 600; }
.diff-neg { color: var(--ok); font-weight: 600; }
.row-click { cursor: pointer; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .spacer { flex: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; border: 0; background: transparent; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; opacity: .5; margin-bottom: 8px; }

/* ------------------------------------------------------------ 办事卡片 */
.flow-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; transition: .16s; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
}
.flow-card:hover { transform: translateY(-2px); border-color: #b9d5cc; box-shadow: 0 10px 26px rgba(20,49,44,.1); }
.flow-card .top { display: flex; align-items: center; gap: 8px; }
.flow-card .code { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--muted); }
.flow-card h3 { font-size: 15.5px; }
.flow-card p { color: var(--muted); font-size: 12.5px; line-height: 1.65; margin: 0; }
.flow-card .foot { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }

/* ------------------------------------------------------------ 弹窗/抽屉 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12, 30, 27, .42); z-index: 60;
  display: flex; justify-content: flex-end; animation: fade .16s ease;
}
.modal {
  width: min(720px, 96vw); background: var(--surface); height: 100%; overflow-y: auto;
  box-shadow: -20px 0 60px rgba(0,0,0,.2); animation: slide .2s ease;
  display: flex; flex-direction: column;
}
.modal.wide { width: min(980px, 98vw); }
.modal.center { margin: auto; height: auto; max-height: 90vh; border-radius: 16px; width: min(720px, 94vw); animation: pop .18s ease; }
.modal-head {
  position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 16px 22px;
  border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px;
}
.modal-head h3 { font-size: 17px; font-family: var(--serif); }
.modal-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px 22px 28px; }
.modal-foot {
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: 14px 22px; display: flex; gap: 10px; justify-content: flex-end;
}
@keyframes slide { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------ 结果块 */
.answer { font-size: 14.5px; line-height: 1.85; }
.answer h3 { font-family: var(--serif); font-size: 17px; margin: 18px 0 8px; }
.answer blockquote {
  margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft);
  border-radius: 0 8px 8px 0; color: var(--ink-2);
}
.answer ul, .answer ol { margin: 8px 0 8px 22px; padding: 0; }
.cite-list { display: grid; gap: 10px; margin-top: 16px; }
.cite {
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px;
  padding: 12px 14px; background: var(--gold-soft);
}
.cite .doc { font-weight: 650; font-size: 13px; }
.cite .loc { color: var(--muted); font-size: 11.5px; margin: 2px 0 6px; }
.cite .text { font-size: 13px; color: var(--ink-2); }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: #cbe6d8; }
.chip.no { background: var(--danger-soft); color: var(--danger); border-color: #ecc9c6; }

.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 18px; display: grid; gap: 14px; }
.timeline .item { position: relative; }
.timeline .item::before {
  content: ''; position: absolute; left: -25px; top: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.timeline .at { color: var(--muted); font-size: 11.5px; }
.revision-diff { margin-top: 6px; font-size: 12px; color: var(--text); display: grid; gap: 3px; }
.revision-diff .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.revision-diff .field { font-weight: 600; min-width: 64px; }
.revision-diff .old { color: #9a4b45; text-decoration: line-through; }
.revision-diff .new { color: #146c43; }
.revision-diff .arrow { color: var(--muted); }

.notice {
  padding: 11px 14px; border-radius: 9px; background: var(--warn-soft); border: 1px solid #f0dcb6;
  color: #7a500e; font-size: 12.5px; line-height: 1.7;
}
.notice.info { background: var(--brand-soft); border-color: #c7e2da; color: #14574a; }
.notice.danger { background: var(--danger-soft); border-color: #ecc9c6; color: #8e3029; }

.pre {
  white-space: pre-wrap; word-break: break-word; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
  font-family: var(--serif); font-size: 14.5px; line-height: 1.9; max-height: 460px; overflow: auto;
}

.mini-table { font-size: 12.5px; }
.mini-table th, .mini-table td { padding: 7px 9px; }

.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2f9c84); }

/* 旧单节点 toast 仅保留占位，实际提示由 core/dom.js 的队列渲染。 */
.toast { display: none; }

.toast-root {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 120;
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  pointer-events: none; max-width: 86vw;
}
.toast-item {
  pointer-events: auto; cursor: pointer;
  background: #123c34; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; line-height: 1.5; max-width: 80vw; text-align: center;
  opacity: 0; transform: translateY(12px); transition: opacity .18s, transform .18s;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast-item.show { opacity: 1; transform: translateY(0); }
.toast-item.err { background: #7d2a24; }
.toast-item.warn { background: #8a6210; }
.toast-item.info { background: #1d4f6f; }
.input.is-error, .textarea.is-error { border-color: #b3403a; box-shadow: 0 0 0 3px rgba(179,64,58,.12); }

/* 公文预览：接近 Word 的纸面版式，标题居中、落款右对齐 */
.doc-preview {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 26px 30px; margin: 12px 0; box-shadow: 0 2px 10px rgba(15,40,32,.05);
  font-family: "FangSong", "仿宋_GB2312", "SimSun", serif; color: #1f2d28;
}
.doc-preview .doc-title { text-align: center; font-size: 20px; line-height: 1.7; margin: 4px 0 18px; font-weight: 700; }
.doc-preview .doc-para { font-size: 15px; line-height: 1.95; text-indent: 2em; margin: 0 0 4px; white-space: pre-wrap; }
.doc-preview .doc-sign { text-align: right; font-size: 15px; line-height: 1.9; margin: 2px 0; padding-right: 6px; }
.doc-preview .doc-gap { height: 6px; }
.doc-preview hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.btn.is-blocked { opacity: .62; cursor: not-allowed; }

.file-drop {
  border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 18px;
  text-align: center; color: var(--muted); font-size: 12.5px; background: var(--surface-2); cursor: pointer;
}
.file-drop:hover { border-color: var(--brand); color: var(--brand); }
.file-drop.has { border-style: solid; border-color: #c7e2da; background: var(--brand-soft); color: var(--brand); }

.check-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.check-item.is-error { border-color: #b3403a; box-shadow: 0 0 0 3px rgba(179, 64, 58, .12); background: #fff8f7; }
.check-item .req { font-size: 13.5px; }
.check-item .basis { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.check-item .opts { display: flex; gap: 14px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.check-item .opts label { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; cursor: pointer; }

.search-hit { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.search-hit:hover { background: var(--surface-2); }
.search-hit .t { font-weight: 600; font-size: 13.5px; }
.search-hit .m { color: var(--muted); font-size: 11.5px; }
.search-hit .x { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

.login-error { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { padding: 4px 8px; }
  .nav-group { display: flex; flex-wrap: wrap; margin: 0; }
  .nav-group-title, .sidebar-foot { display: none; }
  .nav-item { width: auto; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .content { padding: 18px 14px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .toolbar, .form-actions, .modal-foot, .no-print { display: none !important; }
  .shell { display: block; }
  .modal-backdrop { position: static; background: none; }
  .modal { width: 100%; box-shadow: none; height: auto; }
  body { background: #fff; }
}

/* R75 适老化：大字号与高对比（需求 5.4） */
html.gc-large { font-size: 17px; }
html.gc-large body { font-size: 16px; }
html.gc-large .btn, html.gc-large .nav-item, html.gc-large .tab { font-size: 15px; }
html.gc-large .input, html.gc-large .select, html.gc-large .textarea { font-size: 16px; }
html.gc-large .hint, html.gc-large .desc, html.gc-large .help { font-size: 14px; }
html.gc-contrast body { background: #000; color: #fff; }
html.gc-contrast .main, html.gc-contrast .content { background: #000; color: #fff; }
html.gc-contrast .card, html.gc-contrast .topbar, html.gc-contrast .sidebar { background: #111; color: #fff; border-color: #666; }
html.gc-contrast .input, html.gc-contrast .select, html.gc-contrast .textarea { background: #000; color: #fff; border-color: #fff; }
html.gc-contrast .btn { background: #111; color: #fff; border-color: #fff; }
html.gc-contrast .btn-primary { background: #ffd400; color: #000; border-color: #ffd400; }
html.gc-contrast .notice, html.gc-contrast .badge { background: #111; color: #fff; border-color: #888; }
html.gc-contrast a { color: #ffd400; }
html.gc-contrast table th { background: #222; color: #fff; }
html.gc-contrast .topbar { border-bottom: 1px solid #666; }

/* R80 内嵌模式：磐石ai 业务卡片在右侧抽屉打开时，只显示当前业务页 */
html.gc-embed .shell { grid-template-columns: 1fr; }
html.gc-embed .sidebar { display: none !important; }
html.gc-embed .main { min-width: 0; }
html.gc-embed .topbar { padding-left: 16px; }


/* ------------------------------------------------------------ R127 增量：横线处直接填写 */
/* AI 正文/文书预览里的 ________ 变成可点击横线；点击后原地输入，保存写回正文。
 * 颜色用品牌红，和“可编辑”状态区分；打印/Word 仍使用原始下划线或已填写文本。 */
.gc-blank {
  display: inline-block;
  min-width: 4em;
  margin: 0 2px;
  padding: 0 4px;
  border-bottom: 1.5px solid currentColor;
  border-radius: 3px 3px 0 0;
  color: #8a94a3;
  font-size: .92em;
  line-height: 1.45;
  cursor: text;
  vertical-align: baseline;
  transition: background .15s, color .15s;
}
.gc-blank::before { content: '点击填写'; font-size: .78em; letter-spacing: .02em; }
.gc-blank:hover,
.gc-blank:focus { background: rgba(200, 16, 46, .07); color: #a50f1b; outline: none; }
.gc-blank-input {
  display: inline-block;
  min-width: 5em;
  max-width: min(24em, 100%);
  margin: 0 2px;
  padding: 0 4px;
  border: 0;
  border-bottom: 2px solid #c8102e;
  border-radius: 3px 3px 0 0;
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1.45;
  outline: none;
  vertical-align: baseline;
}
.gc-blank-input::placeholder { color: #a8b0bd; font-size: .78em; }
.gc-blank-filled { border-bottom: 1px solid rgba(200, 16, 46, .35); padding: 0 2px; }
html.gc-contrast .gc-blank-input { background: #000; color: #fff; border-bottom-color: #ffd400; }
@media (max-width: 640px) {
  .gc-blank { min-width: 3.2em; }
  .gc-blank-input { min-width: 4.2em; }
}

/* R140：通知入口与站内信列表 */
.notify-btn { position: relative; }
.notify-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin-left: 5px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10.5px; line-height: 1; font-weight: 700;
}
.notify-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.notify-item { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff; }
.notify-item.is-unread { border-color: #e4c98f; background: #fffdf5; }
.notify-item-head { display: flex; gap: 10px; align-items: baseline; }
.notify-item-head b { flex: 1; font-size: 13.5px; }
.notify-item-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.notify-item-body { margin-top: 5px; color: #3c4d56; font-size: 12.5px; line-height: 1.7; word-break: break-word; }
.notify-item-meta { display: flex; gap: 6px; align-items: center; margin-top: 7px; }

/* R143：已作废单据水印（结果卡） */
.voided-card { position: relative; overflow: hidden; }
.voided-card::after {
  content: "已作废";
  position: absolute; right: 24px; top: 46%;
  transform: rotate(-18deg);
  color: var(--danger); opacity: .10;
  font-size: 54px; font-weight: 800; letter-spacing: 8px;
  pointer-events: none; user-select: none;
}
/* R152：子账号动态明细（文件来源、操作趋势、筛选与分页） */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 160px; }
.file-sources { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.file-sources .badge { font-weight: 400; }
.file-sources .more { color: var(--muted); font-size: 12px; }
.usage-trend-wrap { margin: 2px 0 16px; }
.usage-trend-caption { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.usage-trend { display: flex; align-items: flex-end; gap: 2px; height: 64px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.usage-trend .bar { flex: 1; min-width: 2px; background: var(--brand); opacity: .55; border-radius: 2px 2px 0 0; }
.usage-trend .bar:hover { opacity: 1; }
.usage-trend .bar.zero { background: var(--line-strong); opacity: .45; }
.feature-block { border-top: 1px solid rgba(0,0,0,.06); padding: 4px 0; }
.feature-block summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 120px 1fr 56px 132px; gap: 10px; align-items: center; padding: 6px 0; }
.feature-block summary::-webkit-details-marker { display: none; }
.feature-block .feature-name { font-weight: 600; }
.feature-block summary b { text-align: right; }
.feature-block .feature-last { color: #8a9a94; font-size: 12px; text-align: right; }
.feature-actions { margin: 2px 0 8px 14px; display: grid; gap: 2px; }
.feature-action { display: grid; grid-template-columns: 1fr 56px 132px; gap: 10px; padding: 3px 0; font-size: 12.5px; color: var(--ink-2); border-top: 1px dashed rgba(0,0,0,.04); }
.feature-action b { text-align: right; }
.feature-action span:last-child { color: #8a9a94; font-size: 12px; text-align: right; }
.detail-text { white-space: pre-wrap; word-break: break-word; max-width: 520px; line-height: 1.6; }
.load-more { display: flex; justify-content: center; padding: 12px 0 2px; }
@media (max-width: 760px) {
  .feature-block summary { grid-template-columns: 100px 1fr 40px 92px; }
  .feature-action { grid-template-columns: 1fr 40px 92px; }
}
.file-name { overflow-wrap: anywhere; word-break: normal; }
.feature-block summary .feature-name::before { content: "▸"; display: inline-block; margin-right: 6px; color: var(--muted); transition: transform .15s; }
.feature-block[open] summary .feature-name::before { transform: rotate(90deg); }

.file-table td:first-child { min-width: 220px; }
.file-table td:nth-child(3), .file-table td:nth-child(4) { white-space: nowrap; }
.timeline-table td:nth-child(1), .timeline-table td:nth-child(2), .timeline-table td:nth-child(3), .timeline-table td:nth-child(6) { white-space: nowrap; }
