:root {
  color-scheme: dark;
  --background: #111213;
  --panel: #1b1d1f;
  --line: #343639;
  --text: #f5f3ed;
  --muted: #aaaeb3;
  --yellow: #f9cf38;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Liberation Sans", sans-serif;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.5; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; object-fit: contain; }
h1, h2, p, dl, dd { margin: 0; }
a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 5px; }
::selection { color: #111213; background: var(--yellow); }
.container { width: min(100% - 40px, 920px); margin-inline: auto; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; min-height: 52px; border-radius: 4px; }
.brand img { width: 168px; height: auto; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 4px; color: var(--yellow); font-size: 15px; font-weight: 650; border-bottom: 2px solid var(--yellow); }
main { padding-top: 38px; }
.page-heading { margin-bottom: 28px; }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.2; letter-spacing: -.035em; font-weight: 750; }
.accent { color: var(--yellow); }
.edition-line { margin-top: 12px; color: var(--muted); font-size: 14px; }
.market-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.market-card { display: block; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .16s ease; }
.market-card:hover { border-color: var(--yellow); }
.market-art { min-height: 164px; display: flex; align-items: center; justify-content: center; padding: 24px; }
.badge-hk { width: 112px; height: auto; }
.badge-singapore { width: 242px; height: auto; }
.card-content { padding: 0 24px 24px; }
.card-content h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.02em; font-weight: 750; }
.card-date { margin-top: 6px; color: var(--muted); font-size: 13px; }
.card-action { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 16px; padding: 12px 16px; border-radius: 6px; background: var(--yellow); color: #17160e; font-weight: 750; font-size: 14px; }
.card-action > span { font-size: 22px; line-height: 1; }
.market-card:hover .card-action { background: #ffdd65; }
.update-note { display: flex; align-items: baseline; justify-content: center; gap: 9px; margin-top: 24px; color: var(--muted); font-size: 13px; }
.status-dot { display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.detail-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-top: -14px; margin-bottom: 24px; }
.back-link, .switch-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; font-weight: 600; border-radius: 4px; }
.back-link { color: var(--muted); }
.back-link:hover { color: var(--text); }
.switch-link { color: var(--yellow); }
.switch-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.detail-heading h1 { font-size: clamp(27px, 3.5vw, 34px); }
.detail-art { flex: 0 0 150px; display: flex; justify-content: flex-end; }
.detail-art img { width: 80px; height: auto; }
.detail-art img.badge-singapore { width: 150px; }
.edition-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.main-result { padding: 26px 24px 24px; text-align: center; border-bottom: 1px solid var(--line); }
.main-result h2 { font-size: 14px; font-weight: 600; color: var(--muted); }
.main-number { color: var(--yellow); font-size: clamp(42px, 8vw, 60px); line-height: 1.2; font-weight: 750; letter-spacing: .16em; padding-left: .16em; margin: 9px 0 16px; }
.pattern-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pattern-line strong { display: inline-block; padding: 3px 10px; border: 1px solid #56503b; border-radius: 4px; font-size: 12px; font-weight: 650; color: var(--yellow); }
.pattern-help { margin: 10px auto 0; max-width: 440px; color: var(--muted); font-size: 12px; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 24px; column-gap: 32px; }
.result-row { min-height: 72px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.result-row dt { color: #c4c6c9; font-size: 14px; }
.result-row dd { color: var(--yellow); font-size: 23px; line-height: 1.3; font-weight: 650; letter-spacing: .035em; white-space: nowrap; }
.shio-row dd { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 19px; letter-spacing: 0; }
#shio-symbol { flex: 0 0 30px; color: var(--yellow); }
.shio-note { padding: 17px 24px; color: var(--muted); font-size: 12px; text-align: center; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 38px; padding-block: 22px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-brand { font-weight: 800; color: #74797f; letter-spacing: .08em; }
.noscript { margin-bottom: 24px; padding: 16px; border: 1px solid var(--yellow); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 600px) {
  .container { width: calc(100% - 32px); }
  .header-inner { min-height: 84px; }
  .brand img { width: 144px; }
  main { padding-top: 28px; }
  .page-heading { margin-bottom: 24px; }
  .market-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .market-art { min-height: 122px; padding: 18px 24px; }
  .badge-hk { width: 86px; }
  .badge-singapore { width: 218px; }
  .card-content { padding: 0 20px 20px; }
  .card-content h2 { font-size: 20px; }
  .card-action { margin-top: 18px; }
  .update-note { justify-content: flex-start; font-size: 12px; }
  .detail-nav { margin-top: -8px; margin-bottom: 20px; gap: 0 16px; }
  .detail-heading { gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
  .detail-heading > div:first-child { flex: 1 1 230px; }
  .detail-art { flex: 0 0 auto; justify-content: flex-start; }
  .detail-art img { width: 56px; }
  .detail-art img.badge-singapore { width: 150px; }
  .detail-heading h1 { font-size: 27px; }
  .edition-line { font-size: 13px; }
  .main-result { padding: 22px 16px; }
  .results-grid { grid-template-columns: minmax(0, 1fr); padding-inline: 20px; }
  .result-row { min-height: 62px; padding-block: 14px; }
  .result-row dd { font-size: 22px; }
  .shio-row dd { font-size: 19px; }
  .shio-note { text-align: left; padding: 16px 20px; }
  .site-footer { margin-top: 28px; gap: 16px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-card { transition: none; }
}
