@charset "utf-8";

:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --ink: #17202e;
  --ink-2: #3a475b;
  --muted: #6b7789;
  --faint: #98a3b3;
  --line: #e2e8f0;
  --line-strong: #d2dbe7;
  --brand: #173f66;
  --brand-2: #22557f;
  --brand-deep: #0e2b46;
  --gold: #b98b4b;
  --gold-soft: #e6d3b3;
  --ok: #2c7a5b;
  --ok-bg: #e9f5ef;
  --danger: #b4543f;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(20, 38, 62, .05);
  --shadow-md: 0 12px 34px rgba(20, 38, 62, .09);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font-family: inherit; }

/* ------------------------------------------------------------------ */
/* 加载                                                                */
/* ------------------------------------------------------------------ */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
}

.loading-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #cfd9e5;
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-error {
  display: grid;
  gap: 8px;
  text-align: center;
  color: var(--danger);
}
.loading-error span { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ */
/* 登录                                                                */
/* ------------------------------------------------------------------ */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background:
    radial-gradient(900px 500px at 12% 0%, #dfe7f1 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 100%, #e6e1d6 0%, transparent 55%),
    var(--bg);
}

.login-shell {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  min-height: 626px;
  background: var(--surface);
  border: 1px solid #e0e7f0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(15, 35, 60, .15);
}

.brand-panel {
  position: relative;
  padding: clamp(30px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(152deg, #0d2942 0%, #173f66 56%, #1d4d78 100%);
  overflow: hidden;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 90% at 80% 10%, #000 0%, transparent 75%);
  pointer-events: none;
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -130px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 164, 102, .28) 0%, transparent 70%);
  pointer-events: none;
}

.brand-panel > * { position: relative; z-index: 1; }

.brand-tag {
  width: max-content;
  padding: 7px 13px;
  border: 1px solid rgba(217, 189, 138, .38);
  border-radius: 999px;
  color: #dfc696;
  font-size: 11px;
  letter-spacing: .2em;
}

.brand-panel h1 {
  margin: 30px 0 18px;
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 41px);
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: .02em;
}

.brand-lead {
  margin: 0;
  max-width: 33em;
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
  line-height: 1.95;
}

.brand-points {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
}

.brand-points li {
  display: flex;
  gap: 16px;
  padding: 15px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.point-no {
  flex: none;
  padding-top: 2px;
  color: #c9a466;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .08em;
}

.brand-points b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.brand-points small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, .56);
  font-size: 12.5px;
}

.brand-foot {
  margin-top: auto;
  padding-top: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .52);
  font-size: 12px;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
}

.login-panel {
  padding: clamp(30px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .24em;
}

.login-head h2 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .02em;
}

.login-head p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13.5px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.name-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.name-btn:hover {
  border-color: #b9c9dc;
  box-shadow: 0 8px 18px rgba(23, 63, 102, .09);
  transform: translateY(-1px);
}

.name-btn:active { transform: translateY(0); }

.name-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.name-btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }

.name-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf3f9;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}

.name-text { font-size: 14px; font-weight: 500; }

.login-tip {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.login-foot {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.quiet-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed #c3ccd9;
  padding-bottom: 1px;
  transition: color .15s ease, border-color .15s ease;
}

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

/* ------------------------------------------------------------------ */
/* 顶栏                                                                */
/* ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 clamp(16px, 4vw, 32px);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-bar {
  width: 4px;
  height: 26px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--brand) 100%);
}

.topbar-brand b {
  display: block;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.2;
}

.topbar-brand small {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.save-state {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.save-state[data-tone="ok"] { color: var(--ok); }
.save-state[data-tone="saving"] { color: var(--muted); }
.save-state[data-tone="error"] { color: var(--danger); }

.who {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.who b { color: var(--ink); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-deep); }

.btn-ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: #b6c5d8; background: #f7f9fc; }

.btn:disabled { opacity: .38; cursor: default; }

/* ------------------------------------------------------------------ */
/* 评分台布局                                                           */
/* ------------------------------------------------------------------ */

.workspace {
  width: min(1200px, 100%);
  margin: 22px auto 48px;
  padding: 0 clamp(12px, 3vw, 24px);
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  padding: 16px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.side-head b {
  color: var(--brand);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 4px;
  margin: 10px 4px 12px;
  border-radius: 2px;
  background: #edf1f6;
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  transition: width .3s ease;
}

.target-list {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.target-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}

.target-item:hover { background: #f4f7fb; }

.target-item.is-active {
  background: #eef4fa;
  border-color: #cfdeee;
}

.target-index {
  flex: none;
  width: 22px;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .02em;
}

.target-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-state {
  flex: none;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.target-state b { color: var(--ok); font-weight: 600; font-size: 12px; }
.target-state i { font-style: normal; }

.target-item.is-finished .target-state { color: var(--ok); }

.side-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
}
.side-note svg { width: 14px; height: 14px; flex: none; }

/* ------------------------------------------------------------------ */
/* 评分表                                                              */
/* ------------------------------------------------------------------ */

.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 3vw, 30px);
}

.complete-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  padding: 12px 16px;
  border: 1px solid #cfe6da;
  border-radius: 12px;
  background: var(--ok-bg);
  color: var(--ok);
}
.complete-banner svg {
  width: 22px;
  height: 22px;
  flex: none;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
}
.complete-banner b { display: block; font-size: 13.5px; }
.complete-banner span { display: block; color: #4d8a70; font-size: 12px; margin-top: 1px; }

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

.subject {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.subject-avatar {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #eaf0f7, #dbe6f1);
  color: var(--brand);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.subject-meta h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.3;
}

.subject-meta p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.ring {
  --p: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), #e6ecf4 0);
  transition: background .25s ease;
}

.ring-inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.ring-inner span {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.ring-inner small {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .06em;
}

.score-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 70px;
}
.score-meta > div {
  color: var(--muted);
  font-size: 13px;
}
.score-meta b {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-meta small {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: .02em;
}

.group { margin-top: 26px; }

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

.group-name {
  position: relative;
  padding-left: 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
}
.group-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--gold);
}

.group-max {
  color: var(--faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.dim {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 10px 22px;
  padding: 13px 0;
  border-bottom: 1px dashed #edf1f6;
}
.dim:last-child { border-bottom: 0; }

.dim-label span {
  display: block;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
}
.dim-label small {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 11px;
}

.dim-control { min-width: 0; }

.dim select {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7789' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.dim select:hover { border-color: #b9c9dc; }

.dim select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 63, 102, .12);
}

.dim select.is-filled {
  border-color: #c9d8e8;
  background-color: #fbfcfe;
  color: var(--ink);
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.foot-hint {
  color: var(--faint);
  font-size: 11.5px;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* 管理登录                                                            */
/* ------------------------------------------------------------------ */

.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(800px 420px at 85% 0%, #e2e9f2 0%, transparent 60%),
    var(--bg);
}

.admin-login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
}

.admin-login {
  width: min(420px, 100%);
  padding: 38px 36px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.admin-login .eyebrow { display: block; margin-bottom: 10px; }

.admin-login h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.admin-login p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 63, 102, .12);
}

.admin-login .btn { width: 100%; height: 46px; margin-top: 4px; }

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12.5px;
}

.admin-back {
  display: block;
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.admin-back:hover { color: var(--brand); }

/* ------------------------------------------------------------------ */
/* 汇总台                                                              */
/* ------------------------------------------------------------------ */

.admin-main {
  width: min(1240px, 100%);
  margin: 24px auto 48px;
  padding: 0 clamp(12px, 3vw, 24px);
}

.admin-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .03em;
}

.admin-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

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

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .02em;
}

.stat-card .stat-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 7px;
  font-size: 27px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.stat-card .stat-value small {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.stat-card .stat-note {
  margin-top: 5px;
  color: var(--faint);
  font-size: 11px;
}

.panel {
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .04em;
}

.panel-head span {
  color: var(--faint);
  font-size: 11.5px;
}

.table-wrap { overflow-x: auto; }

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

table.rank-table .col-rank { width: 64px; }
table.rank-table .col-ratio { width: 112px; }
table.rank-table .col-count { width: 96px; }

table.rank-table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-align: left;
  white-space: nowrap;
}

table.rank-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

table.rank-table tr:last-child td { border-bottom: 0; }
table.rank-table tbody tr:hover { background: #fafcfe; }

.rank-no {
  width: 34px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.rank-no.top-1 { background: #f7efdf; color: #9a6f2e; }
.rank-no.top-2 { background: #f0f1f3; color: #6f7783; }
.rank-no.top-3 { background: #f7efe9; color: #a06a4c; }

.person-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.person-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf3f9;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.avg-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.bar {
  flex: 1;
  height: 6px;
  min-width: 70px;
  border-radius: 3px;
  background: #edf1f6;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #2b5d8c, #173f66);
}

.num { font-variant-numeric: tabular-nums; }

.ratio {
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.muted { color: var(--faint); }

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.count-pill.zero { background: #fdf1ee; color: var(--danger); }

/* 进度 */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 20px;
}

.progress-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.progress-chip .pc-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #d5dde8;
}
.progress-chip.is-done { border-color: #d6e8de; background: #f8fcfa; }
.progress-chip.is-done .pc-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(44, 122, 91, .12); }
.progress-chip.is-partial .pc-dot { background: var(--gold); }

.progress-chip .pc-name { font-size: 13px; font-weight: 500; }
.progress-chip .pc-state {
  margin-left: auto;
  color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}
.progress-chip.is-done .pc-state { color: var(--ok); }

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}

.dim-table th, .dim-table td { text-align: center; }
.dim-table th:first-child, .dim-table td:first-child { text-align: left; }

.admin-footnote {
  margin-top: 18px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.8;
  text-align: center;
}

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

@media (max-width: 1040px) {
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    padding: 12px;
  }
  .target-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0 2px;
  }
  .target-list li { flex: none; }
  .target-item {
    width: auto;
    min-width: 118px;
    margin-bottom: 0;
    border-color: var(--line);
    background: #fbfcfe;
  }
  .target-state { margin-left: 4px; }
  .side-note { display: none; }
  .progress-track { margin-bottom: 0; }
}

@media (max-width: 820px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .brand-panel { padding: 30px 28px 26px; }
  .brand-panel h1 { margin: 20px 0 12px; font-size: 27px; }
  .brand-lead { font-size: 13px; }
  .brand-points { display: none; }
  .brand-foot { padding-top: 18px; }
  .login-panel { padding: 28px; }
  .name-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .hide-sm { display: none; }
  .topbar { height: 58px; padding: 0 14px; gap: 8px; }
  .topbar-right { gap: 8px; }
  .topbar-brand { gap: 9px; }
  .topbar-brand b { font-size: 14.5px; }
  .topbar-brand small { display: none; }
  .save-state { display: none; }
  .who { padding-left: 0; border-left: 0; }
  .who-label { display: none; }
  .workspace { margin-top: 14px; gap: 12px; }
  .sheet { padding: 16px 14px 20px; }
  .sheet-head { gap: 10px; }
  .subject-avatar { width: 44px; height: 44px; font-size: 19px; border-radius: 12px; }
  .subject-meta h2 { font-size: 20px; }
  .subject-meta p { font-size: 11.5px; }
  .score-box { gap: 8px; }
  .ring { width: 72px; height: 72px; }
  .ring-inner { width: 58px; height: 58px; }
  .ring-inner span { font-size: 17px; }
  .score-meta { min-width: 0; }
  .score-meta b { font-size: 16px; }
  .score-meta > div { font-size: 11px; }
  .score-meta small { display: none; }
  .group { margin-top: 20px; }
  .dim {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 11px 0;
  }
  .dim-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .dim-label small { margin-top: 0; }
  .dim select { height: 46px; font-size: 13.5px; }
  .sheet-foot { gap: 8px; }
  .foot-hint { display: none; }
  .sheet-foot .btn { flex: 1; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-intro { flex-direction: column; align-items: flex-start; }
  .admin-main { margin-top: 18px; }
  #rankTable { min-width: 0; }
  #rankTable th, #rankTable td { padding: 10px 9px; }
  #rankTable .col-rank { width: 40px; }
  #rankTable .col-ratio { width: 66px; }
  #rankTable .col-count { width: 64px; }
  #rankTable .avg-cell { min-width: 0; gap: 0; }
  #rankTable .avg-cell .bar { display: none; }
  #rankTable .ratio { font-size: 15px; }
  #rankTable .person-cell { gap: 6px; }
  #rankTable .person-dot { width: 24px; height: 24px; font-size: 11px; }
}

@media (max-width: 520px) {
  #rankTable th:nth-child(5),
  #rankTable td:nth-child(5) { display: none; }
  #rankTable th, #rankTable td { padding: 10px 7px; }
  #rankTable .col-rank { width: 34px; }
  .login-wrap { padding: 0; }
  .login-shell { border-radius: 0; border: 0; min-height: 100vh; }
  .name-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-panel { padding: 26px 20px 30px; }
  .brand-panel { padding: 26px 22px 22px; }
  .brand-tag { font-size: 10px; }
  .brand-panel h1 { font-size: 24px; }
  .overview { gap: 8px; }
  .stat-card { padding: 13px 14px; }
  .stat-card .stat-value { font-size: 22px; }
  .progress-grid { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .panel-head { padding: 14px 14px; }
  table.rank-table th, table.rank-table td { padding: 11px 12px; }
  .avg-cell { min-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
