:root {
  --bg: #f4fbfa;
  --panel: #ffffff;
  --panel2: #eef7f5;
  --line: #c8ded9;
  --text: #17313a;
  --muted: #667c82;
  --brand: #18b99e;
  --accent: #f4b83c;
  --good: #328e5a;
  --bad: #c54d6a;
  --warn: #b46b00;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(24, 185, 158, .14), transparent 26rem),
    radial-gradient(circle at 92% 8%, rgba(244, 184, 60, .18), transparent 24rem),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 251, 250, .92);
}

header .head-main { min-width: 0; max-width: 980px; }
header h1 { margin: 0 0 2px; font-size: 18px; line-height: 1.3; }
header p { margin: 0; color: var(--muted); font-size: 13px; }
.tool-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tool-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
  font-size: 13px;
  text-decoration: none;
}
.tool-nav a:hover { border-color: #7fb5aa; }
.tool-nav a[aria-current="page"] {
  color: #07342d;
  border-color: var(--brand);
  background: var(--brand);
  font-weight: 700;
}
.header-actions {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-left: auto;
}
.lang-picker { position: relative; flex: none; }
.lang-picker > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 11px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(238, 247, 245, .92);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.85) inset;
}
.lang-picker > summary::-webkit-details-marker { display: none; }
.lang-picker > summary:hover,
.lang-picker[open] > summary {
  border-color: var(--brand);
  background: var(--panel);
}
.lang-picker__label { color: var(--muted); font-size: 12px; }
.lang-picker__current { font-weight: 700; }
.lang-picker__chev {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .16s ease;
}
.lang-picker[open] .lang-picker__chev { transform: translateY(2px) rotate(225deg); }
.lang-picker__menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 80;
  display: grid;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 14px 32px rgba(23, 49, 58, .18);
}
.lang-picker__menu a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  color: var(--text);
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}
.lang-picker__menu a:hover { background: var(--panel2); }
.lang-picker__menu a[aria-current="page"] {
  color: #07342d;
  background: color-mix(in srgb, var(--brand) 22%, white);
  font-weight: 700;
}

.wrap { max-width: 1440px; margin: 0 auto; padding: 20px; }
.layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.col-left { padding-right: 24px; border-right: 1px solid var(--line); }

h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
h2:not(:first-child) { margin-top: 22px; }
h2 .sub2 { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }

.card {
  padding: 2px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.name { flex: 1; min-width: 0; }
.name b { display: block; color: var(--text); font-weight: 600; }
.name small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.swatch { width: 12px; height: 12px; flex: none; border-radius: 3px; }
.icon { width: 18px; height: 18px; flex: none; object-fit: contain; }
.icon-inline { width: 13px; height: 13px; margin-right: 2px; vertical-align: -2px; object-fit: contain; }

input[type=number], .sel {
  width: 104px;
  flex: none;
  padding: 6px 8px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sel { cursor: pointer; }
input[type=number]:focus-visible, .sel:focus-visible, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.locked { width: 104px; flex: none; padding: 7px 8px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.presets.global { grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); }
.preset, .tab, button.reset {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
  font: inherit;
  cursor: pointer;
}
.preset:hover, .tab:hover, button.reset:hover { border-color: #7fb5aa; }
.preset { min-height: 52px; padding: 7px 8px; font-size: 12px; font-weight: 600; }
.preset.on { color: #07342d; border-color: var(--brand); background: var(--brand); }
.preset small, .tab small { display: block; margin-top: 2px; color: inherit; font-size: 10px; font-weight: 400; opacity: .78; white-space: nowrap; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { min-width: 92px; flex: 1 1 120px; min-height: 52px; padding: 8px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.tab[aria-selected=true] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 28%, white); box-shadow: inset 0 -2px 0 var(--accent); }

.chain {
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.chain b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.chain u { color: var(--accent); text-decoration: none; font-weight: 700; }
.chain .warn { color: var(--bad); }
.note { margin: 9px 0 0; padding: 8px 11px; color: var(--warn); border-left: 3px solid var(--accent); background: rgba(244, 184, 60, .12); font-size: 12px; line-height: 1.55; }

.reads { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-top: 9px; }
.read { min-height: 78px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.read span { display: block; color: var(--muted); font-size: 11px; }
.read b { display: block; margin-top: 4px; color: var(--text); font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.1; }

.tbl { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl table { min-width: 720px; width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-variant-numeric: tabular-nums; }
thead th { position: sticky; top: 0; z-index: 2; padding: 8px 5px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--panel2); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-align: right; text-transform: uppercase; }
thead th:first-child { padding-left: 26px; text-align: left; }
tbody td { padding: 7px 5px; border-bottom: 1px solid #e4efec; font-size: 12.5px; text-align: right; }
tbody td:first-child { position: relative; padding-left: 26px; color: var(--muted); text-align: left; }
tbody tr.tier { cursor: pointer; }
tbody tr.tier:hover td { background: rgba(24, 185, 158, .07); }
tbody td.heat { border-radius: 3px; font-weight: 600; }
tbody tr.here { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.here td:first-child { color: var(--text); font-weight: 700; }
tbody tr.here td:first-child::after { position: absolute; top: 50%; right: 2px; color: var(--accent); font-size: 9px; font-weight: 700; content: '当前'; transform: translateY(-50%); }
tbody tr.past td { color: var(--muted); }
tbody tr.det td { padding: 0; border-bottom: 1px solid var(--line); }
.detbox { padding: 9px 12px 11px 26px; color: var(--muted); background: var(--panel2); font-size: 12px; line-height: 1.65; text-align: left; }
.detbox b { color: var(--text); font-weight: 600; }
.detbox .lbl { display: inline-block; min-width: 74px; color: var(--muted); }
.caret { position: absolute; top: 50%; left: 5px; width: 13px; color: var(--muted); font-size: 10px; text-align: center; transform: translateY(-50%); transition: transform .15s; }
tbody tr.tier.open .caret { color: var(--accent); transform: translateY(-50%) rotate(90deg); }
.railline { position: absolute; top: 0; bottom: 0; left: 10px; width: 1px; background: var(--line); }
.legend { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px 8px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 11px; }
.legend i { display: block; height: 7px; border-radius: 4px; }
.legend span:nth-child(3), .legend span:nth-child(4) { font-variant-numeric: tabular-nums; }
.legend span:nth-child(4) { color: var(--text); }
.foot { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.foot b { color: var(--text); font-weight: 600; }
button.reset { margin-top: 14px; padding: 6px 11px; color: var(--muted); font-size: 12px; }

.seg { display: flex; flex: none; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.segb { padding: 6px 12px; color: var(--muted); border: 0; background: var(--panel2); font: inherit; font-size: 12px; cursor: pointer; }
.segb + .segb { border-left: 1px solid var(--line); }
.segb:hover { color: var(--text); }
.segb.on { color: #07342d; background: var(--brand); font-weight: 700; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini { padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); }
.mini label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.mini input { width: 100%; }
.pair { margin-bottom: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.pairhd { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: pointer; }
.pairhd .ttl { flex: 1; font-weight: 600; }
.pairhd .ttl small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 400; }
.pairhd .val { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.pairhd .car { color: var(--muted); font-size: 10px; transition: transform .15s; }
.pair.open .pairhd .car { color: var(--accent); transform: rotate(90deg); }
.pairbody { display: none; padding: 0 12px 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.pair.open .pairbody { display: block; }
.stg { display: flex; gap: 8px; padding: 4px 0; border-top: 1px solid #e4efec; }
.stg .n { width: 58px; color: var(--muted); }
.stg .r { flex: 1; color: var(--text); }
.stg .c { font-variant-numeric: tabular-nums; }
.stg.miss { opacity: .45; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .col-left { padding-right: 0; border-right: 0; }
}

@media (max-width: 700px) {
  header { padding: 14px 16px; }
  .header-actions { gap: 8px; }
  .lang-picker__label { display: none; }
  .wrap { padding: 14px 12px 36px; }
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { min-width: 0; }
  .presets.global { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input[type=number], .sel { font-size: 16px; }
  .row { min-height: 52px; }
  .reads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .read b { font-size: 18px; }
}
