/* 助教 · 糖果教室主题（clay-lite）。三个工具共用；每个工具只改 :root 里的强调色三件套。 */
:root {
  --accent: #DB2777; --accent-2: #F472B6; --accent-deep: #9D174D; --accent-soft: #FCE7F3; --accent-ink: #831843;
  --plus: #16A34A; --plus-soft: #DCFCE7; --plus-ink: #166534;
  --minus: #DC2626; --minus-soft: #FEE2E2; --minus-ink: #991B1B;
  --done: #16A34A; --fix: #F59E0B; --undone: #DC2626;
  --bg: #FFF7ED; --card: #FFFFFF; --ink: #1F2937; --muted: #7C7369; --line: #FFE4CC; --soft: #FFF1E3;
  --radius: 22px; --radius-sm: 16px;
  --shadow-card: 0 10px 24px rgba(234, 88, 12, .10), 0 1px 0 rgba(255,255,255,.9) inset;
  --shadow-float: 0 14px 34px rgba(31, 41, 55, .14);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  background: var(--bg);
  background-image:
    radial-gradient(520px 360px at -10% -8%, rgba(251,146,60,.22), transparent 60%),
    radial-gradient(460px 340px at 110% 8%, rgba(96,165,250,.16), transparent 60%),
    radial-gradient(420px 380px at 50% 110%, rgba(250,204,21,.16), transparent 60%);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:active { transform: translateY(1px); }
main { padding: 14px 14px 16px; padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }

/* 顶栏：标题大一号，右侧小按钮做成药丸 */
.topbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; min-height: 48px; }
.topbar .classname, .topbar .left { flex: 1; font-size: 22px; font-weight: 800; letter-spacing: .5px; text-align: left; }
.topbar .classname { padding: 6px 0; }
.topbar .date { flex: 1; text-align: center; font-size: 19px; font-weight: 800; }
.topbar .date small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.iconbtn { height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px; background: var(--card); font-size: 15px; font-weight: 700; color: var(--accent-ink); box-shadow: var(--shadow-card); border: 2px solid var(--line); }
.iconbtn.text { padding: 0 16px; }
.iconbtn:disabled { opacity: .45; }
.actions { display: flex; gap: 10px; margin-bottom: 12px; }
.btn { flex: 1; height: 48px; border-radius: 999px; background: var(--card); font-weight: 700; font-size: 16px; color: var(--ink); border: 2px solid var(--line); box-shadow: var(--shadow-card); transition: transform .12s, box-shadow .12s; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 6px 0 var(--accent-deep), 0 12px 24px rgba(234,88,12,.25); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--accent-deep), 0 6px 14px rgba(234,88,12,.2); }
.btn.danger { background: var(--minus-soft); color: var(--minus-ink); border-color: #FECACA; }
.btn:disabled { opacity: .45; transform: none; }
.small { height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.small:disabled { opacity: .4; }

/* 分段开关 */
.seg { display: inline-flex; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 12px; box-shadow: var(--shadow-card); }
.seg button { height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }

/* 学生卡片 */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 400px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; background: var(--card); border-radius: var(--radius); border: 2px solid var(--line); min-height: 96px; padding: 14px 14px 12px; text-align: left; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 4px; transition: transform .12s; }
.card:active { transform: scale(.97); }
.card .nm { font-size: 17px; font-weight: 800; }
.card .total { font-size: 36px; font-weight: 900; line-height: 1.05; color: var(--accent); letter-spacing: -1px; }
.card .today { display: inline-block; width: max-content; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.card .today.plus { background: var(--plus-soft); color: var(--plus-ink); }
.card .today.minus { background: var(--minus-soft); color: var(--minus-ink); }
.plus { color: var(--plus-ink); } .minus { color: var(--minus-ink); }

/* 理由按钮 */
.reasons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0; }
.reason { height: 52px; border-radius: var(--radius-sm); color: #fff; font-weight: 800; font-size: 16px; transition: transform .1s; }
.reason.plus { background: linear-gradient(180deg, #22C55E, var(--plus)); box-shadow: 0 5px 0 #15803D; }
.reason.minus { background: linear-gradient(180deg, #EF4444, var(--minus)); box-shadow: 0 5px 0 #B91C1C; }
.reason.custom { background: var(--soft); color: var(--ink); border: 2px solid var(--line); }
.reason:active { transform: translateY(3px); box-shadow: none; }

/* 记录行 */
.log { background: var(--card); border-radius: var(--radius); border: 2px solid var(--line); box-shadow: var(--shadow-card); }
.log .row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 52px; }
.log .row:last-child { border-bottom: 0; }
.log .when { font-size: 12px; color: var(--muted); width: 64px; flex: none; }
.log .who { font-weight: 800; flex: none; }
.log .why { flex: 1; color: var(--muted); font-size: 14px; }
.log .delta { font-weight: 900; flex: none; }
.log .undo { height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 600; }

/* 登记表（作业） */
.grid { background: var(--card); border-radius: var(--radius); border: 2px solid var(--line); overflow-x: auto; box-shadow: var(--shadow-card); }
.grid table { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: 7px 5px; text-align: center; border-bottom: 1px solid var(--line); }
.grid td { vertical-align: middle; }
.grid th { font-size: 13px; color: var(--muted); font-weight: 700; padding-top: 10px; }
.grid th:first-child, .grid td:first-child { text-align: left; padding-left: 12px; width: 1%; white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.name { font-size: 16px; font-weight: 800; padding: 8px 6px 8px 0; min-height: 44px; display: inline-flex; align-items: center; }
.cell { display: block; width: 100%; min-width: 46px; height: 46px; border-radius: 14px; font-size: 20px; font-weight: 800; background: var(--soft); color: var(--muted); border: 2px solid transparent; transition: transform .1s, background .12s; }
.cell:active { transform: scale(.94); }
.cell[data-status="done"] { background: var(--done); color: #fff; box-shadow: 0 3px 0 #15803D; }
.cell[data-status="fix"] { background: var(--fix); color: #fff; box-shadow: 0 3px 0 #B45309; }
.cell[data-status="undone"] { background: var(--undone); color: #fff; box-shadow: 0 3px 0 #991B1B; }

/* 点名：大字舞台与大按钮 */
.stage { position: relative; min-height: 45vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; background: var(--card); border-radius: 28px; border: 2px solid var(--line); box-shadow: var(--shadow-card); overflow: hidden; }
.stage::before { content: ""; position: absolute; inset: auto -20% -40% -20%; height: 60%; background: radial-gradient(closest-side, var(--accent-soft), transparent); opacity: .9; pointer-events: none; }
.stage > * { position: relative; }
.stage .name { font-size: clamp(56px, 16vw, 160px); font-weight: 900; color: var(--accent); line-height: 1.1; word-break: break-all; letter-spacing: -1px; }
.stage .name.rolling { color: var(--muted); }
.stage .name.landed { animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.86); } to { transform: scale(1); } }
.stage .hint { color: var(--muted); font-size: 18px; font-weight: 600; }
.stage .who { font-size: clamp(28px, 8vw, 64px); font-weight: 800; color: var(--accent); margin-bottom: 12px; }
.stage .q { font-size: clamp(28px, 6vw, 56px); font-weight: 700; line-height: 1.35; max-height: 8.2em; overflow-y: auto; word-break: break-word; }
.answer { margin-top: 14px; background: var(--soft); border-radius: 16px; padding: 12px 16px; font-size: 20px; line-height: 1.5; text-align: left; border: 2px solid var(--line); }
.bigbtn { width: 100%; height: 68px; border-radius: 999px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; font-size: 24px; font-weight: 900; margin-top: 14px; letter-spacing: 1px; box-shadow: 0 7px 0 var(--accent-deep), 0 16px 30px rgba(0,0,0,.14); transition: transform .12s, box-shadow .12s; }
.bigbtn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--accent-deep), 0 6px 14px rgba(0,0,0,.12); }
.bigbtn:disabled { opacity: .55; transform: none; }
.small-row { display: flex; gap: 10px; margin-top: 12px; }
.small-row .btn { height: 46px; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 12px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 700; font-size: 15px; box-shadow: var(--shadow-card); }
.toggle .knob { width: 40px; height: 24px; border-radius: 999px; background: #E5E7EB; position: relative; transition: background .15s; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.toggle[aria-pressed="true"] .knob { background: var(--accent); }
.toggle[aria-pressed="true"] .knob::after { left: 19px; }
.toggle:disabled { opacity: .45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.chip.absent { color: var(--muted); text-decoration: line-through; }
.drawn summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); font-weight: 600; }
.drawn summary::-webkit-details-marker { display: none; }
.drawn summary::before { content: "▸"; margin-right: 6px; } .drawn[open] summary::before { content: "▾"; }
body.fullscreen main { padding: 12px; } body.fullscreen .tabs, body.fullscreen .fs-hide { display: none; }
body.fullscreen .stage { min-height: calc(100vh - 140px); }
body.fullscreen .stage .name { font-size: clamp(80px, 22vw, 240px); }
body.fullscreen .stage .q { font-size: clamp(36px, 7vw, 80px); max-height: calc(100vh - 260px); overflow-y: auto; }
.fs-exit { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 700; box-shadow: var(--shadow-float); z-index: 20; }
select.field { height: 48px; font-size: 16px; font-weight: 600; border-radius: 999px; border: 2px solid var(--line); background: var(--card); padding: 0 16px; box-shadow: var(--shadow-card); }

/* 设置页区块 */
.section { background: var(--card); border-radius: var(--radius); border: 2px solid var(--line); padding: 14px 14px 12px; margin-bottom: 14px; box-shadow: var(--shadow-card); }
.section .label, .label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; letter-spacing: .5px; }
.item { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item:last-of-type { border-bottom: 0; }
.item .txt { flex: 1; font-weight: 700; font-size: 16px; }
.addrow { display: flex; gap: 8px; margin-top: 10px; }
.addrow input, .addrow textarea, .field, textarea.field, input.field { flex: 1; min-height: 46px; font-size: 16px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line); background: #fff; outline: none; }
.addrow input:focus, .addrow textarea:focus, .field:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.foot { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; padding: 8px 0 4px; }

/* 空状态 */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty img { width: 220px; height: auto; margin-bottom: 8px; }
.empty p { margin-bottom: 16px; font-weight: 600; }
.empty .btn { flex: none; width: 72%; margin: 0 auto; }

/* 底部悬浮标签栏 */
.tabs { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 4px; padding: 6px; background: rgba(255,255,255,.96); border: 2px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-float); backdrop-filter: blur(10px); z-index: 10; }
.tab { flex: 1; height: 50px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--muted); }
.tab.active, .tab[aria-current] { background: var(--accent-soft); color: var(--accent-ink); }

/* 吉祥物：顶栏右侧一个小贴纸 */
.topbar::after { content: ""; width: 44px; height: 44px; background: url("assets/mascot.png") center/contain no-repeat; order: 99; flex: none; margin-left: 2px; }

/* 提示条与弹层 */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: 92vw; background: #1F2937; color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 600; z-index: 50; box-shadow: var(--shadow-float); }
.toast[hidden] { display: none; }
.toast button { margin-left: 12px; color: #FDE68A; font-weight: 800; text-decoration: underline; min-height: 44px; min-width: 44px; margin-top: -10px; margin-bottom: -10px; }
.has-sheet .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
.sheet-mask { position: fixed; inset: 0; background: rgba(31,41,55,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: up .22s cubic-bezier(.2,1,.3,1); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.sheet h2 small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.sheet textarea, .sheet input { width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: #fff; outline: none; }
.sheet textarea { min-height: 160px; line-height: 1.5; resize: vertical; }
.sheet textarea:focus, .sheet input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.sheet .actions { margin: 12px 0 0; }
.sheet .msg { font-size: 16px; line-height: 1.5; margin: 6px 0 14px; }
.sheet .err { color: var(--minus-ink); font-size: 14px; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 弹层底部按钮行、区块标题、输入框宽度、焦点环 */
.sheet .row, .section .row { display: flex; gap: 10px; margin-top: 12px; }
.sheet .row .btn, .section .row .btn { flex: 1; }
.section h2 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.section .row { align-items: center; }
.field, textarea.field, .roster { width: 100%; display: block; }
textarea.roster { min-height: 150px; line-height: 1.6; resize: vertical; }
button:focus { outline: none; }
button:focus-visible, .cell:focus-visible, .card:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.sheet .reasons + .row, .sheet .row { margin-top: 10px; }

/* 抽题页顶栏：下拉占一整行；舞台里的按钮不要被 flex 拉伸 */
.topbar .left { white-space: nowrap; }
.quizbar { flex-wrap: wrap; row-gap: 10px; }
.quizbar select.field { flex: 1 1 100%; min-width: 0; width: 100%; order: -1; }
.quizbar::after { order: 98; }
.stage .btn, .stage .ansbtn { flex: none; width: auto; min-width: 120px; height: 44px; padding: 0 20px; margin-top: 14px; background: var(--soft); }

/* ---- 课堂互动：倒计时 / 分组 / 转盘 / 计分 ---- */
.presets { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.presets .chipbtn { height:44px; padding:0 16px; border-radius:999px; background:#fff; border:2px solid var(--line); font-weight:700; box-shadow:var(--shadow-card); }
.presets .chipbtn[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-ink); }
.clock { font-size:clamp(72px,24vw,260px); font-weight:900; letter-spacing:-2px; color:var(--accent); font-variant-numeric:tabular-nums; line-height:1; }
.clock.warn { color:var(--minus); animation:tick .9s ease-in-out infinite; }
@keyframes tick { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }
.stage.flash { animation:flash .35s steps(1) 3; }
@keyframes flash { 50% { background:var(--accent-soft); } }
.stepper { display:inline-flex; align-items:center; gap:6px; } .stepper button { width:44px; height:44px; border-radius:50%; background:#fff; border:2px solid var(--line); font-size:22px; font-weight:800; } .stepper b { min-width:36px; text-align:center; font-size:20px; }
.groupcards { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; } @media (min-width:700px){ .groupcards{ grid-template-columns:repeat(4,1fr);} }
.gcard { border-radius:var(--radius); padding:12px 14px; min-height:96px; border:2px solid rgba(0,0,0,.05); } .gcard h3 { font-size:17px; font-weight:800; margin-bottom:6px; } .gcard .mem { font-size:16px; line-height:1.6; } .gcard .mem button { text-decoration:none; padding:2px 6px; border-radius:8px; } .gcard .mem button.out { text-decoration:line-through; color:var(--muted); }
.c0{background:#FCE7F3}.c1{background:#FEF9C3}.c2{background:#DCFCE7}.c3{background:#DBEAFE}.c4{background:#EDE9FE}.c5{background:#FFEDD5}.c6{background:#CCFBF1}.c7{background:#FEE2E2}
.wheelwrap { position:relative; width:min(78vw,420px); aspect-ratio:1; margin:8px auto; } .wheelwrap svg { width:100%; height:100%; transform:rotate(0deg); } .wheelwrap .ptr { position:absolute; top:-6px; left:50%; transform:translateX(-50%); width:0; height:0; border-left:14px solid transparent; border-right:14px solid transparent; border-top:28px solid var(--ink); filter:drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.result { font-size:clamp(32px,9vw,96px); font-weight:900; color:var(--accent); text-align:center; margin-top:10px; }
.scoreboard { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; } body.fullscreen .scoreboard { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.scard { border-radius:var(--radius); padding:12px; text-align:center; border:2px solid rgba(0,0,0,.05); } .scard h3 { font-size:18px; font-weight:800; } .scard .num { font-size:clamp(48px,10vw,140px); font-weight:900; line-height:1.05; } .scard .pm { display:flex; gap:8px; margin-top:8px; } .scard .pm button { flex:1; height:56px; border-radius:16px; font-size:26px; font-weight:900; color:#fff; } .scard .plus { background:var(--plus); box-shadow:0 5px 0 #15803D; } .scard .minus { background:var(--minus); box-shadow:0 5px 0 #B91C1C; } .scard .pm button:active { transform:translateY(3px); box-shadow:none; }

/* 投屏：倒计时大字按视口高度收一收，横屏手机也放得下按钮；转盘横屏时左盘右字 */
body.fullscreen { padding-bottom: env(safe-area-inset-bottom); } /* 标签栏藏了，底部不用再留位 */
body.fullscreen main[data-view="timer"] .stage { min-height: calc(100vh - 200px); }
body.fullscreen main[data-view="timer"] .clock { font-size: clamp(72px, min(24vw, 40vh), 320px); }
body.fullscreen main[data-view="wheel"] .wheelwrap { width: min(78vw, calc(100vh - 230px)); }
@media (orientation: landscape) {
  body.fullscreen main[data-view="wheel"] { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr; column-gap: 32px; min-height: 100vh; align-items: center; }
  body.fullscreen main[data-view="wheel"] .wheelwrap { grid-column: 1; grid-row: 1 / -1; width: min(calc(100vh - 40px), 55vw); margin: 0; }
  body.fullscreen main[data-view="wheel"] .result { grid-column: 2; grid-row: 2; margin: 0 0 8px; word-break: break-all; }
  body.fullscreen main[data-view="wheel"] .bigbtn { grid-column: 2; grid-row: 3; }
  body.fullscreen main[data-view="wheel"] .small-row { grid-column: 2; grid-row: 4; }
}

/* 分组 / 计分 / 设置：控件行、可点组名、名字按钮（≥44px 触控） */
.seg button { height: 44px; }
.groupctl { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; }
.steprow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.steprow .label, .steprow .hint, .absentrow .label { margin: 0; }
.gname { min-height: 44px; padding: 0 6px; margin-left: -6px; border-radius: 10px; font-weight: 800; text-align: left; max-width: 100%; word-break: break-all; }
.scard .gname { width: 100%; margin: 0; text-align: center; }
.gcard h3 { margin-bottom: 2px; }
.gcard .mem { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.gcard .mem button { min-height: 44px; padding: 2px 8px; font-weight: 600; }
.absentrow { margin-top: 12px; }
.absentrow .chips { margin-top: 6px; }
.absentrow .chip { min-height: 44px; }
.item .txt { min-width: 0; word-break: break-all; }
.sheet .flabel { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
body.fullscreen main[data-view="groups"] .groupcards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
body.fullscreen main[data-view="groups"] .gcard h3 { font-size: clamp(20px, 3vw, 36px); }
body.fullscreen main[data-view="groups"] .gcard .mem { font-size: clamp(18px, 2.6vw, 32px); }
body.fullscreen main[data-view="scores"] .scard h3 { font-size: clamp(18px, 2.6vw, 34px); }
body.fullscreen main[data-view="scores"] .scard .num { font-size: clamp(40px, min(10vw, 22vh), 140px); }
body.fullscreen main[data-view="groups"], body.fullscreen main[data-view="scores"] { padding-top: 64px; } /* 给右上角「退出」让位 */

/* ---- 评语助手：评语页 / 全班页 / 句库 ---- */
/* body 固定 100% 高时长页面溢出到 body 外，底部 padding 不生效，最后一行按钮会被悬浮标签栏挡住 */
body { height: auto; min-height: 100%; }
main { max-width: 640px; margin: 0 auto; }
.topbar .date { min-width: 0; word-break: break-all; }
.topbar .iconbtn { flex: none; white-space: nowrap; }

/* 标签卡：五个维度一张卡，每行一种柔色；选中统一玫红渐变白字 */
.d-class { --dim: #DBEAFE; --dim-line: #BFDBFE; --dim-dot: #60A5FA; }
.d-work { --dim: #DCFCE7; --dim-line: #BBF7D0; --dim-dot: #4ADE80; }
.d-moral { --dim: #FEF9C3; --dim-line: #FDE68A; --dim-dot: #FACC15; }
.d-social { --dim: #EDE9FE; --dim-line: #DDD6FE; --dim-dot: #A78BFA; }
.d-advice { --dim: #FFEDD5; --dim-line: #FED7AA; --dim-dot: #FB923C; }
.tagcard { padding: 6px 14px; }
.tagcard .dim { padding: 12px 0; }
.tagcard .dim + .dim { border-top: 2px dashed var(--line); }
.dimtitle { display: flex; align-items: center; gap: 8px; font-size: 15px !important; font-weight: 800; margin-bottom: 10px !important; letter-spacing: .5px; }
.dimtitle .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 2px var(--dim-dot) inset; flex: none; }
.tagcard .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tagcard .chip { min-height: 42px; padding: 0 14px; border-radius: 999px; background: var(--dim); border: 2px solid var(--dim-line); color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.2; max-width: 100%; transition: transform .1s, background .12s; }
.tagcard .chip:active { transform: scale(.96); }
.tagcard .chip.on { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 3px 0 var(--accent-deep), 0 6px 14px rgba(219,39,119,.25); }

/* 评语：信纸（淡粉底、左侧玫红竖条、横格线随文字滚动），字数在右上角小字 */
.rowhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rowhead h2 { margin: 0 !important; }
.rowhead .count { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.rowhead .count:empty { display: none; }
textarea.comment {
  display: block; width: 100%; min-height: 200px; max-height: 70vh; margin-bottom: 14px; resize: vertical; outline: none;
  font: inherit; font-size: 16px; line-height: 1.7; color: var(--ink);
  padding: 10px 14px 10px 18px; border: 0; border-left: 6px solid var(--accent); border-radius: 6px 16px 16px 6px;
  background-color: #FFF5F9;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.7em - 1px), rgba(219,39,119,.13) calc(1.7em - 1px), rgba(219,39,119,.13) 1.7em);
  background-position: 0 10px; background-attachment: local;
  box-shadow: 0 0 0 2px #FBCFE8 inset;
}
textarea.comment:focus { box-shadow: 0 0 0 2px var(--accent-2) inset, 0 0 0 4px var(--accent-soft); }
textarea.comment::placeholder { color: #C08AA5; }
.letter .actions { margin-bottom: 4px; }

/* 全班页：大字进度 + 细进度条，卡片列表 */
.bigstat { display: flex; align-items: baseline; gap: 6px; }
.bigstat .lbl { font-size: 15px; font-weight: 700; color: var(--muted); }
.bigstat .num { font-size: 40px; font-weight: 900; line-height: 1; color: var(--accent); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.bigstat .of { font-size: 20px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin: -4px 0 16px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .3s; }
.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.rows .row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 12px 8px 10px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }
.rows .row:active { transform: scale(.98); }
.rows .row .no { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--soft); }
.rows .row .nm { flex: 1; min-width: 0; font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .row .st { flex: none; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.st-none { background: #F3F4F6; color: #6B7280; }
.st-gen { background: var(--plus-soft); color: var(--plus-ink); }
.st-manual { background: var(--accent-soft); color: var(--accent-ink); }

/* 空状态 */
.empty { display: grid; gap: 16px; padding: 60px 20px; }
.empty p { margin: 0; }

/* 设置页按钮行在窄屏也不挤出去 */
.section .row .btn { min-width: 0; padding: 0 8px; }

/* 句库编辑 */
.bankgroup { display: grid; gap: 6px; margin-bottom: 14px; }
.bankgroup h3 { font-size: 14px; color: var(--muted); }
.bankgroup textarea { width: 100%; min-height: 56px; border-radius: 12px; border: 2px solid var(--line); padding: 8px 10px; font: inherit; line-height: 1.5; resize: vertical; }
.btn.small { height: 36px; font-size: 14px; flex: none; padding: 0 14px; justify-self: start; }
/* 句库弹层很长：底部「关闭/保存」贴底；Chrome 的 sticky 以内容框为界，用负 bottom 盖住弹层底部内边距 */
.sheet .row.sticky { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: var(--card); padding: 10px 0 calc(16px + env(safe-area-inset-bottom)); margin-bottom: calc(-16px - env(safe-area-inset-bottom)); box-shadow: 0 -10px 12px -10px rgba(0,0,0,.1); z-index: 1; }
.sheet .hint + .bankgroup { margin-top: 12px; }
/* 长名字（>6 字）：小一号、最多两行、超出省略 */
.topbar .date.long .nm { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 15px; line-height: 1.25; word-break: break-all; }
