/* ============================================================
   微电影大赛评分系统 · 设计系统
   概念：放映单 / 单场放映 / 颁奖结果单
   ============================================================ */

:root {
  --ink: #0B0F0D;
  --panel: #141A17;
  --panel-2: #1B231F;
  --line: rgba(240, 236, 226, 0.10);
  --line-strong: rgba(240, 236, 226, 0.20);
  --text: #F0ECE2;
  --muted: #98A29B;
  --tungsten: #D8A24A;
  --curtain: #A33A2C;
  --ok: #7FA88C;
  --display: Georgia, "Songti SC", "STZhongsong", "Source Han Serif SC", "SimSun", serif;
  --body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --page: 680px;
  --r: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--tungsten); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--tungsten);
  outline-offset: 3px;
}

/* ---------- 通用组件 ---------- */

.page {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 22px calc(32px + env(safe-area-inset-bottom));
}

.top-rule {
  height: 3px;
  background: var(--tungsten);
  width: 44px;
  margin: 26px 0 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .1s ease;
}

.btn:active { transform: scale(0.985); }

.btn-primary {
  background: var(--tungsten);
  border-color: var(--tungsten);
  color: #171207;
  font-weight: 600;
}

.btn-primary:hover { background: #E4B15C; border-color: #E4B15C; }

.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }

.btn-danger { color: #E8A79E; border-color: rgba(163, 58, 44, 0.55); }
.btn-danger:hover { background: rgba(163, 58, 44, 0.16); }

.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.field { display: block; margin-bottom: 22px; }

.field > span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 10px 0;
  font-size: 20px;
  color: var(--text);
  transition: border-color .16s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--tungsten);
}

.field input::placeholder,
.field textarea::placeholder { color: #5D675F; }

.field textarea {
  font-size: 16px;
  line-height: 1.7;
  resize: vertical;
  min-height: 96px;
}

.field select {
  width: 100%;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 10px 28px 10px 0;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23D8A24A' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 12px 8px;
  cursor: pointer;
}

.field select:focus {
  outline: none;
  border-bottom-color: var(--tungsten);
}

.field select option {
  background: var(--panel);
  color: var(--text);
}

.hint { font-size: 13px; color: var(--muted); }
.hint-error { color: #E8A79E; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 14px;
  max-width: calc(100vw - 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 90;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(163, 58, 44, 0.6); color: #F0C9C3; }

.offline-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--curtain);
  color: #F7EDEA;
  font-size: 13px;
  text-align: center;
  padding: 6px 12px;
  z-index: 99;
  display: none;
}

.offline-bar.show { display: block; }

/* ---------- 进场 ---------- */

.entry { padding-top: 34px; }

.masthead { animation: rise .5s ease both; }

.masthead .event-date {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.event-title {
  font-family: var(--display);
  font-size: clamp(34px, 10vw, 54px);
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 10px 0 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}

.event-sub {
  font-size: 15px;
  color: var(--muted);
  max-width: 26em;
}

.entry-form {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  animation: rise .5s .08s ease both;
}

.entry-note {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 26px;
  max-width: 30em;
}

.entry-form .btn { width: 100%; margin-top: 8px; }

.entry-foot {
  margin-top: 30px;
  font-size: 13px;
  color: #6C766E;
  line-height: 1.8;
  animation: rise .5s .16s ease both;
}

/* ---------- 评分总开关 ---------- */

.gate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(163, 58, 44, 0.45);
  border-radius: var(--r);
  background: rgba(163, 58, 44, 0.10);
}

.gate-banner.live {
  border-color: rgba(127, 168, 140, 0.5);
  background: rgba(127, 168, 140, 0.10);
}

.gate-banner strong {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
}

.gate-banner span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.gate-screen { padding-top: 34px; }

.gate-block {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.gate-mark {
  font-family: var(--display);
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 600;
  color: var(--tungsten);
  line-height: 1.2;
  margin-bottom: 12px;
}

@keyframes rise {
  from { transform: translateY(10px); }
  to { transform: none; }
}

/* ---------- 作品单 ---------- */

.wall-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 16px;
  border-bottom: 1px solid var(--line-strong);
}

.wall-title {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}

.wall-progress {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.wall-progress b {
  color: var(--text);
  font-weight: 500;
}

.work-list { margin-top: 4px; }

.work-row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  transition: background-color .16s ease;
}

.work-row:hover { background: rgba(240, 236, 226, 0.02); }
.work-row:active { background: rgba(240, 236, 226, 0.045); }

.work-code {
  font-family: var(--display);
  font-size: 28px;
  color: #5D675F;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.work-row.is-scored .work-code { color: var(--tungsten); }

.work-name {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.work-team {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.work-state {
  font-size: 13px;
  color: #6C766E;
  text-align: right;
  white-space: nowrap;
}

.work-state strong {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  color: var(--tungsten);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.work-main { display: block; min-width: 0; }
.work-name { display: block; }
.work-team { display: block; }

.wall-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  font-size: 13px;
  color: #6C766E;
}

.link-quiet {
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}

.link-quiet:hover { color: var(--text); }

/* ---------- 封面 ---------- */

.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 20px;
  background:
    linear-gradient(160deg, rgba(216, 162, 74, 0.10), transparent 55%),
    var(--panel);
}

.cover-fallback .cf-code {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
  color: rgba(240, 236, 226, 0.14);
  font-variant-numeric: tabular-nums;
}

.cover-fallback .cf-title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}

.cover-fallback .cf-line {
  width: 34px;
  height: 2px;
  background: var(--tungsten);
  margin-top: 10px;
}

/* ---------- 单场评分 ---------- */

.score-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--ink);
  z-index: 10;
}

.score-bar .bar-back {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0;
}

.score-bar .bar-back:hover { color: var(--text); }

.score-bar .bar-progress {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.score-body {
  flex: 1;
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 24px 22px 20px;
  overflow-y: auto;
}

/* 关闭封面时把文字内容垂直居中，避免中间留出大片空白 */
.score-screen.no-cover .score-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.score-screen.no-cover .score-head { margin-bottom: 26px; }
.score-screen.no-cover .score-title { font-size: clamp(38px, 11vw, 52px); }
.score-screen.no-cover .score-intro { font-size: 17px; line-height: 1.9; }

.score-head { margin-bottom: 20px; }

.score-code {
  font-family: var(--display);
  font-size: 15px;
  color: var(--tungsten);
  letter-spacing: 0.12em;
}

.score-title {
  font-family: var(--display);
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 600;
  line-height: 1.18;
  margin: 6px 0 8px;
}

.score-team {
  font-size: 14px;
  color: var(--muted);
}

.score-cover { margin: 22px 0 18px; }

.score-intro {
  font-size: 15px;
  color: #C8CEC7;
  line-height: 1.85;
  max-width: 34em;
}

.score-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--tungsten);
  border-bottom: 1px solid rgba(216, 162, 74, 0.4);
  padding-bottom: 2px;
}

.score-pad {
  position: sticky;
  bottom: 0;
  background: var(--ink);
  border-top: 1px solid var(--line-strong);
  padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
}

.score-pad-inner {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
}

.pad-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.pad-label b {
  color: var(--tungsten);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.score-key {
  height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  font-family: var(--display);
  font-size: 22px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}

.score-key:hover { border-color: rgba(216, 162, 74, 0.55); }

.score-key.on {
  background: var(--tungsten);
  border-color: var(--tungsten);
  color: #171207;
  font-weight: 600;
}

.score-key:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.score-pad .btn { width: 100%; margin-top: 12px; }

.score-pad .save-note {
  text-align: center;
  font-size: 12px;
  color: var(--ok);
  height: 16px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity .2s ease;
}

.score-pad .save-note.show { opacity: 1; }

/* ---------- 完成 ---------- */

.done {
  padding-top: 72px;
  text-align: left;
}

.done-mark {
  font-family: var(--display);
  font-size: 64px;
  color: var(--tungsten);
  line-height: 1;
}

.done h1 {
  font-family: var(--display);
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 600;
  margin: 18px 0 12px;
}

.done p { color: var(--muted); max-width: 28em; }

.done-actions { margin-top: 36px; display: grid; gap: 12px; }

.done-summary {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.done-summary li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.done-summary .ds-score {
  font-family: var(--display);
  color: var(--tungsten);
  font-variant-numeric: tabular-nums;
}

/* ---------- 榜单 ---------- */

.rank-head {
  padding: 30px 0 18px;
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.rank-title {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
}

.rank-note { font-size: 13px; color: var(--muted); }

.rank-list { margin-top: 8px; }

.rank-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.rank-item .rank-no {
  font-family: var(--display);
  font-size: 22px;
  color: #5D675F;
  font-variant-numeric: tabular-nums;
}

.rank-item .rank-name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}

.rank-item .rank-team {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.rank-main { display: block; min-width: 0; }
.rank-item .rank-name { display: block; }
.rank-item .rank-team { display: block; }

.rank-item .rank-score {
  font-family: var(--display);
  font-size: 26px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1.1;
}

.rank-item .rank-detail {
  grid-column: 2 / 4;
  font-size: 12px;
  color: #6C766E;
  margin-top: 4px;
}

.rank-item.top .rank-no,
.rank-item.top .rank-score { color: var(--tungsten); }

.rank-item.top .rank-name { font-size: 22px; }

.rank-item.rank-1 {
  padding: 24px 0;
  border-bottom: 1px solid var(--line-strong);
}

.rank-item.rank-1 .rank-name {
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.2;
}

.rank-item.rank-1 .rank-score { font-size: 42px; }

.rank-item.rank-1 .rank-no {
  font-size: 40px;
  color: var(--curtain);
}

.rank-empty {
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

/* ---------- 评委端 ---------- */

.judge-wrap { max-width: 640px; margin: 0 auto; padding: 0 22px 40px; }

.judge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
}

.judge-who { font-size: 14px; color: var(--muted); }
.judge-who b { color: var(--text); font-weight: 500; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0 6px;
}

.slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: var(--line-strong);
  outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tungsten);
  border: none;
  cursor: pointer;
}

.slider-row input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tungsten);
  border: none;
  cursor: pointer;
}

.slider-value {
  font-family: var(--display);
  font-size: 34px;
  color: var(--tungsten);
  font-variant-numeric: tabular-nums;
  min-width: 76px;
  text-align: right;
}

.judge-actions { display: flex; gap: 10px; margin-top: 18px; }
.judge-actions .btn { flex: 1; }

/* ---------- 后台 ---------- */

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
}

.admin-side {
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.admin-brand {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.admin-brand span {
  display: block;
  font-family: var(--body);
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 6px;
}

.admin-nav { margin-top: 18px; display: grid; gap: 2px; }

.admin-nav button {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 14px;
  color: var(--muted);
  transition: background-color .14s ease, color .14s ease;
}

.admin-nav button:hover { color: var(--text); background: rgba(240, 236, 226, 0.04); }

.admin-nav button.active {
  color: var(--text);
  background: var(--panel);
  box-shadow: inset 2px 0 0 var(--tungsten);
}

.admin-side-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #6C766E;
  line-height: 1.7;
}

.admin-main {
  padding: 26px clamp(20px, 4vw, 44px) 60px;
  max-width: 1240px;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 22px;
}

.admin-head h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
}

.admin-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 28px;
}

.stat-cell {
  background: var(--ink);
  padding: 18px 20px;
}

.stat-cell .stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-cell .stat-value {
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-cell .stat-unit {
  font-family: var(--body);
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}

.table-wrap {
  border-top: 1px solid var(--line-strong);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

table.data th {
  text-align: left;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

table.data td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data tr:hover td { background: rgba(240, 236, 226, 0.02); }

table.data .num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
}

table.data .sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.ar-title {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.table-thumb {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel);
}

.table-thumb-fallback {
  width: 64px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 14px;
  color: #5D675F;
}

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
}

.tag.on { color: #B7D8C1; border-color: rgba(127, 168, 140, 0.5); }
.tag.off { color: #C9A49E; border-color: rgba(163, 58, 44, 0.4); }
.tag.dup { color: var(--tungsten); border-color: rgba(216, 162, 74, 0.5); margin-left: 6px; }

.voter-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.voter-search {
  width: 220px;
  max-width: 46%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 8px 0;
  font-size: 15px;
  color: var(--text);
}

.voter-search:focus {
  outline: none;
  border-bottom-color: var(--tungsten);
}

.voter-count { font-size: 13px; color: var(--muted); }

.voter-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.empty-state {
  padding: 46px 0;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.admin-form-grid .full { grid-column: 1 / -1; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 5, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-mask.show { display: flex; }

.modal {
  background: var(--ink);
  border: 1px solid var(--line-strong);
  width: 100%;
  max-width: 620px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 26px;
  border-radius: var(--r);
}

.modal h2 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 14px;
}

.modal-text {
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.cover-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.cover-preview {
  width: 128px;
  height: 72px;
  border: 1px solid var(--line-strong);
  background-color: var(--panel);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: none;
}

.cover-picker .cp-actions { display: flex; flex-direction: column; gap: 8px; }

.rank-admin-list { border-top: 1px solid var(--line-strong); }

.admin-rank-row {
  display: grid;
  grid-template-columns: 54px 1fr 90px 90px 100px;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.admin-rank-row .ar-no {
  font-family: var(--display);
  font-size: 20px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-rank-row > span:nth-child(2) { display: block; min-width: 0; }

.admin-rank-row .ar-title {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}

.admin-rank-row .ar-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.admin-rank-row .ar-v {
  font-family: var(--display);
  font-size: 20px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-rank-row .ar-v small {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  color: var(--muted);
}

.admin-rank-row.top .ar-no,
.admin-rank-row.top .ar-v { color: var(--tungsten); }

/* 后台登录 */

.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box { width: 100%; max-width: 380px; }

.login-box h1 {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 8px;
}

.login-box p { font-size: 14px; color: var(--muted); margin-bottom: 30px; }

.login-box .btn { width: 100%; }

/* ---------- 大屏 ---------- */

.display-body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2.4vh, 60px) clamp(24px, 3vw, 80px);
}

.display-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: clamp(8px, 1.4vh, 20px);
}

.display-title {
  font-family: var(--display);
  font-size: clamp(20px, 2.8vh, 60px);
  font-weight: 600;
  line-height: 1.15;
}

.display-sub {
  font-size: clamp(11px, 1.3vh, 24px);
  color: var(--muted);
  margin-top: 4px;
}

.display-live {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: clamp(14px, 1.8vh, 32px);
  color: var(--tungsten);
  white-space: nowrap;
}

.live-dot {
  width: clamp(8px, 1vh, 16px);
  height: clamp(8px, 1vh, 16px);
  border-radius: 50%;
  background: var(--tungsten);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.display-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

.display-row {
  display: grid;
  grid-template-columns: 0.55fr 4fr 1.4fr;
  align-items: center;
  gap: clamp(10px, 1.6vw, 36px);
  padding: clamp(4px, 0.85vh, 18px) 0;
  border-bottom: 1px solid var(--line);
  will-change: transform;
}

.display-row .dr-no {
  font-family: var(--display);
  font-size: clamp(18px, 2.8vh, 56px);
  color: #5D675F;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.display-row .dr-move {
  display: block;
  font-family: var(--body);
  font-size: clamp(10px, 1.35vh, 26px);
  line-height: 1.2;
  margin-top: 4px;
}

.display-row .dr-move.up { color: var(--tungsten); }
.display-row .dr-move.down { color: #6C766E; }

.display-row > span:nth-child(2) { display: block; min-width: 0; }

.display-row .dr-title {
  display: block;
  font-family: var(--display);
  font-size: clamp(18px, 2.8vh, 56px);
  font-weight: 600;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.display-row .dr-team {
  display: block;
  font-size: clamp(10px, 1.3vh, 24px);
  color: var(--muted);
  margin-top: 2px;
}

.display-row .dr-sub {
  display: block;
  font-size: clamp(9px, 1.1vh, 20px);
  color: #8C968E;
  margin-top: 2px;
}

.display-row .dr-score {
  font-family: var(--display);
  font-size: clamp(20px, 3.2vh, 64px);
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.display-row .dr-score-v {
  display: inline-block;
  padding: 2px 8px;
  margin-right: -8px;
  border-radius: 3px;
  will-change: transform, background-color;
}

.display-row.top .dr-no,
.display-row.top .dr-score { color: var(--tungsten); }

.display-row.rank-1 {
  padding: clamp(8px, 1.2vh, 24px) 0;
  border-bottom: 1px solid var(--line-strong);
}

.display-row.rank-1 .dr-title { font-size: clamp(24px, 4vh, 80px); }
.display-row.rank-1 .dr-score { font-size: clamp(26px, 4.6vh, 90px); }
.display-row.rank-1 .dr-no { font-size: clamp(22px, 4.2vh, 84px); color: var(--curtain); }

/* 12 部作品时自动收紧行高，保证一屏放得下 */
.display-list.dense .display-row {
  padding: clamp(2px, 0.35vh, 8px) 0;
}
.display-list.dense .display-row .dr-title { font-size: clamp(16px, 2.2vh, 44px); }
.display-list.dense .display-row .dr-team { font-size: clamp(9px, 1vh, 18px); }
.display-list.dense .display-row .dr-sub { font-size: clamp(8px, 0.9vh, 16px); }
.display-list.dense .display-row .dr-no { font-size: clamp(16px, 2.2vh, 44px); }
.display-list.dense .display-row .dr-score { font-size: clamp(18px, 2.9vh, 56px); }
.display-list.dense .display-row.rank-1 {
  padding: clamp(3px, 0.5vh, 12px) 0;
}
.display-list.dense .display-row.rank-1 .dr-title { font-size: clamp(20px, 2.9vh, 52px); }
.display-list.dense .display-row.rank-1 .dr-score { font-size: clamp(24px, 3.4vh, 60px); }
.display-list.dense .display-row.rank-1 .dr-no { font-size: clamp(20px, 3vh, 52px); }

.display-empty {
  width: 100%;
  text-align: center;
  padding: 6vh 0;
}

.display-empty-mark {
  font-family: var(--display);
  font-size: clamp(36px, 7vh, 140px);
  color: var(--tungsten);
  line-height: 1.2;
  margin-bottom: 10px;
}

/* 只作用于提示副文案，避免把上面的“评分未开始”大字一起压小 */
.display-empty p:not(.display-empty-mark) {
  font-size: clamp(13px, 1.6vh, 30px);
  color: var(--muted);
}

.display-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: clamp(11px, 1.3vh, 24px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: clamp(6px, 1vh, 18px);
  margin-top: auto;
}

/* ---------- 打印 ---------- */

@media print {
  :root { --ink: #fff; --text: #111; --muted: #555; --line: rgba(0,0,0,.12); --line-strong: rgba(0,0,0,.25); }
  body { background: #fff; color: #111; }
  .no-print, .admin-side, .admin-actions { display: none !important; }
  .admin-shell { display: block; }
  .admin-main { max-width: none; padding: 0; }
  @page { size: A3 landscape; margin: 14mm; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 16px 18px;
  }
  .admin-nav { display: flex; overflow-x: auto; gap: 4px; }
  .admin-nav button { white-space: nowrap; }
  .admin-side-foot { display: none; }
  .admin-main { padding: 20px 18px 50px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-rank-row { grid-template-columns: 40px 1fr 70px; }
  .admin-rank-row .ar-v:nth-of-type(2) { display: none; }
}

@media (max-width: 480px) {
  .page { padding-left: 18px; padding-right: 18px; }
  .score-body, .score-pad { padding-left: 18px; padding-right: 18px; }
  .work-row { grid-template-columns: 44px 1fr auto; gap: 10px; }
  .work-code { font-size: 24px; }
  .work-name { font-size: 19px; }
  .rank-item.rank-1 .rank-score { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
