/* 课间操评分系统 · 全站样式 */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --surface-3: #eef2f9;
  --border: #e5eaf2;
  --border-strong: #d8e0ee;
  --text: #1b2436;
  --text-2: #47536b;
  --muted: #8491a8;
  --primary: #3d6bf5;
  --primary-strong: #2f5ce6;
  --primary-soft: #eaf0ff;
  --primary-faint: #f4f7ff;
  --success: #12a37a;
  --success-soft: #e4f7f0;
  --danger: #eb5c5c;
  --danger-soft: #fdecec;
  --warning: #f0a02a;
  --warning-soft: #fff3df;
  --purple: #7a5af8;
  --shadow-sm: 0 2px 8px rgba(28, 45, 90, .05);
  --shadow: 0 8px 28px rgba(28, 45, 90, .08);
  --shadow-lg: 0 20px 60px rgba(20, 38, 80, .16);
  --radius: 14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6dfee; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 通用组件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  font-weight: 600; font-size: 13px; transition: .18s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(61, 107, 245, .25); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 48px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.card-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }

.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 7px; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: .18s; font-size: 14px;
}
.textarea { height: auto; min-height: 78px; padding: 10px 13px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(61, 107, 245, .12); }
.input::placeholder, .textarea::placeholder { color: #aeb8c9; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238491a8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.switch { position: relative; width: 40px; height: 22px; border-radius: 20px; background: #d9e0ec; transition: .2s; flex: none; }
.switch.on { background: var(--primary); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .2s; }
.switch.on::after { transform: translateX(18px); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.tag-blue { background: var(--primary-soft); color: var(--primary); }
.tag-green { background: var(--success-soft); color: var(--success); }
.tag-red { background: var(--danger-soft); color: var(--danger); }
.tag-orange { background: var(--warning-soft); color: #c47c14; }
.tag-purple { background: #f0ebff; color: var(--purple); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 11px 14px; white-space: nowrap; font-size: 12px; letter-spacing: .3px; }
.table td { padding: 12px 14px; border-top: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tr:hover td { background: var(--primary-faint); }
.table .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.table .pos { color: var(--success); }
.table .neg { color: var(--danger); }
.table-actions { display: flex; gap: 6px; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .empty-icon { font-size: 34px; opacity: .5; display: block; margin-bottom: 8px; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.filters .f { min-width: 130px; }
.filters .f .label { font-size: 11.5px; margin-bottom: 5px; color: var(--muted); }
.filters .input, .filters .select { height: 36px; font-size: 13px; }

/* 弹窗 / 提示 */
.modal-mask { position: fixed; inset: 0; background: rgba(18, 30, 55, .42); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .16s ease; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; animation: popIn .2s ease; }
.modal.wide { width: min(720px, 100%); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 18px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.toast-root { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 12px 16px; min-width: 230px; max-width: 360px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 9px; animation: slideIn .22s ease; }
.toast.ok { border-left: 4px solid var(--success); }
.toast.err { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px) } to { opacity: 1; transform: none } }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
.loading-box { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 50px; color: var(--muted); }

/* ---------------------------------------------------------------- 登录页 */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 46px 20px 30px; background:
    radial-gradient(900px 420px at 50% -180px, #e8efff 0%, rgba(246,248,252,0) 70%), var(--bg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.brand-logo {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px;
  background: linear-gradient(145deg, #5a83ff, #3161ee);
  box-shadow: 0 10px 24px rgba(61, 107, 245, .3);
  display: flex; align-items: center; justify-content: center;
}
.brand-logo.small { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; margin: 0; }
.brand-logo svg { width: 36px; height: 36px; }
.brand-logo.small svg { width: 21px; height: 21px; }
.login-brand h1 { font-size: 25px; font-weight: 700; letter-spacing: 1px; color: #182033; }
.login-brand p { font-size: 13px; color: var(--muted); margin-top: 8px; letter-spacing: .6px; }
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid #e9edf5;
  border-radius: 16px; box-shadow: 0 12px 40px rgba(30, 50, 95, .07); padding: 20px 26px 28px;
}
.seg { display: flex; background: #eff2f8; border-radius: 30px; padding: 4px; margin-bottom: 24px; }
.seg button { flex: 1; height: 38px; border-radius: 26px; font-size: 13.5px; font-weight: 600; color: #7d8aa1; display: flex; align-items: center; justify-content: center; gap: 7px; transition: .2s; }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(25, 45, 90, .1); }
.seg button svg { width: 15px; height: 15px; }
.login-card h2 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.login-card .desc { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-card .field { margin-bottom: 18px; }
.login-card .input { height: 46px; border-radius: 9px; }
.login-card .check { margin: 4px 0 20px; }
.login-card .btn-block { height: 46px; border-radius: 9px; font-size: 14.5px; }
.login-foot { margin-top: 22px; font-size: 12px; color: #98a3b5; text-align: center; }
.login-foot b { color: #6c7891; font-weight: 600; }
.login-links { margin-top: 12px; display: flex; gap: 16px; justify-content: center; font-size: 12px; }
.login-links a { color: var(--primary); opacity: .85; }
.code-input { letter-spacing: 14px; text-align: center; font-size: 20px !important; font-weight: 700; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; }

/* ---------------------------------------------------------------- 后台框架 */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 226px; flex: none; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand .t { font-weight: 700; font-size: 14.5px; letter-spacing: .2px; }
.sidebar-brand .s { font-size: 10.5px; color: var(--muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav-group { font-size: 10.5px; font-weight: 700; color: #a8b2c4; letter-spacing: 1.2px; padding: 12px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 500; margin-bottom: 2px; text-align: left; transition: .15s; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; opacity: .8; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item.active .ico { opacity: 1; }
.sidebar-foot { padding: 12px 14px 16px; border-top: 1px solid var(--border); }
.sidebar-school { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.user-chip .n { font-size: 12.5px; font-weight: 600; }
.user-chip .r { font-size: 10.5px; color: var(--muted); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.topbar h2 { font-size: 17px; font-weight: 700; }
.topbar .sub { font-size: 11.5px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.content { padding: 22px 26px 40px; max-width: 1500px; width: 100%; }
.section-gap { margin-bottom: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 17px 18px; position: relative; overflow: hidden; }
.stat-card .stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.stat-card .stat-foot { font-size: 11.5px; color: var(--muted); }
.stat-card .stat-ico { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.chart-box { padding: 16px 18px 8px; }
.chart-svg { width: 100%; height: auto; display: block; }

.rank-list { padding: 8px 0; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-bottom: 1px solid var(--surface-2); }
.rank-item:last-child { border-bottom: none; }
.rank-no { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.rank-item.top1 .rank-no { background: #fff0cf; color: #c8890c; }
.rank-item.top2 .rank-no { background: #e9edf5; color: #6d7c96; }
.rank-item.top3 .rank-no { background: #f9e4d4; color: #b87844; }
.rank-name { flex: 1; font-weight: 600; font-size: 13px; }
.rank-name small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.rank-bar { width: 90px; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: linear-gradient(90deg, #6d94ff, var(--primary)); border-radius: 6px; }
.rank-score { width: 48px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.bar-row .bar-label { width: 84px; font-size: 12px; color: var(--text-2); flex: none; }
.bar-row .bar-track { flex: 1; height: 9px; border-radius: 9px; background: var(--surface-3); position: relative; }
.bar-row .bar-fill { height: 100%; border-radius: 9px; background: var(--primary); }
.bar-row .bar-val { width: 56px; text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline-item { display: flex; gap: 11px; padding: 10px 18px; border-bottom: 1px solid var(--surface-2); font-size: 12.5px; }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex: none; }
.timeline-dot.neg { background: var(--danger); }
.timeline-main { flex: 1; color: var(--text-2); }
.timeline-main b { color: var(--text); }
.timeline-time { color: var(--muted); font-size: 11px; white-space: nowrap; }

.seg-control { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.seg-control button { padding: 5px 13px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg-control button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

.api-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--surface-2); }
.api-row:last-child { border-bottom: none; }
.api-method { font-size: 10.5px; font-weight: 800; color: var(--success); background: var(--success-soft); padding: 3px 7px; border-radius: 5px; letter-spacing: .5px; }
.api-path { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--text); flex: 1; word-break: break-all; }
.api-desc { font-size: 12px; color: var(--muted); }
.code-block { background: #101a2e; color: #c9dbff; border-radius: 10px; padding: 16px; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; line-height: 1.7; overflow-x: auto; white-space: pre; max-height: 260px; overflow-y: auto; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--surface-2); }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { font-size: 13px; font-weight: 600; }
.kv-row .k small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.kv-row .v { flex: none; }
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pill { padding: 5px 10px; border-radius: 7px; font-size: 12px; border: 1px solid var(--border); background: #fff; color: var(--muted); }
.day-pill.on { background: var(--primary-soft); color: var(--primary); border-color: #c9d8ff; font-weight: 700; }
.export-card { padding: 22px; text-align: center; }
.export-card .e-ico { font-size: 30px; }
.export-card h4 { font-size: 14px; margin: 10px 0 4px; }
.export-card p { font-size: 12px; color: var(--muted); min-height: 34px; }
.log-item { padding: 11px 16px; border-bottom: 1px solid var(--surface-2); }
.log-item:last-child { border-bottom: none; }
.log-item .lt { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.log-item .ld { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.log-item pre { margin: 8px 0 0; font-size: 11px; white-space: pre-wrap; color: var(--text-2); background: var(--surface-2); padding: 9px 11px; border-radius: 7px; max-height: 110px; overflow: auto; }

/* ---------------------------------------------------------------- 移动打分端 */
.score-app { max-width: 820px; margin: 0 auto; padding: 0 16px 40px; }
.score-top { display: flex; align-items: center; gap: 10px; padding: 16px 0 14px; }
.score-top .t { font-size: 16px; font-weight: 700; }
.score-top .s { font-size: 11px; color: var(--muted); }
.score-top .spacer { flex: 1; }
.period-banner { border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; background: linear-gradient(110deg, #eaf0ff, #f4f7ff); border: 1px solid #dce6ff; }
.period-banner.closed { background: linear-gradient(110deg, #fff5e6, #fffaf2); border-color: #fae3bf; }
.period-banner .pb-ico { width: 38px; height: 38px; border-radius: 11px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.period-banner .pb-title { font-weight: 700; font-size: 13.5px; }
.period-banner .pb-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.score-section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.score-section-title h3 { font-size: 14px; font-weight: 700; }
.score-section-title span { font-size: 11.5px; color: var(--muted); }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 11px; }
.class-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: left; transition: .18s; position: relative; overflow: hidden; }
.class-card:hover { border-color: #b9ccff; box-shadow: 0 6px 18px rgba(61,107,245,.12); transform: translateY(-2px); }
.class-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(61,107,245,.15); }
.class-card .cc-name { font-size: 15px; font-weight: 700; }
.class-card .cc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.class-card .cc-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; }
.class-card .cc-score { font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.class-card .cc-score small { font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.class-card .cc-count { font-size: 10.5px; color: var(--muted); }
.class-card .cc-delta { position: absolute; right: 12px; top: 12px; font-size: 11px; font-weight: 700; }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--surface-2); font-size: 12.5px; }
.recent-item:last-child { border: none; }
.recent-item .ri-main { flex: 1; }
.recent-item .ri-main b { color: var(--text); }
.recent-item .ri-time { color: var(--muted); font-size: 11px; }

.sheet-mask { position: fixed; inset: 0; background: rgba(18,30,55,.4); z-index: 80; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .16s; }
.sheet { width: min(560px, 100%); background: #fff; border-radius: 20px 20px 0 0; max-height: 88vh; display: flex; flex-direction: column; animation: sheetUp .24s ease; }
@keyframes sheetUp { from { transform: translateY(30px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { font-size: 16px; font-weight: 700; }
.sheet-head p { font-size: 11.5px; color: var(--muted); }
.sheet-body { padding: 16px 20px; overflow-y: auto; }
.sheet-foot { padding: 12px 20px 20px; border-top: 1px solid var(--border); }
.dim-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--surface-2); }
.dim-row:last-child { border: none; }
.dim-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.dim-info { flex: 1; min-width: 0; }
.dim-info .dn { font-size: 13.5px; font-weight: 700; }
.dim-info .dd { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dim-ops { display: flex; align-items: center; gap: 6px; flex: none; }
.op-btn { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: #fff; }
.op-btn.minus { color: var(--danger); }
.op-btn.plus { color: var(--success); }
.op-btn:hover { transform: scale(1.06); }
.op-btn.minus:hover { background: var(--danger-soft); border-color: #f6cccc; }
.op-btn.plus:hover { background: var(--success-soft); border-color: #c2ecd9; }
.op-btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.op-value { font-size: 11px; color: var(--muted); width: 34px; text-align: center; }
.custom-score { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.custom-score .label { margin: 0; font-size: 12px; white-space: nowrap; }
.custom-score .input { height: 34px; width: 90px; text-align: center; }

/* ---------------------------------------------------------------- 大屏看板 */
.board-dark {
  --bd-bg: #08152e;
  --bd-panel: rgba(20, 40, 82, .55);
  --bd-border: rgba(94, 140, 235, .2);
  --bd-text: #eaf2ff;
  --bd-muted: #8fa8d4;
  --bd-accent: #4d8dff;
  background: radial-gradient(1200px 700px at 15% -10%, #173a79 0%, transparent 60%),
              radial-gradient(1000px 600px at 100% 100%, #102a5c 0%, transparent 55%), var(--bd-bg);
  color: var(--bd-text); min-height: 100vh;
}
.board-light { --bd-bg: #f4f7fd; --bd-panel: #ffffff; --bd-border: #e3e9f5; --bd-text: #1b2436; --bd-muted: #8491a8; --bd-accent: #3d6bf5; background: var(--bd-bg); color: var(--bd-text); min-height: 100vh; }
.board-wrap { padding: 18px 26px 24px; max-width: 1900px; margin: 0 auto; }
.board-head { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--bd-border); margin-bottom: 18px; }
.board-head .bh-title { font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.board-head .bh-sub { font-size: 11.5px; color: var(--bd-muted); letter-spacing: .5px; margin-top: 2px; }
.board-head .bh-spacer { flex: 1; }
.board-clock { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; line-height: 1.1; text-align: right; }
.board-clock small { display: block; font-size: 11px; font-weight: 400; color: var(--bd-muted); letter-spacing: .3px; }
.board-tools { display: flex; gap: 8px; align-items: center; }
.bd-btn { border: 1px solid var(--bd-border); background: var(--bd-panel); color: var(--bd-text); height: 34px; padding: 0 13px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.bd-btn:hover { border-color: var(--bd-accent); }
.bd-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 11px; border-radius: 20px; background: rgba(77, 141, 255, .15); color: #8fb6ff; font-weight: 600; }
.board-light .bd-status { background: var(--primary-soft); color: var(--primary); }
.bd-status.closed { background: rgba(240, 160, 42, .15); color: #ffc46b; }
.board-light .bd-status.closed { background: var(--warning-soft); color: #b87a13; }
.bd-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3 } }

.board-grid { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 16px; align-items: start; }
.bd-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bd-panel { background: var(--bd-panel); border: 1px solid var(--bd-border); border-radius: 16px; overflow: hidden; backdrop-filter: blur(6px); }
.bd-panel-head { padding: 13px 17px; border-bottom: 1px solid var(--bd-border); display: flex; align-items: center; justify-content: space-between; }
.bd-panel-head h3 { font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.bd-panel-head span { font-size: 11px; color: var(--bd-muted); }
.bd-panel-body { padding: 14px 17px; }
.bd-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bd-kpi { background: var(--bd-panel); border: 1px solid var(--bd-border); border-radius: 12px; padding: 13px 15px; }
.bd-kpi .k { font-size: 11px; color: var(--bd-muted); }
.bd-kpi .v { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.podium { display: flex; flex-direction: column; gap: 9px; }
.podium-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(77, 141, 255, .08); border: 1px solid var(--bd-border); }
.board-light .podium-item { background: var(--surface-2); }
.podium-item.first { background: linear-gradient(100deg, rgba(255, 196, 84, .18), rgba(77, 141, 255, .06)); border-color: rgba(255, 196, 84, .3); }
.podium-medal { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; background: rgba(255,255,255,.1); flex: none; }
.podium-item.first .podium-medal { background: #ffc954; color: #6b4700; }
.podium-info { flex: 1; }
.podium-info .pn { font-size: 15px; font-weight: 700; }
.podium-info .pg { font-size: 10.5px; color: var(--bd-muted); }
.podium-score { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.podium-score small { font-size: 10px; font-weight: 400; color: var(--bd-muted); }
.bd-rank-scroll { max-height: 560px; overflow-y: auto; }
.bd-rank-row { display: grid; grid-template-columns: 34px 1fr 88px 58px; align-items: center; gap: 10px; padding: 9px 17px; border-bottom: 1px solid var(--bd-border); font-size: 12.5px; }
.bd-rank-row:last-child { border-bottom: none; }
.bd-rank-row:nth-child(-n+3) { background: rgba(77, 141, 255, .07); }
.board-light .bd-rank-row:nth-child(-n+3) { background: var(--primary-faint); }
.bd-rank-no { width: 24px; height: 24px; border-radius: 7px; background: rgba(255,255,255,.08); color: var(--bd-muted); font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.board-light .bd-rank-no { background: var(--surface-3); }
.bd-rank-row:nth-child(1) .bd-rank-no { background: #ffc954; color: #6b4700; }
.bd-rank-row:nth-child(2) .bd-rank-no { background: #c8d4e8; color: #4a5872; }
.bd-rank-row:nth-child(3) .bd-rank-no { background: #e0ac85; color: #5a3418; }
.bd-rank-name { font-weight: 600; }
.bd-rank-name small { font-size: 10px; color: var(--bd-muted); font-weight: 400; margin-left: 6px; }
.bd-bar { height: 7px; border-radius: 7px; background: rgba(255,255,255,.09); overflow: hidden; }
.board-light .bd-bar { background: var(--surface-3); }
.bd-bar span { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, #5b8dff, #9ec1ff); }
.bd-rank-score { text-align: right; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.bd-legend { display: flex; gap: 14px; font-size: 11px; color: var(--bd-muted); margin-top: 10px; }
.bd-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }
.bd-live { display: flex; flex-direction: column; gap: 9px; max-height: 240px; overflow-y: auto; }
.bd-live-item { display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; color: var(--bd-muted); }
.bd-live-item b { color: var(--bd-text); font-weight: 600; }
.bd-live-item .ld { width: 6px; height: 6px; border-radius: 50%; background: #4ade9f; margin-top: 6px; flex: none; }
.bd-live-item .ld.neg { background: #ff8b8b; }
.board-foot { text-align: center; font-size: 11px; color: var(--bd-muted); padding-top: 18px; letter-spacing: .5px; }

/* ---------------------------------------------------------------- 展示屏 */
.display-page { min-height: 100vh; background: linear-gradient(160deg, #0a1836 0%, #122c60 55%, #0a1c40 100%); color: #eaf2ff; padding: 30px 40px; display: flex; flex-direction: column; }
.display-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(120,170,255,.2); padding-bottom: 20px; }
.display-head h1 { font-size: 30px; letter-spacing: 2px; font-weight: 700; }
.display-head p { font-size: 13px; color: #8fa8d4; margin-top: 4px; letter-spacing: 1px; }
.display-clock { font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.display-clock small { display: block; font-size: 13px; color: #8fa8d4; font-weight: 400; text-align: right; }
.display-body { flex: 1; display: grid; grid-template-columns: 1.15fr 1fr; gap: 34px; padding: 32px 0; align-items: start; }
.display-top3 { display: flex; flex-direction: column; gap: 16px; }
.display-podium { display: flex; align-items: center; gap: 20px; background: rgba(255,255,255,.055); border: 1px solid rgba(120,170,255,.18); border-radius: 18px; padding: 22px 26px; }
.display-podium.first { background: linear-gradient(100deg, rgba(255,199,84,.16), rgba(255,255,255,.05)); border-color: rgba(255,199,84,.35); }
.display-podium .dp-no { font-size: 42px; font-weight: 800; color: #ffc954; width: 60px; text-align: center; }
.display-podium:nth-child(2) .dp-no { color: #c8d4e8; }
.display-podium:nth-child(3) .dp-no { color: #e0ac85; }
.display-podium .dp-name { flex: 1; font-size: 26px; font-weight: 700; }
.display-podium .dp-name small { display: block; font-size: 12px; color: #8fa8d4; font-weight: 400; }
.display-podium .dp-score { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; }
.display-list { background: rgba(255,255,255,.04); border: 1px solid rgba(120,170,255,.16); border-radius: 18px; overflow: hidden; }
.display-list-head { padding: 16px 22px; border-bottom: 1px solid rgba(120,170,255,.16); font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.display-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; padding: 11px 22px; border-bottom: 1px solid rgba(120,170,255,.09); font-size: 15px; }
.display-row:last-child { border: none; }
.display-row .dr-no { color: #8fa8d4; font-weight: 700; }
.display-row .dr-score { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.display-foot { border-top: 1px solid rgba(120,170,255,.2); padding-top: 16px; display: flex; justify-content: space-between; font-size: 12px; color: #8fa8d4; letter-spacing: .6px; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .board-grid { grid-template-columns: 1fr 1.4fr; }
  .board-grid > .bd-col:last-child { grid-column: 1 / -1; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .board-grid { grid-template-columns: 1fr; }
  .board-grid > .bd-col:last-child { grid-column: auto; }
  .display-body { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 62px; }
  .sidebar-brand .t, .sidebar-brand .s, .nav-group, .nav-item span:not(.ico), .sidebar-school, .user-chip .n, .user-chip .r { display: none; }
  .sidebar-brand { justify-content: center; padding: 14px 0; }
  .sidebar-nav { padding: 10px 8px; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-foot { display: flex; justify-content: center; padding: 12px 0; }
  .topbar { padding: 0 14px; }
  .content { padding: 14px 14px 30px; }
  .stat-grid { gap: 10px; }
  .field-row { grid-template-columns: 1fr; }
  .board-wrap { padding: 14px; }
  .board-head { flex-wrap: wrap; }
  .board-head .bh-title { font-size: 19px; }
  .board-tools { width: 100%; justify-content: flex-end; }
  .display-page { padding: 20px; }
  .display-podium .dp-name { font-size: 19px; }
  .display-podium .dp-score { font-size: 32px; }
}
