:root {
  --page-bg: #f4f4f0;
  --surface: #ffffff;
  --surface-soft: #f8f8f5;
  --ink: #171815;
  --muted: #65675f;
  --line: #dcded6;
  --accent: #b42318;
  --focus: #075985;
  --shadow: 0 18px 50px rgb(24 24 18 / 8%);
  color: var(--ink);
  background: var(--page-bg);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--page-bg); color: var(--ink); line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
button, input, dialog { font: inherit; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button { border: 0; cursor: pointer; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { position: relative; z-index: 2; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 92%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(1180px, calc(100% - 32px)); min-height: 72px; margin: 0 auto; }
.site-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.13rem; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--ink); color: white; }
.site-navigation { display: flex; flex-wrap: wrap; gap: 20px; }
.site-navigation a { font-size: .92rem; font-weight: 650; text-decoration: none; }
.site-navigation a:hover { color: var(--accent); }
.connection-status { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .76rem; font-weight: 750; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #d97706; box-shadow: 0 0 0 3px rgb(217 119 6 / 16%); }
.connection-status[data-state="connected"] { color: #067647; }
.connection-status[data-state="connected"] .connection-dot { background: #12b76a; box-shadow: 0 0 0 3px rgb(18 183 106 / 15%); }
.connection-status[data-state="disconnected"] { color: #b42318; }
.connection-status[data-state="disconnected"] .connection-dot { background: #d92d20; box-shadow: 0 0 0 3px rgb(217 45 32 / 15%); }

.degraded-banner { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 10px 20px; border-bottom: 1px solid #e7b55b; background: #fff4d6; color: #713f12; font-size: .88rem; }
.degraded-times { color: #854d0e; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: .72rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.15; }
.section-heading > a { color: var(--muted); font-size: .88rem; font-weight: 700; }

.draw-card { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.draw-card.is-delayed { border-color: #e7b55b; }
.draw-card-header { display: flex; justify-content: space-between; gap: 16px; }
.draw-card-header h2 { margin: 0; font-size: 1.18rem; }
.draw-issue { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.draw-numbers { display: flex; flex-wrap: wrap; gap: 9px; margin: 20px 0; }
.ball { display: grid; min-width: 46px; min-height: 46px; place-items: center; border: 2px solid currentColor; border-radius: 50%; background: white; line-height: 1; }
.ball b { font-size: 1rem; }
.ball small { margin-top: 3px; font-size: .58rem; }
.ball-red { color: #b42318; background: #fff1f0; }
.ball-blue { color: #175cd3; background: #eff8ff; }
.ball-green { color: #067647; background: #ecfdf3; }
.draw-pending, .empty-state { color: var(--muted); }
.draw-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; font-size: .82rem; }
.draw-meta div { padding: 9px 10px; border-radius: 9px; background: var(--surface-soft); }
.draw-meta dt { color: var(--muted); }
.draw-meta dd { margin: 0; font-weight: 700; }
.draw-status { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: .72rem; }
.draw-status-label { font-weight: 750; }
.draw-status-flag { padding: 3px 7px; border-radius: 999px; font-weight: 800; }
.draw-status-flag.fallback { background: #fff4d6; color: #854d0e; }
.draw-status-flag.delayed { background: #fff1f0; color: #b42318; }
.draw-last-update { margin-left: auto; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.draw-action { margin-top: 16px; padding: 9px 13px; border-radius: 999px; background: var(--ink); color: white; font-weight: 700; }

.home-banner { overflow: hidden; margin-block: 38px; border-radius: 18px; background: #ecece5; }
.home-banner img { width: 100%; max-height: 338px; object-fit: cover; }
.articles-section, .documents-section { margin-block: 64px; }
.article-list, .document-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.article-item, .document-item { padding: 22px; border-top: 3px solid var(--ink); background: var(--surface); }
.article-item h3, .document-item h3 { margin: 0 0 12px; line-height: 1.35; }
.article-item a, .document-item a { text-decoration: none; }
.article-body, .document-body, .cover-deck { color: var(--muted); }
.article-body > :first-child, .document-body > :first-child, .cover-deck > :first-child { margin-top: 0; }
.article-body > :last-child, .document-body > :last-child, .cover-deck > :last-child { margin-bottom: 0; }
.article-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; }

.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 30px; margin-top: 72px; padding: 30px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.home-modal { width: min(620px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgb(0 0 0 / 25%); }
.home-modal::backdrop { background: rgb(10 10 8 / 60%); }
.modal-panel { padding: 28px; }
.modal-panel button { padding: 9px 14px; border-radius: 8px; background: var(--ink); color: white; }

.status-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #f6f5ef; }
.status-panel { width: min(620px, 100%); padding: clamp(28px, 8vw, 64px); border: 1px solid var(--line); background: white; text-align: center; box-shadow: var(--shadow); }
.status-code { margin: 0; color: var(--accent); font: 900 clamp(4rem, 18vw, 9rem)/.9 ui-monospace, monospace; }
.status-panel h1 { margin: 24px 0 8px; }
.status-home { display: inline-block; margin-top: 16px; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: white; text-decoration: none; }
.status-panel nav, .backup-domains { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.backup-domains h2 { width: 100%; font-size: 1rem; }

@media (max-width: 680px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding-block: 14px; }
  .connection-status { margin-left: 0; }
  .site-navigation { gap: 10px 16px; }
  .degraded-banner { justify-content: flex-start; }
  .article-list, .document-list { grid-template-columns: 1fr; }
  .draw-card { padding: 18px; border-radius: 13px; }
  .home-banner { margin-block: 26px; border-radius: 12px; }
  .articles-section, .documents-section { margin-block: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
