/* ReviewLab 工作台样式 · 与 assets/pages.css 共用同一套设计变量 */
:root {
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff4ff;
  --ink: #151b26;
  --text: #3d4655;
  --muted: #6b7585;
  --faint: #8b95a4;
  --line: #e6eaf1;
  --line-soft: #f0f2f7;
  --surface: #ffffff;
  --bg: #f6f8fb;
  --soft: #eef1f6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 28, 45, .04), 0 8px 28px rgba(18, 28, 45, .045);
  --shadow-pop: 0 12px 36px rgba(18, 28, 45, .14);
  --focus: 0 0 0 3px rgba(37, 99, 235, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #d9e6ff; color: var(--ink); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
button, summary, a, label { -webkit-tap-highlight-color: transparent; }

/* ---------- 通用控件 ---------- */
.btn, .ghost, .primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 15px;
  border: 1px solid transparent; border-radius: 9px;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn-ghost, .ghost {
  border-color: var(--line); background: var(--surface); color: var(--text);
}
.btn-ghost:hover, .ghost:hover {
  border-color: #c9d7f2; background: #fbfcff; color: var(--ink);
}
.btn-primary, .primary {
  border-color: var(--brand); background: var(--brand); color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .18);
}
.btn-primary:hover, .primary:hover:not(:disabled) {
  border-color: var(--brand-strong); background: var(--brand-strong);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .24);
}
.btn-sm, .ghost.sm { min-height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled, .ghost:disabled, .primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary:disabled:hover { background: var(--brand); border-color: var(--brand); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--faint);
  font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: var(--soft); color: var(--ink); }

input[type="text"], input[type="number"] {
  height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input[type="text"]::placeholder { color: #aab3c0; }
input[type="text"]:focus, input[type="number"]:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--focus);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: 1280px; height: 68px; margin: 0 auto; padding: 0 32px;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.logo {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .4px;
  box-shadow: 0 3px 8px rgba(37, 99, 235, .25);
}
.brand .sub {
  padding-left: 12px; border-left: 1px solid var(--line);
  font-size: 13px; font-weight: 400; color: var(--muted);
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.save-state {
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: 4px; font-size: 12px; color: var(--faint);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.save-state:empty { display: none; }
.save-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #a8b1bf; }
.save-state.ok { color: #15803d; }
.save-state.ok::before { background: #16a34a; }
.save-state.error { color: #b91c1c; }
.save-state.error::before { background: #dc2626; }
.file-btn { cursor: pointer; }

/* 下拉菜单（方案 / 导出） */
.menu { position: relative; }
.menu > summary {
  display: inline-flex; align-items: center; gap: 7px;
  list-style: none; cursor: pointer; user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-chevron {
  width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .65;
  transition: transform .16s ease;
}
.menu[open] > summary .menu-chevron { transform: rotate(-135deg) translateY(-2px); }
.menu-body {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40;
  display: flex; flex-direction: column; min-width: 210px; padding: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop);
  animation: pop .14s ease-out;
}
.menu-body button, .menu-body .menu-item {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 2px; width: 100%; min-height: 38px; padding: 8px 11px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  text-align: left; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.menu-body button:hover, .menu-body .menu-item:hover { background: var(--brand-soft); color: var(--brand); }
.menu-body span { display: block; font-size: 11px; font-weight: 400; color: var(--faint); }
.menu-body button:hover span, .menu-body .menu-item:hover span { color: #5c7fd8; }
.export-menu-body { min-width: 230px; }
.menu-divider { height: 1px; margin: 5px 4px; background: var(--line-soft); }

/* ---------- 页面骨架 ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 0 32px 80px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 38px 2px 26px;
}
.eyebrow { margin: 0 0 7px; font-size: 12px; font-weight: 600; letter-spacing: 1.2px; color: var(--brand); }
.page-head h1 { margin: 0; font-size: 27px; line-height: 1.3; font-weight: 700; letter-spacing: -.6px; }
.page-lead { margin: 8px 0 0; max-width: 620px; font-size: 13px; color: var(--muted); }
.steps { display: flex; align-items: center; gap: 8px; margin: 0 0 3px; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.steps li + li::before { content: '→'; margin-right: 1px; color: #c3cad5; }
.steps li span {
  display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 6px; background: var(--brand-soft); color: var(--brand);
  font-size: 11px; font-weight: 700;
}

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 22px; align-items: start; }
.col-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel {
  min-width: 0; padding: 24px 26px 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel.right { position: sticky; top: 90px; }

.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  margin-bottom: 18px;
}
.panel-head > div { display: flex; align-items: center; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.step-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 25px; height: 25px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.panel-sub { margin: 4px 0 0; font-size: 12px; color: var(--faint); text-align: right; }
.hint { margin: 0 0 4px; font-size: 12px; color: var(--muted); }

/* ---------- 模板卡片 ---------- */
.templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tpl-card {
  position: relative;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: border-color .16s, background .16s, box-shadow .16s, transform .16s;
}
.tpl-card:hover { border-color: #c9d7f2; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(18, 28, 45, .06); }
.tpl-card.active { border-color: var(--brand); background: #f7faff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .10); }
.tpl-card.active::after {
  content: '✓'; position: absolute; top: 10px; right: 11px;
  display: grid; place-items: center; width: 17px; height: 17px;
  border-radius: 50%; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
}
.tpl {
  display: block; width: 100%; padding: 14px 14px 26px;
  border: 0; background: transparent; text-align: left; cursor: pointer;
  font-family: inherit; color: inherit;
}
.tpl .n { font-size: 14px; font-weight: 650; letter-spacing: -.1px; }
.tpl .d { margin-top: 3px; font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-card.active .tpl .n { color: var(--brand-strong); }
.tpl-more {
  position: absolute; left: 14px; bottom: 8px;
  font-size: 11px; color: var(--faint); text-decoration: none;
}
.tpl-more:hover { color: var(--brand); }

/* ---------- 产品与输入 ---------- */
.prod-bar { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.prod-tabs { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; min-width: 0; }
.prod-tab {
  max-width: 150px; min-height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 12px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color .16s, background .16s, color .16s;
}
.prod-tab:hover { border-color: #c9d7f2; color: var(--ink); }
.prod-tab.active {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 650;
}
.prod-actions { display: flex; gap: 7px; }

.field { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.field label { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.field input { flex: 1; min-width: 0; }

.score-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0 10px; border-top: 1px solid var(--line-soft);
}
.score-toolbar .hint { margin: 0; }
.score-toolbar .btn { flex: none; }

/* ---------- 维度打分 ---------- */
.dim { padding: 16px 0 17px; border-top: 1px solid var(--line-soft); }
.dim:first-child { border-top: 0; padding-top: 6px; }
.dim-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.dim-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dim-head .name { font-size: 14px; font-weight: 650; }
.dim-head .wt { flex: none; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: #fff3e3; color: #a85d12; font-size: 10px; font-weight: 600; white-space: nowrap;
}
.ctl { display: grid; grid-template-columns: 44px minmax(0, 1fr) 62px; align-items: center; gap: 12px; }
.ctl label { font-size: 12px; color: var(--muted); }
.ctl + .ctl { margin-top: 9px; }
.num-input {
  width: 100%; height: 34px; padding: 0 8px;
  text-align: right; font-size: 13px; font-weight: 650;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.num-input::-webkit-outer-spin-button, .num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ctl-weight label, .ctl-weight .num-input { color: var(--faint); font-weight: 500; }

input[type="range"] {
  width: 100%; height: 20px; margin: 0; padding: 0;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px; background: var(--soft);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; margin-top: -5.5px;
  border: 3px solid var(--surface); border-radius: 50%;
  background: var(--brand); box-shadow: 0 1px 4px rgba(18, 28, 45, .28);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--soft); }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border: 3px solid var(--surface); border-radius: 50%;
  background: var(--brand); box-shadow: 0 1px 4px rgba(18, 28, 45, .28);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(37, 99, 235, .25); }
.ctl-weight input[type="range"]::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -3.5px; background: #9aa6b8; }
.ctl-weight input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; background: #9aa6b8; }
.ctl-weight input[type="range"]::-webkit-slider-runnable-track { height: 4px; }

.anchor-hint {
  margin: 9px 0 0 56px; padding: 7px 11px;
  border-radius: 8px; background: #f7f9fd; border: 1px solid var(--line-soft);
  font-size: 12px; line-height: 1.65; color: var(--muted);
}
.anchor-hint b { margin-right: 7px; color: var(--brand); font-weight: 650; }

/* 评分细则 */
.rubric { margin-top: 11px; }
.rubric > summary {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 0; list-style: none; user-select: none;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.rubric > summary::-webkit-details-marker { display: none; }
.rubric > summary::before {
  content: '›'; display: inline-block; color: var(--faint);
  font-size: 14px; transition: transform .16s ease;
}
.rubric[open] > summary::before { transform: rotate(90deg); }
.rubric > summary:hover { color: var(--brand); }
.rubric-body {
  margin-top: 9px; padding: 12px 14px;
  background: #fafbfd; border: 1px solid var(--line-soft); border-radius: 10px;
}
.anchor { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 4px 0; font-size: 12px; color: var(--text); }
.anchor .lv {
  display: grid; place-items: center; min-width: 26px; height: 21px; padding: 0 4px;
  border-radius: 6px; background: var(--soft); color: var(--text);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.anchor p { margin: 0; }
.measure {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px;
  margin: 9px 0 0; padding-top: 9px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.measure b {
  display: grid; place-items: center; height: 20px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 650;
}

/* ---------- 可折叠区块 ---------- */
.advanced { margin-top: 20px; border-top: 1px solid var(--line); }
.advanced > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 2px 0; list-style: none; cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 650;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary span { font-size: 11px; font-weight: 400; color: var(--faint); }
.advanced > summary::after {
  content: '›'; margin-left: auto; color: var(--faint); font-size: 17px;
  transition: transform .16s ease;
}
.advanced[open] > summary::after { transform: rotate(90deg); }
.advanced > summary:hover { color: var(--brand); }
.advanced-body { padding-top: 14px; }
.wstack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--soft); }
.wstack i { display: block; height: 100%; }
.wlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 11px; font-size: 11px; color: var(--muted); }
.wlegend span { display: inline-flex; align-items: center; gap: 5px; }
.wlegend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.wlegend .warn { color: #b45309; }

/* ---------- 结果区 ---------- */
.result-head { margin-bottom: 12px; }
.result-head .btn { flex: none; }
.score-block {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px;
  padding: 4px 0 18px; border-bottom: 1px solid var(--line-soft);
}
.score-main { display: flex; align-items: baseline; gap: 5px; }
.score {
  font-size: 52px; font-weight: 750; line-height: 1; letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.score-unit { font-size: 14px; color: var(--faint); }
.grade {
  padding: 4px 11px; border: 1px solid #d9e5ff; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 600;
}
.grade.warn { border-color: #f3e0c4; background: #fffbf3; color: #8a5a1c; }
.formula { flex-basis: 100%; font-size: 11px; color: var(--faint); }

.chart-title {
  margin: 20px 0 10px; font-size: 13px; font-weight: 650;
}
.chart-title span { margin-left: 7px; font-size: 11px; font-weight: 400; color: var(--faint); }
.chart-title:empty { display: none; }
.chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.chart-head .chart-title { margin-bottom: 0; }
.view-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 9px; }
.view-tabs button {
  min-height: 28px; padding: 0 11px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 11px; cursor: pointer;
}
.view-tabs button.active {
  background: var(--surface); color: var(--ink); font-weight: 650;
  box-shadow: 0 1px 3px rgba(18, 28, 45, .10);
}
.view-tabs button:disabled { opacity: .38; cursor: not-allowed; }
.chart-wrap { padding: 10px 0 0; }
#radar { display: block; width: 100%; height: auto; }
.scale { font-size: 10px; fill: #a8b1bf; font-variant-numeric: tabular-nums; }
.axis-label { font-size: 12px; fill: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 12px; color: var(--text); }
.legend .dot, .rl-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

/* 排名条 */
.rank-row {
  display: grid; grid-template-columns: 18px minmax(64px, 1fr) 2fr 50px;
  align-items: center; gap: 10px; padding: 6px 0;
  font-size: 12px; color: var(--text);
}
.rank-row .rk { color: var(--faint); font-variant-numeric: tabular-nums; }
.rank-row.top .rk { color: var(--brand); font-weight: 700; }
.rank-row .rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rb { position: relative; height: 9px; border-radius: 5px; background: var(--soft); }
.rank-row .rb i { display: block; height: 100%; border-radius: 5px; background: #a8c1f2; }
.rank-row.top .rb i { background: var(--brand); }
.rank-row .rb .ci {
  position: absolute; top: 3.5px; height: 2px; border-radius: 1px;
  background: rgba(21, 27, 38, .5); pointer-events: none;
}
.rank-row .rb .ci::before, .rank-row .rb .ci::after {
  content: ''; position: absolute; top: -2px; width: 1px; height: 6px;
  background: rgba(21, 27, 38, .5);
}
.rank-row .rb .ci::before { left: 0; }
.rank-row .rb .ci::after { right: 0; }
.rank-row .rv { text-align: right; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

.robust-note {
  margin-top: 14px; padding: 11px 13px;
  border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 9px;
  background: #fafbfd; color: var(--muted); font-size: 11px; line-height: 1.85;
}
.robust-note b { font-weight: 650; color: var(--text); }
.robust-note.warn { border-color: #f3e0c4; border-left-color: #d99a3c; background: #fffbf3; color: #8a5a1c; }
.robust-note.warn b { color: #8a5a1c; }

/* 分项条形 / 热力图 */
.dim-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dim-chip {
  padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: 11px; cursor: pointer;
}
.dim-chip:hover { border-color: #c9d7f2; }
.dim-chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 650; }
.bar-row {
  display: grid; grid-template-columns: minmax(64px, 1fr) 2fr 42px;
  align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; color: var(--text);
}
.bar-row .bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bb { height: 9px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.bar-row .bb i { display: block; height: 100%; border-radius: 5px; }
.bar-row .bv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }

.heat { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.heat th { font-weight: 400; color: var(--muted); text-align: left; padding: 5px 6px; white-space: nowrap; }
.heat thead th { text-align: center; }
.heat tbody th { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.heat td { padding: 6px 3px; border-radius: 5px; text-align: center; font-variant-numeric: tabular-nums; }
.heat td.total { background: var(--brand-soft) !important; color: var(--brand-strong); font-weight: 650; }

/* 贡献条 */
.crow + .crow { margin-top: 10px; }
.crow-top { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12px; color: var(--text); }
.crow-top .num { font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }

/* 熵值法诊断 */
.rubric.diag { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.diag-body { font-size: 11px; }
.diag-lead { margin: 0 0 10px; line-height: 1.8; color: var(--muted); }
.diag-table-wrap { overflow-x: auto; }
.diag-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.diag-table th, .diag-table td { padding: 6px 4px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.diag-table thead th { font-weight: 400; color: var(--faint); }
.diag-table thead th:first-child, .diag-table tbody th { text-align: left; }
.diag-table tbody th { font-weight: 500; color: var(--text); }
.diag-table tbody tr:last-child th, .diag-table tbody tr:last-child td { border-bottom: 0; }
.diag-table .dv { display: inline-block; width: 42px; height: 4px; margin-right: 6px; border-radius: 2px; background: var(--soft); overflow: hidden; vertical-align: middle; }
.diag-table .dv i { display: block; height: 100%; border-radius: 2px; background: var(--brand); }
.diag-table .dv.obj i { background: #8b95a4; }
.diag-table .dnum { color: var(--text); font-variant-numeric: tabular-nums; }
.diag-table td.diff { color: var(--faint); font-variant-numeric: tabular-nums; }
.diag-table td.diff.big { color: #b45309; font-weight: 650; }
.diag-note { margin: 10px 0 0; line-height: 1.8; color: var(--muted); }
.diag-note b { color: var(--text); }
.diag-note.warn { color: #8a5a1c; }
.diag-note.warn b { color: #8a5a1c; }
.diag-foot { margin: 7px 0 0; line-height: 1.7; color: var(--faint); }
.diag-empty { margin: 0; line-height: 1.8; color: var(--muted); }

.foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 11px; line-height: 1.85; color: var(--faint); }
.result-cta { margin-top: 20px; }

/* ---------- 提示 / 弹窗 / 移动端操作条 ---------- */
.toast {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 11px;
  background: var(--surface); color: var(--text);
  font-size: 13px; line-height: 1.6; box-shadow: var(--shadow-pop);
  animation: toast-in .2s ease-out;
}
.toast.error { border-left-color: #dc2626; color: #991b1b; }
.notice {
  margin: 24px auto 0; max-width: 720px; padding: 16px 18px;
  border: 1px solid #f3d9b1; border-radius: 11px;
  background: #fffbf3; color: #7a4b12; font-size: 13px; line-height: 1.8;
}
.notice code {
  padding: 1px 6px; border-radius: 4px; background: #fff; border: 1px solid #f0e2c8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
}
.mobile-bar { display: none; }
.mb-label { display: block; font-size: 11px; color: var(--faint); }
.mb-score { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }

.confirm {
  width: min(390px, calc(100vw - 32px)); padding: 0;
  border: 0; border-radius: 16px; background: var(--surface); color: var(--ink);
  font: inherit; box-shadow: 0 24px 64px rgba(16, 24, 40, .24);
}
.confirm::backdrop { background: rgba(17, 24, 39, .42); }
.confirm-inner { padding: 24px 24px 20px; }
.confirm-inner h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.confirm-inner p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.confirm-actions .btn { min-width: 82px; }

/* ---------- AHP 权重向导 ---------- */
.ahp {
  width: min(720px, calc(100vw - 32px));
  max-height: min(86vh, 880px); margin: auto; padding: 0;
  border: 0; border-radius: 16px;
  background: var(--surface); color: var(--ink); font: inherit;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .24);
}
.ahp::backdrop { background: rgba(17, 24, 39, .42); }
.ahp-inner { display: flex; flex-direction: column; max-height: inherit; }
.ahp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 24px 15px; border-bottom: 1px solid var(--line-soft);
}
.ahp-head h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.ahp-head .hint { margin: 0; }
.ahp-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 24px 20px; }
.ahp-note { margin: 0 0 14px; font-size: 12px; line-height: 1.85; color: var(--muted); }
.ahp-empty { margin: 0; padding: 16px 0; font-size: 12px; color: var(--muted); }
.ahp-pair { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.ahp-pair:first-child { padding-top: 0; border-top: 0; }
.ahp-pair-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 10px; margin-bottom: 6px; font-size: 12px; }
.ahp-pair-head .pair-name { color: var(--text); }
.ahp-pair-head .pair-verdict { color: var(--brand); font-weight: 650; }
.ahp-pair-head .ahp-ratio { margin-left: 8px; color: var(--faint); font-weight: 400; font-variant-numeric: tabular-nums; }
.ahp-scale { display: flex; justify-content: space-between; margin-top: 1px; font-size: 10px; color: var(--faint); }
.ahp-preview { flex: none; padding: 14px 24px 16px; border-top: 1px solid var(--line-soft); }
.ahp-preview .chart-title { margin: 0 0 9px; }
.ahp-cr { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 0; font-size: 12px; line-height: 1.75; color: var(--muted); }
.ahp-badge { flex: none; margin-top: 1px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-variant-numeric: tabular-nums; }
.ahp-badge.ok { border: 1px solid #bbf7d0; background: #ecfdf3; color: #15803d; }
.ahp-badge.bad { border: 1px solid #fed7aa; background: #fff7ed; color: #b45309; }
.ahp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 24px; border-top: 1px solid var(--line-soft); background: #fafbfd;
  border-radius: 0 0 16px 16px;
}
.ahp-actions { display: flex; gap: 9px; }

/* ---------- 导出卡片（屏幕外渲染，导出前不可见） ---------- */
.rl-card {
  position: fixed; left: -20000px; top: 0;
  box-sizing: border-box; width: 1080px; padding: 60px 64px;
  display: flex; flex-direction: column;
  background: #fff; color: #1b1f24;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.rl-card.square { height: 1080px; }
.rl-card.rl-preview { position: static; margin: 24px auto; height: auto; box-shadow: 0 8px 30px rgba(16, 24, 40, .08); }
.rl-brand { display: flex; align-items: baseline; gap: 10px; color: #2563eb; }
.rl-brand b { font-size: 23px; letter-spacing: -.3px; }
.rl-brand span { font-size: 15px; color: #8a93a0; }
.rl-brand .rl-date { margin-left: auto; font-size: 14px; color: #a0a8b4; }
.rl-eyebrow { margin-top: 30px; font-size: 15px; color: #8a93a0; letter-spacing: .4px; }
.rl-title { margin: 8px 0 0; font-size: 44px; line-height: 1.22; font-weight: 700; letter-spacing: -.5px; }
.rl-hero { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 24px; padding-bottom: 20px; border-bottom: 1px solid #eef1f6; }
.rl-hero-label { font-size: 14px; color: #8a93a0; }
.rl-hero-name { margin-top: 6px; font-size: 30px; font-weight: 600; }
.rl-hero-score { font-size: 62px; line-height: 1; font-weight: 700; color: #2563eb; font-variant-numeric: tabular-nums; }
.rl-hero-score span { margin-left: 6px; font-size: 19px; font-weight: 400; color: #a0a8b4; }
.rl-rank { margin-top: 18px; }
.rl-rank .rank-row { grid-template-columns: 20px minmax(130px, 1.2fr) 2.6fr 66px; padding: 5px 0; font-size: 16px; }
.rl-rank .rank-row .rv { font-size: 16px; }
.rl-rank .rank-row .rb { height: 10px; }
.rl-chart { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.rl-chart-cap { font-size: 14px; color: #8a93a0; }
.rl-chart svg { width: 500px; height: 355px; }
.rl-card.long .rl-chart { flex: none; margin-top: 4px; }
.rl-card.long .rl-chart svg { width: 600px; height: 426px; }
.rl-legend { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 2px; font-size: 14px; color: #4b5563; }
.rl-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #eef1f6; font-size: 13px; line-height: 1.7; color: #a0a8b4; }
.rl-section-title { margin: 34px 0 10px; font-size: 16px; font-weight: 600; color: #4b5563; }
.rl-robust { margin-top: 14px; padding: 16px 18px; border: 1px solid #eef1f6; border-radius: 12px; background: #fafbfc; color: #6b7280; font-size: 14px; line-height: 1.9; }
.rl-robust b { font-weight: 600; color: #4b5563; }
.rl-robust.warn { border-color: #f3e0c4; background: #fffbf3; color: #8a5a1c; }
.rl-robust.warn b { color: #8a5a1c; }
.rl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rl-table th, .rl-table td { padding: 10px 8px; border-bottom: 1px solid #f1f3f7; text-align: right; font-variant-numeric: tabular-nums; }
.rl-table th:first-child, .rl-table td:first-child { text-align: left; }
.rl-table thead th { font-size: 13px; font-weight: 500; color: #8a93a0; }
.rl-table tr.total th, .rl-table tr.total td { font-weight: 600; color: #1b1f24; background: #f8fafd; }
.rl-method { margin-top: 26px; font-size: 13px; line-height: 1.9; color: #a0a8b4; }

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; }
  .page, .topbar-inner { padding-left: 24px; padding-right: 24px; }
  .panel { padding: 22px 22px 24px; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 18px; }
  .panel.right { position: static; }
  .page { padding-bottom: 96px; }
  .page-head { padding-top: 28px; }
  .steps { display: none; }
  .brand .sub { display: none; }
  .save-state { display: none; }
  .topbar-inner, .page { padding-left: 18px; padding-right: 18px; }
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 18px rgba(18, 28, 45, .05);
  }
  .toast { right: 16px; bottom: 84px; }

  /* 触屏上放大滑块与切换按钮的点击区域 */
  input[type="range"] { height: 28px; }
  input[type="range"]::-webkit-slider-runnable-track { height: 7px; }
  input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -7.5px; }
  input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; }
  .ctl-weight input[type="range"]::-webkit-slider-thumb { width: 17px; height: 17px; margin-top: -5px; }
  .view-tabs button { min-height: 32px; }
}
@media (max-width: 560px) {
  .page-head h1 { font-size: 22px; }
  .page-head { padding: 22px 2px 20px; }
  .page-lead { font-size: 12px; }
  .topbar-inner { height: 60px; }
  .top-actions { gap: 7px; }
  .top-actions .btn { padding: 0 11px; }
  .panel { padding: 18px 16px 20px; }
  .templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-sub { display: none; }
  .field { flex-wrap: wrap; gap: 7px; }
  .field label { flex-basis: 100%; }
  .ctl { grid-template-columns: 38px minmax(0, 1fr) 56px; gap: 8px; }
  .anchor-hint { margin-left: 0; }
  .score { font-size: 44px; }
  .formula { display: none; }
  .ahp-head, .ahp-body, .ahp-preview, .ahp-foot { padding-left: 16px; padding-right: 16px; }
  .menu-body { right: -8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
