:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #94a3b8;
  --over: #e11d48;
  --over-bg: #fff1f2;
  --over-text: #9f1239;
  --over-line: #fecdd3;
  --tight: #d97706;
  --tight-bg: #fffbeb;
  --tight-text: #92400e;
  --tight-line: #fde68a;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --ok-text: #065f46;
  --ok-line: #a7f3d0;
  --brand: #0f766e;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.045), 0 10px 28px rgba(15, 23, 42, 0.045);
  --radius: 16px;
  --sans: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(#dbe3ee 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
}
.badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 24px;
  padding-left: 10px;
  border-left: 3px solid #94070a;
  user-select: none;
  cursor: default;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
}
.chip + .chip::before {
  content: "·";
  margin: 0 9px;
  color: #cbd5e1;
  font-weight: 400;
}
.chip-brand {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0.06em;
}
#termChip {
  color: #334155;
  font-weight: 700;
}
.chip-ver {
  color: #0e7490;
  font-weight: 600;
}
.hero-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 0;
}
h1 {
  margin: 0;
  font-size: clamp(34px, 4.5vw, 46px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 800;
}
h1 .pku-red {
  color: #94070a;
}
.page-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  align-items: center;
  padding: 5px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  user-select: none;
}
.page-glider {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 3);
  border-radius: 10px;
  background: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  transform: translate3d(calc(var(--tab-index, 0) * 100%), 0, 0);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.page-tab {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: transparent;
  height: 36px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #475563;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.page-tab:hover:not([aria-selected="true"]) { color: var(--ink); }
.page-tab[aria-selected="true"] { color: #ffffff; }
.page-tab:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}
.page-panel[hidden] { display: none; }
.page-panel.is-active {
  animation: pageEnter 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-slot {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 48px 24px;
  text-align: center;
}
.page-slot h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.page-slot p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.live-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 18px;
}
.live-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.live-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ok-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.live-sep {
  color: var(--soft);
  font-weight: 400;
}
.live-card.is-stale .live-row { color: var(--tight-text); }
.live-card.is-wait .live-row { color: var(--muted); }
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.45);
  animation: breathe 1.8s ease-out infinite;
}
.live-card.is-stale .pulse {
  background: var(--tight);
  animation: none;
  box-shadow: none;
}
.live-card.is-wait .pulse {
  background: var(--soft);
  animation: none;
  box-shadow: none;
}
@keyframes breathe {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.42); }
  70% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}
.live-time { margin-top: 6px; font-size: 21px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.live-rel { color: var(--muted); font-size: 12px; font-weight: 600; }
.live-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.refresh,
.reauth-btn {
  margin: 0;
  width: 98px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
}
.refresh {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.refresh:hover { border-color: #94a3b8; background: #f8fafc; }
.refresh:disabled { opacity: 0.55; cursor: wait; }
.reauth-btn {
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.08s ease;
}
.reauth-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
.reauth-btn:active { transform: translateY(1px); }

.banner {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--tight-bg);
  color: var(--tight-text);
  border: 1px solid var(--tight-line);
  font-size: 13px;
  font-weight: 600;
}
.banner[hidden] { display: none; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 15px;
  min-width: 0;
}
.metric .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.metric .value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric .hint { margin-top: 4px; color: var(--soft); font-size: 12px; }
.metric.warn {
  background: var(--over-bg);
  border-color: var(--over-line);
}
.metric.warn .value { color: var(--over-text); }
.metric.warn .hint { color: #be123c; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seg-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn:hover { border-color: var(--line-strong); }
.seg-btn[aria-pressed="true"] {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.seg-btn.over[aria-pressed="true"] { background: var(--over); border-color: var(--over); }
.seg-btn.tight[aria-pressed="true"] { background: var(--tight); border-color: var(--tight); }
.seg-btn.ok[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 11px;
  width: 14px;
  height: 14px;
  border: 1.6px solid #94a3b8;
  border-radius: 99px;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.6px;
  background: #94a3b8;
  right: -5px;
  bottom: -1px;
  transform: rotate(45deg);
  border-radius: 2px;
}
.search input {
  width: min(280px, 72vw);
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0 12px 0 32px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
}
.search input:focus { border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06); }
.sort select {
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.slot-fold-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.slot-fold-controls[hidden] { display: none !important; }
.slot-fold-btn {
  appearance: none;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.slot-fold-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.slot-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 2px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.slot-group:hover .slot-group-label {
  border-color: var(--line-strong);
  color: var(--ink);
}
.slot-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.slot-group-chevron {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #64748b;
  transform-origin: 50% 45%;
  transition: transform 0.18s ease;
}
.slot-group.is-collapsed .slot-group-chevron {
  transform: rotate(-90deg);
}
.slot-group-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  line-height: 1.2;
}
.slot-group-count,
.slot-group-bids {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}
.slot-group-bids {
  color: #64748b;
}
.empty {
  grid-column: 1 / -1;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px 12px 8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card.is-over { border-color: var(--over-line); }
.card.is-tight { border-color: var(--tight-line); }
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  flex: 1 1 auto;
  min-height: 0;
}
.zh-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.zh {
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.major-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid #d8dee7;
  background: #fff;
  color: #526071;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.major-tag.is-mine { box-shadow: inset 0 0 0 1px #0f172a; }
.tag-code-gr, .tag-code-ge { background: #eef8ef; color: #2f7d32; border-color: #bfe0c2; }
.tag-code-er { background: #fff0ed; color: #b53b19; border-color: #f2c3b8; }
.tag-code-fr { background: #edf6fd; color: #1769aa; border-color: #bddaf1; }
.tag-code-mr { background: #fff5e8; color: #b35f00; border-color: #f1d1a8; }
.tag-code-jr { background: #fff9e8; color: #987100; border-color: #ead89b; }
.tag-code-ee { background: #fff0f3; color: #be3040; border-color: #f0c0c7; }
.tag-code-fe { background: #eef8fd; color: #0275a9; border-color: #b8ddec; }
.tag-code-me { background: #f7eff9; color: #7b1fa2; border-color: #dbc2e3; }
.tag-code-je { background: #fff9e8; color: #926b00; border-color: #ead89b; }
.tag-code-ba { background: #f1eefb; color: #5b44a0; border-color: #d0c8ec; }
.tag-code-phd { background: #f0f3f5; color: #51606c; border-color: #cfd7dc; }
.tag-code-intl { background: #ebf8f8; color: #087f78; border-color: #bfe3e1; }
.tag-code-ug { background: #f4f0ee; color: #6d4c41; border-color: #d8cbc6; }
.tag-code-other { background: #f8fafc; color: #526071; border-color: #d8dee7; }
.seg-btn.has-dot { display: inline-flex; align-items: center; gap: 6px; }
.scope-dot { width: 8px; height: 8px; border-radius: 99px; flex: 0 0 auto; }
.scope-dot.tag-code-fe { background: #0288d1; border: 0; }
.scope-dot.tag-code-ee { background: #e53935; border: 0; }
.scope-dot.tag-code-me { background: #8e24aa; border: 0; }
.scope-dot.tag-code-je { background: #c49000; border: 0; }
.scope-dot.tag-code-phd { background: #546e7a; border: 0; }
.card-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  align-self: stretch;
}
.card-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 0 0 auto;
  min-height: 0;
  margin-top: 6px;
  gap: 7px;
}
.en {
  margin-top: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 18px;
  margin-top: 0;
}
.card .chart {
  margin-top: 2px;
  flex: 0 0 auto;
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill.over { background: var(--over-bg); color: var(--over-text); border-color: var(--over-line); }
.pill.tight { background: var(--tight-bg); color: var(--tight-text); border-color: var(--tight-line); }
.pill.ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }

.stats {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  align-items: flex-end;
  margin: 6px 0 5px;
  flex: 0 0 auto;
}
.stats .num {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stats .num span { color: var(--soft); font-size: 12px; font-weight: 600; margin-left: 4px; }
.remain { font-size: 12.5px; font-weight: 700; }
.remain-end {
  margin-left: auto;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.3;
}
.remain.over,
.remain-end.over { color: var(--over-text); }
.remain.tight,
.remain-end.tight { color: var(--tight-text); }
.remain.ok,
.remain-end.ok { color: var(--ok-text); }

.track {
  height: 6px;
  border-radius: 99px;
  background: #f1f5f9;
  overflow: hidden;
}
.track > i {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.track.is-split { display: flex; }
.track.is-split > i { border-radius: 0; flex: 0 0 auto; }
.track.is-split > i:first-child { border-radius: 99px 0 0 99px; }
.track.is-split > i:last-child { border-radius: 0 99px 99px 0; }
.track.is-split > i:only-child { border-radius: 99px; }
.en + .when { margin-top: 0; color: var(--muted); font-size: 12px; white-space: normal; }
.remain .pct { margin-left: 4px; }
.track > i.over {
  background: repeating-linear-gradient(135deg, #e11d48 0 6px, #fb7185 6px 12px);
}
.track > i.tight { background: var(--tight); }
.track > i.ok { background: var(--ok); }

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.meta-row .occ { font-weight: 700; color: #475569; }
.when {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.when span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.when-sub {
  margin-top: 0;
}
.ico-cal { flex: 0 0 auto; color: #94a3b8; }
.chart { height: 160px; }

.card-side {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: 0 0 auto;
}
.card-pills {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.pill.fail {
  background: var(--over-bg);
  color: var(--over-text);
  border-color: var(--over-line);
}
.name-cell { display: flex; align-items: center; gap: 8px; }
.name-cell b { font-weight: 700; }
.star {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
}
.star:hover { color: #b45309; background: #fffbeb; }
.star.is-on { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.star svg { display: block; }

.split-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 4px;
  width: 100%;
}
.split-total {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-right: 2px;
}
.split-empty { color: var(--soft); font-size: 12px; font-weight: 600; }
.split-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}
.split-chip i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--c, #64748b);
}
.split-chip.is-10 { background: color-mix(in srgb, var(--c) 8%, #fff); border-color: color-mix(in srgb, var(--c) 28%, #fff); }
.split-chip.is-mine { box-shadow: inset 0 0 0 1px #0f172a; }

.market {
  margin-bottom: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 8px 14px 6px;
  min-height: 0;
}
.market-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.market h2,
.market-title { margin: 0; font-size: 16px; letter-spacing: -0.02em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.market-inline-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
}
.market p { margin: 4px 0 0; max-width: none; color: var(--muted); font-size: 12px; line-height: 1.55; }
.market-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mine {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.mine select,
.text-btn {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
}
.mine select { padding: 0 8px; }
.text-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  cursor: pointer;
}
.text-btn[hidden] { display: none; }
.text-btn:hover,
.mine select:hover { border-color: var(--line-strong); }
.text-btn.ghost { color: var(--muted); background: transparent; }
.market-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; margin-bottom: 0; }
.market-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  height: auto;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
}
.market-label,
.market-ratio,
.market-pct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  line-height: 1.2;
}
.market-ratio,
.market-pct { font-variant-numeric: tabular-nums; color: inherit; letter-spacing: 0; }
.market-pct { opacity: 0.78; font-weight: 800; }
.market-tag .na { color: inherit; opacity: 0.62; }
.market-ratio .na { color: var(--soft); font-weight: 700; }
.market-fail {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.market-tag.is-over {
  border-color: #f2c3b8;
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.08);
}
.scope-row { margin: 2px 0 10px; }
.star:focus-visible,
.refresh:focus-visible,
.seg-btn:focus-visible,
.text-btn:focus-visible,
.mine select:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

.table-card {
  margin: 0 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}
.table-head:hover {
  background: #f8fafc;
}
.table-head-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.table-head h2 { margin: 0; font-size: 14px; letter-spacing: -0.02em; }
.table-head p { margin: 0; color: var(--muted); font-size: 12px; }
.collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.table-head:hover .collapse-btn {
  border-color: var(--line-strong);
  color: var(--ink);
}
.collapse-btn .chevron {
  display: block;
  transform-origin: 50% 50%;
  transition: transform 0.22s ease;
}
.table-card.is-collapsed .collapse-btn .chevron {
  transform: rotate(180deg);
}
.table-scroll[hidden] {
  display: none;
}
.sum-name b { font-size: 13px; font-weight: 700; }
.sum-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.sum-num span { color: var(--soft); font-weight: 600; }
.sum-time { color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.sum-empty { color: var(--muted); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 6px;
}
.lg.over { background: var(--over); }
.lg.tight { background: var(--tight); }
.lg.ok { background: var(--ok); }

.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 6px 12px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f8fafc;
}
td .en { margin-top: 2px; }
.cell-bar { display: flex; align-items: center; gap: 8px; min-width: 148px; }
.cell-bar .track { width: 92px; flex: 0 0 92px; }
.neg { color: var(--over-text); font-weight: 700; }
.pos { color: var(--ok-text); font-weight: 700; }

footer {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.foot-meta { display: flex; gap: 14px; }
footer a { color: #0f766e; text-decoration: none; font-weight: 700; }
footer a:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .metrics, .grid { grid-template-columns: 1fr 1fr; }
  .hero { flex-direction: column; align-items: stretch; }
  .live-card { min-width: 0; }
  .market-head { align-items: flex-start; }
}
@media (max-width: 640px) {
  .wrap { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .metrics, .grid { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
  .search input { width: min(100%, 72vw); }
  .table-head { flex-direction: column; align-items: flex-start; }
}
.market-tag.tag-code-fe { background: #eef8fd; color: #0275a9; border-color: #b8ddec; }
.market-tag.tag-code-ee { background: #fff0f3; color: #be3040; border-color: #f0c0c7; }
.market-tag.tag-code-me { background: #f7eff9; color: #7b1fa2; border-color: #dbc2e3; }
.market-tag.tag-code-je { background: #fff9e8; color: #926b00; border-color: #ead89b; }
.market-tag.tag-code-phd { background: #f0f3f5; color: #51606c; border-color: #cfd7dc; }
.market-tag.tag-code-other { background: #f8fafc; color: #526071; border-color: #d8dee7; }
