:root{
  --primary:#2F855A;
  --primary-dark:#276749;
  --soft:#F0FFF4;
  --accent:#C05621;
  --accent-soft:#FFF5EB;
  --bg:#F8FAF8;
  --text:#1C4532;
  --text-2:#4A6B5C;
  --line:#C6E6D3;
  --card:#FFFFFF;
  --radius:10px;
  --shadow:0 1px 3px rgba(28,69,50,.06),0 4px 16px rgba(28,69,50,.04);
  --topbar-h:60px;
  /* 字号档位：整体偏小的地方统一从这里调，改一处全局生效 */
  --fs-table:14px;   /* 表格正文（原 13px） */
  --fs-note:13px;    /* 说明 / 图例 / 面包屑等辅助文字（原 12px） */
  --fs-tiny:12px;    /* 胶囊、状态徽标等极小块（不变） */
}
*{box-sizing:border-box;margin:0;padding:0}
html{min-height:100%}
body{min-height:100vh}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg);color:var(--text);line-height:1.6;font-size:15px;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
.wrap{max-width:1180px;margin:0 auto;padding:0 20px}

/* 顶栏 */
.topbar{background:var(--card);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.topbar .wrap{display:flex;align-items:center;justify-content:flex-start;height:var(--topbar-h);gap:16px}
.brand{display:flex;align-items:center;gap:10px;font-weight:600;color:var(--text);font-size:17px;text-decoration:none}
.brand .dot{width:12px;height:12px;border-radius:50%;background:var(--primary);display:inline-block}
.brand:hover{text-decoration:none}
.nav{display:flex;gap:6px;flex-wrap:wrap}
.nav a{padding:7px 14px;border-radius:8px;color:var(--text-2);font-size:14px;text-decoration:none}
.nav a:hover{background:var(--soft);color:var(--primary);text-decoration:none}
.nav a.active{background:var(--primary);color:#fff}

/* 顶栏工具切换（成绩管理 / 试题管理）——颜色跟随各页主题变量 */
.topnav{display:flex;gap:4px;flex:none;margin-left:18px}
.topbar .save-status{margin-left:auto}
.topnav a{padding:7px 13px;border-radius:8px;font-size:14px;color:var(--text-2);text-decoration:none;white-space:nowrap}
.topnav a:hover{background:var(--soft);color:var(--primary);text-decoration:none}
.topnav a.active{background:var(--primary);color:#fff}
.topnav a.active:hover{color:#fff}

/* 按钮 */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 18px;border:1px solid var(--primary);border-radius:var(--radius);
  background:var(--primary);color:#fff;font-size:15px;cursor:pointer;
  font-family:inherit;transition:.15s;text-decoration:none;
}
.btn:hover{background:var(--primary-dark);border-color:var(--primary-dark);text-decoration:none}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.ghost{background:transparent;color:var(--primary)}
.btn.ghost:hover{background:var(--soft)}
.btn.danger{background:transparent;color:var(--accent);border-color:var(--accent)}
.btn.danger:hover{background:var(--accent-soft)}
.btn.sm{padding:6px 12px;font-size:13px;border-radius:8px}

/* 卡片 */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-h{padding:16px 20px;border-bottom:1px solid var(--line);font-weight:600;font-size:16px}
.card-b{padding:20px}
.page-head{padding:34px 0 18px}
.page-head h1{font-size:26px;font-weight:600;letter-spacing:.5px}
.page-head p{color:var(--text-2);margin-top:6px}
.muted{color:var(--text-2)}
.tiny{font-size:13px}
.center{text-align:center}

/* 主页 hero */
.hero{min-height:calc(100vh - 60px);display:flex;align-items:center;justify-content:center;padding:40px 20px}
.hero-inner{max-width:720px;width:100%;text-align:center}
.hero .mark{width:64px;height:64px;border-radius:18px;background:var(--primary);margin:0 auto 22px;
  display:flex;align-items:center;justify-content:center;color:#fff;font-size:28px;font-weight:600}
.hero h1{font-size:32px;font-weight:600;margin-bottom:10px}
.hero .sub{color:var(--text-2);font-size:16px;margin-bottom:34px}
.entries{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px}
.entry{
  display:block;padding:22px 18px;background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);text-align:left;cursor:pointer;
  transition:.15s;color:var(--text);text-decoration:none;
}
.entry:hover{border-color:var(--primary);transform:translateY(-2px);text-decoration:none}
.entry .ic{width:40px;height:40px;border-radius:10px;background:var(--soft);color:var(--primary);
  display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:600;margin-bottom:14px}
.entry h3{font-size:16px;font-weight:600;margin-bottom:4px}
.entry p{font-size:13px;color:var(--text-2)}
.entry.soon{opacity:.6;cursor:default}
.entry.soon:hover{transform:none;border-color:var(--line)}

/* Tab */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:22px;flex-wrap:wrap}
.tabs button{
  border:0;background:transparent;padding:11px 18px;font-size:15px;color:var(--text-2);
  cursor:pointer;font-family:inherit;border-bottom:2px solid transparent;margin-bottom:-1px;
}
.tabs button:hover{color:var(--primary)}
.tabs button.active{color:var(--primary);border-bottom-color:var(--primary);font-weight:600}
.subtabs{display:flex;gap:8px;margin-bottom:18px}
.subtabs button{border:1px solid var(--line);background:var(--card);padding:7px 14px;border-radius:20px;
  font-size:13px;color:var(--text-2);cursor:pointer;font-family:inherit}
.subtabs button.active{background:var(--soft);border-color:var(--primary);color:var(--primary)}
.panel{display:none}
.panel.show{display:block}
.subpanel{display:none}
.subpanel.show{display:block}
.check-list{display:flex;flex-wrap:wrap;gap:8px 14px;max-height:138px;overflow:auto;
  border:1px solid var(--line);border-radius:8px;padding:10px;background:#fff}
.check-list label{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text);
  white-space:nowrap;cursor:pointer}
.check-list input{width:auto;margin:0;accent-color:var(--primary)}
.check-list .retired{opacity:.72}
.clickable-row{cursor:pointer}
.clickable-row:hover{background:var(--soft)}
.spark svg{display:block}
.profile-head{display:flex;gap:16px;flex-wrap:wrap;align-items:flex-end;margin-bottom:16px}
.profile-name{font-size:20px;font-weight:600}
.heat-wrap{max-height:none}
.heat-table{border-collapse:separate;border-spacing:0;font-size:13px;white-space:nowrap}
.heat-table th,.heat-table td{padding:6px 8px;border:1px solid #E8F0EB;text-align:center}
.heat-table thead th{background:var(--soft);position:sticky;top:0;z-index:3}
.heat-table .sticky-col{position:sticky;left:0;z-index:2;background:#fff;font-weight:600}
.heat-table thead .sticky-col{z-index:4;background:var(--soft)}
.heat-cell{display:block;min-width:44px;padding:6px 4px;border-radius:4px;color:#1C4532}

/* 表单 */
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}
.field label{font-size:13px;color:var(--text-2)}
input,select,textarea{
  font-family:inherit;font-size:14px;padding:9px 11px;border:1px solid var(--line);
  border-radius:8px;background:#fff;color:var(--text);outline:none;width:100%;
}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(47,133,90,.12)}
input[type=number]{text-align:center}
.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}
.toolbar{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-bottom:18px}
.toolbar .field{margin:0;min-width:150px}

/* 表格 */
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:var(--radius);background:#fff;max-height:640px}
table{border-collapse:collapse;width:100%;font-size:var(--fs-table);white-space:nowrap}
th,td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:left}
thead th{background:var(--soft);position:sticky;top:0;z-index:2;font-weight:600;color:var(--text);
  border-bottom:2px solid var(--line)}
tbody tr:hover{background:#FAFDFB}
tbody tr:last-child td{border-bottom:0}
td.num,th.num{text-align:center}
td.score-input{padding:4px 5px}
/* 学生成绩录入表：列多，把每列最小宽度从 66 收到 58，12 题的卷子也不用横向滚 */
#studentScoreTable .entry-grid th,#studentScoreTable .entry-grid td{min-width:58px}
#studentScoreTable .entry-grid .row-label{min-width:84px}
td.score-input input{padding:5px 3px;min-width:46px;border-color:transparent;background:transparent}
td.score-input input:hover{border-color:var(--line);background:#fff}
td.score-input input:focus{background:#fff}
.entry-status{display:flex;align-items:center;gap:10px;min-height:24px;margin:-2px 0 10px;flex-wrap:wrap}
.dirty-badge{display:inline-block;padding:2px 9px;border-radius:12px;font-size:12px;
  background:var(--accent-soft);border:1px solid #F0C9A8;color:var(--accent)}
/* 学生管理：轻量未保存标记（无框无底色，只保留小圆点） */
#stuDirty.dirty-badge,#singleDirty.dirty-badge{
  display:inline-flex;align-items:center;gap:7px;padding:4px 2px;
  background:transparent;border:0;border-radius:0;color:#A45A28;
  font-size:12px;font-weight:500;letter-spacing:.01em;
}
#stuDirty.dirty-badge::before,#singleDirty.dirty-badge::before{
  content:"";width:7px;height:7px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 3px rgba(192,86,33,.10);
}
td.score-input.raw input{border-bottom:1px dashed var(--line);color:var(--text)}
td.score-input.conv input{border:1px dashed #A9CDBA;background:#F7FBF8;color:var(--primary)}
td.score-input.conv input::placeholder{color:#9AB3A5}
.entry-grid th,.entry-grid td{min-width:66px;padding:6px 8px}
.entry-grid .row-label{position:sticky;left:0;z-index:3;min-width:88px;background:var(--soft)}
.entry-grid td.row-label{background:#fff;font-weight:600}
.entry-grid input{padding:5px 4px;min-width:56px}
.entry-grid .sum-cell{font-weight:600;background:#F7FBF8}
.entry-grid td.score-static{text-align:center;font-variant-numeric:tabular-nums;color:var(--text)}
.entry-grid td.score-static:empty::after{content:"—";color:#B7C9BE}
.entry-grid td.q-static{text-align:center;font-variant-numeric:tabular-nums;color:var(--text-2)}
.conv-ok{color:var(--primary);font-weight:600}
.conv-bad{color:var(--accent);font-weight:600}
.blank{color:#B7C9BE}
.cell-full{color:var(--text-2);font-size:11px}
.badge{display:inline-block;padding:2px 8px;border-radius:12px;font-size:12px;background:var(--soft);color:var(--primary)}
.badge.mock{background:#EEF2FF;color:#4C51BF}
.low{color:var(--accent);font-weight:600}
.high{color:var(--primary);font-weight:600}
.row-total{background:#F7FBF8;font-weight:600}
.sticky-col{position:sticky;left:0;background:#fff;z-index:1}
thead .sticky-col{background:var(--soft);z-index:3}
tbody tr:hover .sticky-col{background:#FAFDFB}

/* 提示条 */
.notice{padding:12px 16px;border-radius:8px;font-size:14px;margin-bottom:18px;
  background:var(--accent-soft);border:1px solid #F0C9A8;color:#8A3F12}
.notice.info{background:var(--soft);border-color:var(--line);color:var(--text)}
.hidden{display:none!important}

/* 统计卡片 */
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;margin-bottom:22px}
.metric{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow)}
.metric .l{font-size:14px;color:var(--text-2)}
.metric .v{font-size:26px;font-weight:600;margin-top:4px}
.chart-box{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:20px;overflow:auto}
.chart-box h3{font-size:15px;font-weight:600;margin-bottom:14px}
.chart-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.chart-head h3{margin-bottom:0}
.field.compact{margin:0;min-width:130px}
.field.compact label{font-size:12px}
.field.compact select{padding:6px 9px;font-size:13px}
.toolbar.mini{margin:0;gap:8px}
.toolbar.mini .field{min-width:112px}
.sortable{cursor:pointer;user-select:none}
.sortable:hover{color:var(--primary)}
.sort-ind{font-size:10px;margin-left:4px;color:var(--text-2)}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:var(--fs-note);color:var(--text-2);margin-top:12px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:5px;vertical-align:middle}

/* 独立详情页（新标签页）不显示周期表首屏 */
.pf-row{cursor:pointer}
.pf-row.open{background:var(--soft)}
.pf-toggle{display:inline-block;width:14px;color:var(--primary);font-size:12px}
.pf-detail-row>td{padding:0 16px 18px!important;background:var(--soft);height:auto!important;text-align:left!important}
.pf-detail{border:1px solid var(--line);border-radius:9px;background:#fff;padding:14px 16px}
.pf-detail-head{font-weight:600;font-size:14px;margin-bottom:10px}
.pf-detail-table{width:100%;border-collapse:collapse;font-size:13px}
.pf-detail-table th,.pf-detail-table td{padding:7px 8px;border-bottom:1px solid var(--line);text-align:center;height:auto;white-space:nowrap}
.pf-detail-table th{color:var(--text-2);font-weight:500;background:var(--soft)}
.pf-bar{height:9px;border-radius:5px;background:#EDF2EF;overflow:hidden;min-width:110px}
.pf-bar i{display:block;height:100%;border-radius:5px}
.chart-head-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.chart-head-row h3{margin:0}
.chart-head-row select{max-width:220px}

/* 试卷详情（独立标签页） */
.detail-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.detail-head h2{font-size:20px;font-weight:600;word-break:break-all}
/* 详情页面包屑：返回列表标签 / 档案来源 */
.crumb{display:inline-flex;align-items:center;gap:4px;font-size:var(--fs-note);color:var(--text-2);
  margin-bottom:6px;text-decoration:none;cursor:pointer}
.crumb:hover{color:var(--primary);text-decoration:none}
.detail-head .tiny{display:block;margin-top:2px}
.detail-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
a.exam-link,a.stu-name-link{color:var(--primary);text-decoration:none;border-bottom:1px dashed transparent}
a.exam-link:hover,a.stu-name-link:hover{border-bottom-color:var(--primary);text-decoration:none}

.as-section{border:1px solid var(--line);border-radius:9px;padding:12px 14px;margin-bottom:12px}
.as-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.as-head label{font-weight:600;font-size:13px}
.as-actions{display:flex;gap:8px}
.as-grades{display:flex;flex-wrap:wrap;gap:8px 16px}
.as-students{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px;max-height:260px;overflow:auto}
.as-grades label,.as-students label{display:inline-flex;align-items:center;gap:6px;font-size:13px;cursor:pointer;white-space:nowrap}
.as-grades input,.as-students input{width:auto;margin:0;accent-color:var(--primary)}
.as-students label{padding:5px 8px;border:1px solid var(--line);border-radius:6px;background:#fff}
.as-students label.as-student-off{opacity:.72}
/* 弹窗里就地新建学生：姓名 / 届次 / 状态一行排开 */
.as-new{display:flex;gap:8px;flex-wrap:wrap}
.as-new input,.as-new select{margin:0}
.as-new #asNewName{flex:1;min-width:140px}
.as-new #asNewGrade{width:120px}
.as-new #asNewStatus{width:96px}
.as-hint{margin:8px 0 0;font-size:var(--fs-note);color:var(--text-2)}
/* 本次弹窗里新建、还没落盘的学生：虚线框 + “新建”小标签 */
.as-students label.as-student-new{border-style:dashed;border-color:var(--primary);background:#F3FBF7}
.as-students label>.as-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.as-new-tag{flex:0 0 auto;margin-left:5px;padding:0 4px;border-radius:4px;background:var(--primary);color:#fff;
  font-size:10px;line-height:15px}

#examTable .date-triple{justify-content:center;gap:3px;flex-wrap:nowrap}
#examTable .date-triple select{min-width:54px;font-size:12px;padding:4px 3px}
#examTable .date-triple span{font-size:11px}
.date-triple{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.date-triple select{width:auto;min-width:74px;flex:0 1 auto;padding:7px 8px}
.date-triple span{font-size:13px;color:var(--text-2)}

/* 试卷管理 */
.exam-filter-groups{display:grid;grid-template-columns:minmax(180px,1fr) minmax(260px,1.6fr);gap:16px}
.exam-filter-group{border:1px solid var(--line);border-radius:10px;padding:14px 18px;background:var(--soft);transition:opacity .15s}
.exam-filter-group.disabled{opacity:.5}
.exam-filter-group .group-check{display:inline-flex;align-items:center;gap:9px;font-size:16px;font-weight:600;color:var(--text);cursor:pointer;margin-bottom:12px}
.exam-filter-group .group-check input{width:auto;margin:0;accent-color:var(--primary)}
.exam-filter-group .sub-checks{display:flex;flex-wrap:wrap;gap:8px 14px}
.exam-filter-group .sub-checks label{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text);cursor:pointer;white-space:nowrap;background:#fff;border:1px solid var(--line);border-radius:16px;padding:4px 10px}
.exam-filter-group .sub-checks input{width:auto;margin:0;accent-color:var(--primary)}
.exam-filter-foot{display:flex;justify-content:flex-end;align-items:center;gap:12px;margin-top:14px}
#examTable table{width:100%;table-layout:fixed;font-size:15px}
#examTable th,#examTable td{padding:12px 16px;height:52px;text-align:center;vertical-align:middle}
#examTable th:first-child,#examTable td:first-child{text-align:left;padding-left:30px}
#examTable td:nth-child(1) input{min-width:160px}
#examTable td:nth-child(5) input,#examTable td:nth-child(5) select{max-width:130px;margin:0 auto;text-align:center}
#examTable th:nth-child(6),#examTable td:nth-child(6){width:72px;min-width:72px}
#examDirty.dirty-badge{
  display:inline-flex;align-items:center;gap:7px;padding:4px 2px;
  background:transparent;border:0;border-radius:0;color:#A45A28;
  font-size:12px;font-weight:500;letter-spacing:.01em;
}
#examDirty.dirty-badge::before{
  content:"";width:7px;height:7px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 3px rgba(192,86,33,.10);
}
.pager{display:flex;align-items:center;justify-content:center;gap:14px;margin:18px 0;flex-wrap:wrap}
.recent-info{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}
.recent-info .ri{background:var(--soft);border-radius:8px;padding:10px 12px}
.recent-info .ri .l{font-size:12px;color:var(--text-2)}
.recent-info .ri .v{font-size:15px;font-weight:600;margin-top:2px;word-break:break-all}
@media(max-width:760px){.exam-filter-groups{grid-template-columns:1fr}}

/* Toast */
#toast{position:fixed;left:50%;bottom:32px;transform:translateX(-50%);z-index:100;
  display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast-item{background:var(--text);color:#fff;padding:11px 20px;border-radius:8px;font-size:14px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);animation:fadeUp .2s ease}
.toast-item.err{background:var(--accent)}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* 模态 */
.modal-mask{position:fixed;inset:0;background:rgba(28,69,50,.35);z-index:50;display:flex;
  align-items:center;justify-content:center;padding:20px}
.modal{background:#fff;border-radius:var(--radius);width:100%;max-width:460px;box-shadow:0 20px 60px rgba(0,0,0,.2);
  max-height:calc(100vh - 40px);overflow:auto}
.modal .card-h{display:flex;justify-content:space-between;align-items:center}
.modal .x{border:0;background:transparent;font-size:22px;cursor:pointer;color:var(--text-2);line-height:1}
.modal-foot{padding:14px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px}
/* 弹窗里的危险主按钮（如“离开”）：实心红，和“继续编辑”的浅色描边拉开层次 */
.modal-foot .btn.danger{background:#B93C2E;color:#fff;border-color:#B93C2E}
.modal-foot .btn.danger:hover{background:#99291E;border-color:#99291E}

/* ============ 主页专属：B 左文右卡 / 字标 2 无衬线 / 玻璃卡片 ============ */
.home-page{
  --primary:#1E8C7A;
  --primary-dark:#146B5D;
  --bg:#0B2A2A;
  position:relative;min-height:100vh;background:#0B2A2A;
}
.home-page::before{
  content:"";position:fixed;inset:0;z-index:-2;
  background-image:url("bg-home.jpg");
  background-size:cover;background-position:center 42%;background-repeat:no-repeat;
}
.home-page::after{
  content:"";position:fixed;inset:0;z-index:-1;
  background:rgba(7,32,34,.62);
}
.home-page .home-topbar{background:rgba(9,38,40,.55);border-bottom:1px solid rgba(190,224,216,.18);backdrop-filter:blur(8px)}
.home-page .home-topbar .brand{color:#EAF7F2}

.wordmark{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;
  letter-spacing:.18em;font-weight:400}
.wordmark b{font-weight:500;color:#7FE0C0}
.home-topbar .wordmark{font-size:13px;letter-spacing:.22em}

.home-hero{min-height:calc(100vh - 60px);display:flex;align-items:center;padding-top:90px}
.home-split{width:100%;max-width:1180px;margin:0 auto;padding:0 20px;
  display:grid;grid-template-columns:1.15fr .85fr;gap:64px;align-items:center}
.home-kicker{font-size:11px;letter-spacing:.34em;color:#6FC7AB;margin-bottom:18px}
.home-intro{position:relative;padding:26px 28px;margin-left:-28px;border-radius:14px;
  background:radial-gradient(ellipse at 30% 50%,rgba(4,26,26,.72),rgba(4,26,26,0) 78%)}
.home-intro h1.wordmark{font-size:clamp(26px,3.4vw,46px);line-height:1.28;
  color:#F2FBF8;letter-spacing:.16em;margin:0;text-shadow:0 2px 14px rgba(0,0,0,.8)}

.home-cards{display:flex;flex-direction:column;gap:14px}
.home-card{
  display:flex;align-items:center;gap:16px;padding:18px 20px;text-decoration:none;
  background:rgba(240,252,247,.10);border:0.5px solid rgba(214,244,232,.26);
  border-radius:12px;color:#EAF7F2;backdrop-filter:blur(7px);transition:.15s;
}
.home-card:hover{background:rgba(240,252,247,.17);border-color:rgba(127,224,192,.5);text-decoration:none;transform:translateY(-2px)}
.home-card.soon{opacity:.8;cursor:default}
.home-card.soon:hover{transform:none;background:rgba(240,252,247,.10);border-color:rgba(214,244,232,.26)}
.home-card-ic{width:44px;height:44px;flex:0 0 44px;border-radius:10px;
  background:rgba(127,224,192,.16);color:#8FE8CA;display:flex;align-items:center;
  justify-content:center;font-size:18px;font-weight:500}
.home-card-txt{flex:1;min-width:0}
.home-card-txt h3{font-size:15px;font-weight:500;margin:0 0 3px;letter-spacing:.06em}
.home-card-txt p{font-size:12px;color:#9FC4B6;margin:0}
.home-card-arrow{font-size:18px;color:#7FE0C0}
.home-card.soon .home-card-arrow{color:#7FA99A}

@media(max-width:760px){
  .home-split{grid-template-columns:1fr;gap:34px;padding:48px 20px}
  .home-intro h1.wordmark{font-size:30px}
}

/* ============ 成绩管理页：顶部周期表滚动交互 ============ */
.scores-page{background:var(--bg)}
.ptable-hero{
  position:fixed;top:var(--topbar-h);left:0;right:0;z-index:5;
  height:calc(100vh - var(--topbar-h));min-height:420px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:16px 20px 22px;background:var(--bg);
  transform:translateY(-110%);opacity:0;pointer-events:none;
  transition:transform .3s ease,opacity .3s ease;
  will-change:transform,opacity;
}
html.hero-open .ptable-hero{transform:translateY(0);opacity:1;pointer-events:auto}
.ptable-frame{
  width:100%;max-width:1600px;height:100%;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.ptable-frame img{width:100%;height:100%;object-fit:contain;display:block}
.ptable-hint{margin-top:12px;font-size:13px;color:var(--text-2);letter-spacing:.05em;transition:opacity .2s;cursor:pointer}
.ptable-hint:hover{color:var(--primary)}

/* 顶端提示条：只有回到页面顶端才出现，右对齐的小字，不抢版面 */
.hero-tip{
  display:flex;align-items:center;justify-content:flex-end;gap:5px;
  height:16px;padding:0;margin:0 2px 2px;
  font-size:11px;letter-spacing:.02em;color:#8FAEA1;
  user-select:none;opacity:0;transform:translateY(-2px);
  transition:opacity .25s ease,transform .25s ease,color .25s ease;
}
html.at-top .hero-tip{opacity:1;transform:translateY(0)}
html.at-top .hero-tip.ready{color:var(--primary)}
.hero-tip-ic{display:inline-block;font-size:10px;line-height:1}
html.at-top .hero-tip.ready .hero-tip-ic{animation:heroTipBounce 1.1s ease-in-out infinite}
@keyframes heroTipBounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){
  html.at-top .hero-tip.ready .hero-tip-ic{animation:none}
  .ptable-hero{transition:none}
}
.scroll-pad{height:0}
.main-content{position:relative;z-index:2;background:var(--bg);padding-top:8px;padding-bottom:60px;
  border-radius:18px 18px 0 0;box-shadow:0 -8px 24px rgba(28,69,50,.06)}
.main-content .tabs{position:sticky;top:var(--topbar-h);z-index:6;background:var(--bg);padding-top:6px}

/* 开关 */
.switch{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--text-2);cursor:pointer;align-self:flex-end;padding-bottom:10px}
.switch input{width:auto;margin:0;accent-color:var(--primary)}

/* 学生管理表格内的可编辑控件 */
.stu-edit{width:100%;min-width:70px;padding:5px 7px;font-size:13px;border:1px solid transparent;background:transparent}
.stu-edit:hover{border-color:var(--line);background:#fff}
.stu-edit:focus{background:#fff}
.stu-name-link{color:var(--primary);cursor:pointer;text-decoration:none;border-bottom:1px dashed transparent}
.stu-name-link:hover{border-bottom-color:var(--primary);text-decoration:none}
.stu-op{width:58px;min-width:58px}
.btn.sm.stu-del{font-size:17px;line-height:1;padding:3px 9px}
/* 学生管理表格：字号更大、留白更紧凑 */
#studentTable table{width:100%;table-layout:fixed;font-size:15px}
/* 只读态 6 列：姓名 / 届次 / 参加考试 / 平均得分率 / 最近一次 / 在竞状态 */
#studentTable th:nth-child(1),#studentTable td:nth-child(1){width:26%}
#studentTable th:nth-child(2),#studentTable td:nth-child(2){width:12%}
#studentTable th:nth-child(3),#studentTable td:nth-child(3){width:14%}
#studentTable th:nth-child(4),#studentTable td:nth-child(4){width:17%}
#studentTable th:nth-child(5),#studentTable td:nth-child(5){width:16%}
#studentTable th:nth-child(6),#studentTable td:nth-child(6){width:15%}
/* 编辑态 7 列：多一列“操作” */
#studentTable table.stu-editing th:nth-child(1),#studentTable table.stu-editing td:nth-child(1){width:24%}
#studentTable table.stu-editing th:nth-child(2),#studentTable table.stu-editing td:nth-child(2){width:11%}
#studentTable table.stu-editing th:nth-child(3),#studentTable table.stu-editing td:nth-child(3){width:13%}
#studentTable table.stu-editing th:nth-child(4),#studentTable table.stu-editing td:nth-child(4){width:15%}
#studentTable table.stu-editing th:nth-child(5),#studentTable table.stu-editing td:nth-child(5){width:14%}
#studentTable table.stu-editing th:nth-child(6),#studentTable table.stu-editing td:nth-child(6){width:14%}
#studentTable table.stu-editing th:nth-child(7),#studentTable table.stu-editing td:nth-child(7){width:9%}
#studentTable th,#studentTable td{padding:12px 16px;height:52px;text-align:center;vertical-align:middle}
#studentTable th:first-child,#studentTable td:first-child{text-align:left;padding-left:30px}
#studentTable .stu-name-link{font-size:16px;font-weight:600}
#studentTable .stu-count{font-size:16px;font-weight:600;color:var(--text)}
.stu-grade-edit{max-width:88px;margin:0 auto;text-align:center}
.stu-status-edit{max-width:94px;margin:0 auto;text-align:center;padding:5px 8px}
.grade-pill{
  display:inline-block;min-width:62px;padding:4px 12px;border-radius:12px;
  border:1px solid var(--pill-bd);background:var(--pill-bg);color:var(--pill-fg);
  font-size:14px;font-weight:500;line-height:1.5;white-space:nowrap;
}
.status-badge{display:inline-block;padding:3px 10px;border-radius:12px;font-size:12px;white-space:nowrap}
.status-badge.on{background:var(--soft);color:var(--primary)}
.status-badge.off{background:var(--accent-soft);color:var(--accent)}
.retired-row{opacity:.88}
.pending-add{background:#F2FBF5}
.pending-add td:first-child::before{content:"新增 ";font-size:11px;color:var(--primary)}

/* 折线图 / 直方图容器 */
.line-wrap svg,.hist-wrap svg{display:block;width:100%;height:auto}
.chart-note{font-size:var(--fs-note);color:var(--text-2);margin-top:8px}

/* ===== 保存状态（顶栏右侧，一直在，不闪走） ===== */
.save-status{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--text-2);
  letter-spacing:.02em;white-space:nowrap;transition:color .2s}
.save-status::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--line)}
.save-status.ok{color:var(--primary)}
.save-status.ok::before{background:var(--primary)}
.save-status.pending{color:#A45A28}
.save-status.pending::before{background:#A45A28}
.save-status.flash{animation:saveFlash 1.1s ease-out}
@keyframes saveFlash{0%{transform:translateY(-2px);opacity:.4}100%{transform:translateY(0);opacity:1}}

/* ===== 试卷详情：上一份 / 下一份 ===== */
.exam-nav{display:inline-flex;align-items:center;gap:6px}

/* ===== 小题数量步进器 ===== */
.stepper{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:8px;
  background:#fff;overflow:hidden;height:38px}
.stepper .step-btn{width:34px;height:100%;border:0;background:transparent;color:var(--text-2);
  font-size:16px;line-height:1;cursor:pointer;transition:.15s}
.stepper .step-btn:hover:not(:disabled){background:var(--soft);color:var(--primary)}
.stepper .step-btn:disabled{color:#C6D6CC;cursor:not-allowed}
.stepper .step-val{min-width:40px;text-align:center;font-size:14px;font-weight:600;color:var(--text);
  border-left:1px solid var(--line);border-right:1px solid var(--line);line-height:36px}

/* ===== 档案页切换学生 ===== */
.profile-switch{max-width:170px;padding:4px 8px;font-size:13px;border-color:var(--line);background:#fff;color:var(--text-2)}

/* ===== 指标卡单位 ===== */
.metric .unit{font-size:14px;font-weight:500;color:var(--text-2);margin-left:3px}

/* ===== 成绩录入表头的小字（每题满分） ===== */
.th-sub{display:block;font-size:11px;font-weight:400;color:var(--text-2);line-height:1.2;margin-top:2px}

/* ============ 其他功能：打印预览与打印输出 ============ */
.sheet-preview{margin-top:6px;padding:14px;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:auto}
.sheet{font-size:13px;color:var(--text)}
.sheet h1{font-size:18px;font-weight:600;text-align:center;margin-bottom:8px}
.sheet-meta{display:flex;flex-wrap:wrap;gap:6px 18px;justify-content:center;color:var(--text-2);font-size:12px;margin-bottom:12px}
.sheet table{width:100%;border-collapse:collapse}
.sheet th,.sheet td{border:1px solid var(--line);padding:5px 8px;text-align:left}
.sheet th{background:var(--soft);font-weight:600}
.sheet .num{text-align:right}
.sheet-foot{margin-top:10px;font-size:11px;color:var(--text-2);text-align:right}
#printRoot{display:none}
@media print{
  body.printing > *{display:none!important}
  body.printing #printRoot{display:block!important;position:static}
  body.printing{background:#fff}
  #printRoot .sheet h1{font-size:17px}
  #printRoot .sheet table{font-size:12px}
  @page{margin:14mm}
}

/* 响应式 */
@media(max-width:640px){
  .page-head h1{font-size:22px}
  .hero h1{font-size:26px}
  .tabs button{padding:10px 12px;font-size:14px}
  :root{--topbar-h:56px}
  .topbar .wrap{height:var(--topbar-h);min-height:0;padding-top:0;padding-bottom:0;flex-wrap:nowrap}
  .topbar .brand{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .ptable-hero{top:var(--topbar-h);height:calc(100vh - var(--topbar-h));min-height:420px}
  .main-content .tabs{top:var(--topbar-h)}
  /* 添加学生弹窗：窄屏改两列，避免挤成一团 */
  .as-students{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:420px){
  .as-students{grid-template-columns:1fr}
}

/* ============================================================================
 * 公网版新增样式（追加到原 style.css 末尾；原视觉令牌与字号体系保持不变）
 *   - 只读横幅（§7.6 WRITE_DISABLED）
 *   - 空态（UX-02）
 *   - 焦点环（NFR-08）
 *   - 周期表 CSS 渐变占位（1.5 MB 原图不入 public）
 *   - 登录页 / 状态页 / 回收站表格
 * ========================================================================== */

/* ---------- 焦点可见（NFR-08：键盘可达） ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}
.tabs button:focus-visible,
.topnav a:focus-visible,
.skip-link:focus-visible {
  outline-offset: -2px;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 60;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  font-size: 14px;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; }

/* ---------- 顶栏右侧（保存状态 / 用户 / 退出） ---------- */
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-right .save-status { margin-left: 0; }
.user-chip {
  font-size: 12px;
  color: var(--text-2);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
button:disabled,
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.25);
}

/* ---------- 只读横幅（§7.6） ---------- */
.readonly-banner {
  margin: 0 0 16px;
  border: 1px solid #E6C98F;
  background: #FDF6E7;
  color: #7A5312;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.readonly-banner.hidden { display: none; }
.rb-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rb-ic { font-size: 15px; }
.rb-text { flex: 1 1 320px; min-width: 0; }
.rb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.readonly-banner .btn { background: #fff; }

/* ---------- 空态（UX-02） ---------- */
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  background: var(--card);
  margin: 8px 0;
}
.empty-state .es-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state .es-hint {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 12px;
}
.empty-state .btn { margin-top: 2px; }

/* ---------- 周期表占位（不引入 1.5 MB 原图） ---------- */
.ptable-placeholder {
  background:
    radial-gradient(circle at 12% 18%, rgba(47,133,90,.42), transparent 42%),
    radial-gradient(circle at 82% 26%, rgba(192,86,33,.34), transparent 46%),
    radial-gradient(circle at 46% 78%, rgba(76,81,191,.32), transparent 52%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 2px, transparent 2px 9%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.12) 0 2px, transparent 2px 14%),
    linear-gradient(160deg, #1C4532 0%, #2F855A 45%, #14342A 100%);
  border-radius: 10px;
}

/* ---------- 回收站 / 审计 / 快照表 ---------- */
.trash-panel { margin-top: 14px; }
.trash-panel:empty { display: none; }
.trash-panel table { font-size: 13px; }
.trash-panel code {
  background: var(--soft);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
}

/* ---------- 登录页 / 状态页（共用令牌，独立页面） ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background:
    radial-gradient(circle at 15% 12%, rgba(47,133,90,.10), transparent 40%),
    radial-gradient(circle at 88% 88%, rgba(192,86,33,.09), transparent 42%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(20,52,42,.10);
  padding: 26px 26px 22px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 16px;
}
.auth-brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(47,133,90,.16);
}
.auth-title {
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.auth-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 20px;
  line-height: 1.7;
}
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
}
.auth-field input:focus { border-color: var(--primary); }
.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-submit:disabled { opacity: .6; cursor: progress; }
.auth-alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.65;
  border: 1px solid #E7BFC6;
  background: #FBEEF0;
  color: #9A4B5B;
}
.auth-alert.hidden { display: none; }
.auth-alert.info {
  border-color: var(--line);
  background: var(--soft);
  color: var(--text);
}
.auth-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
}
.auth-note summary { cursor: pointer; color: var(--primary); }
.auth-note form { margin-top: 12px; }
.auth-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.status-card { text-align: center; }
.status-code {
  font-size: 44px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.1;
  margin: 4px 0 8px;
  letter-spacing: .02em;
}
.status-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
@media (max-width: 480px) {
  .auth-card { padding: 20px 18px; }
  .status-code { font-size: 36px; }
}

/* ---------- 视觉隐藏但保留给读屏（axe 的 heading-order / page-has-heading-one） ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
 * 对比度与窄屏修正（axe color-contrast / 390px 横向溢出）
 * 色相仍是墨绿（--primary #2F855A）与赭石（--accent #C05621），只把「浅底上的文字」
 * 加深一档到 AA 4.5:1 以上；按钮底色、边框、图表色板一律不动。
 * ========================================================================== */
:root {
  --primary-text: #25714B;   /* #2F855A 在 #F8FAF8 上只有 4.33:1 → 加深到 5.7:1 */
  --accent-text: #9A4415;    /* #C05621 在 #FFF5EB 上只有 4.27:1 → 加深到 6.1:1 */
}
.tabs button.active,
.status-badge.on,
.high,
.save-status.ok,
.ptable-hint:hover,
.hero-tip.ready,
html.at-top .hero-tip.ready {
  color: var(--primary-text);
}
.status-badge.off,
.low,
.conv-bad,
.btn.danger {
  color: var(--accent-text);
}
.hero-tip { color: #4E6B5D; }

/* 窄屏（≤640）：顶栏不再溢出（原站顶栏 + 用户信息在 390px 宽下超宽 49px） */
@media (max-width: 640px) {
  .topbar .wrap { gap: 8px; min-width: 0; }
  .topnav { display: none; }
  .user-chip { display: none; }
  .topbar-right { gap: 6px; flex: 0 1 auto; min-width: 0; }
  .topbar .save-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
  .ptable-hero { width: 100%; }
}

/* 正文链接：墨绿文字在浅底上同样要过 AA（axe color-contrast，14 个学生姓名链接） */
a,
.crumb:hover,
a.exam-link,
a.stu-name-link,
.stu-name-link {
  color: var(--primary-text);
}
a.exam-link:hover,
a.stu-name-link:hover,
.stu-name-link:hover {
  border-bottom-color: var(--primary-text);
}

/* 顶端提示条去动画：原实现用 opacity 0→1 过渡，审计/慢网络下会停在半透明中间态
   （axe color-contrast 因此判不过）。改成 display 切换 + 不透明，视觉上只是少了淡入。 */
.hero-tip {
  display: none;
  opacity: 1;
  transform: none;
  transition: none;
  color: #4E6B5D;
}
html.at-top .hero-tip {
  display: flex;
  opacity: 1;
  transform: none;
}

/* 幽灵按钮的文字色同样要在浅底上过 AA（axe：pager / 次要按钮 4.39:1 → 5.7:1） */
.btn.ghost,
.btn.ghost:hover {
  color: var(--primary-text);
}

/* 视觉评审 M3 P0：概览页「学生表现」表原本被 .table-wrap 的 max-height:640px 截断，
   边界处会出现「只显示上半截」的行。该表改为整表展示（由页面自身滚动），边界不再切行。 */
#ovTable { max-height: none; }

/* 其余需要滚动的表格：底部留一点内边距 + 渐隐提示还有内容，避免看起来像被硬切。 */
.table-wrap:not(#ovTable) {
  padding-bottom: 2px;
}
.table-wrap:not(#ovTable):has(tbody tr) {
  background-image: linear-gradient(to top, rgba(255,255,255,0.92), rgba(255,255,255,0));
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 14px;
}

/* EDIT-07 / P1-4：CONFLICT_VERSION 冲突格标记（服务端值与本地输入并存，不整页 reload） */
.entry-grid td.is-conflict {
  outline: 2px solid #C53030;
  outline-offset: -2px;
  background-image: linear-gradient(rgba(197,48,48,0.10), rgba(197,48,48,0.10));
}
.entry-grid td .conflict-note {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  color: #C53030;
  white-space: nowrap;
}
.entry-grid td .conflict-row-note {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  color: #C53030;
}

/* ===== round-2 修复（vu-3）：只读态写入入口 + 危险入口提示 ===== */
/* BUG-1：写入入口在只读态用 aria-disabled（仍可聚焦/点击），点击由 JS toast 给出明确原因 */
.btn.readonly-gate,
.btn[aria-disabled="true"],
.step-btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  background: #F3F5F4;
  color: var(--text-2);
  border-color: var(--border);
}
.btn.readonly-gate:hover,
.btn[aria-disabled="true"]:hover,
.step-btn[aria-disabled="true"]:hover {
  background: #F3F5F4;
  border-color: var(--border);
  color: var(--text-2);
  text-decoration: none;
}
.btn.readonly-gate:focus-visible,
.btn[aria-disabled="true"]:focus-visible {
  outline: 2px dashed var(--text-2);
  outline-offset: 2px;
}
/* BUG-4：整库回滚危险样式（红色边框/文字），禁用时置灰但仍保留警示语义 */
.btn.danger.rollback-entry,
#rollbackEntry {
  border-color: #B93C2E;
  color: #B93C2E;
  font-weight: 500;
}
#rollbackEntry:not(:disabled) {
  background: #FDECEA;
}
#rollbackEntry:disabled {
  opacity: .55;
  cursor: not-allowed;
}
#rollbackHint {
  line-height: 1.5;
}

/* ============================================================================
 * round-2 修复（vu-4 手机 390×844）：横向拖动提示 / 触控命中区 ≥44px / 字号下限 12px /
 * 学生名单表收窄。全部在 @media(max-width:430px) 内，桌面（≥431px）布局与观感不变。
 * ========================================================================== */

/* 横拖提示元素默认不占位：只有 mobile.js 在「真超宽容器」前插入它，窄屏才显示 */
.hscroll-hint { display: none; }

@media (max-width: 430px) {
  /* ---------- P2-1：超宽表格的横拖提示 + 常显细滚动条 + 右缘渐隐 ---------- */
  .table-wrap {
    scrollbar-width: thin;
    scrollbar-color: #8FBFA8 #F1F6F2;
  }
  .table-wrap::-webkit-scrollbar { height: 9px; }
  .table-wrap::-webkit-scrollbar-track { background: #F1F6F2; border-radius: 5px; }
  .table-wrap::-webkit-scrollbar-thumb { background: #9CC7AF; border-radius: 5px; }
  /* 提示条是容器前面的独立一行（不参与容器内滚动），字号 12px、右对齐不挡表头 */
  .hscroll-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin: 0 0 5px;
    font-size: 12px;
    line-height: 1.5;
    color: #4E6B5D;
    letter-spacing: .01em;
  }
  .hscroll-hint.is-gone { display: none; }
  /* 右缘渐隐：背景层不随内容横向滚动，滚到最右端（.hs-at-end）就撤掉；
     再叠一条 inset 阴影，白底表格上也能看出「右边还有内容」 */
  .table-wrap.is-hscroll {
    background-image:
      linear-gradient(to left, rgba(255,255,255,.97) 0, rgba(255,255,255,0) 24px),
      linear-gradient(to top, rgba(255,255,255,.92) 0, rgba(255,255,255,0) 14px);
    background-position: right top, left bottom;
    background-size: 24px 100%, 100% 14px;
    background-repeat: no-repeat;
    box-shadow: inset -10px 0 10px -8px rgba(28,69,50,.30);
  }
  .table-wrap.is-hscroll.hs-at-end {
    background-image: linear-gradient(to top, rgba(255,255,255,.92) 0, rgba(255,255,255,0) 14px);
    background-position: left bottom;
    background-size: 100% 14px;
    box-shadow: none;
  }

  /* ---------- P2-2：主要可点区域 ≥44px（只加 padding / min-height，不放大字体） ---------- */
  .tabs button { min-height: 44px; padding: 9px 12px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 44px; padding: 8px 12px; }
  .auth-submit { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea { min-height: 44px; }
  .stepper { height: 44px; }
  .stepper .step-btn { min-height: 44px; }
  .pager .btn { min-height: 44px; }
  .modal .x { min-width: 44px; min-height: 44px; }
  .skip-link { padding: 13px 16px; }
  .topbar .brand { min-height: 44px; }
  /* 学生姓名 / 试卷名链接：用 padding 把命中区撑到 ≥44px，负 margin 抵消排版位移 */
  a.stu-name-link,
  .stu-name-link,
  a.exam-link {
    display: inline-block;
    padding: 11px 4px;
    margin: -11px -4px;
  }
  /* 筛选 checkbox：本体仍是 13×13，让整条 label 可点且行高 ≥44px */
  .check-list label { min-height: 44px; padding: 2px 1px; }
  .exam-filter-group .group-check,
  .exam-filter-group .sub-checks label,
  .as-grades label,
  .as-students label { min-height: 44px; }

  /* ---------- P2-3：字号下限 12px（图表刻度统一到 12px，x 轴标签不再 9px） ---------- */
  .cell-full,
  .sort-ind,
  .pf-toggle,
  .hero-tip,
  .hero-tip-ic,
  .th-sub,
  .sheet-foot,
  #examTable .date-triple span,
  .pending-add td:first-child::before { font-size: 12px; }
  .line-wrap text,
  .hist-wrap text,
  .bar-wrap text { font-size: 12px; }

  /* ---------- P3：学生名单表 390px 下不再横向溢出（列宽收紧 + 表头允许换行） ---------- */
  #studentTable th,
  #studentTable td { padding: 8px 5px; }
  #studentTable th:first-child,
  #studentTable td:first-child { padding-left: 8px; }
  #studentTable th { font-size: 12px; white-space: normal; line-height: 1.3; }
  #studentTable .stu-name-link { font-size: 14px; }
  .grade-pill { min-width: 0; padding: 3px 8px; font-size: 12px; }
}

/* ==========================================================================
 * round-4 VU-6 修复补丁（只加样式，不改既有选择器语义）
 *   BUG-2 未保存拦截：二次点击时轻抖提示
 *   BUG-4 回收站：批次行标题区（整批恢复）
 *   BUG-5 审计：前 → 后 结构化展示
 *   BUG-6 保存区常驻可点 + 点击即反馈
 * ========================================================================== */

/* 保存区：长表格编辑时始终留在视口内（VU-6 BUG-6「保存并退出偶发点不到」） */
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 7;
  padding: 10px 0 8px;
  background: linear-gradient(to top, var(--card) 72%, rgba(255, 255, 255, 0));
  scroll-margin-block: calc(var(--topbar-h) + 72px);
}
.save-bar .btn { scroll-margin-top: calc(var(--topbar-h) + 24px); }
.btn.is-saving { opacity: .72; cursor: progress; }

/* 未保存拦截弹窗：重复点击标签时把已有弹窗「顶一下」，而不是静默吞掉点击 */
.modal-mask.pulse .modal { animation: dlgPulse .36s ease; }
@keyframes dlgPulse {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-6px); }
  70% { transform: translateY(3px); }
}

/* 审计「前 → 后」：对象/长文本折叠展开，字段级 diff 逐行展示 */
.audit-val { display: inline-block; max-width: 34vw; vertical-align: top; }
.audit-obj summary { cursor: pointer; color: var(--primary); font-size: 12px; }
.audit-obj pre {
  margin: 6px 0 0; padding: 8px; background: var(--soft); border: 1px solid var(--line);
  border-radius: 6px; font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto;
}
.audit-diff { font-size: 12px; }
.audit-diff li { list-style: none; margin: 2px 0; }
.audit-diff .k { color: var(--text-2); }

/* 回收站：名称 + 整批恢复 */
.trash-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.trash-name { font-weight: 600; }
.trash-sub { color: var(--text-2); font-size: 12px; }

/* ============================================================================
 * v1.3 账号体系（契约 §7.8 / §5.9~§5.13；需求 FR-AUTH-11..13、FR-ACC-01..05）
 *   · 登录页注册态：橙色小字入口（--accent 系，文字用 AA 的 --accent-text）
 *   · 账号管理页：我的账号 / 邀请码 / 全局写入开关 / 账号列表
 * 只复用既有变量与卡片风格，不引入新依赖。
 * ========================================================================== */

/* ---------- 登录页：登录态 / 注册态同页切换 ---------- */
.auth-state[hidden] { display: none; }
.auth-switch-row { margin: 14px 0 2px; display: flex; }
.auth-switch {
  border: 0;
  background: transparent;
  margin: 0;
  padding: 6px 0;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
}
.auth-switch:hover { color: var(--accent); }
.auth-switch:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}
/* 已知注册关闭：入口保留（不隐藏、不灰成死链），只降对比度 + 点击提示 */
.auth-switch.is-disabled {
  color: var(--text-2);
  text-decoration: none;
  cursor: help;
}

/* ---------- 账号管理页 ---------- */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.account-form {
  min-width: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.account-form h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.account-form .auth-field { margin-bottom: 12px; }
.account-form .btn { width: 100%; margin-top: 4px; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.account-card { margin-bottom: 18px; }
.acct-alert {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #E7BFC6;
  background: #FBEEF0;
  color: #9A4B5B;
}
.acct-alert.hidden { display: none; }
.acct-alert.info { border-color: var(--line); background: var(--soft); color: var(--text); }
.account-code {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: .04em;
  word-break: break-all;
}
.account-note-input {
  width: 100%;
  min-width: 160px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.account-note-input:focus { border-color: var(--primary); }
.account-note-cell { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 220px; }
.account-note-counter { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.account-note-counter.over { color: var(--accent-text); font-weight: 600; }
#acctUsersTable td { vertical-align: top; }
#acctUsersTable .account-note-cell { min-width: 0; }
.account-meta { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }

/* ≤430px：小字入口与账号页按钮补足 44px 触控命中区（不放大字号） */
@media (max-width: 430px) {
  .auth-switch { min-height: 44px; padding: 10px 0; }
  .account-grid { grid-template-columns: 1fr; }
}
