:root {
  --ink: #102a43;
  --muted: #627d98;
  --line: #d9e2ec;
  --paper: #ffffff;
  --wash: #f4f7fa;
  --blue: #1379b8;
  --blue-dark: #0b5686;
  --cyan: #5bc0d2;
  --orange: #ea6a2a;
  --magenta: #b832c4;
  --green: #16856b;
  --shadow: 0 18px 50px rgba(16, 42, 67, .09);
  font-family: "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--wash);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 1280px; min-height: 100vh; background: radial-gradient(circle at 80% 0, #e2f2f7 0, transparent 28%), var(--wash); }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
.topbar { height: 76px; display: flex; align-items: center; gap: 20px; padding: 0 24px; color: #fff; background: linear-gradient(115deg, #102a43, #164e68); box-shadow: 0 8px 24px rgba(16, 42, 67, .2); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px 4px 12px 4px; font: 800 14px/1 "Segoe UI"; letter-spacing: .08em; color: #102a43; background: #72d1dc; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: .03em; }
.brand p { margin: 3px 0 0; font-size: 11px; color: #b9d7e5; }
.import-button { margin-left: auto; padding: 11px 20px; border-radius: 8px; color: #102a43; font-weight: 800; background: #fff; cursor: pointer; box-shadow: 0 5px 16px rgba(0,0,0,.16); }
.shell { display: grid; grid-template-columns: 255px minmax(650px, 1fr) 330px; gap: 14px; padding: 14px; height: calc(100vh - 76px); }
.panel { background: rgba(255,255,255,.95); border: 1px solid rgba(188,204,218,.75); border-radius: 12px; box-shadow: var(--shadow); }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 14px; }
.section-title strong { min-width: 28px; padding: 4px 8px; border-radius: 20px; text-align: center; color: var(--blue-dark); background: #e5f2f8; }
.drop-zone { display: grid; place-items: center; gap: 4px; margin-top: 14px; padding: 17px 10px; border: 1px dashed #9fb3c8; border-radius: 10px; color: var(--muted); background: #f8fbfd; transition: .18s ease; outline: none; }
.drop-zone.dragging, .drop-zone:focus-visible { border-color: var(--blue); color: var(--blue); background: #eaf6fb; transform: translateY(-1px); }
.drop-zone .drop-icon { font-size: 22px; line-height: 1; }
.drop-zone b { font-size: 13px; color: var(--ink); }
.drop-zone small { font-size: 11px; }
.file-list { min-height: 0; margin-top: 12px; overflow: auto; }
.file-row { display: grid; grid-template-columns: minmax(0,1fr) 38px; align-items: center; margin-bottom: 7px; border: 1px solid transparent; border-radius: 9px; background: #f5f8fb; overflow: hidden; transition: .15s ease; }
.file-row:hover { border-color: #b9cad9; }
.file-row.active { border-color: #79b8d8; background: #eaf5fa; box-shadow: inset 3px 0 var(--blue); }
.file-main { min-width: 0; padding: 11px 8px 10px 13px; cursor: pointer; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; font-size: 13px; }
.file-meta { display: block; margin-top: 3px; color: var(--muted); font: 11px/1.2 Consolas, monospace; }
.file-remove { align-self: stretch; color: #9b3a3a; background: transparent; font-size: 18px; }
.file-remove:hover { color: #fff; background: #c54545; }
.privacy-note { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 11px; }
.privacy-note span { margin-right: 5px; color: var(--green); }
.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(500px, 1fr) auto; gap: 14px; }
.chart-panel { display: flex; flex-direction: column; min-height: 0; padding: 17px 18px 12px; }
.chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.eyebrow { color: var(--blue); font: 800 10px/1 Consolas, monospace; letter-spacing: .16em; }
.chart-heading h2 { max-width: 650px; margin: 5px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.chart-actions { display: flex; gap: 7px; }
.icon-button, .quiet-button, .tool-rail button { min-height: 34px; padding: 0 12px; border: 1px solid #cbd7e2; border-radius: 7px; color: var(--ink); background: #f4f7fa; font-weight: 700; }
.icon-button { width: 36px; padding: 0; font-size: 20px; }
button:hover { filter: brightness(.97); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible, .import-button:focus-visible { outline: 3px solid rgba(91,192,210,.45); outline-offset: 2px; }
.canvas-wrap { position: relative; flex: 1; min-height: 340px; margin-top: 12px; border: 1px solid #cbd7e2; border-radius: 8px; background: #fbfdff; overflow: hidden; }
#chart { width: 100%; height: 100%; display: block; cursor: crosshair; }
.empty-chart { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; color: #829ab1; pointer-events: none; }
.empty-chart span { font-size: 54px; color: #b8d4e1; }
.empty-chart p { margin: 4px 0; }
.tool-rail { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px; border-radius: 9px; background: #edf5f8; border: 1px solid #cedfe8; }
.selection-readout { display: flex; align-items: center; gap: 8px; min-width: 190px; margin-right: 3px; }
.selection-readout .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 0 4px rgba(184,50,196,.12); }
.selection-readout small { display: block; color: var(--muted); font-size: 10px; }
.selection-readout strong { display: block; margin-top: 2px; font: 700 11px/1.2 Consolas, monospace; }
.tool-rail button.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.tool-rail button.save-button { margin-left: auto; color: #fff; border-color: var(--green); background: var(--green); }
.rail-divider { width: 1px; align-self: stretch; margin: 0 2px; background: #c7d7df; }
.chart-tip { margin: 8px 3px 0; color: var(--muted); font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-card { position: relative; min-height: 92px; padding: 14px 16px; border: 1px solid #d5e0e8; border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(16,42,67,.05); overflow: hidden; }
.metric-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #b5c8d7; }
.metric-card.accent::before { background: var(--orange); }
.metric-card span { display: block; color: var(--muted); font-size: 11px; }
.metric-card strong { display: inline-block; margin-top: 7px; font: 800 23px/1 Consolas, monospace; }
.metric-card small { margin-left: 5px; color: #829ab1; font-size: 10px; }
.analysis { min-height: 0; padding: 16px; overflow: auto; }
.analysis-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.analysis-heading h2 { margin: 5px 0 0; font-size: 17px; }
.result-badge { padding: 6px 9px; border-radius: 20px; font-size: 11px; font-weight: 800; }
.result-badge.neutral { color: #627d98; background: #edf2f6; }
.result-badge.pass { color: #08735d; background: #dff5ee; }
.result-badge.fail { color: #a33232; background: #fde8e8; }
.result-badge.review { color: #9a5700; background: #fff0d4; }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.input-grid label span { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: 10px; }
.input-grid input { width: 100%; height: 34px; padding: 0 9px; border: 1px solid #cbd7e2; border-radius: 7px; color: var(--ink); background: #fbfdff; outline: none; }
.input-grid input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19,121,184,.12); }
.calculate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.calculate-row button { height: 36px; border: 1px solid #cbd7e2; border-radius: 7px; color: var(--ink); background: #f4f7fa; font-weight: 800; }
.calculate-row button.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.metric-results { margin-top: 14px; border-top: 1px solid var(--line); }
.result-empty { padding: 28px 8px; text-align: center; color: #829ab1; font-size: 11px; }
.result-empty.compact { padding: 14px 8px; }
.result-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 7px; min-height: 32px; border-bottom: 1px solid #e7edf2; font-size: 11px; }
.result-row span:first-child { color: var(--muted); }
.result-row strong { font: 700 11px Consolas, monospace; }
.check-mark { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-size: 10px; font-weight: 900; }
.check-mark.pass { color: #08735d; background: #dff5ee; }
.check-mark.fail { color: #a33232; background: #fde8e8; }
.candidates-heading { margin-top: 16px; }
.candidates-heading span { display: block; font-size: 12px; font-weight: 800; }
.candidates-heading small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.candidate-list { margin-top: 7px; }
.candidate-button { display: grid; grid-template-columns: 22px 1fr; width: 100%; margin-bottom: 5px; padding: 7px; border: 1px solid #d6e0e8; border-radius: 7px; text-align: left; color: var(--ink); background: #f7fafc; }
.candidate-button.active { border-color: var(--green); background: #e9f7f2; }
.candidate-button b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: var(--green); font-size: 10px; }
.candidate-button span { font: 10px/1.4 Consolas, monospace; }
.warning-list { margin-top: 10px; color: #8b4b00; font-size: 10px; line-height: 1.5; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; max-width: min(680px, 85vw); padding: 11px 16px; border-radius: 8px; color: #fff; background: #102a43; box-shadow: 0 12px 35px rgba(16,42,67,.3); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-height: 760px) { .topbar { height: 64px; } .shell { height: calc(100vh - 64px); } .summary-grid { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
