:root {
  color-scheme: dark;
  --background: #0c1015;
  --panel: #141b23;
  --border: #2c3744;
  --ink: #f3f6f8;
  --muted: #a5b1bd;
  --faint: #8292a2;
  --accent: #b8f675;
  --attention: #ffdb9b;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--background);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p, ul { margin: 0; }

.shell { max-width: 1160px; padding: 0 clamp(18px, 5vw, 48px); margin: auto; }
.topbar, .wordmark, .symbol {
  display: flex;
  align-items: center;
}
.topbar {
  min-height: 86px;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.wordmark { gap: 10px; font-weight: 720; }
.mark {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 3px 3px;
  width: 22px;
  height: 22px;
  border-bottom: 1px solid var(--accent);
}
.mark i { width: 3px; background: var(--accent); }
.mark i:nth-child(1) { height: 6px; }
.mark i:nth-child(2) { height: 11px; }
.mark i:nth-child(3) { height: 16px; }
.symbol {
  flex: none;
  padding: 7px 12px;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
}
.symbol strong, .zone { font-family: var(--mono); }
.symbol strong { color: var(--ink); }
.symbol:hover { border-color: var(--accent); }

main { padding-top: 26px; }
.market {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(245px, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-top-color: #688b52;
  border-radius: 18px;
  background: var(--panel);
}
.primary {
  padding: clamp(22px, 4vw, 42px);
  background: radial-gradient(ellipse at 4% 100%, #213028 0, #171e25 58%, #171e25 100%);
}
.market-heading, .date-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 14px;
}
.market-heading { justify-content: space-between; }
h1 { font-size: clamp(1.125rem, 2.4vw, 1.625rem); font-weight: 700; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 30px;
  color: var(--attention);
  background: #352d22;
  font-size: .875rem;
  font-weight: 650;
}
.status[data-state="open"] { color: var(--accent); background: #293a25; }
.status[data-state="unknown"] { color: var(--muted); background: #26313b; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.time-label { margin-top: clamp(24px, 4vw, 50px); }
.time-label, .section-label { color: var(--muted); font-size: .9375rem; }
.zone {
  font-size: .8125rem;
  color: var(--muted);
  padding: 2px 6px;
  margin-left: 5px;
  border: 1px solid #42515c;
  border-radius: 4px;
}
.digits {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.eastern-clock {
  display: block;
  margin: 5px 0 12px;
  font-size: clamp(2.4rem, 7.6vw, 6.125rem);
  line-height: 1.16;
  font-weight: 650;
  letter-spacing: -.076em;
}
.date-line { color: var(--muted); font-size: .9375rem; min-height: 25px; }
#season:not(:empty)::before { content: "·"; margin-right: 14px; color: var(--faint); }

.side {
  border-left: 1px solid var(--border);
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.next-event { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.countdown {
  margin: 4px 0;
  color: var(--accent);
  font-weight: 650;
  letter-spacing: -.045em;
  font-size: clamp(1.35rem, 3vw, 2.125rem);
}
.hong-kong { padding-top: 18px; }
.hk-clock { display: block; font-size: 1.75rem; margin-top: 4px; }
.moment { display: block; font-size: .875rem; }
.muted { color: var(--muted); }

.panel {
  margin-top: 16px;
  padding: clamp(20px, 3.6vw, 30px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
h2 { font-size: 1.0625rem; font-weight: 700; }
.flag {
  color: var(--attention);
  font-size: .875rem;
}
.session-et {
  font-size: clamp(1.17rem, 4vw, 1.75rem);
  letter-spacing: -.035em;
  font-weight: 650;
  margin-top: 9px;
}
.session-hk { color: var(--muted); font-size: .9375rem; min-height: 23px; }

.timeline { margin: 24px 0 10px; }
.track {
  height: 8px;
  position: relative;
  border-radius: 6px;
  background: #303c47;
}
#session-window {
  position: absolute;
  left: var(--start);
  width: var(--width);
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
}
#time-marker {
  position: absolute;
  top: -3px;
  left: var(--position, 0%);
  transform: translateX(-50%);
  width: 5px;
  height: 14px;
  background: var(--ink);
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--panel);
}
.scale {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 8px 0 0;
  color: var(--faint);
  font: .8125rem var(--mono);
}
.fine { font-size: .875rem; }
.upcoming ul { margin-top: 12px; padding: 0; list-style: none; }
.upcoming li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: .9375rem;
}
.upcoming time { color: var(--muted); min-width: 7em; }
.upcoming li span { flex: 1; }
.upcoming li strong { font-size: .875rem; color: var(--attention); font-weight: 600; }

footer {
  margin: 22px 0 32px;
  color: var(--faint);
  font-size: .8125rem;
}
footer p { margin: 7px 0; }
.source-links { display: flex; flex-wrap: wrap; gap: 3px 16px; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  .market { grid-template-columns: minmax(0, 1fr); }
  .eastern-clock { font-size: clamp(2.4rem, 11vw, 5rem); }
  .side {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .next-event { padding: 0; border: 0; }
  .hong-kong { padding: 0 0 0 14px; border-left: 1px solid var(--border); }
}

@media (max-width: 430px) {
  .topbar { min-height: 62px; }
  .symbol span { display: none; }
  main { padding-top: 16px; }
  .primary { padding: 20px; }
  .eastern-clock { font-size: clamp(2.25rem, 13vw, 4.5rem); }
  .side { grid-template-columns: 1fr; gap: 10px; padding: 16px 20px; }
  .hong-kong { border-left: 0; border-top: 1px solid var(--border); padding: 10px 0 0; }
}
