/* ==========================================================================
   互动教学平台 · 视觉主题（Neumorphism / 新拟物派）
   设计基调：浅灰类粘土表面 + 双重柔光阴影，所有元素「长在背景上」
   光源固定：左上亮（#ffffff）/ 右下暗（#b8bcc2）
   强调色：#6d5dfc（紫）
   禁止：纯黑/纯白底、渐变、粗边框、直角、hover 增大阴影、translate 浮起
   ========================================================================== */

:root {
  /* 新拟物表面系统 */
  --nm-bg: #e0e5ec;
  --nm-bg-light: #f0f0f3;
  --nm-dark: #b8bcc2;
  --nm-light: #ffffff;

  /* 强调色（CTA / 激活态） */
  --accent: #6d5dfc;
  --accent-press: #5a4ad8;
  --accent-soft: #ece9ff;

  /* 文本 */
  --text-strong: #2f3340;
  --text: #4b5160;
  --muted: #8a90a0;

  /* 细分隔线（仅用于必要处，主靠阴影区分） */
  --line: #cdd3de;

  /* 语义 */
  --success: #2fa56b;
  --success-soft: #e3f5ec;
  --danger: #e0585b;
  --danger-soft: #fbe9e9;

  /* 兼容别名：旧页面/脚本残留引用（青蓝时代的变量名），统一映射到新拟物调色 */
  --primary: var(--accent);
  --primary-dark: #5a4ad8;
  --primary-2: #8a7dfc;
  --primary-soft: var(--accent-soft);
  --mint: #cfc8ff;
  --border: #cdd3de;
  --border-strong: #c0c7d4;

  /* 形状 */
  --radius: 20px;
  --radius-sm: 14px;

  /* 双重阴影：凸起 / 凸起小 / 凹陷 / 凹陷小 */
  --raised: 8px 8px 16px #b8bcc2, -8px -8px 16px #ffffff;
  --raised-sm: 4px 4px 8px #b8bcc2, -4px -4px 8px #ffffff;
  --inset: inset 6px 6px 12px #b8bcc2, inset -6px -6px 12px #ffffff;
  --inset-sm: inset 3px 3px 6px #b8bcc2, inset -3px -3px 6px #ffffff;

  --ring: 0 0 0 3px rgba(109, 93, 252, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--nm-bg);
}

/* ---------- 顶栏（学生端）—— 浅灰凸起长条 ---------- */
header {
  background: var(--nm-bg);
  color: var(--text-strong);
  padding: 15px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--raised-sm);
  position: sticky; top: 0; z-index: 40;
}
header h1 { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: .3px; color: var(--text-strong); }
header .who { font-size: 13px; color: var(--muted); }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; }

/* ---------- 卡片（凸起） ---------- */
.card {
  background: var(--nm-bg);
  border: none;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--raised);
  margin-bottom: 16px;
  transition: box-shadow .3s ease-in-out;
}
.card:hover { box-shadow: var(--raised-sm); }

.card h2 {
  position: relative;
  margin: 0 0 14px;
  padding-left: 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: .2px;
}
.card h2::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 18px;
  border-radius: 6px;
  background: var(--accent);
}
.card h3 { color: var(--text-strong); font-weight: 700; }

.muted { color: var(--muted); font-size: 13px; line-height: 1.65; }
.tiny { font-size: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.col { flex: 1; min-width: 260px; }

/* ---------- 表单（输入框 = 凹陷，聚焦时浅凹） ---------- */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 5px;
  letter-spacing: .2px;
}
input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--nm-bg);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color: var(--text-strong);
  box-shadow: var(--inset);
  transition: box-shadow .3s ease-in-out;
}
input:focus, textarea:focus, select:focus {
  box-shadow: var(--inset-sm);
  background: var(--nm-bg-light);
}
input::placeholder, textarea::placeholder { color: #a3a9b8; }

/* ---------- 按钮（凸起 → hover 缩小阴影 → active 凹陷） ---------- */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-strong);
  background: var(--nm-bg);
  box-shadow: var(--raised);
  transition: box-shadow .3s ease-in-out, background .3s ease-in-out, color .3s ease-in-out;
}
button:hover { box-shadow: var(--raised-sm); }
button:active { box-shadow: var(--inset); }
button.ghost {
  background: var(--nm-bg);
  color: var(--accent);
  box-shadow: var(--raised);
}
button.ghost:hover { box-shadow: var(--raised-sm); color: var(--accent-press); }
button.ghost:active { box-shadow: var(--inset); }
button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 4px 4px 10px rgba(109, 93, 252, .35), -4px -4px 10px rgba(255, 255, 255, .55);
}
button.primary:hover { background: var(--accent-press); box-shadow: 2px 2px 6px rgba(109, 93, 252, .35); }
button.primary:active { background: var(--accent-press); box-shadow: inset 3px 3px 7px rgba(70, 58, 180, .5), inset -3px -3px 7px rgba(160, 150, 255, .35); }
button.danger { background: var(--nm-bg); color: var(--danger); box-shadow: var(--raised); }
button.danger:hover { box-shadow: var(--raised-sm); }
button.danger:active { box-shadow: var(--inset); }
button.success { background: var(--nm-bg); color: var(--success); box-shadow: var(--raised); }
button.success:hover { box-shadow: var(--raised-sm); }
button.success:active { box-shadow: var(--inset); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: var(--raised-sm); color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 徽章 / 状态（轻凸起胶囊） ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--nm-bg);
  color: var(--text);
  box-shadow: var(--inset-sm);
  white-space: nowrap;
}
.badge.live { color: var(--success); box-shadow: var(--inset-sm); }
.badge.idle { color: var(--muted); }
.badge.ended { color: var(--danger); box-shadow: var(--inset-sm); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
  text-align: left;
  padding: 11px 13px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--nm-bg-light);
  color: var(--text-strong);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--inset-sm);
}
th:first-child { border-top-left-radius: 12px; }
th:last-child { border-top-right-radius: 12px; }
td { font-variant-numeric: tabular-nums; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, .35); }
tbody tr:hover { background: var(--accent-soft); }
.rank-1 { background: var(--accent-soft) !important; }
.rank-1 td:first-child::before { content: "🥇 "; }
.rank-2 td:first-child::before { content: "🥈 "; }
.rank-3 td:first-child::before { content: "🥉 "; }

/* ---------- 二维码 / 邀请码（凹陷底托） ---------- */
.qr-box { text-align: center; }
.qr-box img {
  width: 240px; height: 240px;
  border-radius: 16px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--inset);
}
.code-pill {
  font-size: 30px;
  letter-spacing: 5px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  margin: 10px 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--nm-bg);
  box-shadow: var(--inset);
  font-variant-numeric: tabular-nums;
}

/* ---------- 列表项（凸起卡片） ---------- */
.student-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--nm-bg);
  box-shadow: var(--raised-sm);
  transition: box-shadow .3s ease-in-out;
}
.student-item:hover { box-shadow: var(--raised); }
.student-item .name { font-weight: 600; color: var(--text-strong); }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; margin-right: 7px;
  box-shadow: 0 0 0 3px rgba(184, 188, 194, .35);
}
.dot.on { background: var(--success); }
.dot.off { background: #c2c7d4; }

.like-btn { font-size: 13px; padding: 7px 13px; }

/* ---------- 提示条（强调色胶囊） ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(6px);
  background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: 4px 4px 12px rgba(109, 93, 252, .35), -4px -4px 12px rgba(255, 255, 255, .5);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 题目区 ---------- */
.q-card {
  background: var(--nm-bg);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
  box-shadow: var(--inset-sm);
}
.option-btn {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  background: var(--nm-bg); color: var(--text-strong);
  border: none; border-radius: var(--radius-sm);
  box-shadow: var(--raised-sm); font-weight: 600;
  transition: box-shadow .3s ease-in-out, background .3s ease-in-out, color .3s ease-in-out;
}
.option-btn:hover { box-shadow: var(--raised); }
.option-btn.sel {
  background: var(--accent-soft);
  color: var(--accent-press);
  font-weight: 700;
  box-shadow: var(--inset-sm);
}
.timer { font-size: 13px; color: var(--accent-press); font-weight: 700; font-variant-numeric: tabular-nums; }

.center { text-align: center; }
.mt { margin-top: 12px; }
.hidden { display: none !important; }

/* ---------- 弹窗（轻灰卡片浮层） ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(47, 51, 64, .35);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 60;
}
.modal {
  position: relative;
  background: var(--nm-bg); border-radius: 24px; padding: 24px;
  width: 360px; max-width: 92vw;
  box-shadow: var(--raised);
  animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 12px; font-size: 16px; color: var(--text-strong); }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions button { flex: 1; }

/* ==========================================================================
   教师工作台：左侧导航 + 顶栏 + 内容区（全部浅灰新拟物）
   ========================================================================== */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* 顶部横向导航（凸起长条） */
.topnav {
  display: flex; align-items: stretch; gap: 16px;
  padding: 0 20px;
  background: var(--nm-bg);
  box-shadow: var(--raised-sm);
  position: sticky; top: 0; z-index: 40;
}
.topnav-brand {
  display: flex; align-items: center;
  font-weight: 800; font-size: 15.5px; letter-spacing: .4px; white-space: nowrap;
  color: var(--accent);
}
.topnav #nav { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; align-items: center; }
.topnav .nav-item {
  width: auto; display: inline-flex; align-items: center;
  padding: 10px 16px; margin: 8px 0; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  color: var(--text); background: var(--nm-bg); box-shadow: var(--raised-sm);
  transition: box-shadow .3s ease-in-out, color .3s ease-in-out, background .3s ease-in-out;
}
.topnav .nav-item:hover { box-shadow: var(--raised); color: var(--accent-press); }
.topnav .nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-press); font-weight: 700;
  box-shadow: var(--inset-sm);
}
.topnav-right { display: flex; align-items: center; gap: 10px; }
.topnav-right .who { font-size: 13px; color: var(--muted); white-space: nowrap; }
.topnav-right button {
  background: var(--nm-bg); color: var(--text);
  box-shadow: var(--raised-sm); padding: 8px 14px; font-size: 13px;
}
.topnav-right button:hover { box-shadow: var(--raised); color: var(--accent-press); }
.topnav-right button:active { box-shadow: var(--inset-sm); }

/* 第二行：课程 / 课时 / 操作（凹陷条） */
.subbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 22px;
  background: var(--nm-bg);
  box-shadow: var(--inset-sm);
  position: sticky; top: 52px; z-index: 30;
}
.subbar label { margin: 0; }
.subbar select {
  width: auto; min-width: 200px;
  border-radius: 999px; padding: 9px 16px;
  background: var(--nm-bg); color: var(--text-strong);
  font-weight: 600; box-shadow: var(--inset-sm);
}

/* 内容分区：同一视图内多张卡片自动铺成网格 */
.content { padding: 22px; overflow: auto; }
.view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
  gap: 16px; align-items: start;
}
.view > .grid2, .view > .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .view { grid-template-columns: 1fr; } }

/* 左侧导航（凸起竖条） */
.sidebar {
  width: 226px; flex-shrink: 0;
  padding: 18px 14px 14px;
  display: flex; flex-direction: column;
  color: var(--text);
  background: var(--nm-bg);
  box-shadow: 6px 0 16px #b8bcc2, -6px 0 16px #ffffff;
  position: relative;
}
.brand {
  font-weight: 800; font-size: 15.5px;
  margin-bottom: 20px; padding-left: 8px;
  letter-spacing: .4px;
  color: var(--accent);
}
.nav-item {
  display: block; width: 100%; text-align: left;
  background: var(--nm-bg); color: var(--text);
  padding: 11px 14px; border-radius: 12px; margin-bottom: 6px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--raised-sm);
  transition: box-shadow .3s ease-in-out, color .3s ease-in-out, background .3s ease-in-out;
}
.nav-item:hover { box-shadow: var(--raised); color: var(--accent-press); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-press); font-weight: 700;
  box-shadow: var(--inset-sm);
}
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar-footer .who { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; padding-left: 6px; }
.sidebar-footer button {
  background: var(--nm-bg); color: var(--text);
  box-shadow: var(--raised-sm);
}
.sidebar-footer button:hover { box-shadow: var(--raised); color: var(--accent-press); }
.sidebar-footer button:active { box-shadow: var(--inset-sm); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: transparent; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 22px;
  background: var(--nm-bg);
  box-shadow: var(--inset-sm);
}
.topbar label { margin: 0; }
.topbar select {
  width: auto; min-width: 250px;
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--nm-bg);
  font-weight: 600;
  color: var(--text-strong);
  box-shadow: var(--inset-sm);
}
.content { padding: 22px; overflow: auto; }

.view { animation: viewIn .26s ease; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 登录卡 ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
  position: relative;
  width: 380px;
  border-radius: 26px;
  padding: 28px 24px;
  background: var(--nm-bg);
  box-shadow: var(--raised);
}

/* ---------- 课件 ---------- */
.cw-item {
  border: none; border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--nm-bg);
  box-shadow: var(--raised-sm);
  cursor: pointer;
  transition: box-shadow .3s ease-in-out;
}
.cw-item:hover { box-shadow: var(--raised); }
.cw-item .cw-title { font-weight: 700; margin-bottom: 4px; color: var(--text-strong); }
.cw-item .cw-content { white-space: pre-wrap; font-size: 13px; color: var(--muted); max-height: 90px; overflow: hidden; }
.cw-item .cw-actions { margin-top: 10px; display: flex; gap: 8px; }
.cw-item .cw-actions button { padding: 6px 13px; font-size: 13px; }
.cw-item.open .cw-content { max-height: none; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--line);
    box-shadow: 6px 6px 14px #b8bcc2;
  }
  .brand, .sidebar-footer { display: none; }
  .nav-item { width: auto; white-space: nowrap; margin-bottom: 0; margin-right: 6px; }
  .content { padding: 14px; }
}

/* ---------- 顶栏复选框 ---------- */
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { width: auto; margin: 0; }

/* ---------- 统计卡片（凸起面板） ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 12px; margin-top: 12px; }
.stat-box {
  border: none; border-radius: 16px; padding: 16px 12px; text-align: center;
  background: var(--nm-bg);
  box-shadow: var(--raised-sm);
  transition: box-shadow .3s ease-in-out;
}
.stat-box:hover { box-shadow: var(--raised); }
.stat-box .sv {
  font-size: 26px; font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-box .sl { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* ---------- 作业陈列馆 ---------- */
.gal-section { margin-top: 20px; }
.gal-section h3 { font-size: 15px; margin-bottom: 10px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gal-card {
  position: relative; border: none; border-radius: 20px; padding: 18px 15px 13px;
  background: var(--nm-bg); box-shadow: var(--raised-sm);
  display: flex; flex-direction: column;
  transition: box-shadow .3s ease-in-out;
}
.gal-card:hover { box-shadow: var(--raised); }
.gal-card.medal-gold { box-shadow: var(--raised-sm); }
.gal-card.medal-silver { box-shadow: var(--raised-sm); }
.gal-card.medal-bronze { box-shadow: var(--raised-sm); }
.gal-ribbon {
  position: absolute; top: -11px; right: 12px; font-size: 12px; font-weight: 800; color: #fff;
  background: #a9b0bd; padding: 3px 12px; border-radius: 999px;
  box-shadow: 3px 3px 8px #b8bcc2, -3px -3px 8px #ffffff;
}
.medal-gold .gal-ribbon { background: #e0b94a; }
.medal-silver .gal-ribbon { background: #b9c0cc; color: #3a4150; }
.medal-bronze .gal-ribbon { background: #cf9b6b; }
.gal-no { font-size: 11px; color: var(--muted); font-weight: 600; }
.gal-title { font-weight: 700; font-size: 15px; margin: 2px 0 6px; color: var(--text-strong); }
.gal-task { font-size: 12px; color: var(--muted); max-height: 54px; overflow: hidden; margin-bottom: 8px; }
.gal-answer {
  font-size: 13px; line-height: 1.65; white-space: pre-wrap;
  background: var(--nm-bg);
  box-shadow: var(--inset-sm);
  border-radius: 12px; padding: 11px; max-height: 190px; overflow: auto; flex: 1;
}
.gal-meta { font-size: 11px; color: var(--muted); margin-top: 8px; }
.gal-name {
  margin-top: 9px; text-align: center; font-weight: 700; font-size: 14px; color: var(--text-strong);
  border-top: 1px dashed var(--line); padding-top: 9px;
}
.gal-ops { display: flex; gap: 6px; margin-top: 9px; }
.gal-ops button { flex: 1; padding: 6px 8px; font-size: 12px; }

/* ---------- 心情点名 ---------- */
/* 自适应列宽：卡片变窄（如桌面三卡并排）时自动堆叠，避免 mood-wall 溢出压到相邻卡片 */
.mood-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 14px; }
@media (max-width: 900px) { .mood-grid { grid-template-columns: 1fr; } }

.cloud-wrap {
  position: relative;
  border-radius: 16px;
  background: var(--nm-bg);
  box-shadow: var(--inset-sm);
  padding: 10px;
  overflow: hidden;
}
.cloud-wrap canvas { display: block; width: 100%; height: 320px; }
.cloud-tip {
  position: absolute; transform: translate(-50%, -100%);
  background: var(--nm-bg); color: var(--text-strong);
  font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 10px;
  box-shadow: var(--raised-sm);
  pointer-events: none; white-space: nowrap; z-index: 5;
}

.mood-wall {
  max-height: 320px; overflow: auto;
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px;
  border-radius: 16px;
  background: var(--nm-bg);
  box-shadow: var(--inset-sm);
}
.mood-card {
  border: none; border-radius: 14px; padding: 11px 13px;
  background: var(--nm-bg);
  box-shadow: var(--raised-sm);
  animation: moodPop .35s ease;
  transition: box-shadow .3s ease-in-out;
}
.mood-card:hover { box-shadow: var(--raised); }
.mood-card.mine {
  background: var(--accent-soft);
  box-shadow: var(--inset-sm);
}
@keyframes moodPop { from { opacity: 0; } to { opacity: 1; } }
.mood-text { font-size: 14px; line-height: 1.6; word-break: break-word; color: var(--text); }
.mood-who {
  font-size: 12px; color: var(--muted); margin-top: 7px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.mood-time { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }

.mood-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.mood-tag {
  padding: 6px 13px; font-size: 13px; font-weight: 600;
  border-radius: 999px; border: none;
  background: var(--nm-bg); color: var(--text);
  cursor: pointer;
  box-shadow: var(--raised-sm);
  transition: box-shadow .3s ease-in-out, color .3s ease-in-out, background .3s ease-in-out;
}
.mood-tag:hover { box-shadow: var(--raised); color: var(--accent-press); }
.mood-tag.active { background: var(--accent-soft); color: var(--accent-press); box-shadow: var(--inset-sm); }

/* 随机抽签结果 */
.mood-pick {
  margin-top: 12px; text-align: center; padding: 18px 14px; border-radius: 20px;
  background: var(--nm-bg);
  box-shadow: var(--inset);
  animation: moodPop .3s ease;
}
.mp-label { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.mp-name {
  font-size: 32px; font-weight: 800; margin: 4px 0; line-height: 1.2;
  color: var(--accent);
}
.mp-name.rolling { opacity: .55; }
.mp-text { font-size: 15px; color: var(--text-strong); margin-top: 6px; line-height: 1.6; }
.mp-meta { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   首页：身份选择
   ========================================================================== */
.hero { text-align: center; padding: 44px 10px 26px; }
.hero-badge {
  display: inline-block;
  padding: 6px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  color: var(--accent-press);
  background: var(--nm-bg);
  box-shadow: var(--inset-sm);
}
.hero h1 {
  margin: 16px 0 8px;
  font-size: 32px; font-weight: 800; letter-spacing: .5px;
  color: var(--text-strong);
}
.hero p { margin: 0; color: var(--muted); font-size: 14px; }

.role-card {
  display: block; text-decoration: none;
  flex: 1; min-width: 220px;
  border: none;
  border-radius: 24px;
  padding: 26px 20px;
  background: var(--nm-bg);
  box-shadow: var(--raised);
  text-align: center;
  transition: box-shadow .3s ease-in-out;
}
.role-card:hover { box-shadow: var(--raised-sm); }
.role-emoji { font-size: 40px; line-height: 1; }
.role-title { font-size: 17px; font-weight: 800; color: var(--text-strong); margin-top: 10px; }
.role-desc { font-size: 13px; color: var(--muted); margin-top: 6px; }
.role-card .role-btn {
  margin-top: 16px; width: 100%; padding: 12px; font-size: 15px; border-radius: 14px;
  display: block; background: var(--accent); color: #fff; font-weight: 700;
  box-shadow: 4px 4px 10px rgba(109, 93, 252, .35), -4px -4px 10px rgba(255, 255, 255, .55);
  transition: box-shadow .3s ease-in-out, background .3s ease-in-out;
}
.role-card .role-btn:hover { background: var(--accent-press); box-shadow: 2px 2px 6px rgba(109, 93, 252, .35); }
.role-card .role-btn:active { background: var(--accent-press); box-shadow: inset 3px 3px 7px rgba(70, 58, 180, .5), inset -3px -3px 7px rgba(160, 150, 255, .35); }
.role-card.student .role-btn { background: var(--accent); }

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   学生端：手机优先 —— 顶部固定积分条 + 横向分区导航
   ========================================================================== */
.stu-top {
  position: sticky; top: 0; z-index: 40;
  padding: 12px 14px;
  background: var(--nm-bg);
  box-shadow: var(--raised-sm);
}
.stu-top-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stu-top .who { color: var(--text-strong); font-weight: 800; font-size: 15px; flex: 1; min-width: 90px; }
.stu-top .badge { background: var(--nm-bg); color: var(--accent-press); box-shadow: var(--inset-sm); font-weight: 700; }

.stu-nav {
  position: sticky; top: 49px; z-index: 35;
  display: flex; gap: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  background: var(--nm-bg);
  box-shadow: var(--inset-sm);
}
.stu-nav::-webkit-scrollbar { display: none; }

/* 模块一级导航（按课程授权动态生成）：贴顶栏下方；教学互动时二级分区导航顺次下移 */
#modNav { position: sticky; top: 49px; z-index: 36; }
#stuNav { top: 105px; }
.mod-sec { animation: viewIn .24s ease; }
.stu-tab {
  flex: 0 0 auto;
  padding: 10px 16px; border-radius: 999px;
  background: var(--nm-bg); color: var(--text);
  font-size: 14px; font-weight: 600; box-shadow: var(--raised-sm);
  border: none; white-space: nowrap;
  transition: box-shadow .3s ease-in-out, color .3s ease-in-out, background .3s ease-in-out;
}
.stu-tab:hover { box-shadow: var(--raised); }
.stu-tab.active {
  background: var(--accent); color: #fff; font-weight: 700;
  box-shadow: 4px 4px 10px rgba(109, 93, 252, .3), -4px -4px 10px rgba(255, 255, 255, .5);
}
.stu-sec { animation: viewIn .24s ease; }

/* 手机：加大点击区域，单手可操作 */
@media (max-width: 640px) {
  .container { padding: 12px; }
  button { padding: 12px 16px; font-size: 15.5px; }
  .stu-tab { padding: 11px 16px; font-size: 15px; }
  .card { padding: 14px; border-radius: 16px; }
  input, select, textarea { font-size: 16px; }  /* 16px 可避免 iOS 自动缩放 */
}
