:root {
    --blue: #0b6bd3;
    --blue-d: #0852a6;
    --blue-l: #e6f0fb;
    --red: #c8161d;
    --paper: #f3ecdf;
    --card: #fffdf8;
    --ink: #2b2723;
    --muted: #8a8174;
    --line: #e6dccb;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    color: var(--ink);
    background: var(--paper) url(../img/paper.jpg) center top / 400px auto repeat;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
}
.page { max-width: 640px; margin: 0 auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }

/* 头部主视觉 */
.hero { text-align: center; padding-top: 10px; }
.logos { display: flex; justify-content: space-between; align-items: center; padding: 0 14px; }
.logos img { height: 32px; width: auto; }
.emblem {
    display: block; width: 66%; max-width: 360px; margin: 6px auto 0; mix-blend-mode: multiply;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
    mask-composite: intersect;
}
.city { font-size: 28px; font-weight: 900; color: var(--blue); letter-spacing: 6px; margin: 4px 0 8px; font-family: "STSong", "SimSun", serif; }
.band {
    background: linear-gradient(90deg, var(--blue-d), var(--blue) 20%, var(--blue) 80%, var(--blue-d));
    color: #fff; font-size: 13px; padding: 8px 14px; line-height: 1.5; letter-spacing: .5px;
}

main { padding: 14px; }
.card {
    background: var(--card); border-radius: 14px; padding: 16px;
    box-shadow: 0 4px 16px rgba(80, 60, 30, .08); border: 1px solid var(--line); margin-bottom: 14px;
}
.card.loading, .card.center { text-align: center; color: var(--muted); padding: 34px 16px; }
.center .big-ico { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.center h3 { color: var(--ink); margin: 6px 0; font-size: 18px; }

/* 选手信息 */
.player { display: flex; gap: 14px; align-items: center; }
.player .ph {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none;
    border: 3px solid #fff; box-shadow: 0 0 0 2px var(--blue);
    background: var(--blue-l);
}
.player .ph.empty { display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 28px; font-weight: 700; }
.player .tag { display: inline-block; background: var(--red); color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.player .nm { font-size: 22px; font-weight: 700; margin: 2px 0; }
.player .unit { color: var(--muted); font-size: 13px; }
.player .topic { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; }
.player .topic b { color: var(--blue); }

/* 观众打分 */
.aud { text-align: center; padding: 22px 16px 18px; }
.aud .val { font-size: 72px; font-weight: 800; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; }
.aud .val small { font-size: 20px; color: var(--muted); font-weight: 400; }
.slider-wrap { position: relative; margin: 26px 6px 6px; }
input[type=range] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 6px; outline: none; margin: 0;
    background: linear-gradient(90deg, var(--blue) 0, var(--blue) var(--p, 50%), #e2d9c9 var(--p, 50%));
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: #fff;
    border: 3px solid var(--blue); box-shadow: 0 2px 8px rgba(11, 107, 211, .35);
}
input[type=range]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.ticks { display: flex; justify-content: space-between; margin-top: 10px; padding: 0 6px; }
.ticks span { width: 22px; text-align: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.ticks span.on { color: var(--blue); font-weight: 700; }

/* 评委打分 */
.grp-h { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; }
.grp-h b { font-size: 16px; color: var(--blue); border-left: 4px solid var(--red); padding-left: 8px; }
.grp-h span { font-size: 13px; color: var(--muted); }
.item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.item .t em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.item .ctl { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.item .ctl input[type=range] { flex: 1; height: 8px; }
.item .ctl input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; }
.item .step {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--blue); background: #fff; color: var(--blue);
    font-size: 20px; line-height: 1; padding: 0; flex: none;
}
.item .num { width: 46px; text-align: center; font-size: 20px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.item.unset .num { color: #c9bfae; }
.item.unset input[type=range] { --p: 0% !important; }
.sub { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding-top: 8px; }
.sub b { color: var(--ink); }

.sticky {
    position: sticky; bottom: 0; background: rgba(255, 253, 248, .96); backdrop-filter: blur(6px);
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); margin: 0 -14px; border-top: 1px solid var(--line);
    display: flex; align-items: center; gap: 12px; z-index: 5;
}
.sticky .tot { flex: 1; font-size: 13px; color: var(--muted); }
.sticky .tot b { font-size: 26px; color: var(--red); font-variant-numeric: tabular-nums; }

/* 按钮 */
.btn {
    border: 0; border-radius: 24px; font-size: 16px; padding: 11px 22px; cursor: pointer; font-weight: 600;
}
.btn-primary { background: linear-gradient(180deg, #1679e0, var(--blue-d)); color: #fff; box-shadow: 0 4px 12px rgba(11, 107, 211, .3); }
.btn-primary:disabled { background: #b9c4d2; box-shadow: none; }
.btn-ghost { background: #efe7d8; color: var(--ink); }
.btn-block { display: block; width: 100%; margin-top: 22px; padding: 14px; font-size: 17px; }

.done { text-align: center; }
.done .ok { width: 56px; height: 56px; border-radius: 50%; background: #1aa36b; color: #fff; font-size: 32px; line-height: 56px; margin: 0 auto 8px; }
.done .sc { font-size: 40px; color: var(--blue); font-weight: 800; }
.link { color: var(--blue); background: none; border: 0; font-size: 14px; text-decoration: underline; padding: 6px; }

.countdown { font-size: 26px; font-weight: 700; color: var(--blue); margin-top: 8px; font-variant-numeric: tabular-nums; }

.role-bar { text-align: center; font-size: 13px; color: var(--muted); padding: 4px 14px 0; }
.role-bar .badge { background: var(--red); color: #fff; padding: 1px 8px; border-radius: 10px; margin-right: 4px; }
.role-bar button { background: none; border: 0; color: var(--blue); font-size: 13px; padding: 6px; }

.support { text-align: center; padding: 18px 0 6px; }
.support a { color: #a59a89; font-size: 11px; text-decoration: none; letter-spacing: 1px; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.dialog { background: #fff; border-radius: 16px; padding: 22px 20px 18px; width: 100%; max-width: 360px; }
.dialog h3 { margin: 0 0 6px; text-align: center; }
.dialog input { width: 100%; font-size: 22px; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; letter-spacing: 4px; margin-top: 8px; }
.dialog .muted { text-align: center; margin: 0; }
.dlg-btns { display: flex; gap: 10px; margin-top: 18px; }
.dlg-btns .btn { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--red); font-size: 13px; }
.cf-total { text-align: center; font-size: 15px; margin: 10px 0; }
.cf-total b { font-size: 36px; color: var(--red); }

.toast {
    position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .78); color: #fff;
    padding: 12px 20px; border-radius: 10px; z-index: 99; font-size: 15px; max-width: 80%; text-align: center;
}
