/* 项目零件 · 体测成绩批量计算工具（手机 H5）
   全部取值自 tokens.css；缺口零件加在这里，不一处一个数。
   手机规矩（场景规矩.md）：底部 Tab 带字、内容一栏、弹层贴底、点击 ≥44、无悬停态。 */

/* 壳：手机单栏，桌面上居中限宽预览 */
.page { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--bg);
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.page.nobar { padding-bottom: var(--s-5); }

/* 顶栏：返回 + 标题 + 右侧动作 */
.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4); background: var(--bg); }
.appbar .title { flex: 1; min-width: 0; }
.appbar .title .sub { display: block; font-size: var(--fs-xs); color: var(--t3); font-weight: 400; }

/* 底部 Tab（两个：班级 / 设置） */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  display: flex; justify-content: space-around; background: var(--island);
  border-radius: var(--r-island) var(--r-island) 0 0; z-index: 10;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabbar .ti { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 72px; height: 48px; color: var(--t3); font-size: 10px; line-height: 12px;
  border: 0; background: none; cursor: pointer; }
.tabbar .ti svg { width: 20px; height: 20px; }
.tabbar .ti:is(.on, [aria-current="page"]) { color: var(--text); }
.tabbar .ti:active { color: var(--text); }

/* 班级卡（复用 .card 骨架） */
.class-meta { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-top: var(--s-3); }
.kv-mini { display: flex; gap: var(--s-4); margin-top: var(--s-3); }
.kv-mini .k { font-size: var(--fs-xs); color: var(--t3); }
.kv-mini .v { font-family: var(--mono); font-size: 17px; font-weight: 600; line-height: 24px; margin-top: 2px; }

/* 汇总瓷砖行 */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }

/* 项目进度行 */
.pi { display: grid; grid-template-columns: minmax(0, 1fr) 88px auto; gap: var(--s-3); align-items: center;
  padding: 12px 0; position: relative; }
.pi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.pi:first-of-type::before { display: none; }
.pi .n { font-weight: 500; }
.pi .m { font-family: var(--mono); font-size: var(--fs-mono); color: var(--t3); text-align: right; }
.pi .done { color: var(--ok); }

/* 学生行（名单 / 待录队列） */
.srow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center;
  padding: 12px 0; position: relative; }
.srow::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.srow:first-of-type::before { display: none; }
.srow .nm { font-weight: 500; }
.srow .meta { font-size: var(--fs-xs); color: var(--t3); margin-top: 2px; }
.srow .r { display: flex; align-items: center; gap: var(--s-2); font-family: var(--mono); font-size: var(--fs-s); }

/* 录分：当前学生大卡 */
.sc { padding: var(--s-5); }
.sc .who { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.sc .big { width: 100%; height: 56px; text-align: center; font: 600 24px/1 var(--mono); }
.sc .unit { text-align: center; color: var(--t3); font-size: var(--fs-xs); margin-top: var(--s-2); }
.sc .instant { display: flex; align-items: baseline; justify-content: center; gap: var(--s-2);
  margin-top: var(--s-4); min-height: 32px; }
.sc .instant .v { font: 600 26px/1 var(--mono); }
/* 大按钮：button 和 a 共用。a 不像 button 会默认垂直居中，必须 flex 居中，否则文字顶到按钮上缘被裁 */
.bigbtn { display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; height: 52px; padding: 0 var(--s-4); border: 0; border-radius: var(--r-panel);
  background: var(--ink); color: var(--ink-fg); font: 600 var(--fs-read)/1.2 var(--font); cursor: pointer;
  margin-top: var(--s-4); transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.bigbtn:active { transform: scale(0.98); }
.bigbtn:disabled { opacity: 0.45; cursor: default; transform: none; }
.bigbtn.ghost { background: var(--island-3); color: var(--text); }

/* 成绩单：横向滚动 + 首列贴左（首列不换行，防止姓名逐字竖排） */
.grade { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.g-优 { color: var(--ok); background: var(--ok-soft); }
.g-良 { color: var(--acc); background: var(--acc-soft); }
.g-及格 { color: var(--t2); background: var(--island-2); }
.g-不及格 { color: var(--bad); background: var(--bad-soft); }
.sticky-col { position: sticky; left: 0; z-index: 1; background: var(--island); box-shadow: 6px 0 8px -6px rgba(0,0,0,0.18);
  min-width: 68px; white-space: nowrap; }
.table thead .sticky-col { background: var(--island); }

/* 锁定行（目标反算） */
.lockrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 12px 0; position: relative; }
.lockrow::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.lockrow:first-of-type::before { display: none; }

/* 设置行 */
.setrow { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: 14px 0; position: relative;
  border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.setrow::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.setrow:first-of-type::before { display: none; }
.setrow .t { flex: 1; min-width: 0; }
.setrow .d { display: block; font-size: var(--fs-xs); color: var(--t3); margin-top: 2px; }
.setrow .chev { color: var(--t3); flex: none; }
.setrow.danger { color: var(--bad); }

/* 页脚样例声明 */
.fakenote { text-align: center; font-size: var(--fs-xs); color: var(--t3); padding: var(--s-5) 0 var(--s-3); }

/* 标准查看页：单年级大字行（k=得分标签 v=成绩，等宽右对齐） */
.stdrow { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  padding: 10px 0; position: relative; }
.stdrow::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.stdrow:first-of-type::before { display: none; }
.stdrow .k { font-size: 15px; color: var(--t2); }
.stdrow .v { font-family: var(--mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stdrow.key { background: var(--island-2); border-radius: var(--r-ctl); padding-left: var(--s-3); padding-right: var(--s-3); }
.stdrow.key::before { display: none; }
.stdrow.key + .stdrow::before { display: none; }
.stdrow.key .k { color: var(--text); font-weight: 600; }

/* 标准页全表模式：格子加宽、得分列固定（sticky-col 复用成绩单的） */
.table.std-wide th, .table.std-wide td { min-width: 52px; text-align: right; font-size: 13px; }
.table.std-wide th:first-child, .table.std-wide td:first-child { min-width: 44px; text-align: left; }
.table.std-wide tbody tr.std-key-row td { background: var(--island-2); }
.table.std-wide tbody tr.std-key-row td.sticky-col { background: var(--island-2); }

/* 对话框里的多行输入在手机上不给拖拽角 */
.dialog .textarea { resize: none; }

/* 选项行：标题一行、说明换行起，避免孤字 */
.opt { flex-direction: column; align-items: flex-start; gap: 2px; }
.opt .ot { font-size: var(--fs-body); font-weight: 500; color: var(--text); }
.opt .oi { font-size: var(--fs-xs); color: var(--t3); }
