:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #17243a;
  --muted: #66768c;
  --line: #dfe6ef;
  --accent: #2868c7;
  --accent-soft: #eaf2ff;
  --nav: #11233b;
  --nav-soft: #1f3b5d;
  --green: #197b62;
  --amber: #986419;
  --coral: #b6534b;
  --shadow: 0 12px 30px rgba(19, 39, 67, 0.07);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.6 "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #cfd8e6;
  background: white;
  color: var(--ink);
  padding: 8px 13px;
  border-radius: 7px;
  white-space: nowrap;
}
button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover {
  background: #2058b1;
  color: white;
}
input,
select {
  border: 1px solid #cfd8e6;
  background: white;
  border-radius: 7px;
  padding: 8px;
  max-width: 100%;
  color: var(--ink);
}
input:focus,
select:focus {
  outline: 2px solid #9bbced;
  outline-offset: 1px;
}
input[type="checkbox"] {
  accent-color: var(--accent);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
[hidden] {
  display: none !important;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 218px;
  background: var(--nav);
  color: #e1eaf8;
  padding: 30px 17px;
  box-shadow: 8px 0 25px rgba(13, 31, 53, 0.08);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  padding: 0 8px;
}
.brand small {
  display: block;
  letter-spacing: 2px;
  font-size: 9px;
  font-weight: 400;
  color: #96acc8;
}
.brand-mark {
  background: #2e6fcf;
  padding: 2px 12px;
  font-size: 27px;
  border-radius: 8px;
}
nav {
  margin-top: 45px;
  display: grid;
  gap: 9px;
}
nav button {
  background: none;
  border: 0;
  text-align: left;
  color: #a9bcd5;
  display: flex;
  justify-content: space-between;
  padding: 12px;
  font-size: 14px;
}
nav button span {
  font-size: 10px;
  opacity: 0.5;
}
nav button.active,
nav button:hover {
  background: var(--nav-soft);
  color: white;
}
.aside-note {
  margin-top: auto;
  padding: 16px 10px 0;
  color: #a9bcd5;
  font-size: 12px;
  border-top: 1px solid #2c3b52;
}
.aside-note a {
  color: #bfd6fa;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38ab8e;
  margin-right: 7px;
}
.aside-note p {
  color: #748da9;
  line-height: 1.9;
}
main {
  margin-left: 218px;
  max-width: 1900px;
  padding: 34px clamp(24px, 3vw, 56px) 16px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.eyebrow {
  letter-spacing: 2px;
  font-size: 10px;
  color: var(--muted);
}
h1 {
  font-size: 29px;
  font-weight: 650;
  margin: 5px 0 0;
  letter-spacing: 0.5px;
}
.header-state {
  text-align: right;
  font-size: 12px;
}
.header-state small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
h2 {
  font-size: 17px;
  font-weight: 650;
  margin: 18px 0 12px;
}
h3 {
  font-size: 14px;
  margin: 22px 0 8px;
}
p {
  margin: 7px 0 12px;
}
.muted,
.footnote {
  color: var(--muted);
  font-size: 12px;
}
.footnote {
  margin: 17px 0;
}
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 23px;
}
.stat {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 15px 17px;
  box-shadow: 0 2px 8px rgba(22, 42, 72, 0.03);
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
}
.stat .value {
  font-size: 25px;
  font-weight: 600;
  line-height: 1.6;
}
.stat small {
  color: var(--muted);
  font-size: 11px;
}
.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar #search {
  flex: 1;
  min-width: 180px;
  max-width: 450px;
}
.inline {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}
.section-heading h2 {
  margin: 0;
}
.section-heading p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(22, 42, 72, 0.03);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
}
th {
  font-weight: 500;
  background: #f7f9fc;
  color: var(--muted);
  white-space: nowrap;
}
td,
th {
  padding: 12px 13px;
  border-bottom: 1px solid #edf0f5;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f8faff;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.series-button {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--ink);
  font-weight: 600;
}
.star {
  padding: 0;
  border: 0;
  background: none;
  font-size: 18px;
  color: #99a6ba;
}
.star.on {
  color: #c38a1d;
}
.badge {
  display: inline-block;
  border-radius: 4px;
  background: #eef2f7;
  color: #627188;
  padding: 3px 6px;
  font-size: 10px;
  white-space: nowrap;
}
.badge.ok {
  background: #eaf6f0;
  color: var(--green);
}
.badge.warn {
  background: #fff4de;
  color: var(--amber);
}
.badge.bad {
  background: #fdeced;
  color: #a33443;
}
.description {
  padding: 14px 17px;
  border-left: 3px solid #7394c6;
  background: #edf4ff;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 12px;
  line-height: 1.9;
}
.chart {
  height: 350px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(22, 42, 72, 0.03);
}
.chart.analysis-chart {
  height: 525px;
}
.chart.tall {
  height: 460px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 12px;
}
.research-layout {
  display: grid;
  grid-template-columns: minmax(315px, 365px) minmax(0, 1fr);
  gap: clamp(18px, 2.5vw, 30px);
  align-items: start;
}
.research-layout > * {
  min-width: 0;
}
#research-engine {
  max-width: 100%;
}
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 13px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  gap: 4px;
}
.field-help {
  color: #7b8798;
  font-size: 10px;
  line-height: 1.45;
}
.form-grid input,
.form-grid select {
  min-width: 0;
  width: 100%;
}
.weight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
}
.weight-row span {
  flex: 1;
  font-size: 12px;
}
.weight-row input {
  width: 75px;
}
.weight-row button {
  padding: 3px 8px;
}
.full {
  width: 100%;
}
.sensitivity {
  margin: 20px 0;
}
.condition {
  display: flex;
  gap: 5px;
  margin: 10px 0;
}
.condition select:first-child {
  width: 150px;
}
.condition input {
  width: 60px;
}
.condition button {
  padding: 4px;
}
.empty {
  padding: 90px 25px;
  text-align: center;
  border: 1px dashed #bdc9d9;
  border-radius: 8px;
  color: var(--muted);
  font-size: 18px;
}

.intro-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 17px;
  margin: 0 0 22px;
  border: 1px solid #cfe0f8;
  border-radius: 9px;
  background: linear-gradient(90deg, #edf5ff 0%, #f9fbff 100%);
}
.intro-band p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.intro-icon {
  display: grid;
  place-items: center;
  flex: 0 0 33px;
  height: 33px;
  border-radius: 50%;
  background: #d8e8ff;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}
.source-chip,
.mode-chip {
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid #c6d8f3;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--accent);
  background: #f8fbff;
  font-size: 11px;
  white-space: nowrap;
}
.rulebook {
  margin: 0 0 28px;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  background: #fbfcfe;
  box-shadow: var(--shadow);
}
.rulebook-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.rulebook-head h2 {
  margin: 5px 0 5px;
  font-size: 23px;
  letter-spacing: 0;
}
.rulebook-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.mode-chip {
  border-color: #cfe4dd;
  color: var(--green);
  background: #f3fbf8;
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin: 19px 0 15px;
}
.rule-card {
  position: relative;
  min-height: 210px;
  padding: 15px 15px 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}
.rule-card h3 {
  margin: 23px 0 8px;
  font-size: 15px;
}
.rule-card p {
  margin: 0;
  color: #3f5067;
  font-size: 12px;
  line-height: 1.75;
}
.rule-card small {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.rule-index {
  position: absolute;
  top: 12px;
  right: 13px;
  color: #9aacbf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}
.rule-teal { border-top-color: #239575; }
.rule-amber { border-top-color: #d59328; }
.rule-coral { border-top-color: #c5675f; }
.rule-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
}
.rule-notes div {
  display: grid;
  gap: 3px;
}
.rule-notes strong { font-size: 12px; }
.rule-notes span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.rule-details {
  margin-top: 14px;
  border-top: 1px dashed #cbd6e3;
  padding-top: 12px;
}
.rule-details summary { color: var(--accent); font-size: 12px; }
.rule-table-wrap { overflow-x: auto; margin-top: 10px; }
.rule-table { min-width: 680px; font-size: 11px; }
.rule-table td, .rule-table th { padding: 9px 10px; }
.rule-table td:first-child { width: 130px; font-weight: 600; }
.term-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
  padding: 12px;
  border: 1px solid #d9e3ef;
  border-radius: 7px;
  background: #f6f9fd;
  color: #53657e;
  font-size: 11px;
  line-height: 1.55;
}
.term-guide strong {
  color: var(--ink);
  font-size: 12px;
}
.term-guide span { display: block; }
.term-guide b { color: var(--accent); }
.rule-formulas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}
.rule-formulas div {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border-left: 3px solid #a8bddb;
  background: #fff;
  color: #53657e;
  font-size: 11px;
  line-height: 1.5;
}
.rule-formulas strong { color: var(--ink); font-size: 12px; }
.rule-formulas code {
  color: #244e83;
  font-size: 12px;
  white-space: normal;
}
.result-panel {
  margin: 22px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(22, 42, 72, 0.03);
}
.result-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  color: var(--ink);
}
.result-panel summary::-webkit-details-marker { display: none; }
.result-panel summary::after {
  content: "⌄";
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}
.result-panel[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8faff;
}
.result-panel[open] summary::after { transform: rotate(180deg); }
.result-panel summary > span { font-weight: 650; }
.result-panel summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-align: right;
}
.result-panel-body { padding: 2px 16px 16px; }
.result-panel-body h3 {
  margin: 17px 0 6px;
  font-size: 13px;
}
.result-panel-body .table-wrap { margin-top: 10px; }
.compact-table { box-shadow: none; }
.compact-table table { min-width: 620px; }
.result-empty {
  margin: 14px 0 2px;
  padding: 13px;
  border: 1px dashed #cbd6e3;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}
.result-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 15px 0 5px;
}
.result-kpis span,
.evidence-summary span {
  border-radius: 5px;
  background: #f2f6fb;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 11px;
}
.result-kpis strong,
.evidence-summary strong { color: var(--ink); font-size: 12px; }
.result-scroll { max-height: 340px; }
.result-scroll thead th { position: sticky; top: 0; z-index: 1; }
.assumption-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: #3f5067;
  font-size: 12px;
}
.result-hashes {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}
.result-hashes code {
  overflow-wrap: anywhere;
  color: #53657e;
}
.evidence-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 7px 0 0;
}
@media (max-width: 600px) {
  .result-panel summary { align-items: flex-start; padding: 13px; }
  .result-panel summary small { max-width: 46%; }
  .result-panel-body { padding: 2px 13px 13px; }
  .compact-table table { min-width: 560px; }
}
.empty p {
  font-size: 12px;
  margin-top: 15px;
}
.research-layout .summary {
  gap: 8px;
}
.research-layout .stat {
  padding: 12px;
}
.research-layout .stat .value {
  font-size: 21px;
}
.job {
  border: 1px solid var(--line);
  background: white;
  padding: 15px 18px;
  border-radius: 7px;
  margin: 10px 0;
}
.job-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.job details {
  margin-top: 8px;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow: auto;
  font-size: 11px;
  background: #f5f7fa;
  padding: 12px;
  border-radius: 4px;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
#notice {
  position: sticky;
  top: 10px;
  z-index: 10;
  background: #fff3df;
  border: 1px solid #e7c78f;
  border-radius: 7px;
  padding: 12px 16px;
  margin-bottom: 15px;
}
footer {
  color: #8c98aa;
  font-size: 10px;
  letter-spacing: 0.3px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  margin-top: 40px;
}
footer span {
  float: right;
}
@media (max-width: 1200px) {
  main {
    padding: 25px;
  }
  .research-layout {
    grid-template-columns: 330px minmax(0, 1fr);
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary {
    gap: 8px;
  }
}
@media (max-width: 900px) {
  aside {
    width: 165px;
    padding: 25px 10px;
  }
  .brand {
    font-size: 13px;
    gap: 6px;
  }
  .brand-mark {
    font-size: 20px;
    padding: 3px 9px;
  }
  main {
    margin-left: 165px;
    padding: 20px;
  }
  .research-layout {
    grid-template-columns: 1fr;
  }
  .rulebook-head { display: block; }
  .mode-chip { display: inline-block; margin: 14px 0 0; }
  .rule-notes { grid-template-columns: 1fr; }
  .term-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-formulas { grid-template-columns: 1fr; }
  .header-state {
    display: none;
  }
  nav {
    margin-top: 30px;
  }
}
@media (max-width: 600px) {
  aside {
    position: static;
    width: auto;
    padding: 16px;
  }
  .brand {
    display: none;
  }
  nav {
    margin: 0;
    display: flex;
    gap: 2px;
    overflow: auto;
  }
  nav button {
    font-size: 12px;
    padding: 9px;
  }
  nav button span,
  .aside-note {
    display: none;
  }
  main {
    margin-left: 0;
    padding: 15px;
  }
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar input[type="date"] {
    max-width: 145px;
  }
  h1 {
    font-size: 24px;
  }
  .intro-band { align-items: flex-start; }
  .source-chip { display: none; }
  .rule-grid { grid-template-columns: 1fr; }
  .rule-card { min-height: 0; }
  .rulebook-head h2 { font-size: 20px; }
  .term-guide { grid-template-columns: 1fr; }
}
