:root {
  --bg: #f2f7f4;
  --card: #ffffff;
  --ink: #17251e;
  --muted: #66786f;
  --primary: #1f9d6b;
  --primary-d: #12744d;
  --accent: #2489cc;
  --accent-d: #1c6ba3;
  --warn: #e08e0b;
  /* 阶段3修复：语义色 token——状态色统一来源，替代散落各页的硬编码色值 */
  --success: #1f9d6b;
  --danger: #c0392b;
  --pending: #e08e0b;
  /* 第三批：语义色浅底/描边变体（状态标签、提示条统一来源） */
  --success-bg: #e9f7ef;
  --success-bd: #b7e4c7;
  --danger-bg: #fdeaea;
  --danger-bd: #f5b5b5;
  --pending-bg: #fff8e6;
  --pending-bd: #ffe1a8;
  --info: #3a5ccf;
  --info-bg: #eef2ff;
  --info-bd: #b9c8e8;
  --purple: #6a3ab2;
  --purple-bg: #f3ecfe;
  --neutral-bg: #f0f2f1;
  --line: #e2eae5;
  --radius: 14px;
  --radius-lg: 18px;
  /* 第三批：间距阶梯 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  /* 第三批：字号阶梯 */
  --fs-xs: 11px; --fs-sm: 12px; --fs-base: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px;
  --ease: cubic-bezier(.22, .68, .32, 1);
  --shadow-sm: 0 1px 2px rgba(23,37,30,.05), 0 1px 3px rgba(23,37,30,.05);
  --shadow: 0 2px 6px rgba(23,37,30,.05), 0 12px 28px -14px rgba(23,37,30,.16);
  --shadow-lg: 0 6px 16px -4px rgba(23,37,30,.1), 0 24px 48px -18px rgba(18,116,77,.25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(900px 420px at 88% -60px, rgba(36,137,204,.07), transparent 62%),
    radial-gradient(760px 400px at -80px 180px, rgba(31,157,107,.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: rgba(31,157,107,.22); }

a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.topbar {
  background: linear-gradient(115deg, #0f8256 0%, var(--primary) 42%, #2b96d4 118%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 4px 16px -6px rgba(15,80,55,.35);
}
.topbar .logo { font-size: 20px; font-weight: 800; letter-spacing: .3px; text-shadow: 0 1px 2px rgba(0,0,0,.12); }
.topbar .sub { font-size: 12px; opacity: .92; }
.topbar .spacer { flex: 1; }
.topbar a.back, .topbar button {
  color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(4px);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; text-decoration: none;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.topbar a.back:hover, .topbar button:hover { background: rgba(255,255,255,.28); }
.topbar a.back:active, .topbar button:active { transform: scale(.97); }

.wrap { max-width: 920px; margin: 0 auto; padding: 16px; }

.section-title { font-size: 17px; font-weight: 700; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  flex: 0 0 auto;
}
.section-title small { font-weight: 400; color: var(--muted); font-size: 12.5px; }

.card {
  background: linear-gradient(180deg, #ffffff, #fcfefd);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.card h3 { margin: 0 0 4px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.tag {
  display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: #eafaf2; color: var(--primary-d); margin: 2px 4px 2px 0; border: 1px solid #cdeede;
}
.tag.theme { background: #eaf2fb; color: #1f6aa8; border-color: #cfe2f5; }
.tag.long { background: #fff4e0; color: #b9760a; border-color: #f3e0b3; }
/* 第三批：语义状态标签工具类——回收各页硬编码 background/color。
   solid-* = 深底白字（强状态）；soft-* = 浅底彩字（弱状态）。 */
.tag.solid-success { background: var(--success); color: #fff; border-color: var(--success); }
.tag.solid-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.tag.solid-pending { background: var(--pending); color: #fff; border-color: var(--pending); }
.tag.solid-info    { background: var(--accent);  color: #fff; border-color: var(--accent); }
.tag.solid-muted   { background: #98a1ab;        color: #fff; border-color: #98a1ab; }
.tag.soft-success  { background: var(--success-bg); color: var(--primary-d); border-color: var(--success-bd); }
.tag.soft-danger   { background: var(--danger-bg);  color: var(--danger);    border-color: var(--danger-bd); }
.tag.soft-pending  { background: var(--pending-bg); color: #a05a1a;           border-color: var(--pending-bd); }
.tag.soft-info     { background: var(--info-bg);    color: var(--info);      border-color: var(--info-bd); }
.tag.soft-purple   { background: var(--purple-bg);  color: var(--purple);    border-color: #dcc7fb; }
.tag.soft-neutral  { background: var(--neutral-bg); color: #3c4a45;           border-color: #dde3e0; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3.5px rgba(31,157,107,.14); }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #c4d4cb; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, #23a671, #178a5c);
  color: #fff; border: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 6px -2px rgba(18,116,77,.5);
  padding: 11px 18px; border-radius: 11px;
  font-size: 15px; font-weight: 600; letter-spacing: .02em; cursor: pointer; text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease), filter .16s var(--ease);
}
.btn:hover { background: linear-gradient(180deg, #1f9d6b, #12744d); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 14px -4px rgba(18,116,77,.55); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 3px rgba(18,116,77,.4); }
.btn.block { width: 100%; }
.btn.ghost {
  background: #fff; color: var(--primary-d); border: 1px solid rgba(31,157,107,.45);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { background: #f2fbf7; border-color: var(--primary); transform: translateY(-1px); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.accent { background: linear-gradient(180deg, #3596d8, #2480bd); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 6px -2px rgba(28,107,163,.5); }
.btn.accent:hover { background: linear-gradient(180deg, #2b89ca, #1c6ba3); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .exp-grid { grid-template-columns: 1fr; } }
.exp-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s;
}
.exp-item:hover { border-color: var(--primary); }
.exp-item.sel { border-color: var(--primary); background: #f0fbf6; }
.exp-item h4 { margin: 0 0 4px; font-size: 15px; }
.exp-item .src { font-size: 12px; color: var(--muted); }

/* 学生端时间线 */
.timeline { position: relative; padding-left: 22px; margin-top: 8px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -19px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary);
}
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-date { font-weight: 700; font-size: 14px; }
.tl-phase { font-size: 12px; background: #eafaf2; color: var(--primary-d); padding: 1px 8px; border-radius: 999px; }
.tl-weather { font-size: 12px; color: var(--muted); }
.tl-content { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }
.tl-metrics { font-size: 13px; color: var(--accent); margin-top: 4px; }
.tl-photo { margin-top: 8px; max-width: 220px; border-radius: 10px; border: 1px solid var(--line); display: block; }

.phase-progress { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.phase-dot { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: #f0f2f1; color: var(--muted); }
.phase-dot.done { background: var(--primary); color: #fff; }

.photo-preview { margin-top: 10px; }
.photo-preview img { max-width: 160px; border-radius: 10px; border: 1px solid var(--line); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: linear-gradient(180deg, #ffffff, #fafdfb); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; text-align: center; transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat .num { font-size: 22px; font-weight: 800; color: var(--primary-d); font-variant-numeric: tabular-nums; }
.stat .lab { font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px);
  background: #17251e; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 10px 30px -8px rgba(23,37,30,.45); opacity: 0;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  pointer-events: none; z-index: 50;
  max-width: 88vw; text-align: center; line-height: 1.45;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #1f9d6b; }
.toast-error { background: #c0392b; }
.toast-info { background: #1f2a24; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

/* 实验日志打印 */
.log-sheet { background: #fff; padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.log-sheet h2 { margin: 0 0 2px; }
.log-sheet .meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th, .log-table td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.log-table th { background: #f0fbf6; }
.log-photo { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; display: block; }
@media print {
  body * { visibility: hidden; }
  #logView, #logView * { visibility: visible; }
  #logView {
    position: absolute; left: 0; top: 0; width: 100%;
    background: #fff; padding: 0; margin: 0; overflow: visible;
  }
  .log-sheet { box-shadow: none; border-radius: 0; }
  .no-print { display: none !important; }
}

.modal-mask {
  position: fixed; inset: 0; background: rgba(16,26,20,.5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 40; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 20px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .28s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 12px; }

.banner {
  background: #eafaf2; border: 1px solid #cdeede; color: var(--primary-d);
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px;
}
.locked-cls {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px;
  background: #f0fbf6; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* 辅导老师工作台：班级头卡片 */
.tutor-head {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #eaf2ff, #f0fbf6);
  border: 1px solid #d4e6ff;
}
.tutor-head .th-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.tutor-head .muted { font-size: 13px; }


/* 班级学生名单（名册） */
.roster-box { margin: 4px 0; }
.roster-list { display: flex; flex-wrap: wrap; gap: 8px; }
.roster-item {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px 5px 12px;
  background: #f7faf8; font-size: 13.5px;
}
.roster-name { font-weight: 600; }
.roster-item .btn { padding: 2px 8px; font-size: 12px; }

/* 状态标签 */
.status-pill {
  display: inline-block; font-size: 11.5px; padding: 1px 9px; border-radius: 999px; margin-left: 6px;
  vertical-align: middle; font-weight: 600;
}
.status-pill.ok { background: #e9f7ef; color: #1e7e46; }
.status-pill.warn { background: #fff3e0; color: #b26a00; }

/* ==================== 注册 / 登录页（auth） ==================== */
.auth-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #e9f7ef 0%, #f2fbf7 40%, #e3f0fb 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 16px 40px;
}
/* 背景装饰：漂浮的原子 / 分子圆环 */
.auth-page::before, .auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.auth-page::before {
  width: 340px; height: 340px; top: -120px; right: -100px;
  background: radial-gradient(circle at 35% 35%, rgba(47, 158, 107, .16), rgba(47, 158, 107, 0) 65%);
  border: 2px dashed rgba(47, 158, 107, .25);
}
.auth-page::after {
  width: 300px; height: 300px; bottom: -110px; left: -90px;
  background: radial-gradient(circle at 60% 40%, rgba(43, 138, 203, .14), rgba(43, 138, 203, 0) 65%);
  border: 2px dashed rgba(43, 138, 203, .22);
}
.auth-page .atom {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(31, 157, 107, .28);
  pointer-events: none;
}
.auth-page .atom.a1 { width: 90px; height: 90px; top: 16%; left: 6%; }
.auth-page .atom.a2 { width: 54px; height: 54px; bottom: 22%; right: 8%; border-color: rgba(43, 138, 203, .3); }
.auth-page .atom.a3 { width: 34px; height: 34px; top: 10%; right: 26%; background: rgba(255,255,255,.5); }
.auth-page .atom::after {
  content: '';
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); top: -4px; left: 50%; transform: translateX(-50%);
}
.auth-page .atom.a2::after { background: var(--accent); }
.auth-page .atom.a3::after { width: 6px; height: 6px; top: -3px; background: var(--warn); }

.auth-brand { position: relative; text-align: center; margin-bottom: 22px; }
.auth-brand .auth-ico {
  width: 64px; height: 64px; margin: 0 auto 10px;
  border-radius: 18px; background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff; box-shadow: 0 8px 22px rgba(31, 157, 107, .35);
}
.auth-brand h1 {
  margin: 0; font-size: 30px; letter-spacing: 3px; font-weight: 800;
  background: linear-gradient(90deg, #157a52, #2b8acb);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-brand .auth-sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; letter-spacing: 1px; }

.auth-card {
  position: relative;
  width: 100%; max-width: 560px;
  background: rgba(255, 255, 255, .94);
  border-radius: 20px;
  box-shadow: 0 16px 44px rgba(31, 42, 36, .12);
  border: 1px solid rgba(255,255,255,.7);
  padding: 28px 30px 26px;
  backdrop-filter: blur(6px);
}
.auth-card h3 { margin: 0 0 4px; font-size: 19px; color: var(--ink); }
.auth-card .auth-desc { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
/* 左标签 右输入框 两栏 */
.auth-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.auth-row label { text-align: right; font-size: 14px; font-weight: 600; color: #33443c; white-space: nowrap; }
.auth-row input {
  width: 100%; min-height: 42px;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 15px; background: #fbfdfc; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.auth-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 157, 107, .12); background: #fff; }
.auth-tip { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin: -4px 0 2px; text-align: right; }
.auth-err { grid-column: 1 / -1; color: #c0392b; font-size: 13px; min-height: 18px; text-align: right; }
.auth-foot { grid-column: 1 / -1; text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.auth-foot a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-actions { grid-column: 1 / -1; margin-top: 6px; }
@media (max-width: 480px) {
  .auth-page { padding: 22px 12px 30px; }
  .auth-brand h1 { font-size: 24px; letter-spacing: 2px; }
  .auth-card { padding: 22px 18px; }
  .auth-row { grid-template-columns: 1fr; gap: 5px; }
  .auth-row label { text-align: left; }
  .auth-row input { min-height: 44px; }
}

/* ==================== 移动端响应式（<600px） ==================== */
@media (max-width: 600px) {
  .topbar { padding: 12px 14px; }
  .topbar .logo { font-size: 16px; }
  .topbar .sub { font-size: 11px; }
  .wrap { padding: 10px; }

  /* 卡片单列 */
  .exp-grid { grid-template-columns: 1fr; }
  .mat-grid { grid-template-columns: 1fr; }

  /* 按钮全宽 */
  .btn { width: 100%; }
  .btn.sm { width: auto; }

  /* 按钮最小 44px 点击区域 */
  button, .btn, .btn.sm, .btn.ghost {
    min-height: 44px;
  }
  .topbar button, .topbar a.back {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
  }

  /* 输入框字体不小于 16px 防 iOS 缩放 */
  input, select, textarea {
    font-size: 16px;
    padding: 12px 14px;
  }

  /* 表格改为卡片式布局 */
  .log-table {
    display: block;
    border: none;
  }
  .log-table thead { display: none; }
  .log-table tbody { display: block; }
  .log-table tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #fff;
  }
  .log-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid #f0f2f1;
    text-align: right;
    font-size: 13px;
  }
  .log-table td:last-child { border-bottom: none; }
  .log-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    flex: 0 0 90px;
    text-align: left;
    font-size: 12px;
  }
  .log-table th { display: none; }

  /* 日志照片：移动端也保持统一缩略图，不撑满单元格 */
  .log-photo { width: 110px; height: 82px; object-fit: cover; }

  /* 学生清单卡片化 */
  .section-title { font-size: 15px; }
  .row > * { flex: 1 1 100%; }
  .roster-list { gap: 6px; }

  /* === topbar 允许换行，避免标题/按钮在窄屏挤压 === */
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
  .topbar .spacer { display: none; }
  .topbar .logo { font-size: 15px !important; line-height: 1.3; word-break: break-all; }
  .topbar .sub { font-size: 11px; word-break: break-all; line-height: 1.35; max-width: 100%; }
  .topbar > div:not(.spacer) { min-width: 0; flex: 1 1 60%; }
  .topbar .btn.sm, .topbar button { width: auto; min-width: 64px; }

  /* === 教师后台班级列表行（roster-item）改成卡片 === */
  .roster-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 14px;
    gap: 8px;
  }
  .roster-item > * {
    flex: none !important;
    width: 100% !important;
    max-width: none !important;
  }
  /* 行内的两个 .btn.sm（保存 / 入口链接）保持并排 */
  .roster-item > .btn.sm {
    flex: 1 1 calc(50% - 4px) !important;
    width: auto !important;
    min-width: 0;
  }

  /* === 辅导老师头卡片（.tutor-head）允许换行 + 文字收缩 === */
  .tutor-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .tutor-head > div {
    flex: 1 1 calc(100% - 60px);
    min-width: 0;
  }
  .tutor-head .th-name { font-size: 15px; word-break: break-all; }
  .tutor-head .muted { font-size: 12px; word-break: break-all; line-height: 1.4; }
}

/* ==================== 加载状态 ==================== */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}
.loading-placeholder::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-placeholder {
  text-align: center;
  padding: 28px 14px;
  color: #c0392b;
  font-size: 14px;
}
.error-placeholder .retry-btn {
  margin-top: 10px;
  display: inline-block;
}

/* 探究资料网格 */
.mat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mat-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
@media (max-width: 640px) { .mat-grid { grid-template-columns: repeat(2, 1fr); } }
.mat-item {
  position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #f7faf8; text-align: center;
}
.mat-item img { width: 100%; height: 110px; object-fit: cover; display: block; background: #eef3f0; }
.mat-file {
  height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; gap: 4px;
}
.mat-name {
  font-size: 11.5px; color: var(--ink); padding: 5px 6px; word-break: break-all; line-height: 1.35;
  border-top: 1px solid var(--line); background: #fff;
}
.mat-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; cursor: pointer; line-height: 1;
}
.mat-del:hover { background: #c0392b; }

/* 阶段3修复：移除死代码——旧版登录页 .login-tabs/.login-tab/.login-pane 与已合并进学生端的
   实训选课卡片 .pick-grid/.pick-card/.pick-ico/.pick-title/.pick-desc/.pick-bar（均零引用）。
   .my-grid 仍被学生端「我的实训项目」使用，保留。 */
/* 我的实训项目：卡片网格 */
.my-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.my-grid .card { margin-bottom: 0; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 700px) {
  .my-grid { grid-template-columns: 1fr; }
}

/* ---------------- 教师后台：可折叠模块 + 快捷导航 ---------------- */
.fold-section { margin-bottom: 2px; }
.fold-header { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 4px 8px; margin-left: -8px; transition: background .16s var(--ease); }
.fold-header:hover { opacity: 1; background: rgba(31,157,107,.07); }
.fold-arrow { display: inline-block; transition: transform .18s ease; font-size: 12px; color: var(--primary); }
.fold-section.closed .fold-arrow { transform: rotate(-90deg); }
.fold-section.closed .fold-body { display: none; }
.fold-hint { font-size: 12px; font-weight: normal; color: var(--muted); }
/* 阶段3修复：sec-nav 原本 sticky top:0 且 z-index 高于顶栏，滚动时会遮住顶栏的退出/改密按钮。
   现下移至顶栏下方（约 52px）并降低层级。 */
.sec-nav { position: sticky; top: 52px; z-index: 15; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); padding: 8px 0; display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.sec-nav button { font-size: 12px; padding: 5px 10px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.sec-nav button:hover { border-color: var(--primary); color: var(--primary-d); background: #f2fbf7; }

/* 阶段3修复：分配项目 / 学生详情编辑器的双列勾选网格——窄屏（<640px）折为单列，避免挤压 */
.pick2grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .pick2grid { grid-template-columns: 1fr; } }

/* 阶段3修复：移除旧版首页遗留的死样式块（.wrap-home/.home-hero/.hh-*/.float-atom/.role-card/.rc-*/.feat-*，均零引用） */

/* 主页 footer */
.home-footer {
  text-align: center; color: var(--muted); font-size: 12.5px;
  padding: 38px 16px 28px; line-height: 2;
}
.home-footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
