
:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  color-scheme: light;
  --bg: #ffffff; --panel: #ffffff; --panel2: #fafbfc;
  --line: #e6e8ec; --line2: #d9dde4; --text: #171a21;
  --sub: #69707d; --faint: #8a919e; --acc: #635bff; --acc-dk: #4f46e5;
  --ok: #138a5b; --warn: #9a6700; --no: #98a0ad; --bad: #c93636;
  --hover: #f7f7ff; --pop: #ffffff; --shadow: rgba(18, 24, 40, .07);
  --shadow-lg: rgba(18, 24, 40, .14); --hero: #f6f5ff; --on-acc: #ffffff;
  --weight: #7257d5; --kv: #f97316; --runtime: #64748b;
  --active: #0891b2; --adapter: #d97706; --reserve: #b6bec9;
  --brand-soft: #f0efff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px;
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 680; white-space: nowrap;
  border: 1px solid var(--line2); border-radius: 11px; background: #fff;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.site-nav a:hover { border-color: #c9c5ff; background: #fbfaff; }
.site-nav a.is-current, .site-nav a[aria-current="page"] {
  color: var(--acc-dk); border-color: #c9c5ff; background: var(--brand-soft); font-weight: 720;
}
.boot-status {
  margin: 12px auto 0; max-width: 1440px; padding: 12px 18px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel2); color: var(--sub);
}
.boot-status.is-error { color: var(--bad); border-color: var(--bad); }
.empty { text-align: center; color: var(--faint); padding: 28px 12px; }
.date { color: var(--faint); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 390px) {
  .top { height: auto; min-height: 56px; padding: 8px 10px; gap: 8px; flex-wrap: wrap; }
  .site-nav { width: 100%; justify-content: flex-start; }
  .tabs { top: auto; height: auto; }
  .hero { grid-template-columns: 1fr; }
  .stat .v { font-size: 22px; }
}

/* 推理测算 — 与商城统一的白色界面，不提供深色分支。 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 14px; }

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--acc); color: var(--on-acc); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line2); border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- 顶栏 ---------- */

.top {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: max(20px, calc((100vw - 1320px) / 2 + 20px));
  min-height: 68px; background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(217, 221, 228, .9); backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; min-width: max-content; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; font-weight: 850; letter-spacing: -.06em;
  background: linear-gradient(145deg, #756dff 0%, #5148ed 58%, #08a7a7 140%);
  box-shadow: 0 8px 18px rgba(99, 91, 255, .22);
}
.brand-t h1 { font-size: 15px; line-height: 1.2; font-weight: 760; letter-spacing: -.02em; }
.brand-t span {
  display: block; font-size: 9px; letter-spacing: .12em;
  color: var(--faint); margin-top: 2px;
}
.meta { font-size: 11px; color: var(--sub); letter-spacing: .02em; }
.topmeta { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  min-height: 36px; border: 1px solid var(--line2); background: var(--panel); color: var(--sub);
  border-radius: 8px; padding: 7px 12px; font: 600 11px var(--sans); cursor: pointer;
}
.theme-btn:hover, .theme-btn:focus-visible { color: var(--acc); border-color: var(--acc); outline: none; }
.lang-btn { min-width: 46px; }
.meta b { color: var(--acc); font-weight: 700; }

/* ---------- 选项卡 ---------- */

.tabs {
  position: sticky; top: 68px; z-index: 80;
  display: flex; align-items: center; gap: 6px;
  padding-inline: max(20px, calc((100vw - 1320px) / 2 + 20px));
  height: 58px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.tabs button {
  appearance: none; background: transparent; border: 1px solid transparent; cursor: pointer;
  color: var(--sub); font-family: var(--sans); font-size: 13px; font-weight: 600;
  min-height: 38px; padding: 5px 15px; letter-spacing: 0; border-radius: 9px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
}
.tabs button small {
  font-size: 7.5px; letter-spacing: .15em; color: var(--faint);
  font-weight: 500; margin-top: 0;
}
.tabs button:hover { color: var(--text); background: var(--hover); }
.tabs button.on {
  color: var(--acc-dk); background: var(--brand-soft); border-color: #c9c5ff;
}
.tabs button.on small { color: var(--acc); }
.tsep { width: 1px; height: 26px; background: var(--line); margin: 0 6px; }

/* ---------- 布局 ---------- */

main {
  min-height: calc(100vh - 68px - 58px - 52px);
  padding: 30px 24px 48px;
  background: #fff;
}
.view { display: none; }
.view.on {
  display: flex; align-items: flex-start; gap: 28px;
  width: min(1440px, 100%); margin: 0 auto;
}
.view .result {
  flex: 1; min-width: 0; padding: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.view .result.wide { padding: 0; }

aside {
  width: 320px; flex: none; align-self: flex-start;
  position: sticky; top: 146px;
  padding: 22px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 12px 32px var(--shadow);
}

.grp { margin-bottom: 22px; }
.grp:last-child { margin-bottom: 0; }
.lab {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; letter-spacing: .09em; color: var(--faint);
  margin-bottom: 8px; font-weight: 700; text-transform: uppercase;
}
.lab .val { color: var(--acc); font-size: 12px; letter-spacing: 0; }
.lab-meta { display: inline-flex; align-items: baseline; gap: 10px; }
.lab .sym {
  color: var(--sub); font: 500 10px var(--mono); letter-spacing: 0; text-transform: none;
}
.lab .sym sub { font-size: 8px; }
.workload-editor { border-top: 1px solid var(--line); }
.workload-summary {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0; color: var(--faint); font: 9.5px var(--mono);
  border-bottom: 1px solid var(--line);
}
.workload-summary strong { color: var(--ok); font-weight: 600; }
.workload-summary strong.invalid { color: var(--bad); }
.workload-row { padding: 11px 0; border-bottom: 1px solid var(--line); }
.workload-row-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; color: var(--sub); font: 600 9.5px var(--mono);
}
.workload-remove {
  padding: 0; border: 0; background: transparent; color: var(--faint);
  font: 10px var(--mono); cursor: pointer;
}
.workload-remove:hover { color: var(--bad); }
.workload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.workload-field { color: var(--faint); font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; }
.workload-field input {
  min-height: 34px; margin-top: 4px; padding: 6px 8px;
  border-radius: 6px; font: 11px var(--mono);
}
.workload-actions { display: flex; gap: 8px; padding-top: 9px; }
.workload-actions button {
  flex: 1; padding: 6px 7px; border: 1px solid var(--line2); border-radius: 6px;
  background: var(--panel); color: var(--sub); font: 9px var(--mono); cursor: pointer;
}
.workload-actions button:hover { color: var(--acc); border-color: var(--acc); }
.workload-note { margin-top: 8px; color: var(--faint); font-size: 9.5px; line-height: 1.45; }
.workload-table { min-width: 920px; }
.workload-table .share-shift { color: var(--acc); }

select, input[type=number], input[type=text] {
  width: 100%; min-height: 42px; appearance: none;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line2); border-radius: 9px;
  font-family: var(--sans); font-size: 13px;
  padding: 9px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 30px; cursor: pointer;
}
select:focus, input:focus {
  border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 13%, transparent);
}
input[type=number] { font-family: var(--mono); }

input[type=range] {
  appearance: none; width: 100%; height: 4px; border-radius: 999px;
  background: var(--line2); outline: none; cursor: pointer; margin: 10px 0 3px;
}
input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px;
  background: var(--acc); border-radius: 50%; border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--acc), 0 2px 5px var(--shadow);
}
input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; background: var(--acc); border-radius: 50%; border: 3px solid var(--panel);
}

.hint { font-size: 11.5px; color: var(--faint); line-height: 1.75; margin-top: 24px; }
.rep { color: var(--warn); font-size: 9px; }

/* 状态小方格 */
.sq { display: inline-block; width: 7px; height: 7px; margin: 0 4px 0 10px; }
.sq:first-child { margin-left: 0; }
.sq.ok { background: var(--ok); }
.sq.warn { background: var(--warn); }
.sq.no { background: var(--no); }

/* ---------- 表格 ---------- */

.tblwrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--panel); box-shadow: 0 12px 32px var(--shadow);
}
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 700; font-size: 10px;
  letter-spacing: .08em; color: var(--faint); text-transform: uppercase;
  padding: 11px 12px; border-bottom: 1px solid var(--line2);
  background: var(--panel2); white-space: nowrap;
}
.tbl td {
  padding: 11px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--hover); }
.tbl td.n, .tbl th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl td.n { white-space: nowrap; }
.tbl .flag {
  display: inline-block; margin-left: 5px; padding: 1px 5px;
  border-radius: 999px; background: var(--panel2);
  color: var(--faint); font-size: 8px; line-height: 1.5; vertical-align: 1px;
}
.matrix { min-width: 1020px; }
.tbl td.dim { color: var(--faint); }
.tbl .mname { font-weight: 650; }
.tbl .mname a { color: inherit; text-decoration: none; }
.tbl .mname a:hover { color: var(--acc); }
.tbl .msub { color: var(--faint); font-size: 10.5px; margin-left: 6px; }

/* 模式一矩阵单元格 */
.cell { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.cell.ok   { color: var(--ok); }
.cell.warn { color: var(--warn); }
.cell.no   { color: var(--no); }
.cell.ok::before, .cell.warn::before, .cell.no::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
}
.cell.ok::before { background: var(--ok); }
.cell.warn::before { background: var(--warn); }
.cell.no::before { background: var(--no); }
.cell.na { color: var(--faint); font-size: 10px; }

.devline {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 0 0 18px; margin-bottom: 20px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; font-size: 12px; color: var(--sub);
}
.devline .dv-name { margin-right: auto; font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.025em; }
.devline .mono { font-size: 11.5px; }
.devline b { color: var(--text); font-weight: 700; }
.field-note { color: var(--faint); font-size: 11px; line-height: 1.5; margin-top: 7px; }
.field-note.locked { color: var(--acc); }

/* ---------- 模式二：仪表盘 ---------- */

.hero {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px; overflow: hidden; margin-bottom: 26px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--line);
}
.stat {
  min-width: 0; padding: 18px;
  border: 0; border-radius: 0; background: var(--panel); box-shadow: none;
}
.stat .k { font-size: 10px; letter-spacing: .08em; color: var(--faint); margin-bottom: 8px; font-weight: 700; text-transform: uppercase; }
.stat .v { font-family: var(--mono); font-size: 29px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.stat .u { font-size: 10.5px; color: var(--sub); margin-top: 7px; }
.stat.hot { background: var(--panel); }
.stat.hot .v { color: var(--acc); }
.stat.bad .v { color: var(--bad); }

.method-flow {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.method-step {
  position: relative; min-width: 0; padding: 13px 16px;
  border-right: 1px solid var(--line);
}
.method-step:last-child { border-right: 0; }
.method-step:not(:last-child)::after {
  content: "→"; position: absolute; right: -8px; top: 14px; z-index: 1;
  width: 15px; color: var(--acc); background: var(--panel); font: 600 11px var(--mono); text-align: center;
}
.method-index { display: block; color: var(--acc); font: 600 9px var(--mono); margin-bottom: 7px; }
.method-label {
  display: block; color: var(--sub); font-size: 9px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.method-value { display: block; margin-top: 5px; color: var(--text); font: 600 12px var(--mono); }
.method-note { display: block; margin-top: 4px; color: var(--faint); font: 9.5px/1.4 var(--mono); }

.seclab {
  font-size: 12px; letter-spacing: .04em; color: var(--text); font-weight: 700;
  margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline;
}
.seclab span { color: var(--faint); font-size: 10.5px; font-weight: 500; }
.vguard {
  position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px;
  background: var(--bad); box-shadow: 0 0 0 1px var(--panel);
}
.vlegend i.guard { width: 2px; height: 11px; background: var(--bad); }
.seclab:not(:first-child) { margin-top: 28px; }

/* 显存条 */
.vbar {
  position: relative; display: flex; height: 34px; border: 1px solid var(--line2); border-radius: 9px;
  overflow: hidden; background: var(--panel2);
}
.vbar > div { height: 100%; }
.vw  { background: var(--weight); }
.vkv { background: var(--kv); }
.vfw { background: var(--runtime); }
.vact { background: var(--active); }
.vadp { background: var(--adapter); }
.vsys { background: var(--reserve); }
.vfree { background: transparent; }
.vlegend { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 11px; font-size: 11px; color: var(--sub); }
.vlegend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }
.vlegend .mono { color: var(--text); }

/* 公式过程 */
.trace { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.trace .trow {
  display: grid; grid-template-columns: 160px 180px 1fr;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.trace .trow:last-child { border-bottom: none; }
.trace .thead { background: var(--panel2); }
.trace .thead span {
  color: var(--faint); font: 700 9px var(--sans); letter-spacing: .08em;
  text-transform: uppercase; text-align: left; padding-right: 16px;
}
.trace .tk { color: var(--sub); font-weight: 600; }
.trace .tv { font-family: var(--mono); text-align: right; padding-right: 24px; }
.trace .tn { color: var(--faint); font-size: 11px; }

/* 仿真曲线 */
#curveBox {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden;
}
.chart { min-width: 0; padding: 18px 18px 12px; background: var(--panel); }
.chart + .chart { border-left: 1px solid var(--line); }
.chart h3 { font-size: 11px; letter-spacing: .06em; color: var(--text); font-weight: 700; margin-bottom: 4px; }
.chart p { font: 9.5px var(--mono); color: var(--faint); margin-bottom: 5px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis { stroke: var(--sub); stroke-width: 1; opacity: .7; }
.gridline { stroke: var(--line2); stroke-width: 1; opacity: .65; stroke-dasharray: 2 3; }
.tick { stroke: var(--sub); stroke-width: 1; opacity: .55; }
.current-guide { stroke: var(--acc); stroke-width: 1; stroke-dasharray: 2 3; opacity: .45; }
.cline { stroke: var(--acc); stroke-width: 1.7; fill: none; }
.cline.secondary { stroke: var(--active); stroke-dasharray: 4 3; }
.cline.limit { stroke: var(--bad); stroke-dasharray: 5 3; }
.cdot { fill: var(--acc); stroke: var(--panel); stroke-width: 1; }
.cdot.secondary { fill: var(--active); }
.cdot.unfit { fill: var(--bad); }
.cdot.current { stroke: var(--text); stroke-width: 1.5; }
.clabel { fill: var(--faint); font-size: 8.5px; font-family: var(--mono); }
.axis-title { fill: var(--sub); font-size: 9px; font-family: var(--mono); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--sub); font-size: 10px; margin: 4px 0 0; }
.chart-legend i { width: 14px; height: 2px; display: inline-block; margin-right: 5px; vertical-align: middle; background: var(--acc); }
.chart-legend i.secondary { background: var(--active); }
.chart-legend i.limit, .chart-legend i.unfit { background: var(--bad); }

/* ---------- 模式三：方案 ---------- */

#planList {
  display: grid; gap: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px;
}
.planrow {
  display: grid;
  grid-template-columns: 42px 1.35fr 1.3fr .85fr .85fr .95fr .7fr 1fr;
  gap: 0 14px; align-items: baseline;
  padding: 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: var(--panel); transition: background .15s;
}
.planrow.rec { grid-template-columns: 42px 1.2fr 1fr .65fr .75fr .95fr .75fr 1.15fr; }
.planrow:last-child { border-bottom: 0; }
.planrow:not(.planhead):hover { background: var(--hover); }
.planrow .rank { font-family: var(--mono); font-size: 20px; color: var(--faint); }
.planrow.top3 .rank { color: var(--acc); }
.planrow .phw { font-weight: 700; font-size: 13.5px; }
.planrow .phw .x { color: var(--acc); font-family: var(--mono); font-size: 12px; margin-left: 6px; }
.planrow .msub { display: block; margin: 3px 0 0; color: var(--faint); font-size: 10.5px; font-weight: 400; font-family: var(--mono); line-height: 1.35; }
.planrow .pstrat { color: var(--sub); font-size: 12px; }
.planrow .pk { font-size: 9px; letter-spacing: .08em; color: var(--faint); display: block; font-weight: 700; }
.planrow .pv { font-family: var(--mono); font-size: 13px; }
.planrow .warn {
  grid-column: 2 / -1; font-size: 11px; color: var(--warn);
  padding-top: 7px;
}
.planhead { padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel2); }
.planhead span { font-size: 10px; letter-spacing: .08em; color: var(--faint); font-weight: 700; text-transform: uppercase; }
.planrow[data-plan-detail], .planrow[data-rec-detail] { cursor: pointer; }
.planrow[data-plan-detail]:focus-visible, .planrow[data-rec-detail]:focus-visible { outline: 2px solid color-mix(in srgb, var(--acc) 55%, transparent); outline-offset: -2px; }

/* ---------- 方案解释弹窗 ---------- */
.plan-modal[hidden] { display: none; }
.plan-modal {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 24px;
}
.plan-modal-backdrop { position: absolute; inset: 0; background: rgba(5, 10, 18, .72); backdrop-filter: blur(5px); }
.plan-modal-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(1120px, 100%); max-height: calc(100vh - 48px);
  overflow: hidden; border: 1px solid var(--line2); border-radius: 12px;
  background: var(--bg); box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}
.plan-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.plan-modal-head h2 { margin: 3px 0 0; font-size: 22px; text-wrap: balance; }
.plan-modal-close {
  flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel2); color: var(--text); font-size: 24px; line-height: 1;
}
.plan-modal-body { overflow: auto; padding: 22px; }
.detail-loading { min-height: 220px; display: grid; place-items: center; color: var(--sub); }
.detail-hero { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.detail-hero > div { min-width: 0; padding: 16px; background: var(--panel); }
.detail-hero .detail-verdict { border-top: 3px solid var(--ok); }
.detail-hero .detail-verdict.warn { border-color: var(--warn); }
.detail-hero .detail-verdict.bad { border-color: var(--bad); }
.detail-label { display: block; margin-bottom: 6px; color: var(--faint); font: 700 9px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.detail-value { display: block; font: 700 18px/1.2 var(--mono); overflow-wrap: anywhere; }
.detail-verdict .detail-value { font-family: var(--sans); }
.detail-sub { margin-top: 6px; color: var(--sub); font-size: 11px; line-height: 1.5; }
.detail-section { margin-top: 24px; }
.detail-section h3 { margin: 0 0 10px; font-size: 15px; }
.detail-section-intro { margin: -4px 0 12px; color: var(--sub); font-size: 12px; line-height: 1.6; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.detail-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.detail-card .detail-value { font-size: 14px; }
.advice-list { display: grid; gap: 9px; }
.advice {
  padding: 13px 15px; border-left: 3px solid var(--acc); border-radius: 0 7px 7px 0;
  background: var(--panel); font-size: 12px; line-height: 1.65;
}
.advice strong { display: block; margin-bottom: 2px; font-size: 13px; }
.advice.good { border-color: var(--ok); }
.advice.warn { border-color: var(--warn); }
.advice.bad { border-color: var(--bad); }
.detail-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.detail-table th, .detail-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail-table th { color: var(--faint); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.detail-table td.n, .detail-table th.n { text-align: right; font-family: var(--mono); white-space: nowrap; }
.detail-table tr:last-child td { border-bottom: 0; }
.detail-table .formula { font-family: var(--mono); color: var(--sub); }
.detail-callout { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; color: var(--sub); font-size: 11px; line-height: 1.65; }
body.modal-open { overflow: hidden; }

.empty { padding: 60px 0; text-align: center; color: var(--faint); font-size: 12.5px; }

/* ---------- 库/筛选 ---------- */

.filterbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px; padding: 0;
  border: 0; border-radius: 0; background: transparent;
}
.filterbar input[type=text] { max-width: 300px; }
.filterbar select { max-width: 180px; }
#pl-filter { flex-wrap: wrap; margin-top: 14px; }
#pl-filter input[type=text] { width: 200px; }
#pl-filter input[type=number] { width: 110px; }
#pl-filter .cs-inline { width: 160px; }
#pl-filter .seg { flex: 0 0 auto; }
#pl-filter .seg button { padding: 8px 11px; font-size: 11px; }

.pager {
  display: flex; gap: 16px; align-items: center; justify-content: center;
  padding: 20px 0 4px; color: var(--sub); font-size: 12px;
}
.pager .minibtn[disabled] { opacity: 0.35; pointer-events: none; }

.tag {
  display: inline-block; font-size: 9.5px; font-family: var(--sans); font-weight: 650;
  border: 1px solid var(--line2); color: var(--sub); background: var(--panel2);
  padding: 2px 7px; margin-right: 4px; border-radius: 999px; white-space: nowrap;
}
.tag.hot { border-color: color-mix(in srgb, var(--acc) 35%, var(--line2)); color: var(--acc); background: color-mix(in srgb, var(--acc) 7%, var(--panel)); }

/* ---------- 页脚 ---------- */

footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-inline: max(24px, calc((100vw - 1440px) / 2 + 24px)); min-height: 52px;
  background: #fff; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--faint);
}

@media (max-width: 1100px) {
  .view.on { display: block; }
  aside { position: static; width: auto; margin-bottom: 20px; padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 自定义下拉 ---------- */

.cs { position: relative; }
.cs-inline { width: 180px; }

.cs-btn {
  width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line2); border-radius: 9px;
  font-family: var(--sans); font-size: 13px;
  padding: 9px 12px; cursor: pointer; text-align: left; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cs-btn:hover { border-color: var(--faint); }
.cs.open .cs-btn, .cs-btn:focus { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 13%, transparent); }
.cs-btn .cs-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-btn .cs-v .cs-m { color: var(--faint); font-family: var(--mono); font-size: 11px; margin-left: 8px; }
.cs-arrow { color: var(--faint); font-size: 9px; margin-left: 10px; transition: transform .12s; }
.cs.open .cs-arrow { transform: rotate(180deg); color: var(--acc); }

.cs-pop {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 60;
  overflow: hidden; background: var(--pop); border: 1px solid var(--line2); border-radius: 12px;
  display: none; box-shadow: 0 14px 38px var(--shadow-lg);
}
.cs.open .cs-pop { display: block; }

.cs-q {
  width: 100%; border: none; border-bottom: 1px solid var(--line);
  background: transparent; padding: 11px 13px; border-radius: 0;
  font-family: var(--sans); font-size: 12px;
  color: var(--text); caret-color: var(--acc); box-shadow: none;
}
.cs-q::placeholder { color: var(--faint); }
.cs-q:focus { outline: none; border-bottom-color: var(--acc); box-shadow: none; }

.cs-list { max-height: 340px; overflow-y: auto; }
.cs-grp {
  font-size: 9px; letter-spacing: .1em; color: var(--faint); font-weight: 700; text-transform: uppercase;
  padding: 11px 13px 5px; position: sticky; top: 0; background: var(--pop);
}
.cs-opt {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 9px 13px; cursor: pointer; border-left: 3px solid transparent;
}
.cs-opt:hover { background: var(--hover); }
.cs-opt.sel { border-left-color: var(--acc); background: color-mix(in srgb, var(--acc) 7%, var(--panel)); }
.cs-opt.sel .cs-n { color: var(--acc); font-weight: 650; }
.cs-opt .cs-n { font-size: 12.5px; }
.cs-opt .cs-m { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-left: 12px; white-space: nowrap; }
.cs-opt.hidden, .cs-grp.hidden { display: none; }
.cs-empty { padding: 14px 12px; color: var(--faint); font-size: 12px; }
.cs.locked .cs-btn { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 45%, var(--line2)); cursor: not-allowed; }
.cs.locked .cs-arrow { display: none; }

/* ---------- 模式三：自定义模型 + 需求细化 ---------- */

.minibtn {
  width: 100%; margin-top: 8px; padding: 8px 11px; cursor: pointer;
  background: var(--panel); color: var(--sub);
  border: 1px solid var(--line2); border-radius: 8px;
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0;
}
.minibtn:hover { color: var(--acc); border-color: var(--acc); background: color-mix(in srgb, var(--acc) 5%, var(--panel)); }

#pl-custom { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 0; background: transparent; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.cgrid label {
  display: block; font-size: 9.5px; letter-spacing: .06em; color: var(--faint); font-weight: 650;
}
.cgrid input { min-height: 36px; margin-top: 5px; padding: 7px 9px; font-size: 12px; }
.cgrid input:disabled { opacity: .35; }

.advanced {
  border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 0 0; background: transparent;
}
.advanced summary {
  cursor: pointer; list-style: none; color: var(--sub); font-size: 10.5px;
  letter-spacing: .08em; font-weight: 700;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "＋"; color: var(--acc); margin-right: 7px; }
.advanced[open] summary::before { content: "－"; }
.advanced summary span { float: right; color: var(--faint); font-size: 9px; letter-spacing: .02em; }
.advanced .advgrid { margin-top: 12px; }
.advanced .hint { margin: 10px 0 0; }

.segrow { display: flex; gap: 10px; margin: 12px 0 4px; }
.seg { display: flex; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; flex: 1; background: var(--panel); }
.seg button {
  flex: 1; padding: 8px 6px; cursor: pointer; border: none;
  background: transparent; color: var(--faint);
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--acc); color: var(--on-acc); font-weight: 700; }

.dim2 { color: var(--faint); font-size: 9.5px; letter-spacing: .05em; text-transform: none; }
.lab.sub { margin: 10px 0 5px; font-size: 9.5px; }

.switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i {
  position: absolute; inset: 0; background: var(--line2); border-radius: 999px;
  transition: background .15s;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px;
  background: var(--panel); border-radius: 50%; transition: transform .15s, background .15s;
  box-shadow: 0 1px 3px var(--shadow-lg);
}
.switch input:checked + i { background: var(--acc); }
.switch input:checked + i::after { transform: translateX(16px); background: var(--on-acc); }

/* ---------- 术语库 ---------- */
.library-head {
  display: flex; align-items: end; justify-content: space-between; gap: 40px;
  padding: 18px 4px 26px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
  background: transparent;
}
.library-head h2 { font-size: 30px; line-height: 1.2; letter-spacing: -.035em; margin: 5px 0 8px; }
.library-head p { color: var(--sub); max-width: 680px; font-size: 13px; }
.library-head input { width: min(380px, 100%); }
.eyebrow { color: var(--acc); font: 700 10px var(--sans); letter-spacing: .12em; }
.glossary-meta { margin: 18px 0; color: var(--faint); font: 11px var(--mono); }
.glossary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.term-card {
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 18px 19px; min-height: 174px; transition: border-color .15s;
}
.term-card:hover { border-color: var(--line2); }
.term-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.term-abbr { color: var(--acc); font: 750 16px var(--sans); }
.term-cat { color: var(--faint); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.term-full { color: var(--sub); font: 10.5px var(--mono); min-height: 32px; margin: 5px 0 9px; }
.term-desc { color: var(--text); font-size: 12px; }
.term-effect { color: var(--faint); font-size: 11px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 9px; }
:root[lang="zh-CN"] .term-effect::before { content: "本系统："; color: var(--sub); font-weight: 600; }
:root[lang="en"] .term-effect::before { content: "Calculator: "; color: var(--sub); font-weight: 600; }

button:focus-visible, input:focus-visible, .cs-btn:focus-visible, .planrow:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--acc) 55%, transparent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .tabs { overflow-x: auto; padding-inline: 14px; }
  .tabs button { flex: none; }
  .glossary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #curveBox { grid-template-columns: 1fr; }
  .chart + .chart { border-left: 0; border-top: 1px solid var(--line); }
  .planrow { min-width: 980px; }
  #planList { overflow-x: auto; padding-bottom: 4px; }
  .detail-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .top { min-height: 64px; padding: 10px 14px; gap: 12px; }
  .brand-t span { display: none; }
  .meta { display: none; }
  .tabs { top: 64px; height: 54px; }
  .tabs button { min-height: 36px; padding-inline: 12px; }
  main { padding: 16px 12px 32px; }
  .view.on { display: block; }
  aside { position: static; width: auto; margin-bottom: 18px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); }
  .view .result, .view .result.wide { padding: 0; border-radius: 0; }
  .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 25px; }
  .method-flow { grid-template-columns: 1fr; }
  .method-step { border-right: 0; border-bottom: 1px solid var(--line); }
  .method-step:last-child { border-bottom: 0; }
  .method-step:not(:last-child)::after { content: "↓"; right: 14px; top: auto; bottom: -8px; }
  .trace .trow { grid-template-columns: 110px 1fr; }
  .trace .tn { grid-column: 1 / -1; padding-top: 4px; }
  .trace .thead { grid-template-columns: 80px 100px 1fr; }
  .library-head { display: block; padding-top: 8px; }
  .library-head h2 { font-size: 25px; }
  .library-head input { margin-top: 16px; }
  .glossary-grid { grid-template-columns: 1fr; }
  .filterbar { flex-wrap: wrap; }
  footer { min-height: 52px; padding: 12px 14px; gap: 14px; flex-wrap: wrap; }
  .plan-modal { padding: 0; }
  .plan-modal-panel { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .plan-modal-head, .plan-modal-body { padding: 16px; }
  .detail-hero, .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .top {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    min-height: 0;
    align-items: center;
  }
  .top-actions { display: contents; }
  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; padding: 6px 8px; font-size: 11px; }
  .date { display: none; }
  .topmeta { grid-column: 2; grid-row: 1; gap: 6px; }
  .theme-btn { min-height: 32px; padding: 5px 9px; }
  .tabs { position: sticky; top: 0; }
}
