:root {
  --paper: #F6F2E9;
  --paper-2: #EFE9DB;
  --card: #FFFDF7;
  --ink: #2A2521;
  --ink-2: #6B6157;
  --ink-3: #9A9084;
  --line: #E4DBCB;
  --line-2: #D6CBB6;
  --red: #9C3A26;
  --red-2: #C1624A;
  --red-bg: #FBEDE8;
  --gold: #B08A4F;
  --gold-bg: #F8F1E0;
  --green: #4C7A5A;
  --green-bg: #EBF2EC;
  --blue: #3B5F87;
  --blue-bg: #EAF0F7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 37, 33, .05), 0 6px 18px rgba(42, 37, 33, .05);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--red); text-decoration: none; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wide { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 14px; }

.h1 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .06em; margin: 0; }
.h2 { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .04em; margin: 0 0 10px; }
.muted { color: var(--ink-2); font-size: 13px; }
.tiny { color: var(--ink-3); font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); cursor: pointer;
  font-size: 14px; font-weight: 500; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: #86301F; border-color: #86301F; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--red); border-color: #EDD3CB; background: #FDF6F3; }

.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: 10px; background: #fff; outline: none; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--red-2); box-shadow: 0 0 0 3px rgba(156, 58, 38, .08); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--paper-2); color: var(--ink-2); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-gold { background: var(--gold-bg); color: #8C6A2F; }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }

.bar { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--red-2), var(--red)); border-radius: 99px; transition: width .5s ease; }

/* ===== 学生端 ===== */
.login-screen {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 32px 20px; background:
    radial-gradient(circle at 20% 0%, #FBF7EE 0%, transparent 55%),
    radial-gradient(circle at 85% 100%, #F3EDE0 0%, transparent 50%), var(--paper);
}
.login-brand { font-family: var(--serif); font-size: 30px; letter-spacing: .22em; text-indent: .22em; text-align: center; margin-bottom: 6px; white-space: nowrap; }
@media (max-width: 400px) { .login-brand { font-size: 24px; } }
.login-sub { text-align: center; color: var(--ink-2); letter-spacing: .3em; font-size: 12px; margin-bottom: 34px; }
.code-display {
  display: flex; justify-content: center; gap: 12px; margin-bottom: 24px;
}
.code-cell {
  width: 50px; height: 62px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--card); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 28px; color: var(--ink);
}
.code-cell.active { border-color: var(--red); box-shadow: 0 0 0 3px rgba(156, 58, 38, .1); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.keypad button {
  height: 58px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 20px; font-family: var(--serif); cursor: pointer;
}
.keypad button:active { background: var(--paper-2); }

/* 登录：班级、姓名、填写码同屏 */
.login-step {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
}
.login-row { display: flex; align-items: center; gap: 10px; }
.login-label {
  width: 42px; flex: none; color: var(--ink-2); font-size: 14px; letter-spacing: .12em;
  font-family: var(--serif);
}
.login-row .select, .login-row .input { flex: 1; min-width: 0; font-size: 17px; padding: 11px 12px; }
#inName { font-family: var(--serif); font-size: 18px; letter-spacing: .1em; }

.confirm-mask {
  position: fixed; inset: 0; z-index: 320; display: none; align-items: center; justify-content: center;
  background: rgba(42, 37, 33, .55); padding: 24px;
}
.confirm-mask.on { display: flex; }
.confirm-box {
  background: var(--card); border-radius: 18px; padding: 22px 20px; width: 100%; max-width: 340px;
  animation: pop .28s cubic-bezier(.2, 1.3, .5, 1);
}
.confirm-title { font-family: var(--serif); font-size: 18px; letter-spacing: .08em; margin-bottom: 10px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.code-input { font-family: var(--serif); font-size: 20px; letter-spacing: .5em; text-align: center; }
.cw-code {
  font-family: var(--serif); font-size: 19px; letter-spacing: .22em; color: var(--red);
  padding: 0 2px;
}
/* 首页顶部：填写码还是默认序号码时的提醒条 */
.code-warn {
  background: var(--gold-bg); border: 1px solid #E4D3AF; border-left: 3px solid var(--gold);
  border-radius: 14px; padding: 13px 15px; margin-bottom: 12px;
}
.code-warn .cw-t { font-family: var(--serif); font-size: 16px; letter-spacing: .04em; color: #7E5E2C; }
.code-warn .cw-d { font-size: 12.5px; line-height: 1.65; color: #8A6C3C; margin: 5px 0 10px; }
.code-warn .btn { background: var(--red); color: #fff; border-color: var(--red); }
.my-code {
  font-family: var(--serif); font-size: 26px; letter-spacing: .3em; color: var(--red); margin-top: 2px;
}

.tabbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; background: rgba(255, 253, 247, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; padding: 9px 0 11px; text-align: center; color: var(--ink-3);
  font-size: 11px; letter-spacing: .1em; cursor: pointer;
}
.tabbar a.on { color: var(--red); }
.tabbar a b { display: block; font-size: 17px; font-weight: 400; margin-bottom: 1px; }

.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(246, 242, 233, .95);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 0;
}
.level-card {
  background: linear-gradient(150deg, #FFFBF2 0%, #FBF4E6 45%, #F7EEDC 100%);
  border: 1px solid var(--line-2); border-radius: 18px; padding: 20px; position: relative; overflow: hidden;
}
.level-card::after {
  content: "詩"; position: absolute; right: -6px; bottom: -30px;
  font-family: var(--serif); font-size: 112px; color: rgba(176, 138, 79, .1); line-height: 1;
}
.level-badge {
  font-family: var(--serif); font-size: 38px; letter-spacing: .1em; color: var(--red);
  line-height: 1.15; margin: 2px 0 4px;
}
.level-lv { font-family: var(--serif); font-size: 15px; color: var(--gold); letter-spacing: .12em; }

.stat-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-3 > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; text-align: center; }
.stat-3 b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); }
.stat-3 span { font-size: 12px; color: var(--ink-2); }

.book-group { margin-bottom: 14px; }
.book-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; user-select: none;
}
.book-head.on { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
.book-body { border: 1px solid var(--line); border-top: none; border-radius: 0 0 12px 12px; background: var(--card); overflow: hidden; }
.unit-title { padding: 8px 14px; font-size: 12px; letter-spacing: .1em; color: var(--ink-3); background: var(--paper-2); }
.poem-line {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-top: 1px solid var(--line); cursor: pointer;
}
.poem-line:active { background: var(--paper); }
.poem-line .t { font-family: var(--serif); font-size: 16px; letter-spacing: .03em; }
.dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2);
  flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff;
}
.dot.done { background: var(--green); border-color: var(--green); }

.poem-sheet {
  position: fixed; inset: 0; z-index: 60; background: var(--paper); overflow-y: auto;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.3,1);
}
.poem-sheet.on { transform: translateY(0); }
.poem-title { font-family: var(--serif); font-size: 26px; letter-spacing: .08em; margin: 0; }
.poem-meta { color: var(--ink-2); font-size: 13px; margin-top: 4px; letter-spacing: .06em; }
.poem-text {
  font-family: var(--serif); font-size: 19px; line-height: 2.15; letter-spacing: .1em;
  white-space: pre-wrap; margin: 18px 0; color: #241F1B;
}
.poem-text.empty { font-family: var(--sans); font-size: 14px; letter-spacing: 0; color: var(--ink-3); line-height: 1.8; }

/* 背诵页导航：上一篇 / 本册目录 / 下一篇 */
.poem-nav {
  display: flex; align-items: stretch; gap: 8px; margin: 16px 0 4px;
}
.pn-btn {
  flex: 1 1 0; min-width: 0; appearance: none; cursor: pointer; text-align: center;
  font-family: var(--sans); font-size: 13px; line-height: 1.35; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 9px 6px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  transition: background .15s, border-color .15s;
}
.pn-btn b { font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.pn-btn span {
  display: block; color: var(--ink-3); font-size: 11px; letter-spacing: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pn-btn:active { background: var(--line); }
.pn-btn[disabled] { opacity: .42; cursor: default; }
.pn-btn[disabled] span { color: var(--ink-3); }
.pn-mid { flex: 1.25 1 0; background: var(--paper); border-color: var(--gold); }
.pn-mid b { color: var(--red); }

/* 从背诵页返回目录时，闪一下刚看的那一篇 */
.poem-line.focus { background: var(--red-bg); border-radius: var(--radius); transition: background .5s; }
.poem-line.focus .t { color: var(--red); }

/* 录音时「背到哪一句，原文就亮出哪一句」 */
.blind-hint {
  display: none; text-align: center; padding: 24px 16px 20px; margin: 18px 0;
  border-radius: var(--radius); border: 1px dashed var(--line-2); background: var(--paper-2);
}
#sheet.recording .blind-hint { display: block; }
.blind-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .18em; color: var(--red); background: var(--red-bg); border-radius: 99px; padding: 2px 11px; }
.blind-live span { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .18; } }
.blind-t { font-family: var(--serif); font-size: 16px; letter-spacing: .2em; color: var(--ink-2); margin: 14px 0 6px; }
.live-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 16px auto 0; max-width: 260px; }
.live-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red-2), var(--red)); border-radius: 99px; transition: width .35s ease; }
.live-txt b { color: var(--red); }

/* 正文逐句：未背出的句子藏成一片模糊的墨迹，背出来才清晰显示 */
.poem-text .poem-row { display: block; }
.poem-text .seg { border-radius: 4px; padding: 0 1px; transition: color .35s ease, text-shadow .35s ease, background-color .35s ease; }

/* 对照译文：紧贴在它对应的那一行原文下面（左细金线，小一号、淡一档，不抢原文） */
.tr-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.tr-btn { flex: none; letter-spacing: .04em; }
.tr-btn.on { background: var(--red-bg); border-color: var(--red-2); color: var(--red); }
.tr-btn[disabled] { opacity: .45; cursor: default; }
.tr-note { color: var(--ink-3); flex: 1 1 160px; min-width: 0; }
.poem-tr {
  display: none; font-family: var(--sans); font-size: 13.5px; line-height: 1.7; letter-spacing: .01em;
  color: var(--ink-2); white-space: normal; text-indent: 0;
  padding: 1px 0 1px 10px; margin: 0 0 7px; border-left: 2px solid var(--gold);
}
.poem-text.show-trans .poem-tr,
.poem-tr.show-trans { display: block; }
.poem-tr-block { margin-top: 10px; }
/* 录音时必须盲背：译文一律收起来 */
#sheet.recording .poem-tr { display: none !important; }
#sheet.recording .poem-text .seg {
  color: transparent; text-shadow: 0 0 10px rgba(42, 37, 33, .5); background: var(--paper-2);
}
#sheet.recording .poem-text .seg.read { color: #241F1B; text-shadow: none; background: transparent; }
.poem-text .seg.miss { background: var(--red-bg) !important; box-shadow: inset 0 0 0 1px var(--red-2); animation: missBlink .9s 3; }
@keyframes missBlink { 0%, 100% { background: #FBEDE8; } 50% { background: transparent; } }

/* 补背提示：识别没听清时，把漏掉的句子指出来，让学生只补这几句 */
.repair-box:empty { display: none; }
.repair-box { margin: 12px auto 0; max-width: 320px; padding: 10px 12px; border-radius: var(--radius); background: var(--red-bg); border: 1px dashed var(--red-2); }
.repair-t { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.repair-t b { color: var(--red); }

/* 背诵评级徽章：优秀(金) / 良好(蓝) / 达标(绿) / 不合格(红) */
.rate-badge {
  display: inline-block; flex: none; font-size: 12px; letter-spacing: .08em; line-height: 1.6;
  padding: 1px 10px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap;
}
.rate-you { background: var(--gold-bg); color: var(--gold); border-color: #E6D2A6; }
.rate-liang { background: var(--blue-bg); color: var(--blue); border-color: #C6D6E8; }
.rate-da { background: var(--green-bg); color: var(--green); border-color: #C7DBCB; }
.rate-no { background: var(--red-bg); color: var(--red); border-color: #EDD3CB; }
.rate-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rate-note { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

.rec-orb {
  width: 108px; height: 108px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #C1624A, #8C2F1E);
  color: #fff; font-size: 14px; letter-spacing: .16em; font-family: var(--serif);
  box-shadow: 0 8px 24px rgba(140, 47, 30, .28); transition: .2s;
}
.rec-orb:active { transform: scale(.96); }
.rec-orb.rec { animation: pulse 1.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(156, 58, 38, .38); }
  70% { box-shadow: 0 0 0 22px rgba(156, 58, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(156, 58, 38, 0); }
}
.timer { font-family: var(--serif); font-size: 30px; letter-spacing: .1em; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.timeline-item { position: relative; padding: 0 0 16px; }
.timeline-item::before {
  content: ""; position: absolute; left: -19px; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--gold); border: 2px solid var(--card);
}
.timeline-item.done::before { background: var(--green); }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
  background: rgba(42, 37, 33, .93); color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 86vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.celebrate {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; background: rgba(42, 37, 33, .55);
}
.celebrate.on { display: flex; }
.celebrate-inner {
  background: var(--card); border-radius: 20px; padding: 30px 26px; text-align: center;
  max-width: 320px; animation: pop .35s cubic-bezier(.2,1.3,.5,1);
}
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== 教师端 ===== */
.admin-shell { display: flex; min-height: 100vh; }
.side {
  width: 196px; flex: none; background: #2E2823; color: #E8E0D2; padding: 20px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { font-family: var(--serif); font-size: 17px; letter-spacing: .14em; padding: 0 20px 16px; color: #F3EAda; }
.side a {
  display: block; padding: 10px 20px; color: #B8AE9D; font-size: 14px; cursor: pointer; border-left: 2px solid transparent;
}
.side a:hover { color: #F0E8D8; background: rgba(255, 255, 255, .04); }
.side a.on { color: #fff; background: rgba(255, 255, 255, .07); border-left-color: var(--red-2); }
.main { flex: 1; min-width: 0; padding: 24px 28px 0; display: flex; flex-direction: column; }
.main > #content { flex: 1 0 auto; }
.page-title { font-family: var(--serif); font-size: 21px; letter-spacing: .06em; margin: 0 0 4px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.kpi span { font-size: 12px; color: var(--ink-2); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { font-weight: 500; color: var(--ink-2); font-size: 13px; background: var(--paper-2); position: sticky; top: 0; }
table.tbl tbody tr:hover { background: var(--paper); }
.tbl-wrap { overflow: auto; max-height: 620px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rank-no { font-family: var(--serif); color: var(--gold); width: 28px; display: inline-block; }
.rank-no.top { color: var(--red); }

.modal-mask {
  position: fixed; inset: 0; background: rgba(42, 37, 33, .5); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.on { display: flex; }
.modal {
  background: var(--card); border-radius: 16px; padding: 22px; width: 100%; max-width: 520px;
  max-height: 86vh; overflow-y: auto;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--card);
  font-size: 13px; cursor: pointer;
}
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ===== 公开门户 ===== */
.portal { background: var(--paper); }
.p-top {
  position: sticky; top: 0; z-index: 30; background: rgba(246, 242, 233, .96);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.p-top .wide { padding-top: 12px; padding-bottom: 10px; }
.p-brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.p-brand span { font-family: var(--serif); font-size: 20px; letter-spacing: .18em; }
.p-brand small { font-size: 12px; color: var(--ink-3); letter-spacing: .02em; }
.p-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 20px 8px; }
.p-tabs a {
  padding: 5px 14px; border-radius: 99px; font-size: 14px; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; border: 1px solid transparent;
}
.p-tabs a:hover { background: var(--paper-2); }
.p-tabs a.on { background: var(--red); color: #fff; }
/* 学生带着登录态看门户时，顶栏标出「以谁的身份查看」 */
.viewer-chip {
  display: inline-flex; align-items: center; margin-left: auto; padding: 3px 12px; border-radius: 99px;
  background: var(--gold-bg); color: #8C6A2F; border: 1px solid #E2D0A8;
  font-size: 12px; white-space: nowrap; letter-spacing: .02em;
}
.p-main { padding: 16px 20px 40px; }
/* ===== 站点页脚（各页统一：金色饰点 + 上下两行居中） ===== */
.site-foot {
  border-top: 1px solid var(--line);
  text-align: center; color: var(--ink-3);
  padding: 20px 16px 28px;
}
.site-foot::before {
  content: ''; display: block; width: 6px; height: 6px;
  margin: 0 auto 12px; background: var(--gold);
  transform: rotate(45deg); opacity: .75;
}
.site-foot .f1 {
  font-size: 11px; line-height: 1.8; letter-spacing: .14em; color: var(--ink-3);
}
.site-foot .f2 {
  font-family: var(--serif); font-size: 13px; font-weight: 500;
  letter-spacing: .26em; text-indent: .26em; /* 抵消末字间距，保证真正居中 */
  color: var(--ink-2); margin-top: 4px;
}
.site-foot a.f3 {
  display: inline-block; margin-top: 13px;
  font-size: 11px; letter-spacing: .1em; text-decoration: none;
  color: var(--ink-3); border-bottom: 1px solid var(--line-2); padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}
.site-foot a.f3::before { content: '师'; display: inline-block; margin-right: 6px; font-family: var(--serif); color: var(--gold); }
.site-foot a.f3:hover { color: var(--red); border-bottom-color: var(--red-2); }
.site-foot.on-dark a.f3 { color: #9A9080; border-bottom-color: rgba(255, 255, 255, .18); }
/* 备案号（工信部要求：需在页面底部展示并链接到 beian.miit.gov.cn） */
.site-foot a.f4 {
  display: block; margin-top: 10px;
  font-size: 10px; line-height: 1.6; letter-spacing: .02em;
  text-decoration: none; color: var(--ink-3); opacity: .78;
  transition: color .15s, opacity .15s;
}
.site-foot a.f4:hover { color: var(--red); opacity: 1; }
.site-foot.on-dark a.f4 { color: #9A9080; }
.site-foot.in-app { margin-top: 22px; padding-bottom: 26px; }
.site-foot.bare { border-top: 0; padding: 0; margin-top: 30px; }
.site-foot.bare::before { margin-bottom: 10px; }
.site-foot.on-dark { border-top-color: rgba(255, 255, 255, .12); }
.site-foot.on-dark .f1 { color: #CFC6B6; }
.site-foot.on-dark .f2 { color: #B3A88F; }

/* 学生端整页用纵向 flex，保证短页面时页脚也贴底（tabbar 之前） */
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > #view { flex: 1 0 auto; }
.p-filter { padding: 14px 16px; }

.rank-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--line); cursor: pointer;
}
.rank-row:hover { background: var(--paper); }
.rank-row .t { font-family: var(--serif); font-size: 16px; letter-spacing: .03em; }
.rank-medal {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-family: var(--serif); font-size: 15px;
  background: var(--paper-2); color: var(--ink-2);
}
.rank-medal.r1 { background: linear-gradient(140deg, #C9A961, #A9843C); color: #fff; }
.rank-medal.r2 { background: linear-gradient(140deg, #C3BFB6, #9A958A); color: #fff; }
.rank-medal.r3 { background: linear-gradient(140deg, #D2A183, #B0774F); color: #fff; }
.rank-count { font-family: var(--serif); font-size: 20px; color: var(--red); line-height: 1.2; }

.name-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.name-chip {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 8px;
  background: var(--paper-2); font-size: 13px; cursor: pointer;
}
.name-chip:hover { background: var(--line); }
.name-chip i { font-style: normal; font-size: 11px; color: var(--ink-3); }

.lv-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.lv-no {
  width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--paper-2);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 14px; color: var(--ink-2);
}
.lv-n { min-width: 56px; text-align: right; font-family: var(--serif); font-size: 18px; color: var(--red); }

/* ===== 《论语》专项 ===== */
.ly-strip { cursor: pointer; }
.ly-strip:active { background: var(--paper); }
.ly-sec { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.ly-sec-no {
  width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--gold-bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 14px; color: #8C6A2F;
}
.ly-sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.ly-mini {
  display: flex; align-items: baseline; justify-content: space-between; gap: 4px;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-2); font-size: 12px; color: var(--ink-2);
}
.ly-mini span { font-family: var(--serif); letter-spacing: .04em; }
.ly-mini b { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.ly-mini.full { background: var(--green-bg); border-color: #CFE2D4; color: var(--green); }
.ly-mini.full b { color: var(--green); }

.steps .step { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.steps .step > b {
  width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--red-bg);
  color: var(--red); font-size: 14px; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.steps .step > div { flex: 1; min-width: 0; }
.steps .step > div > div:first-child { line-height: 1.55; }
.steps .step b { font-weight: 600; }

/* ===== 分享 ===== */
.btn-gold { background: var(--gold-bg); border-color: #E2D0A8; color: #8C6A2F; }
.btn-gold:hover { background: #F3E8CE; border-color: var(--gold); }

.share-mask {
  position: fixed; inset: 0; z-index: 400; background: rgba(42, 37, 33, .5);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.share-mask.on { opacity: 1; }
.share-sheet {
  width: 100%; max-width: 460px; background: var(--card); border-radius: 18px 18px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(20px);
  transition: transform .25s cubic-bezier(.2,.8,.3,1); max-height: 92vh; overflow-y: auto;
}
.share-mask.on .share-sheet { transform: translateY(0); }
.share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.share-title { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; }
.share-x {
  width: 30px; height: 30px; border: none; background: var(--paper-2); border-radius: 50%;
  cursor: pointer; color: var(--ink-2); font-size: 14px; line-height: 1;
}
.share-qr { display: flex; flex-direction: column; align-items: center; margin: 4px 0 16px; }
.qr-box { padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; line-height: 0; }
.qr-box svg { display: block; }
.share-qr-tip { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.share-actions { display: grid; gap: 8px; }
.share-actions .btn { width: 100%; }
.share-url {
  margin-top: 12px; padding: 9px 12px; background: var(--paper-2); border-radius: 8px;
  font-size: 12px; color: var(--ink-2); word-break: break-all; line-height: 1.5; max-height: 66px; overflow-y: auto;
}
.share-note { margin-top: 10px; font-size: 12px; color: var(--ink-3); line-height: 1.65; }

.share-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 16px);
  background: rgba(42, 37, 33, .93); color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 500;
  max-width: 84vw; text-align: center;
}
.share-toast.on { opacity: 1; transform: translate(-50%, 0); }

.wx-guide {
  position: fixed; inset: 0; z-index: 600; background: rgba(0, 0, 0, .78);
  color: #fff; display: flex; flex-direction: column; align-items: center;
}
.wx-arrow { position: absolute; top: 6px; right: 16px; }
.wx-tip { margin: auto 28px auto; text-align: center; line-height: 1.7; }
.wx-tip b { color: #ffd98a; }

.poster-preview {
  position: fixed; inset: 0; z-index: 600; background: rgba(42, 37, 33, .82);
  display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
}
.poster-inner { max-width: min(82vw, 420px); width: 100%; text-align: center; }
.poster-inner img {
  display: block; margin: 0 auto; width: auto; height: auto;
  max-width: 100%; max-height: 66vh;
  border-radius: 14px; box-shadow: 0 18px 56px rgba(0, 0, 0, .5);
}
.poster-tip { color: #fff; font-size: 13px; margin: 12px 0; opacity: .85; }
.poster-acts { display: flex; gap: 10px; margin-bottom: 10px; }
.poster-acts .btn { flex: 1; }

@media (max-width: 640px) {
  .p-brand { gap: 0; min-width: 0; }
  .p-brand span { font-size: 16px; letter-spacing: .1em; white-space: nowrap; }
  .p-brand small { display: none; }
  .p-main { padding: 12px 14px 32px; }
  .p-tabs { padding: 0 14px 8px; }
}

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; display: flex; overflow-x: auto; padding: 10px 0; gap: 2px; }
  .side .brand { display: none; }
  .side a { padding: 8px 14px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .side a.on { border-left: none; border-bottom-color: var(--red-2); }
  .main { padding: 16px 14px 0; }
}
@media (max-width: 400px) {
  .code-cell { width: 44px; height: 56px; font-size: 24px; }
}

/* ---------- 录音与设备自检页（/check） ---------- */
.chk-list { padding: 4px 0; }
.chk-row { display: flex; gap: 10px; padding: 11px 16px; border-top: 1px dashed var(--line); align-items: flex-start; }
.chk-row:first-child { border-top: 0; }
.chk-ico {
  flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; background: var(--paper-2); color: var(--ink-3);
}
.chk-ico.ok { background: var(--green-bg); color: var(--green); }
.chk-ico.warn { background: var(--gold-bg); color: #8C6A2F; }
.chk-ico.bad { background: var(--red-bg); color: var(--red); }
.chk-ico.skip { background: var(--paper-2); color: var(--ink-3); }
.chk-ico.run { background: var(--blue-bg); color: var(--blue); animation: chkPulse 1s ease-in-out infinite; }
@keyframes chkPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.chk-body { flex: 1; min-width: 0; }
.chk-title { font-size: 14px; }
.chk-detail { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; word-break: break-word; }
.chk-detail code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  background: var(--paper-2); padding: 1px 5px; border-radius: 4px; word-break: break-all;
}
.verdict { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.verdict.ok { border-color: #C7DBCB; background: var(--green-bg); }
.verdict.warn { border-color: #E2D0A8; background: var(--gold-bg); }
.verdict.bad { border-color: #EDD3CB; background: var(--red-bg); }
.verdict-t { font-family: var(--serif); font-size: 19px; letter-spacing: .04em; }
.chk-steps { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.chk-steps li { margin-top: 6px; }
.chk-steps code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- 教师端：现场背诵评价 ---------- */
.ev-tbl tbody tr { cursor: pointer; }
.ev-tbl tbody tr.ev-on td { background: var(--gold-bg); }
.ev-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.ev-b {
  border: 0; background: transparent; padding: 4px 12px; cursor: pointer;
  font-size: 13px; color: var(--ink-2); border-left: 1px solid var(--line);
  font-family: var(--serif); letter-spacing: .06em;
}
.ev-b:first-child { border-left: 0; }
.ev-b:hover { background: var(--paper-2); }
.ev-b.on { background: var(--red); color: #FFFDF7; }

/* ---------- 教师端：侧栏里的当前账号 ---------- */
.me-box { padding: 10px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 6px; }
.me-name { font-family: var(--serif); font-size: 15px; color: #F1E7D8; letter-spacing: .06em; }
.me-role { font-size: 11.5px; color: #8B8172; margin-top: 3px; line-height: 1.5; }
.me-box .btn { background: rgba(255,255,255,.08); color: #D8CDBB; border-color: rgba(255,255,255,.12); }
.me-box .btn:hover { background: rgba(255,255,255,.14); }
