:root {
  --paper: #f3efe6;
  --paper-deep: #e9e1d3;
  --ink: #1f2a27;
  --muted: #6c746d;
  --forest: #294d42;
  --forest-dark: #17352d;
  --jade: #4f7568;
  --cinnabar: #b5553c;
  --gold: #bd8a43;
  --line: rgba(36, 54, 49, 0.14);
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(32, 42, 37, 0.09);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 8%, rgba(189, 138, 67, 0.13), transparent 26rem),
    linear-gradient(135deg, #f6f2e9 0%, var(--paper) 58%, #eee8dc 100%);
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
}
button, textarea { font: inherit; }
button { color: inherit; }

.topbar {
  height: 82px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 237, 0.86);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: #fff8e9; background: var(--forest); box-shadow: inset 0 0 0 4px rgba(255,255,255,.12);
  font-size: 20px;
}
.brand h1 { margin: 0; font-size: 19px; letter-spacing: .08em; font-weight: 650; }
.brand p { margin: 3px 0 0; color: var(--muted); font: 12px/1.3 system-ui, sans-serif; letter-spacing: .06em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.mode.real { color: #7a3a22; background: rgba(181,85,60,.09); border-color: rgba(181,85,60,.25); }
.mode { font: 12px system-ui, sans-serif; color: var(--forest); background: rgba(41,77,66,.08); border: 1px solid rgba(41,77,66,.14); border-radius: 999px; padding: 8px 12px; }
.mode i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #4e9b73; box-shadow: 0 0 0 4px rgba(78,155,115,.12); }
.ghost-button { border: 1px solid var(--line); background: transparent; border-radius: 9px; padding: 8px 12px; cursor: pointer; }
.ghost-button:hover { border-color: var(--jade); color: var(--forest); }

.workspace { height: calc(100vh - 82px); min-height: 620px; display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(390px, .92fr); }
.workspace.swapped { grid-template-columns: minmax(390px, .92fr) minmax(480px, 1.08fr); }
.workspace.swapped .chat-panel { order: -1; border-right: 1px solid var(--line); border-left: 0; }
.workspace.swapped .graph-panel { border-right: 0; }
.graph-panel { border-right: 1px solid var(--line); }
.chat-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 1fr auto; background: rgba(255,253,248,.45); }
.conversation { min-height: 0; overflow-y: auto; overflow-wrap: anywhere; padding: 34px clamp(22px, 4vw, 54px) 28px; scroll-behavior: smooth; }
.welcome-card { max-width: 680px; margin: 0 auto 26px; padding: 25px; border: 1px solid var(--line); background: rgba(255,253,248,.76); box-shadow: var(--shadow); border-radius: 4px 22px 22px 22px; }
.eyebrow { color: var(--cinnabar); text-transform: uppercase; font: 700 10px/1 system-ui, sans-serif; letter-spacing: .16em; }
.welcome-card.collapsed { display: none; }
.welcome-card h2 { margin: 13px 0 10px; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; font-weight: 600; }
.welcome-card p { color: var(--muted); line-height: 1.75; font-size: 15px; }
.suggestion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.suggestion-button { text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: 10px; padding: 11px 12px; line-height: 1.45; cursor: pointer; transition: .18s ease; }
.suggestion-button:hover { transform: translateY(-1px); border-color: rgba(181,85,60,.48); color: var(--cinnabar); box-shadow: 0 8px 24px rgba(61,52,42,.07); }

.message { max-width: 680px; margin: 0 auto 18px; animation: rise .25s ease-out; }
.message.user { display: flex; justify-content: flex-end; }
.message.user p { max-width: 82%; margin: 0; padding: 12px 16px; color: white; background: var(--forest); border-radius: 16px 16px 3px 16px; line-height: 1.55; }
.message.assistant { padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: 3px 18px 18px 18px; box-shadow: 0 10px 30px rgba(32,42,37,.06); }
.message.assistant.unsupported { border-left: 3px solid var(--gold); }
.message-label { color: var(--muted); font: 700 10px/1 system-ui, sans-serif; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 10px; }
.answer-text { margin: 0; line-height: 1.8; font-size: 16px; white-space: pre-wrap; }
.citation-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.citation-chip { border: 1px solid rgba(41,77,66,.17); background: rgba(41,77,66,.055); color: var(--forest); padding: 7px 9px; border-radius: 8px; cursor: pointer; font: 12px system-ui, sans-serif; }
.citation-chip:hover { background: rgba(41,77,66,.11); }
.message.assistant { cursor: pointer; transition: box-shadow .18s ease, border-color .18s ease; }
.message.assistant.active { border-color: rgba(181,85,60,.5); box-shadow: 0 12px 34px rgba(181,85,60,.12); }
.message.assistant.status-insufficient { border-left: 3px solid var(--gold); }
.message.assistant.status-partial { border-left: 3px solid #c9a15b; }
.message-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font: 600 10px/1 system-ui, sans-serif; letter-spacing: .04em; padding: 4px 7px; border-radius: 999px; color: var(--muted); background: rgba(36,54,49,.07); text-transform: none; }
.badge.ok { color: #2f6b4a; background: rgba(78,155,115,.14); }
.badge.bad { color: #9a3b27; background: rgba(181,85,60,.14); }
.badge.warn { color: #8a5d1b; background: rgba(189,138,67,.18); }
.badge.status-answered { color: #2f6b4a; background: rgba(78,155,115,.14); }
.badge.status-partial { color: #8a5d1b; background: rgba(189,138,67,.18); }
.badge.status-insufficient { color: #9a3b27; background: rgba(181,85,60,.14); }
.cite-marker { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin: 0 2px; padding: 0 4px; border: 0; border-radius: 9px; vertical-align: super; font: 700 10px system-ui, sans-serif; color: #fff; background: var(--forest); cursor: pointer; }
.cite-marker:hover { background: var(--cinnabar); }
.detail, .other-material, .diagnostics { margin-top: 12px; font: 13px/1.6 system-ui, sans-serif; color: var(--muted); }
.detail summary, .other-material summary, .diagnostics summary { cursor: pointer; color: var(--forest); font-weight: 600; }
.detail .answer-text { margin-top: 8px; font-size: 14px; color: var(--ink); }
.diag-line { margin: 6px 0 0; font-size: 12px; }
.section-title { display: block; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font: 600 11px system-ui, sans-serif; }
.claim-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.claim { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(41,77,66,.035); }
.claim-missing { border-color: rgba(181,85,60,.4); background: rgba(181,85,60,.05); }
.claim-button { display: flex; gap: 9px; align-items: flex-start; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; line-height: 1.55; }
.claim-no { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--forest); font: 700 11px system-ui, sans-serif; }
.claim-button:hover .claim-text { color: var(--cinnabar); }
.claim-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 0 29px; }
.claim-quote { margin: 8px 0 0 29px; padding-left: 10px; border-left: 2px solid var(--cinnabar); color: #4d554f; font-size: 13px; line-height: 1.6; }
.claim-issue { margin: 6px 0 0 29px; color: #9a3b27; font: 12px/1.5 system-ui, sans-serif; }
.other-material .citation-chip { margin: 6px 6px 0 0; }
.retrieval-note { margin: 11px 0 0; color: var(--muted); font: 11px/1.5 system-ui, sans-serif; }
.follow-ups { margin-top: 15px; }
.follow-ups strong { display: block; color: var(--muted); margin-bottom: 8px; font: 600 11px system-ui, sans-serif; }
.follow-ups .suggestion-button { margin: 0 6px 6px 0; font-size: 13px; padding: 8px 10px; }
.error-card { border-color: rgba(181,85,60,.35) !important; background: #fff8f4 !important; }

.composer { padding: 18px clamp(20px, 4vw, 48px) 17px; border-top: 1px solid var(--line); background: rgba(248,245,237,.92); display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.composer textarea { resize: none; min-height: 47px; max-height: 130px; padding: 13px 15px; border: 1px solid rgba(36,54,49,.2); border-radius: 12px; background: var(--white); color: var(--ink); outline: none; line-height: 1.45; }
.composer textarea:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(79,117,104,.09); }
.composer button { align-self: start; height: 47px; border: 0; border-radius: 11px; padding: 0 17px; color: white; background: var(--cinnabar); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.composer button:hover { background: #9f4632; }
.composer button:disabled { opacity: .5; cursor: wait; }
.composer-note { grid-column: 1 / -1; margin: -3px 0 0; color: #8b8d87; font: 10px system-ui, sans-serif; }

.graph-panel { position: relative; min-width: 0; display: grid; grid-template-rows: auto minmax(300px, 1fr) auto auto; overflow: hidden; background: rgba(232,225,211,.48); }
.graph-panel::before { content: ""; position: absolute; inset: 0; opacity: .28; pointer-events: none; background-image: linear-gradient(rgba(41,77,66,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(41,77,66,.05) 1px, transparent 1px); background-size: 28px 28px; }
.graph-heading { z-index: 1; padding: 26px 28px 8px; display: flex; align-items: end; justify-content: space-between; }
.graph-heading h2 { margin: 8px 0 0; font-size: 21px; font-weight: 600; }
.graph-stats { color: var(--muted); font: 11px system-ui, sans-serif; }
.graph-canvas { z-index: 1; min-height: 330px; position: relative; overflow: hidden; margin: 0 16px; }
.graph-canvas svg { width: 100%; height: 100%; min-height: 330px; display: block; }
.graph-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font: 12px system-ui, sans-serif; }
.graph-empty strong { color: var(--ink); font: 600 17px "Songti SC", serif; }
.empty-orbit { width: 110px; height: 70px; position: relative; margin-bottom: 7px; border: 1px dashed rgba(41,77,66,.24); border-radius: 50%; }
.empty-orbit i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--jade); }
.empty-orbit i:nth-child(1) { left: 10px; top: 27px; }.empty-orbit i:nth-child(2) { right: 13px; top: 9px; background: var(--cinnabar); }.empty-orbit i:nth-child(3) { right: 24px; bottom: 5px; background: var(--gold); }
.graph-edge { stroke: rgba(41,77,66,.34); stroke-width: 1.4; marker-end: url(#arrow); }
.graph-edge-hit { stroke: transparent; stroke-width: 16; cursor: pointer; }
.graph-edge-group:hover .graph-edge { stroke: var(--cinnabar); stroke-width: 2.2; }
.edge-label { fill: #6d756f; font: 10px system-ui, sans-serif; pointer-events: none; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.graph-node { cursor: pointer; }
.graph-node.layer-core circle { stroke: var(--cinnabar); stroke-width: 4; }
.graph-node.layer-expanded circle { stroke: var(--gold); stroke-dasharray: 5 3; }
.graph-node.dim, .graph-edge-group.dim { opacity: .22; }
.graph-edge-group.layer-core .graph-edge { stroke: rgba(41,77,66,.6); stroke-width: 1.9; }
.graph-edge-group.layer-related .graph-edge { stroke-dasharray: 4 3; }
.graph-edge-group.hl .graph-edge { stroke: var(--cinnabar); stroke-width: 2.6; }
.expand-hint circle { fill: var(--gold); stroke: #fff; stroke-width: 2; filter: none; }
.expand-hint text { fill: #fff; font: 700 13px system-ui, sans-serif; }
.graph-node circle { stroke: rgba(255,255,255,.9); stroke-width: 4; filter: drop-shadow(0 6px 8px rgba(31,42,39,.17)); transition: .18s ease; }
.graph-node:hover circle { stroke: #fff; stroke-width: 6; transform-origin: center; }
.graph-node text { fill: white; font: 600 11px system-ui, sans-serif; text-anchor: middle; pointer-events: none; }
.graph-node .node-sub { font-size: 8px; opacity: .76; }

.inspector { z-index: 2; margin: 0 28px 14px; padding: 17px 18px; min-height: 112px; max-height: 260px; overflow-y: auto; background: rgba(255,253,248,.9); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 14px 32px rgba(31,42,39,.06); }
.inspector h3 { margin: 8px 0 6px; font-size: 16px; }
.inspector p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.inspector .quote { margin-top: 9px; padding-left: 11px; border-left: 2px solid var(--cinnabar); color: var(--ink); }
.source-text { color: var(--ink) !important; max-height: 150px; overflow-y: auto; }
.source-mark { background: rgba(189,138,67,.38); color: inherit; padding: 1px 0; border-radius: 2px; box-shadow: 0 0 0 2px rgba(189,138,67,.22); }
.relation-list { display: grid; gap: 8px; margin-top: 9px; }
.relation-block { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(41,77,66,.035); font-size: 13px; }
.relation-block strong { font-size: 13px; }
.relation-block .quote { margin-top: 5px; font-size: 12px; }
.relation-meta { display: block; margin-top: 3px; color: var(--muted); font: 11px/1.5 system-ui, sans-serif; }
.mention-row, .node-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.node-actions .relation-meta { flex-basis: 100%; margin: 0; }
.node-actions .suggestion-button { padding: 6px 9px; font-size: 12px; }
.mini-button { margin-top: 6px; border: 1px solid rgba(41,77,66,.22); background: var(--white); border-radius: 7px; padding: 5px 9px; font: 12px system-ui, sans-serif; color: var(--forest); cursor: pointer; }
.mini-button:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.mini-button.primary { background: var(--forest); color: #fff; border-color: var(--forest); }
.mini-button:disabled { opacity: .5; cursor: wait; }
.legend { flex-wrap: wrap; z-index: 1; display: flex; gap: 17px; padding: 0 28px 20px; color: var(--muted); font: 10px system-ui, sans-serif; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--forest); }.legend-dot.location { background: var(--gold); }
.legend-ring { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--cinnabar); background: transparent; }
.legend-ring.related { border-color: rgba(255,255,255,.9); background: var(--forest); box-shadow: 0 0 0 1px var(--line); }
.legend-ring.expanded { border: 2px dashed var(--gold); }
.legend-line { width: 16px; height: 1px; background: var(--jade); position: relative; }.legend-line::after { content: ""; position: absolute; right: -1px; top: -2px; border-left: 4px solid var(--jade); border-top: 2px solid transparent; border-bottom: 2px solid transparent; }
.loading-lines { display: flex; gap: 6px; margin: 16px 0; }.loading-lines i { width: 7px; height: 7px; background: var(--jade); border-radius: 50%; animation: pulse 1s infinite alternate; }.loading-lines i:nth-child(2){animation-delay:.2s}.loading-lines i:nth-child(3){animation-delay:.4s}
.loading-card p { margin: 0; color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } }
@keyframes pulse { to { opacity: .25; transform: translateY(-4px); } }

@media (max-width: 900px) {
  body { overflow-x: hidden; }
  .topbar { height: auto; min-height: 62px; padding: 10px 16px; gap: 8px; flex-wrap: wrap; }.brand p { display: none; }
  .mode { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace, .workspace.swapped { height: auto; min-height: 0; display: flex; flex-direction: column; }
  /* 窄屏优先问答，图谱在下方；交换后图谱在上方。 */
  .chat-panel, .workspace.swapped .chat-panel { order: 0; min-height: 70vh; border: 0; }
  .graph-panel, .workspace.swapped .graph-panel { order: 1; min-height: 640px; border: 0; border-top: 1px solid var(--line); }
  .workspace.swapped .graph-panel { order: -1; border-top: 0; border-bottom: 1px solid var(--line); }
  .conversation { max-height: none; }
  .suggestion-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top-actions { gap: 6px; flex-wrap: wrap; }.top-actions .ghost-button { font-size: 12px; padding: 7px 9px; }.brand h1 { font-size: 16px; }
  .conversation { padding: 22px 14px; }.welcome-card, .message.assistant { padding: 16px; }
  .composer { padding: 13px; }.composer button span:first-child { display: none; }
  .graph-heading, .legend { padding-left: 18px; padding-right: 18px; }.inspector { margin-left: 14px; margin-right: 14px; }
  .claim-meta, .claim-quote, .claim-issue { margin-left: 0; }
}

/* v0.2 信息层次：回答最醒目，其余按需展开 */
.message.assistant { padding: 22px 24px; }
.answer-text { font-size: 19px; line-height: 1.75; }
.detail .answer-text { font-size: 15px; }
.cite-marker { min-width: 15px; height: 15px; font-size: 9px; background: rgba(41,77,66,.55); }
.answer-warning { margin: 8px 0 0; color: #8a5d1b; font: 12px/1.5 system-ui, sans-serif; }
.detail, .claims, .diagnostics { margin-top: 10px; }
.detail summary, .claims summary, .diagnostics summary { font-size: 12px; font-weight: 500; color: var(--muted); }
.detail summary:hover, .claims summary:hover, .diagnostics summary:hover { color: var(--forest); }
.claims .claim-list { margin-top: 8px; }
.chunk-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.chunk-row .mini-button { margin-top: 0; }
.follow-ups { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.inspector.idle { min-height: 0; margin-bottom: 6px; padding: 4px 2px; background: none; border: 0; box-shadow: none; }
.inspector.idle p { font: 12px system-ui, sans-serif; color: var(--muted); }

.extras-bar { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.extras-toggle { padding: 0; border: 0; background: none; color: var(--muted); font: 12px system-ui, sans-serif; cursor: pointer; }
.extras-toggle::before { content: "▸ "; }
.extras-toggle[aria-expanded="true"] { color: var(--forest); font-weight: 600; }
.extras-toggle[aria-expanded="true"]::before { content: "▾ "; }
.extras-toggle:hover { color: var(--forest); }
.extras-panel { margin-top: 8px; font: 13px/1.6 system-ui, sans-serif; color: var(--muted); }
.extras-panel[hidden] { display: none; }
.extras-panel .claim-list { margin: 0; }
.extras-panel .detail { margin: 0; }
.extras-panel .answer-text { color: var(--ink); }
.follow-ups { margin-top: 12px; padding-top: 10px; }

.trace-step { margin: 0 0 12px; }
.trace-step h4 { margin: 0 0 4px; font: 600 12px system-ui, sans-serif; color: var(--forest); }
.trace-step .diag-line { margin: 3px 0 0; }
.term-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.term-chip { padding: 2px 6px; border-radius: 5px; background: rgba(41,77,66,.08); color: var(--forest); font: 11px system-ui, sans-serif; }
.trace-table { width: 100%; margin-top: 6px; border-collapse: collapse; font: 11px/1.4 system-ui, sans-serif; }
.trace-table th, .trace-table td { padding: 4px 5px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.trace-table th { color: var(--muted); font-weight: 600; }
.trace-table tr[class^="decision-"] { cursor: pointer; }
.trace-table tr:hover td { background: rgba(41,77,66,.05); }
.trace-table .decision-selected td:last-child { color: #2f6b4a; font-weight: 600; }
.trace-table .decision-below_threshold td:last-child, .trace-table .decision-dropped_budget td:last-child, .trace-table .decision-dropped_max_chunks td:last-child { color: #9a3b27; }
.extras-panel a.mini-button { display: inline-block; text-decoration: none; margin-top: 4px; }
@media (max-width: 520px) { .trace-table { display: block; overflow-x: auto; } }
.debug-link, .explore-link { text-decoration: none; color: inherit; font: inherit; }
@media (max-width: 520px) { .debug-link { display: none; } }
.extras-panel { overflow-x: auto; }
.trace-table td:nth-child(2), .trace-table td:nth-child(3), .trace-table td:nth-child(5) { white-space: nowrap; }
.trace-table td:nth-child(2) { font-family: ui-monospace, monospace; font-size: 10px; }

/* 首页新链路（/api/explore/ask）：共享渲染样式在 explore_view.css（限定在 .xv 内），这里只补颜色变量和首页内的排版。 */
.workspace.xv {
  --bg: rgba(255,253,248,.72); --panel: #fffdf8; --accent: var(--forest); --accent-soft: rgba(41,77,66,.09);
  --ok: #2f6b4a; --warn: #8a5d1b; --bad: #9a3b27; --ok-bg: rgba(78,155,115,.14); --warn-bg: rgba(189,138,67,.18); --bad-bg: rgba(181,85,60,.14); --mark: rgba(189,138,67,.38);
  --c-协助: #2f9e6b; --c-冲突: #d64545; --c-亲属: #8a5cc2; --c-旧交: #d9992b; --c-结义: #1f8fa6; --c-上下级: #5b6b8c; --c-其他: #8a8f98;
}
.graph-canvas.xview { overflow-y: auto; padding: 4px 6px 10px; font: 14px/1.6 system-ui, "PingFang SC", sans-serif; }
.graph-canvas.xview svg.graph { height: auto; min-height: 0; }
.graph-canvas.xview .legend svg { width: 34px; height: 8px; min-height: 0; }
.graph-canvas.xview .legend { z-index: 0; }
/* 左侧：图在上、详情在下。未选择时详情区收起、图谱占满；选择后展开（默认约 38%），分隔条可拖动；详情内部独立滚动，不遮挡图谱 */
.workspace.xv .graph-panel { grid-template-rows: auto minmax(0, 1fr) 0 0; transition: grid-template-rows .22s ease; }
.workspace.xv .graph-panel.has-sel { grid-template-rows: auto minmax(200px, 1fr) 10px var(--dh, 38%); }
.workspace.xv .graph-panel.dragging { transition: none; }
.graph-split { display: none; }
.workspace.xv .graph-split { display: flex; z-index: 3; align-items: center; justify-content: center; cursor: row-resize; touch-action: none; visibility: hidden; }
.workspace.xv .has-sel .graph-split { visibility: visible; }
.workspace.xv .graph-split::after { content: ""; width: 46px; height: 4px; border-radius: 4px; background: rgba(36,54,49,.28); }
.workspace.xv .graph-split:hover::after, .workspace.xv .dragging .graph-split::after { background: var(--cinnabar); }
.workspace.xv .inspector { margin: 0 12px; padding: 0; min-height: 0; max-height: none; overflow: hidden; display: flex; flex-direction: column; background: var(--white); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 20px rgba(31,42,39,.06); visibility: hidden; font-family: system-ui, "PingFang SC", sans-serif; }
.workspace.xv .has-sel .inspector { visibility: visible; }
.workspace.xv .inspector > .insp { flex: 1; min-height: 0; overflow: auto; padding: 10px 16px 16px; color: var(--ink); }
.workspace.xv .inspector > .insp > div, .workspace.xv .inspector > .insp details { font-size: 13.5px; }
.dclose { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 4px 16px; border-bottom: 1px solid var(--line); background: var(--white); color: var(--muted); font: 600 12px system-ui, sans-serif; }
/* Q2：关系图占满画布（图例折叠在底部，类别筛选在顶部） */
.graph-canvas.xfill { overflow: hidden; padding: 0 6px; }
.xfillpane { height: 100%; min-height: 0; display: flex; flex-direction: column; font: 14px/1.6 system-ui, "PingFang SC", sans-serif; }
.xfillpane .notice { flex: none; margin: 0 0 6px; }
.workspace.xv .gfillwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.workspace.xv .gwrap.fill { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 0; background: none; }
.workspace.xv .gwrap.fill .gtools { border-bottom: 0; padding: 4px 4px 2px; }
.workspace.xv .gholder { flex: 1; min-height: 0; position: relative; }
.workspace.xv .gholder svg.graph { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; }
.workspace.xv .glegend { flex: none; max-height: 40%; overflow: auto; padding: 2px 8px 6px; font-size: 12px; color: var(--muted); }
.workspace.xv .glegend summary { cursor: pointer; }
.workspace.xv .glegend > span { display: block; margin-top: 3px; }
.workspace.xv .glegend svg { width: 34px; height: 8px; min-height: 0; vertical-align: middle; }
.xempty { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 60px 20px; text-align: center; color: var(--muted); font: 13px system-ui, sans-serif; }
.xempty b { color: var(--ink); font: 600 17px "Songti SC", serif; }
.cite-marker.bad { background: var(--cinnabar); }
.cite-marker.derived { background: var(--gold); }
.suggestion-button .sg-hint { display: block; margin-top: 3px; color: var(--muted); font: 11px system-ui, sans-serif; }
.follow-ups .alt-title { margin-top: 6px; }
.claims-holder .sec { margin-top: 0; }
.claims-holder .claim { background: rgba(41,77,66,.035); }
.badge.view { color: var(--forest); background: rgba(41,77,66,.1); }
.workspace.xv .welcome-card b { color: var(--cinnabar); font-weight: 650; }
.xfillpane .xwarn { flex: none; margin: 0 0 4px; font-size: 12.5px; color: var(--warn); }
.xfillpane .xwarn summary { cursor: pointer; }
.xfillpane .xwarn .notice { margin: 4px 0; }

/* 首次使用说明、回答反馈 */
.help-notice { max-width: 680px; margin: 0 auto 16px; padding: 14px 18px 12px; border: 1px solid rgba(189,138,67,.4); border-radius: 12px; background: rgba(189,138,67,.09); font: 13px/1.65 system-ui, "PingFang SC", sans-serif; color: var(--ink); }
.help-notice[hidden] { display: none; }
.help-notice .bn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.help-notice .bn-head strong { font-size: 13px; }
.help-notice ul { margin: 0; padding-left: 18px; color: #4d554f; }
.help-notice li { margin: 2px 0; }
.help-notice b { color: var(--cinnabar); font-weight: 650; }
.bn-close { padding: 4px 12px; border: 1px solid rgba(41,77,66,.28); border-radius: 999px; background: var(--white); color: var(--forest); font: 12px system-ui, sans-serif; cursor: pointer; }
.bn-close:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.feedback-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font: 12px system-ui, "PingFang SC", sans-serif; color: var(--muted); }
.fb-btn { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: 12px system-ui, "PingFang SC", sans-serif; cursor: pointer; }
.fb-btn:hover { border-color: var(--jade); }
.fb-btn[aria-pressed="true"] { font-weight: 600; }
.fb-btn.up[aria-pressed="true"] { border-color: #2f6b4a; background: rgba(78,155,115,.16); color: #2f6b4a; }
.fb-btn.down[aria-pressed="true"] { border-color: #9a3b27; background: rgba(181,85,60,.14); color: #9a3b27; }
.fb-note { color: var(--muted); }
.error-card .mini-button { margin-top: 10px; }
.mode[hidden] { display: none; }
@media (max-width: 900px) { .btn-text { display: none; } }
@media (max-width: 520px) { .help-notice { padding: 12px 14px 10px; } .brand h1 { white-space: nowrap; } }
.jump-visual { display: none; }
.jump-visual::before { content: none !important; }
@media (max-width: 900px) {
  .jump-visual { display: inline; color: var(--forest); font-weight: 600; }
  .composer { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -8px 20px rgba(31,42,39,.06); }
}
/* 窄屏：左侧面板定高（图在上、详情在下的百分比行才有确定的基准），点击后详情在面板内部滚动，不会把整页撑长、把详情推到屏幕外 */
@media (max-width: 900px) {
  .workspace.xv .graph-panel, .workspace.xv.swapped .graph-panel { flex: none; height: clamp(560px, 84vh, 780px); min-height: 0; }
}

/* Minimal Multilingual v1：界面语言切换器、翻译回退说明（信息色，不是错误红）、原文证据语言说明 */
.locale-select { border: 1px solid var(--line); background: transparent; border-radius: 9px; padding: 7px 26px 7px 10px; font: 13px system-ui, sans-serif; color: inherit; cursor: pointer; max-width: 120px;
  appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 52%, calc(100% - 9px) 52%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.locale-select:hover { border-color: var(--jade); }
.locale-select:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.answer-info { margin: 10px 0 0; padding: 7px 10px; border-left: 3px solid #5b7fa6; background: rgba(91,127,166,.08); border-radius: 0 6px 6px 0; color: #34506e; font: 12.5px/1.55 system-ui, sans-serif; }
/* 翻译回退：明显但非致命（有效的中文回答仍在）——琥珀色底、左侧强调线、图标、粗体标题 + 一行说明；不是红色错误 */
.ml-fallback { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 10px; padding: 9px 12px; border: 1px solid #e3b65a; border-left: 4px solid #c98a12;
  background: #fff4dc; border-radius: 8px; color: #5b3d06; font: 13px/1.5 system-ui, sans-serif; }
.ml-fallback-icon { flex: none; font-size: 15px; line-height: 1.35; color: #b7790a; }
.ml-fallback-text { display: flex; flex-direction: column; min-width: 0; }
.ml-fallback-text strong { font-weight: 700; }
.ml-fallback-left { flex: none; }
.evidence-note { margin: 0 0 8px; color: var(--muted); font: 11.5px/1.5 system-ui, sans-serif; }
@media (max-width: 520px) { .locale-select { font-size: 12px; padding: 6px 22px 6px 8px; max-width: 96px; } }
