:root {
  --navy-950: #041324;
  --navy-900: #071b33;
  --navy-800: #0b2948;
  --blue: #155da1;
  --sky: #71b8e8;
  --gold: #c9a96e;
  --cream: #f3eee4;
  --ink: #102138;
  --muted: #6e7b89;
  --white: #fff;
  --line: rgba(255, 255, 255, .15);
  --shadow: 0 30px 80px rgba(2, 15, 31, .25);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy-950); }
body { margin: 0; min-height: 100vh; font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--white); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.draw-page {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(7, 27, 51, .98) 0%, rgba(6, 29, 54, .95) 50%, rgba(7, 38, 67, .92) 100%),
    radial-gradient(circle at 76% 14%, rgba(21, 93, 161, .45), transparent 42%);
}
.draw-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .23;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
}
.ambient { position: fixed; border: 1px solid rgba(113,184,232,.16); border-radius: 50%; pointer-events: none; }
.ambient-one { width: 52vw; height: 52vw; right: -19vw; top: -22vw; box-shadow: 0 0 120px rgba(58,135,193,.08) inset; }
.ambient-two { width: 34vw; height: 34vw; left: -21vw; bottom: -24vw; }

.site-header, .site-footer { position: relative; z-index: 2; width: min(1280px, calc(100% - 64px)); margin: 0 auto; }
.site-header { height: 112px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand-mark { width: 42px; height: 42px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; align-items: end; transform: skewX(-12deg); }
.brand-mark i { display: block; background: var(--gold); }
.brand-mark i:nth-child(1) { height: 50%; }
.brand-mark i:nth-child(2) { height: 76%; }
.brand-mark i:nth-child(3) { height: 100%; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-family: Georgia, "Songti SC", serif; font-size: 19px; letter-spacing: .16em; }
.brand-copy small { font-size: 8px; color: rgba(255,255,255,.58); letter-spacing: .22em; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.language-button, .admin-link { height: 38px; min-width: 48px; padding: 0 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: transparent; color: rgba(255,255,255,.78); cursor: pointer; font-size: 12px; letter-spacing: .08em; display: inline-flex; align-items: center; justify-content: center; transition: .25s ease; }
.language-button:hover, .admin-link:hover { color: #fff; border-color: rgba(201,169,110,.65); background: rgba(255,255,255,.04); }

.draw-shell { position: relative; z-index: 1; width: min(1280px, calc(100% - 64px)); min-height: calc(100vh - 196px); margin: 0 auto; display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(60px, 8vw, 132px); align-items: center; padding: 64px 0 78px; }
.hero-copy { max-width: 620px; }
.eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; color: var(--gold); font-size: 11px; letter-spacing: .28em; }
.eyebrow span { width: 46px; height: 1px; background: var(--gold); }
.hero-copy h1 { margin: 0; font-family: Georgia, "Songti SC", "STSong", serif; font-weight: 400; font-size: clamp(54px, 6vw, 94px); line-height: 1.04; letter-spacing: -.035em; }
.hero-copy h1 span, .hero-copy h1 em { display: block; }
.hero-copy h1 em { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.72); font-style: normal; margin-left: .65em; }
.hero-copy > p { max-width: 470px; margin: 34px 0 46px; color: rgba(255,255,255,.62); font-size: 15px; line-height: 1.9; letter-spacing: .06em; }
.event-meta { display: flex; gap: 54px; }
.event-meta > div { display: flex; flex-direction: column; gap: 8px; }
.event-meta small { color: rgba(255,255,255,.38); font-size: 9px; letter-spacing: .24em; }
.event-meta strong { color: rgba(255,255,255,.85); font-size: 12px; letter-spacing: .15em; font-weight: 500; }

.draw-card { position: relative; background: rgba(248, 246, 240, .98); color: var(--ink); padding: clamp(38px, 4.5vw, 62px); box-shadow: var(--shadow); overflow: hidden; }
.draw-card::after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid rgba(21,93,161,.08); border-radius: 50%; right: -96px; bottom: -94px; }
.card-index { position: absolute; right: 28px; top: 16px; font-family: Georgia, serif; font-size: 72px; color: rgba(7,27,51,.045); line-height: 1; }
.mini-label { color: var(--blue); font-size: 9px; letter-spacing: .23em; font-weight: 700; }
.card-heading h2 { margin: 16px 0 10px; font-family: Georgia, "Songti SC", serif; font-size: clamp(28px, 2.5vw, 38px); font-weight: 500; letter-spacing: .02em; }
.card-heading p { margin: 0 0 38px; color: var(--muted); font-size: 13px; }
#draw-form label { display: block; color: #34445a; font-size: 11px; letter-spacing: .08em; margin-bottom: 10px; }
.input-wrap { height: 62px; display: flex; align-items: center; border-bottom: 1px solid #a8afb7; transition: border-color .2s ease; }
.input-wrap:focus-within { border-color: var(--blue); }
.input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; }
.input-wrap input::placeholder { color: #a1a9b0; }
.input-wrap span { font-size: 24px; color: var(--gold); transform: rotate(45deg); }
.form-message { min-height: 22px; margin: 9px 0 6px; color: #a43d3d; font-size: 12px; }
.primary-button { width: 100%; height: 62px; border: 0; background: var(--navy-900); color: #fff; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; font-size: 13px; letter-spacing: .15em; transition: background .25s ease, transform .2s ease; }
.primary-button:hover { background: var(--blue); }
.primary-button:active { transform: scale(.99); }
.primary-button:disabled { cursor: wait; opacity: .68; }
.primary-button i { font-style: normal; color: var(--gold); font-size: 20px; }
.privacy-note { display: flex; align-items: center; gap: 8px; color: #929ba4; font-size: 10px; margin-top: 22px; }
.privacy-note span { color: var(--gold); font-size: 7px; }
.privacy-note p { margin: 0; }

.site-footer { height: 84px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.34); font-size: 8px; letter-spacing: .18em; }

.result-layer { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; background: var(--navy-900); visibility: hidden; opacity: 0; transition: opacity .5s ease, visibility .5s; overflow: hidden; }
.result-layer.is-open { visibility: visible; opacity: 1; }
.result-layer::before, .result-layer::after { content: ""; position: absolute; border: 1px solid rgba(201,169,110,.18); border-radius: 50%; }
.result-layer::before { width: min(72vw, 860px); height: min(72vw, 860px); }
.result-layer::after { width: min(52vw, 620px); height: min(52vw, 620px); }
.result-noise { position: absolute; inset: 0; background: radial-gradient(circle, rgba(21,93,161,.42), transparent 56%); }
.result-close { position: absolute; z-index: 2; right: 34px; top: 28px; border: 1px solid rgba(255,255,255,.2); width: 44px; height: 44px; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; font-size: 24px; }
.result-content { z-index: 1; width: min(680px, calc(100% - 44px)); text-align: center; }
.result-kicker { color: var(--gold); font-size: 10px; letter-spacing: .35em; }
.result-greeting { margin: 28px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; color: rgba(255,255,255,.82); }
.number-stage { position: relative; height: clamp(190px, 30vw, 320px); display: grid; place-items: center; }
.number-stage strong { position: relative; z-index: 2; font-family: Georgia, serif; font-size: clamp(130px, 25vw, 260px); line-height: 1; font-weight: 400; color: #fff; text-shadow: 0 10px 40px rgba(0,0,0,.28); }
.number-ghost { position: absolute; z-index: 1; font-family: Georgia, serif; font-size: clamp(160px, 29vw, 310px); color: transparent; -webkit-text-stroke: 1px rgba(113,184,232,.15); transform: translate(16px, -7px); }
.result-note { min-height: 28px; margin: 4px 0 24px; color: rgba(255,255,255,.55); font-size: 13px; }
.result-divider { width: 54px; height: 1px; background: var(--gold); margin: 0 auto 24px; }
.result-footer { display: flex; justify-content: center; gap: 28px; color: rgba(255,255,255,.33); font-size: 8px; letter-spacing: .18em; }

/* Admin */
.admin-page { min-height: 100vh; background: #f1f3f5; color: var(--ink); }
.admin-page .site-header { width: 100%; height: 88px; padding: 0 clamp(24px, 5vw, 72px); background: var(--navy-900); border: 0; }
.admin-page .back-link { color: rgba(255,255,255,.7); font-size: 12px; }
.admin-main { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 72px; }
.admin-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 34px; }
.admin-title-row small { color: var(--blue); font-weight: 700; letter-spacing: .2em; font-size: 9px; }
.admin-title-row h1 { margin: 10px 0 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(34px, 4vw, 54px); font-weight: 500; }
.admin-status { color: var(--muted); font-size: 12px; }
.admin-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #36a06f; margin-right: 8px; }
.login-panel { max-width: 520px; margin: 8vh auto; padding: 42px; background: #fff; box-shadow: 0 14px 40px rgba(12,31,51,.08); }
.login-panel h2 { margin: 0 0 10px; font-family: Georgia, "Songti SC", serif; font-size: 30px; }
.login-panel p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-panel input { width: 100%; height: 54px; border: 1px solid #cbd1d7; padding: 0 16px; outline: none; margin: 12px 0; }
.login-panel input:focus { border-color: var(--blue); }
.login-panel button { width: 100%; height: 54px; border: 0; background: var(--navy-900); color: #fff; cursor: pointer; }
.login-error { color: #a43d3d !important; min-height: 20px; }
.dashboard[hidden], .login-panel[hidden] { display: none; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric-card { min-height: 142px; padding: 26px; background: #fff; border-top: 3px solid transparent; }
.metric-card.primary { background: var(--navy-900); color: #fff; border-color: var(--gold); }
.metric-card small { display: block; color: #7b8793; font-size: 10px; letter-spacing: .16em; margin-bottom: 18px; }
.metric-card.primary small { color: rgba(255,255,255,.5); }
.metric-card strong { font-family: Georgia, serif; font-size: 43px; font-weight: 400; }
.metric-card .suffix { font-size: 12px; margin-left: 5px; color: #8a949e; }
.table-panel { background: #fff; }
.table-toolbar { min-height: 82px; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e6e9ec; }
.table-toolbar h2 { font-family: Georgia, "Songti SC", serif; font-weight: 500; margin: 0; font-size: 22px; }
.toolbar-actions { display: flex; gap: 10px; }
.toolbar-actions input { height: 40px; width: 210px; border: 1px solid #d8dde2; padding: 0 13px; outline: 0; }
.toolbar-actions button { height: 40px; border: 1px solid var(--navy-900); background: #fff; color: var(--navy-900); padding: 0 16px; cursor: pointer; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.data-table th { text-align: left; padding: 16px 24px; color: #8a949e; background: #f8f9fa; font-size: 9px; letter-spacing: .16em; font-weight: 600; }
.data-table td { padding: 18px 24px; border-top: 1px solid #edf0f2; font-size: 13px; }
.data-table td:nth-child(2) { font-weight: 600; }
.number-pill { display: inline-flex; min-width: 58px; height: 30px; align-items: center; justify-content: center; background: #edf4fa; color: var(--blue); font-family: Georgia, serif; font-size: 16px; }
.empty-state { padding: 56px 24px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .draw-shell { grid-template-columns: 1fr; gap: 48px; padding-top: 54px; }
  .hero-copy { text-align: center; margin: 0 auto; }
  .eyebrow, .event-meta { justify-content: center; }
  .hero-copy h1 em { margin-left: 0; }
  .hero-copy > p { margin-left: auto; margin-right: auto; }
  .draw-card { width: min(560px, 100%); margin: 0 auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .site-header, .site-footer, .draw-shell { width: calc(100% - 36px); }
  .site-header { height: 82px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { font-size: 6px; }
  .admin-link { display: none; }
  .draw-shell { padding: 42px 0 54px; gap: 40px; }
  .eyebrow { margin-bottom: 24px; font-size: 9px; }
  .hero-copy h1 { font-size: clamp(48px, 15vw, 66px); }
  .hero-copy > p { margin: 25px 0 30px; font-size: 13px; }
  .event-meta { gap: 32px; }
  .draw-card { padding: 36px 26px 30px; }
  .card-index { font-size: 58px; }
  .site-footer { height: 72px; justify-content: center; text-align: center; }
  .site-footer span:last-child { display: none; }
  .result-close { right: 18px; top: 18px; }
  .result-layer::before { width: 125vw; height: 125vw; }
  .result-layer::after { width: 92vw; height: 92vw; }
  .result-footer { flex-direction: column; gap: 8px; }
  .admin-main { width: calc(100% - 28px); padding-top: 34px; }
  .admin-title-row { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 118px; padding: 20px; }
  .metric-card strong { font-size: 34px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions input { min-width: 0; flex: 1; }
  .login-panel { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
