:root {
  --bg: #07111f;
  --bg-deep: #040b15;
  --panel: rgba(16, 32, 55, 0.84);
  --panel-solid: #102037;
  --panel-soft: #142844;
  --line: rgba(114, 203, 255, 0.18);
  --line-strong: rgba(92, 205, 255, 0.58);
  --text: #f6f9ff;
  --muted: #9db0c8;
  --cyan: #42c7ee;
  --cyan-strong: #22a8d3;
  --orange: #ff7048;
  --orange-soft: #ff8b65;
  --success: #43d39e;
  --warning: #ffc75a;
  --danger: #ff6178;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 15px;
  --shell: 1380px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgba(41, 126, 185, 0.16), transparent 28%),
    radial-gradient(circle at 86% 26%, rgba(255, 112, 72, 0.09), transparent 22%),
    linear-gradient(180deg, #081426 0%, var(--bg) 50%, var(--bg-deep) 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
  opacity: .22;
}
.ambient-one { width: 420px; height: 420px; top: 180px; left: -220px; background: #138ac4; }
.ambient-two { width: 360px; height: 360px; right: -190px; top: 760px; background: #a0442e; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 13, 25, 0.78);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}
.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}
.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  grid-template-columns: repeat(3, 6px);
  gap: 4px;
  border: 1px solid rgba(90,207,255,.35);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(67,196,237,.18), rgba(255,112,72,.08));
  box-shadow: inset 0 0 24px rgba(62,190,235,.08);
}
.brand-mark i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(66,199,238,.7); }
.brand-mark i:nth-child(2) { background: #f6f9ff; }
.brand-mark i:nth-child(3) { background: var(--orange); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 17px; letter-spacing: .08em; }
.brand-text small { margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .25em; }
.live-status, .sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #bfd0e4;
  font-size: 13px;
}
.status-dot, .sync-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(255,199,90,.09);
}
.live-status.online .status-dot, .sync-badge.online span {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(67,211,158,.09), 0 0 13px rgba(67,211,158,.45);
}
.live-status.offline .status-dot { background: var(--danger); }

.hero {
  padding-block: 72px 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: stretch;
}
.hero-panel, .stats-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18,37,63,.94), rgba(9,22,40,.9));
  box-shadow: var(--shadow);
}
.hero-panel {
  min-height: 500px;
  padding: 58px 60px;
  border-radius: var(--radius-lg);
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto -120px -190px auto;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66,199,238,.18), transparent 66%);
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 2px;
  top: 0;
  left: 56px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px rgba(66,199,238,.48);
}
.hero-kicker, .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #7cddfb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}
.hero-kicker span { width: 28px; height: 1px; background: var(--orange); }
.hero h1 {
  max-width: 780px;
  margin: 22px 0 12px;
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.14;
  letter-spacing: -.04em;
}
.hero-subtitle { margin: 0; max-width: 760px; color: #dae7f5; font-size: clamp(18px, 2vw, 23px); font-weight: 600; }
.hero-description { max-width: 760px; min-height: 30px; margin: 18px 0 30px; color: var(--muted); font-size: 15px; }
.event-meta {
  display: grid;
  grid-template-columns: 1.15fr .7fr 1fr;
  gap: 12px;
  max-width: 870px;
}
.meta-item {
  min-height: 88px;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background: rgba(4,14,28,.34);
}
.meta-item small { display: block; color: #7f96b1; font-size: 11px; letter-spacing: .1em; margin-bottom: 6px; }
.meta-item strong { display: block; color: #f2f7fd; font-size: 14px; line-height: 1.45; }
.countdown-wrap strong { color: var(--orange-soft); font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.button {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 0 24px;
  color: #fff;
  font-weight: 750;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--orange), #ff5c3a); box-shadow: 0 14px 30px rgba(255,96,58,.22); }
.button-primary:hover { box-shadow: 0 18px 38px rgba(255,96,58,.32); }
.button-ghost { background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.14); }
.button-ghost:hover { border-color: rgba(91,207,255,.52); }
.button-cyan { background: linear-gradient(135deg, #2aaed5, #2087b2); box-shadow: 0 12px 28px rgba(34,168,211,.18); }

.stats-panel {
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stats-panel::before {
  content: "";
  position: absolute;
  inset: -80px -100px auto auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255,112,72,.1);
  filter: blur(8px);
}
.stats-label { display: inline-flex; align-items: center; gap: 10px; color: #bcd1e6; font-size: 13px; }
.pulse-ring { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 6px rgba(67,211,158,.08); }
.main-stat { padding: 30px 0 24px; border-bottom: 1px solid rgba(255,255,255,.07); }
.main-stat strong { display: block; font-size: clamp(52px, 6vw, 76px); line-height: 1; color: var(--orange-soft); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.main-stat span { display: block; margin-top: 12px; color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.mini-stats div { padding: 18px 14px; border-radius: 16px; background: rgba(5,16,31,.42); border: 1px solid rgba(255,255,255,.06); }
.mini-stats strong { display: block; font-size: 20px; color: #eef7ff; }
.mini-stats span { color: #7f96b1; font-size: 12px; }
.stats-note { margin: 18px 0 0; color: #6f879f; font-size: 12px; }

.candidates-section { padding-block: 38px 90px; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section-heading h2 { margin: 6px 0 6px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; }
.section-heading p { margin: 0; color: var(--muted); max-width: 720px; }
.sync-badge { padding: 10px 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(255,255,255,.03); white-space: nowrap; }

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.candidate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(97,200,244,.18);
  border-radius: 25px;
  background: linear-gradient(180deg, rgba(20,41,69,.95), rgba(12,27,48,.96));
  box-shadow: 0 22px 54px rgba(0,0,0,.28);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.candidate-card:hover {
  transform: translateY(-7px);
  border-color: rgba(84,202,247,.48);
  box-shadow: 0 30px 70px rgba(0,0,0,.36), 0 0 0 1px rgba(53,185,234,.08);
}
.candidate-card.voted-for { border-color: rgba(67,211,158,.65); box-shadow: 0 0 0 1px rgba(67,211,158,.12), 0 26px 62px rgba(0,0,0,.34); }
.card-image-wrap {
  position: relative;
  margin: 14px 14px 0;
  aspect-ratio: 4 / 4.7;
  overflow: hidden;
  border-radius: 19px;
  background: linear-gradient(145deg, #edf2f7, #b9c8d5);
}
.card-image-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(transparent, rgba(6,18,33,.7));
  pointer-events: none;
}
.candidate-photo { width: 100%; height: 100%; display: block; object-fit: cover; }
.placeholder-photo {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #15314d; font-size: 58px; font-weight: 900;
  background:
    radial-gradient(circle at 50% 36%, rgba(255,255,255,.75), transparent 26%),
    linear-gradient(145deg, #f4f8fb, #9fb7c9);
}
.rank-chip {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  background: rgba(7,17,31,.74);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  letter-spacing: .035em;
}
.rank-chip.rank-top-1 {
  color: #2d2100;
  background: linear-gradient(135deg, #fff0a6 0%, #f4c950 48%, #bf8418 100%);
  border-color: rgba(255,238,150,.88);
  box-shadow: 0 8px 22px rgba(214,157,32,.32), inset 0 1px 0 rgba(255,255,255,.72);
}
.rank-chip.rank-top-2 {
  color: #22303d;
  background: linear-gradient(135deg, #f8fbff 0%, #cbd5df 50%, #8998a8 100%);
  border-color: rgba(245,250,255,.82);
  box-shadow: 0 8px 22px rgba(174,190,207,.22), inset 0 1px 0 rgba(255,255,255,.82);
}
.rank-chip.rank-top-3 {
  color: #fff7ef;
  background: linear-gradient(135deg, #d99a68 0%, #a95f32 52%, #713719 100%);
  border-color: rgba(255,193,143,.52);
  box-shadow: 0 8px 22px rgba(160,83,38,.26), inset 0 1px 0 rgba(255,255,255,.24);
}
.rank-chip.rank-standard {
  color: #dbe8f5;
  background: rgba(7,17,31,.78);
}
.candidate-card:has(.rank-top-1) { border-color: rgba(232,187,64,.52); box-shadow: 0 24px 64px rgba(0,0,0,.31), 0 0 0 1px rgba(232,187,64,.08); }
.candidate-card:has(.rank-top-2) { border-color: rgba(185,202,219,.38); }
.candidate-card:has(.rank-top-3) { border-color: rgba(193,112,64,.38); }
.card-content { padding: 20px 20px 21px; display: flex; flex: 1; flex-direction: column; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-heading h3 { margin: 0; font-size: 21px; line-height: 1.25; }
.card-heading p { margin: 6px 0 0; color: #8ca3bc; font-size: 13px; min-height: 21px; }
.vote-number { text-align: right; flex: 0 0 auto; }
.vote-number strong { display: block; color: var(--orange-soft); font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.vote-number span { color: #7189a2; font-size: 10px; }
.card-summary {
  margin: 16px 0 18px;
  min-height: 44px;
  color: #aebfd1;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: auto; }
.card-actions .button { min-width: 0; min-height: 44px; padding: 0 12px; font-size: 14px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-complete-label {
  position: absolute;
  z-index: 3;
  right: 12px;
  top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #dffbf1;
  background: rgba(28,125,92,.78);
  border: 1px solid rgba(108,242,193,.24);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.empty-state {
  padding: 80px 24px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.13);
  border-radius: 24px;
  background: rgba(255,255,255,.025);
}
.empty-icon { font-size: 44px; color: var(--cyan); }
.empty-state h3 { margin: 8px 0 2px; }
.empty-state p { margin: 0; color: var(--muted); }

.site-footer { border-top: 1px solid rgba(255,255,255,.06); background: rgba(3,10,19,.58); }
.footer-inner { min-height: 90px; display: flex; justify-content: center; align-items: center; gap: 20px; color: #7188a1; font-size: 13px; text-align: center; }
.footer-inner a { text-decoration: none; color: #829ab4; }
.footer-inner a:hover { color: var(--cyan); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1,7,15,.78);
  backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  width: min(100%, 560px);
  max-height: min(84vh, 760px);
  overflow-y: auto;
  color: #193049;
  border-radius: 26px;
  background: #f8fbfd;
  border: 2px solid rgba(72,190,230,.7);
  box-shadow: 0 32px 100px rgba(0,0,0,.55), 0 0 42px rgba(55,186,232,.18);
  padding: 36px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #60768b;
  background: rgba(13,57,86,.07);
  font-size: 25px;
}
.modal-profile { text-align: center; }
.modal-avatar {
  width: 138px;
  height: 138px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #edf5f9, #acc0cf);
  border: 7px solid #fff;
  box-shadow: 0 12px 28px rgba(19,73,104,.18);
}
.modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.modal-avatar span { font-size: 42px; font-weight: 900; color: #1e4a67; }
.modal-profile h2, .rules-content h2 { margin: 0; color: #18324a; font-size: 28px; }
.modal-role { margin: 5px 0 18px; color: #6a7e90; }
.modal-bio { text-align: left; white-space: pre-line; color: #42586c; line-height: 1.85; }
.modal-votes { margin: 22px auto 0; padding: 14px 18px; border-radius: 14px; background: #edf6fa; color: #3e5d72; }
.modal-votes strong { color: #ff6c43; font-size: 21px; }
.rules-content h2 { margin-bottom: 18px; }
.rules-text { white-space: pre-line; color: #3f5569; line-height: 1.9; }

.toast-region { position: fixed; z-index: 120; top: 92px; right: 22px; display: grid; gap: 10px; width: min(380px, calc(100% - 44px)); }
.toast {
  padding: 15px 17px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  color: #fff;
  background: rgba(17,34,55,.96);
  box-shadow: 0 18px 50px rgba(0,0,0,.36);
  animation: toast-in .25s ease both;
}
.toast.success { border-color: rgba(67,211,158,.35); }
.toast.error { border-color: rgba(255,97,120,.42); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes vote-pop { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }
.vote-number strong.changed { animation: vote-pop .42s ease; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .stats-panel { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 18px; align-items: center; }
  .main-stat { padding: 4px 20px; border-bottom: 0; border-left: 1px solid rgba(255,255,255,.07); border-right: 1px solid rgba(255,255,255,.07); }
  .mini-stats { margin-top: 0; }
  .stats-note { display: none; }
  .candidate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-panel { padding: 46px 38px; }
  .event-meta { grid-template-columns: 1fr 1fr; }
  .countdown-wrap { grid-column: 1 / -1; }
  .candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-panel { grid-template-columns: 1fr; }
  .main-stat { border: 0; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.07); border-bottom: 1px solid rgba(255,255,255,.07); }
}
@media (max-width: 640px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .header-inner { min-height: 68px; }
  .brand-text small { display: none; }
  .live-status { font-size: 11px; }
  .hero { padding-block: 30px 24px; }
  .hero-panel { min-height: auto; padding: 36px 22px; border-radius: 23px; }
  .hero h1 { font-size: 38px; }
  .hero-subtitle { font-size: 17px; }
  .event-meta { grid-template-columns: 1fr; }
  .countdown-wrap { grid-column: auto; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .stats-panel { border-radius: 23px; padding: 26px 22px; }
  .main-stat strong { font-size: 58px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .candidate-grid { grid-template-columns: 1fr; }
  .card-image-wrap { aspect-ratio: 4 / 4.25; }
  .candidates-section { padding-bottom: 58px; }
  .footer-inner { padding-block: 22px; flex-direction: column; justify-content: center; text-align: center; }
  .modal-card { padding: 34px 22px 26px; border-radius: 22px; }
  .toast-region { top: 76px; right: 14px; width: calc(100% - 28px); }
}
