:root {
  color-scheme: light;
  --ink: #163a35;
  --muted: #69817b;
  --paper: #f6f4ec;
  --card: #fffef9;
  --line: #d7dfd5;
  --accent: #e3a36c;
  --accent-light: #f6dfc8;
  --green: #1d5e51;
  --shadow: 0 20px 60px rgba(22, 58, 53, 0.09);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
.hidden { display: none !important; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.site-shell::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%; background: #e7eee7; right: -280px; top: 80px; z-index: 0; pointer-events: none; }
.site-shell::after { content: ""; position: absolute; width: 300px; height: 300px; border: 1px solid #dbe5d9; border-radius: 50%; left: -190px; bottom: 60px; z-index: 0; pointer-events: none; }
.site-header, main, .site-footer { position: relative; z-index: 1; }
.site-header { width: min(1200px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--ink); color: white; border-radius: 13px; font: 700 23px "Songti SC", serif; }
.brand-name { font-size: 20px; font-weight: 850; letter-spacing: 0.16em; }
.brand-dot { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 24px; }
.language-switch { padding: 3px; border: 1px solid var(--line); border-radius: 999px; display: flex; background: #ffffffb8; }
.language-switch button { border: 0; background: transparent; color: var(--muted); min-width: 48px; padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.language-switch button.active { color: white; background: var(--ink); box-shadow: 0 3px 8px #163a3520; }
.text-button { border: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
main { width: min(1200px, calc(100% - 64px)); margin: 0 auto; flex: 1; }
.site-footer { width: min(1200px, calc(100% - 64px)); margin: 0 auto; padding: 24px 0 29px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.login-layout { min-height: min(700px, calc(100vh - 220px)); display: grid; grid-template-columns: 1fr 440px; align-items: center; gap: 9%; padding: 30px 0 85px; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 850; letter-spacing: .19em; color: var(--green); }
.eyebrow-line { width: 28px; height: 2px; background: var(--accent); }
h1, h2, p { margin-top: 0; }
h1 { font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(48px, 6.8vw, 88px); font-weight: 600; letter-spacing: -.055em; line-height: 1.06; margin: 24px 0 26px; max-width: 760px; }
html[lang="zh-Hans"] .hero-copy h1 { font-size: clamp(48px, 5.2vw, 67px); letter-spacing: -.04em; }
.hero-copy p, .page-title p { color: var(--muted); font-size: 17px; line-height: 1.75; max-width: 520px; }
.status-pill { width: fit-content; display: inline-flex; align-items: center; gap: 9px; background: #e8eee6; color: var(--green); padding: 10px 15px; border-radius: 999px; font-size: 12px; font-weight: 800; margin-top: 28px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4a9b69; box-shadow: 0 0 0 4px #4a9b6925; flex: none; }
.login-card { padding: 46px 43px 32px; background: var(--card); border: 1px solid #e4e7dc; border-radius: 28px; box-shadow: var(--shadow); position: relative; }
.login-card::before { content: ""; position: absolute; width: 52px; height: 52px; border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); right: -14px; top: -14px; border-radius: 0 25px 0 0; }
.card-symbol { color: var(--accent); font: 600 52px Georgia, serif; letter-spacing: -.09em; margin-bottom: 37px; }
label { display: block; }
.login-card label, .stack-form label, .inline-form label { font-size: 12px; font-weight: 800; letter-spacing: .05em; }
input[type="text"], input[type="password"], input[type="url"], .stack-form input:not([type="checkbox"]), .stack-form select, .edit-form input, .edit-form select {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink);
  padding: 14px 15px; transition: border .2s, box-shadow .2s;
}
input:focus, select:focus { border-color: var(--green) !important; box-shadow: 0 0 0 3px #1d5e511b; }
.login-card input { margin: 12px 0 23px; height: 62px; font-size: 24px; letter-spacing: .27em; font-weight: 800; text-align: center; }
.login-card input[type="password"] { font-size: 17px; letter-spacing: normal; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 18px; min-height: 51px; border-radius: 12px; border: 1px solid var(--ink); padding: 12px 20px; font-weight: 800; font-size: 14px; transition: transform .15s, box-shadow .15s, background .15s; }
.primary-button { background: var(--ink); color: white; }
.primary-button:hover { background: #285b51; transform: translateY(-1px); box-shadow: 0 9px 20px #163a3525; }
.secondary-button { background: transparent; color: var(--ink); }
.secondary-button:hover { background: #e9eee8; }
.primary-button span { font-size: 19px; font-weight: 400; margin-left: auto; }
.login-card .primary-button { width: 100%; margin-top: 8px; }
.card-foot { display: flex; justify-content: center; gap: 7px; margin-top: 30px; }
.step-dot { width: 6px; height: 6px; background: #d9dfd5; border-radius: 50%; }
.step-dot.active { background: var(--accent); width: 19px; border-radius: 999px; }
.notice { display: none; margin: 16px 0; padding: 14px 18px; border-radius: 12px; background: #fff1df; color: #8d4b26; font-weight: 700; font-size: 14px; }
.notice.visible { display: block; }
.page-title { padding: 65px 0 26px; }
.page-title h1 { font-size: clamp(45px, 5vw, 68px); margin: 20px 0 16px; }
.page-title p { margin-bottom: 0; }
.panel { background: var(--card); border: 1px solid #e2e7dd; border-radius: 23px; padding: 28px 31px; box-shadow: 0 8px 30px #163a3509; margin: 24px 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 15px; }
.panel h2 { font-family: Georgia, "Songti SC", serif; font-size: 25px; letter-spacing: -.025em; margin: 0; }
.panel-description { color: var(--muted); font-size: 14px; line-height: 1.65; margin-bottom: 24px; }
.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.candidate-card { display: flex; align-items: center; gap: 15px; padding: 16px 18px; min-height: 68px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: border-color .15s, background .15s, transform .15s; cursor: pointer; }
.candidate-card:hover { transform: translateY(-1px); border-color: #86aa9f; }
.candidate-card.selected { background: #eaf3ec; border-color: var(--green); }
.candidate-card:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.candidate-card input { position: absolute; opacity: 0; pointer-events: none; }
.candidate-number { font: 600 15px Georgia, serif; color: #9cafaa; width: 24px; flex: none; }
.candidate-name { flex: 1; font-weight: 760; overflow-wrap: anywhere; }
.candidate-check { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #b7c8bf; border-radius: 7px; color: transparent; font-size: 14px; flex: none; }
.selected .candidate-check { background: var(--green); color: white; border-color: var(--green); }
.vote-action { position: sticky; bottom: 14px; margin-top: 25px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fbfbf7f0; border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(12px); color: var(--muted); font-weight: 800; font-size: 13px; }
.vote-action .primary-button { min-width: 220px; }
.results-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.result-row { display: flex; align-items: center; gap: 17px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.result-row strong { flex: 1; overflow-wrap: anywhere; }
.result-rank { color: #9fafaa; font: 600 16px Georgia, serif; }
.result-star { color: var(--accent); }
.winner-card { padding: 35px; background: var(--ink); color: white; border-radius: 18px; display: flex; align-items: center; gap: 22px; font: 600 clamp(30px, 4vw, 51px) Georgia, "Songti SC", serif; }
.winner-crown { color: var(--accent); font-size: 40px; }
.whatsapp-link { display: inline-flex; margin-top: 23px; padding: 13px 18px; background: #e9f5e8; color: #236545; text-decoration: none; border-radius: 10px; font-weight: 800; font-size: 14px; }
.whatsapp-link:hover { background: #d9edd9; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.stat { background: var(--ink); color: white; border-radius: 16px; padding: 19px 22px; min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; }
.stat span { color: #aec9bf; font-size: 12px; font-weight: 700; }
.stat strong { font: 600 35px Georgia, serif; }
.phase-banner { display: flex; align-items: center; gap: 13px; background: #ebf1e9; border-radius: 12px; padding: 16px 18px; margin: 4px 0 20px; }
.phase-panel .action-button { min-width: 260px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.admin-grid .panel { margin-top: 0; }
.stack-form { display: grid; gap: 17px; }
.stack-form label { display: grid; gap: 9px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack-form .check-line { display: flex; align-items: center; gap: 9px; }
.check-line input { accent-color: var(--green); width: 17px; height: 17px; }
.stack-form button { width: fit-content; }
.divider { height: 1px; background: var(--line); margin: 25px 0; }
input[type="file"] { max-width: 100%; color: var(--muted); font-size: 13px; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; min-width: 0; }
.ranking-list { border-top: 1px solid var(--line); }
.ranking-row { display: flex; align-items: center; gap: 14px; padding: 13px 5px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ranking-row input { accent-color: var(--green); width: 17px; height: 17px; flex: none; }
.ranking-row span:not(.rank-index) { flex: 1; }
.ranking-row b { color: var(--green); white-space: nowrap; font-size: 12px; }
.ranking-row.muted { color: #a3afa8; }
.ranking-row.muted b { color: #a3afa8; }
.rank-index { width: 26px; color: #9aacaa; font-family: Georgia, serif; }
.selection-note { font-weight: 850; color: var(--green); }
.roster-panel { background: #fffefb; }
.roster-panel .panel-heading { margin-bottom: 20px; }
.roster-toolbar { display: grid; gap: 17px; padding: 19px; background: #f6f8f3; border: 1px solid #e3e9df; border-radius: 17px; }
.roster-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.roster-summary span { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 9px; font-size: 12px; font-weight: 750; }
.roster-summary b { font-size: 17px; line-height: 1; }
.roster-summary-ready { color: #2d6751; background: #e9f3eb; }
.roster-summary-missing { color: #a93d36; background: #fde9e6; }
.roster-controls { display: flex; align-items: center; gap: 12px; }
.roster-search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; height: 44px; padding: 0 13px; color: #70887d; background: white; border: 1px solid #d8e3d9; border-radius: 11px; }
.roster-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #1d5e511b; }
.roster-search span { font-size: 26px; line-height: 1; }
.roster-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.roster-search input:focus { box-shadow: none !important; }
.roster-search input::placeholder { color: #84968d; }
.roster-filters { display: inline-flex; gap: 4px; padding: 4px; background: #e9eee7; border-radius: 11px; }
.roster-filters button { border: 0; border-radius: 8px; padding: 8px 13px; background: transparent; color: #60776d; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.roster-filters button.active { color: var(--ink); background: white; box-shadow: 0 2px 8px #163a3518; }
.roster-filters button:hover:not(.active) { color: var(--ink); }
.roster-visible-count { margin: 16px 2px 10px; color: var(--muted); font-size: 12px; font-weight: 750; }
.roster-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 12px; max-height: 680px; overflow-y: auto; padding: 3px 8px 4px 3px; scrollbar-color: #c1d0c5 transparent; }
.roster-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 132px; padding: 18px 19px 16px; background: white; border: 1px solid #e1e8df; border-radius: 15px; box-shadow: 0 3px 12px #163a3508; transition: border-color .15s, box-shadow .15s, transform .15s; }
.roster-card:hover { border-color: #b8cfc0; box-shadow: 0 7px 18px #163a3512; transform: translateY(-1px); }
.roster-card.missing { background: #fff9f8; border-color: #f1cfcb; }
.roster-card.missing::before { content: ""; position: absolute; inset: 15px auto 15px 0; width: 3px; border-radius: 0 3px 3px 0; background: #d86b5f; }
.roster-card.missing:hover { border-color: #dfaca5; }
.roster-card.editing { grid-column: 1 / -1; min-height: 0; }
.roster-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.roster-code { display: inline-flex; align-items: center; min-height: 27px; padding: 5px 9px; border-radius: 7px; background: #eaf2ed; color: #2d6651; font: 800 12px Consolas, monospace; letter-spacing: .08em; white-space: nowrap; }
.roster-card.missing .roster-code { background: #fde7e4; color: #a93d36; font-family: inherit; letter-spacing: 0; }
.roster-card-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.roster-tag { padding: 6px 9px; border-radius: 999px; background: #f0f3ee; color: #61766c; font-size: 11px; font-weight: 750; white-space: nowrap; }
.roster-tag.candidate { background: #e7f1e8; color: #2e6748; }
.roster-tag.qualified { background: var(--accent-light); color: #9a5d32; }
.roster-identity { display: grid; gap: 3px; min-width: 0; }
.roster-identity strong { color: var(--ink); font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
.roster-email { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.roster-edit-button { align-self: flex-start; display: inline-flex; align-items: center; gap: 9px; margin-top: auto; padding: 11px 0 0; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 800; cursor: pointer; }
.roster-edit-button:hover { color: #174d40; }
.roster-card.missing .roster-edit-button { color: #ad473d; }
.roster-empty { grid-column: 1 / -1; padding: 50px 12px; text-align: center; color: var(--muted); }
.edit-form { width: 100%; }
.roster-edit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.roster-edit-grid label { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.roster-edit-grid input, .roster-edit-grid select { width: 100%; padding: 10px 11px; font-size: 13px; }
.roster-card.missing .roster-edit-grid input[name="code"] { border-color: #e3aaa3; }
.roster-edit-email { grid-column: span 2; }
.roster-edit-actions { display: flex; gap: 9px; margin-top: 15px; }
.mini-button { border: 0; background: var(--ink); color: white; border-radius: 9px; padding: 10px 14px; font-size: 12px; font-weight: 750; cursor: pointer; }
.mini-button.secondary { background: #e9eee9; color: var(--ink); }
@media (max-width: 800px) {
  .login-layout { grid-template-columns: 1fr; gap: 42px; padding-top: 45px; }
  .hero-copy h1 { max-width: 600px; }
  .login-card { max-width: 520px; width: 100%; margin: 0 auto; }
  .admin-grid { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .roster-list { grid-template-columns: 1fr; }
  .roster-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .site-header, main, .site-footer { width: min(100% - 36px, 1200px); }
  .site-header { padding: 17px 0; flex-wrap: wrap; gap: 12px; }
  .brand-name { font-size: 16px; letter-spacing: .08em; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .header-actions { gap: 10px; margin-left: auto; }
  .language-switch button { min-width: 40px; padding: 7px; font-size: 11px; }
  .text-button { font-size: 11px; }
  .login-layout { padding: 45px 0 65px; gap: 35px; }
  .hero-copy h1 { font-size: 55px; }
  html[lang="zh-Hans"] .hero-copy h1 { font-size: 39px; }
  .hero-copy p, .page-title p { font-size: 15px; }
  .login-card { padding: 34px 27px 25px; border-radius: 23px; }
  .page-title { padding-top: 45px; }
  .page-title h1 { font-size: 46px; }
  .panel { padding: 22px 19px; border-radius: 18px; }
  .candidate-grid, .results-list { grid-template-columns: 1fr; }
  .vote-action { bottom: 8px; gap: 12px; }
  .vote-action .primary-button { min-width: 0; font-size: 12px; }
  .field-pair { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; }
  .roster-toolbar { padding: 14px; }
  .roster-controls { flex-direction: column; align-items: stretch; }
  .roster-search { flex: none; }
  .roster-filters { align-self: flex-start; }
  .roster-edit-grid { grid-template-columns: 1fr; }
  .roster-edit-email { grid-column: auto; }
  .site-footer { font-size: 9px; }
}
