:root {
  --bg: #0e1116;
  --bg-soft: #151a22;
  --card: #191f29;
  --card-2: #1f2632;
  --line: #2b3441;
  --text: #e6ebf2;
  --muted: #93a1b3;
  --accent: #5ddc7f;
  --accent-dim: #2f7a46;
  --gold: #f0c060;
  --danger: #e8705b;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -200px, #1b2a24 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

.site-header {
  padding: 40px 0 12px;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: 0.02em;
}

.site-header .sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.site-header .version {
  margin: 4px 0 0;
  color: var(--accent-dim);
  font-family: var(--mono);
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 20px;
  align-items: start;
  padding: 20px 0 60px;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 25%);
}

.card + .card,
.results .card + .card {
  margin-top: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.panel {
  position: sticky;
  top: 16px;
}

@media (max-width: 860px) {
  .panel {
    position: static;
  }
}

.field {
  margin-bottom: 14px;
}

.field:last-of-type {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row.tight {
  gap: 8px;
  grid-template-columns: 2fr 1fr;
}

select,
input[type="number"] {
  width: 100%;
  padding: 9px 10px;
  color: var(--text);
  background: #11161d;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
}

select:focus,
input:focus,
button:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.status {
  min-height: 18px;
  font-family: var(--mono);
}

button[type="submit"] {
  width: 100%;
  margin-top: 16px;
  padding: 11px 16px;
  color: #06210f;
  background: linear-gradient(180deg, #6fe892 0%, #46c96c 100%);
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

button[type="submit"]:hover {
  filter: brightness(1.06);
}

button[type="submit"]:active {
  transform: translateY(1px);
}

button[type="submit"]:disabled {
  filter: grayscale(0.6) brightness(0.8);
  cursor: progress;
}

details.shelves {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #11161d;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

details.shelves summary {
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

details.shelves[open] summary {
  margin-bottom: 12px;
}

.slot-buttons {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.slot-buttons button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  color: var(--text);
  background: #171e27;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.slot-buttons button:hover {
  border-color: var(--accent-dim);
}

.slot-buttons .range {
  color: var(--accent);
  font-family: var(--mono);
}

/* ---------- 结果区 ---------- */

.placeholder {
  color: var(--muted);
}

.placeholder h2 {
  color: var(--text);
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat {
  padding: 10px 12px;
  background: #11161d;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.stat .k {
  color: var(--muted);
  font-size: 12px;
}

.stat .v {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 17px;
}

.stat.ok .v {
  color: var(--accent);
}

.stat.bad .v {
  color: var(--danger);
}

.note {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #11161d;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.note b {
  color: var(--text);
}

ol.outcomes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

ol.outcomes li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 12px;
  background: #11161d;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 2px 8px;
  background: #1c2a3d;
  border: 1px solid #2f4159;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.chip b {
  color: var(--gold);
  font-weight: 600;
}

.chip.lead {
  background: #16301f;
  border-color: #2f6a42;
}

.pct {
  align-self: center;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
}

.bar {
  grid-column: 1 / -1;
  height: 4px;
  background: #0c1016;
  border-radius: 999px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.grid th {
  padding: 6px 8px;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

table.grid td {
  padding: 7px 8px;
  border-bottom: 1px solid #202832;
  vertical-align: top;
}

table.grid tr:last-child td {
  border-bottom: 0;
}

table.grid td.num {
  font-family: var(--mono);
  text-align: right;
  white-space: nowrap;
}

.levels {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
}

.mini {
  display: inline-block;
  width: 46px;
  height: 4px;
  margin-right: 6px;
  background: #0c1016;
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
}

.mini > i {
  display: block;
  height: 100%;
  background: var(--accent-dim);
}

details.about {
  margin-top: 16px;
  padding: 12px 16px;
  background: #11161d;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

details.about summary {
  color: var(--text);
  cursor: pointer;
}

details.about ul {
  padding-left: 20px;
}

details.about code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
}

.site-footer {
  padding: 24px 0 40px;
  border-top: 1px solid #171d26;
  color: var(--muted);
  font-size: 12.5px;
}
