:root {
  --bg: #0b1119;
  --panel: #111a24;
  --panel-2: #182431;
  --line: #2b3947;
  --line-soft: #202c38;
  --text: #edf2f6;
  --muted: #93a1ad;
  --amber: #e6bd62;
  --red: #ef6a64;
  --cyan: #62cbc5;
  --green: #68b98f;
  --blue: #7c9fdb;
  --sidebar: 214px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template: 62px 1fr / var(--sidebar) 1fr; overflow: hidden; }
.topbar { grid-column: 1 / -1; display: grid; grid-template-columns: var(--sidebar) 1fr auto; align-items: center; height: 62px; background: #0d1521; border-bottom: 1px solid var(--line); }
.brand-block { height: 100%; display: flex; align-items: center; gap: 11px; padding: 0 16px; border-right: 1px solid var(--line); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #b7c7ec; border-radius: 10px; background: #dce5ff; color: #23345a; font: 800 19px Georgia, serif; box-shadow: 0 7px 22px rgba(5, 13, 28, .28); }
.brand-block div { display: flex; flex-direction: column; line-height: 1.05; }
.brand-block strong { font-size: 15px; font-weight: 720; }
.brand-block span:not(.brand-mark) { margin-top: 4px; color: #93a8c3; font-size: 9px; }
.market-strip { display: flex; align-items: center; gap: 22px; min-width: 0; padding: 0 18px; color: var(--muted); font-size: 12px; }
.market-strip b { margin-left: 5px; color: var(--text); font-weight: 650; }
.market-strip .hot { color: var(--red); }
.dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--muted); }
.online { background: var(--green); box-shadow: 0 0 8px rgba(72,184,122,.5); }
.mock { background: var(--amber); }
.top-actions { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.icon-button, .avatar, .assistant-panel header button, .search-box > button { border: 0; background: transparent; cursor: pointer; }
.icon-button { width: 34px; height: 34px; font-size: 22px; color: var(--muted); }
.status-button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-size: 11px; }
.avatar { width: 32px; height: 32px; background: #26364a; border-radius: 8px; font-size: 12px; }

.sidebar { display: flex; flex-direction: column; min-height: 0; background: #111a2c; border-right: 1px solid #2a3850; padding: 15px 12px; }
.scope-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid #34435a; border-radius: 8px; background: #0c1422; }
.scope-switch button { height: 31px; border: 0; border-radius: 6px; background: transparent; color: #9cacbf; cursor: pointer; font-size: 12px; }
.scope-switch button.active { background: #263551; color: #eff4ff; }
.primary-nav, .topic-nav { display: grid; gap: 3px; }
.primary-nav { margin-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.primary-nav button, .topic-nav button { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; min-height: 40px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: #b9c7dc; cursor: pointer; text-align: left; font-size: 13px; }
.primary-nav button:hover, .topic-nav button:hover { background: #1b2940; color: #fff; }
.primary-nav button.active { background: #dfe6f7; color: #243453; font-weight: 680; box-shadow: inset 3px 0 #7396ef; }
.primary-nav kbd { color: #5f686f; font-size: 10px; font-family: inherit; }
.nav-label { margin: 16px 9px 8px; color: #626b72; font-size: 10px; text-transform: uppercase; }
.topic-nav button { grid-template-columns: 1fr auto; }
.topic-nav button.active { background: #1c2d42; color: #75d6d0; }
.topic-nav small { color: #616a70; }
.sidebar-foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.sidebar-foot span, .sidebar-foot small { color: var(--muted); font-size: 10px; }
.sidebar-foot .next-batch-date { margin-top: 3px; color: #c4cacf; font-size: 11px; }
.sidebar-foot strong { color: var(--cyan); font-size: 22px; font-weight: 500; }

.workspace { min-width: 0; min-height: 0; height: calc(100vh - 62px); overflow: hidden; }
.view { display: none; width: 100%; height: 100%; }
.view.active { display: flex; }
#eventsView { grid-template-columns: minmax(440px, 43%) minmax(430px, 57%); }
#eventsView.active { display: grid; }
.pane { min-width: 0; min-height: 0; background: var(--panel); }
.event-list-pane { border-right: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.pane-header, .section-heading { display: flex; justify-content: space-between; align-items: center; min-height: 73px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--amber); font-size: 9px; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h1 { margin-top: 2px; font-size: 21px; font-weight: 600; }
h2 { font-size: 14px; font-weight: 600; }
.compact-controls { display: flex; gap: 7px; }
select, .compact-controls button, .panel-title button, .primary-action { height: 30px; border: 1px solid var(--line); border-radius: 3px; background: #0d1012; color: #c4cacf; padding: 0 10px; font-size: 11px; cursor: pointer; }
.compact-controls button:hover, .panel-title button:hover { border-color: var(--amber); color: var(--amber); }
.event-list { min-height: 0; overflow: auto; }
.event-row { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.event-row:hover { background: #15191c; }
.event-row.selected { background: #191d20; box-shadow: inset 3px 0 var(--amber); }
.grade { display: flex; justify-content: center; align-items: flex-start; padding-top: 2px; color: var(--amber); font-size: 12px; font-weight: 800; }
.grade.sss { color: var(--red); }
.grade.ss { color: var(--amber); }
.grade.s { color: var(--cyan); }
.grade.a { color: var(--blue); }
.event-row h2 { margin-bottom: 7px; line-height: 1.35; }
.event-row p { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.event-meta { display: flex; gap: 12px; margin-top: 9px; color: #697178; font-size: 10px; }
.event-meta .confirmed { color: var(--green); }

.detail-pane { overflow: auto; background: #0f1214; }
.detail-hero { padding: 20px 22px 18px; border-bottom: 1px solid var(--line); }
.detail-topline { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; }
.event-id { font-family: Consolas, monospace; color: var(--cyan); }
.detail-hero h1 { margin: 11px 0 9px; max-width: 780px; font-size: 24px; line-height: 1.35; }
.detail-summary { color: #aeb5ba; font-size: 13px; line-height: 1.65; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag-list span { padding: 3px 7px; border: 1px solid #353c41; color: #aab2b7; font-size: 10px; }
.detail-actions { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.detail-actions button { flex: none; height: 28px; padding: 0 9px; border: 1px solid #4b555c; border-radius: 3px; background: transparent; color: #c7cdd0; font-size: 10px; cursor: pointer; }
.detail-actions button:hover { border-color: var(--amber); color: var(--amber); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.detail-section { padding: 18px 22px; border-right: 1px solid var(--line); }
.detail-section:last-child { border: 0; }
.section-title { display: flex; justify-content: space-between; margin-bottom: 14px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.fact-list { display: grid; gap: 9px; }
.fact-item { display: grid; grid-template-columns: 15px 1fr; color: #c9ced1; font-size: 12px; line-height: 1.45; }
.fact-item b { color: var(--green); }
.impact-bars { display: grid; gap: 10px; }
.impact-row { display: grid; grid-template-columns: 46px 1fr 25px; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.bar { height: 4px; background: #242a2e; }
.bar i { display: block; height: 100%; background: var(--amber); }
.evidence-section { padding: 18px 22px; }
.evidence-row { display: grid; grid-template-columns: 1.4fr .7fr .6fr 58px; gap: 10px; width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--text); font-size: 11px; text-align: left; cursor: pointer; }
.evidence-row:hover { background: #151a1d; color: var(--amber); }
.evidence-row span:not(:first-child) { color: var(--muted); }
.judgment-box, .advice-box { margin: 4px 22px 12px; padding: 13px 15px; background: #151a1c; color: #c9d1d3; font-size: 12px; line-height: 1.6; }
.judgment-box { border-left: 2px solid var(--amber); }.advice-box { margin-bottom: 22px; border-left: 2px solid var(--cyan); }
.judgment-box p, .advice-box p { margin-top: 5px; }

#generationView, #shadowView, #paperView, #labView { flex-direction: column; overflow: auto; background: #0f1214; }
.section-heading { flex: none; background: var(--panel); }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 11px; }
.hot-dot { background: var(--red); }.batch-dot { background: var(--cyan); }
.queue-layout { display: grid; grid-template-columns: 1fr 280px; min-height: 0; height: 100%; }
.queue-table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); color: #6f787e; font-size: 9px; text-align: left; text-transform: uppercase; font-weight: 500; }
td { padding: 14px; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.queue-title { max-width: 430px; color: #d8dcdf; font-size: 12px; line-height: 1.45; }
.queue-title small { display: block; margin-top: 5px; color: #606970; font-family: Consolas, monospace; }
.level-cell { font-weight: 800; color: var(--amber); }
.level-cell.SSS { color: var(--red); }
.queue-table button { border: 1px solid #3b444a; border-radius: 3px; background: transparent; padding: 5px 8px; color: #bbc1c5; font-size: 10px; cursor: pointer; }
.queue-table button:hover { border-color: var(--amber); color: var(--amber); }
.process-panel { padding: 20px; border-left: 1px solid var(--line); background: #111417; }
.process-panel h2 { margin: 5px 0 18px; font-size: 17px; }
.contract-list { margin: 0; }
.contract-list div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.contract-list dt { color: #b9c0c4; }.contract-list dd { margin: 0; color: var(--muted); }
.gate-line { display: grid; gap: 7px; margin-top: 22px; color: var(--muted); font-size: 11px; text-align: center; }
.gate-line b { color: var(--amber); }

.primary-action { border-color: var(--amber); background: var(--amber); color: #181108; font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.metric { min-height: 92px; padding: 17px 18px; border-right: 1px solid var(--line); }
.metric span { color: var(--muted); font-size: 10px; }.metric strong { display: block; margin: 8px 0 4px; font-size: 22px; font-weight: 500; }.metric small { color: #626b71; font-size: 9px; }
.split-panel { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 0; flex: 1; }
.timeline-panel, .settlement-panel, .positions-panel, .strategy-panel { padding: 18px; }
.timeline-panel, .positions-panel { border-right: 1px solid var(--line); }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; color: var(--muted); font-size: 10px; }
.panel-title h2 { color: var(--text); }
.timeline-item { position: relative; margin-left: 7px; padding: 0 0 20px 19px; border-left: 1px solid #343b40; }
.timeline-item::before { position: absolute; left: -4px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); content: ""; }
.timeline-item.future::before { background: #444c51; }.timeline-item time { color: var(--cyan); font-size: 9px; }.timeline-item p { margin-top: 5px; color: #b8bfc3; font-size: 11px; line-height: 1.5; }
.shadow-case { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.shadow-case .case-level { font-weight: 800; color: var(--amber); }.shadow-case strong { display: block; font-size: 11px; }.shadow-case p { margin-top: 6px; color: var(--muted); font-size: 10px; }.case-state { align-self: start; color: var(--green); font-size: 9px; }
.case-state.refuted { color: var(--red); }

.safety-lock { padding: 6px 9px; border: 1px solid #4f3421; color: var(--amber); font-family: Consolas, monospace; font-size: 10px; }
.provider-strip { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: #0c0f11; }.provider-strip > div { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; min-width: 320px; padding: 9px 18px; border-right: 1px solid var(--line); font-size: 10px; }.provider-strip strong { font-size: 11px; }.provider-strip span { color: var(--muted); }.provider-strip b { color: var(--amber); font-weight: 500; }
.account-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.account-item { padding: 14px 18px; border-right: 1px solid var(--line); }.account-item span { color: var(--muted); font-size: 9px; }.account-item strong { display: block; margin-top: 5px; font-size: 18px; font-weight: 500; }.positive { color: var(--green); }.negative { color: var(--red); }
.paper-layout { display: grid; grid-template-columns: 1fr 280px; flex: 1; }
.positions-table td { white-space: nowrap; }.positions-table .event-ref { color: var(--cyan); font-family: Consolas, monospace; font-size: 9px; }
.strategy-panel h2 { margin: 4px 0 16px; font-size: 16px; }.strategy-panel dl { margin: 0; }.strategy-panel div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }.strategy-panel dt { color: var(--muted); }.strategy-panel dd { margin: 0; }.strategy-panel .lock-note { margin-top: 18px; padding: 10px; border: 1px solid #30373c; color: #7f898f; font-size: 10px; line-height: 1.5; }

.assistant-launcher { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--amber); color: #171008; font-size: 10px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.assistant-panel { position: fixed; right: 18px; bottom: 75px; display: none; flex-direction: column; width: min(360px, calc(100vw - 36px)); height: 430px; border: 1px solid #384047; border-radius: 5px; background: #111417; box-shadow: 0 16px 50px rgba(0,0,0,.65); z-index: 10; }
.assistant-panel.open { display: flex; }
.assistant-panel header { display: flex; justify-content: space-between; align-items: center; height: 48px; padding: 0 13px; border-bottom: 1px solid var(--line); }
.assistant-panel header div { display: flex; flex-direction: column; }.assistant-panel header strong { font-size: 12px; }.assistant-panel header span { color: var(--muted); font-size: 9px; }.assistant-panel header button { color: var(--muted); font-size: 21px; }
.chat-log { flex: 1; overflow: auto; padding: 13px; }.message { max-width: 88%; margin-bottom: 9px; padding: 9px 10px; border-radius: 4px; background: #1b2024; color: #bcc3c7; font-size: 11px; line-height: 1.55; }.message.user { margin-left: auto; background: #3b321d; color: #f1e7ce; }
.assistant-panel form { display: grid; grid-template-columns: 1fr auto; gap: 7px; padding: 10px; border-top: 1px solid var(--line); }.assistant-panel input, .search-box input { min-width: 0; border: 1px solid #343b40; border-radius: 3px; outline: none; background: #090b0d; color: white; padding: 0 10px; }.assistant-panel form button { border: 0; border-radius: 3px; background: var(--amber); color: #171008; font-size: 11px; font-weight: 700; }
.search-overlay { position: fixed; inset: 0; display: none; justify-content: center; padding-top: 90px; background: rgba(4,6,7,.78); z-index: 20; }.search-overlay.open { display: flex; }.search-box { position: relative; width: min(650px, calc(100vw - 30px)); max-height: 70vh; padding: 12px; border: 1px solid #3b444a; border-radius: 5px; background: #111417; overflow: auto; }.search-box input { width: calc(100% - 38px); height: 42px; font-size: 14px; }.search-box > button { position: absolute; right: 17px; top: 20px; color: var(--muted); font-size: 20px; }.search-result { padding: 12px 7px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }.search-result b { margin-right: 9px; color: var(--amber); font-size: 10px; }.search-result span { font-size: 12px; }
.evidence-overlay { position: fixed; inset: 0; display: none; place-items: center; padding: 18px; background: rgba(4,6,7,.82); z-index: 25; }.evidence-overlay.open { display: grid; }.evidence-document { width: min(720px, 100%); max-height: 82vh; overflow: auto; border: 1px solid #414a50; border-radius: 5px; background: #111417; box-shadow: 0 18px 60px rgba(0,0,0,.7); }.evidence-document header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }.evidence-document header h2 { margin-top: 4px; font-size: 17px; }.evidence-document header button { border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }.evidence-metadata { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }.evidence-metadata div { padding: 12px 14px; border-right: 1px solid var(--line-soft); }.evidence-metadata span, .evidence-metadata b { display: block; font-size: 9px; }.evidence-metadata span { color: var(--muted); }.evidence-metadata b { margin-top: 5px; color: #cbd1d4; font-weight: 500; }.evidence-content { min-height: 180px; padding: 22px; color: #c7cdd0; font-family: "Microsoft YaHei", sans-serif; font-size: 13px; line-height: 1.9; }.evidence-document footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }.evidence-document footer span { overflow: hidden; color: #667077; font: 9px Consolas, monospace; text-overflow: ellipsis; }.evidence-document footer button { flex: none; height: 29px; border: 1px solid var(--amber); border-radius: 3px; background: transparent; color: var(--amber); font-size: 10px; cursor: pointer; }
.canvas-overlay { position: fixed; inset: 0; display: none; place-items: center; padding: 18px; background: rgba(4,6,7,.82); z-index: 26; }.canvas-overlay.open { display: grid; }.canvas-dialog { width: min(540px, 100%); border: 1px solid #4b4230; border-radius: 5px; background: #111417; box-shadow: 0 18px 60px rgba(0,0,0,.7); }.canvas-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }.canvas-dialog header h2 { margin-top: 4px; font-size: 17px; }.canvas-dialog header button { border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }.canvas-modes { display: grid; gap: 7px; padding: 14px; }.canvas-modes button { display: grid; gap: 4px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 4px; background: #0d1012; color: var(--text); text-align: left; cursor: pointer; }.canvas-modes button.active { border-color: var(--amber); box-shadow: inset 3px 0 var(--amber); }.canvas-modes strong { font-size: 12px; }.canvas-modes span { color: var(--muted); font-size: 10px; }.canvas-dialog footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }.canvas-dialog footer span { color: var(--cyan); font: 10px Consolas, monospace; }.canvas-dialog footer button { height: 30px; border: 0; border-radius: 3px; background: var(--amber); color: #171008; font-size: 10px; font-weight: 700; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); padding: 9px 13px; border: 1px solid #495158; border-radius: 3px; background: #1a1f22; color: #d5dadc; font-size: 11px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 30; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

.lab-banner { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: #0c141c; }
.lab-banner > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.lab-banner span, .lab-banner strong { display: block; }
.lab-banner span { color: var(--muted); font-size: 9px; }
.lab-banner strong { margin-top: 6px; font: 600 13px Consolas, monospace; }
.lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.lab-card { min-height: 190px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #111b25; }
.lab-card.lab-wide { grid-column: 1 / -1; min-height: 160px; }
.lab-card p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.lab-counter { margin: 14px 0 8px; color: var(--cyan); font: 500 34px Consolas, monospace; }
.lab-status-list { margin-top: 14px; }
.lab-status-list div { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 10px; }
.route-strip { display: flex; align-items: center; gap: 10px; margin-top: 20px; color: var(--muted); font: 10px Consolas, monospace; }
.route-strip b { color: var(--amber); }
.strategy-books, .budget-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.strategy-books article { padding: 14px; border: 1px solid var(--line-soft); border-radius: 7px; background: #0d1620; }
.strategy-books h3 { margin: 6px 0; font-size: 15px; }
.strategy-books strong { color: var(--cyan); font-size: 10px; }
.budget-flow { grid-template-columns: repeat(4, 1fr); }
.budget-flow div { display: grid; gap: 6px; padding: 12px; border-left: 2px solid #33465a; background: #0e1720; }
.budget-flow b { color: var(--amber); font: 600 12px Consolas, monospace; }
.budget-flow span { font-size: 11px; }
.budget-flow small { color: var(--muted); font-size: 9px; }

@media (max-width: 920px) {
  :root { --sidebar: 158px; }
  .market-strip span:nth-child(2), .market-strip span:nth-child(3) { display: none; }
  #eventsView { grid-template-columns: 1fr; overflow: auto; }
  .event-list-pane { min-height: 55vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-pane { overflow: visible; }
  .queue-layout, .paper-layout { grid-template-columns: 1fr; }
  .process-panel, .strategy-panel { border-left: 0; border-top: 1px solid var(--line); }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .split-panel { grid-template-columns: 1fr; }
  .lab-banner { grid-template-columns: repeat(2, 1fr); }
  .strategy-books, .budget-flow { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .app-shell { grid-template: 52px auto 1fr / 1fr; overflow: auto; }
  .topbar { grid-template-columns: 1fr auto; position: sticky; top: 0; z-index: 5; }
  .brand-block { border-right: 0; }.market-strip { display: none; }.status-button { display: none; }
  .sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .scope-switch { width: 180px; }.primary-nav { grid-template-columns: repeat(5, 1fr); margin-top: 8px; padding-bottom: 0; border: 0; }.primary-nav button { grid-template-columns: 1fr; text-align: center; }.primary-nav button span, .primary-nav kbd, .nav-label, .topic-nav, .sidebar-foot { display: none; }
  .workspace { height: auto; min-height: calc(100vh - 110px); overflow: visible; }
  .view { min-height: calc(100vh - 110px); }.detail-grid { grid-template-columns: 1fr; }.detail-section { border-right: 0; border-bottom: 1px solid var(--line); }.metric-grid { grid-template-columns: repeat(2, 1fr); }.queue-table-wrap, .positions-panel { overflow-x: auto; }.queue-table, .positions-table { min-width: 700px; }.pane-header, .section-heading { padding: 11px 12px; }.detail-hero, .detail-section, .evidence-section { padding-left: 14px; padding-right: 14px; }
  .detail-actions { align-items: flex-start; flex-direction: column; }
  .evidence-metadata { grid-template-columns: repeat(2, 1fr); }
  .lab-grid, .lab-banner, .strategy-books, .budget-flow { grid-template-columns: 1fr; }
}

/* Qunxing belongs to the Xingchen/Fanxing product family, with its own night-sky identity. */
h1, h2, h3, strong { letter-spacing: 0; }
h1 { font-weight: 720; }
.top-actions { gap: 10px; padding-right: 16px; }
.status-button, select, .compact-controls button, .panel-title button, .primary-action {
  border-color: #344457;
  border-radius: 8px;
  background: #121d29;
}
.icon-button { border-radius: 8px; color: #aab9ca; }
.icon-button:hover { background: #1b2939; color: #fff; }
.market-strip { color: #8fa0b0; }
.sidebar-foot { border-color: #2a3850; }
.sidebar-foot strong { color: #75d6d0; font-weight: 650; }
.pane, .section-heading { background: #111a24; }
.detail-pane, #generationView, #shadowView, #paperView, #labView { background: #0e1720; }
.event-row:hover { background: #17222e; }
.event-row.selected { background: #1a2633; box-shadow: inset 3px 0 var(--amber); }
.detail-hero { background: #101a25; }
.detail-actions button, .queue-table button, .panel-title button {
  border-radius: 7px;
  background: #131e29;
}
.tag-list span { border-color: #364657; border-radius: 5px; background: #14202c; }
.bar { border-radius: 4px; background: #263442; overflow: hidden; }
.judgment-box, .advice-box { border-radius: 0 8px 8px 0; background: #151f29; }
.process-panel, .strategy-panel { background: #121c27; }
.provider-strip { background: #0d1620; }
.primary-action { border-color: var(--amber); background: var(--amber); color: #251d0e; }
.safety-lock { border-color: #6a5730; border-radius: 7px; background: #1b1c1b; }
.assistant-launcher {
  width: 48px;
  height: 48px;
  border: 1px solid #b9c8e9;
  border-radius: 14px;
  background: #dce5ff;
  color: #24385e;
  font: 800 20px Georgia, serif;
  box-shadow: 0 12px 34px rgba(2, 9, 20, .48);
}
.assistant-panel, .search-box, .evidence-document, .canvas-dialog {
  border-color: #344556;
  border-radius: 8px;
  background: #121c27;
}
.message { border-radius: 8px; background: #1b2834; }
.message.user { background: #263958; color: #eaf0ff; }
.assistant-panel input, .search-box input, .canvas-modes button {
  border-color: #344556;
  border-radius: 7px;
  background: #0d1620;
}
.assistant-panel form button, .canvas-dialog footer button { border-radius: 7px; }
.canvas-modes button.active { border-color: #7b9ce9; box-shadow: inset 3px 0 #7b9ce9; }
.evidence-content { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif; }
.toast { border-color: #435466; border-radius: 8px; background: #1a2733; }

@media (max-width: 640px) {
  .app-shell { grid-template: 62px auto 1fr / 1fr; }
  html, body { width: 100%; overflow-x: hidden; }
  .topbar, .sidebar, .workspace, .view, .pane { width: 100%; min-width: 0; max-width: 100vw; }
  .sidebar { overflow: hidden; }
  .primary-nav { grid-template-columns: minmax(0, 1fr) !important; width: calc(100vw - 16px) !important; min-width: 0; max-width: calc(100vw - 16px); overflow: hidden; }
  .primary-nav button { width: 100%; min-width: 0; max-width: 100%; padding: 0 12px; overflow: hidden; font-size: 12px; text-align: left; white-space: nowrap; }
  .pane-header, .section-heading { flex-wrap: wrap; gap: 10px; }
  .compact-controls { width: 100%; }
  .compact-controls select { min-width: 0; flex: 1; }
  .event-row { grid-template-columns: 42px minmax(0, 1fr); padding-inline: 12px; }
  .event-row > div { min-width: 0; }
  .detail-hero h1, .detail-summary, .event-row h2, .event-row p { overflow-wrap: anywhere; }
  .evidence-row { grid-template-columns: minmax(0, 1fr) auto; }
  .evidence-row span:nth-child(2), .evidence-row span:nth-child(3) { display: none; }
  .workspace { min-height: calc(100vh - 120px); }
  .view { min-height: calc(100vh - 120px); }
}
