:root {
  --bg: #0b0e13;
  --glass: rgba(14, 18, 25, 0.84);
  --glass-strong: rgba(13, 16, 22, 0.96);
  --surface: #171b22;
  --surface-2: #1d222b;
  --surface-3: #232933;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #edf0f5;
  --text-2: #a9b1be;
  --muted: #898781;
  --gold: #f5c04a;
  --teal: #3cc8b4;
  --violet: #9085e9;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --kimi: #3987e5;
  --deepseek: #d95926;
  --cme: #199e70;
  --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Zen Hei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "WenQuanYi Zen Hei Mono", monospace;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.pix { image-rendering: pixelated; image-rendering: crisp-edges; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.gold { color: var(--gold); }
[hidden] { display: none !important; }

#town { position: fixed; inset: 0; display: block; cursor: grab; touch-action: none; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }

/* ---------- 顶栏 ---------- */
#hud { position: fixed; top: 10px; left: 10px; right: 10px; height: 54px; display: flex; align-items: center; gap: 18px; padding: 0 14px; z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2f6fb5, #199e70); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.logo-name { font-size: 19px; font-weight: 750; letter-spacing: 2px; }
.logo-town { font-size: 12px; color: var(--text-2); }
.hud-sep { width: 1px; height: 26px; background: var(--line-2); }
.hud-time { display: flex; flex-direction: column; line-height: 1.25; cursor: pointer; }
.hud-time b { font-size: 13.5px; font-weight: 650; }
.hud-time span { font-size: 12px; color: var(--text-2); }
.hud-counts { display: flex; gap: 6px; }
.hud-count { display: flex; flex-direction: column; align-items: center; padding: 3px 10px; border-radius: 9px; cursor: pointer; line-height: 1.2; }
.hud-count:hover { background: rgba(255,255,255,0.06); }
.hud-count b { font-size: 15px; font-weight: 700; }
.hud-count span { font-size: 11px; color: var(--text-2); }
.hud-meter { display: flex; flex-direction: column; gap: 4px; width: 150px; cursor: pointer; }
.hud-meter .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.hud-meter .row b { color: var(--text); font-weight: 650; }
.hud-bar { height: 6px; border-radius: 3px; background: rgba(57,135,229,0.18); overflow: hidden; display: flex; gap: 2px; }
.hud-bar i { display: block; height: 100%; }
.hud-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.icon-btn.on { color: var(--text); background: rgba(255,255,255,0.08); border-color: var(--line-2); }
.badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--crit); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.role-pill { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(245,192,74,0.14); color: var(--gold); border: 1px solid rgba(245,192,74,0.35); cursor: pointer; }
.role-pill.visitor { background: rgba(169,177,190,0.12); color: var(--text-2); border-color: var(--line-2); }
.search { position: relative; }
.search input { width: 190px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0,0,0,0.25); color: var(--text); padding: 0 10px 0 32px; font: inherit; font-size: 13px; outline: none; }
.search input:focus { border-color: rgba(60,200,180,0.6); }
.search svg { position: absolute; left: 9px; top: 9px; color: var(--muted); }
.search-res { position: absolute; top: 40px; right: 0; width: 360px; max-height: 420px; overflow: auto; padding: 8px; z-index: 30; }
.search-res h5 { margin: 8px 6px 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.search-res a { display: block; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; cursor: pointer; }
.search-res a:hover { background: rgba(255,255,255,0.07); }
.search-res a small { color: var(--text-2); margin-left: 6px; }

#banner { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 19; padding: 5px 14px; border-radius: 999px; font-size: 12px; color: #1d1a14; background: rgba(245,192,74,0.92); box-shadow: 0 4px 14px rgba(0,0,0,0.3); font-weight: 600; }

/* ---------- 左栏 今日焦点 ---------- */
#focus { position: fixed; top: 74px; left: 10px; width: 270px; bottom: 82px; z-index: 15; display: flex; flex-direction: column; overflow: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.side-head h4 { margin: 0; font-size: 13.5px; font-weight: 650; }
.side-body { overflow: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.side-body::-webkit-scrollbar, .feed-list::-webkit-scrollbar, .panel-body::-webkit-scrollbar { width: 8px; }
.side-body::-webkit-scrollbar-thumb, .feed-list::-webkit-scrollbar-thumb, .panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }
.fcard { background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; }
.fcard:hover { border-color: var(--line-2); background: rgba(255,255,255,0.06); }
.fcard .k { font-size: 11.5px; color: var(--text-2); margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.fcard .t { font-size: 13.5px; font-weight: 650; line-height: 1.45; }
.fcard .d { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-top: 4px; }
.paper-card { background: linear-gradient(180deg, rgba(245,192,74,0.12), rgba(245,192,74,0.03)); border-color: rgba(245,192,74,0.3); }
.todo { display: flex; flex-direction: column; gap: 2px; }
.todo a { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; border-radius: 7px; font-size: 13px; color: var(--text); text-decoration: none; cursor: pointer; }
.todo a:hover { background: rgba(255,255,255,0.06); }
.todo a b { font-size: 15px; color: var(--gold); }
.todo a b.zero { color: var(--muted); }
.steps { display: flex; gap: 3px; margin-top: 8px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.1); }
.steps i.on { background: var(--teal); }
.steps-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-top: 5px; }
.collapse { cursor: pointer; color: var(--muted); font-size: 12px; background: none; border: none; padding: 2px 4px; border-radius: 6px; }
.collapse:hover { color: var(--text); background: rgba(255,255,255,0.07); }
#focus.collapsed, #feed.collapsed { width: 46px; bottom: auto; height: 180px; cursor: pointer; }
.collapsed .side-body, .collapsed .chips, .collapsed .feed-list, .collapsed .side-head { display: none; }
.vlabel { display: none; }
.collapsed .vlabel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; writing-mode: vertical-rl; font-size: 13px; color: var(--text-2); letter-spacing: 2px; }
.collapsed .vlabel span:first-child { writing-mode: horizontal-tb; }

/* ---------- 右栏 世界动态 ---------- */
#feed { position: fixed; top: 74px; right: 10px; width: 330px; bottom: 82px; z-index: 15; display: flex; flex-direction: column; overflow: hidden; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(60,200,180,0.6); animation: live 1.8s infinite; display: inline-block; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(60,200,180,0.55); } 70% { box-shadow: 0 0 0 8px rgba(60,200,180,0); } 100% { box-shadow: 0 0 0 0 rgba(60,200,180,0); } }
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 8px; }
.chip { padding: 4px 9px; border-radius: 999px; font-size: 12px; color: var(--text-2); background: rgba(255,255,255,0.05); border: 1px solid var(--line); cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.on { color: #0b0e13; background: var(--text); border-color: var(--text); font-weight: 600; }
.feed-list { overflow: auto; flex: 1; padding: 0 6px 10px; }
.fi { display: grid; grid-template-columns: 26px 1fr; gap: 9px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.fi:hover { background: rgba(255,255,255,0.05); }
.fi.new { animation: slidein 0.5s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.fi .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,0.06); }
.fi .meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.fi .who { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; font-size: 12.5px; }
.fi .who i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.fi .txt { font-size: 13px; line-height: 1.5; color: var(--text); }
.fi.creator { background: rgba(245,192,74,0.08); box-shadow: inset 2px 0 0 var(--gold); }
.fi.dao .ic { color: var(--violet); }

/* ---------- 底栏 ---------- */
#dock { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 2px; padding: 6px; }
.dock-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 70px; padding: 7px 8px 6px; border-radius: 11px; border: none; background: transparent; cursor: pointer; color: var(--text-2); font-size: 12px; }
.dock-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.dock-btn.on { background: rgba(255,255,255,0.1); color: var(--text); box-shadow: inset 0 -2px 0 var(--teal); }
.dock-btn .badge { top: 2px; right: 12px; }

/* ---------- 地图控制 ---------- */
#mapctl { position: fixed; right: 352px; bottom: 82px; z-index: 16; display: flex; gap: 6px; padding: 6px; align-items: center; }
#mapctl select { height: 32px; background: rgba(0,0,0,0.3); color: var(--text); border: 1px solid var(--line-2); border-radius: 9px; padding: 0 8px; font: inherit; font-size: 12.5px; }
.ctl-btn { height: 32px; min-width: 32px; padding: 0 9px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(0,0,0,0.25); color: var(--text); cursor: pointer; font-size: 12.5px; display: grid; place-items: center; }
.ctl-btn:hover { background: rgba(255,255,255,0.08); }

/* ---------- 人物小卡 / 建筑抽屉 ---------- */
#popover { position: fixed; z-index: 40; width: 300px; padding: 14px; }
.pop-head { display: flex; gap: 12px; align-items: center; }
.pop-head img { width: 54px; height: 54px; border-radius: 12px; background: #2a3140; }
.pop-name { font-size: 16px; font-weight: 700; }
.pop-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.pop-doing { margin-top: 12px; font-size: 13px; line-height: 1.5; }
.prog { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; margin-top: 6px; }
.prog i { display: block; height: 100%; background: var(--teal); }
.thought { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,0.05); font-size: 13px; line-height: 1.6; color: var(--text); border-left: 3px solid rgba(144,133,233,0.7); }
.thought small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.pop-actions { display: flex; gap: 6px; margin-top: 12px; }
.btn { height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.06); color: var(--text); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: rgba(255,255,255,0.12); }
.btn.primary { background: var(--text); color: #0b0e13; border-color: var(--text); font-weight: 650; }
.btn.primary:hover { background: #ffffff; }
.btn.gold { background: rgba(245,192,74,0.16); color: var(--gold); border-color: rgba(245,192,74,0.4); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.mini-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mm { font-size: 11.5px; color: var(--text-2); }
.mm .prog i { background: var(--kimi); }
#drawer { position: fixed; top: 74px; right: 352px; width: 340px; z-index: 30; padding: 16px; max-height: calc(100vh - 170px); overflow: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.drawer-head h3 { margin: 0; font-size: 17px; }
.drawer-desc { font-size: 13px; color: var(--text-2); margin: 6px 0 12px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13px; line-height: 1.5; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }

/* ---------- 大面板 ---------- */
#panel { position: fixed; top: 70px; bottom: 74px; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(5, 7, 10, 0.5); }
.panel-box { width: min(1260px, 95vw); height: 100%; background: var(--glass-strong); border: 1px solid var(--line-2); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.55); }
.panel-head { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.panel-head .sub { font-size: 12.5px; color: var(--text-2); }
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tab { padding: 7px 13px; border-radius: 9px; background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer; font-size: 13.5px; }
.tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.tab.on { color: var(--text); background: rgba(255,255,255,0.09); border-color: var(--line-2); font-weight: 600; }
.panel-close { margin-left: auto; }
.panel-body { flex: 1; overflow: auto; padding: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; }
.card h3 { margin: 0 0 10px; font-size: 14.5px; font-weight: 650; }
.card h3 small { font-weight: 400; color: var(--text-2); font-size: 12px; margin-left: 6px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: rgba(255,255,255,0.07); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.g { color: #7fe08a; border-color: rgba(12,163,12,0.4); background: rgba(12,163,12,0.12); }
.pill.y { color: var(--warn); border-color: rgba(250,178,25,0.4); background: rgba(250,178,25,0.1); }
.pill.b { color: #8ab8f2; border-color: rgba(57,135,229,0.4); background: rgba(57,135,229,0.12); }
.pill.v { color: #b9b1f5; border-color: rgba(144,133,233,0.45); background: rgba(144,133,233,0.12); }
.pill.gold { color: var(--gold); border-color: rgba(245,192,74,0.4); background: rgba(245,192,74,0.1); }
.pill.ext { color: #f0b48a; border-color: rgba(236,131,90,0.45); background: rgba(236,131,90,0.1); }
.cdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.avatars { display: flex; }
.avatars img { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--surface); margin-left: -6px; background: #2a3140; }
.avatars img:first-child { margin-left: 0; }
.list { display: flex; flex-direction: column; }
.li { padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; }
.li:last-child { border-bottom: none; }
.li .k { color: var(--text-2); font-size: 12px; }
.clickable { cursor: pointer; }
.clickable:hover { border-color: var(--line-2); background: var(--surface-2); }
.hint { font-size: 12px; color: var(--muted); }
.back { color: var(--text-2); cursor: pointer; font-size: 13px; margin-bottom: 12px; display: inline-block; }
.back:hover { color: var(--text); }

/* 人物 */
.res-card { display: flex; flex-direction: column; gap: 10px; }
.res-top { display: flex; gap: 12px; align-items: center; }
.res-top img { width: 64px; height: 64px; border-radius: 14px; background: #2a3140; }
.res-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.res-heart { font-size: 13px; color: var(--text-2); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 10px; }
.person-grid { display: grid; grid-template-columns: 320px 1fr 1fr; gap: 14px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; }
.big-ava { width: 96px; height: 96px; border-radius: 18px; background: #2a3140; }
.sched { display: flex; flex-direction: column; }
.sched .s { display: grid; grid-template-columns: 54px 14px 1fr; gap: 8px; align-items: start; padding: 7px 0; font-size: 13px; }
.sched .s .tm { color: var(--text-2); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.sched .s .dt { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; border: 2px solid var(--muted); }
.sched .s.done .dt { background: var(--muted); }
.sched .s.now .dt { border-color: var(--teal); background: var(--teal); box-shadow: 0 0 0 4px rgba(60,200,180,0.2); }
.sched .s.now { font-weight: 600; }
.sched .s.plan { color: var(--text-2); }
.mem { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.mem:last-child { border: none; }
.mem .k { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.rel { display: grid; grid-template-columns: 26px 1fr 90px; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.rel img { width: 26px; height: 26px; border-radius: 8px; background: #2a3140; }
.rel .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.rel .bar i { display: block; height: 100%; background: #3987e5; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--text-2); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table tr.clickable:hover td { background: rgba(255,255,255,0.04); }

/* 关系网 / 世界地图 */
.graph-layout { display: grid; grid-template-columns: 1fr 280px; gap: 14px; height: 100%; }
.graph-wrap, .world-wrap { position: relative; width: 100%; height: 100%; min-height: 480px; border-radius: 13px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.graph-wrap canvas, .world-wrap canvas { display: block; }
.legend-list { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.legend-list .lk { display: flex; gap: 8px; align-items: center; }
.legend-list .ln { width: 26px; height: 0; border-top: 3px solid; }
.legend-list .ln.dash { border-top-style: dashed; border-top-width: 2px; }
input[type=range] { width: 100%; accent-color: #3cc8b4; }
.place-card { position: absolute; left: 16px; bottom: 16px; width: 320px; padding: 14px; }

/* 成果 */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.work { display: flex; flex-direction: column; gap: 8px; }
.work .t { font-size: 15px; font-weight: 650; line-height: 1.45; }
.work .s { font-size: 12.5px; color: var(--text-2); line-height: 1.6; flex: 1; }
.work .f { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.score { font-weight: 700; color: var(--text); font-size: 14px; }
.reader { display: grid; grid-template-columns: 190px 1fr 320px; gap: 16px; align-items: start; }
.toc { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.toc a { color: var(--text-2); padding: 6px 8px; border-radius: 7px; cursor: pointer; text-decoration: none; }
.toc a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.doc { background: #f7f5ef; color: #1f2329; border-radius: 12px; padding: 28px 34px; line-height: 1.85; font-size: 14.5px; }
.doc h1 { font-size: 22px; margin: 0 0 6px; line-height: 1.4; }
.doc .docmeta { color: #6b6f76; font-size: 12.5px; margin-bottom: 18px; }
.doc h4 { font-size: 16px; margin: 22px 0 6px; }
.doc p { margin: 6px 0; }
.doc sup { color: #2a78d6; font-weight: 700; cursor: pointer; margin-left: 2px; }
.doc ul { margin: 6px 0; padding-left: 22px; }
.doc table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13.5px; }
.doc th, .doc td { border: 1px solid #d9d4c4; padding: 6px 9px; text-align: left; }
.doc th { background: #ece7d9; }
.doc .rv { margin: 10px 0; padding: 9px 12px; border-left: 3px solid #eb6834; background: #fbeee4; font-size: 13px; color: #6b3417; border-radius: 0 8px 8px 0; }
.doc .guess { background: #fff2c4; padding: 0 3px; border-radius: 3px; }
.side-stack { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.src { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; }
.src:last-child { border: none; }
.src b { font-weight: 650; }
.src q { display: block; color: var(--text-2); margin-top: 3px; quotes: none; }
.review { display: grid; grid-template-columns: 28px 1fr; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; }
.review:last-child { border: none; }
.review img { width: 28px; height: 28px; border-radius: 8px; background: #2a3140; }
.kcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.kcard ul { margin: 6px 0 8px; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text); }
.kcard .src2 { font-size: 11.5px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 7px; line-height: 1.5; }
.shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.shelf { padding: 12px; border-radius: 11px; background: linear-gradient(180deg, #2a2016, #211a12); border: 1px solid #3e2f20; }
.shelf .nm { font-size: 13px; font-weight: 650; line-height: 1.45; color: #f3e6cf; min-height: 38px; }
.shelf .bk { display: flex; gap: 2px; height: 22px; margin: 8px 0; align-items: flex-end; }
.shelf .bk i { flex: 1; border-radius: 2px 2px 0 0; }
.shelf .ft { display: flex; justify-content: space-between; font-size: 11.5px; color: #c9b89a; }
.diff { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; background: #0f1319; border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); }
.diff .add { color: #8be29b; }
.diff .del { color: #f19a9a; text-decoration: line-through; }

/* 课题与组织 */
.org { display: grid; grid-template-columns: 74px 1fr; gap: 14px; }
.org .logo2 { width: 74px; height: 74px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.board-col h4 { margin: 0 0 10px; font-size: 13px; color: var(--text-2); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.board-col .card { margin-bottom: 10px; padding: 12px; }
.bounty { display: grid; grid-template-columns: 70px 1fr 170px 110px; gap: 14px; align-items: center; }

/* 编年史 */
.chron { position: relative; padding-left: 26px; max-width: 820px; }
.chron::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--line-2); }
.chron .day { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--text-2); position: relative; }
.chron .day::before { content: ''; position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text-2); }
.chron .ev { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 9px 12px; margin-bottom: 8px; }
.chron .ev .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,0.06); }

/* 晨报 */
.paper { max-width: 900px; margin: 0 auto; background: #f4eedf; color: #1d1a14; border-radius: 6px; padding: 30px 40px 26px; font-family: var(--serif); box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.paper .mast { text-align: center; border-bottom: 3px double #1d1a14; padding-bottom: 10px; }
.paper .mast h1 { margin: 0; font-size: 44px; letter-spacing: 12px; font-weight: 900; }
.paper .mast .ml { display: flex; justify-content: space-between; font-size: 13px; margin-top: 8px; font-family: var(--font); color: #4a4334; }
.paper .head { margin: 18px 0 8px; font-size: 28px; font-weight: 900; line-height: 1.35; text-align: center; }
.paper .lead { font-size: 16px; line-height: 1.8; text-align: center; color: #3b3427; margin: 0 40px 16px; }
.paper .cols { column-count: 2; column-gap: 34px; column-rule: 1px solid #cbbf9f; border-top: 1px solid #1d1a14; padding-top: 14px; }
.paper .sec { break-inside: avoid; margin-bottom: 16px; }
.paper .sec h4 { margin: 0 0 6px; font-size: 16px; border-bottom: 1px solid #cbbf9f; padding-bottom: 4px; font-weight: 800; }
.paper .sec p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.75; }
.paper .foot { border-top: 1px solid #1d1a14; margin-top: 8px; padding-top: 8px; font-size: 12.5px; font-family: var(--font); color: #4a4334; display: flex; justify-content: space-between; }

/* 观星台 */
.star-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: 100%; }
.letter-item { padding: 11px 12px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; }
.letter-item:hover { background: rgba(255,255,255,0.05); }
.letter-item.on { background: rgba(255,255,255,0.08); border-color: var(--line-2); }
.letter-item .t { font-size: 13.5px; font-weight: 650; margin: 3px 0; line-height: 1.45; }
.letter-item .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); display: inline-block; }
.letter { background: #f8f3e6; color: #2a241a; border-radius: 8px; padding: 22px 34px 26px; font-family: var(--serif); font-size: 15.5px; line-height: 32px; background-image: repeating-linear-gradient(180deg, transparent 0 31px, #e6dcc4 31px 32px); background-origin: content-box; background-clip: padding-box; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.letter p { margin: 0; }
textarea, .inp, select.inp { width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); font: inherit; font-size: 13.5px; padding: 9px 11px; outline: none; }
textarea:focus, .inp:focus { border-color: rgba(60,200,180,0.6); }
.chat { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.msg img { width: 34px; height: 34px; border-radius: 10px; background: #2a3140; }
.msg .bub { max-width: 640px; padding: 11px 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.75; }
.msg.me .bub { background: rgba(245,192,74,0.14); border-color: rgba(245,192,74,0.3); }
.msg .bub .srcs { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.form { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; align-items: center; }
.form label { color: var(--text-2); font-size: 13px; }
.stepbar { display: grid; gap: 6px; }
.stepbar .bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stepbar .bars i { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); }
.stepbar .bars i.on { background: var(--teal); }
.stepbar .names { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; font-size: 11.5px; color: var(--text-2); }
.stepbar .names span.on { color: var(--text); font-weight: 600; }

/* 监控中心 */
.mon-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(12,163,12,0.12); border: 1px solid rgba(12,163,12,0.4); color: #7fe08a; font-size: 13px; font-weight: 600; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.seg button { border: none; background: transparent; color: var(--text-2); padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.seg button.on { background: rgba(255,255,255,0.12); color: var(--text); font-weight: 600; }
.mon-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
.meter-group h4 { margin: 12px 0 8px; font-size: 12.5px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.meter-group h4:first-child { margin-top: 0; }
.daolog .li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }

/* 图表 */
.viz-card { display: flex; flex-direction: column; gap: 8px; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.viz-head h3 { margin: 0; }
.viz-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.viz-toggle { border: 1px solid var(--line-2); background: transparent; color: var(--text-2); border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.viz-toggle:hover { color: var(--text); }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin: 2px 0 6px; }
.viz-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.viz-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.viz-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.viz-dot-ring { box-shadow: 0 0 0 2px #171b22, 0 0 0 3px rgba(255,255,255,0.15); }
.viz-svg { display: block; overflow: visible; }
.viz-axis { fill: #898781; font-size: 10.5px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.viz-now { fill: #edf0f5; font-weight: 700; font-family: var(--font); }
.viz-label { fill: #a9b1be; font-size: 11px; font-family: var(--font); }
.viz-col { transition: opacity 0.12s; }
.viz-tip { position: fixed; z-index: 100; pointer-events: none; background: #0f1319; border: 1px solid rgba(255,255,255,0.16); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); min-width: 120px; max-width: 320px; }
.viz-tip-title { color: var(--text-2); font-size: 11.5px; margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.7; }
.viz-tip-row strong { color: var(--text); font-weight: 700; }
.viz-tip-label { color: var(--text-2); }
.viz-key { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.viz-table th { text-align: left; color: var(--text-2); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.viz-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.viz-hbars { display: flex; flex-direction: column; gap: 9px; }
.viz-hrow { display: grid; grid-template-columns: 84px 1fr 48px; gap: 10px; align-items: center; font-size: 12.5px; }
.viz-hlabel { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viz-htrack { height: 14px; }
.viz-hbar { display: flex; height: 14px; min-width: 4px; }
.viz-hseg { height: 100%; min-width: 2px; }
.viz-hseg:hover { filter: brightness(1.2); }
.viz-hval { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.viz-abil { display: flex; flex-direction: column; gap: 9px; }
.viz-arow { display: grid; grid-template-columns: 70px 1fr 64px; gap: 10px; align-items: center; font-size: 12.5px; }
.viz-arow:hover .viz-abar { filter: brightness(1.15); }
.viz-alabel { color: var(--text-2); white-space: nowrap; }
.viz-atrack { position: relative; height: 10px; background: rgba(255,255,255,0.05); border-radius: 0 5px 5px 0; }
.viz-abar { height: 100%; background: #3987e5; border-radius: 0 4px 4px 0; }
.viz-amark { position: absolute; top: 0; width: 10px; height: 10px; border-radius: 50%; background: #9ec5f4; box-shadow: 0 0 0 2px #171b22; }
.viz-aval { display: flex; gap: 6px; align-items: baseline; justify-content: flex-end; }
.viz-aval > span:first-child { color: var(--text); font-weight: 650; }
.viz-delta { font-size: 11px; color: var(--muted); }
.viz-delta.up { color: #0ca30c; }
.viz-meter { margin-bottom: 12px; }
.viz-mtop { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.viz-mlabel { color: var(--text-2); }
.viz-mval { color: var(--text); font-weight: 650; }
.viz-mtrack { position: relative; height: 8px; border-radius: 4px; background: rgba(57,135,229,0.18); }
.viz-mfill { height: 100%; border-radius: 4px; }
.viz-mfloor { position: absolute; top: -3px; width: 2px; height: 14px; background: #edf0f5; border-radius: 1px; }
.viz-mstate { display: flex; align-items: center; gap: 5px; font-size: 11.5px; margin-top: 5px; color: var(--text-2); }
.viz-mstate.warn { color: var(--warn); }
.viz-mstate.crit { color: #f08a8a; }
.viz-mstate.off { color: var(--muted); }
.viz-mstate.ok { color: var(--muted); }
.viz-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; display: flex; flex-direction: column; gap: 4px; }
.viz-tlabel { font-size: 12.5px; color: var(--text-2); }
.viz-tvalue { font-size: 26px; font-weight: 700; line-height: 1.15; }
.viz-trow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.viz-tdelta { font-size: 12px; color: var(--text-2); }
.viz-tdelta.up { color: #0ca30c; }
.viz-tdelta.down { color: var(--serious); }
.viz-tsub { font-size: 11.5px; color: var(--muted); }
.viz-spark { display: block; overflow: visible; }

/* 通知 */
#toasts { position: fixed; top: 74px; right: 352px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: 320px; }
.toast { padding: 11px 13px; display: grid; grid-template-columns: 30px 1fr; gap: 10px; cursor: pointer; animation: slidein 0.35s ease-out; }
.toast .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(245,192,74,0.16); color: var(--gold); }
.toast b { font-size: 13.5px; display: block; margin-bottom: 2px; }
.toast span { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.settings { position: fixed; top: 72px; right: 60px; width: 290px; z-index: 40; padding: 14px; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border: none; }
.switch { width: 38px; height: 22px; border-radius: 11px; background: rgba(255,255,255,0.15); position: relative; cursor: pointer; border: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch.on { background: var(--teal); }
.switch.on::after { left: 19px; }

/* 登录 */
#login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(10,12,18,0.25), rgba(6,8,12,0.78)); backdrop-filter: blur(2px); }
.login-card { width: 420px; padding: 34px 34px 26px; text-align: center; }
.login-card h1 { margin: 6px 0 4px; font-size: 46px; letter-spacing: 14px; font-weight: 800; padding-left: 14px; }
.login-card .slogan { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.login-card .inp { height: 42px; text-align: center; font-size: 15px; margin-bottom: 12px; }
.login-card .btn { width: 100%; height: 42px; justify-content: center; font-size: 14.5px; margin-bottom: 8px; }
.login-foot { margin-top: 14px; font-size: 12.5px; color: var(--text-2); display: flex; justify-content: center; gap: 14px; }

@media (max-width: 1280px) { #focus { width: 236px; } #feed { width: 300px; } #mapctl, #drawer, #toasts { right: 322px; } .person-grid { grid-template-columns: 290px 1fr; } .person-grid > .col:last-child { grid-column: 1 / -1; } }
@media (max-width: 1080px) { #focus { display: none; } .hud-counts { display: none; } .reader { grid-template-columns: 1fr; } .toc { display: none; } .mon-grid, .g2, .g3, .g4, .board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  #hud { height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 10px; } .hud-meter, .search, .hud-sep { display: none; }
  #feed { top: auto; left: 10px; right: 10px; width: auto; height: 38vh; bottom: 76px; }
  #mapctl { right: 10px; bottom: calc(38vh + 86px); } #drawer, #toasts { right: 10px; left: 10px; width: auto; }
  #dock { left: 6px; right: 6px; transform: none; overflow-x: auto; } .dock-btn { min-width: 58px; }
  #panel { top: 0; bottom: 0; } .panel-box { width: 100vw; height: 100vh; border-radius: 0; } .person-grid, .mon-grid, .g2, .g3, .g4, .board, .graph-layout, .star-layout { grid-template-columns: 1fr; }
  .paper { padding: 20px; } .paper .cols { column-count: 1; } #banner { top: auto; bottom: calc(38vh + 130px); }
}

.empty-state { padding: 32px 18px; color: var(--muted); text-align: center; line-height: 1.8; }
.login-error { color: #f08a8a; font-size: 13px; line-height: 1.6; margin-top: 10px; }
.commission-layout { grid-template-columns: 1fr 420px; align-items: start; }
.status.paused { color: var(--text-2); background: rgba(169,177,190,0.08); border-color: var(--line-2); }
@media (max-width: 760px) {
  .login-card { width: calc(100vw - 24px); padding: 26px 20px 22px; }
  .commission-layout { grid-template-columns: 1fr; }
  .panel-head { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .panel-head .sub { width: 100%; order: 3; }
  .tabs { max-width: 100%; overflow-x: auto; margin-left: 0; }
}

.material-text { white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.75 var(--font); }
.srcs { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }

.history-shell { max-width: 1120px; margin: 0 auto; }
.history-toolbar { position: sticky; top: -18px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -18px -18px 14px; padding: 12px 18px; background: var(--glass-strong); border-bottom: 1px solid var(--line); }
.history-filter { min-width: 0; height: 32px; padding: 0 9px; color: var(--text); background: rgba(0,0,0,0.25); border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 12.5px; }
.history-filter:focus { border-color: rgba(60,200,180,0.6); outline: none; }
.history-query { width: 220px; }
.history-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 16px; color: var(--text-2); font-size: 12.5px; }
.history-summary strong { color: var(--text); font-weight: 650; }
.history-new { color: var(--gold); }
.history-list { position: relative; display: flex; flex-direction: column; gap: 12px; }
.history-list::before { content: ''; position: absolute; top: 4px; bottom: 4px; left: 8px; width: 2px; background: var(--line-2); }
.history-item { position: relative; margin-left: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.history-item::before { content: ''; position: absolute; top: 20px; left: -22px; width: 10px; height: 10px; border-radius: 50%; background: var(--history-color, #a9b1be); box-shadow: 0 0 0 3px var(--surface); z-index: 1; }
.history-item > summary { position: relative; display: grid; grid-template-columns: 142px 86px 86px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 14px 38px 14px 16px; cursor: pointer; list-style: none; }
.history-item > summary::-webkit-details-marker { display: none; }
.history-item > summary::after { content: '▸'; position: absolute; top: 14px; right: 16px; color: var(--muted); transition: transform 0.15s; }
.history-item[open] > summary { border-bottom: 1px solid var(--line); }
.history-item[open] > summary::after { transform: rotate(90deg); }
.history-time { color: var(--text-2); font: 11.5px var(--mono); white-space: nowrap; }
.history-actor { color: var(--text); font-weight: 650; }
.history-type { color: var(--history-color, var(--text-2)); font-size: 12px; font-weight: 600; }
.history-main { color: var(--text); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.history-detail { padding: 0 16px 14px; }
.history-kv { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px 14px; margin: 10px 0 0; font-size: 12.5px; line-height: 1.75; }
.history-kv dt { color: var(--text-2); }
.history-kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-result { margin-top: 12px; padding: 11px 12px; background: rgba(60,200,180,0.07); border-left: 3px solid var(--teal); border-radius: 0 8px 8px 0; font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-error { margin-top: 12px; padding: 11px 12px; background: rgba(208,59,59,0.09); border-left: 3px solid var(--crit); border-radius: 0 8px 8px 0; color: #f3b0a0; font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-missing { color: var(--muted); }
.history-raw { margin-top: 12px; }
.history-raw > summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.history-raw pre { max-height: 360px; overflow: auto; padding: 10px; background: #0f1319; border: 1px solid var(--line); border-radius: 8px; font: 11.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.history-more { display: flex; justify-content: center; padding: 18px 0 8px; }
.history-loading { padding: 22px; color: var(--text-2); text-align: center; }
.history-person { padding: 0; color: var(--teal); background: none; border: none; cursor: pointer; font: inherit; text-align: left; }
.history-person:hover { text-decoration: underline; }
.history-badge { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line-2); color: var(--text-2); }
.history-badge.ok { color: #7fe08a; border-color: rgba(12,163,12,0.4); }
.history-badge.bad { color: #f08a8a; border-color: rgba(208,59,59,0.45); }
.history-badge.wait { color: var(--warn); border-color: rgba(250,178,25,0.4); }
@media (max-width: 760px) {
  .history-toolbar { top: -18px; margin: -18px -18px 12px; padding: 10px 12px; }
  .history-filter { max-width: 100%; }
  .history-query { width: 100%; }
  .history-item > summary { grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 32px 12px 12px; }
  .history-time { grid-column: 1 / -1; font-size: 11px; }
  .history-main { grid-column: 1 / -1; font-size: 12.5px; }
  .history-kv { grid-template-columns: 72px minmax(0, 1fr); gap: 6px 10px; font-size: 12px; }
}

/* 项目制万卷阁 */
.project-pack { display: flex; flex-direction: column; gap: 16px; max-width: 1180px; margin: 0 auto; }
.project-overview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 14px 24px; }
.project-heading { min-width: 0; }
.project-heading h3 { margin-bottom: 6px; }
.project-root { color: var(--text-2); font: 11.5px/1.7 var(--mono); overflow-wrap: anywhere; }
.project-batch { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; color: var(--text-2); font-size: 12px; }
.project-batch .btn { margin-top: 3px; font-size: 12px; }
.project-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.project-stat { min-width: 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,0.025); }
.project-stat b { display: block; font: 650 23px/1.3 var(--mono); color: var(--teal); }
.project-stat span { display: block; margin-top: 4px; color: var(--text-2); font-size: 11.5px; line-height: 1.5; }
.project-tree { display: flex; flex-direction: column; gap: 9px; }
.project-dir { border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.025); overflow: hidden; }
.project-dir > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; color: var(--teal); font-size: 13px; font-weight: 600; }
.project-dir > summary .hint { margin-left: auto; flex-shrink: 0; font-weight: 400; }
.project-dir-name { min-width: 0; overflow-wrap: anywhere; }
.project-dir[open] > summary { border-bottom: 1px solid var(--line); }
.project-files { padding: 0 14px; }
.material-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 20px; width: 100%; padding: 12px 0; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.project-files .material-row:last-child { border-bottom: none; }
.material-row:hover, .material-row:focus-visible { background: rgba(60,200,180,0.06); outline: none; }
.material-row:disabled { opacity: 0.55; cursor: wait; }
.material-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.material-main .hint { font-size: 11px; overflow-wrap: anywhere; }
.material-title { font-size: 12.5px; line-height: 1.65; overflow-wrap: anywhere; }
.material-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.material-kind { color: var(--gold); }
.ingest-errors { padding-top: 14px; border-top: 1px solid var(--line); }
.ingest-errors h3 { margin-bottom: 8px; font-size: 13px; }
.ingest-error { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ingest-error:last-child { border-bottom: none; }
.ingest-path { overflow-wrap: anywhere; font: 11.5px/1.7 var(--mono); }
.ingest-reason { margin: 5px 0; color: #f3b0a0; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc { min-width: 0; }
.doc .docmeta { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .project-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
  .project-pack { gap: 12px; }
  .project-overview { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .project-batch { align-items: flex-start; }
  .project-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .project-stat { padding: 10px; }
  .project-stat b { font-size: 20px; }
  .project-dir > summary { padding: 11px; font-size: 12px; }
  .project-files { padding: 0 11px; }
  .material-row { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .material-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 5px 12px; white-space: normal; }
  .doc { padding: 20px 16px; }
}
