/* ============ 碳账房协同云 · 设计令牌 ============ */
@font-face {
  font-family: "MiSans";
  src: url("./assets/fonts/MiSans.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Alimama ShuHeiTi";
  src: url("./assets/fonts/AlimamaShuHeiTi.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Liter";
  src: url("./assets/fonts/Liter.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --green-deep: #0b3b30;     /* 侧边栏深绿 */
  --green-deep-2: #0e3a2c;
  --green-primary: #165f49;  /* 主绿 */
  --green-btn: #14532d;      /* 实心按钮深绿 */
  --green-btn-hover: #0f3f22;
  --accent: #e8f56d;         /* 荧光黄绿强调 */
  --accent-soft: #f0fa91;
  --ink: #0c0c0c;
  --ink-2: #14352a;
  --muted: #6b7f74;
  --muted-2: #9aa8a0;
  --page-bg: #f3f5ef;        /* 浅灰绿主背景 */
  --card: #ffffff;
  --border: #dfe7e0;
  --border-soft: #eef2ec;
  --mint: #b0ffc4;           /* hero 网格 */

  --red: #a53b2d;  --red-bg: #fbe9e7;
  --orange: #c2681e; --orange-bg: #fdeede;
  --yellow: #b88a13; --yellow-bg: #fbf3d3;
  --safe: #2f8f4f; --safe-bg: #e3f5e8;

  --font-display: "Alimama ShuHeiTi", "MiSans", "PingFang SC", sans-serif;
  --font-body: "MiSans", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-num: "Liter", "MiSans", monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11,59,48,.04), 0 6px 20px rgba(11,59,48,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* ============ 登录页 ============ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(184,245,109,.18), transparent 60%),
    linear-gradient(135deg, #0b3b30 0%, #0e3a2c 55%, #082a21 100%);
}
.login-card {
  width: 400px; max-width: 92vw;
  background: #fff; border-radius: 20px; padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #165f49, #0b3b30);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 22px; box-shadow: inset 0 0 0 1px rgba(184,245,109,.4);
}
.login-brand h1 { font-family: var(--font-display); font-size: 20px; margin: 0; color: var(--green-deep); letter-spacing: .5px; }
.login-brand .sub { font-size: 10px; letter-spacing: 2px; color: var(--muted); margin-top: 2px; }
.login-card label { display: block; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; font-weight: 600; }
.login-card input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14px; outline: none; transition: border-color .15s;
}
.login-card input:focus { border-color: var(--green-primary); }
.login-btn {
  width: 100%; margin-top: 22px; padding: 12px; border: none; border-radius: 10px;
  background: var(--green-btn); color: #fff; font-size: 15px; font-weight: 700;
  transition: background .15s;
}
.login-btn:hover { background: var(--green-btn-hover); }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }
.login-err { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 16px; }

/* ============ 应用骨架 ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px;
  background: linear-gradient(180deg, #0c3d30 0%, #0b3b30 60%, #082a21 100%);
  color: #eafff4; padding: 18px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-logo { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }
.sb-logo .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #1c7a57, #0b3b30); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(184,245,109,.35);
}
.sb-logo .t { font-family: var(--font-display); font-size: 16px; line-height: 1.1; }
.sb-logo .t small { display: block; font-family: var(--font-body); font-size: 9px; letter-spacing: 1.6px; color: #8fc7ad; font-weight: 400; margin-top: 2px; }
.sb-group { font-size: 11px; color: #7fb79c; padding: 12px 8px 4px; }
.sb-group.b { font-family: var(--font-display); color: #eafff4; font-size: 13px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #cfeede; font-size: 14px; cursor: pointer; position: relative; user-select: none;
  transition: background .12s;
}
.sb-item:hover { background: rgba(255,255,255,.06); }
.sb-item.active { background: var(--accent); color: #0b3b30; font-weight: 700; }
.sb-item .ic { width: 18px; text-align: center; opacity: .9; }
.sb-item .badge {
  margin-left: auto; background: #e8f56d; color: #0b3b30; font-size: 11px; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center;
}
.sb-item.active .badge { background: #0b3b30; color: #e8f56d; }
.sb-newbtn {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; text-align: center;
  border: 1.5px solid rgba(184,245,109,.5); color: #e8f56d; font-weight: 600; font-size: 13px;
  background: transparent; transition: background .12s;
}
.sb-newbtn:hover { background: rgba(184,245,109,.12); }
.sb-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #7fb79c; }
.sb-foot .dot { color: #6ee7a8; }
.sb-foot .co { margin-top: 8px; color: #5e9a82; line-height: 1.4; }

/* ============ 主内容 ============ */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 12px; color: var(--muted); }
.topbar .crumb b { display: block; font-size: 18px; color: var(--ink); font-family: var(--font-display); margin-top: 2px; }
.topbar .tools { display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: 12px; background: #f1f4ef; color: var(--muted); border: 1px solid var(--border-soft);
}
.pill.demo { background: #fbf3d3; color: #9a7a10; border-color: #f1e4a8; }
.seg { display: inline-flex; background: #eef2ec; border-radius: 999px; padding: 3px; }
.seg button { border: none; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--green-btn); color: #fff; font-weight: 600; }
.btn {
  border: none; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 700;
  background: var(--green-btn); color: #fff; transition: background .12s;
}
.btn:hover { background: var(--green-btn-hover); }
.btn.ghost { background: #fff; color: var(--green-primary); border: 1.5px solid var(--border); }
.btn.ghost:hover { background: #f3f7f3; }
.btn.accent { background: var(--accent); color: #0b3b30; }
.btn.accent:hover { background: #dcee55; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #8e2f23; }
.btn.sm { padding: 6px 12px; font-size: 12px; }

.views { padding: 22px 26px 60px; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* ============ Hero ============ */
.hero {
  position: relative; border-radius: 20px; overflow: hidden; color: #eafff4;
  background:
    linear-gradient(135deg, #0f3d2e 0%, #0b3b30 60%, #072a20 100%);
  padding: 30px 34px; display: flex; gap: 30px; min-height: 188px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(176,255,196,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(176,255,196,.06) 1px, transparent 1px);
  background-size: 26px 26px; pointer-events: none;
}
.hero::after { content:""; position:absolute; right:-40px; top:-40px; width:220px; height:220px; background: radial-gradient(circle, rgba(184,245,109,.18), transparent 70%); }
.hero-main { flex: 1; position: relative; z-index: 1; }
.hero-tag { font-size: 12px; color: #9fe3c0; letter-spacing: 1px; }
.hero h2 { font-family: var(--font-display); font-size: 30px; line-height: 1.2; margin: 10px 0 8px; color: #fff; }
.hero p { color: #c7e9d8; font-size: 13px; max-width: 560px; margin: 0 0 16px; }
.hero-actions { display: flex; gap: 10px; }
.hero .btn.accent { background: var(--accent); color: #0b3b30; }
.hero .btn.line { background: transparent; color: #eafff4; border: 1.5px solid rgba(234,255,244,.45); }
.hero .btn.line:hover { background: rgba(255,255,255,.08); }
.hero-stat { position: relative; z-index: 1; border-left: 1px solid rgba(255,255,255,.16); padding-left: 26px; min-width: 220px; }
.hero-stat .lbl { font-size: 12px; color: #9fe3c0; }
.hero-stat .nums { display: flex; gap: 18px; margin-top: 8px; }
.hero-stat .nums div { text-align: center; }
.hero-stat .nums b { font-family: var(--font-num); font-size: 32px; color: var(--accent); display: block; line-height: 1; }
.hero-stat .nums span { font-size: 11px; color: #bfe6d3; }
.hero-stat .synced { margin-top: 14px; font-size: 11px; color: #9fe3c0; }

/* ============ 卡片 & 区块 ============ */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 26px 0 14px; }
.section-head .tag { font-size: 12px; color: var(--green-primary); font-weight: 700; letter-spacing: 1px; }
.section-head .tag .gray { color: var(--muted); font-weight: 400; margin-left: 8px; }
.section-head h3 { font-family: var(--font-display); font-size: 19px; margin: 6px 0 0; color: var(--ink); }
.section-head a.link { color: var(--green-primary); font-size: 13px; font-weight: 600; }

.grid-cards { display: grid; gap: 14px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-9 { grid-template-columns: repeat(9, 1fr); }
@media (max-width: 1200px) { .cols-4 { grid-template-columns: repeat(2,1fr);} .cols-9{grid-template-columns:repeat(3,1fr);} .cols-3{grid-template-columns:repeat(2,1fr);} }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat-card .lbl { font-size: 12px; color: var(--muted); }
.stat-card .val { font-family: var(--font-num); font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1.1; margin: 6px 0 2px; }
.stat-card .val.danger { color: var(--red); }
.stat-card .sub { font-size: 12px; color: var(--muted-2); }

.sop-card { text-align: center; padding: 14px 8px; position: relative; }
.sop-card .no { font-size: 11px; color: var(--green-primary); font-weight: 700; }
.sop-card .name { font-size: 12px; color: var(--ink-2); margin: 4px 0 8px; min-height: 32px; display: flex; align-items: center; justify-content: center; }
.sop-card .cnt { font-family: var(--font-num); font-size: 26px; font-weight: 700; color: var(--ink); }
.sop-card::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 10px; height: 3px; background: var(--green-primary); border-radius: 2px; }

/* ============ 表格 ============ */
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; flex: 1; min-width: 280px; max-width: 460px; }
.search-box input { border: none; outline: none; flex: 1; font-size: 13px; background: transparent; }
.filters { display: flex; gap: 10px; align-items: center; }
.filters select { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 13px; background: #fff; color: var(--ink-2); }
.rec-count { font-size: 12px; color: var(--muted); }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 13px 14px; background: #f7faf5; border-bottom: 1px solid var(--border); }
table.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: #fafdf9; }
.cust-name { font-weight: 700; color: var(--ink); }
.cust-code { font-size: 11px; color: var(--muted-2); font-family: var(--font-num); }
.cust-region { font-size: 12px; color: var(--muted); }
.type-b { font-weight: 700; color: var(--ink-2); }
.type-s { font-size: 12px; color: var(--muted); }
.stage-no { font-family: var(--font-num); font-size: 20px; font-weight: 700; color: var(--green-primary); }
.stage-name { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.progress { display: flex; align-items: center; gap: 8px; }
.progress .bar { flex: 1; height: 7px; background: #eef2ec; border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress .bar i { display: block; height: 100%; background: var(--green-primary); border-radius: 99px; }
.progress .pct { font-size: 12px; color: var(--muted); font-family: var(--font-num); }
.owner { font-weight: 700; color: var(--ink-2); }
.owner-s { font-size: 12px; color: var(--muted); }
.owner-date { font-size: 11px; color: var(--muted-2); font-family: var(--font-num); }
.risk-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.risk-green { background: var(--safe-bg); color: var(--safe); }
.risk-yellow { background: var(--yellow-bg); color: var(--yellow); }
.risk-orange { background: var(--orange-bg); color: var(--orange); }
.risk-red { background: var(--red-bg); color: var(--red); }
.row-link { color: var(--green-primary); font-weight: 600; font-size: 13px; }

/* ============ 任务 ============ */
.task-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.task-stats .card { display: flex; flex-direction: column; }
.task-stats b { font-family: var(--font-num); font-size: 30px; color: var(--green-primary); }
.task-stats span { font-size: 12px; color: var(--muted); }
.task-group .gh { font-family: var(--font-display); font-size: 15px; margin: 18px 0 10px; color: var(--ink); }
.task-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 10px; }
.task-item .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cdd8d0; flex: 0 0 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.task-item.done .check { background: var(--green-primary); border-color: var(--green-primary); }
.task-item.done .t-title { text-decoration: line-through; color: var(--muted); }
.task-item .t-title { font-weight: 700; color: var(--ink); }
.task-item .t-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.task-item .t-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tag-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-urgent { background: var(--red-bg); color: var(--red); }
.tag-normal { background: #eef2ec; color: var(--muted); }
.due { font-size: 12px; color: var(--muted); font-family: var(--font-num); }

/* ============ 风险 ============ */
.risk-levels { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width:1200px){ .risk-levels{grid-template-columns:repeat(2,1fr);} }
.level-card { border-top: 4px solid; }
.level-card.red { border-top-color: var(--red); }
.level-card.orange { border-top-color: var(--orange); }
.level-card.yellow { border-top-color: var(--yellow); }
.level-card.green { border-top-color: var(--safe); }
.level-card .lv { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.level-card.red .lv { background: var(--red-bg); color: var(--red); }
.level-card.orange .lv { background: var(--orange-bg); color: var(--orange); }
.level-card.yellow .lv { background: var(--yellow-bg); color: var(--yellow); }
.level-card.green .lv { background: var(--safe-bg); color: var(--safe); }
.level-card h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 16px; }
.level-card p { font-size: 12px; color: var(--muted); margin: 0; }
.risk-rec { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 10px; }
.risk-rec .lv { flex: 0 0 26px; }
.risk-rec .r-body { flex: 1; }
.risk-rec .r-title { font-weight: 700; color: var(--ink); }
.risk-rec .r-desc { font-size: 12px; color: var(--muted); margin: 4px 0; }
.risk-rec .r-meta { font-size: 12px; color: var(--green-primary); }

.banner-card { background: linear-gradient(135deg,#0f3d2e,#0b3b30); color: #eafff4; border-radius: var(--radius); padding: 20px 24px; display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.banner-card .shield { font-size: 26px; }
.banner-card h4 { margin: 0; font-family: var(--font-display); font-size: 17px; }
.banner-card p { margin: 4px 0 0; font-size: 12px; color: #bfe6d3; }

/* ============ 电子手册 ============ */
.handbook-hero { position: relative; border-radius: 20px; overflow: hidden; color: #eafff4; background: linear-gradient(135deg,#0f3d2e,#0b3b30); padding: 28px 32px; display: flex; gap: 28px; }
.handbook-hero::before { content:""; position:absolute; inset:0; background-image: linear-gradient(rgba(176,255,196,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(176,255,196,.06) 1px,transparent 1px); background-size: 26px 26px; }
.hb-main { flex: 1; position: relative; z-index: 1; }
.hb-main .badge { font-size: 12px; color: #9fe3c0; }
.hb-main h2 { font-family: var(--font-display); font-size: 26px; color: #fff; margin: 8px 0; }
.hb-main p { color: #c7e9d8; font-size: 13px; max-width: 540px; }
.hb-actions { display: flex; gap: 10px; margin-top: 14px; }
.hb-stat { position: relative; z-index: 1; border-left: 1px solid rgba(255,255,255,.16); padding-left: 24px; min-width: 210px; }
.hb-stat .lbl { font-size: 12px; color: #9fe3c0; }
.hb-stat .big { font-family: var(--font-num); font-size: 40px; color: var(--accent); }
.hb-stat .bar { height: 7px; background: rgba(255,255,255,.16); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.hb-stat .bar i { display: block; height: 100%; background: var(--accent); }
.hb-stat .synced { font-size: 11px; color: #9fe3c0; }

/* 原版 chapter-browser：上排「目录 | 章节详情」两列并排等高，下排阅读器通栏（倒置品字形）。
   .page-reader 是 chapter-browser 的兄弟节点，不属于右列，因此阅读器左边与目录卡左边缘对齐。 */
.hb-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; margin-top: 16px; align-items: stretch; }
@media (max-width: 1000px){ .hb-layout{grid-template-columns:1fr;} }
.hb-toc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.hb-toc .toc-head { display: flex; justify-content: space-between; padding: 10px 12px; font-family: var(--font-display); font-size: 15px; }
.hb-toc .toc-head .v { font-size: 12px; color: var(--muted); font-weight: 400; }
.toc-item { display: flex; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.toc-item:hover { background: #f3f7f3; }
.toc-item.on { background: var(--green-primary); color: #fff; }
.toc-item .no { font-family: var(--font-num); font-weight: 700; }
.toc-item .pg { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.toc-item.on .pg { color: #d8f0e3; }
.hb-content { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.hb-content .pg-tag { display: inline-block; background: var(--safe-bg); color: var(--safe); font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; font-family: var(--font-num); }
.hb-content h3 { font-family: var(--font-display); font-size: 24px; margin: 7px 0 8px; }
.hb-content .desc { color: var(--muted); font-size: 13px; line-height: 1.7; }
/* 原版 chapter-output / tag-row：普通小字 + 方角标签，不带背景框 */
.hb-content .callout { margin-top: 13px; font-size: 12px; color: var(--ink-2); }
.hb-content .callout strong { color: var(--green-primary); font-weight: 700; }
.hb-tags { display: flex; gap: 7px; flex-wrap: wrap; margin: 16px 0 0; }
.hb-tags span, .hb-tags button.hb-tag { min-height: 30px; display: inline-flex; align-items: center; background: #f0f3ec; border: 1px solid var(--border); border-radius: 6px; color: var(--green-primary); font-size: 10px; padding: 0 10px; }
.hb-tags button.hb-tag { cursor: pointer; font-family: inherit; line-height: 1.6; transition: border-color .15s, background .15s; }
.hb-tags button.hb-tag:hover { border-color: var(--green-primary); background: var(--safe-bg); }
.node-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 800px){ .node-grid{grid-template-columns:1fr;} }
.node { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; }
.node .pg { font-family: var(--font-num); font-weight: 700; color: var(--green-primary); font-size: 15px; }
.node .nt { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.node .ns { font-size: 12px; color: var(--muted); margin-top: 2px; }
.node.on { background: var(--green-primary); border-color: var(--green-primary); }
.node.on .pg, .node.on .nt { color: #fff; }
.node.on .ns { color: #d8f0e3; }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(8,30,24,.45); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 100; overflow: auto; }
.modal { width: 620px; max-width: 96vw; background: #fff; border-radius: 16px; padding: 24px 26px; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal .m-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal .m-tag { font-size: 12px; color: var(--green-primary); font-weight: 700; }
.modal h3 { font-family: var(--font-display); font-size: 22px; margin: 6px 0 4px; }
.modal .m-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.modal .x { background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; outline: none; transition: border-color .12s; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-primary); }
.field textarea { resize: vertical; min-height: 70px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.station-hint { font-size: 12px; color: var(--muted); align-self: flex-end; padding-bottom: 10px; }

/* ============ Toast ============ */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #0b3b30; color: #eafff4; padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: toastin .2s ease; }
@keyframes toastin { from {opacity:0; transform: translate(-50%,8px);} to {opacity:1; transform: translateX(-50%);} }

/* Kimi 浮标 */
.kimi-fab { position: fixed; right: 22px; bottom: 22px; background: #0c0c0c; color: #fff; border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 700; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; align-items: center; gap: 6px; }

/* ============ 窄屏 / 小窗口适配 ============ */
@media (max-width: 900px) {
  .sidebar { width: 190px; flex-basis: 190px; padding: 14px 10px; }
  .sb-logo .t { font-size: 12px; }
  .topbar { height: auto; min-height: 60px; padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar .tools { flex-wrap: wrap; gap: 6px; }
  .views { padding: 16px 16px 50px; }
  .view { overflow-x: auto; }
  .cols-9 { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 30px 24px; }
  .modal { max-width: 94vw; }
  table.tbl { min-width: 880px; }
  .btn { white-space: nowrap; }
  .kimi-fab { display: none; }
}
@media (max-width: 640px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; height: auto; position: static; padding: 12px; }
  .sb-group, .sb-foot { display: none; }
  .sb-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
  .sb-item { padding: 7px 9px; font-size: 12px; }
  .sb-newbtn { margin-top: 10px; width: 100%; }
  .kimi-fab { display: none; }
  .cols-4, .cols-9, .cols-3 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .login-card { padding: 26px 20px; }
}

/* ============ 电子手册 V9.3 · Hero / 阅读器（对齐原站） ============ */
.handbook-hero {
  display: grid; grid-template-columns: 1fr 260px; gap: 36px;
  padding: 36px 40px; border-radius: 16px; color: #edf5ef;
  background: linear-gradient(120deg, #0c0c0c, #0b3b30 70%, #165f49);
}
.handbook-hero::before { display: none; }
.handbook-hero-copy { position: relative; z-index: 1; }
.hb-kicker { font-size: 12px; color: #c8d8cc; letter-spacing: .5px; display: flex; align-items: center; gap: 7px; }
.hb-kicker span { font-size: 14px; color: var(--accent); }
.handbook-hero h1 {
  max-width: 680px; margin: 12px 0; font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px); line-height: 1.2; color: #fff;
}
.handbook-hero-copy > p { max-width: 650px; margin: 0; color: #d2e1d7; font-size: 14px; line-height: 1.7; }
.handbook-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 700;
  border: 1.5px solid transparent; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.button.lime { color: #0c0c0c; background: var(--accent); border-color: var(--accent); }
.button.lime:hover { background: #f0fa91; border-color: #f0fa91; }
.button.ghost-light { color: #eef6ef; background: transparent; border-color: rgba(238,246,239,.3); }
.button.ghost-light:hover { border-color: var(--mint); color: var(--mint); }
.reading-meter {
  display: grid; align-content: center; gap: 10px;
  padding-left: 28px; border-left: 1px solid rgba(197,199,178,.22); position: relative; z-index: 1;
}
.reading-meter > span { color: #c5d7ca; font-size: 12px; }
.reading-meter strong { font-family: var(--font-num); color: var(--accent); font-size: 48px; font-weight: 400; line-height: 1; }
.reading-meter strong small { margin-left: 5px; color: #e1eae3; font-size: 13px; font-family: var(--font-body); }
.meter-track { height: 4px; background: rgba(255,255,255,.16); border-radius: 99px; overflow: hidden; }
.meter-track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s; }
.reading-meter p { margin: 0; color: #b9cdc0; font-size: 10px; }

.text-button { background: none; border: none; color: var(--green-primary); font-size: 13px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.hb-results { display: grid; gap: 8px; margin-bottom: 14px; }
.hb-result {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px;
}
.hb-result:hover { border-color: var(--green-primary); background: #f8fcf8; }
.hb-result .rt { background: var(--safe-bg); color: var(--safe); font-size: 11px; padding: 2px 7px; border-radius: 5px; flex: none; }
.hb-result b { font-weight: 700; color: var(--ink-2); flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-result .rs { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-result .rp { margin-left: auto; font-family: var(--font-num); color: var(--green-primary); font-weight: 700; flex: none; }
.hb-noresult { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; color: var(--muted); font-size: 13px; }

/* 原版 page-strip：auto-fill 小方格，未占满的列由容器底色铺出来（右上方留白） */
.node-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 1px;
  margin-top: 22px; padding: 1px; background: var(--border); border: 1px solid var(--border);
}
.node {
  position: relative; background: #f7f9f4; border: none; border-radius: 0;
  padding: 11px; min-height: 82px; display: grid; align-content: start; gap: 4px;
  cursor: pointer; text-align: left;
}
.node:hover { background: #eaf0e5; }
.node .pg { font-family: var(--font-num); font-size: 16px; font-weight: 700; color: var(--muted-2); }
.node .nt { font-size: 10px; line-height: 1.45; color: var(--muted); font-weight: 400; }
.node .tick { position: absolute; top: 9px; right: 9px; font-size: 12px; color: var(--safe); }
.node.on { background: var(--green-primary); }
.node.on:hover { background: #12513e; }
.node.on .pg, .node.on .nt { color: #fff; }
.node.on .tick { color: var(--accent); }

/* 阅读器是 .hb-layout 的兄弟节点：横贯整行，左边与目录卡对齐，形成上二下一的倒置品字 */
.hb-page-panel { margin-top: 20px; padding: 28px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.p-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border-soft); }
.p-head .eyebrow { font-size: 12px; color: var(--muted); }
.p-head h4 { font-family: var(--font-display); font-size: 20px; margin: 6px 0 0; color: var(--ink); }
.p-actions { display: flex; gap: 8px; }
.p-body { margin-top: 18px; }
/* 章节联动标识：随左侧章节切换，位于章节介绍卡片底部 */
.p-chapter-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0 0; padding: 9px 12px; background: #f3f7f1; border: 1px solid var(--border-soft); border-radius: 8px; font-size: 12px; color: var(--muted); }
.p-chapter-note .cn-no { background: var(--green-primary); color: #fff; font-weight: 700; padding: 2px 9px; border-radius: 5px; font-family: var(--font-num); }
.p-chapter-note b { color: var(--ink-2); font-size: 13px; }
.p-chapter-note .cn-pos { margin-left: auto; color: var(--safe); font-family: var(--font-num); font-weight: 700; }
.p-body h5 { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; }
.sop-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.sop-tbl { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 12px; }
.sop-tbl th, .sop-tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; }
.sop-tbl th { background: #f7faf5; color: var(--muted); font-weight: 700; }
.sop-tbl tr:last-child td { border-bottom: none; }
.p-body .footnote { font-size: 12px; color: var(--ink-2); line-height: 1.75; margin: 12px 0 6px; }
.p-body .source { font-size: 11px; color: var(--muted-2); text-align: right; }
.p-empty { margin-top: 16px; padding: 18px; background: #f7faf5; border-radius: 10px; color: var(--muted); font-size: 13px; }
.p-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.p-pager span { font-family: var(--font-num); font-size: 13px; color: var(--muted); }

@media (max-width: 1200px) {
  .handbook-hero { grid-template-columns: 1fr 220px; padding: 30px; }
  .node-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .handbook-hero { grid-template-columns: 1fr; gap: 22px; padding: 24px 22px; }
  .handbook-hero h1 { font-size: 29px; }
  .reading-meter { padding: 18px 0 0; border-left: 0; border-top: 1px solid rgba(197,199,178,.22); }
  .reading-meter strong { font-size: 38px; }
  .node-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .node-grid { grid-template-columns: 1fr; }
  .handbook-hero { padding: 20px 16px; }
  .button { padding: 10px 14px; font-size: 13px; }
}

/* ============ 97 页正文阅读器（PDF 全文入库后） ============ */
.hb-text {
  border: 1px solid var(--border); border-radius: 10px; background: #fbfcfa;
  padding: 16px 18px; max-width: 90ch; max-height: 380px; overflow-y: auto; margin: 0 auto;
  font-size: 13px; line-height: 1.85; color: var(--ink-2);
}
.hb-text p { margin: 0 0 8px; }
.hb-text p:last-child { margin-bottom: 0; }
.hb-text::-webkit-scrollbar { width: 6px; }
.hb-text::-webkit-scrollbar-thumb { background: #cfd9cd; border-radius: 99px; }
.node .nt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.node-grid { max-height: 340px; overflow-y: auto; }
@media (max-width: 640px) {
  .node-grid { max-height: 260px; }
  .hb-text { max-height: 320px; padding: 12px 14px; }
  .hb-page-panel { padding: 16px 14px; }
  .p-head h4 { font-size: 17px; }
}

@media (max-width:640px){ .sidebar{padding:10px 12px 8px;} .sb-nav{margin-top:8px;} .sb-newbtn{margin-top:8px;padding:9px;} .topbar{padding:8px 12px;gap:6px;min-height:0;} .topbar .tools{gap:5px;} .crumb{line-height:1.35;} }
