:root { --red: #b3161b; --red-d: #8f0f13; --line: #e5e0dc; --ink: #2a2422; --muted: #7b716c; --bg: #f6f3f0; --ok: #1d7a43; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 15px; margin: 0 0 8px; }
a { color: var(--red); }
code { padding: 1px 5px; border-radius: 4px; background: #efeae6; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 13px; } .center { text-align: center; } .sub { color: var(--muted); margin: 2px 0; }
label { display: block; margin-bottom: 12px; font-size: 14px; color: #4d4440; }
label.check { display: flex; gap: 8px; align-items: center; }
input:not([type=checkbox]):not([type=file]), textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; font-size: 16px; color: inherit; background: #fff; border: 1px solid #cfc8c3; border-radius: 7px; }
input:focus, textarea:focus { outline: 2px solid rgba(179,22,27,.28); border-color: var(--red); }
input[type=file] { display: block; margin-top: 6px; }
.btn { display: inline-block; padding: 8px 14px; font: inherit; font-size: 14px; line-height: 1.4; color: var(--ink); background: #fff; border: 1px solid #cfc8c3; border-radius: 7px; cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--red); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { color: #fff; background: var(--red); border-color: var(--red); }
.btn.primary:hover:not(:disabled) { background: var(--red-d); }
.btn.danger { color: #fff; background: #c0261f; border-color: #c0261f; }
.btn.block { display: block; width: 100%; padding: 11px; font-size: 16px; }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row label { flex: 1 1 90px; margin-bottom: 8px; }
.row.between { justify-content: space-between; margin-bottom: 8px; }
.row.between h2 { margin: 0; }
.alert { padding: 10px 14px; margin-bottom: 14px; border-radius: 8px; font-size: 14px; }
.alert.ok { color: #14562f; background: #e4f4ea; } .alert.err { color: #8c1a14; background: #fbe6e3; }
.ok-text { color: var(--ok); } .err-text { color: #c0261f; }
.page-plain .narrow { max-width: 520px; margin: 0 auto; padding: 32px 16px; }
.narrow.login { padding-top: 12vh; } .narrow.login h1 { text-align: center; }
.checks { list-style: none; margin: 0; padding: 0; } .checks .ok { color: var(--ok); } .checks .bad { color: #c0261f; }
.kv { width: 100%; border-collapse: collapse; margin: 10px 0; } .kv th { width: 96px; text-align: left; vertical-align: top; padding: 6px 0; } .kv td { padding: 6px 0; word-break: break-all; }

/* 后台布局 */
.admin { display: flex; min-height: 100vh; }
.side { flex: none; width: 190px; padding: 18px 12px; color: #fff; background: #3a1214; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { padding: 2px 10px 14px; font-weight: 700; font-size: 16px; }
.side nav { flex: 1; }
.side a { display: block; padding: 9px 10px; margin-bottom: 2px; color: #ecdcda; border-radius: 7px; text-decoration: none; }
.side nav a.on, .side nav a:hover { color: #fff; background: var(--red); }
.side .out { font-size: 13px; opacity: .75; }
.content { flex: 1; min-width: 0; padding: 22px 24px; max-width: 1180px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
.stats { display: flex; gap: 12px; margin-bottom: 16px; }
.stats div { flex: 1; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.stats b { display: block; font-size: 26px; line-height: 1.2; color: var(--red); } .stats span { color: var(--muted); font-size: 13px; }
.url { margin: 8px 0 12px !important; font-size: 13px !important; color: #4d4440 !important; background: #faf8f6 !important; }
.steps { margin: 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.table tr.cur td { background: #fdeeee; }
.table input { margin: 0 !important; min-width: 90px; font-size: 14px !important; padding: 5px 8px !important; }
.table input.w-num, .w-num { width: 70px; min-width: 70px; }
.ops { white-space: nowrap; } .ops form { display: inline-block; margin: 0; }
.nowrap { white-space: nowrap; }
.struck { color: var(--muted); text-decoration: line-through; }
.struck .retry { display: inline-block; }
.retry { border: 0; background: none; color: var(--red); cursor: pointer; padding: 0 2px; font-size: 13px; text-decoration: none; }
.thumb { max-width: 150px; max-height: 110px; border-radius: 6px; display: block; } .thumb.s { width: 40px; height: 52px; object-fit: cover; }
textarea { min-height: 150px; margin-bottom: 12px !important; }
.tag { display: inline-block; padding: 1px 10px; font-size: 13px; color: #fff; background: var(--red); border-radius: 20px; }
.tag.warn { background: #b56a00; }
.danger-card { border-color: #eec5c1; }
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.5); }
.modal-body { width: 340px; max-width: 100%; padding: 20px; background: #fff; border-radius: 12px; text-align: center; }
.qr svg { display: block; width: 100%; } .url-text { word-break: break-all; }

/* 现场控制台 */
.now-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.now h2 { font-size: 26px; margin: 0; }
.timer-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.clock { min-width: 120px; font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; } .clock.in { color: var(--ok); } .clock.over { color: #c0261f; }
.dur { margin-top: 10px; align-items: flex-end; } .dur label { flex: 0 1 140px; margin: 0; } .dur .hint { padding-bottom: 8px; }
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .flow .btn { padding: 14px 6px; font-size: 16px; }
.judge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 12px 0; }
.jd { padding: 8px; border: 1px solid var(--line); border-radius: 8px; text-align: center; color: var(--muted); }
.jd b, .jd span, .jd i { display: block; font-style: normal; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jd.done { color: #14562f; background: #e4f4ea; border-color: #b8e0c6; }
.sep { width: 1px; height: 24px; background: var(--line); }

/* 打印评委卡 */
.print-cards { flex: 1; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, 230px); gap: 16px; justify-content: center; align-content: start; }
.print-cards .no-print { grid-column: 1 / -1; margin: 0; }
.pcard { padding: 16px; background: #fff; border: 1px dashed #aaa; text-align: center; break-inside: avoid; } .pcard svg { width: 100%; display: block; } .pcard p { margin: 4px 0; } .pcard h2 { margin: 0 0 6px; }
@media print { .no-print { display: none; } body { background: #fff; } }

/* 提示条（手机端和后台共用） */
#toast { position: fixed; left: 50%; top: 18px; z-index: 40; transform: translateX(-50%); max-width: 86vw; padding: 9px 16px; color: #fff; font-size: 14px; background: rgba(30,20,20,.92); border-radius: 8px; }
[hidden] { display: none !important; }

/* 后台窄屏：侧栏变顶部横向导航，手机也能控场 */
@media (max-width: 760px) {
  .admin { display: block; }
  .side { position: sticky; z-index: 10; width: auto; height: auto; padding: 8px 10px; }
  .brand, .side .out { display: none; }
  .side nav { display: flex; gap: 4px; overflow-x: auto; }
  .side nav a { flex: none; margin: 0; padding: 7px 10px; font-size: 14px; }
  .content { padding: 14px 12px; }
  .content > h1 { display: none; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px; }
}

/* 评委手机端 */
.judge { min-height: 100vh; display: flex; flex-direction: column; }
.judge #app { flex: 1; }
.judge main { max-width: 620px; margin: 0 auto; padding: 12px; }
.judge main.with-bar { padding-bottom: 12px; }
.judge .login { padding: 11vh 18px 0; }
.judge .login h1 span { display: block; }
.judge .login h1 { font-size: min(4.9vw, 24px); line-height: 1.5; text-align: center; color: var(--red-d); margin-bottom: 4px; }
.judge .login .sub { text-align: center; margin-bottom: 26px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; color: #fff; background: var(--red); font-weight: 600; }
.link { border: 0; background: none; color: #fff; font: inherit; font-weight: 400; font-size: 14px; opacity: .9; }
.wait { text-align: center; padding: 34px 16px; }
.wait h2 { font-size: 26px; margin: 2px 0; }
.seq { margin: 0; color: var(--red); font-weight: 600; }
.status { color: var(--muted); }
.done-mark { display: inline-block; margin-top: 14px; padding: 3px 14px; color: #14562f; background: #e4f4ea; border-radius: 20px; font-weight: 600; }
.big { margin: 6px 0; font-size: 40px; font-weight: 700; color: var(--red); line-height: 1.2; font-variant-numeric: tabular-nums; }
.who h2 { font-size: 24px; margin: 2px 0; } .topic { margin: 4px 0 0; }
.group h3 { color: var(--red-d); font-size: 16px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.item-text b { display: block; } .item-text small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.stepper { display: flex; align-items: center; grid-row: span 2; }
.stepper button { width: 38px; height: 44px; font-size: 21px; color: var(--red); background: #faf4f3; border: 1px solid #cfc8c3; }
.stepper .dec { border-radius: 8px 0 0 8px; } .stepper .inc { border-radius: 0 8px 8px 0; }
.stepper input { width: 66px !important; height: 44px; margin: 0 !important; padding: 0 2px !important; text-align: center; font-size: 17px !important; font-weight: 600; border-width: 1px 0 !important; border-radius: 0 !important; }
.stepper input::placeholder { font-size: 13px; font-weight: 400; }
.max { color: var(--muted); font-size: 12px; font-style: normal; }
.item.bad input { color: #c0261f; background: #fdeeee !important; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.bar b { font-size: 25px; color: var(--red); font-variant-numeric: tabular-nums; } .bar span { color: var(--muted); font-size: 13px; }
.bar .btn { padding: 10px 24px; font-size: 16px; }
.judge.scoring .support { padding-bottom: 86px; }
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; background: rgba(0,0,0,.45); }
.sheet-body { width: 100%; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); text-align: center; background: #fff; border-radius: 16px 16px 0 0; }
.sheet-body p { margin: 4px 0; }
.sheet .row { flex-wrap: nowrap; margin-top: 14px; } .sheet .row .btn { flex: 1; padding: 12px; font-size: 16px; }
.hist summary { cursor: pointer; font-weight: 600; } .hist ul { list-style: none; margin: 10px 0 0; padding: 0; } .hist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.support { padding: 14px 0 18px; text-align: center; font-size: 12px; }
.support a { color: #a59a94; text-decoration: none; }
