/* 物流项目管理平台 · 应用外壳与页面样式
   字体：系统字体栈（不加载任何在线字体）。 */
:root {
  --blue: #0A4F7C;
  --blue-700: #083D61;
  --blue-50: #E8F1F8;
  --blue-100: #D3E4F1;
  --amber: #FFC53D;
  --amber-50: #FFF6D9;
  --amber-700: #8A6100;
  --green: #1E8E5A;
  --green-50: #E4F4EC;
  --red: #C8372D;
  --red-50: #FBE9E7;
  --ink: #18222E;
  --ink-2: #3B4856;
  --muted: #667584;
  --line: #DDE3EA;
  --line-2: #EBEFF3;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgba(16, 32, 48, .06), 0 1px 1px rgba(16, 32, 48, .04);
  --shadow-2: 0 8px 28px rgba(16, 32, 48, .12);
  --topbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
h1, h2, h3, h4 { line-height: 1.35; margin: 0; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #5AA5D6; outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }
#app { outline: none; }
.boot { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--blue); font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; color: var(--blue); }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { color: var(--ink-2); padding: 7px 14px; border-radius: 8px; font-weight: 500; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.is-active { color: var(--blue); background: var(--blue-50); }
.nav-ic { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; min-width: 220px; padding: 0 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 14px;
}
.search-btn:hover { border-color: #B9C5D1; }
.search-btn kbd { margin-left: auto; font: 12px var(--mono); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: #fff; color: var(--muted); }
.banner { background: var(--amber-50); color: var(--amber-700); padding: 10px 20px; font-size: 14px; border-bottom: 1px solid #F0DDA0; text-align: center; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px;
  border-radius: 9px; border: 1px solid transparent; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-700); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.btn-text { background: transparent; color: var(--blue); padding: 0 8px; min-height: 32px; }
.btn-text:hover { background: var(--blue-50); }
.btn-text.danger { color: var(--red); }
.btn-text.danger:hover { background: var(--red-50); }
.btn-lg { min-height: 48px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.btn-assistant { background: var(--amber); color: #3A2A00; min-height: 36px; padding: 0 14px; }
.btn-assistant:hover { background: #F5B921; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); font-size: 16px; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.tag { display: inline-block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--amber-700); background: var(--amber-50); border-radius: 5px; padding: 1px 7px; margin-left: 8px; vertical-align: 2px; }
.pbar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.pbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #2B86C5); border-radius: 99px; transition: width .4s; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #B6C1CC; }
.status-doing { color: var(--amber-700); } .status-doing i { border-color: var(--amber); background: var(--amber); }
.status-done { color: var(--green); } .status-done i { border-color: var(--green); background: var(--green); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.notfound { max-width: 560px; margin: 80px auto; padding: 0 20px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.toast-host { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-2); opacity: 0; transform: translateY(8px); transition: .25s; }
.toast.in { opacity: 1; transform: none; }
mark { background: #FFE58F; color: inherit; padding: 0 1px; border-radius: 2px; }
.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 30% { background: #FFF1B8; box-shadow: 0 0 0 8px #FFF1B8; } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }

/* ---------- 页面通用 ---------- */
.page-head { max-width: 1040px; margin: 0 auto; padding: 36px 20px 18px; display: grid; gap: 8px; }
.page-head h1 { font-size: 30px; }
.page-head p { color: var(--muted); max-width: 70ch; }
.filter input { width: min(420px, 100%); height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; font: inherit; background: #fff; margin-top: 8px; }
.filter input:focus { outline: 3px solid #BCD9EE; border-color: var(--blue); }

/* ---------- 首页 ---------- */
.hero { max-width: 1160px; margin: 0 auto; padding: 56px 20px 24px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 40px; align-items: center; }
.eyebrow { color: var(--blue); font-weight: 600; font-size: 14px; letter-spacing: .04em; margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.22; font-weight: 800; color: var(--ink); }
.lead { margin-top: 18px; color: var(--ink-2); font-size: 17px; max-width: 58ch; }
.hero-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-hint { margin-top: 12px; color: var(--muted); font-size: 14px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-1); display: grid; gap: 16px; }
.big-num { display: flex; align-items: baseline; gap: 8px; }
.big-num strong { font-size: 52px; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }
.big-num span { color: var(--muted); }
.hero-card-top p { color: var(--ink-2); margin-top: 6px; }
.hero-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-stats div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.hero-stats dt { font-size: 12px; color: var(--muted); }
.hero-stats dd { margin: 0; font-weight: 700; }

.section { max-width: 1160px; margin: 0 auto; padding: 36px 20px; }
.section-head { margin-bottom: 22px; display: grid; gap: 6px; }
.section-head h2 { font-size: 24px; }
.section-head p { color: var(--muted); }

/* 学习路线：站点沿线展开（桌面横向，窄屏纵向） */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); position: relative; }
.route::before { content: ""; position: absolute; top: 21px; left: calc(100% / 14); right: calc(100% / 14); height: 3px; background: var(--line); border-radius: 3px; }
.station { position: relative; }
.station a { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 0 6px; color: var(--ink); }
.station a:hover { text-decoration: none; }
.station-dot { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px; background: #fff; border: 3px solid var(--line); color: var(--muted); transition: transform .15s; }
.station a:hover .station-dot { transform: scale(1.08); border-color: var(--blue); color: var(--blue); }
.station.is-done .station-dot { background: var(--green); border-color: var(--green); color: #fff; }
.station.is-current .station-dot { background: var(--amber); border-color: var(--amber); color: #3A2A00; box-shadow: 0 0 0 6px rgba(255, 197, 61, .28); }
.station-body { display: grid; gap: 2px; }
.station-title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.station-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.station.is-current .station-title { color: var(--blue); }

.stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stages li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; display: grid; gap: 6px; position: relative; }
.stage-no { width: 28px; height: 28px; border-radius: 8px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.stages h3 { font-size: 18px; margin-top: 4px; }
.stages p { color: var(--muted); font-size: 15px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: grid; gap: 12px; align-content: start; justify-items: start; }
.panel h2 { font-size: 20px; }
.panel p { color: var(--muted); }

/* ---------- 项目索引 ---------- */
.proj-list { max-width: 1040px; margin: 0 auto; padding: 0 20px 80px; display: grid; gap: 20px; }
.proj { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; scroll-margin-top: calc(var(--topbar-h) + 12px); }
.proj-head { display: grid; grid-template-columns: auto 1fr minmax(120px, 190px); gap: 16px; align-items: center; padding: 18px 22px; background: linear-gradient(180deg, #F2F7FB, #fff); border-bottom: 1px solid var(--line-2); }
.proj-no { width: 40px; height: 40px; border-radius: 11px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.proj-title h2 { font-size: 19px; }
.proj-title p { color: var(--muted); font-size: 14px; }
.proj-prog { display: grid; gap: 6px; font-size: 13px; color: var(--muted); text-align: right; }
.task-list { list-style: none; margin: 0; padding: 6px 0; }
.task a { display: grid; grid-template-columns: 64px 1fr auto 76px; gap: 12px; align-items: center; padding: 11px 22px; color: var(--ink); }
.task a:hover { background: var(--bg); text-decoration: none; }
.task-no { font-size: 13px; font-weight: 700; color: var(--blue); }
.task-name { font-weight: 600; display: grid; }
.task-name small { font-weight: 400; color: var(--muted); font-size: 13px; }
.task-min { font-size: 13px; color: var(--muted); white-space: nowrap; }
.task-intro .task-no { color: var(--muted); }

/* ---------- 学习页 ---------- */
.learn { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 268px minmax(0, 1fr) 224px; gap: 0 28px; padding: 0 20px 80px; align-items: start; }
.tree { position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow: auto; padding: 18px 4px 30px 0; font-size: 14px; }
.tree-head { display: none; }
.tree-proj { margin-bottom: 4px; }
.tree-proj summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 8px 8px; border-radius: 8px; font-weight: 700; }
.tree-proj summary::-webkit-details-marker { display: none; }
.tree-proj summary:hover { background: #EDF1F5; }
.tree-no { width: 22px; height: 22px; border-radius: 6px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-size: 12px; }
.tree-count { font-size: 12px; color: var(--muted); font-weight: 500; }
.tree-proj ul { list-style: none; margin: 2px 0 8px 11px; padding: 0 0 0 10px; border-left: 2px solid var(--line-2); }
.tree-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; color: var(--ink-2); line-height: 1.45; }
.tree-item:hover { background: #EDF1F5; text-decoration: none; }
.tree-item.is-active { background: var(--blue-50); color: var(--blue); font-weight: 700; }
.tree-item em { font-style: normal; font-size: 11px; color: var(--amber-700); background: var(--amber-50); padding: 0 5px; border-radius: 4px; margin-left: auto; white-space: nowrap; }
.tree-item .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #B6C1CC; }
.tree-item.s-doing .dot { background: var(--amber); border-color: var(--amber); }
.tree-item.s-done .dot { background: var(--green); border-color: var(--green); }
.tree-scrim { display: none; }

.reader { min-width: 0; padding-top: 0; }
.stagebar {
  position: sticky; top: var(--topbar-h); z-index: 20; display: flex; align-items: center; gap: 10px; height: 48px;
  background: rgba(245, 247, 250, .96); backdrop-filter: blur(8px); margin: 0 -8px; padding: 0 8px; border-bottom: 1px solid var(--line);
}
.tree-toggle { display: none; flex: none; }
.stages-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.stages-nav::-webkit-scrollbar { display: none; }
.stages-nav a { flex: none; display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.stages-nav a b { width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 12px; display: grid; place-items: center; }
.stages-nav a:hover { background: #E6ECF2; text-decoration: none; }
.stages-nav a.is-active { background: var(--blue); color: #fff; }
.stages-nav a.is-active b { background: var(--amber); color: #3A2A00; }
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; }
.read-progress i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .1s; }

.unit-head { padding: 34px 0 10px; display: grid; gap: 10px; max-width: 800px; }
.crumb { color: var(--blue); font-weight: 600; font-size: 14px; }
.unit-head h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; }
.unit-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; color: var(--muted); font-size: 14px; }
.unit-meta .tag { margin: 0; }
.kw { background: #EBEFF3; border-radius: 99px; padding: 0 10px; font-size: 13px; color: var(--ink-2); }
.unit-body { max-width: 800px; }
.skeleton { display: grid; gap: 14px; padding-top: 20px; }
.skeleton i { height: 16px; border-radius: 6px; background: linear-gradient(90deg, #E8EDF2, #F4F6F9, #E8EDF2); background-size: 200% 100%; animation: sk 1.2s infinite; }
.skeleton i:nth-child(2) { width: 80%; } .skeleton i:nth-child(3) { width: 60%; }
@keyframes sk { to { background-position: -200% 0; } }

.toc { position: sticky; top: calc(var(--topbar-h) + 48px); max-height: calc(100vh - var(--topbar-h) - 60px); overflow: auto; padding: 22px 0 30px 8px; font-size: 13.5px; }
.toc-title { font-weight: 700; color: var(--muted); font-size: 12.5px; letter-spacing: .06em; margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line-2); }
.toc a { display: block; padding: 4px 10px; color: var(--muted); margin-left: -2px; border-left: 2px solid transparent; line-height: 1.5; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.is-active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
.toc-l2 a { font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.toc-l3 a { padding-left: 22px; }

.unit-foot { max-width: 800px; margin-top: 40px; display: grid; gap: 22px; }
.finish { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; display: grid; gap: 16px; }
.finish.is-done { background: var(--green-50); border-color: #BFE3D0; }
.finish h2 { font-size: 20px; }
.finish p { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.finish-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: grid; gap: 2px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.pager a:hover { border-color: var(--blue); text-decoration: none; }
.pager small { color: var(--muted); }
.pager span { font-weight: 600; }
.pager-next { text-align: right; }

/* ---------- 工具资源 ---------- */
.filters { max-width: 1040px; margin: 0 auto; padding: 0 20px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.filters-sep { width: 1px; height: 22px; background: var(--line); margin: 0 10px; }
.tool-grid { max-width: 1040px; margin: 0 auto; padding: 0 20px 80px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tool-card { display: grid; gap: 6px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tool-card:hover { border-color: var(--blue); box-shadow: var(--shadow-1); transform: translateY(-2px); text-decoration: none; }
.tool-card h3 { font-size: 18px; }
.tool-card p { color: var(--ink-2); font-size: 14.5px; }
.tool-card .tool-en { color: var(--muted); font-size: 13px; }
.tool-card-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-src { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 5px; }
.src-pmbok { background: var(--blue-50); color: var(--blue); }
.src-course { background: var(--amber-50); color: var(--amber-700); }
.tool-area { font-size: 12.5px; color: var(--muted); }
.tool-phases { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tool-phases span, .phase-tag { font-size: 12px; background: #EEF2F6; color: var(--ink-2); border-radius: 99px; padding: 0 9px; }
.tool-detail { max-width: 1160px; margin: 0 auto; padding: 28px 20px 80px; display: grid; gap: 22px; }
.back { font-size: 14px; }
.tool-head { display: grid; gap: 8px; }
.tool-head h1 { font-size: 32px; }
.tool-en { color: var(--muted); }
.tool-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 36px; align-items: start; }
.tool-cols h2 { font-size: 18px; margin: 22px 0 8px; }
.tool-cols h2:first-child { margin-top: 0; }
.steps { padding-left: 22px; margin: 0; display: grid; gap: 6px; }
.related { padding-left: 20px; margin: 0; }
.template { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; min-width: 0; }
.template h2 { margin: 0; }
.template-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; }
.tpl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tpl-table th { background: var(--blue-50); color: var(--blue-700); text-align: left; font-weight: 700; }
.tpl-table th, .tpl-table td { border: 1px solid var(--line); padding: 8px 10px; min-width: 72px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- 搜索 ---------- */
.search-dialog { width: min(680px, calc(100vw - 24px)); max-height: min(78vh, 720px); margin: 8vh auto 0; border: 0; border-radius: var(--radius-lg); padding: 0; box-shadow: var(--shadow-2); overflow: hidden; background: #fff; color: var(--ink); }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: rgba(14, 26, 38, .45); }
.search-box { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); margin: 0; }
.search-box input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 17px; height: 40px; background: transparent; }
.search-results { overflow: auto; padding: 8px; }
.search-hint { color: var(--muted); padding: 22px 16px; line-height: 2.2; }
.search-hint .chip { margin-left: 8px; }
.result { display: grid; gap: 2px; padding: 11px 14px; border-radius: 10px; color: var(--ink); }
.result:hover, .result:focus-visible { background: var(--blue-50); text-decoration: none; }
.result-unit { font-size: 12.5px; color: var(--blue); font-weight: 600; }
.result-snip { font-size: 14px; color: var(--muted); }

/* ---------- AI 助手 ---------- */
.chat { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); z-index: 70; background: #fff; border-left: 1px solid var(--line); box-shadow: var(--shadow-2); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
body.chat-open .chat { transform: none; visibility: visible; }
.chat-scrim { position: fixed; inset: 0; background: rgba(14, 26, 38, .35); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.chat-fab { position: fixed; right: 18px; bottom: 22px; z-index: 50; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--amber); color: #3A2A00; font-weight: 800; font-size: 20px; box-shadow: var(--shadow-2); display: none; }
body.chat-open .chat-fab { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line-2); }
.chat-head h2 { font-size: 18px; }
.chat-status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.chat-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #B6C1CC; }
.chat-status[data-mode="ai"]::before { background: var(--green); }
.chat-status[data-mode="local"]::before { background: var(--amber); }
.chat-ctx { padding: 8px 20px; background: var(--blue-50); color: var(--blue-700); font-size: 13px; }
.chat-log { flex: 1; overflow: auto; padding: 18px 16px; display: grid; gap: 14px; align-content: start; background: #FAFBFC; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 94%; }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-bubble { padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.65; }
.msg-bubble p + p { margin-top: 8px; }
.msg-user .msg-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg-bot .msg-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-bot .msg-bubble ul, .msg-bot .msg-bubble ol { padding-left: 20px; margin: 6px 0; }
.typing span { animation: blink 1.2s infinite; } .typing span:nth-child(3) { animation-delay: .2s; } .typing span:nth-child(4) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.msg-sources { display: grid; gap: 8px; }
.msg-sources-title { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.src { display: grid; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); }
.src:hover { border-color: var(--blue); text-decoration: none; }
.src-title { font-size: 12.5px; color: var(--blue); font-weight: 600; }
.src-h { font-weight: 600; font-size: 14.5px; }
.src-snip { font-size: 13px; color: var(--muted); line-height: 1.6; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; background: #fff; border-top: 1px solid var(--line-2); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: #fff; }
.chat-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; line-height: 1.5; min-height: 42px; max-height: 140px; }
.chat-form textarea:focus { outline: 3px solid #BCD9EE; border-color: var(--blue); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .learn { grid-template-columns: 252px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .learn { grid-template-columns: minmax(0, 1fr); padding: 0 16px 80px; }
  .tree-toggle { display: inline-flex; }
  .tree { position: fixed; z-index: 80; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; background: #fff; padding: 0 12px 30px; box-shadow: var(--shadow-2); transform: translateX(-105%); transition: transform .25s; visibility: hidden; }
  .tree-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; padding: 10px 0; z-index: 1; }
  body.tree-open .tree { transform: none; visibility: visible; }
  body.tree-open .tree-scrim { display: block; position: fixed; inset: 0; z-index: 75; background: rgba(14, 26, 38, .4); }
  .tool-cols { grid-template-columns: 1fr; }
  .route { grid-template-columns: 1fr; gap: 0; }
  .route::before { top: 22px; bottom: 22px; left: 21px; right: auto; width: 3px; height: auto; }
  .station a { grid-template-columns: 44px 1fr; justify-items: start; text-align: left; gap: 14px; padding: 8px 0; align-items: center; }
  .stages, .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-name { font-size: 16px; }
  .btn-assistant, .search-btn-text, .search-btn kbd { display: none; }
  .search-btn { min-width: 36px; width: 36px; justify-content: center; padding: 0; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 45; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; backdrop-filter: blur(10px); }
  .nav a { flex-direction: column; gap: 0; padding: 4px 10px; font-size: 12px; min-width: 64px; }
  .nav-ic { display: block; font-size: 18px; line-height: 1.3; }
  .chat-fab { display: block; bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; }
  .toast-host { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .proj-head { grid-template-columns: auto 1fr; }
  .proj-prog { grid-column: 1 / -1; text-align: left; }
  .task a { grid-template-columns: 1fr auto; grid-template-areas: "no st" "name name" "min min"; gap: 2px 8px; padding: 12px 16px; }
  .task-no { grid-area: no; } .task-name { grid-area: name; } .task-min { grid-area: min; } .task a .status { grid-area: st; justify-self: end; }
  .page-head { padding-top: 24px; } .page-head h1 { font-size: 26px; }
  .pager { grid-template-columns: 1fr; }
  .filters-sep { display: none; }
  .search-dialog { margin-top: 4vh; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}
@media print {
  .topbar, .nav, .chat, .chat-fab, .tree, .toc, .stagebar, .unit-foot, .toast-host, .btn-row, .back { display: none !important; }
  body { background: #fff; padding: 0; }
  .tool-detail { padding: 0; } .tool-cols { grid-template-columns: 1fr; }
  .tool-cols section:first-child { display: none; }
  .template { border: 0; padding: 0; }
}

@media (max-width: 1000px) {
  body.chat-open .chat-scrim { opacity: 1; pointer-events: auto; }
}
