/* ============================================================
   柏木教务 · 移动优先样式
   设计目标：手机单手可操作，桌面不空旷；无外部依赖。
   ============================================================ */

:root {
  --ink: #16241d;
  --ink-2: #34443b;
  --muted: #74827a;
  --paper: #f4f1e8;
  --card: #fffdf8;
  --line: #e3ddcd;
  --line-strong: #cfc7b2;
  --green: #14532d;
  --green-2: #1d6b3c;
  --green-soft: #e6f2e8;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --blue: #1d4ed8;
  --blue-soft: #e0e7ff;
  --shadow: 0 12px 30px rgba(22, 36, 29, 0.07);
  --shadow-sm: 0 4px 12px rgba(22, 36, 29, 0.05);
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 90px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(20, 83, 45, 0.08), transparent 60%),
    radial-gradient(800px 400px at -10% 0%, rgba(180, 83, 9, 0.06), transparent 55%),
    var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100dvh;
}

a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

[x-cloak] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(29, 107, 60, 0.35);
  outline-offset: 2px;
}

.icon { flex: 0 0 auto; vertical-align: -0.18em; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  color: #f7f4e8;
  background: linear-gradient(135deg, #0f3d22 0%, #14532d 55%, #1d6b3c 100%);
  box-shadow: 0 6px 18px rgba(15, 61, 34, 0.18);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #f7dfa3, #e8bd63);
  color: #14532d;
  font-weight: 800;
  font-size: 19px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.brand-logo { object-fit: contain; background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0; flex: 0 0 auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 10px; opacity: 0.72; letter-spacing: 0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav-link {
  color: rgba(247, 244, 232, 0.78);
  padding: 8px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  position: relative;
  text-decoration: none;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 600; }

.mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: #f2c14e;
  display: inline-block;
}

.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { font-size: 13px; }
.user-meta small { font-size: 11px; opacity: 0.7; }

.logout-form { margin: 0; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- 布局 ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 96px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 18px;
  flex-wrap: wrap;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 600;
}
.page-title { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: -0.3px; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-head {
  padding: 16px 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-body { padding: 16px 18px 18px; }
.card-body.tight { padding: 12px 14px; }
.card-link { font-size: 13px; color: var(--green-2); white-space: nowrap; }

/* ---------- 版本信息 ---------- */
.version-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 20px; border-radius: 20px; color: #f7f4e8;
  background: linear-gradient(135deg, #14532d, #1d6b3c 60%, #2f7d4a);
  box-shadow: var(--shadow);
}
.version-kicker { display: block; font-size: 12px; opacity: 0.72; margin-bottom: 5px; }
.version-label { display: block; font-size: 23px; letter-spacing: -0.3px; }
.version-hero p { margin: 7px 0 0; font-size: 12px; opacity: 0.76; }
.version-badge {
  border: 1px solid rgba(255,255,255,0.28); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; white-space: nowrap;
}
.version-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.version-items { margin: 0; padding-left: 19px; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.version-items li { margin: 2px 0; }
@media (max-width: 560px) {
  .version-hero { align-items: flex-start; flex-direction: column; }
  .version-label { font-size: 21px; }
}

/* ---------- 学员名单（只显示姓名） ---------- */
.name-groups { display: flex; flex-direction: column; gap: 14px; }
.name-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip {
  display: inline-flex; align-items: center;
  padding: 8px 13px; border: 1px solid var(--line-strong);
  border-radius: 999px; background: #fff; color: var(--ink);
  font-size: 14px; text-decoration: none;
}
.name-chip:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }

/* ---------- 摸鱼小游戏 ---------- */
.fish-page { max-width: 760px; margin: 0 auto; }
.fish-page,
.fish-page * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.fish-stage {
  position: relative; max-width: 420px; margin: 0 auto;
  border-radius: 24px; overflow: hidden;
  background: #dff5f2;
  box-shadow: 0 18px 42px rgba(15, 61, 34, 0.18);
  border: 1px solid rgba(20, 83, 45, 0.12);
  touch-action: manipulation;
}
#fishGame { display: block; width: 100%; height: auto; aspect-ratio: 360 / 560; touch-action: none; cursor: pointer; outline: none; }
.fish-hud {
  position: absolute; top: 12px; left: 14px; right: 14px;
  display: flex; justify-content: space-between;
  color: #fff; font-size: 12px; letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0, 40, 30, 0.35);
  pointer-events: none;
}
.fish-hud strong { font-size: 19px; margin-left: 4px; }
.fish-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8, 35, 29, 0.38); backdrop-filter: blur(3px);
  transition: opacity 0.2s ease;
}
.fish-overlay.hidden { opacity: 0; pointer-events: none; }
.fish-panel {
  width: 100%; max-width: 270px; text-align: center;
  padding: 20px 18px; border-radius: 20px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}
.fish-panel-img { width: 88px; height: 88px; object-fit: contain; display: block; margin: 0 auto 4px; }
.fish-panel h2 { margin: 2px 0 6px; font-size: 23px; color: var(--green); }
.fish-panel p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.fish-panel small { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.fish-tip { max-width: 420px; margin: 12px auto 0; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.7; }
.fish-entry {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink); padding: 2px 0;
}
.fish-entry:hover { color: var(--green); }
.fish-entry img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 40px; }
.fish-entry-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fish-entry-main strong { font-size: 14px; }
.fish-entry-main small { color: var(--muted); font-size: 11px; }
.fish-profile-btn { gap: 5px; }
.fish-profile-btn img { width: 18px; height: 18px; object-fit: contain; }

/* 摸鱼排行榜 */
.lb-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.lb-tab {
  display: block; min-width: 0; padding: 10px 8px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); text-decoration: none;
  text-align: center; transition: border-color .15s, background .15s;
}
.lb-tab span { display: block; font-size: 12px; font-weight: 700; }
.lb-tab small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.lb-tab.active { border-color: var(--green); background: #ecfdf5; color: var(--green); }
.lb-tab.active small { color: var(--green); opacity: .75; }
table.lb-table { width: 100%; min-width: 0; table-layout: fixed; }
.lb-table th, .lb-table td { white-space: nowrap; }
.lb-table th:first-child, .lb-table td:first-child { width: 52px; }
.lb-table th:last-child, .lb-table td:last-child { width: 108px; text-align: right; }
.lb-table th:nth-child(3), .lb-table td:nth-child(3) { width: 72px; }
.lb-table th.lb-active-col { color: var(--green); }
.lb-table td.lb-active-col { background: #f0fdf4; color: var(--green); font-weight: 700; }
.lb-me { background: #fffbeb; }
.lb-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-user > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lb-user small { color: var(--muted); font-size: 10px; font-weight: 400; white-space: normal; line-height: 1.5; }
.lb-value { color: var(--green); font-size: 13px; }
.lb-value strong { font-size: 15px; }
.rank-badge {
  display: inline-grid; place-items: center;
  width: 25px; height: 25px; border-radius: 50%;
  background: #f1f5f9; color: var(--muted); font-size: 11px; font-weight: 800;
}
.rank-1 { background: #fef3c7; color: #a16207; }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #ffedd5; color: #9a3412; }
@media (max-width: 520px) {
  .lb-tab { padding: 8px 4px; }
  .lb-tab span { font-size: 11px; }
  .lb-tab small { display: none; }
}

/* ---------- 编辑记录 ---------- */
.audit-table .audit-time { white-space: nowrap; font-size: 12px; color: var(--muted); }
.audit-change { display: flex; gap: 5px; align-items: baseline; font-size: 12px; margin: 2px 0; flex-wrap: wrap; }
.audit-change .k { color: var(--muted); min-width: 58px; }
.audit-change .old { color: #a15c3e; text-decoration: line-through; }
.audit-change .arrow { color: var(--muted); }
.audit-change .new { color: var(--green); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0; }

/* ---------- 学员分布地图 ---------- */.map-card .card-body { padding: 10px 12px 12px; }
.map-canvas { width: 100%; height: 420px; min-height: 420px; display: block; }
.map-note { margin: 6px 2px 0; }
.province-list { display: flex; flex-direction: column; }
.province-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.province-row:last-child { border-bottom: 0; }
.province-row:hover { color: var(--green); }
.province-name { flex: 1; font-weight: 600; }
.province-count { color: var(--muted); font-size: 12px; }
.city-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.city-chip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12px; cursor: pointer;
}
.city-chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.map-student-row { text-decoration: none; }
@media (max-width: 560px) {
  .map-canvas { height: 360px; }
}
@media (min-width: 900px) {
  .map-canvas { height: 500px; }
}

/* ---------- 文档列表 ---------- */
.table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--paper); color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }

.doc-upload { padding: 0; }
.doc-upload-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15px;
}
.doc-upload-head::-webkit-details-marker { display: none; }
.doc-upload[open] .doc-upload-head { border-bottom: 1px solid var(--line); }
.doc-upload .card-body { padding-top: 14px; }
input[type="file"].input { padding: 9px; background: #fff; }
input[type="file"]::file-selector-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  margin-right: 8px;
  font: inherit;
  cursor: pointer;
}

.doc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.doc-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.doc-icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--green-soft); color: var(--green); flex: 0 0 auto;
}
.doc-main { flex: 1; min-width: 0; }
.doc-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.doc-meta { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.6; word-break: break-word; }
.doc-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.doc-actions form { margin: 0; }

/* ---------- 专项成绩 ---------- */
.special-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.special-inputs .score-input { min-height: 40px; font-size: 15px; }
.special-scores {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.special-scores strong { color: var(--green); font-size: 16px; font-variant-numeric: tabular-nums; }
.special-total { margin-left: auto; color: var(--ink-2); }
.special-total strong { font-size: 20px; }
.special-card .hint { margin-top: 6px; }

@media (min-width: 700px) {
  .special-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 我的 / 待办 ---------- */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.todo-item:hover { text-decoration: none; border-color: var(--line-strong); }
.todo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.todo-dot.amber, .todo-dot.wip { background: var(--amber); }
.todo-dot.ok { background: #16a34a; }
.todo-main { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.todo-main strong { font-size: 13px; }
.todo-main small { color: var(--muted); font-size: 11px; }

/* ---------- 公寓 ---------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.room-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-head > div { display: flex; align-items: baseline; gap: 6px; }
.room-head strong { font-size: 21px; letter-spacing: -0.5px; }
.room-head .hint { font-size: 11px; color: var(--muted); }
.room-students { display: flex; flex-direction: column; margin-top: 8px; }
.room-student {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
  text-decoration: none;
}
.room-student:last-child { border-bottom: 0; padding-bottom: 0; }
.room-student:hover { text-decoration: none; color: var(--green-2); }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--green-soft); color: var(--green);
  font-size: 11px; font-weight: 800; flex: 0 0 auto;
}
.room-student-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.room-student-main strong { font-size: 13px; }
.room-student-main small { color: var(--muted); font-size: 11px; }
.room-student-main .tag { margin-left: 4px; font-size: 9px; }

/* ---------- 文化课 / 成绩 ---------- */
.exam-list { display: flex; flex-direction: column; gap: 10px; }
.exam-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.exam-row:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--line-strong); }
.exam-date {
  width: 66px;
  min-width: 66px;
  padding: 8px 4px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}
.exam-date strong { font-size: 12px; }
.exam-date small { font-size: 10px; opacity: 0.7; }
.exam-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.exam-name { font-weight: 700; font-size: 15px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.exam-meta { color: var(--muted); font-size: 12px; }
.progress { height: 6px; border-radius: 99px; background: #ece9de; overflow: hidden; margin-top: 4px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), #4caf70); border-radius: 99px; }
.exam-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--muted); }

/* ---------- 成绩录入 ---------- */
.score-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.summary-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 11px; border-radius: 99px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.summary-chip strong { color: var(--ink); font-size: 14px; }
.summary-chip.green { background: var(--green-soft); border-color: #c7e4cd; color: var(--green); }
.summary-chip.amber { background: var(--amber-soft); border-color: #fde68a; color: var(--amber); }
.summary-chip.red { background: var(--red-soft); border-color: #fecaca; color: var(--red); }

.score-filter { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.score-filter .field { width: 190px; margin: 0; }

.score-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 84px; }
.score-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.score-card.is-absent { opacity: 0.62; background: #f4f1e8; }
.score-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.score-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.score-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.score-field { display: flex; flex-direction: column; gap: 3px; }
.score-field > span { font-size: 11px; color: var(--muted); }
.score-input { min-height: 42px; text-align: center; font-weight: 700; font-size: 17px; padding: 6px; }
.score-input:disabled { background: #eee9dc; color: var(--muted); }
.score-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line);
}
.score-card-foot .checkline { min-height: 34px; font-size: 13px; color: var(--muted); }
.score-total { font-size: 12px; color: var(--muted); }
.score-total strong { font-size: 19px; color: var(--green); margin-left: 4px; font-variant-numeric: tabular-nums; }

.score-savebar {
  position: sticky;
  bottom: 76px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 253, 248, 0.97);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(22, 36, 29, 0.16);
  backdrop-filter: blur(10px);
}
.savebar-hint { color: var(--muted); font-size: 12px; }
.score-savebar .btn { flex: 0 0 auto; }

@media (min-width: 700px) {
  .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-inputs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 861px) {
  .score-savebar { bottom: 16px; }
  .score-grid { margin-bottom: 72px; }
}

/* ---------- 板块首页 ---------- */
.hub-hero {
  background: linear-gradient(135deg, #14532d, #1d6b3c 60%, #2f7d4a);
  color: #f7f4e8;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.hub-hero h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.3px; }
.hub-hero p { margin: 0; opacity: 0.78; font-size: 13px; }
.hub-hero-stats { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hub-hero-stats div { display: flex; flex-direction: column; }
.hub-hero-stats strong { font-size: 22px; line-height: 1.1; }
.hub-hero-stats span { font-size: 11px; opacity: 0.7; }

/* ---------- 仪表盘生日提示 ---------- */
.birthday-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 0; padding: 13px 15px;
  border-radius: 16px; background: #fffaf0;
  border: 1px solid #f0dfb8; color: var(--ink); text-decoration: none;
}
.birthday-banner:hover { border-color: #d9b96f; color: var(--ink); }
.birthday-banner-icon {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f6e7bd; color: #8a5a12;
}
.birthday-banner-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.birthday-banner-main strong { font-size: 13px; color: #8a5a12; }
.birthday-banner-main span { font-size: 14px; }
.birthday-week-list { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 3px; }
.birthday-week-person { color: var(--ink); text-decoration: none; font-size: 14px; }
.birthday-week-person:hover { color: var(--green); }
.birthday-week-person span { margin-left: 4px; color: var(--muted); font-size: 12px; }
.birthday-banner-link { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .birthday-banner { align-items: flex-start; }
  .birthday-banner-link { display: none; }
}

/* ---------- 学员生日 ---------- */
.birthday-nearest {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px; background: var(--green-soft);
}
.birthday-icon {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--green);
}
.birthday-nearest-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.birthday-nearest-main strong { font-size: 17px; }
.birthday-nearest-main small { color: var(--muted); font-size: 12px; }
.birthday-list { margin-top: 12px; border-top: 1px solid var(--line); }
.birthday-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 13px;
}
.birthday-row:last-child { border-bottom: 0; }
.birthday-row:hover { color: var(--green); }
.birthday-date { width: 44px; flex: 0 0 44px; font-weight: 700; color: var(--green); }
.birthday-name { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.birthday-name small { color: var(--muted); font-size: 11px; }
.birthday-when { color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .hub-hero-stats { gap: 12px; }
  .hub-hero-stats strong { font-size: 20px; }
  .birthday-nearest { align-items: flex-start; }
  .birthday-nearest .btn { flex: 0 0 auto; }
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 152px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hub-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.hub-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  margin-bottom: 2px;
}
.hub-title { font-weight: 700; font-size: 15px; }
.hub-desc { color: var(--muted); font-size: 12px; line-height: 1.5; }
.hub-foot { margin-top: auto; color: var(--green-2); font-size: 12px; font-weight: 600; }

@media (max-width: 600px) {
  .hub-hero-stats { width: 100%; justify-content: space-between; }
  .hub-hero h2 { font-size: 19px; }
}

/* ---------- 仪表盘 ---------- */
.hello {
  background: linear-gradient(135deg, #14532d, #1d6b3c 60%, #2f7d4a);
  color: #f7f4e8;
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: 0 16px 36px rgba(20, 83, 45, 0.18);
  position: relative;
  overflow: hidden;
}
.hello::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(247, 223, 163, 0.12);
}
.hello h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.3px; }
.hello p { margin: 0; opacity: 0.8; font-size: 14px; }
.hello .hello-meta { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.hello .pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -1px; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-foot { font-size: 11px; color: var(--muted); margin-top: 6px; }
.stat.green .stat-value { color: var(--green); }
.stat.amber .stat-value { color: var(--amber); }
.stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.stat-link:hover { border-color: var(--green); transform: translateY(-1px); }

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 4px; }

.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.module {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  min-height: 104px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.module:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.module-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.module-name { font-weight: 700; font-size: 14px; white-space: nowrap; }
.module-desc { color: var(--muted); font-size: 12px; line-height: 1.45; }
.module-foot { margin-top: auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(20, 83, 45, 0.18); }
.btn-primary:hover { background: var(--green-2); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: rgba(20, 83, 45, 0.05); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: 0.5; pointer-events: none; }

/* ---------- 徽标 / 标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-wip { background: var(--amber-soft); color: var(--amber); }
.badge-todo { background: #ece9de; color: var(--muted); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--blue-soft); color: var(--blue); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 7px;
  background: #f1eee4;
  color: var(--ink-2);
  font-size: 11px;
  white-space: nowrap;
}
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }

/* ---------- 学员列表 ---------- */
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar .input { flex: 1; }
.filter-toggle {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.filter-grid .field { margin: 0; }
.filter-actions { display: flex; gap: 8px; margin-top: 12px; }

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px 10px;
  color: var(--muted);
  font-size: 13px;
}

.student-list { display: flex; flex-direction: column; gap: 10px; }
.student-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.student-row:hover { transform: translateY(-1px); border-color: var(--line-strong); text-decoration: none; }
.avatar-lg {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #e6f2e8, #cfe6d4);
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 auto;
}
.student-main { min-width: 0; flex: 1; }
.student-name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; flex-wrap: wrap; }
.student-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.student-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.student-side { text-align: right; color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.student-side strong { display: block; color: var(--ink-2); font-size: 12px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 空态 ---------- */
.empty {
  text-align: center;
  padding: 37px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--muted);
}
.empty .empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
}
.empty h3 { margin: 0 0 4px; color: var(--ink); font-size: 16px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* ---------- 表单 ---------- */
.form-card { max-width: 820px; }
.form-section { padding: 18px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2 { margin: 0 0 3px; font-size: 16px; }
.form-section .section-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  font-size: 16px; /* 防止 iOS 聚焦放大 */
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(29, 107, 60, 0.12);
  outline: none;
}
.hint { color: var(--muted); font-size: 11px; }
.error-text { color: var(--red); font-size: 12px; }
.checkline { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.checkline input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); }
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 18px;
  background: #faf7ef;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.form-actions .btn { flex: 0 0 auto; }

.error-box {
  background: var(--red-soft);
  border: 1px solid #fecaca;
  color: #7f1d1d;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.error-box ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- 详情 ---------- */
.profile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
}
.profile .avatar-xl {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  font-size: 20px;
}
.profile-main { flex: 1; min-width: 0; }
.profile-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name h1 { margin: 0; font-size: 24px; letter-spacing: -0.3px; }
.profile-meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.detail-grid > *, .dash-grid > * { min-width: 0; }
.card-body, .timeline, .tl-item, .tl-head, .form-grid, .field, .talk-form { min-width: 0; }
.timeline { overflow-wrap: anywhere; }
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--muted); flex: 0 0 auto; }
.info-row .v { text-align: right; word-break: break-word; }
.guardian { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.guardian:last-child { border-bottom: 0; }
.guardian-main { flex: 1; min-width: 0; }
.guardian-name { font-weight: 600; font-size: 14px; }
.guardian-meta { color: var(--muted); font-size: 12px; }
.guardian-phone { font-variant-numeric: tabular-nums; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--green-soft), var(--line));
  border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -22px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--green-2);
  box-shadow: 0 0 0 3px var(--paper);
}
.tl-item.enroll .tl-dot { border-color: var(--amber); }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-title { font-weight: 700; font-size: 14px; }
.tl-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl-body { margin-top: 4px; color: var(--ink-2); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.tl-meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.tl-actions { margin-top: 6px; }

.talk-form { background: #faf7ef; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.talk-form h3 { margin: 0 0 10px; font-size: 14px; }
.talk-form .form-grid { gap: 10px; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #9eb5a4 #eef2ea; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.table-wrap::-webkit-scrollbar { height: 7px; }
.table-wrap::-webkit-scrollbar-track { background: #eef2ea; border-radius: 99px; }
.table-wrap::-webkit-scrollbar-thumb { background: #9eb5a4; border-radius: 99px; }
.table-scroll-hint { display: none; }
@media (max-width: 860px) {
  .table-scroll-hint { display: block; margin: -2px 0 6px; font-size: 11px; color: var(--muted); }
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: #f7f4ea; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 登录 ---------- */
.login-body {
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(247, 223, 163, 0.22), transparent 55%),
    radial-gradient(700px 500px at 90% 100%, rgba(29, 107, 60, 0.35), transparent 60%),
    linear-gradient(145deg, #0f3d22, #14532d 55%, #0b2f1a);
}
.login-body .container {
  min-height: 100dvh;
  width: 100%;
  max-width: none;
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
  overflow-x: hidden;
}
.login-body .site-foot { display: none; }
.login-card {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  max-width: 410px;
  background: var(--card);
  border-radius: 24px;
  padding: 30px 26px 24px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 46px; height: 46px; font-size: 22px; }
.login-brand .brand-logo { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.login-brand h1 { margin: 0; font-size: 21px; line-height: 1.2; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { margin-top: 6px; }
.login-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 11px; }
.login-hint {
  margin-top: 14px;
  background: var(--amber-soft);
  border: 1px solid #fde68a;
  color: #78350f;
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.login-hint code { word-break: break-all; font-size: 11px; }

/* ---------- 板块横向条（手机） ---------- */
.section-tabs-wrap {
  display: none;
  position: sticky;
  top: 58px;
  z-index: 35;
  background: rgba(244, 241, 232, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.section-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  scrollbar-width: none;
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}
.section-tab:hover { text-decoration: none; border-color: var(--line-strong); }
.section-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}

/* ---------- 即将上线 ---------- */
.soon-hero {
  background: linear-gradient(135deg, #14532d, #1d6b3c);
  color: #f7f4e8;
  border-radius: 22px;
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.soon-hero .soon-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.soon-hero h1 { margin: 0 0 4px; font-size: 26px; }
.soon-hero p { margin: 0; opacity: 0.78; font-size: 14px; }
.soon-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.soon-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; }
.soon-list .dot { width: 7px; height: 7px; border-radius: 50%; background: #f2c14e; margin-top: 8px; flex: 0 0 auto; }

/* ---------- 管理 / 诊断 ---------- */
.diag-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.kv { display: flex; flex-direction: column; gap: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--muted); white-space: nowrap; }
.kv-row .v { text-align: right; word-break: break-all; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.check-row:last-child { border-bottom: 0; }
.check-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.check-dot.ok { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.check-dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.check-row .detail { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.log-box {
  background: #0f1a14;
  color: #c7f0d2;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  overflow-x: auto;
  max-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 提示 ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid transparent;
  animation: fade-up 0.2s ease both;
}
.flash-success { background: var(--green-soft); border-color: #c7e4cd; color: #14532d; }
.flash-warning { background: var(--amber-soft); border-color: #fde68a; color: #78350f; }
.flash-error { background: var(--red-soft); border-color: #fecaca; color: #7f1d1d; }
.flash-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  font-size: 12px;
  flex: 0 0 auto;
}
.flash-text { flex: 1; }
.flash-close { border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0.55; }

/* ---------- 错误页 ---------- */
.error-page { max-width: 520px; margin: 8vh auto 0; text-align: center; }
.error-code {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  color: var(--green);
  letter-spacing: -4px;
  opacity: 0.9;
}
.error-page h1 { margin: 10px 0 8px; font-size: 23px; }
.error-page p { color: var(--muted); margin: 0 0 20px; }
.error-trace { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); }

/* ---------- 页脚 / 底部导航 ---------- */
.site-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 18px 84px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #99a39b;
  font-size: 10px;
  letter-spacing: 0.3px;
}
.foot-trace { font-family: Consolas, monospace; }

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.bottom-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px 5px;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  border-radius: 12px;
}
.bottom-item:hover { text-decoration: none; color: var(--ink-2); }
.bottom-item.active { color: var(--green); font-weight: 700; }
.bottom-item.active .icon { stroke-width: 2.2; }
.bottom-item .mini-dot { position: absolute; top: 6px; right: calc(50% - 17px); width: 5px; height: 5px; }
.bottom-logo { width: 24px; height: 24px; object-fit: contain; display: block; }

/* ---------- 动画 ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.card, .student-row, .stat, .module { animation: fade-up 0.22s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hide-mobile { display: none !important; }
  .section-tabs-wrap { display: block; }
  .page-title { font-size: 24px; }
  .hello h1 { font-size: 21px; }
  .site-foot { padding-bottom: 84px; }
}

@media (min-width: 861px) and (max-width: 1120px) {
  .nav-link span { display: none; }
  .nav-link { padding: 8px 10px; }
}

@media (min-width: 861px) {
  .bottomnav { display: none; }
  .container { padding: 28px 24px 48px; }
  .site-foot { padding-bottom: 20px; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: span 2; }
  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
  .dash-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .diag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid .span-full { grid-column: 1 / -1; }
  .topbar-inner { padding: 12px 24px; }
}

@media (min-width: 1000px) {
  .roster-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 420px) {
  .stat-value { font-size: 24px; }
  .page-head { align-items: flex-start; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .form-actions .btn { flex: 1; }
}

@media print {
  .topbar, .bottomnav, .site-foot, .actions, .btn, .flash-stack { display: none !important; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #ddd; }
}
