:root {
  color-scheme: light;
  --ink: #182e2a; --text: #344a44; --muted: #5b6d66; --green: #176950;
  --line: #dce5df; --wash: #f5f7f3; --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink); background: var(--wash); font-size: 15px; line-height: 1.55;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
a, .link-btn { color: var(--green); text-underline-offset: .2em; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #16846b; outline-offset: 3px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; top: 5px; left: 10px; z-index: 20; background: white; padding: 8px; }
.shell { width: min(1232px, 92%); margin-inline: auto; }
.mast { position: sticky; top: 0; z-index: 5; background: #fbfcf9; border-bottom: 1px solid var(--line); }
.mast-inner, .brand, nav, .card-head, .board-filter, .actions, footer { display: flex; align-items: center; }
.mast-inner { justify-content: space-between; min-height: 70px; gap: 24px; }
.brand { gap: 11px; white-space: nowrap; }
.brand b { font-size: 18px; letter-spacing: -.035em; }
.course { padding-left: 13px; margin-left: 3px; border-left: 1px solid #cdd8cf; color: var(--muted); font-size: 13px; }
.gate { width: 33px; height: 33px; border-radius: 9px; background: #184a3e; display: grid; place-items: center; }
.gate i { display:block; position:relative; width:14px; height:14px; border:2px solid #b4edb7; border-radius:1px 85% 85% 1px; }
.gate i::before, .gate i::after { content:""; position:absolute; background:#b4edb7; height:2px; width:4px; }
.gate i::before { left:-6px; top:1px; box-shadow:0 5px #b4edb7; }
.gate i::after { right:-6px; top:4px; }
nav { gap: 5px; }
nav a { padding: 8px 15px; color: var(--muted); text-decoration: none; border-radius: 7px; font-size: 14px; font-weight: 600; }
nav a:hover { color: var(--green); background: #f0f4ed; }
nav a[aria-current] { color: #14543f; background: #e3efdf; }
.hero { display: grid; grid-template-columns: 1.07fr 1fr; gap: clamp(24px,5vw,80px); align-items: center; position: relative;
  margin: 27px 0 24px; padding: clamp(25px,3vw,43px) clamp(24px,3.5vw,50px); border-radius: 19px; overflow: hidden;
  color: white; background: radial-gradient(ellipse at 100% 0%, #286153 0, transparent 60%), linear-gradient(110deg,#113b35,#194c40);
}
.hero::before { content:""; position: absolute; inset:0 0 0 45%; opacity:.13; pointer-events:none;
  background-image:radial-gradient(circle,#c4e9ca 1px,transparent 1.4px); background-size:16px 16px; mask-image:linear-gradient(90deg,transparent,#000); }
.hero-copy, .chart-card { position: relative; }
.eyebrow { display:flex; align-items:center; gap:9px; font:600 12px/1.1 var(--mono); letter-spacing:.13em; color:#c0e4bc; }
.eyebrow span { width:24px; height:2px; background:#b7e8a5; }
h1 { margin-top:14px; font-size:clamp(34px,3.3vw,52px); letter-spacing:-.045em; line-height:1.2; font-weight:750; }
.subtitle { color:#d7e6df; margin-top:12px; font-size:14px; }
.stats { display:flex; margin-top:24px; }
.stats div { display:flex; flex-direction:column-reverse; gap:2px; padding:0 clamp(14px,2.2vw,33px); border-left:1px solid #547469; }
.stats div:first-child { border:0; padding-left:0; }
.stats div:last-child { padding-right:0; }
.stats dt { color:#bad1c5; font-size:12px; }
.stats dd { display:flex; align-items:baseline; gap:6px; line-height:1; }
.stats dd b { font:600 clamp(22px,2vw,30px)/1.1 var(--mono); letter-spacing:-.055em; }
.stats small { color:#cadfd3; font-size:12px; }
.chart-card { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0 12px; align-items:center; padding:18px 22px 15px; border:1px solid #557b69; border-radius:13px; background:rgba(9,41,34,.72); --optimal:#ffcf53; }
.chart-card figcaption { display:grid; gap:2px; }
.chart-card figcaption strong { font-size:17px; }
.chart-card figcaption span, .chart-picker { color:#c1d7c9; font-size:12px; }
.chart-picker { display:flex; align-items:center; justify-self:end; gap:6px; }
.chart-card select { min-width:70px; max-width:128px; min-height:32px; padding:3px 23px 3px 8px; border:1px solid #648578; border-radius:6px; background-color:#214e41; color:#fff; font-size:14px; appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,#cde2d3 50%),linear-gradient(135deg,#cde2d3 50%,transparent 50%); background-position:calc(100% - 12px) 53%,calc(100% - 8px) 53%; background-size:4px 4px; background-repeat:no-repeat; }
.chart-card select:focus-visible, .chart-point:focus-visible { outline:2px solid white; outline-offset:2px; }
#chart-data, .chart-message { grid-column:1/-1; }
.chart-message { min-height:100px; display:grid; place-content:center; color:#c1d7c9; font-size:14px; }
.chart-legend { display:flex; justify-content:flex-end; margin:4px 0; color:#f4e3b6; font-size:12px; }
.chart-legend span::before { content:""; display:inline-block; width:9px; height:9px; margin-right:5px; border-radius:2px; background:var(--optimal); }
.chart-legend b { font-family:var(--mono); }
.plot { display:grid; grid-template-columns:34px 1fr; height:76px; }
.chart-axis-y { display:flex; flex-direction:column; justify-content:space-between; font:11px var(--mono); color:#c5d5cb; }
.chart { display:flex; align-items:stretch; padding:0 2px; border-bottom:1px solid #829a85; background:linear-gradient(to bottom,rgba(166,197,170,.27) 1px,transparent 1px) top/100% 50%; }
.chart-point { flex:1; min-width:0; display:flex; align-items:flex-end; padding:0 clamp(1px,.15vw,3px); border:0; background:transparent; }
.chart-point[aria-pressed="true"] { background:rgba(230,248,226,.12); }
.bar { width:100%; min-height:1px; background:#85baa6; border-radius:2px 2px 0 0; }
.bar.at-best { background:var(--optimal); border-top:2px solid #fff0ba; }
.bar.missing { background:none; border-bottom:1px dashed #a1b6a9; }
.chart-axis-x { display:flex; justify-content:space-between; margin:4px 0 0 34px; color:#c4d6c9; font:11px var(--mono); }
.chart-detail { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:2px 12px; margin-top:9px; padding-top:7px; border-top:1px solid #537769; font-size:12px; font-variant-numeric:tabular-nums; color:#c6dacd; }
.chart-detail strong { color:#f4f6ed; font-size:13px; }
#workspace, #workspace > section { scroll-margin-top:84px; }
.board-jump { display:none; }
.workspace-grid { display:grid; grid-template-columns:minmax(310px,.9fr) minmax(0,1.65fr); align-items:start; gap:22px; }
.card { background:#fff; min-width:0; border:1px solid var(--line); border-radius:15px; padding:clamp(20px,2vw,30px); box-shadow:0 3px 11px rgba(29,52,36,.035); }
h2 { font-size:clamp(20px,1.8vw,26px); line-height:1.35; letter-spacing:-.035em; }
h2 small { font-size:12px; font-weight:500; color:var(--muted); letter-spacing:0; vertical-align:middle; margin-left:6px; }
.intro { margin-top:6px; color:var(--muted); font-size:13px; line-height:1.7; }
.card-head { gap:16px; justify-content:space-between; align-items:flex-start; }
.picker { margin-top:18px; padding:16px 12px 12px; border:1px dashed #a4bdae; border-radius:9px; background:#f5f9f2; text-align:center; }
.picker:focus-within, .picker:hover { border-color:#588b73; background:#f0f6ee; }
.pick-dir { display:flex; flex-direction:column; align-items:center; gap:9px; width:100%; padding:2px; background:none; color:#275c48; border:0; }
.folder { width:25px; height:17px; border:1.8px solid #387158; border-radius:2px 4px 4px 4px; position:relative; margin-top:5px; background:#e9f2e2; }
.folder::before { content:""; position:absolute; width:10px; height:4px; left:-1.8px; top:-6px; border:1.8px solid #387158; border-bottom:0; border-radius:3px 4px 0 0; }
.pick-alt { color:var(--muted); font-size:12px; }
.link-btn, .rank-name { border:0; background:transparent; padding:2px 4px; text-decoration:underline; text-underline-offset:3px; color:var(--green); }
#aig-selection { margin:8px 0 15px; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.field { display:block; font-size:13px; font-weight:650; margin-bottom:5px; }
input[type="text"], input[type="search"], select { background:white; color:var(--ink); min-height:40px; padding:7px 11px; border:1px solid #bbcbbf; border-radius:7px; font-size:14px; }
input::placeholder { color:#68796f; }
#aig-nick { width:100%; }
#aig-identity:not(:empty) { margin-top:5px; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.actions { margin-top:15px; }
.primary { font-size:14px; font-weight:650; border:0; border-radius:7px; padding:9px 20px; color:#fff; background:var(--green); }
.primary:hover:enabled { background:#0e503f; }
.primary:disabled { color:#52675a; background:#dfe8dd; }
details { margin-top:15px; font-size:13px; }
details summary { width:fit-content; color:var(--green); font-weight:550; }
details p, details ul { color:var(--muted); margin-top:8px; }
details ul { padding-left:20px; overflow-wrap:anywhere; }
details li + li { margin-top:5px; }
code { font-family:var(--mono); }
.refresh { display:inline-flex; flex:none; align-items:center; gap:5px; padding:5px 10px; border:1px solid var(--line); border-radius:7px; color:var(--text); background:white; font-size:13px; }
.refresh:hover { background:var(--wash); }
.refresh span { font:20px/1 system-ui; }
.board-filter { justify-content:space-between; gap:10px; padding:18px 0 14px; border-bottom:1px solid var(--line); }
.board-filter select { max-width:70%; font-weight:600; min-height:36px; }
#aig-board-note { font-size:12px; color:var(--muted); }
#aig-state:not(:empty), .empty { margin:18px 0; padding:24px 14px; border-radius:9px; background:#f6f8f3; color:var(--muted); text-align:center; font-size:14px; }
#aig-state[data-kind="empty"], .empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-height:165px; }
#aig-state[data-kind="empty"]::before, .empty::before { content:""; display:block; width:52px; height:40px; margin:0 auto 7px; background:
  linear-gradient(#93b39a,#93b39a) 0 100%/14px 18px,
  linear-gradient(#50876b,#50876b) 50% 100%/16px 32px,
  linear-gradient(#bacfb4,#bacfb4) 100% 100%/14px 12px; background-repeat:no-repeat; }
#aig-state strong, .empty strong { color:var(--text); font-weight:600; }
#aig-state small { font-size:12px; }
.board-foot, .panel-foot { color:var(--muted); font-size:12px; }
.board-foot { padding-top:14px; margin-top:8px; border-top:1px solid var(--line); }
.board-foot a { white-space:nowrap; margin-left:.3em; }
.panel .card-head { margin-bottom:20px; align-items:center; }
.scroll { overflow-x:auto; }
.data { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; font-size:14px; line-height:1.5; }
.data th, .data td { padding:12px 11px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; }
.data th { background:#f0f4ee; color:#43594c; font-size:12px; font-weight:600; }
.data th:first-child, .data td:first-child, .data:not(.baseline) :is(th,td):nth-child(2) { text-align:left; }
.data tr:hover > td { background:#f7f9f5; }
.sort { border:0; background:transparent; color:inherit; font-size:inherit; font-weight:inherit; padding:3px 0; }
.sort:hover, .sort-active, .pass, .delta { color:var(--green); }
.case, .final, .rule-score { font-weight:650; }
.case { font-family:var(--mono); }
.panel-foot { margin-top:12px; }
.rank-detail > td { padding:16px; }
.rank-detail h3 { margin-bottom:10px; }
.rank-name { font-size:inherit; font-weight:550; }
.rules-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.rules-grid article { border:1px solid var(--line); border-radius:9px; padding:19px; background:#f8faf6; }
h3 { font-size:16px; }
.rules-grid p { margin-top:8px; color:var(--muted); font-size:14px; }
.rules-grid .formula { font-weight:650; color:var(--green); }
.upload-error { color:#a2382b; }
footer { justify-content:space-between; gap:16px; margin:26px auto; padding-top:18px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
footer i { margin:0 6px; font-style:normal; color:#9aa89c; }
footer span:last-child { font:11px var(--mono); letter-spacing:.05em; }
@media (max-width:880px) {
  .shell { width:94%; } .workspace-grid { grid-template-columns:minmax(262px,.9fr) minmax(0,1.4fr); gap:14px; }
  .hero { gap:20px; padding:25px; } .chart-card { padding:16px; } .rules-grid { gap:10px; }
}
@media (max-width:700px) {
  .shell { width:calc(100% - 32px); } .mast-inner { align-items:flex-start; flex-direction:column; gap:9px; padding:12px 0 9px; }
  .brand b { font-size:16px; } .gate { width:29px; height:29px; } .course { font-size:12px; }
  nav { width:100%; justify-content:space-between; gap:3px; } nav a { text-align:center; padding:6px 4px; flex:1; font-size:13px; }
  .hero { grid-template-columns:1fr; gap:18px; margin:15px 0; padding:23px; border-radius:14px; }
  .hero::before { inset:0; } h1 { margin-top:11px; } .subtitle { margin-top:8px; }
  .stats { margin-top:19px; } .stats div { padding-inline:18px; } .stats div:first-child { padding-left:0; }
  .chart-card { padding:14px; } .chart-card figcaption strong { font-size:15px; }
  .chart-picker { flex-direction:column; align-items:start; gap:2px; } .chart-card select { max-width:92px; }
  .plot { height:68px; }
  .workspace-grid, .rules-grid { grid-template-columns:1fr; } .card { padding:19px; border-radius:12px; }
  #workspace, #workspace > section, #aig-board { scroll-margin-top:105px; }
  .upload-title { display:flex; align-items:center; justify-content:space-between; gap:8px; }
  .board-jump { display:inline-block; padding:4px 0 4px 6px; font-size:13px; text-decoration:none; }
  .panel .card-head { align-items:stretch; flex-direction:column; gap:12px; }
  .data th, .data td { padding:9px; } footer { margin-top:18px; }
}
@media(max-width:370px) { .shell { width:calc(100% - 20px); } .hero,.card { padding:16px; } footer { flex-wrap:wrap; } }
