/* 班级积分系统 · 全站样式 */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #1c2440;
  --muted: #69718c;
  --line: #e4e8f1;
  --brand: #3f5efb;
  --brand-deep: #2b46d4;
  --brand-soft: #eef1ff;
  --gold: #f0a51f;
  --plus: #12805c;
  --plus-soft: #e2f6ee;
  --minus: #d3382f;
  --minus-soft: #fdeceb;
  --warn: #b96a00;
  --warn-soft: #fff3df;
  --shadow: 0 10px 30px rgba(28, 36, 64, 0.08);
  --shadow-sm: 0 4px 14px rgba(28, 36, 64, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #7c5cff);
  color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--muted); padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 14px;
}
.nav-links a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.nav-links a.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.nav-links a.cta { background: var(--brand); color: #fff; font-weight: 600; }
.nav-links a.cta:hover { background: var(--brand-deep); color: #fff; }

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-family: inherit;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: 999px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { background: var(--brand-deep); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.success { background: var(--plus); }
.btn.success:hover { background: #0d6a4c; }
.btn.danger { background: var(--minus); }
.btn.danger:hover { background: #b32a22; }
.btn.sm { padding: 7px 14px; font-size: 13px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-deep); white-space: nowrap;
}
.tag.plus { background: var(--plus-soft); color: var(--plus); }
.tag.minus { background: var(--minus-soft); color: var(--minus); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.gray { background: #eef0f5; color: var(--muted); }

.delta-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px;
  font-weight: 800; font-size: 14px; padding: 3px 10px; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.delta-pill.plus { background: var(--plus-soft); color: var(--plus); }
.delta-pill.minus { background: var(--minus-soft); color: var(--minus); }

.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: var(--brand-soft); flex: none;
}

.section-title { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 16px; }
.section-title h2 { margin: 0; font-size: 20px; font-weight: 800; }
.section-title .sub { color: var(--muted); font-size: 13px; }
.section-title .right { margin-left: auto; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; outline: none; transition: border 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(63, 94, 251, 0.12);
}
textarea { resize: vertical; min-height: 96px; }
label.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 16px 0 6px; }
label.field-label .req { color: var(--minus); margin-left: 2px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  margin-top: 26px; border-radius: 22px; padding: 36px;
  background: linear-gradient(120deg, #2b46d4 0%, #3f5efb 55%, #7c5cff 100%);
  color: #fff; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.12);
}
.hero::before {
  content: ""; position: absolute; right: 120px; bottom: -90px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08);
}
.hero .eyebrow { font-size: 13px; letter-spacing: 3px; opacity: 0.85; font-weight: 600; }
.hero h1 { margin: 8px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.hero p { margin: 0; opacity: 0.9; font-size: 14px; max-width: 560px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; position: relative; z-index: 1; }
.hero-stat {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px; padding: 10px 18px; min-width: 110px;
}
.hero-stat b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 12px; opacity: 0.85; }

/* ---------------- 领奖台 ---------------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.podium-item { text-align: center; padding: 24px 16px 20px; position: relative; }
.podium-item .medal {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; color: #fff; box-shadow: var(--shadow-sm);
}
.podium-item:nth-child(1) .medal { background: linear-gradient(135deg, #f7c948, #f0a51f); }
.podium-item:nth-child(2) .medal { background: linear-gradient(135deg, #b9c2d0, #8d99ab); }
.podium-item:nth-child(3) .medal { background: linear-gradient(135deg, #e59866, #c96f2f); }
.podium-item .avatar { width: 58px; height: 58px; font-size: 30px; border-radius: 18px; margin: 10px auto 8px; }
.podium-item .name { font-weight: 700; font-size: 16px; }
.podium-item .group { color: var(--muted); font-size: 12px; }
.podium-item .score { font-size: 28px; font-weight: 800; color: var(--brand-deep); font-variant-numeric: tabular-nums; margin-top: 4px; }
.podium-item .score small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.podium-item .link { font-size: 12px; margin-top: 8px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.data th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #fafbfe; position: sticky; top: 0;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid #f0f2f8; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #f8faff; }
.rank-cell { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-cell.top { color: var(--gold); }
.stu-cell { display: flex; align-items: center; gap: 10px; }
.stu-cell .name { font-weight: 600; }
.stu-cell .no { color: var(--muted); font-size: 12px; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--brand); }
.sortable .arrow { font-size: 10px; margin-left: 3px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar input { max-width: 220px; }
.toolbar select { width: auto; }

/* ---------------- 动态时间线 ---------------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.feed li:last-child { border-bottom: none; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 8px; flex: none; }
.feed .dot.minus { background: var(--minus); }
.feed .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.feed .reason { font-size: 14px; }
.feed .who { font-weight: 600; }

/* ---------------- 申请页 ---------------- */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all 0.12s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.score-stepper { display: flex; align-items: center; gap: 10px; }
.score-stepper button {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 18px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.score-stepper button:hover { border-color: var(--brand); color: var(--brand); }
.score-stepper input { width: 90px; text-align: center; font-weight: 800; font-size: 18px; }
.quick-scores { display: flex; gap: 8px; margin-top: 8px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 20px 40px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand-deep); font-weight: 700; font-size: 13px; display: grid; place-items: center;
}
.steps li::after {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 4px; width: 1px; background: var(--line);
}
.steps li:last-child::after { display: none; }
.steps b { display: block; font-size: 14px; }
.steps span { color: var(--muted); font-size: 13px; }

.success-panel { text-align: center; padding: 36px 24px; }
.success-panel .icon { font-size: 44px; }
.success-panel h3 { margin: 10px 0 4px; font-size: 20px; }
.app-id {
  display: inline-block; font-family: "SFMono-Regular", Consolas, monospace;
  background: var(--brand-soft); color: var(--brand-deep); font-weight: 700;
  padding: 6px 16px; border-radius: 10px; margin: 10px 0; letter-spacing: 1px;
}

/* ---------------- 个人页 ---------------- */
.profile {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 26px; padding: 28px;
  background: linear-gradient(120deg, #2b46d4, #3f5efb 60%, #7c5cff);
  border-radius: 22px; color: #fff; box-shadow: var(--shadow);
}
.profile .avatar { width: 74px; height: 74px; font-size: 40px; border-radius: 22px; background: rgba(255,255,255,0.18); }
.profile h1 { margin: 0; font-size: 26px; }
.profile .meta { opacity: 0.85; font-size: 13px; }
.profile .big { margin-left: auto; text-align: right; }
.profile .big b { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.profile .big span { font-size: 13px; opacity: 0.85; }
.profile .rank-badge {
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.25);
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.stat-card { padding: 16px 18px; }
.stat-card b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: 12px; }

/* ---------------- 后台 ---------------- */
.login-wrap { max-width: 440px; margin: 60px auto 0; }
.account-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.account-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer;
  text-align: center; background: #fff; transition: all 0.12s; font-family: inherit;
}
.account-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.account-card.on { border-color: var(--brand); background: var(--brand-soft); }
.account-card .a-avatar {
  width: 44px; height: 44px; margin: 0 auto 6px; border-radius: 14px; display: grid; place-items: center;
  font-size: 20px; background: linear-gradient(135deg, #3f5efb, #7c5cff); color: #fff; font-weight: 700;
}
.account-card b { display: block; font-size: 14px; }
.account-card span { color: var(--muted); font-size: 12px; }

.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 20px 0 0; border-bottom: 2px solid var(--line); }
.admin-tabs button {
  border: none; background: none; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted); padding: 10px 16px; cursor: pointer; position: relative;
}
.admin-tabs button:hover { color: var(--ink); }
.admin-tabs button.on { color: var(--brand-deep); }
.admin-tabs button.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 2px;
  background: var(--brand); border-radius: 2px;
}
.admin-tabs .count {
  background: var(--minus); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; margin-left: 5px;
}

.review-card { display: flex; gap: 14px; padding: 18px; align-items: flex-start; }
.review-card .body { flex: 1; min-width: 0; }
.review-card .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-card .reason { margin: 6px 0 8px; }
.review-card .meta { color: var(--muted); font-size: 12px; }
.review-card .actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.review-card .actions input { max-width: 220px; }
.review-card textarea { min-height: 60px; }
.review-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.status-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.status-pill.pending { background: var(--warn-soft); color: var(--warn); }
.status-pill.approved { background: var(--plus-soft); color: var(--plus); }
.status-pill.rejected { background: var(--minus-soft); color: var(--minus); }

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

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); opacity: 0;
  pointer-events: none; transition: all 0.25s ease; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b3261e; }

.loading { text-align: center; color: var(--muted); padding: 50px 0; }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer { margin: 56px 0 30px; color: var(--muted); font-size: 12px; text-align: center; }
.footer a { color: var(--muted); text-decoration: underline; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; }
  .podium-item:nth-child(1) { order: -1; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 26px; }
  .hero h1 { font-size: 24px; }
  .nav-links a:not(.cta) { display: none; }
  .profile .big { margin-left: 0; text-align: left; width: 100%; }
}
