:root {
    --bg: #101217;
    --panel: rgba(255,255,255,.07);
    --panel-strong: rgba(255,255,255,.12);
    --line: rgba(255,255,255,.14);
    --text: #f5f7fb;
    --muted: #aeb6c5;
    --primary: #f5c35b;
    --accent: #3bd6c6;
    --danger: #ff5670;
    --good: #37d991;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a.ghost-btn, .primary-btn, .secondary-btn, .danger-btn { cursor: pointer; min-height: 44px; border-radius: 8px; }
button:disabled, .primary-btn:disabled, .secondary-btn:disabled, .danger-btn:disabled { cursor: not-allowed; opacity: .52; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; background: radial-gradient(circle at 20% 10%, rgba(245,195,91,.18), transparent 28%), #101217; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px; border-right: 1px solid var(--line); background: rgba(12,14,20,.78); backdrop-filter: blur(18px); display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(245,195,91,.5); color: #111; background: linear-gradient(135deg, #ffe39a, #f5b33b); border-radius: 8px; font-weight: 900; }
.brand strong { display: block; font-size: 18px; }
.brand small { color: var(--muted); }
.nav { display: grid; gap: 8px; }
.nav a { min-height: 44px; display: flex; align-items: center; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; color: #dce3ee; }
.nav a:hover, .nav a.active { background: var(--panel-strong); border-color: var(--line); color: #fff; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.main { min-width: 0; }
.topbar { min-height: 92px; padding: 22px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgba(16,18,23,.62); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 0 0 4px; font-size: 26px; }
.topbar p { margin: 0; color: var(--muted); }
.top-actions, .action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.content { padding: 30px; display: grid; gap: 22px; }
.panel, .control-panel { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.panel h2 { margin: 0 0 18px; font-size: 19px; }
.panel-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 14px; }
.stat-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.05)); }
.stat-grid span { color: var(--muted); display: block; margin-bottom: 8px; }
.stat-grid strong { font-size: 34px; }
.panel-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.muted, .hint, small { color: var(--muted); }
.link-list { display: grid; gap: 10px; }
.link-list a { padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.06); }
.primary-btn, .secondary-btn, .danger-btn, .ghost-btn, .actions button { display: inline-flex; justify-content: center; align-items: center; padding: 0 16px; border: 1px solid transparent; color: #101217; background: var(--primary); font-weight: 700; }
.secondary-btn, .ghost-btn, .actions button { color: var(--text); background: rgba(255,255,255,.08); border-color: var(--line); }
.danger-btn { background: var(--danger); color: #fff; }
.primary-btn.big, .danger-btn.big { min-height: 58px; font-size: 18px; }
.block { width: 100%; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form.wide input { min-width: 170px; }
input, select { min-height: 44px; color: var(--text); background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; outline: none; }
input:focus, select:focus { border-color: rgba(245,195,91,.8); box-shadow: 0 0 0 3px rgba(245,195,91,.14); }
label { display: grid; gap: 8px; color: #e7ecf4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid h2 { grid-column: 1 / -1; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.one, .panel.narrow { max-width: 680px; }
.check-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.check-inline input, .check-row input { min-height: auto; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.09); }
th { color: #d8dfeb; background: rgba(255,255,255,.08); font-size: 13px; }
td { color: #f4f7fb; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { display: inline-flex; }
.actions button { min-height: 36px; padding: 0 10px; font-weight: 600; }
.batch-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 0; }
.batch-actions span { color: var(--muted); min-width: 82px; }
.table-wrap input[type="checkbox"] { min-height: auto; width: 18px; height: 18px; }
.badge { display: inline-flex; min-height: 28px; align-items: center; padding: 0 9px; border-radius: 8px; background: rgba(255,255,255,.1); color: #d9e1ef; }
.badge.good { color: #0d2a1c; background: var(--good); }
.badge.danger { color: #fff; background: var(--danger); }
.badge.force { color: #101217; background: linear-gradient(135deg, #ffe38b, #ffb347); margin-left: 6px; }
.avatar { width: 40px; height: 40px; border-radius: 8px; display: inline-grid; place-items: center; background: rgba(245,195,91,.18); border: 1px solid rgba(245,195,91,.38); font-weight: 900; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pager { display: flex; gap: 10px; padding-top: 14px; }
.pager a { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.alert { padding: 12px 14px; border: 1px solid rgba(255,86,112,.4); background: rgba(255,86,112,.13); border-radius: 8px; color: #ffd6dd; }
.void-row { opacity: .52; text-decoration: line-through; }
.control-panel { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; align-items: stretch; }
.control-stage { min-height: 280px; display: grid; align-content: center; gap: 8px; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, rgba(245,195,91,.16), rgba(59,214,198,.1)); }
.control-stage h2 { font-size: clamp(28px, 4vw, 54px); margin: 0; }
.overline { color: var(--primary); text-transform: uppercase; font-weight: 800; font-size: 12px; }
.state-pill, .phone-state { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.08); width: fit-content; }
.control-message { min-height: 34px; display: flex; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.06); }
.control-message:empty { display: none; }
.control-message.success { color: #10291e; background: rgba(55,217,145,.88); }
.control-message.error { color: #fff; background: rgba(255,86,112,.82); }
.control-message.info { color: #101217; background: rgba(245,195,91,.86); }
.control-actions { display: grid; gap: 14px; align-content: center; }
.login-page, .mobile-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #0d1018, #18120d 48%, #0b1514); }
.login-card { width: min(420px, 100%); display: grid; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.08); box-shadow: 0 28px 90px rgba(0,0,0,.36); }
.login-card h1 { margin: 0; }
.login-brand { margin-bottom: 8px; }
.control-mobile { min-height: 100vh; background: #101217; }
.phone-shell { width: min(620px, 100%); margin: 0 auto; min-height: 100vh; padding: 18px; display: grid; align-content: start; gap: 16px; }
.phone-shell header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.phone-shell h1 { margin: 4px 0; font-size: 26px; }
.phone-shell p { margin: 0; color: var(--muted); }
.phone-panel { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.recent-list { display: grid; gap: 8px; max-height: min(52vh, 620px); overflow: auto; padding-right: 2px; }
.recent-list div { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.public-result { min-height: 100vh; background: #f4f7fb; color: #172033; }
.result-shell { width: min(1100px, 100%); margin: 0 auto; padding: 32px 18px; }
.result-shell header { padding: 28px 0; }
.result-shell h1 { margin: 8px 0; font-size: clamp(30px, 6vw, 60px); }
.result-shell .panel { background: #fff; color: #172033; border-color: #dbe3ef; }
.result-shell .table-wrap { border-color: #dbe3ef; background: #fff; }
.result-shell table { color: #172033; background: #fff; }
.result-shell th, .result-shell td { border-bottom-color: #e5ebf3; }
.result-shell th { background: #eef3fa; color: #445166; }
.result-shell td { color: #172033; background: #fff; font-weight: 600; }
.result-shell tbody tr:nth-child(even) td { background: #f8fafc; }
.result-shell tbody tr:hover td { background: #fff8e8; }
.result-search { display: flex; gap: 10px; margin-bottom: 18px; }
.result-search input { flex: 1; background: #fff; color: #172033; border-color: #d8e0ec; }
.result-shell .secondary-btn { color: #172033; background: #fff; border-color: #cbd5e1; }
.result-shell .secondary-btn:hover { background: #eef3fa; }
.empty { text-align: center; color: #6a7487; }
@media (max-width: 980px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .topbar, .panel-head, .control-panel { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
    .stat-grid, .panel-grid.two, .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
    .content { padding: 18px; }
}
@media print {
    .sidebar, .topbar, .actions, .action-row, .inline-form, .pager, .form-actions, .batch-actions, input[type="checkbox"] { display: none !important; }
    .admin-shell { display: block; background: #fff; color: #111; }
    .content, .panel { padding: 0; background: #fff; color: #111; box-shadow: none; border: 0; }
    table { color: #111; }
}

/* Award-specific group rules. */
[data-award-custom][hidden], [data-award-uniform][hidden], [data-award-per-group][hidden] { display: none; }
.form-grid h3, .form-grid > .muted, .form-grid > [data-award-per-group] { grid-column: 1 / -1; }
