/* ============ 设计变量 ============ */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e5e8ee;
  --line-soft: #f0f2f6;
  --text: #141923;
  --text-2: #4a5462;
  --muted: #78828f;
  --brand: #2b6cf6;
  --brand-dark: #1d54c9;
  --brand-soft: #eaf0ff;

  --ac: #0fa958;
  --ac-soft: #e6f7ee;
  --wa: #e5484d;
  --wa-soft: #fdeced;
  --tle: #8b5cf6;
  --tle-soft: #f1ecfd;
  --mle: #b45309;
  --mle-soft: #fdf1e3;
  --re: #ea580c;
  --re-soft: #fdeee5;
  --ce: #64748b;
  --ce-soft: #eef1f5;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px -12px rgba(16, 24, 40, 0.12);

  /* 代码字号：JS 里 applyCodeFontSize() 会改写这两个变量（Ctrl+滚轮 / 工具栏 A- A+） */
  --code-fs: 13.5px;
  --code-lh: 21px;
}

/* ============ 基础 ============ */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd6e0; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c0cd; background-clip: content-box; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  height: 58px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(140deg, #4c86ff, #2b6cf6 55%, #1d54c9);
  color: #fff;
  /* 中文单字 logo：用系统中文字体，避免拉丁字体回退后字形不居中 */
  font: 700 14px/28px "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  letter-spacing: 0;
  text-align: center;
  box-shadow: 0 2px 8px -2px rgba(43, 108, 246, 0.55);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 28px; letter-spacing: -0.01em; }
.brand-text em { font-size: 11px; color: var(--muted); font-style: normal; letter-spacing: -0.02em; white-space: nowrap; }

.nav { display: flex; gap: 4px; }

.nav a {
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover { background: #f1f4f8; color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); }

.topstat { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; white-space: nowrap; }
.topstat b { color: var(--text); font-weight: 600; }
.topstat .tp-link { color: inherit; text-decoration: none; border-radius: 6px; }
.topstat .tp-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

/* 提示音开关（右上角小喇叭）：关闭时图标变淡 + 打叉 */
.sfx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sfx-btn:hover { background: #f2f5f9; border-color: var(--line); color: var(--text); }
.sfx-btn.muted { color: #b7bfca; }
.sfx-btn.muted:hover { color: #8b95a3; }

/* hidden 要自己兜住：.sfx-btn 是 inline-flex，会盖掉浏览器自带的 [hidden]{display:none}，
   按钮明明 hidden 却还显示、点了没反应（截图按钮在 http 下就是这个坑） */
.sfx-btn[hidden] { display: none; }

/* ============ 用户菜单 ============ */
.userbox { position: relative; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  transition: all 0.15s;
  color: var(--text-2);
}
.user-chip:hover { border-color: #ccd5e1; background: #f8fafc; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: #7c8899;
  flex: none;
}
.avatar.r-admin { background: linear-gradient(140deg, #4c86ff, #2b6cf6); }
.avatar.r-teacher { background: linear-gradient(140deg, #14b8a6, #0d9488); }
.avatar.r-student { background: linear-gradient(140deg, #f59e0b, #d97706); }
/* 好友 / 班级群里：在线是本来彩色，离线整颗头像灰掉（渐变底和 emoji 一起去色） */
.avatar.av-off { filter: grayscale(1); opacity: .58; }
/* 有未读消息：对方头像轻轻跳一下（只有头像动，名字和预览不动，免得整屏都在晃） */
@keyframes av-bounce {
  0%, 62%, 100% { transform: translateY(0); }
  18% { transform: translateY(-5px); }
  36% { transform: translateY(0); }
  48% { transform: translateY(-2px); }
}
/* 头像外圈滚一圈淡蓝光环：比单纯跳动更打眼，也是最省事的「新消息」提示 */
@keyframes av-ring {
  0% { box-shadow: 0 0 0 0 rgba(43, 108, 246, 0.5); }
  80% { box-shadow: 0 0 0 7px rgba(43, 108, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 108, 246, 0); }
}
/* 好友列表 / 班级列表：有未读 → 光环 + 跳动一起上（外层包裹的那种） */
.av-bounce .avatar {
  animation: av-ring 1.8s ease-out infinite, av-bounce 1.15s ease-in-out infinite;
}
/* 班级列表的头像本身就是 .avatar，直接挂两个动画（分别管 box-shadow 和 transform） */
.avatar.is-bounce { animation: av-ring 1.8s ease-out infinite, av-bounce 1.15s ease-in-out infinite; }
.av-bounce { display: inline-flex; flex: none; }
/* 聊天窗口里刚进来的新消息：头像滚 3 圈就停，别一直闪 */
.chat-msg.is-fresh .avatar { animation: av-ring 1.2s ease-out 3; }
@media (prefers-reduced-motion: reduce) {
  .avatar.is-bounce,
  .av-bounce .avatar,
  .chat-msg.is-fresh .avatar { animation: none; }
}
/* 老师学员看板：姓名旁的在线圆点 / 离线灰点 */
.online-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 10.5px; font-weight: 500; color: #8b95a3; vertical-align: middle; white-space: nowrap; }
.online-tag i { width: 7px; height: 7px; border-radius: 50%; background: #c2c9d3; flex: none; }
.online-tag.is-on { color: #15803d; }
.online-tag.is-on i { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.15); }

.uinfo { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.uinfo b { font-size: 12.5px; font-weight: 600; color: var(--text); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uinfo em { font-size: 10.5px; color: var(--muted); font-style: normal; }

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px; /* 战绩卡要装下「段位名 + Lv 徽章 + 火苗」，160 太窄会折行 */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 60;
}
.user-menu.open { display: block; }
.user-menu .um-head {
  font-size: 11.5px;
  color: var(--muted);
  padding: 5px 9px 7px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
  font-family: var(--mono);
}
.user-menu a, .user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
  color: var(--text-2);
}
.user-menu a:hover, .user-menu button:hover { background: #f3f6fa; color: var(--text); }

/* ============ 角色 / 状态 ============ */
.role-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f2f5f9;
  color: #5b6675;
}
.role-badge.r-admin { background: var(--brand-soft); color: var(--brand-dark); }
.role-badge.r-teacher { background: #e6f7f5; color: #0f766e; }
.role-badge.r-student { background: #fef3e2; color: #b45309; }

.pill { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.pill.on { background: var(--ac-soft); color: #0a7a41; }
.pill.off { background: #f1f3f6; color: #78828f; }
.pill.wait { background: #fff3d6; color: #8a5a00; border: 1px solid #f6e0a8; }

/* 待审核申请面板（老师注册审核 / 学员绑定老师） */
.pend-panel { border-color: #f6e0a8; background: #fffdf7; }
.pend-panel .panel-head h3 { display: flex; align-items: center; gap: 8px; }
.pend-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #f59e0b;
  color: #fff;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.pend-list { display: flex; flex-direction: column; }
.pend-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line-soft); }
.pend-item:first-child { border-top: 0; }
.pend-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pend-main b { font-size: 13.5px; }
.pend-main em { font-size: 11.5px; color: var(--muted); font-style: normal; }
.pend-why { font-size: 12px; color: #8a5a00; }
.pend-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pend-item .row-actions { flex: none; }
@media (max-width: 720px) {
  .pend-item { flex-wrap: wrap; }
  .pend-time { order: 3; width: 100%; }
}

.u-cell { display: flex; align-items: center; gap: 9px; }
.u-cell > div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.u-cell b { font-weight: 600; font-size: 13.5px; }
.u-cell em { font-style: normal; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }

.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 4px 8px; font-size: 15px; line-height: 1.1; font-weight: 400; min-width: 30px; justify-content: center; }
.btn-danger { color: #b42318; border-color: #f3d3d0; background: #fff; }
.btn-danger:hover { background: #fdf2f1; border-color: #eab8b3; }
.btn-block { width: 100%; justify-content: center; padding: 9px 13px; font-size: 14px; }

.toolbar-title { font-size: 13px; font-weight: 600; color: var(--text-2); }

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: var(--radius) var(--radius) 0 0;
}
.panel-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.panel-head .muted { font-weight: 400; }

/* 账号管理 → 聊天数据清理 */
#maintPanel .panel-head { flex-wrap: wrap; }
#maintPanel .panel-head p { flex: 1 1 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.maint-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.maint-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafd;
  font-size: 12.5px;
  color: var(--text-2);
}
.maint-item b { color: var(--text); font-weight: 600; }
.maint-item em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.maint-dim { font-size: 12.5px; color: var(--muted); }
.maint-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.maint-days { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.maint-days .input { width: 88px; padding: 5px 8px; font-size: 13px; text-align: center; }
.maint-tip { margin-top: 9px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

/* ============ 表单 ============ */
.form-body { padding: 16px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field > .field-tip { display: block; margin-top: 4px; font-size: 11.5px; font-style: normal; line-height: 1.55; color: #8b95a3; }
.field.grow2 { grid-column: span 2; }

.input {
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0 11px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
select.input { padding-right: 6px; }
.input:focus { border-color: #b9ccfb; box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.09); }
.input:disabled { background: #f6f8fa; color: var(--muted); }
.input::placeholder { color: #9aa4b1; }

.mono-area {
  height: auto;
  min-height: 260px;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
  resize: vertical;
}

.form-err { color: #b42318; font-size: 12.5px; margin-top: 10px; min-height: 17px; }

.form-actions { display: flex; gap: 8px; margin-top: 14px; }

.banner {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.banner.warn { background: #fffbf0; border-color: #f3e2bd; color: #8a5a05; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.login-brand > div { display: flex; flex-direction: column; line-height: 1.2; }
.login-brand strong { font-size: 15px; }
.login-brand em { font-style: normal; font-size: 11px; color: var(--muted); }

.login-card h1 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.login-card .field > span { font-size: 12px; }
.login-card .input { height: 40px; }

.login-err { color: #b42318; font-size: 12.5px; min-height: 17px; }

.login-hint {
  font-size: 11.5px;
  color: var(--muted);
  background: #f7f9fc;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.7;
}
.login-hint code {
  font-family: var(--mono);
  background: #eef2f8;
  border-radius: 4px;
  padding: 1px 5px;
  color: #33507a;
}

/* ============ Markdown 编辑器 ============ */
.md-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.md-edit .mono-area {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-height: 420px;
  font-size: 12.8px;
}
.md-edit .mono-area:focus { box-shadow: none; }
.md-preview {
  padding: 18px 20px;
  max-height: 520px;
  overflow: auto;
  font-size: 14px;
}

/* ============ 测试数据编辑 ============ */
.case-list { display: flex; flex-direction: column; gap: 12px; }

.case-item { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }

.case-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
}
.case-no { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-family: var(--mono); }

.case-cols { display: grid; grid-template-columns: 1fr 1fr; }
.case-col { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.case-col:last-child { border-right: 0; }
.case-col > span {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 10px 0;
  font-family: var(--mono);
}
.case-col .mono-area {
  border: 0;
  border-radius: 0;
  min-height: 130px;
  font-size: 12.5px;
  resize: vertical;
}
.case-col .mono-area:focus { box-shadow: none; }

.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.save-hint { flex: 1; color: #b42318; font-size: 12.5px; }

/* ============ 学员 / 账号 ============ */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.progress-lg { height: 6px; background: #eef1f6; overflow: hidden; }
.progress-lg span { display: block; height: 100%; background: linear-gradient(90deg, #4c86ff, #0fa958); }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field.grow2 { grid-column: span 2; }
  .md-edit { grid-template-columns: 1fr; }
  .md-edit .mono-area { border-right: 0; border-bottom: 1px solid var(--line); min-height: 260px; }
  .md-preview { max-height: none; }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .case-cols { grid-template-columns: 1fr; }
  .case-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .case-col:last-child { border-bottom: 0; }
}


/* ============ 布局 ============ */
.app { max-width: 1320px; margin: 0 auto; padding: 22px; }

/* 打字练习：挂在 OJ 路由里的内嵌面板。
   宽度和其它页面完全一致（1320 居中 + 22 内边距）；高度用 flex 撑满剩余视口，
   顶栏 / 游客提示条这些的高度变化都不会把面板顶出屏幕。 */
body.typing-mode {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
@supports (height: 100dvh) {
  body.typing-mode { height: 100dvh; }
}
body.typing-mode .site-foot { display: none; }
/* flex 容器里 margin:auto 会吃掉剩余空间、把面板压成 300px，所以显式给宽度 */
.app.is-typing-page { width: 100%; flex: 1 1 auto; min-height: 0; padding-bottom: 14px; }
.typing-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f6fa;
}

/* 待审核提示条：常驻在顶栏下面，不属于任何页面，切页不会消失 */
.pending-bar {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 1276px; /* 和 .app 的内容区同宽（1320 - 左右 padding 22×2） */
  margin: 14px auto -8px;
  padding: 10px 14px;
  background: #fff8e6;
  border: 1px solid #f6e0a8;
  border-radius: 10px;
  color: #8a5a00;
  font-size: 12.5px;
  line-height: 1.6;
}
.pending-bar[hidden] { display: none; }
.pending-bar b { font-weight: 600; }
.pb-ico { flex: none; font-size: 14px; line-height: 1.4; }
.pb-text { min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ============ 题库页 ============ */
.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-card .k { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.stat-card .v { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-card .v small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  height: 34px;
  transition: border-color 0.15s, background 0.15s;
}
.search:focus-within { border-color: #b9ccfb; background: #fff; box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.09); }
.search svg { flex: none; stroke: var(--muted); }
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13.5px; color: var(--text); }
.search input::placeholder { color: #9aa4b1; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  transition: all 0.15s;
}
.chip:hover { border-color: #cbd5e1; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 题库分阶 ---------- */
.list-scope { font-size: 12.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }

.panel-head #repScope { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.rep-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.rep-toggle input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }

.panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; }

.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.stage-card {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px 11px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  font: inherit;
  color: inherit;
}
.stage-card:hover { border-color: #c3d2ea; box-shadow: 0 2px 8px rgba(28, 53, 92, .07); }
.stage-card.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset, 0 2px 10px rgba(43, 108, 246, .12);
  background: #f8fbff;
}
.stage-card .sc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.stage-card .sc-idx { font-size: 12px; font-weight: 650; color: var(--brand); letter-spacing: .02em; }
.stage-card .sc-num { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-card .sc-name {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-card .sc-bar {
  margin: 8px 0 6px;
  height: 4px;
  border-radius: 3px;
  background: #edf1f7;
  overflow: hidden;
}
.stage-card .sc-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #6ba1ff, var(--brand)); }
.stage-card .sc-foot { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.stage-pill {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #3f5b82;
  background: #eef3fa;
  border: 1px solid #e0e8f4;
  border-radius: 5px;
  white-space: nowrap;
}

/* 题库：三列紧凑列表（题号和标题同一行，一屏能看更多题） */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 14px;
}

.problem-row {
  display: grid;
  grid-template-columns: 18px auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.problem-row:hover {
  border-color: #bcd0ef;
  background: #f8fbff;
  box-shadow: 0 1px 4px rgba(28, 53, 92, .07);
}
.problem-row.is-ac { background: #f8fdfa; border-color: #dcf0e5; }
.problem-row.is-ac:hover { background: #f1fbf5; border-color: #b7e2c8; }

.problem-row .pr-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.problem-row.is-ac .pr-id { color: #3f8f66; }

.problem-row .pr-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.problem-row:hover .pr-title { color: var(--brand); }
/* 已通过的题：题目名标红（悬停也保持红色） */
.problem-row.is-ac .pr-title,
.problem-row.is-ac:hover .pr-title { color: #d0342c; }
/* 提交过但还没通过：题目名标橙 */
.problem-row.is-tried .pr-title,
.problem-row.is-tried:hover .pr-title { color: #c2740a; }

.problem-row .pr-sub {
  font-size: 11.5px;
  color: #9aa4b1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.problem-row .diff {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}

@media (max-width: 1000px) {
  .problem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .problem-grid { grid-template-columns: minmax(0, 1fr); }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}.pg-btn {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-num { min-width: 30px; padding: 5px 6px; text-align: center; font-variant-numeric: tabular-nums; }
.pg-num.on,
.pg-num.on:hover:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.pg-gap { font-size: 12px; color: var(--muted); padding: 0 1px; }
.pg-info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pg-info b { color: var(--text); font-weight: 650; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 16px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #f8fafd; }
tbody tr.clickable { cursor: pointer; }

.td-id { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.td-title a { font-weight: 550; color: var(--text); }
.td-title a:hover { color: var(--brand); }
.td-num { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
/* 作业列表：作业单元格两栏（信息 + 具体内容），内容多时框内滚动 */
.hw-cell-flex { display: flex; align-items: flex-start; gap: 14px; }
.hw-main { flex: 0 0 auto; max-width: 300px; min-width: 150px; }
.hw-main .sub-line { white-space: normal; word-break: break-all; }
.hw-content-box {
  flex: 1 1 200px;
  max-width: 360px;
  max-height: 88px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 7px 2px 2px;
  background: transparent;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.hw-content-box::-webkit-scrollbar { width: 6px; }
.hw-content-box::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.hw-content-box::-webkit-scrollbar-track { background: transparent; }
/* 作业管理：老师布置 / 系统生成 分类页签 */
.hw-tabs-wrap { padding: 12px 16px 0; }
.hw-tabs-wrap .hw-tabs { margin-bottom: 12px; }
.hw-tab-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(100, 116, 139, .12);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.track-tab.on .hw-tab-count { background: rgba(43, 108, 246, .12); color: var(--brand); }
.hw-pane[hidden] { display: none; }
/* 作业列表「布置老师」列 */
.td-teacher {
  font-size: 13px;
  color: var(--text-2);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; }
.status-dot .dot { width: 7px; height: 7px; border-radius: 50%; background: #d7dde5; }
.status-dot.ac { color: var(--ac); font-weight: 700; font-size: 14px; }
.status-dot.tried { color: #f59e0b; font-weight: 700; font-size: 14px; }

.diff {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.diff.d0 { color: #15803d; background: #e9f9f0; }
.diff.d1 { color: #1d4ed8; background: #eaf1ff; }
.diff.d2 { color: #b45309; background: #fdf3e4; }
.diff.d3 { color: #b91c1c; background: #fdeaea; }

.tag {
  display: inline-block;
  font-size: 11.5px;
  color: #5b6675;
  background: #f2f5f9;
  border-radius: 5px;
  padding: 2px 7px;
  margin-right: 4px;
}

.progress-mini { display: flex; align-items: center; gap: 8px; }
.progress-bar { width: 56px; height: 5px; border-radius: 3px; background: #edf0f5; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--ac); border-radius: 3px; }

/* ============ 题目页 ============ */
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.crumbs a:hover { color: var(--brand); }
.crumbs span { color: #b6bfca; margin: 0 6px; }

/* 顶部翻题条：上一题 / 下一题 / 题序 + 跳题搜索 */
.pnav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 7px 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.pnav-btn { padding: 5px 11px; font-size: 12.5px; white-space: nowrap; }
.pnav-btn:disabled { cursor: not-allowed; }
.pnav-btn:disabled:hover { border-color: var(--line); background: #fff; }
.pnav-pos { font-size: 12.5px; color: var(--muted); padding: 0 2px; white-space: nowrap; }
.pnav-pos b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pnav-scope {
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 3px 9px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pnav-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 300px;
  max-width: 100%;
  height: 32px;
  padding: 0 9px;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.pnav-search:focus-within { border-color: #b9ccfb; background: #fff; box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.09); }
.pnav-search svg { flex: none; stroke: var(--muted); }
.pnav-search input { border: 0; background: transparent; outline: none; width: 100%; min-width: 0; font-size: 13px; color: var(--text); }
.pnav-search input::placeholder { color: #9aa4b1; }
.pnav-kbd {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 15px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
}
.pnav-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  padding: 4px;
  max-height: 330px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 8px 26px -10px rgba(16, 24, 40, 0.28);
}
.pn-note { font-size: 11.5px; color: var(--muted); padding: 5px 8px 6px; }
.pn-empty { font-size: 12.5px; color: var(--muted); padding: 11px 8px; text-align: center; }
.pn-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}
.pn-item:hover, .pn-item.on-focus { background: var(--brand-soft); }
.pn-item.on .pn-id { color: var(--brand); font-weight: 600; }
.pn-id { flex: none; min-width: 46px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pn-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-title mark { background: #ffef9f; color: inherit; border-radius: 2px; padding: 0 1px; }
.pn-item .diff { flex: none; }

@media (max-width: 720px) {
  .pnav-search { width: 100%; order: 9; }
  .pnav-scope { display: none; }
}

.problem-head { margin-bottom: 14px; }
/* 题目页的答题悬赏条（答题红包）：暖色点缀，和群聊里的红包卡同一套语义 */
.pbounty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 9px 13px;
  border: 1px solid #f3d6b6;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff8f0 0%, #fffdf8 100%);
}
.pbounty-ico { font-size: 17px; line-height: 1; flex: none; }
.pbounty-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pbounty-txt b { font-size: 13px; color: #8a4a12; }
.pbounty-txt span { font-size: 11.5px; color: #9c6b3f; }
.pbounty .btn { flex: none; }
/* 悬赏已被 AC 抢走：绿色系，和「还在等」区分开 */
.pbounty-done { border-color: #bfe6cf; background: linear-gradient(90deg, #f2fbf5 0%, #fbfefc 100%); }
.pbounty-done .pbounty-txt b { color: #1f6b45; }
.pbounty-done .pbounty-txt span { color: #4b7f63; }
/* 查看 AC 代码的弹窗 */
.modal-bcode { max-width: min(760px, 92vw); }
.bcode-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.bcode-pre {
  margin: 0; padding: 12px 14px; max-height: 56vh; overflow: auto;
  background: #1f2533; color: #dfe6f2; border-radius: 10px;
  font-family: var(--mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0, "calt" 0;
  font-size: 12.5px; line-height: 20px;
  white-space: pre; tab-size: 4;
}
.problem-head h1 { margin: 0 0 8px; font-size: 21px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.problem-meta { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.problem-meta b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

.work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 16px; align-items: start; }
/* 左右两列各自纵向堆叠（左：题面 + 讨论区；右：编辑器 + 评测结果 + 我的提交） */
.work-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.work-col > .panel { margin-top: 0; }

/* 右列顶部的翻题条：宽度只占编辑器那一列，并和下面的编辑器面板贴合，不再横跨整页独占一行 */
.work-col > .pnav {
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: -16px; /* 抵消 work-col 的 gap，和编辑器面板连成一块 */
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  box-shadow: none;
}
.work-col > .pnav + .panel {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.work-col > .pnav .pnav-btn { padding: 4px 9px; }
.work-col > .pnav .pnav-pos { font-size: 12px; }
.work-col > .pnav .pnav-scope { display: none; } /* 右列偏窄，翻题范围只留在 button 的 title 里 */
.work-col > .pnav .pnav-search { flex: 1 1 150px; width: auto; min-width: 120px; height: 30px; }

.statement {
  padding: 22px 26px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.78;
  color: #26303d;
}

.statement h1, .statement h2, .statement h3 { color: var(--text); line-height: 1.35; }
.statement h2 {
  font-size: 15px;
  margin: 26px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--brand);
  letter-spacing: -0.01em;
}
.statement h2:first-child { margin-top: 0; }
.statement h3 { font-size: 14px; margin: 18px 0 8px; }
.statement p { margin: 10px 0; }
.statement ul, .statement ol { margin: 10px 0; padding-left: 22px; }
.statement li { margin: 4px 0; }

.statement code {
  font-family: Consolas, "Courier New", "Liberation Mono", Menlo, monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0;
  font-size: 12.8px;
  background: #f2f5f9;
  border: 1px solid #e8edf4;
  border-radius: 5px;
  padding: 1.5px 5px;
  color: #33507a;
}

.statement pre.md-code {
  /* 造型输出题（三角形/菱形等）对字符等宽和对齐要求很严格：
   * 不用带编程连字的字体（Cascadia Code / JetBrains Mono 会把 ** / *** 连成
   * 更宽更高的字形，导致同一段星号图案每行大小不一致），并明确关掉连字。 */
  font-family: Consolas, "Courier New", "Liberation Mono", Menlo, monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0;
  font-size: 13px;
  /* 用整数像素行高：原 1.65 倍行距在 125%/150% 缩放下是小数设备像素，
   * 同一字形每行落在不同亚像素相位上会被栅格化成不同高度（星号图案尤其明显） */
  line-height: 20px;
  letter-spacing: 0;
  text-align: left;
  white-space: pre;
  tab-size: 4;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 12px 0;
  color: #33405a;
}
.statement pre.md-code code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

.statement blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  background: #f7f9fc;
  border-left: 3px solid #cfd9e6;
  color: var(--text-2);
  border-radius: 0 6px 6px 0;
}

.statement hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* 行内公式：等宽 + 淡底色，和普通行内代码区分开 */
.statement .math {
  font-family: "Cambria Math", "Latin Modern Math", var(--mono);
  font-size: 0.96em;
  padding: 0 2px;
  color: #2c4a72;
  white-space: nowrap;
}
.statement .math-block { display: block; text-align: center; padding: 6px 0; white-space: normal; }
.statement .math sup, .statement .math sub { font-size: 0.72em; line-height: 0; }
.statement .math-mat { font-family: var(--mono); letter-spacing: 0.5px; }

.md-table-wrap { overflow-x: auto; margin: 12px 0; }
.md-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.md-table th, .md-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; text-transform: none; letter-spacing: 0; }
.md-table thead th { background: #f7f9fc; color: var(--text-2); }

.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 4px; }

.sample {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfe;
}
.sample-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f4f7fb;
  border-bottom: 1px solid var(--line);
}
.sample pre {
  margin: 0;
  padding: 10px 12px;
  /* 样例里可能是星号图形，必须原样等宽显示：不换行、不连字、不强断词 */
  font-family: Consolas, "Courier New", "Liberation Mono", Menlo, monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0;
  font-size: 12.8px;
  /* 整数行高：保证每行字形同一栅格相位，星号图案各行高度一致 */
  line-height: 20px;
  letter-spacing: 0;
  color: #2b3646;
  overflow-x: auto;
  max-height: 180px;
  white-space: pre;
  word-break: normal;
}

.copy-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 5px;
  font-size: 11px;
  padding: 1px 7px;
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--brand); border-color: #c9d8fb; }

details.hint {
  margin-top: 18px;
  border: 1px solid #f0e6d2;
  background: #fffdf7;
  border-radius: 8px;
  padding: 10px 14px;
}
details.hint summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #92620a;
  list-style: none;
}
details.hint summary::-webkit-details-marker { display: none; }
details.hint summary::before { content: "▸ "; }
details.hint[open] summary::before { content: "▾ "; }
details.hint > *:not(summary) { color: #5c4a26; }

/* ============ 编辑器 ============ */
.editor-panel { overflow: hidden; display: flex; flex-direction: column; }

/* 选择 / 判断题要藏掉编辑器：上面这句 display:flex 会盖掉浏览器自带的 [hidden]{display:none}，
   必须显式兜一下，否则 hidden 设了也没用（面板照样显示）。 */
.editor-panel[hidden],
.quiz-panel[hidden],
.result-panel[hidden] { display: none; }

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  flex-wrap: wrap;
  row-gap: 6px;
}
/* 编辑器底部那条工具栏（撤销 / 复制 / 全屏 / 提交评测）：边框换到上边 */
.editor-toolbar.is-foot { border-top: 1px solid var(--line); border-bottom: 0; }

.lang-badge {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #475569;
  background: #eef2f7;
  border-radius: 6px;
  padding: 3px 9px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex: none;
}

/* 提交消耗提示的样式已随工具栏文案一起移除（扣分规则仍在提交接口里生效） */

.spacer { flex: 1; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 7px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: #ccd5e1; background: #f8fafc; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(43, 108, 246, 0.3);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-primary:disabled { background: #9dbdfb; border-color: #9dbdfb; }

.kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  padding: 1px 4px;
}

.code-editor {
  position: relative;
  display: flex;
  height: 430px;
  overflow: hidden;
  /* 编程区配色：默认墨夜（深蓝灰底）。主题在「账号 → 个人资料」里选，
     这里只放默认值，body.edth-* 覆盖其它主题；编辑器上不放切换入口 */
  --ed-bg: #1f2533;
  --ed-gut-bg: #1a1f2b;
  --ed-gut-fg: #647083;
  --ed-gut-line: #2c3444;
  --ed-fg: #d5dce8;
  --ed-caret: #d5dce8;
  --ed-sel: rgba(96, 140, 220, 0.3);
  --ed-ph: #5a6577;
  --ed-kw: #7aa2f7;
  --ed-str: #9ece6a;
  --ed-com: #67718a;
  --ed-num: #e0af68;
  --ed-pre: #bb9af7;
  --ed-std: #7dcfff;
  /* 联想浮层：本主题的底色 60% 不透明（40% 透出底下的代码）+ 同色系的边框/选中色，压在代码上也认得出是哪套配色 */
  --ed-pop-bg: rgba(24, 30, 43, 0.6);
  --ed-pop-line: rgba(122, 162, 247, 0.42);
  --ed-pop-fg: #e6ecf7;
  --ed-pop-key: #ffffff;
  --ed-pop-dim: #9aa8bf;
  --ed-pop-on: rgba(122, 162, 247, 0.24);
  --ed-pop-chip: rgba(255, 255, 255, 0.12);
  --ed-pop-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.8);
  --ed-pop-ts: 0 0 3px rgba(10, 14, 22, 0.9), 0 1px 2px rgba(0, 0, 0, 0.5);
  background: var(--ed-bg);
}

.gutter {
  flex: none;
  width: 46px;
  background: var(--ed-gut-bg);
  color: var(--ed-gut-fg);
  font-family: var(--mono);
  font-size: calc(var(--code-fs) - 0.5px);
  line-height: var(--code-lh);
  text-align: right;
  padding: 12px 8px 12px 0;
  overflow: hidden;
  user-select: none;
  white-space: pre;
  border-right: 1px solid var(--ed-gut-line);
}

.code-wrap { position: relative; flex: 1; min-width: 0; }

.code-hl, .code-input {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: var(--code-fs);
  line-height: var(--code-lh);
  white-space: pre;
  tab-size: 4;
  border: 0;
  overflow: auto;
}

.code-hl {
  color: var(--ed-fg);
  pointer-events: none;
  z-index: 1;
  scrollbar-width: none;
}
.code-hl::-webkit-scrollbar { display: none; }

.c-std { color: var(--ed-std); }

.code-input {
  background: transparent;
  color: transparent;
  caret-color: var(--ed-caret);
  resize: none;
  outline: none;
  z-index: 2;
  overflow: auto;
}
.code-input::selection { background: var(--ed-sel); }
.code-input::placeholder { color: var(--ed-ph); }

/* ---------- 输入联想（自动补全）弹出层 ---------- */
/* 普通代码文本框（如出题页的代码片段）用它包一层，浮层才有定位基准 */
.ta-ac { position: relative; display: block; }
.ta-ac textarea { width: 100%; }
/* 白底输入框里跟一套浅色皮肤，别突然冒出来一块黑的 */
.ta-ac .ac-pop {
  background: rgba(255, 255, 255, 0.87);
  border-color: var(--line);
  color: var(--text-2);
  box-shadow: 0 12px 26px -10px rgba(16, 24, 40, 0.22);
}
.ta-ac .ac-item.on { background: var(--brand-soft); }
.ta-ac .ac-item b { color: var(--text); }
.ta-ac .ac-item em { color: var(--muted); }
.ta-ac .ac-foot { border-top-color: var(--line-soft); color: var(--muted); }
.ta-ac .ac-kind { color: #5b6472; background: #eef1f6; }
.ta-ac .ac-kind.ac-var { color: #15803d; background: #e7f6ec; }
.ta-ac .ac-kind.ac-type { color: #1d4ed8; background: #e8efff; }
.ta-ac .ac-kind.ac-field { color: #6d28d9; background: #f1eafe; }
.ta-ac .ac-kind.ac-method { color: #be185d; background: #fdecf2; }
.ta-ac .ac-kind.ac-snip { color: #b45309; background: #fdf3e2; }

.ac-pop {
  position: absolute;
  z-index: 6;
  min-width: 236px;
  max-width: 360px;
  max-height: 240px;
  overflow: auto;
  padding: 4px;
  /* 半透明：底下的代码还隐约看得见，不挡视线（全站禁了 backdrop-filter，这里是纯 alpha）。
     颜色全部走 --ed-pop-* —— 编程区里由 .code-editor 按主题给值（60% 不透明 + 主题色），
     白底文本框（.ta-ac）不在这套主题里，落到下面的 fallback，仍是原来的浅色浮层 */
  background: var(--ed-pop-bg, rgba(255, 255, 255, 0.87));
  border: 1px solid var(--ed-pop-line, rgba(215, 224, 238, 0.92));
  border-radius: 8px;
  box-shadow: var(--ed-pop-shadow, 0 12px 28px -12px rgba(16, 24, 40, 0.28));
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ed-pop-fg, #334155);
  /* 不完全不透明之后底下的代码会「透」上来，文字描一圈同色系的边压住它才看得清 */
  text-shadow: var(--ed-pop-ts, none);
}
.ac-pop[hidden] { display: none; }
.ac-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.ac-item.on { background: var(--ed-pop-on, var(--brand-soft)); }
.ac-kind {
  flex: none;
  font-size: 10px;
  line-height: 15px;
  padding: 0 5px;
  border-radius: 3px;
  color: var(--ed-pop-dim, #5b6472);
  background: var(--ed-pop-chip, #eef1f6);
}
/* 候选类型的小标签：直接复用当前主题的语法色，深色主题也不会出现一块刺眼的浅绿浅蓝 */
.ac-kind.ac-var { color: var(--ed-str, #15803d); }
.ac-kind.ac-type { color: var(--ed-std, #1d4ed8); }
.ac-kind.ac-field { color: var(--ed-pre, #6d28d9); }
.ac-kind.ac-method { color: var(--ed-kw, #be185d); }
.ac-kind.ac-snip { color: var(--ed-num, #b45309); }
.ac-item b {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--ed-pop-key, #111c2d);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-item em {
  color: var(--ed-pop-dim, #6b7688);
  font-style: normal;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-foot {
  margin-top: 3px;
  padding: 4px 7px 2px;
  border-top: 1px solid var(--ed-pop-line, #eaedf3);
  color: var(--ed-pop-dim, #7a8595);
  font-size: 10.5px;
}

/* ---------- 代码字号：工具栏 A- / A+ ---------- */
.code-fs-box {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin: 0 4px;
  padding: 0 5px;
  flex: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.code-fs-cur {
  min-width: 36px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.code-fs-box .btn-icon { min-width: 22px; padding: 0 3px; font-size: 10.5px; font-weight: 700; }

/* 底部工具栏本来就挤（撤销 / 复制 / 粘贴 / 重置 / 全屏 / 提交），
   语言标识不是必需信息，窄屏时让位给按钮；宽屏再显示出来 */
.editor-toolbar.is-foot .lang-badge { display: none; }
@media (min-width: 1500px) {
  .editor-toolbar.is-foot .lang-badge { display: inline-block; }
}

/* 语法高亮配色：编辑器（.code-editor）内读 --ed-* 变量（墨夜）；
   题面/提交回看/讨论/聊天里的只读代码块不在 .code-editor 里，
   落到 fallback 浅色，保持全站简约风不变 */
/* 注释不用斜体：等宽字体斜体在深色主题里会发虚、也影响对齐（2026-11-16 用户要求） */
.c-com { color: var(--ed-com, #97a3b4); }
.c-str { color: var(--ed-str, #0f7b3f); }
.c-pre { color: var(--ed-pre, #7c3aed); }
.c-kw  { color: var(--ed-kw, #1d4ed8); }
.c-std { color: var(--ed-std, #0e7490); }
.c-num { color: var(--ed-num, #b45309); }
/* 光标贴着 () [] {} 时，左右一对同时点亮（2026-11-22） */
.c-bracket-active {
  color: #ffb020;
  background: rgba(255, 176, 32, 0.18);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.35);
  font-weight: 700;
}

/* ---------- 编程区主题（做题/作业/比赛/聊天代码弹窗共用） ----------
   入口只在「账号 → 个人资料 → 编程区主题」，选中存账号，下次登录沿用。
   默认墨夜（.code-editor 上的变量），下面七套由 body 类整套换色。
   每套都带一组 --ed-pop-*：联想浮层用本主题底色 50% 透明 + 同色系边框。 */
/* 浅云：白底浅灰，白天/投屏用 */
body.edth-light .code-editor {
  --ed-bg: #f8fafc;
  --ed-gut-bg: #f2f5fa;
  --ed-gut-fg: #9aa6b6;
  --ed-gut-line: #e7ebf2;
  --ed-fg: #24303f;
  --ed-caret: #1f2937;
  --ed-sel: rgba(37, 99, 235, 0.18);
  --ed-ph: #a9b4c2;
  --ed-kw: #1d4ed8;
  --ed-str: #0f7b3f;
  --ed-com: #97a3b4;
  --ed-num: #b45309;
  --ed-pre: #7c3aed;
  --ed-std: #0e7490;
  --ed-pop-bg: rgba(203, 219, 243, 0.6);
  --ed-pop-line: rgba(37, 99, 235, 0.34);
  --ed-pop-fg: #1f2937;
  --ed-pop-key: #0f172a;
  --ed-pop-dim: #5b6b80;
  --ed-pop-on: rgba(37, 99, 235, 0.16);
  --ed-pop-chip: rgba(15, 23, 42, 0.09);
  --ed-pop-shadow: 0 16px 32px -16px rgba(16, 24, 40, 0.35);
  --ed-pop-ts: 0 0 3px rgba(255, 255, 255, 0.95);
}
/* 暖沙：米黄护眼底 */
body.edth-solar .code-editor {
  --ed-bg: #f7f2e7;
  --ed-gut-bg: #efe8d8;
  --ed-gut-fg: #a39a86;
  --ed-gut-line: #e3dbc8;
  --ed-fg: #4a463c;
  --ed-caret: #4a463c;
  --ed-sel: rgba(196, 158, 66, 0.28);
  --ed-ph: #b0a78f;
  --ed-kw: #9c4a1a;
  --ed-str: #5c7a29;
  --ed-com: #a8a08c;
  --ed-num: #a34d68;
  --ed-pre: #7d5fc0;
  --ed-std: #2a7f8f;
  --ed-pop-bg: rgba(232, 219, 191, 0.6);
  --ed-pop-line: rgba(156, 74, 26, 0.34);
  --ed-pop-fg: #4a463c;
  --ed-pop-key: #2f2a20;
  --ed-pop-dim: #6f6857;
  --ed-pop-on: rgba(196, 158, 66, 0.26);
  --ed-pop-chip: rgba(74, 70, 60, 0.1);
  --ed-pop-shadow: 0 16px 32px -16px rgba(90, 74, 40, 0.32);
  --ed-pop-ts: 0 0 3px rgba(255, 250, 238, 0.95);
}
/* 黑白极简：纯灰阶，靠深浅区分 */
body.edth-ink .code-editor {
  --ed-bg: #ffffff;
  --ed-gut-bg: #f4f4f4;
  --ed-gut-fg: #9a9a9a;
  --ed-gut-line: #e6e6e6;
  --ed-fg: #1c1c1c;
  --ed-caret: #1c1c1c;
  --ed-sel: rgba(0, 0, 0, 0.14);
  --ed-ph: #b5b5b5;
  --ed-kw: #111111;
  --ed-str: #555555;
  --ed-com: #999999;
  --ed-num: #444444;
  --ed-pre: #666666;
  --ed-std: #333333;
  --ed-pop-bg: rgba(226, 226, 226, 0.6);
  --ed-pop-line: rgba(0, 0, 0, 0.24);
  --ed-pop-fg: #1c1c1c;
  --ed-pop-key: #000000;
  --ed-pop-dim: #5f5f5f;
  --ed-pop-on: rgba(0, 0, 0, 0.1);
  --ed-pop-chip: rgba(0, 0, 0, 0.07);
  --ed-pop-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.3);
  --ed-pop-ts: 0 0 3px rgba(255, 255, 255, 0.95);
}
/* 复古终端：墨绿底 + 荧光绿 */
body.edth-term .code-editor {
  --ed-bg: #0e1a14;
  --ed-gut-bg: #0a130e;
  --ed-gut-fg: #3f6b52;
  --ed-gut-line: #1d3328;
  --ed-fg: #b8e6c6;
  --ed-caret: #d2ffe0;
  --ed-sel: rgba(60, 220, 130, 0.22);
  --ed-ph: #47775c;
  --ed-kw: #56d364;
  --ed-str: #f2cc60;
  --ed-com: #4d7a5e;
  --ed-num: #f0883e;
  --ed-pre: #d2a8ff;
  --ed-std: #76e3ea;
  --ed-pop-bg: rgba(5, 20, 13, 0.6);
  --ed-pop-line: rgba(86, 211, 100, 0.42);
  --ed-pop-fg: #c6f0d2;
  --ed-pop-key: #e8fff0;
  --ed-pop-dim: #7fb495;
  --ed-pop-on: rgba(86, 211, 100, 0.2);
  --ed-pop-chip: rgba(86, 211, 100, 0.16);
  --ed-pop-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.85);
  --ed-pop-ts: 0 0 3px rgba(4, 14, 9, 0.9), 0 1px 2px rgba(0, 0, 0, 0.5);
}
/* 雾蓝（Nord）：北欧冷灰蓝，配色最耐看 */
body.edth-nord .code-editor {
  --ed-bg: #2e3440;
  --ed-gut-bg: #292e39;
  --ed-gut-fg: #6b7688;
  --ed-gut-line: #3b4252;
  --ed-fg: #d8dee9;
  --ed-caret: #eceff4;
  --ed-sel: rgba(136, 192, 208, 0.28);
  --ed-ph: #616e88;
  --ed-kw: #81a1c1;
  --ed-str: #a3be8c;
  --ed-com: #616e88;
  --ed-num: #b48ead;
  --ed-pre: #d08770;
  --ed-std: #88c0d0;
  --ed-pop-bg: rgba(36, 41, 51, 0.6);
  --ed-pop-line: rgba(136, 192, 208, 0.42);
  --ed-pop-fg: #e5e9f0;
  --ed-pop-key: #ffffff;
  --ed-pop-dim: #a3b1c6;
  --ed-pop-on: rgba(136, 192, 208, 0.22);
  --ed-pop-chip: rgba(255, 255, 255, 0.12);
  --ed-pop-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.75);
  --ed-pop-ts: 0 0 3px rgba(20, 24, 31, 0.9), 0 1px 2px rgba(0, 0, 0, 0.45);
}
/* 深海：深青蓝底 + 青色高亮，夜里不刺眼 */
body.edth-ocean .code-editor {
  --ed-bg: #0d2433;
  --ed-gut-bg: #0a1c28;
  --ed-gut-fg: #4d7188;
  --ed-gut-line: #17384b;
  --ed-fg: #cfe6f2;
  --ed-caret: #e6f7ff;
  --ed-sel: rgba(34, 211, 238, 0.26);
  --ed-ph: #4a7086;
  --ed-kw: #22d3ee;
  --ed-str: #7ee0b8;
  --ed-com: #4e7389;
  --ed-num: #fbbf24;
  --ed-pre: #c4b5fd;
  --ed-std: #93c5fd;
  --ed-pop-bg: rgba(8, 26, 37, 0.6);
  --ed-pop-line: rgba(34, 211, 238, 0.4);
  --ed-pop-fg: #d8eefb;
  --ed-pop-key: #ffffff;
  --ed-pop-dim: #8fb2c6;
  --ed-pop-on: rgba(34, 211, 238, 0.2);
  --ed-pop-chip: rgba(255, 255, 255, 0.11);
  --ed-pop-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.82);
  --ed-pop-ts: 0 0 3px rgba(3, 12, 18, 0.9), 0 1px 2px rgba(0, 0, 0, 0.5);
}
/* 樱花：浅粉底 + 玫红关键字，柔和清爽 */
body.edth-sakura .code-editor {
  --ed-bg: #fff5f7;
  --ed-gut-bg: #fdeef1;
  --ed-gut-fg: #b99aa4;
  --ed-gut-line: #f5e0e6;
  --ed-fg: #4a3a41;
  --ed-caret: #3d2c34;
  --ed-sel: rgba(219, 39, 119, 0.16);
  --ed-ph: #c4a8b2;
  --ed-kw: #be185d;
  --ed-str: #15803d;
  --ed-com: #b39aa3;
  --ed-num: #b45309;
  --ed-pre: #7c3aed;
  --ed-std: #0e7490;
  --ed-pop-bg: rgba(246, 214, 224, 0.6);
  --ed-pop-line: rgba(190, 24, 93, 0.32);
  --ed-pop-fg: #4a3a41;
  --ed-pop-key: #2b1f24;
  --ed-pop-dim: #7d6670;
  --ed-pop-on: rgba(190, 24, 93, 0.14);
  --ed-pop-chip: rgba(74, 58, 65, 0.09);
  --ed-pop-shadow: 0 16px 32px -16px rgba(120, 60, 85, 0.3);
  --ed-pop-ts: 0 0 3px rgba(255, 247, 250, 0.95);
}

/* 个人资料里的主题下拉：选完立即预览，下面那行小字走通用 .field > .field-tip */

/* ============ 评测结果 ============ */
.result-panel { margin-top: 16px; overflow: hidden; }

.result-empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

/* 提交冷却：两次提交间隔 20 秒，没到点服务器不判题，这里显示倒计时 */
.submit-cool { padding: 22px 18px; text-align: center; }
.submit-cool .sc-head {
  font-size: 14px;
  font-weight: 650;
  color: #a4231c;
  margin-bottom: 8px;
}
.submit-cool .sc-head.is-ok { color: var(--brand-dark); }
.submit-cool .sc-tip {
  margin: 0 auto;
  max-width: 460px;
  font-size: 12.8px;
  line-height: 1.75;
  color: var(--text-2);
}
.submit-cool .sc-tip b { color: #a4231c; }
.submit-cool .sc-sec {
  display: inline-block;
  min-width: 22px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
/* 冷却期间提交按钮：去掉主色，看着就知道现在点不动 */
.btn.is-cooling,
.btn.is-cooling:hover {
  background: #f2f4f8;
  color: var(--text-2);
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
  white-space: nowrap; /* 「12s 后可提交」别在窄屏折成两行 */
}
/* 倒计时秒数单独一个 class：不能再用 .kbd（半屏时 .editor-toolbar .kbd 会被隐藏，
   结果把数字一起藏了，按钮上只剩「后可提交」） */
.cool-secs {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.verdict .vg {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.v-AC { color: var(--ac); }        .v-AC .vg { background: var(--ac); }
.v-WA { color: var(--wa); }        .v-WA .vg { background: var(--wa); }
.v-TLE { color: var(--tle); }      .v-TLE .vg { background: var(--tle); }
.v-MLE { color: var(--mle); }      .v-MLE .vg { background: var(--mle); }
.v-RE { color: var(--re); }        .v-RE .vg { background: var(--re); }
.v-CE { color: var(--ce); }        .v-CE .vg { background: var(--ce); }
.v-OLE { color: #0e7490; }         .v-OLE .vg { background: #0e7490; }
.v-SE { color: var(--ce); }        .v-SE .vg { background: var(--ce); }
.v-Pending, .v-Judging { color: var(--brand); }
.v-Pending .vg, .v-Judging .vg { background: var(--brand); }

.score-big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.score-big small { font-size: 12px; color: var(--muted); font-weight: 500; }

.res-meta { margin-left: auto; display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); }
.res-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.case-grid { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; }

.case-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
  border-radius: 6px;
  padding: 4px 9px;
  border: 1px solid transparent;
  background: #f3f5f9;
  color: #64748b;
  cursor: pointer;
  transition: all 0.13s;
  min-width: 44px;
  text-align: center;
}
.case-pill:hover { filter: brightness(0.96); }
.case-pill.sel { box-shadow: 0 0 0 2px rgba(43, 108, 246, 0.35); }

.cp-AC { background: var(--ac-soft); color: #0a7a41; border-color: #c8efd9; }
.cp-WA { background: var(--wa-soft); color: #b42318; border-color: #fbd0d2; }
.cp-TLE { background: var(--tle-soft); color: #6d34d1; border-color: #e2d6fb; }
.cp-MLE { background: var(--mle-soft); color: #92400e; border-color: #f8e0c0; }
.cp-RE { background: var(--re-soft); color: #b4470e; border-color: #fadbc8; }
.cp-OLE { background: #e4f4f8; color: #0e7490; border-color: #c5e7f0; }
.cp-CE, .cp-SE { background: var(--ce-soft); color: #52606d; border-color: #dfe5ec; }

.case-detail {
  border-top: 1px solid var(--line);
  padding: 16px;
  background: #fcfdff;
  font-size: 13px;
}
.case-detail .cd-row { margin-bottom: 14px; }
.case-detail .cd-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.case-detail pre {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  font-family: var(--mono);
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "calt" 0;
  font-size: 12.5px;
  line-height: 20px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow: auto;
  color: #2b3646;
}

.compile-box {
  margin: 14px 16px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #33425a;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
}

/* CE 提示下方的判题环境说明行：顺手把「为什么编译不过」的环境问题答了 */
.ce-env-tip {
  margin: 0 16px 16px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #eef4ff;
  border: 1px solid #d4e3ff;
  color: #2b5db8;
  font-size: 12.5px;
  line-height: 1.6;
}
.ce-env-tip b {
  font-family: var(--mono);
}
.ce-env-tip a {
  color: #2b6cf6;
  font-weight: 600;
}

/* 被沙箱拦下来的提交：在编译框上方单独提示一句，
   免得学员看到「编译错误」以为自己语法写错了 */
.blocked-tip {
  margin: 14px 16px 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fdf1ee;
  border: 1px solid #f2d2c9;
  color: #a5331d;
  font-size: 13px;
  font-weight: 600;
}

.judging-anim {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(43, 108, 246, 0.25);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 提交详情 ============ */
.sub-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

.code-readonly {
  background: #fbfcfe;
  color: #24303f;
  font: 13px/1.65 var(--mono);
  padding: 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: auto;
  max-height: calc(100vh - 260px);
  white-space: pre;
  margin: 0;
}

.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ 空状态 ============ */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .big { font-size: 30px; margin-bottom: 10px; opacity: 0.5; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: #141923;
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 响应式 ============ */
/* ---- 分屏 / 半屏窗口（两窗口并排，每边约 600~1180px）：两列保留，收紧留白让内容多露一点 ---- */
@media (max-width: 1180px) and (min-width: 901px) {
  .work { gap: 12px; }
  .work-col { gap: 12px; }
  .work-col > .pnav { margin-bottom: -12px; }
  .statement { padding: 16px 18px; max-height: calc(100vh - 150px); }
  .problem-meta { gap: 6px 14px; }
  .code-editor { height: 320px; }
  /* 工具栏按键多（提交 / 字号 / 撤销 / 整理 / 复制 / 粘贴 / 重置 / 全屏），不够宽就换行，别挤爆 */
  .editor-toolbar { gap: 8px; }
  .editor-toolbar .kbd { display: none; } /* 快捷键提示先藏掉，省下的宽度给按钮 */
}

@media (max-width: 900px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  /* 窄屏拍平两列：题面 → 翻题条 → 编辑器 → 结果 → 我的提交 → 讨论区（讨论区放最后，少挡手） */
  .work-col { display: contents; }
  .work .cm-panel { order: 9; }
  .statement { max-height: none; }
  .sub-layout { grid-template-columns: minmax(0, 1fr); }
  .code-editor { height: 360px; }
  .editor-toolbar { gap: 8px; }
  .editor-toolbar .kbd { display: none; }
}

@media (max-width: 720px) {
  .app { padding: 14px; }
  .topbar-inner { padding: 0 14px; gap: 14px; }
  .brand-text em { display: none; }
  .topstat { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .sample-grid { grid-template-columns: 1fr; }
  .statement { padding: 18px; }
  .pending-bar { margin: 12px 14px -4px; }
}

/* ============ 提交筛选 / 代码展开 ============ */
.sub-filter { padding: 11px 16px; }
.filter-field { display: flex; align-items: center; gap: 6px; }
.filter-field > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.filter-field .input { height: 32px; width: auto; min-width: 104px; max-width: 230px; font-size: 13px; }
.sub-filter .search { height: 32px; }

.more-bar { display: flex; align-items: center; justify-content: center; gap: 10px; }
.more-bar:not(:empty) { padding: 12px 16px; border-top: 1px solid var(--line); }

tr.code-row > td { padding: 0; background: #f7f9fc; border-bottom: 1px solid var(--line); }
.code-expand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  background: #eff3f9;
  border-bottom: 1px solid #e1e7f0;
}
.code-expand-pre {
  margin: 0;
  background: #fbfcfe;
  color: #24303f;
  font: 12.5px/20px var(--mono);
  font-variant-ligatures: none;
  padding: 14px 16px;
  overflow: auto;
  max-height: 420px;
  white-space: pre;
}

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
  opacity: 0;
  transition: opacity .16s ease;
}
.modal-mask.show { opacity: 1; }

.modal {
  width: 100%;
  max-width: 470px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 14px;
  box-shadow: 0 24px 60px -16px rgba(16, 24, 40, .35);
  transform: translateY(8px) scale(.985);
  transition: transform .18s ease;
}
.modal-mask.show .modal { transform: none; }
.modal-wide { max-width: 720px; }

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-x {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.modal-x:hover { background: var(--line-soft); color: var(--text); }

.modal-body { padding: 18px; overflow: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #fcfdfe;
  border-radius: 0 0 14px 14px;
}

/* 评测通过的鼓励弹窗 */
.modal-reward .modal-body { padding: 22px 22px 16px; }
.rm { text-align: center; }
.rm-emoji { font-size: 40px; line-height: 1; color: #d97706; }
.rm-emoji .ico { vertical-align: 0; }
.rm-praise {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -.02em;
  color: var(--text);
}
.rm-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.rm-note { margin-top: 8px; color: var(--text-2); font-size: 13px; }
.rm-points {
  margin: 16px auto 6px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.rm-points small { font-size: 15px; font-weight: 600; color: var(--muted); }
/* 奖励明细：多条奖励叠加时逐条列出（图标 + 说明 + 分值），最后带合计 */
.rm-items {
  margin: 12px auto 0;
  max-width: 380px;
  text-align: left;
  background: #f6fbf8;
  border: 1px solid #d9efe3;
  border-radius: 10px;
  padding: 8px 12px 10px;
  font-size: 13px;
  color: #14532d;
}
.rm-items-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #cfe7da;
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
}
.rm-items-head span:last-child { font-weight: 600; color: #4d7c62; }
.rm-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  line-height: 1.45;
}
.rm-item + .rm-item { border-top: 1px solid rgba(21, 128, 61, .08); }
.rm-item-ic { flex: 0 0 18px; text-align: center; font-size: 13px; }
.rm-item-t { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.rm-item-note { margin-left: 4px; color: #b45309; font-size: 12px; }
.rm-item-p {
  flex: 0 0 auto;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: #15803d;
}
.rm-item.is-neg .rm-item-p { color: #b42318; }
.rm-item.is-sum {
  margin-top: 2px;
  border-top: 1px dashed #cfe7da;
  padding-top: 7px;
  font-weight: 700;
}
.rm-item.is-sum .rm-item-t { color: #14532d; }
.rm-item.is-sum .rm-item-p { font-size: 14px; }
/* 老样式：仅历史弹窗残留，保留兼容 */
.rm-hw {
  margin: 12px auto 0;
  max-width: 340px;
  text-align: left;
  background: #f6fbf8;
  border: 1px solid #d9efe3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #14532d;
}
.rm-hw-row + .rm-hw-row { margin-top: 4px; }
.rm-hw-row.is-late { color: #b45309; }
.rm-hw-row.is-late b { color: #b42318; }
.rm-points.is-neg { color: #b42318; }
.rm-balance { margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.rm-balance b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ============ 弹窗里的表单 ============ */
.form { display: flex; flex-direction: column; gap: 12px; }
.form > label,
.form .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.form input[type="text"],
.form input[type="number"],
.form input[type="datetime-local"],
.form input:not([type]),
.form select,
.form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  font-weight: 400;
}
.form textarea { resize: vertical; line-height: 1.6; }
.form textarea[name="ids"] { font-family: var(--mono); letter-spacing: .01em; }
.form input:focus,
.form select:focus,
.form textarea:focus { border-color: #b9ccfb; box-shadow: 0 0 0 3px rgba(43, 108, 246, .09); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-err { color: #b42318; font-size: 12.5px; min-height: 16px; }

/* 敏感操作的密码确认框 */
.pw-box { display: flex; flex-direction: column; gap: 10px; }
.pw-tip {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.65;
  color: var(--text-2);
  background: #f6f8fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.pw-tip.is-danger { color: #a4231c; background: #fdeceb; border-color: #f3d3d0; }
.pw-label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.pw-label .input { width: 100%; }

.scope-row { display: flex; gap: 16px; align-items: center; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 400; }
.radio input { accent-color: var(--brand); }
.stu-pick {
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #fbfcfe;
}
.stu-item { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 7px; font-size: 13px; color: var(--text); font-weight: 400; }
.stu-item:hover { background: #eef3fd; }
.stu-item em { font-style: normal; color: var(--muted); font-size: 11.5px; margin-left: 6px; font-family: var(--mono); }
.stu-item input { accent-color: var(--brand); }

.pt-user { font-size: 13px; color: var(--text-2); }
.pt-user b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ============ 我的作业 ============ */
.hw-list { display: flex; flex-direction: column; gap: 12px; }
.hw-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--brand);
}
.hw-card.hw-done { border-left-color: var(--ac); }
.hw-card.hw-late { border-left-color: #b45309; }
.hw-card.hw-over { border-left-color: #cbd5e1; }

.hw-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hw-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.hw-due { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.hw-due b { color: var(--text-2); font-weight: 600; }
.due-left { color: var(--brand); margin-left: 8px; }
.due-over { color: #b42318; margin-left: 8px; }
/* 逾期罚分：作业卡片上用橙色提示，别和「已过期」的红混在一起 */
.hw-fine { color: #b45309; font-weight: 600; }
.stat-card .v.down { color: #b45309; }

.hw-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  vertical-align: 2px;
  margin-left: 6px;
}
.b-doing { background: var(--brand-soft); color: var(--brand-dark); }
.b-done { background: var(--ac-soft); color: #0b7a41; }
.b-late { background: #fdf1e3; color: #b45309; }
.b-over { background: #eef1f5; color: #64748b; }

.hw-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.hw-bar .progress-mini { flex: 0 0 240px; max-width: 240px; }
.hw-count { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hw-reward { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.hw-reward b { color: #b45309; }

.hw-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  background: #f8fafd;
  border-radius: 8px;
  padding: 7px 10px;
}

.hw-plist { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.hw-p {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  color: var(--text-2);
}
.hw-p:hover { border-color: #bcd0ef; background: #f6f9ff; color: var(--brand); }
.hw-p.ok { background: #f6fcf8; border-color: #d9efe3; }
.hw-p-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #cfd6e0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  flex: 0 0 14px;
}
.hw-p.ok .hw-p-dot { background: var(--ac); border-color: var(--ac); }
.hw-p-id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.hw-p-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hw-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.hw-foot .hw-teacher { white-space: nowrap; }
.hw-foot .hw-go { margin-left: auto; color: var(--brand); }
.hw-foot .hw-doneat { margin-left: auto; color: #0b7a41; }

/* ---- 作业作答页（和考试答题页同一套布局） ---- */
.hw-prog { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.exam-clock.hw-clock-over { background: rgba(100, 116, 139, .34); border-color: rgba(255, 255, 255, .2); }
.ec-time.is-over { font-size: 21px; letter-spacing: .02em; }
.ex-card.is-over { background: #fbfcfd; }

/* ============ 我的积分 ============ */
.points-hero {
  display: grid;
  grid-template-columns: minmax(170px, 220px) 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 16px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2b6cf6 0%, #5b3df5 100%);
  box-shadow: 0 12px 28px -14px rgba(43, 108, 246, .6);
}
.ph-label { font-size: 13px; opacity: .85; }
.ph-num { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ph-sub { font-size: 12.5px; opacity: .9; margin-top: 2px; }
.ph-sub b { font-weight: 700; }
.ph-rules {
  background: rgba(255, 255, 255, .14);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 12.5px;
}
.ph-rule-title { font-weight: 600; opacity: .9; margin-bottom: 6px; }
.ph-rule { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.ph-rule b { margin-left: auto; }
.ph-rule-k { opacity: .9; }
.ph-rules .diff { background: rgba(255, 255, 255, .92); }

/* 顶部积分概览（2026-11-21 重排）：左边大数字，右边四张小卡，规则收进折叠面板 */
.ph-main { min-width: 0; }
.ph-num small { font-size: 14px; font-weight: 600; margin-left: 4px; opacity: .65; }
.ph-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ph-mini-card {
  background: #fff; border: 1px solid #dbe6fb; border-radius: 10px;
  padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.ph-mini-card span { font-size: 11.5px; color: #5b6b82; }
.ph-mini-card b {
  display: flex; align-items: baseline; gap: 3px;
  font-size: 21px; font-weight: 700; line-height: 1.15;
  color: #1f2937; font-variant-numeric: tabular-nums;
}
.ph-mini-card b em { font-style: normal; font-size: 11.5px; font-weight: 600; color: #5b6b82; }
.ph-mini-card b.is-todo { color: #b45309; }

/* 规则：折叠面板，展开后两列排，省掉原来那一大块留白 */
.ph-rules-panel { padding: 0; overflow: hidden; }
.ph-rules-panel > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer; list-style: none;
  font-size: 13px; color: var(--text);
}
.ph-rules-panel > summary::-webkit-details-marker { display: none; }
.ph-rules-panel > summary::before {
  content: '＋'; flex: 0 0 auto;
  width: 18px; text-align: center; color: var(--muted); font-weight: 700;
}
.ph-rules-panel[open] > summary::before { content: '－'; }
.ph-rules-panel > summary span { font-size: 11.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 560px) {
  /* 窄屏别把标题挤成「怎么拿分 / 怎么花 分」，副标题换到第二行 */
  .ph-rules-panel > summary { flex-wrap: wrap; }
  .ph-rules-panel > summary b { white-space: nowrap; }
  .ph-rules-panel > summary span { flex: 1 1 100%; padding-left: 28px; }
}
.ph-rule-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2px 26px; padding: 2px 16px 14px;
  font-size: 12.5px;
}

/* ---------- 账号管理 → 积分规则（难度系数） ---------- */
.eco-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.eco-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface, #fff);
}
.eco-chip b { font-size: 14px; color: var(--brand); }
.eco-chip em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.eco-chip.is-custom { border-color: rgba(43, 108, 246, .35); background: rgba(43, 108, 246, .05); }
.modal-economy .modal-body { max-height: 74vh; overflow: auto; }
.eco-form .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.eco-preview { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--bg-soft, #f7f8fa); }
.eco-line { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 3px 0; color: var(--text-2); }
.eco-line b { margin-left: auto; color: var(--text); }
.eco-line em { font-style: normal; font-size: 11.5px; color: var(--muted); min-width: 96px; text-align: right; }
.eco-line.is-net { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; }
.eco-line.is-net b { font-size: 15px; color: var(--brand); }
.eco-line.is-net b.is-low { color: #d8622f; }
.eco-warn { font-size: 12.5px; color: #d8622f; }
.eco-audit { margin-top: 14px; }
.eco-audit-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.eco-audit-row { display: flex; gap: 10px; font-size: 12px; color: var(--text-2); padding: 2px 0; }
.eco-audit-row span { color: var(--muted); }
.eco-audit-row em { font-style: normal; }

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 16px 18px;
}
.gift-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .12s, box-shadow .12s;
}
.gift-card:hover { border-color: #c7d8f6; box-shadow: var(--shadow-sm); }
.gift-card.is-out { opacity: .6; }
.gc-name { font-weight: 650; font-size: 14px; }
.gc-desc { font-size: 12px; color: var(--muted); min-height: 32px; line-height: 1.5; }
.gc-meta { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.gc-cost { font-size: 17px; font-weight: 700; color: #b45309; font-variant-numeric: tabular-nums; }
.gc-cost small { font-size: 11.5px; font-weight: 600; }
.gc-stock { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

.log-list { padding: 4px 0 8px; }
.log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.log-row:last-child { border-bottom: 0; }
.log-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 18px;
}
.log-dot.plus { background: var(--ac-soft); color: #0b7a41; }
.log-dot.minus { background: var(--wa-soft); color: #b42318; }
.log-reason { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.log-delta.plus { color: #0b7a41; }
.log-delta.minus { color: #b42318; }
.log-at { color: var(--muted); font-size: 12px; width: 78px; text-align: right; }

/* ============ 作业管理 ============ */
.sub-line { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.collapsible > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::before {
  content: '▸';
  color: var(--muted);
  font-size: 11px;
  transition: transform .15s;
}
.collapsible[open] > summary::before { transform: rotate(90deg); }
.collapsible > summary:hover { background: #fafbfd; }

.gift-admin { padding: 4px 16px 14px; }
.ga-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.ga-row:last-child { border-bottom: 0; }
.ga-name { font-weight: 600; width: 150px; }
.ga-desc { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ga-cost { width: 80px; color: #b45309; font-weight: 600; font-variant-numeric: tabular-nums; }
.ga-stock { width: 80px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .points-hero { grid-template-columns: 1fr; gap: 14px; }
  .ph-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw-bar .progress-mini { flex: 1 1 auto; max-width: none; }
  .form-row { grid-template-columns: 1fr; }
  .stu-pick { grid-template-columns: 1fr; }
}

/* 作业卡里的进度条拉满整格（默认 .progress-bar 是 56px 定宽） */
.hw-bar .progress-bar { width: 100%; height: 6px; }

/* ============ 注册页 ============ */
.reg-card { max-width: 400px; }

/* 注册卡紧凑化：项目多（验证区 + 用户名 + 密码×2 + 邀请码 + 身份），收紧行距尽量一屏放下 */
.reg-card { padding: 20px 22px 16px; gap: 8px; }
.reg-card h1 { font-size: 17px; }
.reg-card .reg-lead { font-size: 12px; line-height: 1.5; margin: 0; }
.reg-card .field { gap: 3px; }
.reg-card .field > .field-tip { margin-top: 2px; font-size: 11px; line-height: 1.45; }
.reg-card .input { height: 36px; }
.reg-card .reg-verify { padding: 9px 10px; margin-bottom: 2px; }
.reg-card .rv-tabs { margin-bottom: 6px; }
.reg-card .rv-head { font-size: 11.5px; margin-bottom: 5px; }
.reg-card .rv-tab { padding: 5px 4px; font-size: 12px; }
.reg-card .rv-row { margin-bottom: 6px; }
.reg-card .rv-row .input { height: 34px; }
.reg-card .rv-send { height: 34px; }
.reg-card .rv-tip { font-size: 11px; line-height: 1.5; }
.reg-card .reg-role { margin: 2px 0 0; }
.reg-card .reg-role span { font-size: 11.5px; line-height: 1.45; }
.reg-card .login-err { min-height: 15px; font-size: 12px; }
.reg-card .btn-primary { height: 36px; font-size: 13.5px; }
.reg-card .reg-hint { min-height: 0; font-size: 11px; line-height: 1.5; }
.reg-card .login-alt { padding-top: 8px; }
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f4f6fa;
  border-radius: 10px;
  padding: 4px;
}
.role-tab {
  border: 0;
  background: transparent;
  color: var(--text-2);
  border-radius: 8px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s, box-shadow .15s;
}
.role-tab:hover { color: var(--text); }
.role-tab.on {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
.role-tab:disabled { cursor: default; opacity: .75; }

/* 出题：题目来源四选一 */
.src-tabs { grid-template-columns: repeat(4, 1fr); }
.src-note { font-size: 12.5px; color: var(--muted); padding: 9px 0 0; line-height: 1.5; }
.src-author { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
@media (max-width: 720px) {
  .src-tabs { grid-template-columns: 1fr 1fr; }
}
.reg-hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; min-height: 18px; }
.login-alt {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  margin-top: 2px;
}
.login-alt a { color: var(--brand); font-weight: 500; }
.login-alt a:hover { text-decoration: underline; }

/* ============ 积分排行榜 ============ */
.rank-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 16px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #5b3df5 0%, #2b6cf6 55%, #0ea5e9 100%);
  box-shadow: 0 12px 28px -14px rgba(43, 108, 246, .55);
}
.rh-label { font-size: 13px; opacity: .85; }
.rh-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.rh-sub { font-size: 12.5px; opacity: .88; }
.rh-stats { display: flex; gap: 26px; }
.rh-stat { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.rh-stat span { font-size: 12px; opacity: .85; }
.rh-stat b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}
/* 三张卡统一几何：同高、同内边距、同内容顺序，只在顶部色条和配色上区分名次（2026-11-21 对齐重做） */
.pod-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  min-height: 196px;
  overflow: hidden;
}
.pod-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: #e6ebf5;
}
.pod-1::before { background: linear-gradient(90deg, #f7cd7c, #eda427); }
.pod-2::before { background: linear-gradient(90deg, #ccd6e3, #97a6bb); }
.pod-3::before { background: linear-gradient(90deg, #e6bd9c, #c6885c); }
.pod-card.is-me { border-color: #b9ccfb; box-shadow: 0 0 0 3px rgba(43, 108, 246, .1); }
.pod-1 { border-color: #f3d9a4; }
.pod-medal { margin-top: 16px; height: 28px; display: grid; place-items: center; font-size: 22px; line-height: 1; }
.pod-1 .pod-medal { font-size: 26px; height: 28px; }
.pod-card .avatar { width: 42px; height: 42px; font-size: 17px; margin: 2px 0; }
.pod-name {
  font-weight: 650; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pod-pts { font-size: 22px; font-weight: 800; color: #b45309; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.25; }
.pod-pts small { font-size: 11.5px; font-weight: 600; }
.pod-sub { font-size: 11.5px; color: var(--muted); min-height: 16px; }
.pod-empty { background: #fafbfd; border-style: dashed; min-height: 196px; }

.me-tag {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 16px;
  display: inline-block;
  vertical-align: 1px;
}

.rank-table td { vertical-align: middle; }
.rank-row.is-me, .rank-row.rank-me { background: #f6f9ff; }
.rank-no {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rank-no.top1, .rank-no.top2, .rank-no.top3 { font-size: 18px; }
.rank-user { display: flex; align-items: center; gap: 9px; }
.ru-txt { display: flex; flex-direction: column; line-height: 1.35; }
.ru-txt b { font-size: 13.5px; display: inline-flex; align-items: center; gap: 5px; }
.rank-pts { font-size: 15px; font-weight: 700; color: #b45309; }
.rank-school, .rank-grade {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-school { max-width: 180px; }
.rank-grade { max-width: 96px; }
.rank-none { color: #b6bec9; }

/* ============ 登录后作业提醒 ============ */
.hw-tip-lead { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.hw-tip-list { display: flex; flex-direction: column; gap: 8px; }
.hw-tip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.hw-tip-item:hover { border-color: #bcd0ef; background: #f8fbff; box-shadow: var(--shadow-sm); }
.hti-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hti-main b { font-size: 13.5px; }
.hti-sub { font-size: 12px; color: var(--muted); }
.hw-tip-item .hw-badge { margin-left: auto; flex: none; }

@media (max-width: 900px) {
  .rank-hero { grid-template-columns: 1fr; }
  .rh-stats { gap: 18px; }
  .rh-stat { text-align: left; }
  .podium { grid-template-columns: 1fr; }
  .pod-1 { order: -1; } /* 窄屏竖排时第一名叫在最上面，别按 2-1-3 的顺序排 */
  .pod-card { margin-bottom: 0 !important; min-height: 0; }
}

/* ============ 考试：列表 / 答题 / 成绩 ============ */
.b-wait { background: #eef2f8; color: #5b6b82; }
.b-wait::before { background: #9aa8bd; }

.sc-ok { color: #0f9d58; }
.sc-bad { color: #d92d20; }

.ex-card .hw-foot { flex-wrap: wrap; gap: 10px; }
.ex-statusline { font-size: 12.5px; color: var(--text-2); }
.ex-statusline b { font-variant-numeric: tabular-nums; }
.ex-card.is-doing { border-color: #bcd0ef; background: linear-gradient(180deg, #f8fbff, #fff); }
.ex-card.is-done { background: #fbfcfd; }

/* ---- 答题页顶栏 ---- */
.exam-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f3a8a 0%, #2b6cf6 60%, #38bdf8 100%);
  color: #fff;
  box-shadow: 0 14px 30px -18px rgba(43, 108, 246, .6);
}
.exam-head .crumbs, .exam-head .crumbs a { color: rgba(255, 255, 255, .78); }
.exam-title { font-size: 22px; font-weight: 750; margin: 2px 0 6px; letter-spacing: -.01em; }
.exam-sub { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: rgba(255, 255, 255, .9); }
.exam-sub b { font-weight: 700; color: #fff; }
.exam-clock {
  min-width: 178px;
  text-align: right;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
}
.ec-label { font-size: 11.5px; letter-spacing: .08em; opacity: .85; }
.ec-time {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.ec-deadline { font-size: 11.5px; opacity: .82; }
.exam-clock.warn { background: rgba(220, 38, 38, .28); border-color: rgba(255, 255, 255, .4); animation: ecPulse 1.4s ease-in-out infinite; }
.exam-clock.warn .ec-time { color: #ffe1e1; }
@keyframes ecPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .0); } 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .12); } }

/* ---- 题目标签 ---- */
.exam-tabs-panel { padding: 10px 12px 0; margin-bottom: 14px; }
.exam-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.exam-tab b {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: #f2f5fa;
  border-radius: 5px;
  padding: 0 5px;
  line-height: 17px;
}
.exam-tab em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.exam-tab:hover { border-color: #bcd0ef; }
.exam-tab.on { border-color: var(--brand); background: #f2f7ff; color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 108, 246, .08); }
.exam-tab.on b { background: var(--brand); color: #fff; }
.exam-tab.is-ac { border-color: #b7e3c8; background: #f4fbf6; }
.exam-tab.is-ac b { background: #0f9d58; color: #fff; }
.exam-tab.is-try { border-color: #f0d7a8; background: #fffcf4; }
.exam-tab.is-try b { background: #d99b1d; color: #fff; }

.exam-now {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 2px;
  font-size: 13px;
  color: var(--text-2);
  border-top: 1px solid var(--line-soft);
  margin-top: 10px;
}
.exam-mine b { font-size: 17px; color: #b45309; font-variant-numeric: tabular-nums; }
.exam-savehint { font-size: 11.5px; color: var(--muted); margin-left: 10px; }

/* ---- 题面 ---- */
.exam-p-head { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; margin-bottom: 14px; }
.exam-p-head h2 { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.exam-p-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.exam-p-meta b { color: var(--text-2); font-weight: 600; }

/* ---- 成绩页 ---- */
.exam-result .er-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px 26px;
  border-radius: 16px;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 16px 34px -20px rgba(16, 24, 40, .45);
}
.exam-result.pass .er-hero { background: linear-gradient(135deg, #0f9d58 0%, #16b37a 55%, #35d0a0 100%); }
.exam-result.fail .er-hero { background: linear-gradient(135deg, #b42318 0%, #e0413a 55%, #f9796f 100%); }
.er-emoji { font-size: 44px; line-height: 1; }
.er-emoji .ico { vertical-align: 0; }
.exam-result.pass .er-emoji { color: #d97706; }
.exam-result.fail .er-emoji { color: #94a3b8; }
.er-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  margin-bottom: 4px;
}
.er-score { font-size: 44px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.er-score small { font-size: 16px; font-weight: 600; opacity: .82; }
.er-line { font-size: 13px; opacity: .92; margin-top: 2px; }
.er-side { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; text-align: right; }
.er-side div { display: flex; gap: 10px; justify-content: flex-end; }
.er-side span { opacity: .8; }
.er-side b { font-variant-numeric: tabular-nums; }

.er-msg {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  background: #f8fafd;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.er-actions { display: flex; gap: 10px; margin-top: 16px; }
.exam-result table td.td-title a { color: var(--text); }
.exam-result table td.td-title a:hover { color: var(--brand); }

/* ---- 老师成绩明细 ---- */
.ex-mini-row { display: flex; flex-wrap: wrap; gap: 4px; }
.ex-mini {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: 5px;
  background: #f2f5fa;
  color: #5b6b82;
}
.ex-mini.ok { background: #e9f8ef; color: #0f7a46; font-weight: 700; }
.ex-mini.bad { background: #fdf1f0; color: #b42318; }
.ex-mini.none { background: #f5f6f8; color: #98a2b3; }

@media (max-width: 900px) {
  .exam-head { grid-template-columns: 1fr; }
  .exam-clock { text-align: left; }
  .exam-result .er-hero { grid-template-columns: auto 1fr; }
  .er-side { grid-column: 1 / -1; text-align: left; }
  .er-side div { justify-content: flex-start; }
}

/* ============ 题库分区切换（入门 / GESP / CSP） ============ */
.track-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #f4f6fa;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 14px;
}
.track-tab {
  border: 0;
  background: transparent;
  color: var(--text-2);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s, box-shadow .15s;
}
.track-tab:hover { color: var(--text); }
.track-tab.on {
  background: #fff;
  color: var(--brand);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
@media (max-width: 900px) {
  .track-tab { padding: 6px 10px; font-size: 12.5px; }
}

/* ============ 题目讨论区 ============ */
.cm-panel { margin-top: 16px; padding: 18px 20px 20px; }
.cm-head { display: flex; align-items: center; gap: 12px; }
.cm-head h2 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.cm-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.cm-sorts { margin-left: auto; display: flex; gap: 3px; background: #f2f5f9; padding: 3px; border-radius: 9px; }
.cm-sort {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.cm-sort:hover { color: var(--text); }
.cm-sort.on { background: #fff; color: var(--brand); font-weight: 650; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

.cm-compose { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px 10px; background: #fbfcfe; }
.cm-kinds { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; flex-wrap: wrap; }
.cm-kind {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  transition: all .15s;
}
.cm-kind:hover { border-color: #cbd6e8; }
.cm-kind.on { background: var(--brand-soft); border-color: #c9d9ff; color: var(--brand-dark); font-weight: 650; }
.cm-kind-hint { font-size: 12px; color: var(--muted); }
.cm-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cm-input::placeholder { color: #a2abb8; }
.cm-input:focus { border-color: #b9cdfd; box-shadow: 0 0 0 3px var(--brand-soft); }
.cm-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.cm-hint { font-size: 12px; color: var(--muted); }
.cm-hint code { font-family: var(--mono); background: #eef1f6; padding: 1px 4px; border-radius: 4px; font-size: 11.5px; }
.cm-len { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-len.near { color: var(--re); font-weight: 600; }

.cm-list { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.cm-item { display: flex; gap: 10px; }
.cm-side { flex: 0 0 auto; padding-top: 1px; }
.cm-main { flex: 1; min-width: 0; }
.cm-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.cm-name { color: var(--text); font-size: 13px; font-weight: 600; }
.cm-time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cm-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tle-soft);
  color: #6d28d9;
}
.cm-tag.mine { background: var(--brand-soft); color: var(--brand-dark); }
.cm-solution { border-left: 2px solid #e4dcfb; padding-left: 10px; margin-left: -12px; }

.cm-body { margin-top: 5px; font-size: 13.5px; color: var(--text-2); line-height: 1.78; overflow-wrap: anywhere; }
.cm-body p { margin: 0 0 7px; }
.cm-body p:last-child { margin-bottom: 0; }
.cm-body ul, .cm-body ol { margin: 4px 0 8px; padding-left: 22px; }
.cm-body code { font-family: var(--mono); font-size: 12.5px; background: #f2f5f9; border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 5px; }
.cm-body pre {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  overflow: auto;
  margin: 8px 0;
}
.cm-body pre code { background: none; border: 0; padding: 0; font-size: 12.5px; line-height: 20px; }
.cm-body blockquote {
  margin: 6px 0;
  padding: 2px 10px;
  border-left: 3px solid #dfe5ef;
  color: var(--muted);
}
.cm-body a { color: var(--brand); }
.cm-body a:hover { text-decoration: underline; }
.cm-body .md-table { font-size: 12.5px; }

.cm-acts { display: flex; align-items: center; gap: 4px; margin-top: 7px; }
.cm-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.cm-act:hover { background: #f2f5f9; color: var(--text-2); }
.cm-act.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.cm-act b { font-weight: 700; font-variant-numeric: tabular-nums; }
.cm-act:disabled { opacity: .6; cursor: default; }
.cm-danger:hover { background: var(--wa-soft); color: var(--wa); }

.cm-thread {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cm-thread:empty { display: none; }
/* 楼中楼不限层数：超过 3 层就不再往里缩（改由「回复 @某人」交代上下文），窄屏也读得下 */
.cm-thread-flat { padding-left: 0; border-left: 0; }
.cm-deep > .cm-side { display: none; }
.cm-reply-slot:empty { display: none; }
.cm-replyto { font-size: 12px; color: var(--muted); }
.cm-replyto b { color: var(--brand-dark); font-weight: 600; }
.cm-reply .avatar { width: 22px; height: 22px; font-size: 11px; }
.cm-reply .cm-body { font-size: 13px; }

.cm-spoiler { margin-top: 6px; border: 1px dashed #d9dcE6; border-radius: 9px; padding: 8px 11px; background: #fcfcfd; }
.cm-spoiler > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--brand); list-style: none; }
.cm-spoiler > summary::-webkit-details-marker { display: none; }
.cm-spoiler > summary::before { content: '▸ '; }
.cm-spoiler[open] > summary::before { content: '▾ '; }
.cm-spoiler[open] > summary { margin-bottom: 4px; }

.cm-deleted .cm-gone { font-size: 12.5px; color: #a2abb8; font-style: italic; padding-top: 3px; }
.cm-avatar-ghost { background: #eef1f6; color: #b3bcc9; }
.cm-empty, .cm-loading { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.cm-empty b { display: block; color: var(--text-2); font-size: 13.5px; margin-bottom: 3px; }
.cm-empty span { font-size: 12.5px; }
.cm-more-wrap { margin-top: 14px; text-align: center; }
.cm-reply-box { margin-top: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.cm-reply-box .cm-bar { margin-top: 7px; }

@media (max-width: 720px) {
  .cm-kind-hint { display: none; }
  .cm-time { margin-left: 0; }
  .cm-panel { padding: 16px 14px 18px; }
  .cm-thread { padding-left: 8px; }
}

/* ---------- 本题：我的提交记录 ---------- */

.mysub-panel { margin-top: 16px; overflow: hidden; }

.mysub-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.mysub-head h2 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.mysub-count {
  font-size: 11.5px;
  color: var(--brand);
  background: #eef4ff;
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mysub-tip { font-size: 11.5px; color: var(--muted); }

.mysub-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; }

.mysub-note { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }

.mysub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.mysub-row:hover { background: #f5f8fd; }
.mysub-row.on { background: #eef4ff; box-shadow: inset 0 0 0 1px #cfe0ff; }
.mysub-row .verdict { font-size: 12.5px; gap: 5px; flex: none; width: 84px; }
.mysub-row .verdict .vg { width: 16px; height: 16px; font-size: 10px; }
.mysub-score {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  width: 44px;
  flex: none;
}
.mysub-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}
.mysub-when { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.mysub-code { flex: none; opacity: 0; transition: opacity 0.12s ease; }
.mysub-row:hover .mysub-code,
.mysub-row.on .mysub-code,
.mysub-row.open .mysub-code,
.mysub-row:focus-within .mysub-code { opacity: 1; }

.mysub-codewrap {
  margin: 2px 4px 8px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f7f9fc;
}
.mysub-codewrap .code-expand-pre { max-height: 340px; font-size: 12px; }

.mysub-foot { padding: 2px 16px 12px; }

@media (max-width: 720px) {
  .mysub-tip { display: none; }
  .mysub-meta { display: none; }
  .mysub-row .verdict { width: 76px; }
  .mysub-code { opacity: 1; }
}

/* ---------- 讨论区表情面板 ---------- */

/* 内联 SVG 图标（app.js 的 ico()）：功能图标不用 emoji，避开缺字形的系统。
   vertical-align 只对行内文本生效，flex 容器里会被忽略，不用另写。 */
.ico { display: inline-block; vertical-align: -0.145em; flex: none; pointer-events: none; }

.cm-emoji-btn {
  flex: none;
  width: 28px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  line-height: 1;
  color: #5b6478;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Noto Emoji", sans-serif;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.cm-emoji-btn:hover { background: #f2f6fd; border-color: #c9dbff; }
.cm-emoji-btn:active { transform: scale(0.94); }
.cm-emoji-btn.on { background: #eef4ff; border-color: #a9c6ff; box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.12); }

/* 回复框里没有长度计数，靠 auto 把按钮组推到右侧 */
.cm-reply-box .cm-bar .cm-emoji-btn { margin-left: auto; }

.emoji-pop {
  position: fixed;
  z-index: 80;
  width: 300px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 36px -10px rgba(15, 32, 62, 0.28), 0 2px 8px -4px rgba(15, 32, 62, 0.16);
  animation: emoji-in 0.12s ease;
}
@keyframes emoji-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.emoji-tabs { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
.emoji-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 4px 0;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.emoji-tab:hover { background: #f2f6fd; color: var(--text-2); }
.emoji-tab.on { background: #eef4ff; color: var(--brand); font-weight: 650; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 1px;
  max-height: 178px;
  overflow-y: auto;
  padding: 6px 2px 2px;
  overscroll-behavior: contain;
}

.emoji-cell {
  border: 0;
  background: transparent;
  padding: 4px 0;
  border-radius: 7px;
  font-size: 18px;
  line-height: 1.1;
  cursor: pointer;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Noto Emoji", sans-serif;
  transition: background 0.1s ease, transform 0.1s ease;
}
.emoji-cell:hover { background: #eef4ff; transform: scale(1.14); }
.emoji-cell:active { transform: scale(0.96); }

.emoji-empty { grid-column: 1 / -1; padding: 26px 8px; text-align: center; color: var(--muted); font-size: 12px; }

.emoji-foot { padding: 5px 4px 1px; font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 720px) {
  .emoji-pop { width: min(300px, calc(100vw - 16px)); }
  .emoji-grid { grid-template-columns: repeat(8, 1fr); max-height: 160px; }
  .emoji-cell { font-size: 17px; }
}

/* ---------- 账号资料 ---------- */

.user-menu .um-head b {
  display: block;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.user-menu .um-head span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

.panel-head .panel-sub {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
}

/* 资料表单下面的只读信息，用一条线隔开 */
.account-facts {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 0 0 var(--radius) var(--radius);
}
.account-facts .kv { font-size: 12.5px; padding: 7px 0; }

/* 注册页的「选填资料」折叠块 */
.reg-extra {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fbfcfe;
}
.reg-extra > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 0;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.reg-extra > summary::-webkit-details-marker { display: none; }
.reg-extra > summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
  flex: none;
}
.reg-extra[open] > summary::before { transform: rotate(90deg); }
.reg-extra > summary em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 600;
}
.reg-extra-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 3px 0 13px;
}

/* 注册页（2026-11-16 起只收「用户名 + 密码 + 确认密码」）*/
.reg-lead {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: -6px 0 6px;
}
.reg-role {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 2px 0 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  cursor: pointer;
}
.reg-role input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* 「完善资料」弹窗（登录后补姓名 / 学校 / 联系方式）*/
.pf-lead {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
}
.pf-lead b { color: var(--text); }
.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.pf-grid .field { margin-bottom: 10px; }
@media (max-width: 640px) {
  .pf-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .panel-head .panel-sub { display: none; }
}

/* 学员列表里的学校 · 年级小字 */
.u-cell em.u-sub {
  font-family: var(--font-sans, inherit);
  font-size: 11px;
  color: #8b95a3;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 账号资料面板 / 弹窗 ---------- */

.acct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
}

.acct-grid .kv {
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 0;
}
.acct-grid .kv > span { flex: none; width: 68px; }
.acct-grid .kv > b {
  font-weight: 600;
  min-width: 0;
  word-break: break-all;
}

.acct-none {
  font-style: normal;
  color: #a8b1bd;
  font-weight: 400;
}

.acct-panel-body { padding: 4px 16px 10px; }

.acct-note {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .acct-grid { grid-template-columns: minmax(0, 1fr); }
  .acct-grid .kv:nth-last-child(2) { border-bottom: 1px dashed var(--line-soft); }
}

/* ---------- 导航待办角标 ---------- */

.nav-badge {
  margin-left: 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: #e5484d;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.nav-badge[hidden] { display: none; }
.nav a.active .nav-badge { color: #d92d20; }

/* ============ 参考答案弹窗（老师 / 管理员） ============ */
.sol-modal { max-width: 880px; }
.sol-loading { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.sol-block + .sol-block { margin-top: 18px; }
.sol-h {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.02em;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 10px;
}
.sol-ideas { font-size: 13.5px; line-height: 1.8; color: var(--text); }
.sol-ideas p { margin: 0 0 8px; }
.sol-ideas ul, .sol-ideas ol { margin: 0 0 8px; padding-left: 22px; }
.sol-ideas li { margin: 3px 0; }
.sol-ideas h2, .sol-ideas h3 { font-size: 14px; margin: 12px 0 6px; }
.sol-ideas code {
  font: 12.5px var(--mono);
  background: #eef2f7;
  border-radius: 4px;
  padding: 1px 5px;
  color: #1e40af;
}
.sol-code {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  margin-top: 10px;
  background: #fff;
}
.sol-code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.sol-code-head b { color: var(--brand-dark); font-size: 12px; }
.sol-title { color: var(--text-2); }
.sol-lines { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sol-pre {
  margin: 0;
  background: #fbfcfe;
  color: #24303f;
  font: 12.5px/20px var(--mono);
  font-variant-ligatures: none;
  padding: 13px 15px;
  overflow: auto;
  max-height: 420px;
  white-space: pre;
  tab-size: 4;
}

/* ============ 聊天室 ============ */
.chat-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 16px;
  align-items: start;
}
/* 带班级列表时左边多一列 */
.chat-wrap.has-rooms { grid-template-columns: 192px minmax(0, 1fr) 232px; }

/* 左侧班级栏：一行一个班，未读用括号红字挂在班名后面 */
.chat-rooms {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(min(58vh, 520px) + 120px);
}
.chat-room-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; overflow-y: auto; min-height: 0; }
.chat-room-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.chat-room-item:hover { background: #f4f7fd; }
.chat-room-item.is-on { background: var(--brand-soft); border-color: #cadcf7; }
.chat-room-item.is-off { opacity: 0.45; cursor: not-allowed; }
.cr-line { display: flex; align-items: baseline; gap: 2px; min-width: 0; }
.cr-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 未读数：中文括号 + 红色，数量变化只改这里的数字 */
.cr-badge { flex: none; color: #e5484d; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chat-room-item.is-on .cr-badge { color: #d92d20; }
.cr-badge.is-mention { text-decoration: underline; text-underline-offset: 2px; }
.cr-sub {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel { display: flex; flex-direction: column; overflow: hidden; padding: 0; }

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.chat-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-title b { font-size: 14.5px; color: var(--text); }
.chat-sub { font-size: 12px; color: var(--muted); }
.chat-list {
  height: min(58vh, 520px);
  overflow-y: auto;
  padding: 14px 16px 6px;
  background:
    radial-gradient(circle at 12% 0%, #f7faff 0%, transparent 42%),
    #fff;
}
.chat-loading,
.chat-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.chat-empty .big { font-size: 30px; margin-bottom: 8px; }
.chat-empty .big .ico { vertical-align: 0; color: #c3ccda; }

.chat-msg {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.chat-msg .avatar { flex: none; margin-top: 2px; }
.chat-av-ph { width: 26px; flex: none; }
.chat-body { min-width: 0; max-width: min(78%, 620px); }
.chat-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.chat-line b { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
/* 群聊里点消息里的人名 = @ 他：做成无框小按钮，看着还是普通名字，鼠标移上去才有下划线 */
.chat-name {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: inherit;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}
.chat-name-at:hover,
.chat-name-at:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-role {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text-2);
}
.chat-role.r-admin { background: #fdeceb; color: #b42318; }
.chat-role.r-teacher { background: var(--brand-soft); color: var(--brand-dark); }
.chat-time { font-size: 11px; color: #9aa3af; font-variant-numeric: tabular-nums; }
.chat-del {
  border: 0;
  background: none;
  color: #b0b7c2;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.chat-msg:hover .chat-del { opacity: 1; }
.chat-del:hover { color: var(--wa); }

/* 「撤回」：和删除一样悬停才出现，2 分钟内的自己消息才有 */
.chat-recall {
  border: 0;
  background: none;
  color: #b0b7c2;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.chat-msg:hover .chat-recall { opacity: 1; }
.chat-recall:hover { color: var(--brand); }
.chat-recall:disabled { color: #cfd5de; cursor: default; }

/* 撤回后的占位：灰字斜体，气泡也淡下去，别当成真消息 */
.chat-msg.is-recalled .chat-bubble {
  background: #f4f6f9;
  border-color: var(--line);
}
.chat-bubble.chat-recalled {
  padding: 5px 12px;
  background: #f4f6f9;
  border-style: dashed;
}
.chat-bubble.chat-recalled i {
  font-style: normal;
  font-size: 12px;
  color: #98a1ae;
}
.chat-msg.mine .chat-bubble.chat-recalled { background: #f4f6f9; border-color: var(--line); }
.chat-msg.is-recalled .chat-time { opacity: 0.7; }

/* 「引用」按钮：和删除一样，鼠标移到消息上才露出来 */
.chat-quote-btn {
  border: 0;
  background: none;
  color: #b0b7c2;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.chat-msg:hover .chat-quote-btn { opacity: 1; }
.chat-quote-btn:hover { color: var(--brand); }

/* 气泡里的引用块：左边一道竖线 + 原话摘要，点一下跳回原消息 */
.chat-quote {
  display: block;
  margin: 0 0 6px;
  padding: 4px 8px;
  border-left: 3px solid #bfd2ee;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7686;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chat-quote:hover { background: #fff; border-left-color: var(--brand); }
.chat-quote b { color: var(--brand-dark); font-weight: 600; margin-right: 5px; }
.chat-quote .cq-text { color: #6b7686; }
.chat-quote .cq-code {
  font: 650 10px/1 var(--mono);
  color: #1d4ed8;
  background: #e4eeff;
  border-radius: 4px;
  padding: 2px 4px;
  margin-right: 4px;
  vertical-align: 1px;
}
.chat-msg.mine .chat-quote { border-left-color: #a6c1ec; background: rgba(255, 255, 255, 0.6); }
.chat-msg.flash .chat-bubble {
  animation: chatFlash 1.25s ease;
}
@keyframes chatFlash {
  0% { box-shadow: 0 0 0 0 rgba(245, 176, 65, 0.85); }
  35% { box-shadow: 0 0 0 4px rgba(245, 176, 65, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(245, 176, 65, 0); }
}

.chat-bubble {
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text);
  background: #f4f6fa;
  border: 1px solid var(--line-soft);
  border-radius: 4px 12px 12px 12px;
  padding: 8px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .chat-body { text-align: right; }
.chat-msg.mine .chat-line { flex-direction: row-reverse; }
.chat-msg.mine .chat-bubble {
  background: var(--brand-soft);
  border-color: #d6e2ff;
  border-radius: 12px 4px 12px 12px;
  text-align: left;
}

.chat-compose {
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
  background: #fbfcfe;
}
.chat-textarea {
  width: 100%;
  height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  font: 13.5px/1.6 var(--sans);
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.12); }
.chat-compose-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.chat-count { font-variant-numeric: tabular-nums; }
.chat-count.warn { color: var(--mle); }
.chat-tip { color: var(--wa); font-size: 12px; }
.chat-tip.err { font-weight: 600; }

.chat-side { padding: 0; overflow: hidden; }
.chat-side-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
  background: #fbfcfe;
}
.chat-side-head b { color: var(--brand-dark); margin-left: 4px; }
.chat-members { max-height: min(58vh, 520px); overflow-y: auto; padding: 8px 10px; }
.chat-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border-radius: 8px;
  font-size: 13px;
}
.chat-member.me { background: var(--brand-soft); }
.chat-member .cm-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.chat-member .cm-role {
  font-size: 10.5px;
  color: var(--muted);
  background: #f1f4f9;
  border-radius: 999px;
  padding: 1px 6px;
}
.chat-member .cm-role.r-teacher { background: var(--brand-soft); color: var(--brand-dark); }
.chat-member .cm-role.r-admin { background: #fdeceb; color: #b42318; }

/* 成员名字可点：进他的博客主页；右边的「⋯」才是发私信 / @ 他 */
.chat-member a.cm-name { text-decoration: none; border-radius: 4px; }
.chat-member a.cm-name:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.chat-member a.cm-name:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chat-member .cm-more {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #9aa4b2;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: .5;
  transition: opacity .12s, background .12s, color .12s;
}
.chat-member:hover .cm-more { opacity: 1; }
.chat-member .cm-more:hover,
.chat-member .cm-more:focus-visible { background: #eef2f8; color: var(--brand-dark); opacity: 1; }

/* 大班成员列表只渲染前 60 个，这行按钮把剩下的补进来 */
.chat-member-more {
  display: block;
  width: 100%;
  margin: 8px 0 2px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: 8px;
  cursor: pointer;
}
.chat-member-more:hover { background: #e6efff; }

.cm-menu {
  position: fixed;
  z-index: 120;
  width: 234px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(23, 35, 58, 0.16);
}
.cm-menu[hidden] { display: none; }
.cm-menu-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cm-menu-head em {
  flex: none;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
  background: #f1f4f9;
  border-radius: 999px;
  padding: 1px 6px;
}
.cm-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: none;
  cursor: pointer;
  font: inherit;
}
.cm-menu-item b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.cm-menu-item span { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.cm-menu-item:hover { background: var(--brand-soft); }
.cm-menu-item.is-off { cursor: default; opacity: 0.65; }
.cm-menu-item.is-off:hover { background: none; }

@media (max-width: 1180px) {
  .chat-wrap.has-rooms { grid-template-columns: 168px minmax(0, 1fr) 200px; gap: 12px; }
}

@media (max-width: 880px) {
  .chat-wrap,
  .chat-wrap.has-rooms { grid-template-columns: 1fr; }
  .chat-side { order: 2; }
  .chat-list { height: 56vh; }
  /* 窄屏把班级栏横过来，省一行高度 */
  .chat-rooms { max-height: none; order: 0; }
  .chat-room-list { flex-direction: row; overflow-x: auto; padding: 8px; }
  .chat-room-item { flex: 0 0 auto; width: auto; max-width: 62vw; }
  /* 触屏没有 hover，引用 / 删除按钮得一直露出来，不然点不到 */
  .chat-quote-btn,
  .chat-recall,
  .chat-del { opacity: 1; }
}

/* ============ 好友 & 私信 ============ */
/* ---------- 消息：班级群 / 好友 两个标签（原导航两项合并） ---------- */
.msg-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  background: #eef2f8;
  border-radius: 11px;
}
.msg-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background .12s, color .12s, box-shadow .12s;
}
.msg-tab:hover { color: var(--text); }
.msg-tab.on {
  background: var(--panel);
  color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
.msg-tab-n {
  min-width: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
/* 左栏标题下的小字说明（原来是消息页顶部那条，挪进来了） */
.side-note {
  padding: 9px 12px 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  background: #fbfcfe;
  border-bottom: 1px solid var(--line-soft);
}

.fr-wrap {
  display: grid;
  grid-template-columns: 322px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.fr-side {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 168px);
}
.fr-search {
  display: flex;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.fr-search .input { min-width: 0; }
.fr-search .btn { flex: none; }

.fr-find-box { border-bottom: 1px solid var(--line-soft); background: #fbfcff; }
.fr-find {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
}
.fr-find + .fr-find { border-top: 1px dashed var(--line-soft); }
.fr-find-main { min-width: 0; flex: 1; }
.fr-find-main b { display: block; font-size: 13px; color: var(--text-2); }
.fr-find-main span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fr-rel { flex: none; font-size: 11.5px; color: var(--muted); max-width: 96px; text-align: right; }
.fr-hint { padding: 9px 12px; font-size: 12px; color: var(--muted); }

.fr-sec { border-bottom: 1px solid var(--line-soft); }
.fr-sec-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.fr-sec-head b {
  color: var(--brand);
  font-weight: 700;
}
.fr-list-head { background: #fafbfe; border-bottom: 1px solid var(--line-soft); }
.fr-cap { margin-left: auto; font-weight: 400; color: #a8b1bd; }

.fr-reqs, .fr-outs { padding: 0 0 6px; }
.fr-req {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
}
.fr-req-main { min-width: 0; flex: 1; }
.fr-req-main b { display: block; font-size: 13px; }
.fr-req-main span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fr-req-main i {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-style: normal;
  color: #6b7686;
  background: #f3f6fb;
  border-radius: 4px;
  padding: 2px 6px;
}
.fr-req-btns { display: flex; flex-direction: column; gap: 4px; }
.fr-req-btns .btn { padding: 3px 9px; font-size: 11.5px; }

.fr-out {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
}
.fr-out span { color: var(--text-2); font-weight: 500; }
.fr-out em {
  flex: 1;
  min-width: 0;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fr-mini {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11.5px;
  cursor: pointer;
  padding: 0 2px;
}
.fr-mini:hover { text-decoration: underline; }

/* 好友列表要自己吃满左栏剩余高度再滚：.fr-side 是 overflow:hidden 的 flex 列，
   列表不设 flex 的话好友一多就被裁掉、滚不动（宽窄屏都有这个问题） */
.fr-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 6px; }
.fr-list-empty { padding: 26px 14px; text-align: center; font-size: 12.5px; color: var(--muted); }
.fr-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 12px;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.fr-item:hover { background: #f7f9fd; }
.fr-item.active { background: var(--brand-soft); border-left-color: var(--brand); }
.fr-item-main { min-width: 0; flex: 1; }
.fr-item-top { display: flex; align-items: baseline; gap: 6px; }
.fr-item-top b,
.fr-item-top .fr-name {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 好友名字可点：进他的博客主页（行的其它地方点了才是切私信） */
.fr-item-top .fr-name { text-decoration: none; }
.fr-item-top .fr-name:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.fr-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fr-item-top em {
  margin-left: auto;
  font-style: normal;
  font-size: 10.5px;
  color: #a8b1bd;
  flex: none;
}
.fr-item-last {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fr-quiet { color: #a8b1bd; }
.fr-dot {
  flex: none;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
  font-weight: 700;
}

.fr-main {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 168px);
  min-height: 420px;
  overflow: hidden;
}
.fr-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.fr-empty .big { font-size: 34px; }
.fr-empty b { font-size: 14px; color: var(--text-2); }
.fr-empty span { font-size: 12.5px; max-width: 340px; line-height: 1.7; }

.dm-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.dm-who { min-width: 0; }
.dm-who b { display: block; font-size: 13.5px; color: var(--text-2); }
.dm-who .dm-name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  text-decoration: none;
}
.dm-who .dm-name:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.dm-who span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  background:
    radial-gradient(circle at 12% 0%, #f7faff 0%, transparent 42%),
    #fff;
}
/* 私信的消息走和班级群一模一样的 .chat-msg 结构（同一份渲染代码），
   这里只调私信这一栏的宽度，外加把「引用」做成常显的小按钮：
   消息不多，藏到 hover 里在触屏/没对准的时候就跟没有这个功能一样 */
.dm-list .chat-body { max-width: min(84%, 620px); }
.dm-list .chat-msg { margin-bottom: 13px; }
.dm-list .chat-quote-btn {
  opacity: 0.75;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: #fff;
  font-size: 11px;
  line-height: 16px;
}
.dm-list .chat-msg:hover .chat-quote-btn,
.dm-list .chat-msg:focus-within .chat-quote-btn { opacity: 1; border-color: #c9d8ee; }
.dm-list .chat-msg.mine .chat-quote-btn { background: rgba(255, 255, 255, 0.8); }
.dm-list .chat-recall,
.dm-list .chat-del {
  opacity: 0.65;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: #fff;
  font-size: 11px;
  line-height: 16px;
}
.dm-list .chat-msg:hover .chat-recall,
.dm-list .chat-msg:focus-within .chat-recall,
.dm-list .chat-msg:hover .chat-del,
.dm-list .chat-msg:focus-within .chat-del { opacity: 1; border-color: #c9d8ee; }
.dm-compose {
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
  background: #fbfcfe;
}
.dm-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

/* 班级群成员 / 讨论区里的「加好友」 */
.cm-add {
  flex: none;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 1px solid #cfd9e8;
  background: #fff;
  color: var(--brand);
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, border-color 0.12s;
}
.chat-member:hover .cm-add { opacity: 1; }
.cm-add:hover { background: var(--brand-soft); border-color: #b9cdf3; }
.cm-add.is-done {
  opacity: 0.7;
  border-style: dashed;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.cm-act.is-done { opacity: 0.6; cursor: default; }
.cm-act.is-done:hover { color: inherit; background: none; }

@media (max-width: 880px) {
  .fr-wrap { grid-template-columns: 1fr; }
  .fr-side { max-height: 44vh; }
  .fr-main { height: 62vh; }
  /* 触屏没有 hover，加好友的「+」要一直露出来 */
  .cm-add { opacity: 1; }
}

/* ============ 每日登录奖励弹窗 ============ */
.modal-bonus { max-width: 420px; }
.modal-bonus .modal-head { border-bottom: 0; padding-bottom: 4px; }
.modal-bonus .modal-body { padding: 0; }
.bonus-card {
  padding: 6px 22px 22px;
  text-align: center;
  background: radial-gradient(120% 92% at 50% 0%, #fff8e8 0%, #ffffff 62%);
}
/* 顶部：礼物印章 + 标题 + 「已领取」小标 */
.bonus-hero {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 0 16px;
  text-align: left;
}
.bonus-seal {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(150deg, #fbbf24, #f97316);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.3);
  animation: bonusPop 0.42s cubic-bezier(0.22, 1.4, 0.4, 1) both;
}
.bonus-hero-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bonus-hero-txt b { font-size: 15px; color: var(--text); }
.bonus-hero-txt em { font-style: normal; font-size: 12px; color: var(--muted); }
.bonus-streak {
  margin-left: auto;
  flex: none;
  padding: 2px 9px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 11.5px;
}
/* 大数字：金 → 红渐变，字距收紧，和红包弹窗一个观感 */
.bonus-amount { display: flex; align-items: baseline; justify-content: center; gap: 3px; padding: 2px 0 2px; }
.bonus-amount .n {
  font-size: 60px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #f59e0b, #dc2626);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: bonusPop 0.5s cubic-bezier(0.22, 1.4, 0.4, 1) both;
}
.bonus-amount .u { font-size: 13px; font-weight: 600; color: #b45309; letter-spacing: 3px; }
@keyframes bonusPop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bonus-seal, .bonus-amount .n { animation: none; }
}
.bonus-text { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.bonus-text b { color: #b45309; }
.bonus-balance { margin-top: 8px; font-size: 13px; color: var(--muted); }
.bonus-balance b { color: #b45309; font-size: 16px; }
.bonus-tip {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  text-align: left;
}

/* ============ 聊天室：题号链接 / 表情按钮 ============ */
/* 转发卡片（题 / 学习笔记 / 课程视频）：气泡里的一张可点小卡 */
.chat-share {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid #dbe6f6;
  border-radius: 10px;
  background: #f7faff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background .15s, border-color .15s;
}
.chat-share:hover { background: #eef4ff; border-color: #bcd2f5; }
.chat-share:active { background: #e3edff; }
.chat-share.is-blocked { cursor: default; opacity: .72; background: #f6f7f9; border-color: #e6e8ec; }
.chat-share .cs-ic { flex: 0 0 auto; font-size: 19px; line-height: 1; }
.chat-share .cs-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-share .cs-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-share .cs-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-share .cs-go {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--brand);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(43, 108, 246, .1);
}
.chat-share.is-blocked .cs-go { color: var(--muted); background: #e9ebef; }
/* 自己的气泡是蓝底，卡片得换一套浅色才看得清 */
.chat-msg.mine .chat-share { background: rgba(255, 255, 255, .92); border-color: rgba(255, 255, 255, .6); }
.chat-msg.mine .chat-share .cs-title { color: var(--text); }
/* 转发弹窗里的大卡片预览 */
.hs-share-preview { margin: 2px 0 12px; }
.hs-share-preview .chat-share { max-width: none; cursor: default; }

.chat-bubble .chat-prob {
  color: var(--brand);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px dashed rgba(43, 108, 246, 0.55);
  padding: 0 1px;
  border-radius: 2px;
}
.chat-bubble .chat-prob:hover { background: #e2ecff; border-bottom-color: var(--brand); }
.chat-bubble .chat-prob:active { background: #d3e2ff; }
.chat-msg.mine .chat-bubble .chat-prob { color: var(--brand-dark); }

/* 输入栏里的表情按钮：比讨论区的小一号，紧挨着「发送」 */
.chat-compose-foot .cm-emoji-btn {
  width: 30px;
  height: 30px;
  font-size: 15px;
  line-height: 1;
  flex: none;
}

/* ============ 聊天室：@ 点名 ============ */
/* .chat-compose 做浮层定位的锚点 */
.chat-compose { position: relative; }

.cm-at-btn {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font: 700 15px/1 var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cm-at-btn:hover { background: #f2f6fd; border-color: #c9dbff; }
.cm-at-btn:active { transform: scale(0.94); }
.cm-at-btn.on { background: #eef4ff; border-color: #a9c6ff; box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.12); }

.chat-at-pop {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% - 6px);
  z-index: 60;
  max-height: 232px;
  overflow-y: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(23, 33, 51, 0.14);
}
.chat-at-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
}
.chat-at-head span { font-weight: 400; color: var(--muted); font-size: 11.5px; }
/* @ 候选一次只画前 50 个，这行提示继续打字收窄 */
.chat-at-more {
  padding: 7px 9px 3px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.chat-at-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: 13px/1.3 var(--sans);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.chat-at-item:hover,
.chat-at-item.on { background: #eef4ff; }
.chat-at-name { font-weight: 600; }
.chat-at-item .cm-role { margin-left: auto; }

/* 气泡里的 @ */
.chat-bubble .chat-at {
  color: var(--brand);
  font-weight: 650;
  background: rgba(43, 108, 246, 0.08);
  border-radius: 4px;
  padding: 0 2px;
}
.chat-bubble .chat-at-me {
  color: #b45309;
  background: #fff2d8;
  box-shadow: inset 0 0 0 1px #f8d79a;
}
.chat-msg.mine .chat-bubble .chat-at { color: var(--brand-dark); }
.chat-msg.mention-me .chat-bubble { border-color: #f3cf8f; background: #fffaf0; }

/* ============ 班级群：代码消息 ============ */
.cm-code-btn {
  flex: none;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cm-code-btn:hover { background: #f2f6fd; border-color: #c9dbff; }
.cm-code-btn:active { transform: scale(0.96); }

/* 积分红包按钮：带文字标签，不靠单个 emoji —— 有些系统缺 🧧 字形，纯图标会看成空白 */
.cm-rp-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #f0c3bd;
  border-radius: 8px;
  background: #fff7f5;
  color: #bf3b31;
  font: 700 12px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.cm-rp-btn:hover { background: #ffece8; border-color: #e6a49b; }
.cm-rp-btn:active { transform: scale(0.96); }
.cm-rp-ico { display: inline-flex; align-items: center; color: #d9534f; }
.cm-rp-btn:hover .cm-rp-ico { color: #c9302c; }
.cm-rp-txt { letter-spacing: 0.3px; }

/* 待发代码条（输入框上方，发送前随时可以改 / 删） */
.chat-code-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px 6px 9px;
  border: 1px solid #cdddfd;
  background: #f2f7ff;
  border-radius: 9px;
}
.chat-code-chip[hidden] { display: none; }
.ccc-tag {
  flex: none;
  font: 650 11px/1 var(--mono);
  color: #1d4ed8;
  background: #e0ecff;
  border-radius: 5px;
  padding: 3px 6px;
}
.ccc-meta { flex: none; font-size: 11.5px; color: #5b6b82; font-variant-numeric: tabular-nums; }
.ccc-preview {
  min-width: 0;
  font: 11.5px/1.4 var(--mono);
  color: #7c8798;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ccc-btn {
  flex: none;
  border: 1px solid #c9dbfb;
  background: #fff;
  color: var(--brand);
  border-radius: 6px;
  font-size: 11.5px;
  padding: 3px 8px;
  cursor: pointer;
}
.ccc-btn:hover { background: #e9f1ff; }
.ccc-del {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #93a0b4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.ccc-del:hover { background: #fee2e2; color: #dc2626; }

/* 待发引用条（在代码条上面，同样可以一键取消） */
.chat-quote-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px 6px 9px;
  border: 1px solid #d8e2f2;
  background: #f6f9ff;
  border-radius: 9px;
}
.chat-quote-chip[hidden] { display: none; }
.cqc-tag {
  flex: none;
  font-size: 10.5px;
  font-weight: 650;
  color: #1d4ed8;
  background: #e0ecff;
  border-radius: 5px;
  padding: 3px 6px;
}
.cqc-name { flex: none; font-size: 12px; color: var(--brand-dark); }
.cqc-preview {
  min-width: 0;
  font-size: 12px;
  color: #7c8798;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 聊天气泡里的代码块 */
.chat-bubble .chat-code { margin-top: 7px; }
.chat-bubble.code-only { padding: 6px; }
.chat-bubble.code-only .chat-code { margin-top: 0; }

.chat-code {
  position: relative;
  max-width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  text-align: left;
}
.chat-code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  background: #f4f7fb;
  border-bottom: 1px solid #e2e8f2;
}
.cc-lang {
  font: 650 10.5px/1 var(--mono);
  color: #0f7b3f;
  background: #e7f6ec;
  border: 1px solid #c6e6d3;
  border-radius: 5px;
  padding: 3px 6px;
  letter-spacing: 0.5px;
}
.cc-lines { font-size: 11px; color: #7a8595; font-variant-numeric: tabular-nums; }
.cc-btn {
  border: 1px solid #dbe2ec;
  background: #ffffff;
  color: #475569;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 7px;
  cursor: pointer;
}
.cc-btn:hover { background: #f1f5fb; color: #1f2937; }
.cc-btn:active { transform: scale(0.96); }
.chat-code-pre {
  margin: 0;
  padding: 8px 12px 10px;
  font: 12.5px/20px var(--mono);
  font-variant-ligatures: none;
  color: #24303f;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 4;
  overflow: auto;
}
.chat-code.is-folded .chat-code-pre { max-height: 252px; overflow: hidden; }
.chat-code.is-folded::after {
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 34px;
  background: linear-gradient(rgba(255, 255, 255, 0), #ffffff);
  pointer-events: none;
}

/* 插入代码的编辑器弹窗（复用题目编辑器的行号 / 高亮 / 配色） */
.modal-chat-code { max-width: 700px; width: calc(100vw - 40px); }
.chat-code-tip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.ccc-count { flex: none; font-variant-numeric: tabular-nums; color: #8b95a3; }
.ccc-count.warn { color: #c2740a; font-weight: 600; }
.code-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.code-tools .ct-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 3px;
}
.code-tools .ct-hint {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.chat-code-editor {
  height: 300px;
  border: 1px solid #e2e8f2;
  border-radius: 9px;
}

/* ============ 班级（一个老师多个班） ============ */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.class-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.class-card-head { display: flex; flex-direction: column; gap: 3px; }
.class-name { font-size: 15px; font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 7px; }
.class-sub { font-size: 12px; color: var(--muted); }
.class-note { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.cls-tag { font-size: 11px; font-weight: 600; color: #8a6d3b; background: #fdf3e2; border-radius: 999px; padding: 1px 8px; }
.class-code {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  background: #f7f9fc;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 6px 9px;
}
.class-code code { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; color: var(--text); }
.class-join { display: flex; align-items: center; gap: 12px; padding: 12px 15px; margin-top: 12px; flex-wrap: wrap; }
.class-join .cj-text { display: flex; flex-direction: column; gap: 2px; }
.class-join .cj-text b { font-size: 13.5px; }
.class-join .cj-text span { font-size: 12px; color: var(--muted); }
.class-join .input { width: 230px; }

.cls-code-row { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cls-code-row code {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text);
  background: #f2f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}
.cls-mem-head { margin: 12px 0 6px; font-size: 12.5px; color: var(--text-2); }
.cls-mem-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.cls-mem { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.cls-mem:last-child { border-bottom: 0; }
.cls-mem .cm-name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cls-mem .cm-name em { font-style: normal; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.cls-mem .btn { margin-left: auto; }
.cls-add { margin-top: 12px; }
.cls-add summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.cls-cand {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #fbfcfe;
}
.cls-add-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* ============ 博客 ============ */
.blog-page-head { display: flex; align-items: flex-start; gap: 16px; }
.blog-page-head > div { flex: 1; min-width: 0; }

.blog-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.blog-search { display: flex; gap: 8px; }
.blog-search .input { width: 250px; }

.blog-list { display: flex; flex-direction: column; gap: 10px; }
.blog-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.blog-card:hover { border-color: #b9ccfb; box-shadow: var(--shadow); transform: translateY(-1px); }
.bc-top { display: flex; align-items: center; gap: 8px; }
.bc-title { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.bc-mine {
  font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 1px 8px;
}
.bc-excerpt {
  margin: 6px 0 10px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bc-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.bc-meta .avatar { width: 20px; height: 20px; font-size: 11px; }
.bc-author { color: var(--text-2); font-weight: 600; }
.bc-dot { color: #c9d1dc; }
.bc-flag { font-size: 11px; padding: 0 7px; border-radius: 999px; background: #f2f5f9; border: 1px solid var(--line); }
.bc-flag-prob { color: var(--brand); background: var(--brand-soft); border-color: #d7e3ff; }
.bc-views { margin-left: auto; }
.blog-empty {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* 详情 */
.blog-head { margin-bottom: 14px; }
.blog-title { margin: 6px 0 8px; font-size: 24px; line-height: 1.35; letter-spacing: -.02em; }
.blog-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.blog-meta .avatar { width: 22px; height: 22px; font-size: 11.5px; }
.blog-author { color: var(--text); font-size: 13px; text-decoration: none; }
a.blog-author:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.blog-actions { margin-top: 12px; display: flex; gap: 8px; }

/* 正文排版：和题面一致，只是不限高 */
.blog-body { padding: 22px 26px; font-size: 14.5px; line-height: 1.8; color: #26303d; }
.blog-body h1, .blog-body h2, .blog-body h3 { color: var(--text); line-height: 1.35; }
.blog-body h1 { font-size: 19px; margin: 22px 0 10px; }
.blog-body h2 {
  font-size: 16px; margin: 26px 0 10px; padding-left: 10px;
  border-left: 3px solid var(--brand); letter-spacing: -.01em;
}
.blog-body h2:first-child { margin-top: 0; }
.blog-body h3 { font-size: 14.5px; margin: 18px 0 8px; }
.blog-body p { margin: 10px 0; }
.blog-body ul, .blog-body ol { margin: 10px 0; padding-left: 22px; }
.blog-body li { margin: 4px 0; }
.blog-body a { color: var(--brand); }
.blog-body a:hover { text-decoration: underline; }
.blog-body code {
  font-family: var(--mono);
  font-size: 12.8px;
  background: #f2f5f9;
  border: 1px solid #e8edf4;
  border-radius: 5px;
  padding: 1.5px 5px;
  color: #33507a;
}
.blog-body pre.md-code {
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.65;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 12px 0;
  color: #33405a;
}
.blog-body pre.md-code code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.blog-body blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  background: #f7f9fc;
  border-left: 3px solid #cfd9e6;
  color: var(--text-2);
  border-radius: 0 6px 6px 0;
}
.blog-body hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* 正文里的题号胶囊（点了跳题目） */
.blog-prob {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid #d7e3ff;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: 1px;
  transition: background .12s, border-color .12s;
}
.blog-prob b { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.blog-prob span {
  font-weight: 500;
  color: #3556a8;
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blog-prob:hover { background: #dfe9ff; border-color: #b9ccfb; text-decoration: none; }
.blog-prob.is-missing { background: #f4f6f9; border-color: var(--line); color: var(--muted); }

/* 「本文提到的题目」 */
.blog-probs-panel { margin-top: 14px; padding: 14px 16px; }
.bpp-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--text-2); margin-bottom: 10px; }
.bpp-count { font-size: 11.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 0 8px; }
.prob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prob-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font-size: 12.8px;
  color: var(--text-2);
}
.prob-chip b { font-family: var(--mono); color: var(--brand); }
.prob-chip:hover { border-color: #b9ccfb; background: #f2f6ff; }
.prob-chip.is-missing, .prob-chip.is-missing b { color: var(--muted); }

/* 编辑器 */
.blog-editor { padding: 16px 18px; }
.blog-title-input { width: 100%; font-size: 17px; font-weight: 650; padding: 10px 12px; }
.blog-tabs { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.blog-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}
.blog-tab:hover { border-color: #cbd5e1; }
.blog-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.blog-hint { font-size: 12px; color: var(--muted); }
/* 笔记页「插入代码 / 插入题号」和讨论区是同一个符号（</> 和 #），点了也弹同一个编辑器 */
.blog-code-btn b,
.blog-prob-btn b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--brand);
  letter-spacing: 0.5px;
}
.blog-hint code { font-family: var(--mono); background: #f2f5f9; border-radius: 4px; padding: 0 4px; }
.blog-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.blog-count.is-over { color: #b42318; font-weight: 700; }
.blog-text {
  width: 100%;
  min-height: 380px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13.2px;
  line-height: 1.75;
  color: var(--text);
  background: #fcfdff;
  outline: none;
}
.blog-text:focus { border-color: #b9ccfb; box-shadow: 0 0 0 3px rgba(43, 108, 246, .09); }
.blog-text[hidden] { display: none; }
.blog-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.blog-foot .form-err { margin: 0; }
.blog-body [hidden] { display: none; }

/* ---------- 个人主页（#/u/:id）：班级群成员、好友点名字进来 ---------- */
.ub-card { padding: 18px 20px; }
.ub-top { display: flex; align-items: center; gap: 14px; }
.ub-av .avatar { width: 54px; height: 54px; font-size: 20px; border-radius: 16px; }
.ub-who { min-width: 0; flex: 1; }
.ub-name {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ub-role {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f4f9;
  color: var(--muted);
}
.ub-role.r-teacher { background: var(--brand-soft); color: var(--brand-dark); }
.ub-role.r-admin { background: #fdeceb; color: #b42318; }
.ub-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf7ef;
  color: #1b7a45;
}
.ub-line { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* 个人主页的成长信息：称号 + Lv + 经验条 + 成长路径入口 */
.ub-growth { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.ub-tier {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  background: linear-gradient(135deg, #fff9e9, #fdecc8);
  border: 1px solid #f6dfae;
}
.ub-lv {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 6px 14px -10px rgba(79, 70, 229, .9);
}
.ub-xp { width: 88px; height: 6px; border-radius: 99px; background: #e9edf5; overflow: hidden; }
.ub-xp i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #818cf8, #4f46e5); }
.ub-xp-num { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ub-growth-link {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid #d7e3ff;
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
  text-decoration: none;
}
.ub-growth-link:hover { background: #e3ecff; text-decoration: none; }
.ub-stats { margin-top: 10px; display: flex; gap: 18px; flex-wrap: wrap; }
.ub-stat { font-size: 12px; color: var(--muted); }
.ub-stat b { font-size: 15px; color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.ub-acts { display: flex; gap: 8px; flex: none; align-items: center; }
.ub-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.ub-sec { margin-top: 18px; }
.ub-sec-head { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.ub-sec-head b { color: var(--brand-dark); margin-left: 4px; }

/* 个人页主体：左边宠物 + 徽章，右边笔记栏（2026-11-20 用户要求） */
.ub-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}
.ub-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ub-main { min-width: 0; }
.ub-main .ub-sec { margin-top: 0; }

@media (max-width: 980px) {
  .ub-layout { grid-template-columns: minmax(0, 1fr); }
  /* 单列时侧栏占满整行，徽章改成自适应小格，别把 3 张卡拉成三大块 */
  .ub-side .bd-wall { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
}

@media (max-width: 640px) {
  .ub-top { flex-wrap: wrap; }
  .ub-acts { width: 100%; }
}

/* 题号选择器 / 语言选择 */
.pp-box { display: flex; flex-direction: column; gap: 10px; }
.pp-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
}
.pp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}
.pp-row:last-child { border-bottom: 0; }
.pp-row:hover { background: #eef3fd; }
.pp-row b { font-family: var(--mono); color: var(--brand); min-width: 46px; }
.pp-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-diff { font-size: 11.5px; color: var(--muted); }
.pp-note { padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.lang-pick { display: flex; gap: 8px; }

/* ============ 选择题 / 判断题 ============ */
.quiz-panel { padding: 0; overflow: hidden; }

.quiz-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}
.q-kind {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.q-tip { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quiz-opts { padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.quiz-opt:hover { border-color: #bcd0ef; background: #f8fbff; }
.quiz-opt.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(43, 108, 246, .12);
}
.quiz-opt .qo-key {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  background: #f1f3f7;
  color: #4a5462;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-opt.on .qo-key { background: var(--brand); color: #fff; }
.quiz-opt .qo-text { flex: 1; min-width: 0; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.quiz-opt .qo-check { opacity: 0; color: var(--brand); font-weight: 700; transition: opacity .12s; }
.quiz-opt.on .qo-check { opacity: 1; }

.quiz-foot { padding: 0 14px 14px; font-size: 12px; color: var(--muted); }
.quiz-foot b { color: var(--text-2); }

.quiz-answer { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.qa-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.qa-row > span { color: var(--muted); min-width: 72px; }
.qa-row > b { font-size: 16px; }
.qa-ok { color: var(--ac); }
.qa-bad { color: var(--wa); }
.qa-note { font-size: 12.5px; color: var(--muted); }
.qa-big { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.qa-big .qa-row > b { font-size: 22px; }
.quiz-answer-card .editor-toolbar { border-bottom: 1px solid var(--line); }

/* 题库列表里的题型小标签 */
.k-tag {
  display: inline-block;
  font-style: normal;
  font-size: 10.5px;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  margin-right: 5px;
  vertical-align: 1px;
}
.k-choice { color: #1d54c9; background: #eaf0ff; }
.k-judge { color: #0f766e; background: #e6f7f4; }
.k-multi { color: #7a3fbf; background: #f3ecff; }
.k-reading { color: #b45309; background: #fdf1e3; }
/* 题目权限：比赛保密题，只有出题老师 / 管理员看得到这个标记 */
.k-private { color: #9a3412; background: #ffe9e0; font-weight: 700; }

/* 题目权限里的「定向可见范围」：老师 / 班级 chip 多选 */
.vs-scope { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.vs-scope[hidden] { display: none; }
.vs-row { display: flex; align-items: flex-start; gap: 10px; }
.vs-label { flex: 0 0 88px; font-size: 12px; color: var(--muted); padding-top: 5px; }
.vs-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.vs-chip {
  height: 26px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12px; color: var(--text-2); cursor: pointer;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.vs-chip:hover { border-color: var(--brand); color: var(--brand); }
.vs-chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.vs-empty { font-size: 12px; color: var(--muted); padding-top: 5px; }
.vs-hint { font-size: 12px; color: var(--muted); line-height: 1.55; }

.kind-sel { width: auto; min-width: 104px; padding: 5px 8px; font-size: 12.5px; }

/* ============ 多选题 / 阅读理解 ============ */
/* 多选题：方形序号 + 常显的勾选圈，可反复点 */
.quiz-opt.is-multi .qo-key { border-radius: 7px; }
.quiz-opt.is-multi .qo-check { opacity: 1; color: #c8cfdb; }
.quiz-opt.is-multi.on .qo-check { color: var(--brand); }

/* 阅读理解：一段代码 + 一串小题 */
.quiz-panel-reading .quiz-head { background: #fdf8f1; border-bottom-color: #f0e2cd; }
.quiz-reading { display: flex; flex-direction: column; }

.qsub { padding: 12px 14px 0; border-top: 1px dashed var(--line); }
.qsub:first-child { border-top: 0; }
.qsub-head { display: flex; align-items: center; gap: 8px; }
.qsub-head > b { font-size: 13px; color: var(--text-2); }
.qsub-kind {
  font-style: normal;
  font-size: 11px;
  line-height: 17px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
}
.qsub-multi {
  font-style: normal;
  font-size: 11px;
  line-height: 17px;
  padding: 0 7px;
  border-radius: 999px;
  color: #7a3fbf;
  background: #f3ecff;
}
.qsub-desc { margin-top: 5px; font-size: 13.5px; line-height: 1.68; color: var(--text); }
.qsub-desc p { margin: 0 0 6px; }
.qsub-desc code { font-family: var(--mono); font-size: 12.5px; background: #f1f3f8; padding: 1px 5px; border-radius: 4px; }
.qsub .quiz-opts { padding: 10px 0 12px; gap: 8px; }
.qsub .quiz-opt { padding: 9px 11px; font-size: 13.5px; }

/* 阅读理解的代码块：行号 + 代码，横向可滚 */
.reading-code {
  display: flex;
  margin: 10px 0 4px;
  border: 1px solid #e2e8f2;
  border-radius: 10px;
  background: #fbfcfe;
  overflow: auto;
  max-height: 460px;
}
.reading-code pre {
  margin: 0;
  padding: 12px 0;
  font: 12.5px/20px var(--mono);
  font-variant-ligatures: none;
  tab-size: 4;
}
.rc-gutter {
  flex: 0 0 auto;
  padding-left: 11px;
  padding-right: 9px;
  text-align: right;
  color: #a3aebd;
  border-right: 1px solid #e7ebf2;
  user-select: none;
  -webkit-user-select: none;
}
.rc-code { flex: 1; padding-left: 12px; padding-right: 15px; color: #24303f; white-space: pre; }

/* 交卷后逐小题结果 */
.qsub-results { margin: 12px 14px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qsub-res {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.qsub-res:first-child { border-top: 0; }
.qsub-res > b { flex: 0 0 56px; color: var(--text-2); }
.qsub-res > span { color: var(--muted); }
.qsub-res > i { margin-left: auto; font-style: normal; font-weight: 700; color: var(--muted); }
.qsub-res.is-ok { background: #f4fcf7; }
.qsub-res.is-ok > i { color: var(--ac); }
.qsub-res.is-bad { background: #fff6f6; }
.qsub-res.is-bad > i { color: var(--wa); }

/* 参考答案（老师 / 管理员）：单行答案 + 逐小题解析 */
.sol-answer-big {
  margin: 10px 0 2px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--brand-dark);
  word-break: break-all;
}
.sol-subs { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.sol-sub { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fcfdff; }
.sol-sub-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sol-sub-head > b { color: var(--text); }
.sol-sub-head > i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.sol-sub-ans { margin-left: auto; font-weight: 700; color: var(--ac); letter-spacing: .04em; }
.sol-sub-desc { margin-top: 7px; font-size: 13px; line-height: 1.72; color: var(--text); }
.sol-sub-desc p { margin: 0 0 6px; }
.sol-sub-desc code { font-family: var(--mono); font-size: 12.5px; background: #f1f3f8; padding: 1px 5px; border-radius: 4px; }
.sol-sub-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.sol-sub-opts .so {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: var(--text-2);
}
.sol-sub-opts .so > b { color: var(--brand); }
.sol-sub-opts .so.is-ok { border-color: #b7e2c6; background: #f2fbf5; color: #166534; }
.sol-sub-opts .so.is-ok > b { color: var(--ac); }
.sol-sub-note {
  margin-top: 9px;
  padding-left: 10px;
  border-left: 3px solid #e6eaf2;
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--muted);
}
.sol-sub-note p { margin: 0 0 5px; }
.sol-sub-note code { font-family: var(--mono); font-size: 12px; background: #f1f3f8; padding: 1px 4px; border-radius: 4px; }

.sol-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13.5px;
}
.sol-opt > b { flex: 0 0 18px; color: var(--brand); }
.sol-opt > span { flex: 1; min-width: 0; line-height: 1.6; }
.sol-opt > i { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ac); }
.sol-opt.is-ok { border-color: #b7e2c6; background: #f2fbf5; }

/* 出题编辑器：多选题勾选 / 阅读理解子题 */
.multi-answer { margin-top: 12px; }
.multi-answer > span { display: block; margin-bottom: 7px; font-size: 12.5px; color: var(--muted); }
.mcheck-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mcheck {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.mcheck:hover { border-color: #bcd0ef; background: #f8fbff; }
.mcheck input { margin: 0; }
.mcheck:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

.sub-list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 9px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.sub-list-head > b { font-size: 13px; }
.sub-editor { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fcfdff; margin-bottom: 10px; }
.se-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.se-head > b { font-size: 12.5px; color: var(--text-2); }
.se-kind { width: auto; min-width: 96px; padding: 4px 8px; font-size: 12.5px; }

/* 建考试 / 布置作业：整卷导入 */
.paper-field .field-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.paper-field .field-label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 7px; }
.paper-pick {
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.paper-pick:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 108, 246, .12); }
.paper-pick:disabled { color: var(--muted); background: #fafbfd; }
.paper-hint { margin-top: 2px; font-size: 12px; line-height: 1.6; }

@media (max-width: 720px) {
  .quiz-opts { padding: 10px; gap: 8px; }
  .quiz-opt { padding: 10px 12px; font-size: 13.5px; }
  .quiz-head { flex-wrap: wrap; }
}

/* ============ 好友提交（积分看代码） ============ */
.fsub-panel { margin-top: 16px; overflow: hidden; }

.fsub-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.fsub-head h2 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.fsub-cost {
  font-size: 11.5px;
  color: #8a5a00;
  background: #fff6e5;
  border: 1px solid #f6e0b3;
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 600;
}
.fsub-cost b { color: #b45309; }
.fsub-points { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fsub-points b { color: #b45309; font-size: 12.5px; }

.fsub-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.fsub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.fsub-row:hover { background: #f5f8fd; }
.fsub-who {
  font-size: 13px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fsub-row .verdict { font-size: 12.5px; gap: 5px; flex: none; width: 84px; }
.fsub-row .verdict .vg { width: 16px; height: 16px; font-size: 10px; }
.fsub-score {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  width: 44px;
  flex: none;
}
.fsub-when {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fsub-row .btn[disabled] { opacity: 0.7; cursor: not-allowed; }

.fsub-codewrap {
  margin: 2px 4px 8px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f7f9fc;
}
.fsub-codewrap .code-expand-pre { max-height: 340px; font-size: 12px; }

.fsub-foot {
  padding: 2px 16px 12px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 720px) {
  .fsub-when { display: none; }
  .fsub-who { max-width: 82px; }
  .fsub-head { flex-wrap: wrap; }
}

/* ============ 内置头像 ============ */
/* emoji 字形：让不同系统的 emoji 字体都优先用彩色版 */
.avatar.av-pic {
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Segoe UI Symbol', 'Noto Emoji', sans-serif;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}
.avatar.av-group { background: linear-gradient(140deg, #cbd5e1, #94a3b8); }
.avatar.av-plain { background: #94a3b8; }
.avatar.is-lg { width: 34px; height: 34px; font-size: 18px; border-radius: 11px; }
.avatar.is-xs { width: 18px; height: 18px; font-size: 11px; margin-right: 4px; }

/* ---- 账号页：头像选择 ---- */
.av-field { display: flex; flex-direction: column; gap: 9px; padding-bottom: 4px; }
.av-field-head { display: flex; align-items: center; gap: 11px; }
.av-preview .avatar { width: 46px; height: 46px; font-size: 24px; border-radius: 14px; }
.av-field-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.av-field-txt b { font-size: 13px; color: var(--text); }
.av-field-txt span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.av-hint { font-size: 11.5px; color: var(--muted); }

.av-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 7px;
}
.av-grid-lg { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.av-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 3px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.av-cell:hover { border-color: #bcd0ef; background: #f8fbff; }
.av-cell.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.12);
}
.av-cell .avatar { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
.av-cell em { font-style: normal; font-size: 10.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.av-cell.on em { color: var(--brand); font-weight: 600; }
.av-cell[disabled] { opacity: 0.6; cursor: progress; }

.av-picker { display: flex; flex-direction: column; gap: 10px; }
.av-picker-tip { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---- 班级卡片：群头像 ---- */
.class-card-head { flex-direction: row; align-items: center; gap: 11px; }
.class-av { flex: none; display: flex; }
.class-head-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.class-head-txt .class-name { min-width: 0; }

/* ---- 班级群：群头像 ---- */
.chat-title { flex-direction: row; align-items: center; gap: 10px; }
.chat-title-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-room-av {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}
.chat-room-av i {
  position: absolute;
  right: -3px;
  bottom: -3px;
  font-style: normal;
  font-size: 9.5px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  opacity: 0;
  transition: opacity 0.12s;
}
.chat-room-av:hover i { opacity: 1; }
.chat-room-av:hover .avatar { filter: brightness(1.06); }

@media (max-width: 720px) {
  .av-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
  .av-preview .avatar { width: 40px; height: 40px; font-size: 21px; }
  .av-field-head { flex-wrap: wrap; }
}

/* ---------- 网课 / 直播 ---------- */

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .16);
  animation: livePulse 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}
.live-dot.off { background: #b3bcc9; box-shadow: none; animation: none; }
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.82); }
}

.lsn-live-tip {
  font-size: 12px;
  font-weight: 600;
  color: #b42318;
  background: #fdecea;
  border: 1px solid #f7cfcb;
  border-radius: 20px;
  padding: 2px 9px;
  vertical-align: 3px;
}
.lsn-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.lsn-bar .spacer { flex: 1; }
.lsn-card { position: relative; }
.lsn-card.is-live { border-color: #f3c9c6; box-shadow: 0 0 0 3px rgba(229, 72, 77, .07); }
.lsn-card.is-over { opacity: .82; }
.lsn-card .hw-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lsn-desc { margin: 6px 2px 0; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.lsn-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.lsn-online { color: #b42318; font-weight: 600; }
.lsn-card .hw-acts { margin-top: 10px; }

.lsn-form { display: flex; flex-direction: column; gap: 12px; }
.lf-row { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.lf-row > span { font-weight: 600; color: var(--text-2); }
.lf-row .input { width: 100%; }
.lf-2 { flex-direction: row; gap: 10px; }
.lf-2 > label { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.lf-3 { flex-direction: row; gap: 10px; }
.lf-3 > label { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lf-classes { display: flex; flex-wrap: wrap; gap: 7px; }
.lf-cls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.lf-cls:has(input:checked) { border-color: #c9d9ff; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.lf-tip { font-size: 12px; color: var(--muted); }

/* 班级群里的「正在直播」条 */
.chat-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid #f3c9c6;
  border-radius: 11px;
  background: linear-gradient(90deg, #fdf1f0, #fff);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}
.chat-live:hover { border-color: #eab8b3; background: #fdf1f0; }
.chat-live b { color: #b42318; font-weight: 700; }
.chat-live-title { font-weight: 600; }
.chat-live-sub { font-size: 12px; color: var(--muted); }
.chat-live-go { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--brand); white-space: nowrap; }

/* 直播间 */
.live-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.live-head { display: flex; align-items: flex-start; gap: 12px; }
.live-head > div { flex: 1; min-width: 0; }
.live-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-stage { padding: 12px; }
.live-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f1522;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-shot, .live-local {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f1522;
}
.live-local { z-index: 2; }
.live-shot { z-index: 1; }
.live-empty {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #9aa6bb;
  text-align: center;
  padding: 20px;
}
.live-empty .big { font-size: 34px; line-height: 1; }
.live-empty b { color: #d7deeb; font-size: 14px; }
.live-empty span { font-size: 12.5px; max-width: 320px; }
.live-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.live-bar b { color: var(--text); font-size: 13px; }
.live-sep { color: #d5dbe5; }
.live-bar .spacer { flex: 1; }
.live-ctrls { display: flex; gap: 6px; flex-wrap: wrap; }
.live-tip { margin: 8px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

.live-side { display: flex; flex-direction: column; padding: 12px; min-height: 520px; }
.live-side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.live-side-head b { font-size: 13.5px; color: var(--text); }
.live-side-head span { margin-left: auto; font-size: 12px; color: var(--muted); }
.live-chat {
  flex: 1;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 8px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.lv-chat-empty, .lv-empty-people { font-size: 12.5px; color: var(--muted); padding: 14px 4px; text-align: center; }
.lv-msg { display: flex; gap: 8px; }
.lv-msg .avatar { width: 26px; height: 26px; font-size: 12px; }
.lv-msg-main { flex: 1; min-width: 0; }
.lv-msg-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.lv-msg-meta b { color: var(--text); font-size: 12.5px; }
.lv-time { margin-left: auto; font-size: 11px; }
.lv-msg-body { font-size: 13px; color: var(--text-2); line-height: 1.65; margin-top: 2px; overflow-wrap: anywhere; }
.lv-msg-body p { margin: 0 0 4px; }
.lv-msg-body p:last-child { margin-bottom: 0; }
.lv-msg-body code { font-family: var(--mono); font-size: 12px; background: #f2f5f9; border: 1px solid var(--line-soft); padding: 1px 4px; border-radius: 5px; }
.lv-msg.me .lv-msg-body { color: var(--brand-dark); }
.lv-msg.is-hand .lv-msg-body { color: #b45309; }
.lv-msg.is-hand { background: #fffaf0; border-radius: 8px; padding: 4px 6px; }
.live-compose { margin-top: 10px; }
.live-textarea { min-height: 54px; }
.live-compose-foot { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.live-compose-foot .spacer { flex: 1; }
.live-hint { font-size: 12px; color: var(--muted); }
.live-people { margin-top: 12px; }
.live-people-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-person {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: #fbfcfe;
  font-size: 12px;
  color: var(--text-2);
  max-width: 100%;
}
.lv-person .avatar { width: 20px; height: 20px; font-size: 10px; }
.lv-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.lv-person i { font-style: normal; font-size: 10px; color: var(--brand); background: var(--brand-soft); border-radius: 4px; padding: 0 3px; }
.lv-person.is-air { border-color: #f6ad55; background: #fff7ed; }
.lv-person .lv-air { color: #c2410c; background: #ffedd5; }
.lv-person .lv-netslow { color: #b91c1c; background: #fee2e2; }

/* 直播：正在讲的画面（画布就是推出去的那一张，板书也叠在上面） */
.live-ink {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  z-index: 3;
  background: #0f1522;
  cursor: default;
}
.live-ink.drawing { cursor: crosshair; touch-action: none; }
.live-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(15, 21, 34, 0.72);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(4px);
}
.lv-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.28);
  animation: lvpulse 1.6s infinite;
}
@keyframes lvpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.live-gate {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 8;
  border: 0;
  border-radius: 22px;
  padding: 9px 18px;
  font-size: 13px;
  color: #fff;
  background: rgba(37, 99, 235, 0.92);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 21, 34, 0.35);
  animation: lvpulse 2.4s infinite;
}
.live-banner {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(15, 21, 34, 0.22);
  font-size: 12.5px;
  color: var(--text-2);
  max-width: calc(100% - 24px);
}
.live-banner b { color: var(--brand-dark); }
.live-ink-bar {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(15, 21, 34, 0.78);
  backdrop-filter: blur(4px);
}
.lv-ink-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  padding: 0;
}
.lv-ink-btn.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.lv-ink-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.25); }
.live-ink-bar .btn { padding: 2px 8px; font-size: 11.5px; }
.live-head-acts { display: flex; align-items: center; gap: 8px; }
.lv-q-badge {
  font-size: 11.5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.live-q-sel { padding: 4px 6px; font-size: 12px; height: auto; }
.btn.on { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }

/* 直播：随堂投票 */
.live-poll {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 7;
  width: min(340px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 28px rgba(15, 21, 34, 0.26);
  font-size: 12.5px;
}
.lv-poll-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.lv-poll-head b { font-size: 13px; color: var(--text); line-height: 1.5; }
.lv-poll-head span { font-size: 11px; color: var(--muted); }
.lv-poll-opts { display: flex; flex-direction: column; gap: 5px; }
.lv-poll-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}
.lv-poll-opt:hover:not(:disabled) { border-color: var(--brand); }
.lv-poll-opt i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--brand-soft);
  z-index: 0;
  transition: width 0.3s ease;
}
.lv-poll-t { position: relative; z-index: 1; flex: 1; min-width: 0; }
.lv-poll-opt em { position: relative; z-index: 1; font-style: normal; font-size: 11px; color: var(--muted); }
.lv-poll-opt.is-mine { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.lv-poll-opt:disabled { cursor: default; }
.lv-poll-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.lv-poll-foot .spacer { flex: 1; }

/* 直播：举手队列 */
.lv-hands { border: 1px solid #fed7aa; background: #fff7ed; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.lv-hands-head { font-size: 12.5px; color: #9a3412; font-weight: 600; margin-bottom: 6px; }
.lv-hands-list { display: flex; flex-direction: column; gap: 5px; max-height: 132px; overflow-y: auto; }
.lv-hand-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.lv-hand-item b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lv-hand-item .btn { padding: 2px 8px; font-size: 11.5px; }

.lv-msg.is-sys { justify-content: center; padding: 2px 0; }
.lv-sys {
  font-size: 11.5px;
  color: var(--muted);
  background: #f4f6fa;
  border-radius: 20px;
  padding: 2px 10px;
}

@media (max-width: 900px) {
  .live-wrap { grid-template-columns: minmax(0, 1fr); }
  .live-side { min-height: 0; }
  .live-chat { max-height: 320px; }
}

/* ---------- 网课：直播 / 录播分段 ---------- */

.lsn-modes {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f6f8fb;
}
.lsn-mode {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lsn-mode b {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 0 6px;
}
.lsn-mode.on {
  background: #fff;
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.lsn-mode.on b { color: var(--brand); border-color: #cfe0ff; background: var(--brand-soft); }

/* ---------- 录播课卡片 ---------- */

.cse-card {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  margin-bottom: 10px;
}
.cse-card.is-done { border-color: #cfe8d8; }
.cse-thumb {
  flex: 0 0 132px;
  width: 132px;
  align-self: center;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b5bdb, #7048e8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  overflow: hidden;
}
.cse-thumb.is-empty { background: linear-gradient(135deg, #c8d1de, #dfe5ee); }
.cse-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #3b5bdb;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
}
.cse-thumb.is-empty .cse-play { color: #8a95a6; }
.cse-size {
  position: absolute;
  right: 6px;
  bottom: 5px;
  font-size: 10.5px;
  color: #fff;
  background: rgba(15, 21, 34, .55);
  border-radius: 4px;
  padding: 0 4px;
}
.cse-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cse-title { font-size: 14.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cse-desc { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.65; }
.cse-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.cse-hw { color: var(--brand-dark); background: var(--brand-soft); border-radius: 5px; padding: 0 6px; }
.cse-bar { height: 5px; border-radius: 4px; background: #eef2f8; overflow: hidden; margin-top: 2px; }
.cse-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4c6ef5, #7048e8); border-radius: 4px; }
.cse-prog { font-size: 12px; color: var(--muted); }
.cse-acts { display: flex; flex-direction: column; gap: 6px; justify-content: center; flex: 0 0 auto; }
.cse-acts .btn { white-space: nowrap; }

/* 表单：分段标题 / 当前视频 / 上传进度 */
.lf-sec {
  margin: 4px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.cf-cur { font-size: 12.5px; color: var(--text-2); background: #f7f9fc; border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 10px; }
.cf-cur b { color: var(--text); }
.cf-up { display: flex; align-items: center; gap: 9px; }
.cf-bar { flex: 1; height: 7px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.cf-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4c6ef5, #7048e8); transition: width .2s ease; }
.cf-up span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 录播课播放页 ---------- */

.cse-watch { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 14px; align-items: start; }
.cse-player-panel { padding: 12px; }
.cse-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f1522;
  border-radius: 10px;
  display: block;
}
.cse-novideo {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #0f1522;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #9aa6bb;
  text-align: center;
  padding: 20px;
}
.cse-novideo .big { font-size: 34px; line-height: 1; }
.cse-novideo b { color: #d7deeb; font-size: 14px; }
.cse-novideo span { font-size: 12.5px; max-width: 320px; }
.cse-under { margin-top: 10px; }
.cse-progress { display: flex; align-items: center; gap: 9px; }
.cse-bar2 { flex: 1; height: 6px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.cse-bar2 i { display: block; height: 100%; background: linear-gradient(90deg, #4c6ef5, #7048e8); transition: width .25s ease; }
.cse-progress span { font-size: 12px; color: var(--muted); min-width: 32px; text-align: right; }
.cse-tip { font-size: 12px; color: var(--muted); margin-top: 5px; }
/* B站讲：看完按钮 + 去B站看高清（并排，窄屏换行） */
.cse-bili-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cse-bili-bar .btn { text-decoration: none; }
.cse-bili-bar a.btn { color: var(--brand-dark); }
.cse-player-panel .cse-desc { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--text-2); }
.cse-up {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.cse-up .input { flex: 1; min-width: 180px; }
.cse-up .cf-up { flex: 1 0 100%; }

/* 播放页顶部的「第 2/3 个 · 标题」一行 */
.cse-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  padding: 0 2px;
}
.cse-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cse-head-main b {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cse-head-sub { font-size: 11.5px; color: var(--muted); }
.cse-head-nav { display: flex; gap: 6px; flex: 0 0 auto; }
.cse-mini {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}
.cse-mini:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); }
.cse-mini:disabled { opacity: .45; cursor: not-allowed; }
.cse-qwrap { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.cse-qsel { height: 26px; padding: 0 6px; font-size: 12px; color: var(--text-2); background: #fff; }
/* 清晰度按钮：当前是「流畅」时给个明确的选中态，别让人以为点了没反应 */
.cse-mini.is-low {
  border-color: var(--brand);
  background: var(--brand-soft, #eef3ff);
  color: var(--brand-dark);
  font-weight: 600;
}

/* 课程目录（一套课里的多个视频） */
.cse-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.cse-list-head .cse-side-title { margin: 0; }
.cse-list-meta { font-size: 11.5px; color: var(--muted); }
.cse-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.cse-list-empty { font-size: 12.5px; color: var(--muted); padding: 8px 0; }
/* ---- 章 → 讲两级目录 ---- */
.cse-list-acts { display: inline-flex; gap: 6px; align-items: center; }
.cse-chapter {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 4px 6px 6px;
  background: rgba(248, 250, 253, .6);
}
.cse-chapter-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 4px 3px;
}
.cse-chapter-name { font-weight: 700; font-size: 12.5px; color: var(--text-1); }
.cse-chapter-n { font-size: 11px; color: var(--muted); }
.cse-chapter-acts { margin-left: auto; display: inline-flex; gap: 4px; opacity: 0; transition: opacity .15s ease; }
.cse-chapter:hover .cse-chapter-acts { opacity: 1; }
.cse-chapter-empty { font-size: 11.5px; color: var(--muted); padding: 2px 6px 6px; }
.cse-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.cse-item:hover { border-color: #c5d3ec; background: #f8faff; }
.cse-item.is-cur { border-color: var(--brand); background: var(--brand-soft); }
.cse-item.is-done .cse-item-title { color: var(--text-2); }
.cse-num {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 5px;
  background: #eef2f8;
  color: var(--muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cse-item.is-cur .cse-num { background: var(--brand); color: #fff; }
.cse-item-main { flex: 1; min-width: 0; }
.cse-item-title {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cse-item-now {
  margin-left: 5px;
  font-size: 10.5px;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #cfdcff;
  border-radius: 4px;
  padding: 0 4px;
}
.cse-item-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.cse-item-state { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.cse-item-state.is-ok { color: #0b7a41; font-weight: 600; }
.cse-item-state.is-zero { color: #b0b9c8; }
.cse-item-acts { display: flex; gap: 2px; flex: 0 0 auto; }
.cse-item-act {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}
.cse-item-act:hover { background: #eef2f8; color: var(--brand-dark); }
.cse-list-tip { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: -4px 0 12px; }

.cse-side { padding: 14px; }
.cse-side-title { margin: 0 0 10px; font-size: 14px; }
.cse-hw-empty { font-size: 13px; color: var(--muted); }
.cse-hw-title { font-size: 13.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cse-hw-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cse-hw-pids { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0; }
.cse-pid {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #d7e3ff;
  border-radius: 6px;
  padding: 1px 6px;
  text-decoration: none;
}
.cse-pid:hover { background: #e3ecff; }
.cse-hw-on > .btn { margin-top: 4px; }
.cse-hw-lock {
  border: 1px dashed #dbe2ee;
  border-radius: 10px;
  padding: 12px;
  background: #fbfcfe;
  text-align: center;
}
.cse-hw-lock p { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.cse-lock { font-size: 20px; line-height: 1; margin-bottom: 4px; }

.cse-viewers { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.cse-viewers h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: baseline; gap: 6px; }
.cse-viewers h4 span { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.cse-vlist { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow-y: auto; }
.cse-vrow { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.cse-vrow .avatar { width: 22px; height: 22px; font-size: 10px; }
.cse-vname { flex: 0 0 auto; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.cse-vbar { flex: 1; height: 5px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.cse-vbar i { display: block; height: 100%; background: #4c6ef5; border-radius: 4px; }
.cse-vpct { flex: 0 0 auto; font-size: 11px; color: var(--muted); min-width: 46px; text-align: right; white-space: nowrap; }
.cse-unseen { margin-top: 9px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

@media (max-width: 900px) {
  .cse-watch { grid-template-columns: minmax(0, 1fr); }
  .cse-card { flex-wrap: wrap; }
  .cse-thumb { flex: 0 0 96px; width: 96px; }
  .cse-acts { flex-direction: row; flex-wrap: wrap; }
}
.cse-hw-tip { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.cse-hw-note {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-2);
  background: #f7f9fc;
  border-radius: 7px;
  padding: 6px 8px;
  line-height: 1.6;
}
.cse-hw-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cse-hw-of { font-size: 11.5px; font-weight: 400; color: var(--muted); }

/* 目录每条的作业角标：有没有作业、做没做完，扫一眼就知道 */
.cse-item-hw {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 15px;
  background: #eef2f8;
  color: var(--muted);
  vertical-align: 1px;
}

/* B站视频讲：目录里的小标签 */
.cse-item-bili {
  display: inline-block;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 15px;
  background: #fff1e6;
  color: #e0641e;
  font-weight: 600;
  vertical-align: 1px;
}

/* OSS 云端视频讲：目录里的小标签 */
.cse-item-oss {
  display: inline-block;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 15px;
  background: #e8f1ff;
  color: #1d5fd0;
  font-weight: 600;
  vertical-align: 1px;
}
.cse-item-hw.is-open { background: var(--brand-soft); color: var(--brand-dark); }
.cse-item-hw.is-done { background: #e6f7ee; color: #0b7a41; }
.cse-item-hw.is-none { background: transparent; border: 1px dashed #dfe5ee; color: #b0b9c8; }

/* 目录上方的「作业 N/M 讲已配」横条 */
.cse-hw-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f7f9fc;
  border: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-2);
}
.cse-hw-bar b { color: var(--brand-dark); }
.cse-hw-bar .cse-mini { margin-left: auto; }

/* ---------- 单讲作业编辑 / 作业一览 ---------- */
.vh-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--brand-soft);
  border: 1px solid #d7e3ff;
  margin-bottom: 4px;
}
.vh-head b { font-size: 13.5px; color: var(--text); }
.vh-quick { display: flex; flex-wrap: wrap; gap: 7px; }
/* 「补给已经看完的学员」勾选 */
.hw-back {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  cursor: pointer;
}
.hw-back input { margin: 2px 0 0; flex: 0 0 auto; }
.hb-wrap { display: flex; flex-direction: column; gap: 9px; }
.hb-tip { font-size: 12px; color: var(--muted); line-height: 1.7; }
.hb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hb-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fc;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-align: left;
  padding: 6px 7px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.hb-table td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.hb-table tr:hover td { background: #fafbfe; }
.hb-no { color: var(--muted); font-size: 11.5px; width: 30px; text-align: right; }
.hb-title {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.hb-table .input { height: 28px; font-size: 12.5px; padding: 0 7px; }
.hb-table .hb-pids { width: 100%; min-width: 150px; font-family: var(--mono); }
.hb-table .hb-days { width: 108px; }
.hb-table .hb-reward { width: 66px; }
.hb-act { width: 52px; text-align: center; }
.hb-wrap > .form-err:empty { display: none; }
/* 作业一览工具条：自动配题 + 一键统一截止/积分 + 题号体检结果 */
.hb-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f8f9fc;
}
.hb-tools-sep { width: 1px; height: 18px; background: var(--line); }
.hb-tools-f { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.hb-tools-f .input { height: 28px; padding: 0 6px; font-size: 12px; }
.hb-tools-f select.input { width: auto; min-width: 96px; }
.hb-tools-f input.input { width: 62px; }
.hb-tools-stat { margin-left: auto; font-size: 12px; color: var(--muted); }
.hb-tools-stat b { color: var(--text); }
.hb-tools .is-bad, .hb-tools-stat .is-bad { color: #c0392b; font-style: normal; font-weight: 600; }
.hb-table tr.is-bad td { background: #fff6f5; }
.hb-table tr.is-bad .hb-pids { border-color: #e7a09a; background: #fff; }

/* 自动配题弹窗 */
.modal-hwauto { max-width: 720px; }
.modal-hwauto .modal-body { max-height: min(70vh, 640px); overflow-y: auto; }
.af-form { gap: 14px; }
.af-sec {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fbfcfe;
}
.af-sec-h { font-size: 12.5px; font-weight: 700; color: var(--text); }
.af-pool { font-size: 12px; color: var(--muted); line-height: 1.6; }
.af-pool b { color: var(--text); }
.af-pool.is-ok { color: #1a7f45; }
.af-pool.is-short { color: #b26a00; }
.af-plan { display: none; }
.af-plan.is-on {
  display: block;
  padding: 10px 12px;
  border: 1px solid #cfe0f7;
  border-radius: 11px;
  background: #f4f8ff;
}
.af-plan-head { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.af-plan-head b { color: #1652a3; }
.af-plan-list { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.af-plan-row { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.af-plan-row .af-n { flex: 0 0 60px; color: var(--muted); }
.af-plan-row .af-t {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.af-plan-row .af-p { flex: 0 0 auto; font-family: var(--mono); font-size: 11.5px; color: #1652a3; }
.af-plan-more, .af-plan-tip { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.af-plan .is-bad { color: #c0392b; font-style: normal; }
.modal-hwboard { max-width: 880px; }
.modal-hwboard .modal-body { max-height: min(64vh, 560px); overflow-y: auto; }

/* ---------- 班级群左栏：搜班级 / 入班申请（原来「我的班级」那页并进来了） ---------- */

/* 左栏现在要放搜索框和申请列表，比过去「纯班级列表」宽一圈 */
.chat-wrap.has-rooms { grid-template-columns: 264px minmax(0, 1fr) 232px; }
.chat-rooms { max-height: calc(min(58vh, 520px) + 250px); }
.chat-rooms .fr-search { padding: 10px 10px 9px; }
.chat-rooms .chat-side-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
}
.chat-rooms .chat-side-head .btn { margin-left: auto; flex: none; }
.chat-rooms .chat-room-list { padding-top: 6px; }

.cr-empty { padding: 22px 12px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* 入班申请（老师看）/ 我发出的申请（学员看） */
.cr-joins { display: flex; flex-direction: column; padding-bottom: 4px; }
/* 没申请时整块藏起来（容器常驻，新申请到了就地填内容） */
.cr-join-sec[hidden] { display: none; }
/* 待审批的条数：和导航红点一个颜色，扫一眼就知道有活要干 */
.cr-join-sec .fr-sec-head b { color: #d13a34; }
.cr-join {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 8px;
}
.cr-join + .cr-join { border-top: 1px dashed var(--line-soft); }
.cr-join .avatar { width: 24px; height: 24px; font-size: 11px; flex: none; }
.cr-join-main { flex: 1; min-width: 0; }
.cr-join-main b {
  display: block;
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-join-main span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-join-btns { display: flex; gap: 4px; flex: none; }
.cr-join-btns .btn { padding: 2px 7px; font-size: 11.5px; }

/* 「管理本班」弹窗里的按钮组 */
.cm-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cm-ops-tip { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }

@media (max-width: 1180px) {
  .chat-wrap.has-rooms { grid-template-columns: 240px minmax(0, 1fr) 200px; }
}
@media (max-width: 880px) {
  .chat-wrap.has-rooms { grid-template-columns: 1fr; }
  .chat-rooms { max-height: none; }
  .chat-rooms .fr-search { padding: 8px 10px; }
}

/* ============ 发消息扣积分（每条 0.1 分） ============ */
.chat-fee {
  font-size: 11.5px;
  line-height: 1;
  color: var(--mle);
  background: var(--mle-soft);
  border: 1px solid #f3ddc2;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* ============ 博客评论 ============ */
.blog-talk { padding: 0; overflow: hidden; margin-top: 14px; }
.bt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.bt-head b { color: var(--brand); font-variant-numeric: tabular-nums; }
.bt-hint { margin-left: auto; font-weight: 400; }
.bt-list { padding: 0 16px; }
.bt-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.bt-item:last-child { border-bottom: 0; }
.bt-av { flex: 0 0 auto; display: flex; }
.bt-av .avatar, .bt-item > .avatar { width: 32px; height: 32px; font-size: 13px; }
.bt-main { flex: 1; min-width: 0; }
.bt-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.bt-meta b { color: var(--text); font-size: 13px; }
.bt-time { font-variant-numeric: tabular-nums; }
.bt-body {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  word-break: break-word;
}
.bt-item.is-gone .bt-body { color: var(--muted); font-style: italic; }
.bt-del {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.bt-del:hover { color: var(--wa); border-color: var(--line); background: var(--wa-soft); }
.bt-form {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.bt-text {
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bt-text:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.12); }
.bt-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.bt-tip { color: var(--mle); }

@media (max-width: 720px) {
  .chat-fee { order: -1; }
  .bt-list { padding: 0 12px; }
  .bt-form { padding: 10px 12px 12px; }
}

/* ============ 考试里的选择 / 判断题：只保存答案，交卷后统一对答案 ============ */
.exam-tab.is-saved { border-color: #c7d7f5; background: #f7faff; }
.exam-tab.is-saved b { background: #2b6cf6; color: #fff; }
.exam-tab em.ts-saved { color: #2b6cf6; font-weight: 600; }

.quiz-save-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.quiz-saved { font-size: 12.5px; color: var(--muted); }
.quiz-saved.is-on { color: #0f9d58; }

.ans-panel { margin-bottom: 14px; }
.ans-list { padding: 4px 16px 12px; }
.ans-item { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.ans-item:last-child { border-bottom: 0; }
.ans-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ans-no {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 6px;
  background: #f1f3f7;
  color: #4a5462;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ans-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-tag {
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f3f7;
  color: var(--muted);
  white-space: nowrap;
}
.ans-item.is-ok .ans-tag { background: #e8f7ef; color: #0f9d58; }
.ans-item.is-bad .ans-tag { background: #fdecec; color: #d64545; }
.ans-body {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0 28px;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.ans-k { color: var(--muted); }
.ans-v { font-family: var(--mono); font-weight: 700; color: var(--text-2); }
.ans-v.ok { color: #0f9d58; }
.ans-v.bad { color: #d64545; }

@media (max-width: 720px) {
  .quiz-save-row { flex-wrap: wrap; }
}

/* ============ 讨论区工具条：代码 / 题号（表情按钮已有样式） ============ */
.cm-prob-btn {
  flex: none;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font: 700 13px/1 var(--mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cm-prob-btn:hover { background: #f2f6fd; border-color: #c9dbff; }
.cm-prob-btn:active { transform: scale(0.96); }
/* 讨论区这一排按钮统一高度，别一个高一个矮 */
.cm-bar .cm-code-btn,
.cm-bar .cm-prob-btn,
.cm-bar .cm-emoji-btn { height: 26px; }
.cm-reply-box .cm-bar .cm-code-btn,
.cm-reply-box .cm-bar .cm-prob-btn { margin-left: 0; }

/* 收藏按钮：选中时星星填满 */
.cm-act.is-fav.on svg { fill: currentColor; }

/* 插入题号的小弹窗 */
.modal-prob-pick .pp-tip {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.modal-prob-pick .input { width: 100%; }

/* ============ 关注 / 粉丝 / 我的收藏 ============ */
.btn.is-on {
  background: var(--brand-soft);
  border-color: #bcd2ff;
  color: var(--brand-dark);
  font-weight: 600;
}
.blog-follow { margin-left: 6px; }

.fl-panel { padding: 0; overflow: hidden; }
.fl-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.fl-tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.fl-tab b { margin-left: 4px; color: var(--brand); font-variant-numeric: tabular-nums; }
.fl-tab:hover { background: #f2f6fd; }
.fl-tab.on { background: var(--brand-soft); border-color: #bcd2ff; color: var(--brand-dark); font-weight: 600; }

.fl-list { display: flex; flex-direction: column; }
.fl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.fl-item:last-child { border-bottom: 0; }
.fl-av { display: flex; flex: none; }
.fl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fl-name { font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none; }
.fl-name:hover { color: var(--brand); }
.fl-line { font-size: 12px; color: var(--muted); }
.fl-tag {
  font-size: 11.5px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}
.fl-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  background: #fbfcfe;
}
.fl-foot:empty { display: none; }

.ub-stat-link { text-decoration: none; }
.ub-stat-link:hover b { color: var(--brand); }

.fv-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.fv-item:last-child { border-bottom: 0; }
.fv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fv-src {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-dark);
  text-decoration: none;
}
.fv-src:hover { text-decoration: underline; }
.fv-time { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.fv-body { font-size: 13px; color: var(--text-2); line-height: 1.65; }
.fv-body b { color: var(--text); }
.fv-foot { display: flex; gap: 8px; margin-top: 8px; }

/* 直播间「悬浮窗」：真正的界面在 Document PiP 的独立窗口里（样式由 app.js 内联注入），
   这里只负责网页内的停放点，不能让一个 display:flex 的 .lv-dock 撑出空白 */
.lv-dock-holder { display: none !important; }

/* ==========================================================================
   科技风皮肤 v2（面向青少年学员）
   思路：深空蓝顶栏 + 霓虹青紫渐变 + 玻璃拟态卡片 + 大圆角 + 轻微动效。
   页面主体仍是浅底（长时间读题不刺眼），只在「头部 / 商城 / 强调块」上用深色 + 霓虹。
   ========================================================================== */

:root {
  --bg: #eef1fb;
  --panel: #ffffff;
  --line: #e0e6f6;
  --line-soft: #eef1fb;
  --text: #0f1734;
  --text-2: #3f4a6b;
  --muted: #6c7896;

  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef0ff;

  --cy: #06b6d4;
  --vi: #8b5cf6;
  --pk: #ec4899;
  --glow: 0 0 0 1px rgba(99, 102, 241, 0.16), 0 12px 34px -18px rgba(79, 70, 229, 0.55);

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 84, 0.05);
  --shadow: 0 2px 6px rgba(20, 32, 84, 0.05), 0 18px 40px -28px rgba(20, 32, 84, 0.5);
}

html { background: #eef2fc; }

body {
  background: transparent;
  color: var(--text);
}

/* 背景：两团霓虹光晕 + 一层很淡的网格，滚动时不动（fixed），不干扰读题 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(99, 102, 241, 0.2), transparent 62%),
    radial-gradient(760px 460px at 96% -6%, rgba(34, 211, 238, 0.18), transparent 58%),
    radial-gradient(820px 500px at 62% 108%, rgba(168, 85, 247, 0.14), transparent 62%),
    linear-gradient(180deg, #eef2ff 0%, #e9edfa 55%, #e6ecfb 100%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.07) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

/* ---------------- 顶栏：深空蓝 + 霓虹底线 ---------------- */
.topbar {
  background:
    radial-gradient(600px 120px at 12% 0%, rgba(56, 189, 248, 0.24), transparent 70%),
    radial-gradient(600px 120px at 82% 0%, rgba(168, 85, 247, 0.24), transparent 70%),
    linear-gradient(115deg, #070d20 0%, #101a3c 46%, #1a1040 100%);
  border-bottom: 1px solid rgba(122, 158, 255, 0.16);
  box-shadow: 0 10px 34px -22px rgba(10, 22, 60, 0.95);
  backdrop-filter: none;
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #22d3ee, #6366f1 30%, #a855f7 62%, #ec4899 88%, #22d3ee);
  background-size: 220% 100%;
  animation: techLine 9s linear infinite;
  opacity: 0.9;
}

@keyframes techLine {
  from { background-position: 0% 0; }
  to { background-position: 220% 0; }
}

.brand-mark {
  background: linear-gradient(140deg, #22d3ee, #6366f1 52%, #a855f7);
  box-shadow: 0 6px 18px -8px rgba(99, 102, 241, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  border-radius: 9px;
}

.brand-text strong { color: #ffffff; letter-spacing: 0.02em; }
.brand-text em { color: #8fa6d8; }

.nav a {
  color: #b9c6e8;
  border-radius: 9px;
  transition: background 0.15s, color 0.15s, box-shadow 0.2s;
}
.nav a:hover { background: rgba(148, 178, 255, 0.14); color: #ffffff; }
.nav a.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(168, 85, 247, 0.9));
  box-shadow: 0 6px 18px -8px rgba(120, 119, 255, 0.95);
}

/* 待办数量：只要红色数字（「(3)」），不要红底方块 —— 顶栏已经是深色，红底反而像一块补丁 */
.nav-badge {
  background: none;
  box-shadow: none;
  color: #ff6b6b;
}
.nav a:hover .nav-badge { color: #ff8a8a; }
.nav a.active .nav-badge { color: #ffd0ce; }

.topstat { color: #93a4cc; }
.topstat b { color: #ffffff; }
.topstat .tp-points { color: #fbbf24 !important; }

.sfx-btn {
  background: rgba(148, 178, 255, 0.12);
  border-color: rgba(148, 178, 255, 0.2);
  color: #cfdbff;
}
.sfx-btn:hover { background: rgba(148, 178, 255, 0.22); }

.user-chip {
  background: rgba(148, 178, 255, 0.12);
  border-color: rgba(148, 178, 255, 0.22);
  color: #e6ecff;
}
.user-chip:hover { background: rgba(148, 178, 255, 0.22); border-color: rgba(148, 178, 255, 0.36); }
.user-chip .uinfo b { color: #ffffff; }
.user-chip .uinfo em { color: #93a4cc; }

/* ---------------- 卡片 / 按钮 / 输入框 ---------------- */
.panel {
  border-radius: var(--radius);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 7px 14px;
  border-color: #dbe2f4;
  background: #fff;
  color: var(--text-2);
}
.btn:hover { border-color: #c3cdf0; background: #f7f9ff; transform: translateY(-1px); }
.btn:disabled { transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #4338ca);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -12px rgba(79, 70, 229, 0.95);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7c7ff5, #5b52ea 55%, #4c42d6);
  border-color: transparent;
  box-shadow: 0 12px 26px -12px rgba(79, 70, 229, 0.95);
}

.btn-danger { border-color: #f6cdd2; color: #d92d33; background: #fff5f6; }
.btn-danger:hover { background: #ffecee; border-color: #f0b0b7; }

.input {
  border-radius: 10px;
}
.input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

/* 页面标题：左侧一条霓虹竖条（不用渐变文字，免得标题里的徽章跟着变透明） */
.page-head h1 {
  position: relative;
  padding-left: 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-head h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 1.02em;
  border-radius: 3px;
  background: linear-gradient(180deg, #22d3ee, #6366f1 52%, #a855f7);
  box-shadow: 0 0 12px -2px rgba(99, 102, 241, 0.75);
}
.page-head p { color: var(--muted); }

.chip { border-radius: 999px; }
.chip.on {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: transparent;
  box-shadow: 0 6px 16px -10px rgba(79, 70, 229, 0.95);
}

::-webkit-scrollbar-thumb { background: #c3cdf0; }
::-webkit-scrollbar-thumb:hover { background: #a9b6e6; }

/* ==========================================================================
   课程商城（网课页）
   ========================================================================== */

.mall-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 30px 32px;
  margin-bottom: 18px;
  border-radius: 22px;
  color: #eaf0ff;
  background:
    radial-gradient(620px 240px at 88% -30%, rgba(34, 211, 238, 0.42), transparent 62%),
    radial-gradient(520px 260px at 12% 120%, rgba(168, 85, 247, 0.4), transparent 62%),
    linear-gradient(120deg, #0a1130 0%, #16204c 48%, #241247 100%);
  box-shadow: 0 26px 60px -40px rgba(12, 22, 66, 0.95), inset 0 0 0 1px rgba(140, 170, 255, 0.14);
}

.mall-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(150, 180, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 180, 255, 0.09) 1px, transparent 1px);
  background-size: 34px 34px, 34px 34px;
  -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 62%);
  mask-image: linear-gradient(100deg, #000 0%, transparent 62%);
  pointer-events: none;
}

.mall-hero-in { position: relative; flex: 1; min-width: 0; }

.mall-kicker {
  display: inline-block;
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.32em;
  color: #67e8f9;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.mall-hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(96deg, #ffffff 10%, #c7d4ff 48%, #6ee7f9 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mall-hero p {
  margin: 0;
  max-width: 620px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #b9c7ec;
}

.mall-hero-stats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 12.5px; color: #9fb0d8; }
.mall-hero-stats b { color: #ffffff; font-size: 17px; font-weight: 800; margin-right: 4px; }

.mall-hero-art {
  position: relative;
  width: 132px;
  height: 132px;
  flex: none;
  display: grid;
  place-items: center;
}

.mh-emoji { font-size: 62px; filter: drop-shadow(0 10px 24px rgba(120, 140, 255, 0.6)); }

.mh-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(140, 200, 255, 0.42);
  animation: orbitSpin 18s linear infinite;
}
.mh-orbit::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 12px 3px rgba(103, 232, 249, 0.75);
}

@keyframes orbitSpin { to { transform: rotate(360deg); } }

/* ---- 筛选条 ---- */
.mall-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -26px rgba(20, 32, 84, 0.7);
  backdrop-filter: blur(10px) saturate(150%);
}

.mall-search {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-width: 180px;
  border-radius: 999px;
  background: #f2f5fe;
  border: 1px solid transparent;
}
.mall-search:focus-within { border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.13); }
.mall-search span { font-size: 13px; opacity: 0.7; }
.mall-search .input {
  flex: 1;
  border: none;
  background: transparent;
  box-shadow: none !important;
  padding: 8px 0;
  min-width: 0;
}
.mall-search .input:focus { border: none; box-shadow: none !important; }

.mall-chips { display: flex; gap: 6px; }

.mall-sel { width: auto; min-width: 118px; border-radius: 999px; padding: 6px 10px; font-size: 12.5px; }
.mall-new { white-space: nowrap; }

.mall-count { font-size: 12.5px; color: var(--muted); margin: 0 4px 10px; }
.mall-count b { color: var(--brand); }

.mall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  gap: 18px;
}

/* ---- 一张课程卡 ---- */
.mc {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(20, 32, 84, 0.05), 0 18px 40px -34px rgba(20, 32, 84, 0.6);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.mc:hover {
  transform: translateY(-6px);
  border-color: #c7d2fe;
  box-shadow: 0 10px 24px -14px rgba(79, 70, 229, 0.4), 0 26px 50px -30px rgba(20, 32, 84, 0.6);
}
.mc.is-locked .mc-cover { filter: saturate(0.72); }

.mc-cover {
  position: relative;
  display: grid;
  place-items: center;
  height: 150px;
  background: linear-gradient(135deg, var(--c1, #6366f1), var(--c2, #22d3ee));
  overflow: hidden;
}
/* 有真实截图封面（工作台从成片截一帧）：图片铺满，去掉原来的斜纹和光斑装饰 */
.mc-cover.is-shot::before,
.mc-cover.is-shot::after,
.chero-cover.is-shot::before,
.chero-cover.is-shot::after {
  display: none;
}
.mc-cover .mc-shot,
.chero-cover .chero-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}
/* 封面图是 JS 用 token 拉回来再塞 src 的，加载好之前先透明，避免闪一下破图 */
.mc-cover .mc-shot,
.chero-cover .chero-shot {
  opacity: 0;
  transition: opacity 0.18s ease;
}
.mc-cover .mc-shot.is-on,
.chero-cover .chero-shot.is-on {
  opacity: 1;
}

/* 角标本来就 position:absolute + z-index:2，压在截图上不用再动；只给白字加一点阴影 */
.mc-cover.is-shot .mc-num,
.mc-cover.is-shot .mc-lv,
.chero-cover.is-shot .chero-lv {
  box-shadow: 0 2px 8px rgba(12, 20, 40, 0.35);
}
.mc-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 14px);
  opacity: 0.5;
  pointer-events: none;
}
.mc-cover::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  top: -60px;
  right: -40px;
  filter: blur(2px);
}

.mc-emoji {
  position: relative;
  font-size: 54px;
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s;
}
.mc:hover .mc-emoji { transform: scale(1.08) rotate(-3deg); }

.mc-lv,
.mc-num,
.mc-lock {
  position: absolute;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.mc-lv { top: 10px; left: 10px; background: rgba(255, 255, 255, 0.92); color: #1f2a55; }
.mc-num { top: 10px; right: 10px; background: rgba(8, 16, 40, 0.55); color: #fff; }
.mc-lock { bottom: 10px; left: 10px; background: rgba(8, 16, 40, 0.62); color: #ffe08a; }

.mc-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(8, 16, 40, 0.28);
  z-index: 2;
}
.mc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a7f3d0, #67e8f9); }

.mc-done {
  position: absolute;
  bottom: 12px;
  right: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.92);
  color: #fff;
}

.mc-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 7px;
  padding: 13px 14px 12px;
}

.mc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.mc-title a:hover { color: var(--brand); }

.mc-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.mc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mc-tags span {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1fe;
  color: #4b5680;
}
.mc-tags span.is-hw { background: #fff4e5; color: #b45309; }

.mc-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.mc-teacher { color: #4b5680; font-weight: 600; }
.mc-dot { opacity: 0.45; }

.mc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.mc-price {
  font-size: 19px;
  font-weight: 800;
  color: #e11d48;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.mc-price i { font-style: normal; font-size: 12px; }
.mc-price.is-big { font-size: 26px; }
.mc-price.is-big i { font-size: 15px; }

.mc-old {
  font-size: 12px;
  color: #98a2bd;
  text-decoration: line-through;
  margin-left: -2px;
}

.mc-free { font-size: 16px; font-weight: 800; color: #059669; }
.mc-free.is-big { font-size: 24px; }

.mc-btn {
  margin-left: auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #dbe2f4;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s;
}
.mc-btn:hover { border-color: #a5b4fc; color: var(--brand); background: #f6f7ff; }
.mc-btn.is-go,
.mc-btn.is-buy {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5 60%, #4338ca);
  box-shadow: 0 8px 18px -12px rgba(79, 70, 229, 0.95);
}
.mc-btn.is-buy {
  background: linear-gradient(135deg, #fb923c, #f43f5e 75%);
  box-shadow: 0 8px 18px -12px rgba(244, 63, 94, 0.95);
}
.mc-btn.is-go:hover,
.mc-btn.is-buy:hover { transform: translateY(-1px); color: #fff; filter: brightness(1.06); }
.mc-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.mc-acts {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.mc:hover .mc-acts { opacity: 1; }
.mc-acts button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  color: #1f2a55;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.6);
}
.mc-acts button:hover { background: #fff; transform: scale(1.06); }

.mall-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 56px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed #c7d2fe;
  color: var(--muted);
  text-align: center;
}
.mall-empty .big { font-size: 40px; }
.mall-empty b { color: var(--text); font-size: 15px; }

/* 封面色板（8 套渐变，卡片 / 详情页 / 选色按钮共用） */
.cov-0 { --c1: #6366f1; --c2: #22d3ee; }
.cov-1 { --c1: #f59e0b; --c2: #ef4444; }
.cov-2 { --c1: #10b981; --c2: #0ea5e9; }
.cov-3 { --c1: #8b5cf6; --c2: #ec4899; }
.cov-4 { --c1: #0ea5e9; --c2: #4f46e5; }
.cov-5 { --c1: #f97316; --c2: #a855f7; }
.cov-6 { --c1: #14b8a6; --c2: #6366f1; }
.cov-7 { --c1: #ef4444; --c2: #6366f1; }

/* ==========================================================================
   课程详情页（商品详情式头部）
   ========================================================================== */

.chero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: 22px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(20, 32, 84, 0.05), 0 24px 50px -40px rgba(20, 32, 84, 0.75);
  position: relative;
  overflow: hidden;
}
.chero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--c1, #6366f1), var(--c2, #22d3ee), transparent);
}

.chero-cover {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--c1, #6366f1), var(--c2, #22d3ee));
  box-shadow: 0 16px 30px -20px rgba(30, 40, 90, 0.9);
  position: relative;
  overflow: hidden;
  flex: none;
}
.chero-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 14px);
  opacity: 0.55;
}
.chero-emoji { font-size: 54px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3)); position: relative; }
.chero-lv {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2a55;
}

.chero-main { min-width: 0; }

.chero-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.chero-crumb a { color: var(--brand); font-weight: 600; }
.chero-crumb a:hover { text-decoration: underline; }

.chero-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1fe;
  color: #4b5680;
}
.chero-pill.is-class { background: #eaf6ff; color: #0369a1; }
.chero-pill.is-lock { background: #fff4e5; color: #b45309; }
.chero-pill.is-done { background: #e7f8f0; color: #047857; }

.chero-title {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.32;
}

.chero-desc {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.72;
  color: var(--text-2);
  max-width: 780px;
  white-space: pre-wrap;
}

.chero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chero-tags span {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef1fe;
  color: #4b5680;
}
.chero-tags span.is-soft { background: #f4f6fc; color: var(--muted); }

.chero-meta { font-size: 12px; color: var(--muted); }

.chero-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 176px;
  padding-left: 20px;
  border-left: 1px dashed var(--line);
  text-align: right;
}
.chero-buy-btn, .chero-go-btn { width: 100%; justify-content: center; }
.chero-buy-tip { font-size: 11px; color: var(--muted); }
.chero-owned { font-size: 12.5px; font-weight: 700; color: #059669; }

/* 没解锁：播放器位置放一块锁屏 */
.cse-lockbox {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 54px 24px;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed #c7d2fe;
  background:
    radial-gradient(420px 200px at 50% 0%, rgba(99, 102, 241, 0.1), transparent 70%),
    #f8faff;
}
.cse-lock-ico { font-size: 40px; }
.cse-lockbox b { font-size: 16px; }
.cse-lockbox span { font-size: 12.5px; color: var(--muted); max-width: 420px; }
.cse-lockbox .btn { margin-top: 4px; }
.cse-lock-tip { font-size: 11.5px; color: #94a3b8; }

/* 建课表单：封面色选择 */
.cf-covers { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-cov {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 6px 14px -10px rgba(20, 32, 84, 0.9);
  transition: transform 0.15s, border-color 0.15s;
}
.cf-cov:hover { transform: translateY(-2px); }
.cf-cov.on { border-color: #1f2a55; box-shadow: 0 0 0 2px #fff inset, 0 8px 18px -10px rgba(20, 32, 84, 0.9); }

/* ---------------- 窄屏 ---------------- */
@media (max-width: 900px) {
  .mall-hero { padding: 22px; }
  .mall-hero-art { display: none; }
  .mall-hero h1 { font-size: 24px; }
  .mall-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .chero { grid-template-columns: auto minmax(0, 1fr); }
  .chero-buy {
    grid-column: 1 / -1;
    align-items: stretch;
    border-left: none;
    border-top: 1px dashed var(--line);
    padding: 12px 0 0;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .chero-buy .mc-price.is-big { font-size: 22px; }
}

@media (max-width: 620px) {
  .mall-hero-stats { gap: 10px; font-size: 11.5px; }
  .mall-bar { padding: 8px; }
  .mall-sel { min-width: 96px; }
  .mall-grid { grid-template-columns: 1fr 1fr; }
  .mc-cover { height: 112px; }
  .mc-emoji { font-size: 40px; }
  .mc-title { font-size: 13.5px; min-height: 38px; }
  .chero { grid-template-columns: 1fr; }
  .chero-cover { width: 88px; height: 88px; border-radius: 14px; }
  .chero-emoji { font-size: 38px; }
  .chero-title { font-size: 19px; }
}

/* ==========================================================================
   最后一层打磨：登录页 / 焦点圈 / 动效降级
   ========================================================================== */

.login-card {
  position: relative;
  border-radius: 20px;
  border-color: #dfe6f8;
  box-shadow: 0 2px 8px rgba(20, 32, 84, 0.06), 0 40px 80px -50px rgba(20, 32, 84, 0.85);
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #22d3ee, #6366f1 42%, #a855f7 72%, #ec4899);
}
.login-card h1 { font-weight: 800; }
.login-card .btn-primary { height: 40px; justify-content: center; font-size: 14px; }

/* 键盘操作时的焦点圈统一成品牌色（鼠标点不出现，不吵） */
a:focus-visible,
button:focus-visible,
.chip:focus-visible,
.mc-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 8px;
}

/* 系统开了「减少动态效果」就全停掉，别晃眼睛 */
@media (prefers-reduced-motion: reduce) {
  .topbar::after,
  .mh-orbit { animation: none; }
  .mc,
  .mc-emoji,
  .mc-btn,
  .btn { transition: none; }
  .mc:hover { transform: none; }
  .mc:hover .mc-emoji { transform: none; }
}

/* 窄屏：导航别把顶栏挤爆（人多了菜单项也多），横向滚动代替换行 */
@media (max-width: 1180px) {
  .topbar-inner { gap: 12px; padding: 0 14px; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 9px; font-size: 13px; white-space: nowrap; }
  .topstat { display: none; }
}

/* ==========================================================================
   年轻化 v3：更亮的配色、更圆更弹的卡片、每阶一个颜色（像闯关地图）
   底色仍然保持浅，保证长时间读题不累。
   ========================================================================== */

:root {
  --pink: #f472b6;
  --lime: #84cc16;
  --amber: #f59e0b;
  --mint: #2dd4bf;
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 背景：柔光极光 + 点阵（比网格更活一点） ---------- */
body::before {
  background:
    radial-gradient(760px 460px at 6% -6%, rgba(129, 140, 248, 0.34), transparent 62%),
    radial-gradient(680px 420px at 96% -4%, rgba(56, 189, 248, 0.3), transparent 60%),
    radial-gradient(720px 460px at 78% 104%, rgba(244, 114, 182, 0.22), transparent 62%),
    radial-gradient(600px 420px at 18% 96%, rgba(45, 212, 191, 0.22), transparent 62%),
    linear-gradient(180deg, #eef2ff 0%, #f0f0fd 46%, #eef5ff 100%);
}

body::after {
  opacity: 0.9;
  background-image: radial-gradient(rgba(99, 102, 241, 0.16) 1.1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

/* ---------- 顶栏：加一层细碎星光 ---------- */
.topbar {
  background-image:
    radial-gradient(1px 1px at 18px 12px, rgba(255, 255, 255, 0.55), transparent 1.6px),
    radial-gradient(1.2px 1.2px at 76px 32px, rgba(190, 220, 255, 0.5), transparent 2px),
    radial-gradient(1px 1px at 124px 9px, rgba(255, 255, 255, 0.42), transparent 1.6px),
    radial-gradient(1.4px 1.4px at 168px 36px, rgba(216, 180, 254, 0.5), transparent 2.2px),
    radial-gradient(1px 1px at 214px 22px, rgba(255, 255, 255, 0.36), transparent 1.6px),
    radial-gradient(520px 140px at 14% 0%, rgba(56, 189, 248, 0.28), transparent 70%),
    radial-gradient(520px 140px at 84% 0%, rgba(192, 132, 252, 0.3), transparent 70%),
    linear-gradient(115deg, #070d20 0%, #131c40 46%, #1d1046 100%);
  background-size:
    230px 46px, 230px 46px, 230px 46px, 230px 46px, 230px 46px,
    100% 100%, 100% 100%, 100% 100%;
}

.brand-mark {
  border-radius: 11px;
  box-shadow: 0 8px 20px -8px rgba(129, 140, 248, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

/* ---------- 卡片：更圆一点，阴影更柔 ---------- */
.panel {
  border-radius: 20px;
  border-color: #e6ebfa;
  box-shadow: 0 1px 3px rgba(23, 32, 84, 0.05), 0 22px 44px -38px rgba(30, 41, 110, 0.85);
}

.panel-head h2 {
  position: relative;
  padding-left: 16px;
}
.panel-head h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

/* ---------- 分区标签：胶囊 + 渐变选中 ---------- */
.track-tabs {
  background: rgba(255, 255, 255, 0.72);
  border-color: #e6ebfa;
  border-radius: 999px;
  padding: 6px;
  gap: 4px;
  backdrop-filter: blur(8px);
}
.track-tab {
  border-radius: 999px;
  font-weight: 600;
  padding: 7px 16px;
  transition: background 0.16s, color 0.16s, box-shadow 0.2s, transform 0.16s var(--bounce);
}
.track-tab:hover { background: #eef2ff; transform: translateY(-1px); }
.track-tab.on {
  background: linear-gradient(135deg, #6366f1, #8b5cf6 60%, #a855f7);
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(99, 102, 241, 0.95);
}

/* ---------- 学习路径：每阶一个颜色，像一张闯关地图 ---------- */
.stage-grid { gap: 12px; }

.stage-card {
  --c1: #6366f1;
  --c2: #8b5cf6;
  border-radius: 16px;
  border-color: #e8edfb;
  padding: 12px 13px 13px;
  background: linear-gradient(180deg, #ffffff, #fafbff);
  transition: transform 0.2s var(--bounce), box-shadow 0.2s, border-color 0.2s;
}
.stage-card:nth-child(10n + 1) { --c1: #6366f1; --c2: #8b5cf6; }
.stage-card:nth-child(10n + 2) { --c1: #3b82f6; --c2: #06b6d4; }
.stage-card:nth-child(10n + 3) { --c1: #06b6d4; --c2: #2dd4bf; }
.stage-card:nth-child(10n + 4) { --c1: #10b981; --c2: #84cc16; }
.stage-card:nth-child(10n + 5) { --c1: #65a30d; --c2: #facc15; }
.stage-card:nth-child(10n + 6) { --c1: #f59e0b; --c2: #fb923c; }
.stage-card:nth-child(10n + 7) { --c1: #f97316; --c2: #ef4444; }
.stage-card:nth-child(10n + 8) { --c1: #ef4444; --c2: #ec4899; }
.stage-card:nth-child(10n + 9) { --c1: #ec4899; --c2: #a855f7; }
.stage-card:nth-child(10n + 10) { --c1: #8b5cf6; --c2: #6366f1; }

.stage-card .sc-idx { color: var(--c1); font-weight: 800; letter-spacing: 0; }
.stage-card .sc-name { font-weight: 700; }
.stage-card .sc-bar {
  height: 6px;
  border-radius: 99px;
  background: #eef1fa;
}
.stage-card .sc-bar i {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
}

.stage-card:hover {
  transform: translateY(-4px);
  border-color: var(--c1);
  box-shadow: 0 16px 28px -20px var(--c1);
}

.stage-card.on {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  border-color: transparent;
  box-shadow: 0 18px 32px -18px var(--c1);
}
.stage-card.on .sc-idx,
.stage-card.on .sc-name { color: #fff; }
.stage-card.on .sc-num,
.stage-card.on .sc-foot { color: rgba(255, 255, 255, 0.85); }
.stage-card.on .sc-bar { background: rgba(255, 255, 255, 0.34); }
.stage-card.on .sc-bar i { background: #fff; }
.stage-card.on:hover { transform: translateY(-4px); }

/* ---------- 题目列表：圆一点，通过的行淡绿 ---------- */
.problem-row {
  border-radius: 12px;
  border-color: #e9edf9;
  transition: transform 0.15s var(--bounce), border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.problem-row:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  background: #f7f8ff;
  box-shadow: 0 8px 18px -14px rgba(79, 70, 229, 0.8);
}
.problem-row.is-ac {
  background: linear-gradient(180deg, #f6fefa, #ebfaf1);
  border-color: #d6f2e2;
}
.problem-row.is-ac:hover { background: linear-gradient(180deg, #f0fdf7, #e3f8ec); border-color: #b3e6c9; }

/* ---------- 按钮 / 输入框：更圆，按下去有回弹 ---------- */
.btn {
  border-radius: 12px;
  transition: transform 0.16s var(--bounce), background 0.16s, border-color 0.16s, box-shadow 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #7c3aed 52%, #a855f7);
  box-shadow: 0 10px 22px -14px rgba(109, 40, 217, 0.95);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7c7ff5, #8b5cf6 52%, #b366f8);
  box-shadow: 0 14px 26px -14px rgba(109, 40, 217, 0.95);
}
.btn:active { transform: translateY(1px) scale(0.99); }

.input { border-radius: 12px; }

/* ---------- 滚动条：圆润一点 ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c7d2fe, #bfdbfe);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #a5b4fc, #93c5fd); background-clip: content-box; }

/* ==========================================================================
   游戏化：等级徽章 / 战绩卡 / 关卡星级 / 撒花
   ========================================================================== */

/* ---- 顶栏等级徽章 ---- */
.lv-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font: 800 11px/1 var(--sans);
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #22d3ee, #6366f1 52%, #a855f7);
  box-shadow: 0 6px 14px -8px rgba(99, 102, 241, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.lv-chip[hidden] { display: none; }

/* ---- 用户菜单里的战绩卡 ---- */
.game-card {
  margin: 2px 0 6px;
  padding: 10px 11px 9px;
  border-radius: 14px;
  color: #e9eeff;
  background:
    radial-gradient(220px 90px at 90% -20%, rgba(168, 85, 247, 0.45), transparent 65%),
    linear-gradient(140deg, #131b3c, #1d1244);
  box-shadow: inset 0 0 0 1px rgba(150, 180, 255, 0.16);
}
.game-card[hidden] { display: none; }

.gc-top { display: flex; align-items: center; gap: 9px; }
.gc-ava {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.gc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.gc-main b { color: #fff; font-size: 12.5px; }
.gc-main em { font-style: normal; font-size: 11px; color: #9db0da; }
/* 段位名后面跟一个小徽章式的等级，不再塞进副标题换行 */
.gc-lv {
  font-style: normal;
  font-weight: 700;
  font-size: 10.5px;
  color: #c7d6ff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 1px;
  white-space: nowrap;
}
.gc-fire {
  flex: none;
  font-size: 11.5px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.16);
  padding: 3px 8px;
  border-radius: 999px;
}
.gc-bar {
  margin: 9px 0 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
/* 2026-11-16 重排：两行「标签 + 进度条 + 数值」，文字不再挤在一行里换行 */
.gc-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.gc-row .gc-bar { flex: 1; min-width: 0; margin: 0; }
.gc-k { flex: none; font-size: 10.5px; color: #8ea0c8; }
.gc-v {
  flex: none;
  font-size: 10.5px;
  color: #b7c5e8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gc-bar-t i { background: linear-gradient(90deg, #f59e0b, #fb923c); }
.gc-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #22d3ee, #818cf8 55%, #c084fc);
  transition: width 0.45s var(--bounce);
}

/* ---- 关卡卡片的星星 ---- */
.stage-card .sc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sc-stars { display: inline-flex; gap: 1px; font-size: 11px; letter-spacing: 0.5px; flex: none; }
.sc-stars i { font-style: normal; color: rgba(148, 163, 184, 0.45); transition: color 0.2s; }
.sc-stars i.on { color: #fbbf24; text-shadow: 0 0 7px rgba(251, 191, 36, 0.6); }
.stage-card.on .sc-stars i { color: rgba(255, 255, 255, 0.42); }
.stage-card.on .sc-stars i.on { color: #fff; text-shadow: 0 0 9px rgba(255, 255, 255, 0.85); }

/* ---- 排行榜的等级 / 段位小标 ---- */
.ru-lv {
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 4px 10px -8px rgba(99, 102, 241, 0.95);
}
.ru-title {
  margin-left: 5px;
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef1fe;
  color: #4b5680;
  white-space: nowrap;
}
.rank-me .ru-title { background: #fff3d6; color: #8a5b00; }

/* ---- 撒花 ---- */
.confetti-cv {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .gc-bar i { transition: none; }
}

/* 代码编辑器里的语言下拉（写笔记插代码时可选 C++ / Python / 纯文本） */
.code-tools .ccc-lang {
  flex: none;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.code-tools .ccc-lang:focus { outline: 2px solid #6366f1; outline-offset: 1px; }

/* ==========================================================================
   题库：关卡地图（关卡节点 + 连线）· 今日任务卡
   ========================================================================== */

/* ---- 关卡地图：横向排开，节点之间用虚线/霓虹线连起来 ---- */
.lmap {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  padding: 22px 6px 14px;
  scrollbar-width: thin;
}
.lmap-node {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 4px 6px;
  background: none;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s var(--bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
}
.lmap-node:hover { transform: translateY(-4px); }

.lm-orb {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--c1, #6366f1) calc(var(--p, 0) * 1%), #e8edfa 0);
  box-shadow: 0 10px 20px -14px rgba(24, 36, 90, 0.9);
  transition: box-shadow 0.2s, background 0.2s;
}
.lm-orb::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
  transition: background 0.2s;
}
.lm-orb b {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c1, #4f46e5);
}
.lmap-node:hover .lm-orb { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.10), 0 14px 26px -14px var(--c1, #6366f1); }
.lmap-node.on .lm-orb {
  background: var(--c1, #6366f1);
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.14), 0 16px 30px -12px var(--c1, #6366f1);
}
.lmap-node.on .lm-orb::after { background: linear-gradient(140deg, var(--c1, #6366f1), var(--c2, #22d3ee)); }
.lmap-node.on .lm-orb b { color: #fff; }
.lmap-node.clear .lm-orb b::after { content: '✓'; font-size: 9px; margin-left: 1px; vertical-align: super; }

.lm-idx { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.lm-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  max-width: 112px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lm-sub { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lmap-node .sc-stars { font-size: 11px; margin-top: 1px; }
.lmap-node.on .lm-idx,
.lmap-node.on .lm-sub { color: var(--c1, #4f46e5); }

/* 节点之间的连线：没通关是虚线，通关了变成霓虹渐变 */
.lm-link {
  flex: 1 0 26px;
  min-width: 18px;
  height: 4px;
  margin-top: 29px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #dde4f6 0 6px, transparent 6px 11px);
  align-self: flex-start;
  transition: background 0.25s;
}
.lm-link.done {
  background: linear-gradient(90deg, #22d3ee, #6366f1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.45);
}

/* 每关一个色相（11 个一循环：第 1 个「全部」是灰色） */
.lmap-node:nth-of-type(11n + 1) { --c1: #94a3b8; --c2: #cbd5e1; }
.lmap-node:nth-of-type(11n + 2) { --c1: #6366f1; --c2: #818cf8; }
.lmap-node:nth-of-type(11n + 3) { --c1: #0ea5e9; --c2: #38bdf8; }
.lmap-node:nth-of-type(11n + 4) { --c1: #06b6d4; --c2: #22d3ee; }
.lmap-node:nth-of-type(11n + 5) { --c1: #10b981; --c2: #34d399; }
.lmap-node:nth-of-type(11n + 6) { --c1: #84cc16; --c2: #a3e635; }
.lmap-node:nth-of-type(11n + 7) { --c1: #f59e0b; --c2: #fbbf24; }
.lmap-node:nth-of-type(11n + 8) { --c1: #f97316; --c2: #fb923c; }
.lmap-node:nth-of-type(11n + 9) { --c1: #f43f5e; --c2: #fb7185; }
.lmap-node:nth-of-type(11n + 10) { --c1: #a855f7; --c2: #c084fc; }
.lmap-node:nth-of-type(11n + 11) { --c1: #8b5cf6; --c2: #a78bfa; }

/* ---- 今日任务：深空底 + 两条任务 ---- */
.daily-card {
  margin: 0 0 16px;
  padding: 15px 18px 16px;
  border-radius: 18px;
  color: #eef2ff;
  background: linear-gradient(135deg, #0b1330, #17224b 55%, #241a4d);
  border: 1px solid rgba(124, 150, 255, 0.22);
  box-shadow: 0 20px 44px -30px rgba(10, 16, 40, 0.95);
}
.dc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dc-title { font-weight: 800; font-size: 15px; letter-spacing: 0.01em; }
.dc-day { font-size: 11.5px; color: #9fb0d8; }
.dc-sum { font-size: 12.5px; color: #b9c6e8; margin-left: auto; }
.dc-sum b { color: #fde68a; font-size: 13px; }
.dc-list { display: grid; gap: 8px; }
.dc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.2s, border-color 0.2s;
}
.dc-item.is-done { background: rgba(34, 211, 238, 0.10); border-color: rgba(34, 211, 238, 0.30); }
.dc-item.is-claimed { opacity: 0.7; }
.dc-emoji { font-size: 20px; line-height: 1; }
.dc-main { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dc-main b { font-size: 13.5px; font-weight: 700; }
.dc-hint { font-size: 11.5px; color: #93a3c9; }
.dc-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.10); overflow: hidden; }
.dc-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #22d3ee, #6366f1); transition: width 0.3s; }
.dc-prog { font-size: 12px; color: #cbd5f5; font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; flex: none; }
.dc-btn {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: #dbe4ff;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: transform 0.15s var(--bounce, ease), box-shadow 0.2s;
}
.dc-btn.on {
  color: #06122c;
  background: linear-gradient(135deg, #7ef0ff, #a9b6ff);
  border-color: transparent;
  box-shadow: 0 8px 18px -10px rgba(126, 240, 255, 0.9);
}
.dc-btn.on:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -10px rgba(126, 240, 255, 0.95); }
.dc-btn:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 640px) {
  .dc-item { flex-wrap: wrap; }
  .dc-main { flex-basis: 100%; }
  .dc-prog { margin-left: auto; }
}

/* ---- 个人主页：成就徽章墙 ---- */
.ub-badges { padding: 16px 18px 18px; }
.bd-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bd-head h2 { font-size: 15px; font-weight: 800; }
.bd-count { font-size: 12.5px; color: var(--muted); }
.bd-count b { color: #4f46e5; font-size: 15px; font-weight: 800; }
.bd-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.bd-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
}
.bd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px 12px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(180deg, #f6f8ff, #eef2ff);
  border: 1px solid #e3e9fb;
  filter: grayscale(1);
  opacity: 0.6;
  transition: transform 0.18s var(--bounce, ease), box-shadow 0.2s, filter 0.2s, opacity 0.2s;
}
.bd.on {
  filter: none;
  opacity: 1;
  background: linear-gradient(180deg, #fff, #f4f7ff);
  border-color: #cfd9fb;
  box-shadow: 0 12px 26px -20px rgba(79, 70, 229, 0.9);
}
.bd.on.t-gold {
  border-color: #f3d290;
  background: linear-gradient(180deg, #fffdf5, #fff4dc);
  box-shadow: 0 12px 26px -18px rgba(217, 155, 22, 0.85);
}
.bd.on.t-silver {
  border-color: #cdd8ea;
  background: linear-gradient(180deg, #fbfcff, #eef3fb);
}
.bd-emoji { font-size: 26px; line-height: 1; }
.bd.on .bd-emoji { filter: drop-shadow(0 4px 6px rgba(20, 30, 80, 0.14)); }
.bd-name { font-size: 12.5px; font-weight: 700; }
.bd-desc { font-size: 11px; color: var(--muted); line-height: 1.3; min-height: 29px; }
.bd-stamp {
  font-size: 10.5px;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 6px;
  padding: 2px 7px;
}
.bd.t-gold .bd-stamp { color: #a16207; background: #fdf3d6; }
.bd-bar { width: 100%; height: 4px; border-radius: 2px; background: #e6ebf8; overflow: hidden; }
.bd-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a5b4fc, #818cf8); }
.bd-prog { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bd.on:hover { transform: translateY(-3px); }

/* 侧栏徽章墙：一行 3 个，去掉长描述，只留形象 + 名字 + 进度 */
.ub-side .ub-badges { padding: 14px 12px 12px; }
.ub-side .bd-head { gap: 8px; margin-bottom: 10px; }
.ub-side .bd-head h2 { font-size: 14px; }
.ub-side .bd-hint { display: none; }
.ub-side .bd-wall {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.ub-side .bd { padding: 10px 4px 9px; border-radius: 11px; gap: 3px; }
.ub-side .bd-emoji { font-size: 22px; }
.ub-side .bd-name { font-size: 11px; line-height: 1.25; }
.ub-side .bd-desc { display: none; }
.ub-side .bd-stamp { font-size: 9.5px; padding: 1px 5px; }
.ub-side .bd-bar { height: 3px; }
.ub-side .bd-prog { font-size: 9.5px; }
.ub-side .bd-head-sub { margin-top: 14px; }
.ub-side .ub-honors { gap: 6px; margin-top: 8px; }
.ub-side .ub-honor { font-size: 10.5px; padding: 2px 7px; }

/* ---- 排行榜：总榜 / 赛季榜切换 ---- */
.rank-tabs { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.rank-tabs .spacer { flex: 1; }
.rank-tab {
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.18s var(--bounce, ease);
}
.rank-tab:hover { color: var(--ink); transform: translateY(-1px); }
.rank-tab.on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #22d3ee);
  box-shadow: 0 10px 22px -14px rgba(79, 70, 229, 0.95);
}

/* 赛季横幅 */
.season-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 14px;
  border-radius: 18px;
  color: #eef2ff;
  background: radial-gradient(120% 140% at 12% 0%, #1e2a6b 0%, #0d1330 55%, #1b1240 100%);
  border: 1px solid rgba(124, 150, 255, 0.22);
  box-shadow: 0 22px 48px -34px rgba(8, 14, 40, 0.95);
}
.sh-left { flex: 1; min-width: 0; }
.sh-label { font-size: 11.5px; letter-spacing: 0.08em; color: #8fa2d8; text-transform: uppercase; }
.sh-title { font-size: 21px; font-weight: 800; margin: 4px 0 6px; letter-spacing: -0.01em; }
.sh-sub { font-size: 13px; color: #b9c6e8; }
.sh-sub b { color: #fde68a; }
.sh-right { text-align: right; flex: none; }
.sh-days { display: flex; align-items: baseline; gap: 5px; justify-content: flex-end; }
.sh-days b { font-size: 30px; font-weight: 800; color: #7ef0ff; line-height: 1; }
.sh-days span { font-size: 12px; color: #9fb0d8; }
.sh-tip { font-size: 11px; color: #7d8dbb; margin-top: 4px; }

/* 上赛季前三 */
.season-prev {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(100deg, #fffbeb, #fff7e2);
  border: 1px solid #f3e3b5;
}
.season-prev .sp-title { font-size: 12.5px; font-weight: 800; color: #a16207; }
.season-prev .sp-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #f0e0b4;
  color: #7c5a12;
  font-size: 12.5px;
  text-decoration: none;
  transition: transform 0.15s;
}
.season-prev .sp-item:hover { transform: translateY(-1px); }
.season-prev .sp-item em { font-style: normal; color: #a98b45; font-size: 11.5px; }
.season-prev .sp-medal { font-size: 13px; }

/* 赛季称号小胶囊 */
.ru-season {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  background: #f3ebff;
  border: 1px solid #e2d3ff;
  vertical-align: 1px;
}
.ru-season.t-gold { color: #a16207; background: #fff6dd; border-color: #f2dfa8; }
.ru-season.t-silver { color: #4a5f8a; background: #eef4ff; border-color: #d6e2fa; }

@media (max-width: 640px) {
  .season-hero { flex-direction: column; align-items: flex-start; }
  .sh-right { text-align: left; }
  .sh-days { justify-content: flex-start; }
}

/* ---------- 品牌字标：拉丁字母 C，换拉丁字体栈并放大一点，字形才不显小 ---------- */
.brand-mark {
  font: 800 16px/28px ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  padding-right: 0.5px;
}

/* ==========================================================================
   简约风（默认皮肤）
   思路：纯浅底 + 单一主色 + 细边框 + 小圆角，不要渐变、光晕、玻璃、装饰动效。
   这一层只覆盖视觉，不动结构；想恢复科技风，把这一整段删掉即可。
   ========================================================================== */

:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-soft: #f0f2f5;
  --text: #1f2937;
  --text-2: #475569;
  --muted: #64748b;
  --ink: #1f2937;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eef4ff;
  --cy: #2563eb;
  --vi: #2563eb;
  --pk: #2563eb;
  --glow: none;
  --radius: 8px;
  --shadow-sm: none;
  --shadow: none;
}

html { background: #f7f8fa !important; }
body { background: transparent !important; }

/* 去掉极光、网格、点阵背景 */
body::before,
body::after { display: none !important; }

/* ---------------- 顶栏：白底一条细线 ---------------- */
.topbar {
  background: #ffffff !important;
  background-image: none !important;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.topbar::after { display: none !important; }

.brand-mark {
  background: #2563eb !important;
  box-shadow: none !important;
  border-radius: 6px !important;
}
.brand-text strong { color: #1f2937 !important; letter-spacing: 0 !important; }
.brand-text em { color: #64748b !important; }

/* 左上角 LOGO 现在跳官网（`index.html` 里 href="/"）：不给反馈的话看不出能点 */
.brand {
  transition: opacity 0.15s ease;
}
.brand:hover .brand-text strong { color: #2563eb !important; }
.brand:hover .brand-mark { background: #1d4ed8 !important; }
.brand:active { opacity: 0.72; }

.nav a { color: #475569 !important; border-radius: 6px !important; }
.nav a:hover { background: #f1f5f9 !important; color: #1f2937 !important; }
.nav a.active {
  background: #eef4ff !important;
  color: #2563eb !important;
  box-shadow: none !important;
}
.nav-badge,
.nav a:hover .nav-badge,
.nav a.active .nav-badge { color: #e5484d !important; background: none !important; box-shadow: none !important; }

.topstat, .topstat em { color: #64748b !important; }
.topstat b { color: #1f2937 !important; }
.topstat .tp-points { color: #b45309 !important; }
.sfx-btn,
.user-chip {
  background: #f7f8fa !important;
  border-color: #e5e7eb !important;
  color: #475569 !important;
}
.sfx-btn:hover,
.user-chip:hover { background: #eef1f6 !important; border-color: #d8dee8 !important; }
.user-chip .uinfo b { color: #1f2937 !important; }
.user-chip .uinfo em { color: #64748b !important; }

/* ---------------- 通用：白卡片、细边框、无阴影 ---------------- */
.panel,
.login-card,
.chero,
.mall-bar,
.mc {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.login-card::before,
.chero::before,
.mall-hero::before,
.mall-hero::after { display: none !important; }

.panel-head h2::before {
  width: 3px !important;
  height: 14px !important;
  border-radius: 2px !important;
  background: #2563eb !important;
  box-shadow: none !important;
}
.page-head h1,
.panel-head h2,
.login-card h1 { font-weight: 600 !important; letter-spacing: 0 !important; }
.page-head h1 { font-size: 20px !important; }
.page-head h1::before {
  width: 3px !important;
  border-radius: 2px !important;
  background: #2563eb !important;
  box-shadow: none !important;
}

.btn {
  border-radius: 6px !important;
  font-weight: 500 !important;
  background: #ffffff !important;
  border-color: #d9dee8 !important;
  color: #334155 !important;
  box-shadow: none !important;
}
.btn:hover { background: #f3f5f8 !important; border-color: #c9d1de !important; transform: none !important; }
.btn-primary,
.btn-primary:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
.btn-danger { background: #fff5f5 !important; border-color: #f3c9c9 !important; color: #c53030 !important; }
.btn-danger:hover { background: #ffecec !important; }

.input,
.mall-sel,
select.input { border-radius: 6px !important; }
.input:focus,
input:focus,
textarea:focus,
select:focus,
.mall-search:focus-within {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important;
  outline: none !important;
}
.chip,
.track-tab,
.rank-tab,
.mall-sel { border-radius: 6px !important; }
.chip.on,
.track-tab.on,
.rank-tab.on {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}
.track-tabs {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  backdrop-filter: none !important;
}
.track-tab:hover,
.rank-tab:hover { background: #f1f5f9 !important; transform: none !important; }
.rank-tab { font-weight: 500 !important; height: 30px !important; }
::-webkit-scrollbar-thumb { background: #d8dee8 !important; }
::-webkit-scrollbar-thumb:hover { background: #c2cbd8 !important; }

/* ---------------- 课程商城：浅色封面，去掉装饰 ---------------- */
.mall-hero,
.daily-card,
.season-hero,
.game-card {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: #1f2937 !important;
}
.mall-hero { padding: 20px 24px !important; }
.mall-hero h1 {
  background: none !important;
  -webkit-text-fill-color: #1f2937 !important;
  color: #1f2937 !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}
.mall-kicker { color: #2563eb !important; letter-spacing: 0.12em !important; }
.mall-hero p,
.mall-hero-stats,
.dc-day, .dc-sum, .dc-hint, .dc-prog,
.sh-label, .sh-sub, .sh-days span, .sh-tip,
.gc-main b, .gc-main em, .gc-k, .gc-v, .cse-lock-tip { color: #64748b !important; }
.mall-hero-stats b,
.dc-sum b, .dc-title, .dc-main b,
.sh-sub b, .sh-title, .sh-days b { color: #1f2937 !important; }
.sh-title { font-size: 18px !important; font-weight: 600 !important; }
.mall-hero-art, .mh-orbit { display: none !important; }
.mh-emoji { filter: none !important; }

.mall-search { background: #f7f8fa !important; border: 1px solid #e5e7eb !important; border-radius: 6px !important; }
.mall-search:focus-within { background: #ffffff !important; }
.mall-grid { gap: 14px !important; }

.mc { transition: border-color 0.12s !important; }
.mc:hover { transform: none !important; border-color: #c7d7f7 !important; box-shadow: none !important; }
.mc-cover,
.chero-cover {
  background: #f1f4f9 !important;
  box-shadow: none !important;
  border-radius: 6px !important;
}
.mc-cover { border-radius: 0 !important; }
.mc-cover::before,
.mc-cover::after,
.chero-cover::after { display: none !important; }
.mc-emoji { filter: none !important; transition: none !important; }
.mc:hover .mc-emoji { transform: none !important; }
.mc-lv, .mc-num, .mc-lock, .mc-done {
  border-radius: 4px !important;
  backdrop-filter: none !important;
  font-weight: 500 !important;
}
.mc-lv { background: #ffffff !important; color: #1f2937 !important; border: 1px solid #e5e7eb !important; }
.mc-num { background: #f1f4f9 !important; color: #475569 !important; }
.mc-lock { background: #fff8e6 !important; color: #92610a !important; }
.mc-done { background: #e6f7ee !important; color: #0f7a45 !important; }
.mc-bar { background: #e9edf4 !important; height: 3px !important; }
.mc-bar i { background: #2563eb !important; }
.mc.is-locked .mc-cover { filter: none !important; }

/* ---------------- 学习路径 / 关卡地图：统一一个主色 ---------------- */
.stage-card,
.lmap-node { --c1: #2563eb !important; --c2: #2563eb !important; }
.stage-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
}
.stage-card:hover,
.stage-card.on:hover { transform: none !important; box-shadow: none !important; border-color: #c7d7f7 !important; }
.stage-card.on {
  background: #eef4ff !important;
  border-color: #c7d7f7 !important;
  box-shadow: none !important;
}
.stage-card.on .sc-idx,
.stage-card.on .sc-name { color: #1f2937 !important; }
.stage-card.on .sc-num,
.stage-card.on .sc-foot { color: #475569 !important; }
.stage-card.on .sc-bar { background: #dbe3f3 !important; }
.stage-card.on .sc-bar i { background: #2563eb !important; }
.stage-card .sc-bar i { background: #2563eb !important; }

.lmap-node:hover { transform: none !important; }
.lm-orb {
  background: conic-gradient(#2563eb calc(var(--p, 0) * 1%), #e9edf4 0) !important;
  box-shadow: none !important;
}
.lmap-node:hover .lm-orb { box-shadow: none !important; }
.lmap-node.on .lm-orb { background: #2563eb !important; box-shadow: none !important; }
.lmap-node.on .lm-orb::after { background: #2563eb !important; }
.lm-link.done { background: #2563eb !important; box-shadow: none !important; }
.lm-link { background: repeating-linear-gradient(90deg, #dde3ec 0 6px, transparent 6px 11px) !important; }

/* ---------------- 每日任务 / 徽章 / 赛季 ---------------- */
.dc-item {
  background: #f8fafc !important;
  border: 1px solid #ebeff4 !important;
  border-radius: 6px !important;
}
.dc-item.is-done { background: #eef4ff !important; border-color: #d5e2fb !important; }
.dc-bar { background: #e5eaf2 !important; }
.dc-bar i { background: #2563eb !important; }
.dc-btn {
  background: #ffffff !important;
  border: 1px solid #d9dee8 !important;
  border-radius: 6px !important;
  color: #334155 !important;
  font-weight: 500 !important;
}
.dc-btn.on,
.dc-btn.on:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}

.bd,
.bd.on,
.bd.on.t-gold,
.bd.on.t-silver {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
.bd.on { border-color: #c7d7f7 !important; }
.bd.on.t-gold { border-color: #e6cf94 !important; }
.bd.on:hover { transform: none !important; }
.bd.on .bd-emoji { filter: none !important; }
.bd-name, .bd-head h2, .dc-title { font-weight: 600 !important; }
.bd-bar { background: #e9edf4 !important; }
.bd-bar i { background: #2563eb !important; }
.bd-stamp { color: #2563eb !important; background: #eef4ff !important; border-radius: 4px !important; }
.bd.t-gold .bd-stamp { color: #92610a !important; background: #fdf3d6 !important; }

.lv-chip {
  background: #2563eb !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
}
.game-card { color: #1f2937 !important; }
.gc-ava { background: #f1f4f9 !important; box-shadow: none !important; }
.gc-bar { background: #e9edf4 !important; }
.gc-bar i { background: #2563eb !important; }
.gc-bar-t i { background: #f59e0b !important; }
.gc-lv { background: #eff4ff !important; color: #2563eb !important; }
.gc-fire { filter: none !important; }

.season-prev {
  background: #f8fafc !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
}
.season-prev .sp-item { border-color: #e5e7eb !important; color: #475569 !important; }
.ru-season { color: #2563eb !important; background: #eef4ff !important; border-color: #d5e2fb !important; }

/* 补几处零散的强调色：购买按钮、已通过行、等级标签 */
.mc-btn.is-go,
.mc-btn.is-buy {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: none !important;
  border-radius: 6px !important;
}
.mc-btn:hover { border-color: #c7d7f7 !important; background: #f3f6fc !important; color: #2563eb !important; }
.problem-row.is-ac,
.problem-row.is-ac:hover { background: #f2fbf6 !important; border-color: #d6f2e2 !important; }
.ru-lv {
  background: #eef4ff !important;
  color: #2563eb !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
.cse-lockbox { background: #f8fafc !important; border-color: #e5e7eb !important; box-shadow: none !important; }

/* 积分页 / 排行榜 / 比赛的彩色大标题块：改成淡蓝底 + 深色字 */
.points-hero,
.rank-hero,
.exam-head,
.exam-result .er-hero {
  background: #eef4ff !important;
  background-image: none !important;
  border: 1px solid #dbe6fb !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: #1f2937 !important;
}
.points-hero *, .rank-hero *, .exam-head *, .exam-result .er-hero * { color: #1f2937 !important; }
.ph-rules,
.exam-clock,
.er-tag {
  background: #ffffff !important;
  border: 1px solid #dbe6fb !important;
  border-radius: 6px !important;
}
.exam-clock.warn { background: #fff1f1 !important; border-color: #f6cccc !important; animation: none !important; }
.exam-clock.warn .ec-time { color: #b42318 !important; }
.ph-num, .rh-num, .er-score, .ec-time { font-weight: 600 !important; }
.avatar.r-admin { background: #2563eb !important; }
.avatar.r-teacher { background: #0f9d58 !important; }
.progress-lg span { background: #2563eb !important; }

/* 其它零碎彩色块统一成纯色 */
.pod-1 { background: #ffffff !important; }
.ex-card.is-doing { background: #ffffff !important; }
.chat-list, .dm-list { background: #ffffff !important; }
.bonus-card { background: #ffffff !important; border-color: #e5e7eb !important; }
.bonus-num {
  background: none !important;
  -webkit-text-fill-color: #2563eb !important;
  color: #2563eb !important;
  letter-spacing: -0.02em !important;
}
.bonus-unit { background: #2563eb !important; }
.cse-thumb, .cse-thumb.is-empty { background: #eef1f6 !important; }
.cse-bar i, .cf-bar i, .cse-bar2 i { background: #2563eb !important; }

/* 内置 100 个头像：选择弹窗里滚动，配一个搜索框 */
.av-picker .av-grid { max-height: min(52vh, 420px); overflow-y: auto; padding: 2px 6px 2px 2px; }
.av-picker .input { flex: none; }

/* 代码编辑器：常用符号快捷栏（手机 / 平板点一下插入，不用翻软键盘） */
.code-symbar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 8px;
  margin: 0 0 6px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.code-sym {
  flex: 0 0 auto;
  min-width: 32px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font: 500 15px/1 var(--mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.code-sym:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.code-sym:hover { border-color: #c7d7f7; background: #eef4ff; color: #2563eb; }
.code-sym:active { background: #dbeafe; }
.code-sym-tab { color: #2563eb; }
@media (max-width: 640px) {
  .code-symbar { padding: 6px; gap: 5px; }
  .code-sym { min-width: 38px; height: 36px; font-size: 16px; }
}



/* 代码编辑器：在线试跑面板（编译 + 运行，输入 stdin / 看输出；运行按钮在面板里） */
.code-run-panel {
  margin: 8px 0 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.code-run-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #fafbfc;
  border-bottom: 1px solid #e5e7eb;
}
.code-run-toggle {
  border: 0;
  background: none;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}
.code-run-toggle:hover { text-decoration: underline; }
.code-run-note { color: #94a3b8; font-size: 12px; }
.code-run-body { padding: 10px; }
.code-run-body[hidden] { display: none !important; }
.code-run-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
}
.code-run-col { display: flex; flex-direction: column; min-width: 0; }
.code-run-col > span { font-size: 12px; color: #475569; margin-bottom: 5px; }
.code-run-col em { font-style: normal; font-weight: 400; color: #94a3b8; }
.code-run-in {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  font: 13px/1.5 var(--mono);
  color: #334155;
  background: #fff;
  outline: none;
}
.code-run-in:focus { border-color: #93c5fd; }
.code-run-out {
  min-height: 108px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
}
.code-run-empty { color: #94a3b8; font-size: 12px; }
.code-run-loading { color: #2563eb; font-size: 12px; padding: 4px 0; }
.code-run-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}
.code-run-meta b { font-size: 13px; }
.code-run-meta.is-ok b, .code-run-status.is-ok { color: #15803d; }
.code-run-meta.is-bad b, .code-run-status.is-bad { color: #dc2626; }
.code-run-status.is-busy { color: #2563eb; }
.cr-label { font-size: 11px; color: #94a3b8; margin: 7px 0 3px; }
.cr-block {
  margin: 0;
  padding: 8px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12.5px/1.55 var(--mono);
}
.cr-out { background: #ffffff; border: 1px solid #e5e7eb; color: #24303f; }
.cr-err { background: #fff5f5; color: #b91c1c; border: 1px solid #fecaca; }
.cr-warn { color: #b45309; font-size: 12px; margin-top: 6px; }
.code-run-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.code-run-tip { color: #94a3b8; font-size: 12px; }
@media (max-width: 760px) {
  .code-run-cols { grid-template-columns: 1fr; }
  .code-run-note, .code-run-tip { display: none; }
}

/* 每日任务：搬进「我的作业」页，任务按列并排（不是一行一个） */
.dc-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}
.dc-list .dc-item { align-items: stretch; }

/* 每日任务设置（老师 / 管理员，作业管理页） */
.dc-cfg { display: grid; gap: 10px; }
.dc-cfg-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.dc-cfg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dc-cfg-head b { font-size: 13.5px; }
.dc-cfg-on { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.dc-cfg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #475569;
}
.dc-cfg-row label { display: inline-flex; align-items: center; gap: 6px; }
.dc-cfg-row .input { height: 30px; }
.dc-cfg-hint { flex: 1 1 220px; }
.dc-cfg-hint .input { width: 100%; }
.dc-cfg-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ============ 编辑器：工具栏挪到黑框下边 + 全屏（做题 / 作业 / 比赛共用） ============ */

/* 符号栏贴黑框上沿，工具栏贴黑框下沿，三块拼成一台「代码机」 */
.editor-panel > .code-symbar { margin-bottom: 6px; }
.editor-panel > .editor-toolbar .btn-primary { padding: 4px 14px; font-weight: 600; }

/* 底部工具栏：撤销 / 重做 / 复制 / 粘贴 / 重置 / 全屏 / 提交评测 全部挤在**同一行**，
   不许提交按钮被挤到第二行（右列窄也放得下：窄了就收掉快捷键提示和语言标识） */
.editor-panel > .editor-toolbar.is-foot { flex-wrap: nowrap; gap: 6px; padding: 7px 10px; }
.editor-toolbar.is-foot .spacer { flex: 1 1 auto; min-width: 0; }
.editor-toolbar.is-foot > .btn {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: nowrap;
}
.editor-toolbar.is-foot > .btn-icon { padding: 4px 7px; min-width: 27px; }
.editor-toolbar.is-foot > .btn-fs { min-width: 30px; padding: 4px 7px; font-size: 14px; }
.editor-toolbar.is-foot > .btn-primary { margin-left: 2px; white-space: nowrap; }

/* 右列窄的时候按「不重要的先收」的顺序让位：快捷键提示 → 保存提示 → 语言标识 */
@media (max-width: 1280px) {
  .editor-toolbar.is-foot .btn-primary .kbd { display: none; }
  .editor-toolbar.is-foot .exam-savehint { display: none; }
}
@media (max-width: 1120px) {
  .editor-toolbar.is-foot .lang-badge { display: none; }
}

/* 全屏按钮：进全屏后高亮，图标换成「收回」 */
.btn-fs { font-size: 15px; line-height: 1; padding: 5px 10px; min-width: 34px; justify-content: center; }
.btn-fs.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-fs.is-on:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* 全屏：整块面板钉在视口上，黑框吃掉工具栏之外的所有高度 */
.editor-panel.is-fs {
  position: fixed;
  inset: 0;
  z-index: 150;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  height: 100vh;
  max-height: 100vh;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
}
body.ed-fs { overflow: hidden; }
.editor-panel.is-fs .editor-toolbar,
.editor-panel.is-fs .code-symbar,
.editor-panel.is-fs .code-run-panel { flex: none; }
.editor-panel.is-fs .code-editor {
  flex: 1 1 auto;
  height: auto;
  min-height: 160px;
}
.editor-panel.is-fs .code-run-panel { margin: 8px 10px 10px; }
/* 全屏时试跑结果别把黑框压没了：面板内部自己滚 */
.editor-panel.is-fs .code-run-body { max-height: 32vh; overflow: auto; }
.editor-panel.is-fs .code-run-out { max-height: 22vh; overflow: auto; }

@media (max-width: 720px) {
  /* 手机这一行实在放不下：允许换行，「提交」独占一整行，拇指好按 */
  .editor-panel > .editor-toolbar.is-foot { flex-wrap: wrap; row-gap: 6px; }
  .editor-panel > .editor-toolbar .btn-primary { flex: 1 1 100%; justify-content: center; order: 9; padding: 9px 16px; }
  .editor-panel > .editor-toolbar .exam-savehint { display: none; }
}

/* 半屏 / 窄窗口（≤1180px）：上面那条 nowrap 会把按钮裁在窗口外
   （用户反馈「12s 后可提交」和后面的按钮被挡）——放不下就换行。
   必须写在 nowrap 规则之后，同特异性才能盖住它。 */
@media (max-width: 1180px) {
  .editor-panel > .editor-toolbar.is-foot { flex-wrap: wrap; row-gap: 6px; }
}

/* ============ 试卷（套卷）：题库的「按卷看」 ============ */

/* 题库 / 试卷 两个视图之间的切换 */
.view-switch { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; }
.vs-btn {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: all 0.15s;
}
.vs-btn:hover { border-color: var(--brand); color: var(--brand); }
.vs-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.vs-new { margin-left: auto; }

/* 分组 + 卡片墙 */
.paper-group { margin-bottom: 22px; }
.paper-group:last-child { margin-bottom: 4px; }
.pg-title {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--text);
}
.pg-title .muted { font-size: 12px; font-weight: 500; }
.paper-deck {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.paper-card {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  padding: 13px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); cursor: pointer; outline: none;
  transition: box-shadow 0.16s, border-color 0.16s, transform 0.16s;
}
.paper-card:hover, .paper-card:focus-visible {
  border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px);
}
.paper-card.is-clear { border-color: #bce3cd; background: linear-gradient(180deg, #f6fdf9, #fff 46%); }
.pc-top { display: flex; align-items: center; gap: 8px; }
.pc-badge {
  height: 19px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; letter-spacing: 0.02em;
}
.pc-badge.is-official { background: var(--brand-soft); color: var(--brand-dark); }
.pc-badge.is-custom { background: #fdf1e3; color: #b45309; }
.pc-track { font-size: 11.5px; color: var(--muted); }
.pc-title {
  margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-kinds { display: flex; flex-wrap: wrap; gap: 5px; min-height: 18px; }
.pk {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: var(--line-soft); color: var(--text-2);
}
.pk-choice { background: #eaf0ff; color: #1d54c9; }
.pk-multiple { background: #f1ecfd; color: #6d3fd4; }
.pk-judge { background: #e6f7ee; color: #0a7f43; }
.pk-reading { background: #fdf1e3; color: #96550b; }
.pk-program { background: #eef1f5; color: #475569; }
.pc-bar { height: 4px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.pc-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--brand); transition: width 0.3s; }
.paper-card.is-clear .pc-bar > span { background: var(--ac); }
.pc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--muted);
}
.pc-done { font-variant-numeric: tabular-nums; color: var(--text-2); }

/* 卷面 */
.paper-hero {
  display: flex; align-items: flex-start; gap: 22px; justify-content: space-between;
  padding: 18px 20px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.ph-main { min-width: 0; }
.ph-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-bottom: 8px;
  border-radius: 5px; background: var(--brand-soft); color: var(--brand-dark);
  font-size: 11.5px; font-weight: 700;
}
.ph-main h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.3; }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.ph-meta .pc-kinds { gap: 5px; }
.ph-note { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.ph-side { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.ph-ring {
  width: 74px; height: 74px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line-soft) 0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.ph-ring::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #fff;
}
.ph-ring b { position: relative; font-size: 15px; line-height: 1.1; }
.ph-ring span { position: relative; font-size: 10.5px; color: var(--muted); }
.ph-actions { display: flex; flex-direction: column; gap: 7px; }
.btn.danger { color: var(--wa); border-color: #f3c9cb; }
.btn.danger:hover { background: var(--wa-soft); }

.paper-sec { margin-bottom: 14px; }
.paper-rows { display: flex; flex-direction: column; }
.paper-row {
  display: grid; grid-template-columns: 34px 74px 1fr 74px 26px;
  align-items: center; gap: 10px; padding: 9px 4px;
  border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit;
  transition: background 0.12s;
}
.paper-row:first-child { border-top: 0; }
.paper-row:hover { background: #f7f9fd; }
.prow-no { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.prow-id { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.prow-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-row.is-ac .prow-title { color: var(--muted); }
.prow-st { text-align: center; }
.paper-tip { margin: 4px 2px 26px; font-size: 12.5px; }

/* 组卷器 */
.paper-form { margin-bottom: 14px; }
.pf-row { display: flex; flex-wrap: wrap; gap: 14px; }
.pf-row .field { display: flex; flex-direction: column; gap: 5px; min-width: 180px; }
.pf-row .field > span { font-size: 12px; color: var(--muted); }
.pf-row .pf-wide { flex: 1 1 260px; }
.paper-build { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pb-filter { display: flex; gap: 8px; padding: 0 0 10px; }
.pb-filter .input { height: 32px; }
.pb-filter #pbQ { flex: 1 1 auto; min-width: 0; }
.pb-list { max-height: 520px; overflow: auto; border-top: 1px solid var(--line-soft); }
.pick-row {
  display: grid; grid-template-columns: 22px 74px 1fr 62px 62px;
  align-items: center; gap: 9px; width: 100%; padding: 7px 4px;
  border: 0; border-bottom: 1px solid var(--line-soft); background: none;
  font: inherit; font-size: 13px; text-align: left; cursor: pointer; color: inherit;
}
.pick-row:hover { background: #f7f9fd; }
.pick-row.on { background: var(--brand-soft); }
.pick-box {
  width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted);
}
.pick-row.on .pick-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.pick-id { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pick-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-kind { font-size: 11.5px; color: var(--muted); }
.pb-items { max-height: 470px; overflow: auto; }
.basket-row {
  display: grid; grid-template-columns: 26px 1fr 62px 84px;
  align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.bk-no { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.bk-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-title b { font-family: var(--mono); font-weight: 600; color: var(--muted); font-size: 12px; margin-right: 5px; }
.bk-kind { font-size: 11.5px; color: var(--muted); }
.bk-ops { display: flex; gap: 4px; justify-content: flex-end; }
.mini {
  width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--text-2); font-size: 13px; line-height: 1; cursor: pointer;
}
.mini:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.mini:disabled { opacity: 0.4; cursor: default; }
.mini.danger:hover { border-color: var(--wa); color: var(--wa); }
.pb-foot { display: flex; gap: 8px; padding-top: 12px; }

@media (max-width: 900px) {
  .paper-build { grid-template-columns: 1fr; }
  .paper-hero { flex-direction: column; }
  .ph-side { width: 100%; justify-content: space-between; }
  .ph-actions { flex-direction: row; }
  .paper-row { grid-template-columns: 28px 66px 1fr 26px; }
  .paper-row .diff { display: none; }
  .pick-row { grid-template-columns: 22px 66px 1fr 56px; }
  .pick-row .diff { display: none; }
}

/* ============ 品牌页脚 / 登录页版权 ============ */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 1320px;
  margin: 4px auto 26px;
  padding: 0 22px;
  font-size: 12px;
  color: var(--muted);
}
.site-foot b { color: var(--text-2); font-weight: 700; }
.site-foot-dot { color: var(--line); }

.login-copy {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ============ 没有班级群时的空态 ============ */
.chat-panel.chat-noroom {
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.chat-panel.chat-noroom .chat-empty { padding: 0 24px; }
.chat-panel[hidden],
.chat-side[hidden] { display: none; }

/* ============ 登录记录（账号管理，v1.13.0） ============ */
/* 表格里的「最近登录」：上面一行时间 + 在线角标，下面一行设备 · IP */
.u-login { font-size: 12px; line-height: 1.45; }
.u-login .lg-time { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.u-login .lg-dev { color: var(--muted); font-size: 11.5px; }
.lg-on {
  display: inline-block;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: #e7f7ec;
  color: #0a7a41;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  white-space: nowrap;
  cursor: pointer;
}
.lg-on:hover { background: #d5f0de; }
.u-login .muted { color: var(--muted); }

/* 表格里逐条列出该账号的每一个登录点（多点登录时一眼看到几台设备） */
.u-login .lg-points { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; }
.lg-pt { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.lg-pt .dev-dot { width: 6px; height: 6px; }
.lg-pt-dev { max-width: 116px; overflow: hidden; text-overflow: ellipsis; }
.lg-pt em { font-style: normal; margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-pt-more { font-size: 11px; color: var(--muted); }
.lg-inline { color: var(--brand); }

/* 全站记录列表 */
.log-list { padding: 4px 0 2px; }
.log-rows { display: flex; flex-direction: column; }
.log-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { background: #fafbfc; }
.log-t {
  flex: none;
  min-width: 58px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  background: #f1f3f6;
  color: #64748b;
}
.log-t.ok { background: #e7f7ec; color: #0a7a41; }
.log-t.bad { background: #fdeaea; color: #b42318; }
.log-t.warn { background: #fff4e5; color: #9a5b00; }
.log-at { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-who { display: inline-flex; align-items: baseline; gap: 5px; min-width: 120px; }
.log-who b { font-weight: 600; color: var(--text); }
.log-who em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.log-dev { color: var(--text-2); }
.log-ip { color: var(--muted); font-variant-numeric: tabular-nums; }
.log-note { color: var(--muted); font-size: 12px; }

/* 单账号弹窗：在线设备 + 历史 */
.log-modal .modal-body { max-height: 70vh; overflow: auto; }
.log-sec { margin-bottom: 18px; }
.log-sec:last-child { margin-bottom: 4px; }
.log-sec-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.log-sec-h b { color: var(--brand); font-size: 15px; }
.log-sec-h .muted { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.dev-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.dev-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
}
.dev-row:last-child { border-bottom: none; }
.dev-row b { color: var(--text); font-weight: 600; }
.dev-row.is-self { background: #f6fbff; }
.dev-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; min-width: 240px; }
.dev-times { display: flex; flex-direction: column; gap: 1px; color: var(--muted); font-size: 11.5px; }
.dev-times em { font-style: normal; color: var(--text-2); }
.dev-tag {
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  background: #f1f3f6;
  color: #64748b;
}
.dev-tag.on { background: #e7f7ec; color: #0a7a41; }
.dev-tag.self { background: #e8f0fe; color: #1a56db; }
.dev-id {
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.dev-kick { margin-left: auto; flex: none; }
.dev-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex: none; }
.dev-dot.idle { background: #cbd5e1; }
.dev-ip { color: var(--muted); font-variant-numeric: tabular-nums; }
.dev-seen { color: var(--muted); }


/* ==========================================================================
   登录 / 注册页：简约版（2026-11-13）
   · 老版是「流光玻璃」：4 块 filter:blur(64px) 的大色斑跑 30s 无限动画、
     两个 conic 弧环旋转、3 个浮球 + 2 个星点各自动画，登录卡片还挂着
     backdrop-filter:blur(18px)。这是 fixed 全屏层，滚动时浏览器每帧都要
     重新模糊整屏，集显 / 学校机房上就是「刚打开卡一下、上下滑一下卡一下」。
     整层已删除（不是 display:none，是连 DOM 都不再生成了）。
   · 现在卡片长相直接沿用上面「简约风」那套（白底 / 细边框 / 无阴影），
     这里只补一个定位和窄屏内边距，不再重复定义颜色。
   ========================================================================== */
.login-wrap { position: relative; }
.login-card { position: relative; z-index: 2; }

@media (max-width: 720px) {
  .login-card { padding: 22px 18px 20px; }
}

/* ==========================================================================
   性能收尾：全站不要「玻璃」效果
   · backdrop-filter 在滚动时每帧都要重新采样身后的像素 —— 顶栏、sticky 底栏、
     弹层上的模糊在集显机器上是掉帧的常见来源，而白卡片本来也不需要半透明。
   · 半透明的元素顺带改成实色，否则去掉模糊后会露出背景、字反而不清楚。
   ========================================================================== */
* { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.save-bar { background: #ffffff !important; }

/* 首屏占位：HTML 里就写死的「正在加载…」
   app.js 解析完 + 首屏数据回来之前，页面原本是一片白，看着像卡住了。
   这一句让点开就有反馈，渲染完成后会被 router 整块替换掉。 */
.boot-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44vh;
  color: #98a2b3;
  font-size: 13px;
  letter-spacing: 0.06em;
}

/* ===== 在线状态 / 关联学员弹窗（2026-11-14） ===== */
.sb-modal { width: min(560px, 94vw); }
.sb-tip {
  padding: 10px 12px;
  border: 1px solid #dbe7ff;
  background: #f5f9ff;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.7;
  color: #4a5769;
}
.sb-tip b { color: #1f2937; }
.sb-search { margin: 12px 0 10px; }
.sb-results {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.sb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #eef1f6;
}
.sb-row:last-child { border-bottom: 0; }
.sb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-main b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.sb-main > span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-tag { flex: none; font-size: 11px; color: #8b95a3; }
.sb-tag.is-free { color: #15803d; }
.sb-tag.is-mine { color: #2b6cf6; }
.sb-tag.is-other { color: #b45309; }
.sb-empty { padding: 18px 12px; text-align: center; font-size: 12px; color: var(--muted); }

/* ===== 积分商城：按班级设置（2026-11-14） ===== */
.gs-hint {
  margin: 12px 16px;
  padding: 10px 12px;
  border: 1px solid #dbe7ff;
  background: #f5f9ff;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.8;
  color: #4a5769;
}
.gs-hint b { color: var(--ink); }
.gs-rules { padding: 4px 18px 18px; font-size: 13.5px; line-height: 1.9; color: var(--ink2); }
.gs-rules p { margin: 6px 0; }
.gs-rules b { color: var(--ink); }
.ga-scope {
  flex: none;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: #f1f4f9;
  color: #78828f;
}
.ga-scope.is-class { background: var(--brand-soft); color: var(--brand-dark); }
.ga-locked { flex: none; font-size: 11.5px; color: #98a2b3; }
.gs-field { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.gs-label { font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-bottom: 8px; }
.gs-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; max-height: 150px; overflow-y: auto; }
.gs-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  cursor: pointer;
}
.gs-opt input { margin: 0; }
.gs-opt.is-all { border-color: #c9dcff; background: #f5f9ff; margin-bottom: 4px; }
.gs-opt input:disabled + span { color: #a3adbb; }
.gs-tip { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.gc-scope {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  color: #1a4ed1;
  background: #e8f0ff;
  vertical-align: middle;
}

/* ==========================================================================
   窄屏导航抽屉（手机 / 平板竖屏）
   · 所有规则都关在 max-width: 820px 里，宽屏一行都不受影响
   · 直接复用现有的 #nav，不再渲染第二套菜单，renderChrome() 不用改
   ========================================================================== */
.nav-toggle { display: none; }
.nav-toggle[hidden] { display: none !important; }
.nav-scrim { display: none; }

@media (max-width: 820px) {
  .topbar-inner { height: 56px; padding: 0 12px; gap: 10px; }
  .brand-text strong { font-size: 14px; }
  .brand-text em { display: none; }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--text-2);
    transition: transform 0.18s, opacity 0.18s;
  }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 8px 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.22);
  }
  body.nav-open .nav { display: flex; }
  .nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 8px;
  }
  .nav a.active { background: var(--brand-soft); }

  body.nav-open .nav-scrim {
    display: block;
    position: fixed;
    inset: 56px 0 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.28);
  }

  .nav-right { gap: 8px; }
  .topstat { display: none; }

  /* 触控目标放大、图片不撑破屏幕 */
  .btn { min-height: 40px; }
  img { max-width: 100%; }
  .app { padding: 12px; }
  .pending-bar { margin: 10px 12px -4px; }
}

/* ===== 我的提交 → 转发到班级群 / 好友私聊求助 ===== */
.mysub-help {
  flex: none;
  margin-left: 6px;
  color: #9a5b0d !important;
  background: #fffbf3 !important;
  border-color: #eed9b5 !important;
}
.mysub-help:hover { background: #fff4df !important; }

.modal-help .modal { width: 560px; max-width: 94vw; }
.hs-wrap { font-size: 13px; }
.hs-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.hs-prob { font-weight: 650; font-size: 14px; }
.hs-prob span { font-weight: 400; color: var(--muted); margin-left: 6px; }
.hs-meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; color: var(--muted); }
.hs-bad {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
}
.hs-brief { margin-top: 8px; line-height: 1.6; word-break: break-all; }
.hs-safe { margin-top: 8px; font-size: 12px; color: var(--muted); }
.hs-label { display: block; margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.hs-note-input { width: 100%; box-sizing: border-box; resize: vertical; }
.hs-tabs { display: flex; gap: 8px; margin: 14px 0 8px; }
.hs-tab {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.hs-tab em { font-style: normal; color: var(--muted); font-size: 12px; }
.hs-tab.on { border-color: #2f6fed; color: #205bc4; background: #f2f7ff; }
.hs-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
}
.hs-target {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}
.hs-target.on { border-color: #2f6fed; background: #f2f7ff; }
.hs-target-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.hs-target-sub { flex: none; font-size: 11.5px; color: var(--muted); }
.hs-empty { grid-column: 1 / -1; padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.hs-chk { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 12.5px; cursor: pointer; }
.hs-preview { margin-top: 12px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfcfe; }
.hs-preview-h { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.hs-preview pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 16px; font-family: inherit; }
.hs-preview-code { margin-top: 6px; font-size: 12px; color: #205bc4; }
.hs-err {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #fecdca;
  background: #fef3f2;
  color: #b42318;
  border-radius: 8px;
  font-size: 12.5px;
}
.hs-foot-tip { font-size: 12px; color: var(--muted); margin-right: 4px; }
.modal-foot .spacer { flex: 1; }

@media (max-width: 820px) {
  .mysub-row { flex-wrap: wrap; }
  .mysub-row .mysub-meta { display: none; }
  .mysub-row .mysub-code { opacity: 1; }
  .modal-help .modal { width: 94vw; }
  .hs-targets { grid-template-columns: 1fr; max-height: 168px; }
}

/* ===== 登录待办提醒（作业 + 比赛一次列全） ===== */
.todo-sec-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.todo-sec-h b { font-size: 14px; }
.todo-sec-h span { font-size: 12px; color: var(--muted); }
.todo-more { font-size: 12.5px; margin-top: 6px; }
.todo-foot { font-size: 12.5px; margin-top: 10px; }
.modal-todo .modal-body { max-height: 68vh; overflow: auto; }

/* ===== 系统消息（现在是「班级群」页的第三个标签） ===== */
/* 页面顶部原先是 h1 + 说明，搬进消息页后只留一行小字提示，别和页签重复 */
.nt-lead { font-size: 12.5px; color: var(--muted); margin: 0 2px 10px; }
.nt-form { margin-bottom: 14px; }
.nt-list .panel-head { display: flex; align-items: center; gap: 8px; }
/* 每条消息：左边图标 + 右边正文，未读用左侧色条和浅蓝底带出来（2026-11-21 改版） */
.nt-item { display: flex; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.nt-item:last-child { border-bottom: 0; }
.nt-item.is-unread { background: linear-gradient(90deg, #f1f7ff, #fbfdff 55%); box-shadow: inset 3px 0 0 #2b6cf6; }
.nt-ico {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 16px; line-height: 1;
  background: #f1f4f9; border: 1px solid #e8edf5;
}
.nt-item.is-unread .nt-ico { background: #e8f1ff; border-color: #d3e4ff; }
.nt-main { flex: 1; min-width: 0; }
.nt-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.nt-title { font-weight: 650; font-size: 14px; color: var(--text); }
.nt-unread {
  font-size: 11px; font-weight: 600;
  color: #fff; background: #2b6cf6;
  border-radius: 999px; padding: 1px 8px; line-height: 16px;
}
.nt-target {
  margin-left: auto; flex: 0 0 auto;
  font-size: 10.5px; color: #5b6b82;
  background: #f2f5fa; border: 1px solid #e8edf5;
  border-radius: 999px; padding: 1px 8px; line-height: 15px;
}
.nt-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.nt-meta i { font-style: normal; opacity: .6; }
.nt-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: 13px; line-height: 1.75; color: var(--text-2);
  margin-top: 9px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid #eef1f6; border-radius: 9px;
}
.nt-item.is-unread .nt-text { background: #fff; border-color: #dfeaff; color: var(--text); }
.nt-acts { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.nt-read-flag {
  font-size: 11.5px; font-weight: 600; color: #0b7a41;
  background: #e7f8f0; border-radius: 999px; padding: 2px 9px;
}
.nt-del { color: #b42318 !important; }
.nt-list .panel-head .btn-primary { box-shadow: 0 2px 6px -2px rgba(43, 108, 246, .5); }
.nt-empty { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; }
.nt-form .field textarea { min-height: 90px; resize: vertical; }

/* ===== 群公告 ===== */
/* 公告条压 60% 不透明（40% 透出底下的面板底色），文字保持不透明，保证可读 */
.chat-announce {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 251, 243, 0.6);
  font-size: 12.5px;
}
.chat-announce.is-empty { background: transparent; color: var(--muted); }
.ca-tag {
  flex: none;
  font-weight: 650;
  color: #9a5b0d;
  background: #fdf0d9;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11.5px;
}
.ca-text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.ca-by { flex: none; font-size: 11.5px; color: var(--muted); }
@media (max-width: 820px) {
  .chat-announce { gap: 6px; padding: 8px 10px; }
  .ca-text { flex-basis: 100%; }
  /* 三个页签（班级群 / 好友 / 系统消息）在手机上平分一行，别挤成两行 */
  .msg-tabs { display: flex; width: 100%; }
  .msg-tab { flex: 1; justify-content: center; padding: 6px 6px; }
}

/* ===== 班级群积分红包 ===== */
/* 整张卡就是红包：皮肤横幅铺满背景（.rp-cardbg），文字浮在上面（浅色 --rp-ink） */
.rp-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 220px;
  max-width: 330px;
  margin-top: 6px;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: #c8403a;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.rp-cardbg { position: absolute; inset: 0; z-index: 0; display: block; }
.rp-cardbg svg { display: block; width: 100%; height: 100%; }
.rp-card.can-claim:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18); }
/* 已领完 / 过期 / 失效、以及我已经领过：红包一律保持原色，只靠右侧状态胶囊区分，不整卡褪色 */
.rp-card.is-done,
.rp-card.is-got { cursor: pointer; }
.rp-card.is-done:hover,
.rp-card.is-got:hover { transform: none; box-shadow: none; }
.rp-txt,
.rp-state { position: relative; z-index: 1; }
.rp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rp-txt b { font-size: 13px; font-weight: 600; color: var(--rp-ink, #ffe6ab); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22); }
.rp-txt em { font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, 0.88); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.rp-state { flex: none; font-size: 11.5px; font-weight: 600; color: var(--rp-ink, #ffe6ab); background: rgba(0, 0, 0, 0.16); padding: 3px 8px; border-radius: 999px; }
.rp-card.is-done .rp-state { color: #6b7280; background: rgba(255, 255, 255, 0.62); }
.rp-card.is-got .rp-state { color: #40485a; background: rgba(255, 255, 255, 0.84); }

/* 发红包：皮肤选择 + 实时预览 */
.rp-skin-line { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 14px; }
.rp-skin-pick { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rp-skin-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 3px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; cursor: pointer; text-align: center;
}
.rp-skin-opt:hover { border-color: #d99a6c; }
.rp-skin-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rp-skin-thumb { display: block; height: 56px; border-radius: 6px; }
.rp-skin-thumb .rp-svg { display: block; margin: 0 auto; }
.rp-skin-opt input:checked ~ .rp-skin-thumb { outline: 2px solid #d99a6c; outline-offset: 2px; }
.rp-skin-opt input:checked ~ b { color: #b45309; }
.rp-skin-opt b { font-size: 11.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.rp-skin-preview {
  flex: 0 0 94px; display: flex; align-items: center; justify-content: center; min-height: 96px;
  border: 1px dashed var(--line); border-radius: 9px; background: #fbfcfe;
}
.rp-big .rp-svg { display: block; margin: 0 auto 6px; }

/* 点开红包后的快捷感谢语 */
.rp-thanks { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rp-thanks-h { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; color: #6b7280; }
.rp-thanks-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-thanks-btn {
  min-height: 34px; padding: 6px 11px; border: 1px solid #f0d6c6; border-radius: 999px;
  background: #fff8f3; color: #9a5b0d; font-size: 12.5px; cursor: pointer;
}
.rp-thanks-btn:hover { background: #fff1e6; border-color: #d99a6c; }
.rp-thanks-custom { display: flex; gap: 6px; margin-top: 9px; }
.rp-thanks-custom .input { flex: 1; min-width: 0; }

/* 领到红包后的获奖弹窗 */
.rp-win-modal .modal { width: 424px; max-width: 94vw; border: 1px solid #e8cf9a; }
.rp-win-modal .modal-head { background: #fffaf0; border-bottom: 1px solid #f0e0bb; }
.rp-win { text-align: center; padding: 4px 0 2px; }
.rp-win-head { font-size: 15px; font-weight: 700; color: #a86f14; letter-spacing: 0.06em; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rp-win-skin { display: flex; justify-content: center; margin: 12px 0 6px; }
.rp-win-amount { display: flex; align-items: baseline; justify-content: center; gap: 7px; }
.rp-win-amount span { font-size: 13px; color: var(--muted); }
.rp-win-amount b { font-size: 42px; line-height: 1.1; color: #b45309; font-variant-numeric: tabular-nums; }
.rp-win-amount em { font-style: normal; font-size: 13px; color: var(--muted); }
.rp-win-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rp-win .rp-thanks { text-align: left; }

.rp-form .form-row { margin-bottom: 4px; }
.rp-form .hs-label { margin-top: 12px; }
.rp-form .scope-row { margin-top: 6px; }
.rp-form .rp-lock { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--line-soft); color: var(--text-2); line-height: 1.65; }
.rp-big { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 0 14px; }
.rp-big span { font-size: 40px; line-height: 1; }
.rp-big b { font-size: 15px; }
.rp-big em { font-style: normal; font-size: 12px; color: var(--muted); }
.rp-got {
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  text-align: center;
  font-size: 13px;
}
.rp-claims { margin-top: 10px; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line); }
.rp-claim { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.rp-claim span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-claim em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.hw-card.hw-wait { border-color: var(--line); }
.hw-p.is-locked { color: var(--muted); cursor: default; }

/* ===== 手机端逐页优化（全部关在窄屏 media 内，宽屏零影响） ===== */
@media (max-width: 820px) {
  /* 表格：容器本来就有 overflow-x:auto，给表格一个最小宽度，手机上左右滑而不是把字挤成竖排 */
  .table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .table-wrap table { min-width: 560px; }
  .hb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hb-table { min-width: 560px; }
  table th, table td { padding-left: 8px; padding-right: 8px; }
  .row-actions { flex-wrap: wrap; gap: 5px; }

  /* iOS Safari 对 <16px 的输入框会自动放大页面，输入框统一 16px（代码编辑器不在此列） */
  .form input, .form select, .form textarea, .input, .chat-textarea, .fr-search input {
    font-size: 16px;
  }
  .modal { max-width: 96vw; }
  .modal-body { max-height: 70vh; overflow-y: auto; }
  .stat-row { gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .page-head h1 { font-size: 19px !important; }
  .page-head p { font-size: 12.5px; line-height: 1.7; }
  .hw-bar { flex-wrap: wrap; gap: 6px 10px; }
  .hw-foot { flex-wrap: wrap; gap: 8px; }
  .hw-foot .btn { min-height: 40px; }
  img { max-width: 100%; height: auto; }

  /* 课程视频：内嵌播放（playsinline）+ 不拉伸，横屏时交给系统全屏按钮 */
  .cse-video { max-height: 56vh; object-fit: contain; }
  .cse-player-panel { padding: 8px; }
  .rp-card { max-width: 100%; min-width: 0; }
  /* 输入栏在手机上按钮多，间隙收窄一点，红包按钮照样露出文字 */
  .chat-compose-foot { gap: 6px; }
  .cm-rp-btn { padding: 0 8px; }
  .rp-txt b { white-space: normal; }
  .rp-state { font-size: 11px; }
  .rp-skin-line { gap: 8px; }
  .rp-skin-pick { gap: 5px; }
  .rp-skin-opt { padding: 6px 2px; }
  .rp-skin-opt b { font-size: 11px; }
  .rp-skin-preview { flex-basis: 72px; min-height: 82px; }
  .rp-win-amount b { font-size: 34px; }
  .rp-thanks-btn { min-height: 40px; }
}

/* ============ 老师批改：评语 / 逐行批注 / 鼓励分 ============ */
/* 代码 + 左侧行号：行号点一下就能写批注，批注过的行标橙点 */
.code-cols { display: flex; max-height: calc(100vh - 260px); overflow: auto; background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.code-cols .code-readonly { max-height: none; overflow: visible; flex: 1 1 auto; border-radius: 0; }
.code-gutter {
  position: sticky; left: 0; z-index: 1; flex: none;
  padding: 16px 8px; text-align: right;
  background: #f4f7fb; border-right: 1px solid var(--line-soft);
  font: 13px/1.65 var(--mono); color: #a7b0bd; user-select: none;
}
.code-gutter .cl {
  display: block; width: 100%; padding: 0 2px; border: 0; border-radius: 3px;
  background: none; font: inherit; line-height: inherit; color: inherit; text-align: right; cursor: default;
}
.code-gutter.is-clickable .cl { cursor: pointer; }
.code-gutter.is-clickable .cl:hover { background: #e6edf8; color: #2b6cf6; }
.code-gutter .cl.has-note { color: #b45309; font-weight: 700; }
.code-gutter .cl.has-note::after { content: '·'; margin-left: 1px; }
.code-gutter .cl.flash { background: #fff2d8; color: #b45309; }

.rv-card, .rv-edit { padding: 14px 16px; }
.rv-head, .rv-edit-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.rv-ico { display: inline-flex; color: var(--brand); }
.rv-by { margin-left: auto; font-size: 11.5px; color: #9aa3af; }
.rv-badge { font-size: 11px; font-weight: 700; color: #0d7a4a; background: #e7f7ee; border-radius: 999px; padding: 1px 8px; }
.rv-bonus { font-size: 11px; font-weight: 700; color: #b45309; background: #fff2d8; border-radius: 999px; padding: 1px 8px; }
.rv-text { margin-top: 9px; font-size: 13.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.rv-notes { margin-top: 10px; border-top: 1px dashed var(--line-soft); padding-top: 8px; }
.rv-notes-h { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.rv-note { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--text-2); padding: 3px 0; cursor: pointer; }
.rv-note b { flex: none; color: #b45309; font-weight: 600; font-variant-numeric: tabular-nums; }
.rv-note span { flex: 1 1 auto; }
.rv-note:hover span { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.rv-note-del { flex: none; border: 0; background: none; color: #c2c9d3; font-size: 14px; line-height: 1; cursor: pointer; }
.rv-note-del:hover { color: #e5484d; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.rv-chip { border: 1px solid var(--line); background: #f7f9fc; color: var(--text-2); font-size: 12px; padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.rv-chip:hover { border-color: #b9d0f7; color: var(--brand-dark); background: #eef4ff; }
.rv-textarea { width: 100%; min-height: 76px; resize: vertical; line-height: 1.65; }
.rv-opts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; color: var(--text-2); }
.rv-opt { display: inline-flex; align-items: center; gap: 6px; }
.rv-opt .input { width: auto; padding: 3px 6px; font-size: 12.5px; }
.rv-check input { margin: 0; }
.rv-empty-note { margin-top: 8px; font-size: 12px; color: #9aa3af; }
.rv-cap { font-size: 11.5px; color: #9aa3af; }
.rv-done { color: #0d7a4a; }

/* ============ 批改：打回重做 / 错题本 ============ */
.hw-badge.b-redo { background: #fff2d8; color: #b45309; }
.hw-p.is-redo { border-color: #f3cf8f; background: #fffaf0; }
.hw-p-redo { margin-left: auto; font-size: 10.5px; font-weight: 700; color: #b45309; background: #fff2d8; border-radius: 999px; padding: 1px 7px; flex: none; }
.rv-redo { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-soft); display: flex; flex-direction: column; gap: 7px; }
.rv-redo-h { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.rv-redo-list { display: flex; flex-direction: column; gap: 4px; }
.rv-redo-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 3px 0; }
.rv-redo-row input { margin: 0; flex: none; }
.rv-redo-row .rd-id { flex: none; color: #78828f; font-variant-numeric: tabular-nums; }
.rv-redo-row .rd-title { flex: 1 1 auto; }
.rv-count { font-size: 12px; font-weight: 700; color: #b45309; }
.wrong-list { display: flex; flex-direction: column; gap: 2px; padding: 6px 16px 8px; }
.wrong-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.wrong-row:last-child { border-bottom: 0; }
.wr-id { flex: none; width: 62px; color: #78828f; font-variant-numeric: tabular-nums; }
.wr-title { flex: 1 1 auto; color: var(--brand-dark); text-decoration: none; }
.wr-title:hover { text-decoration: underline; }
.wr-kind { flex: none; font-size: 11px; color: #78828f; background: #f1f4f8; border-radius: 999px; padding: 1px 7px; }
.wr-tries { flex: none; font-size: 11.5px; color: #b45309; }
.wr-tags { flex: none; display: inline-flex; gap: 4px; }
.wr-tags i { font-style: normal; font-size: 10.5px; color: #78828f; background: #f6f8fb; border: 1px solid var(--line-soft); border-radius: 999px; padding: 0 6px; }

/* ============ 批改分析：知识点掌握度 / 相似代码 ============ */
.tag-bars { display: flex; flex-direction: column; gap: 7px; padding: 10px 16px 14px; }
.tag-bar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.tb-name { flex: none; width: 100px; color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-track { flex: 1 1 auto; height: 8px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.tb-track i { display: block; height: 100%; border-radius: 999px; background: #94a3b8; }
.tag-bar.is-bad .tb-track i { background: #ef4444; }
.tag-bar.is-mid .tb-track i { background: #f59e0b; }
.tag-bar.is-ok .tb-track i { background: #10b981; }
.tb-pct { flex: none; width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.tb-meta { flex: none; width: 172px; color: #9aa3af; font-size: 11.5px; text-align: right; }
.sim-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 16px 10px; }
.sim-form .input { width: 200px; }
.sim-out { padding-bottom: 10px; }
.sim-cap { padding: 4px 16px 8px; font-size: 12.5px; color: var(--text-2); }
.sim-score { color: #b45309; font-weight: 700; }
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sim-side { min-width: 0; }
.sim-h { display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.sim-verdict { font-size: 11px; font-weight: 600; }
.sim-code { margin: 0; background: #fbfcfe; border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; font: 12px/20px var(--mono); font-variant-ligatures: none; overflow: auto; max-height: 52vh; white-space: pre; }
@media (max-width: 820px) {
  .sim-grid { grid-template-columns: 1fr; }
  .tb-meta { display: none; }
}

/* 归档的老提交：没有测试点明细时给一句说明，别让人以为加载失败 */
.case-archived {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: #f6f8fb; border: 1px dashed var(--line-soft);
  font-size: 12.5px; color: var(--text-2);
}

/* ============ 课堂看板 ============ */
.lv-warn {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 0; padding: 10px 14px; border-radius: 10px;
  background: #fff7ed; border: 1px solid #fbd5a5; font-size: 13px; color: #9a4b09;
}
.lv-warn-t { font-weight: 700; color: #b45309; flex: none; }
.lv-warn-list { flex: 1 1 auto; min-width: 0; }
.lv-panel { padding-bottom: 12px; }
.lv-count { font-size: 12px; color: #b45309; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; padding: 10px 16px 4px; }
.lv-card {
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 13px;
  background: #fff; display: flex; flex-direction: column; gap: 7px;
}
.lv-card.is-on { border-color: #bcd4ff; background: #fbfdff; }
.lv-card.is-stuck { border-color: #f3cf8f; background: #fffaf0; }
.lv-top { display: flex; align-items: center; gap: 9px; }
.lv-top .avatar { flex: none; }
.lv-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lv-name b { font-size: 13.5px; color: var(--text); font-weight: 600; }
.lv-dot { font-size: 11px; color: #9aa3af; }
.lv-card.is-on .lv-dot { color: #0d7a4a; }
.lv-pts { margin-left: auto; font-size: 11.5px; color: #78828f; flex: none; }
.lv-meta { font-size: 12px; color: var(--text-2); }
.lv-cur { font-size: 12.5px; color: var(--brand-dark); }
.lv-stuck { font-size: 12.5px; color: #b45309; line-height: 1.55; }
.lv-quiet { font-size: 12px; color: #9aa3af; }
.lv-acts { display: flex; gap: 6px; margin-top: 2px; }
.lv-feed { display: flex; flex-direction: column; padding: 4px 16px 8px; }
.lv-feed-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
.lv-feed-row:last-child { border-bottom: 0; }
.lv-feed-row b { flex: none; width: 76px; color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-feed-row a { flex: 1 1 auto; color: var(--brand-dark); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-feed-row a:hover { text-decoration: underline; }
.lv-fd { flex: none; font-size: 11.5px; }
.lv-ft { flex: none; width: 72px; text-align: right; color: #9aa3af; font-size: 11.5px; }
.lv-fd.v-AC { color: #0d7a4a; }
.lv-fd.v-WA, .lv-fd.v-RE, .lv-fd.v-CE { color: #c2410c; }
.lv-fd.v-TLE, .lv-fd.v-MLE { color: #b45309; }
/* 周报画布 */
.modal-body canvas { display: block; margin: 0 auto; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line-soft); }
.wk-tip { margin: 10px auto 0; max-width: 750px; font-size: 12px; color: #9aa3af; text-align: center; }
@media (max-width: 820px) {
  .lv-grid { grid-template-columns: 1fr; padding: 8px 12px 4px; }
  .lv-feed-row b { width: 58px; }
  .lv-ft { width: 56px; }
}

/* 手机端做题：隐藏用不上的行号栏，按钮放大一点，编辑器多留高度 */
@media (max-width: 820px) {
  .code-gutter { display: none !important; }
  .code-cols { max-height: none !important; }
  .editor-toolbar { flex-wrap: wrap; gap: 6px !important; }
  .editor-toolbar .btn { padding: 7px 11px !important; font-size: 13px !important; }
  .editor-toolbar #btn-submit { flex: 1 1 100% !important; margin-top: 2px; }
  .code-editor { min-height: 44vh !important; }
  .work-col { min-width: 0; }
  .lv-stuck, .lv-cur { font-size: 13px; }
  .modal-body canvas { width: 100% !important; height: auto !important; }
}

/* ===== 手机端班级群：一屏装下「选班 → 消息 → 输入」 ===== */
/* 宽屏零改动，全部关在 ≤820px 内。
   思路：整块 .chat-wrap 变成定高的竖向 flex，消息区自己吃剩余高度并内部滚动，
   输入栏和成员条不再把页面顶出屏幕 —— 手机上不用先滚一屏才能打字。 */
@media (max-width: 820px) {
  .chat-wrap,
  .chat-wrap.has-rooms {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* vh 给老浏览器兜底，dvh 跟着地址栏 / 键盘收放 */
    height: calc(100vh - 152px);
    height: calc(100dvh - 152px);
    min-height: 430px;
    align-items: stretch;
  }

  /* 左栏：一行横滑的「班名芯片」，不带副标题，省一半高度 */
  .chat-rooms { max-height: none; flex: 0 0 auto; }
  .chat-rooms .side-note { display: none; }
  .chat-rooms .fr-search { padding: 7px 8px; }
  .chat-rooms .chat-side-head { padding: 6px 10px 4px; font-size: 12px; }
  .chat-room-list { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 4px 8px 8px; gap: 6px; }
  .chat-room-item {
    flex: 0 0 auto;
    width: auto;
    max-width: 60vw;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
  }
  .chat-room-item.is-on { background: var(--brand-soft); border-color: #c7daf9; }
  .chat-room-item .cr-sub { display: none; }
  .chat-room-item .cr-name { font-size: 12.5px; max-width: 46vw; }

  /* 入班申请 / 我发出的申请：手机上按钮并排压紧，别把左栏撑高 */
  .chat-rooms .cr-join-sec { padding-bottom: 4px; }
  .chat-rooms .cr-joins { max-height: 132px; overflow-y: auto; }

  /* 聊天面板占满剩余高度；消息区内部滚动，输入栏永远贴在面板底部 */
  .chat-panel { flex: 1 1 0; min-height: 240px; height: auto; }
  .chat-list { flex: 1 1 0; height: auto; min-height: 0; padding: 10px 10px 4px; }
  /* 还没进班：没有聊天窗口可撑，别硬留一屏高 */
  .chat-wrap.no-room { height: auto; min-height: 0; }

  .chat-head { padding: 7px 10px; gap: 8px; }
  .chat-head .chat-room-av .avatar.is-lg,
  .chat-head .avatar.is-lg { width: 34px; height: 34px; font-size: 13px; }
  .chat-title b { font-size: 14px; }
  .chat-sub { font-size: 11px; }
  .chat-head .btn-sm { padding: 5px 9px; font-size: 12px; white-space: nowrap; }

  /* 公告压成一行：长公告一就地展开会把消息区挤成 0 高（看起来像公告糊住了整个屏幕），
     所以手机上一律单行省略，点整条弹窗看全文（JS 里只有窄屏才弹）。 */
  .chat-announce {
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    max-height: 58px;
    overflow: hidden;
  }
  .chat-announce .ca-tag { flex: none; padding: 2px 6px; font-size: 11px; }
  .chat-announce .ca-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: unset;
  }
  /* 手机上省掉「谁发的 · 什么时候」和占位 spacer，这两项进弹窗 */
  .chat-announce .ca-by { display: none; }
  .chat-announce .spacer { display: none; }
  .chat-announce .btn-xs { flex: none; padding: 3px 7px; font-size: 11px; }

  /* 气泡放宽一点，长句子少折两行 */
  .chat-msg { gap: 7px; margin-bottom: 11px; }
  .chat-body { max-width: 86%; }
  /* 带代码的消息直接占满一行，代码框里横滑比挤在 86% 里舒服（:has 不认就退回上面的 86%） */
  .chat-body:has(.chat-code) { max-width: 100%; }
  .chat-code-pre { font-size: 12px; line-height: 16px; padding: 8px 10px 9px; }
  .chat-code.is-folded .chat-code-pre { max-height: 200px; }
  .chat-list .chat-empty { padding: 34px 14px; }
  .chat-bubble { font-size: 13.5px; line-height: 1.62; padding: 8px 11px; }
  .chat-line { margin-bottom: 3px; }
  .chat-line b,
  .chat-name { font-size: 12px; }
  /* 触屏没有 hover：引用 / 撤回 / 删除一直露出来，点得着就行 */
  .chat-quote-btn,
  .chat-recall,
  .chat-del { padding: 2px 7px; font-size: 11px; }

  /* 输入区：矮一点、按钮大一点 */
  .chat-compose { padding: 8px 10px 10px; }
  .chat-textarea { height: 58px; resize: none; padding: 8px 10px; }
  .chat-compose-foot { gap: 6px; row-gap: 6px; margin-top: 6px; }
  .cm-at-btn,
  .cm-emoji-btn,
  .cm-code-btn { min-width: 34px; height: 34px; }
  .chat-compose-foot .btn-primary { min-height: 34px; padding: 0 16px; }
  .chat-count { font-size: 11px; }

  /* 成员栏：横滑头像条（竖排小卡），点名字进个人主页；私信 / 加好友走个人页 */
  .chat-side { flex: 0 0 auto; max-height: none; }
  .chat-side-head { padding: 6px 10px; font-size: 12px; }
  .chat-members {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 8px 8px;
  }
  .chat-member {
    flex: 0 0 auto;
    flex-direction: column;
    gap: 2px;
    width: 56px;
    padding: 4px 2px 5px;
    text-align: center;
  }
  .chat-member .avatar { margin: 0 auto; }
  .chat-member .cm-name {
    max-width: 52px;
    font-size: 11px;
    text-align: center;
  }
  .chat-member .cm-role,
  .chat-member .cm-add,
  .chat-member .cm-more { display: none; }
  .chat-member-more { flex: 0 0 auto; width: 116px; align-self: center; }

  /* 没进班时的空态：别留一大块白 */
  .chat-panel.chat-noroom { flex: 0 0 auto; }
  .chat-panel.chat-noroom .chat-empty { padding: 32px 16px; }
}

/* ===== 群公告弹窗（手机端点公告条看全文） ===== */
.modal-announce { max-width: 520px; }
.ca-view-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.ca-view-by {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
}

/* ===== 手机端好友 / 私聊：列表与会话单栏切换 ===== */
/* 宽屏零改动。窄屏不再「列表 44vh + 会话 62vh」纵向堆叠（一屏塞不下、点完人还得自己往下滚），
   改成默认只看好友列表，点某个人整块换成会话，会话头部有「‹ 好友」退回。 */
.dm-back {
  display: none;
  flex: none;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.dm-back:hover { background: #f4f7fd; color: var(--brand-dark); }

@media (max-width: 820px) {
  .fr-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: calc(100vh - 152px);
    height: calc(100dvh - 152px);
    min-height: 430px;
    align-items: stretch;
  }

  /* 左栏（搜索 + 新的朋友 + 好友列表）在窄屏独占一屏 */
  .fr-side { max-height: none; flex: 1 1 0; min-height: 0; }
  .fr-wrap .side-note { display: none; }
  .fr-search { padding: 8px 10px; }
  .fr-sec-head { padding: 7px 10px 5px; }
  .fr-reqs,
  .fr-outs { max-height: 168px; overflow-y: auto; }
  .fr-item { padding: 10px 12px; }
  .fr-item-top b,
  .fr-item-top .fr-name { font-size: 13.5px; }
  .fr-item-last { font-size: 12px; }
  .fr-list-empty { padding: 40px 16px; }

  /* 会话也独占一屏，输入栏贴底 */
  .fr-main { height: auto; flex: 1 1 0; min-height: 0; }
  .fr-wrap:not(.is-dm) .fr-main { display: none; }
  .fr-wrap.is-dm .fr-side { display: none; }

  .dm-back { display: inline-flex; }
  .dm-head { padding: 7px 10px; gap: 7px; }
  .dm-who { flex: 1; min-width: 0; }
  .dm-who .dm-name { font-size: 13px; }
  .dm-who span { font-size: 11px; }
  .dm-head .btn-sm { padding: 4px 8px; font-size: 11.5px; white-space: nowrap; }
  .dm-list { padding: 10px 10px 6px; }
  .dm-list .chat-body { max-width: 86%; }
  .dm-compose { padding: 8px 10px 10px; }
  .dm-compose .chat-textarea { height: 58px; resize: none; }
  .dm-foot { gap: 6px; }
  .dm-foot .btn-primary { min-height: 34px; padding: 0 16px; }
}

/* ===== 手机端「我的好友」默认折叠 ===== */
.fr-fold {
  display: none;
  flex: none;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}
.fr-fold:hover { background: #f4f7fd; color: var(--brand-dark); }

@media (max-width: 820px) {
  .fr-fold { display: inline-flex; align-items: center; }
  .fr-list-head { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  /* 标题行右边位置紧：「最多 N 个」让位给折叠按钮 */
  .fr-list-head .fr-cap { display: none; }
  /* 折叠后只留那一行标题，左栏收起内容高度，底下不留一大片白 */
  .fr-wrap.is-fold .fr-list { display: none; }
  .fr-wrap.is-fold .fr-side { flex: 0 0 auto; }
  /* :not(.is-dm) —— 进会话时不能跟着折成内容高，会话仍要占满一屏 */
  .fr-wrap.is-fold:not(.is-dm) { height: auto; min-height: 0; }
  .fr-wrap.is-fold .fr-list-head { border-bottom: 0; }
}

/* ===== 手机端「本班成员」默认折叠 ===== */
.chat-side > .chat-side-head { display: flex; align-items: center; gap: 6px; }
.cs-fold {
  display: none;
  margin-left: auto;
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}
.cs-fold:hover { background: #f4f7fd; color: var(--brand-dark); }

@media (max-width: 820px) {
  .cs-fold { display: inline-flex; align-items: center; }
  .chat-side > .chat-side-head { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .chat-side.is-fold .chat-members { display: none; }
  .chat-side.is-fold .chat-side-head { border-bottom: 0; }
}

/* ===== 手机端「群公告」默认折叠成一条 ===== */
/* 窄屏公告只留「群公告」标签 + 「查看 ▸」，正文收起来（点整条弹窗看全文），
   聊天区能再多挤出一行高度。没公告时照常显示「还没有公告」。 */
.ca-more { display: none; }

@media (max-width: 820px) {
  .chat-announce { padding: 5px 10px; }
  .chat-announce .ca-text { display: none; }
  .chat-announce .ca-more {
    display: inline;
    margin-left: auto;
    flex: none;
    font-size: 11px;
    color: #9a5b0d;
  }
  .chat-announce.is-empty .ca-text { display: inline; min-width: 0; }
  .chat-announce.is-empty .ca-more { display: none; }
}

/* ===== 手机端「搜索班级」「我的班级群」默认折叠 ===== */
.cr-search-toggle,
.cr-fold {
  display: none;
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}
.cr-search-toggle { margin: 6px 8px 0; }
.cr-search-toggle:hover,
.cr-fold:hover { background: #f4f7fd; color: var(--brand-dark); }

@media (max-width: 820px) {
  .cr-search-toggle { display: inline-flex; align-items: center; align-self: flex-start; }
  .cr-fold { display: inline-flex; align-items: center; }
  .chat-rooms .chat-side-head { padding: 6px 10px 4px; }
  /* 搜索：默认只留「搜索班级 ▾」，点开才出现输入框并直接聚焦 */
  .chat-rooms.is-sfold #crSearchBox { display: none; }
  .chat-rooms.is-sfold #crFindBox { display: none; }
  /* 我的班级群：默认收起横滑条，只留标题行 */
  .chat-rooms.is-rfold .chat-room-list { display: none; }
  .chat-rooms.is-rfold #crHead { border-bottom: 0; }
}

/* ===== 学习报告（系统消息页顶部，管理员可见） ===== */
.nt-reports { margin-bottom: 14px; }
.nt-reports-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
}
.nt-reports-tip {
  flex: 1 1 320px;
  min-width: 0;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.nt-reports-tip b { color: var(--text); font-weight: 600; }
.nt-reports-btns { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }

@media (max-width: 820px) {
  .nt-reports-body { padding: 10px 12px 12px; }
  .nt-reports-btns { width: 100%; }
  .nt-reports-btns .btn { flex: 1 1 0; min-height: 38px; }
}

/* ===== 课堂看板：板块页签（实时看板 / 批改分析 / 我的学员 / 学习报告） ===== */
.lv-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
}
.lv-tab {
  flex: none;
  padding: 8px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.lv-tab:hover { color: var(--brand-dark); }
.lv-tab.is-on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

/* ===== 课堂看板：全班占 2/3，实时动态在右占 1/3 ===== */
.lv-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.lv-main { min-width: 0; }
.lv-side { min-width: 0; }
/* 动态最多 20 条，右栏自己滚，别把整页拉长到看不见底部 */
.lv-side .lv-feed { max-height: 60vh; overflow-y: auto; }
/* 左栏变窄后卡片也跟着小一点，一行能多放两个 */
.lv-split .lv-grid { grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); }

/* 投影仪 / 小笔记本：并排挤了，改回上下 */
@media (max-width: 1180px) {
  .lv-split { grid-template-columns: minmax(0, 1fr); }
  .lv-side .lv-feed { max-height: none; }
}

/* ===== 学习报告 ===== */
.lv-rep-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lv-rep-kinds { display: flex; gap: 6px; }
.rpt-wrap { overflow-x: auto; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-table th,
.rpt-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.rpt-table th { color: var(--text-2); font-weight: 600; font-size: 12px; background: #fafbfd; }
.rpt-table tbody tr[data-rpt-row] { cursor: pointer; }
.rpt-table tbody tr[data-rpt-row]:hover { background: #f7faff; }
.rpt-table tr.is-idle td { color: #9aa3af; }
.rpt-delta { font-style: normal; font-size: 11.5px; }
.rpt-delta.is-up { color: #0d7a4a; }
.rpt-delta.is-down { color: #c2410c; }
.rpt-fresh { margin-left: 4px; font-size: 11px; color: #0d7a4a; }
.rpt-act { text-align: right; }
.rpt-detail { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.85; color: var(--text); }
.modal-rpt { max-width: 560px; }

@media (max-width: 820px) {
  .lv-tab { padding: 7px 11px; font-size: 13px; }
  .rpt-table th,
  .rpt-table td { padding: 8px 10px; }
}

/* ===== 笔记「公开 / 仅自己可见」 ===== */
/* 编辑器里的一行开关：两个药丸按钮 + 一句解释，默认选中「公开」。 */
.blog-vis {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.bv-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.bv-opt {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 3px 12px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  cursor: pointer;
}
.bv-opt:hover { border-color: #b9ccfb; color: var(--brand-dark); }
.bv-opt.on {
  background: var(--brand-soft);
  border-color: #c7daf9;
  color: var(--brand-dark);
  font-weight: 600;
}
.bv-tip { font-size: 11.5px; color: var(--muted); min-width: 0; }

/* 标题旁的「仅自己可见」标签（详情页） */
.blog-vis-tag {
  display: inline-block;
  vertical-align: 3px;
  margin-left: 10px;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid #f0d5a8;
  background: #fdf6e8;
  color: #9a5b0d;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
}
/* 列表卡片上的同款标记 */
.bc-flag-priv { color: #9a5b0d; background: #fdf6e8; border-color: #f0d5a8; }

@media (max-width: 820px) {
  .blog-vis { gap: 6px; padding: 7px 9px; }
  .bv-tip { flex: 1 1 100%; }
  .bv-opt { padding: 4px 11px; }
  .blog-vis-tag { vertical-align: 1px; margin-left: 6px; }
}

/* =========================================================
 * 成长体系（2026-11）：等级 / 段位 / 赛季三层 + 说明页
 * 简约风：白卡片 + 细边框，不用渐变和阴影
 * ========================================================= */
.gc-season {
  margin: 6px 0 0;
  font-size: 12px;
  color: #8a6d3b;
}
.gc-more {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: #2b6cf6;
}
.gc-more:hover { text-decoration: underline; }

.growth-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.gh-card {
  border: 1px solid #e6e9ef;
  border-radius: 12px;
  background: #fff;
  padding: 13px 15px;
  min-height: 96px;
}
.gh-lab { font-size: 12px; color: #78828f; }
.gh-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 7px 0 5px;
}
.gh-emoji { font-size: 18px; line-height: 1; }
.gh-main b { font-size: 16px; color: #1f2937; }
.gh-bar {
  height: 6px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
  margin: 4px 0 6px;
}
.gh-bar i { display: block; height: 100%; background: #2b6cf6; border-radius: 999px; }
.gh-sub { font-size: 12px; color: #6b7280; line-height: 1.5; }
.gh-sub b { color: #1f2937; }

.gd-body { padding: 4px 16px 10px; }
.gd-body p { margin: 6px 0; font-size: 13px; line-height: 1.75; color: #374151; }
.gd-body strong { font-weight: 500; color: #1f2937; }
.gd-tip { color: #6b7280 !important; font-size: 12.5px !important; }
.gd-note {
  padding: 0 16px 14px;
  font-size: 12.5px;
  color: #6b7280;
}
.gd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gd-table th {
  text-align: left;
  font-weight: 500;
  color: #6b7280;
  padding: 9px 12px;
  border-bottom: 1px solid #e6e9ef;
  background: #fafbfc;
  white-space: nowrap;
}
.gd-table td { padding: 9px 12px; border-bottom: 1px solid #f1f3f7; color: #374151; }
.gd-table tr:last-child td { border-bottom: 0; }
.gd-table tr.is-me td { background: #f5f8ff; }
.gd-emoji { font-size: 16px; width: 52px; }
.gd-desc { color: #6b7280; }
.gd-flag { color: #9aa3af; font-size: 12px; }
.gd-table tr.is-me .gd-flag { color: #2b6cf6; }

.gd-honors { padding: 2px 16px 16px; display: grid; gap: 10px; }
.gd-honor {
  border: 1px solid #e6e9ef;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fcfcfd;
}
.gd-honor-key {
  display: block;
  font-size: 12px;
  color: #8a6d3b;
  margin-bottom: 6px;
}
.gd-honor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
  color: #374151;
}
.gd-honor-row span { flex: 0 0 auto; color: #8a6d3b; font-size: 12px; }
.gd-honor-row b { font-weight: 500; color: #1f2937; }
.gd-honor-row em { margin-left: auto; font-style: normal; color: #9aa3af; font-size: 12px; }
.gd-foot {
  padding: 2px 4px 20px;
  font-size: 12px;
  color: #9aa3af;
  text-align: center;
}
.rm-growth {
  margin-top: 10px;
  font-size: 12.5px;
  color: #6b7280;
}
.rm-hw-row.is-grow { color: #2b6cf6; }

@media (max-width: 820px) {
  .growth-hero { grid-template-columns: 1fr; gap: 10px; }
  .gd-table th, .gd-table td { padding: 8px 9px; }
  .gd-table .gd-desc { display: none; }
}

/* 个人主页的赛季荣誉行 */
.bd-head-sub { margin-top: 22px; }
.ub-honors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ub-honor {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid #f0d5a8;
  background: #fdf6e8;
  color: #8a5a12;
  border-radius: 999px;
  font-size: 12.5px;
}

/* 学员列表里的「等级 / 段位」列 */
.stu-grow b { display: block; font-size: 12.5px; color: #1f2937; font-weight: 500; }
.stu-grow em { display: block; font-style: normal; font-size: 12px; color: #8a6d3b; }

/* =========================================================
 * 课堂看板 · 数据墙（2026-11）
 * KPI 卡片和数据墙都是浅色简约风，和看板其余面板同一套配色（#fff / #e6e9ef）；
 * 数字统一等宽字体，折线只用蓝/绿两条，不要渐变和阴影。
 * ========================================================= */
.lvx-kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.lvx-k {
  border: 1px solid #e6e9ef;
  border-left: 2px solid #38bdf8;
  border-radius: 10px;
  background: #fff;
  padding: 10px 13px 9px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lvx-k.is-warn { border-left-color: #e24b4a; }
.lvx-k-t { font-size: 11.5px; color: #78828f; letter-spacing: .04em; }
.lvx-k-v {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 23px;
  line-height: 1.15;
  color: #10283a;
  font-weight: 500;
}
.lvx-k-v small { font-size: 12px; color: #9aa3af; font-weight: 400; }
.lvx-k-foot { font-size: 11.5px; color: #9aa3af; }
.lvx-spark { display: block; margin-top: 2px; }

.lvx-wall {
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e6e9ef;
  padding: 12px 14px 14px;
  margin-bottom: 16px;
  color: #1f2937;
}
.lvx-wall-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef1f5;
  margin-bottom: 12px;
}
.lvx-wall-head b { font-size: 13.5px; color: #10283a; font-weight: 500; letter-spacing: .06em; }
.lvx-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22b07d;
  box-shadow: 0 0 0 3px rgba(34, 176, 125, .14);
}
.lvx-live {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: #0f8f63;
  border: 1px solid #bfe8d5;
  background: #f0fbf6;
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: .1em;
}
.lvx-wall-sub { margin-left: auto; font-size: 11.5px; color: #9aa3af; }

.lvx-wall-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}
.lvx-cell {
  background: #fbfcfd;
  border: 1px solid #eef1f5;
  border-radius: 9px;
  padding: 9px 11px 6px;
  min-width: 0;
}
.lvx-cell-t {
  font-size: 11.5px;
  color: #5b7285;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.lvx-cell-t em { font-style: normal; color: #a8b1bd; margin-left: 6px; }
.lvx-span8 { grid-column: span 8; }
.lvx-span5 { grid-column: span 5; }
.lvx-span4 { grid-column: span 4; }
.lvx-span3 { grid-column: span 3; }
.lvx-cell-mid { display: flex; flex-direction: column; justify-content: center; }
.lvx-chart { display: block; width: 100%; height: 146px; }
.lvx-chart-week { height: 120px; }
.lvx-ring { display: block; width: 96px; height: 96px; margin: 0 auto 4px; }

.lvx-stage { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 6px; }
.lvx-stage-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.lvx-stage-k { flex: 0 0 84px; color: #5b7285; }
.lvx-stage-bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  background: #eef1f5;
  overflow: hidden;
}
.lvx-stage-bar i { display: block; height: 100%; background: #3aa9e0; border-radius: 4px; }
.lvx-stage-n {
  flex: 0 0 28px;
  text-align: right;
  color: #10283a;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 400;
}
.lvx-empty { font-size: 12px; color: #9aa3af; padding: 14px 2px; }

.lvx-skel {
  height: 108px;
  border-radius: 6px;
  background: #eef1f5;
  opacity: .9;
}
.lvx-skel-sq { height: 96px; width: 96px; margin: 0 auto 4px; }

@media (prefers-reduced-motion: no-preference) {
  .lvx-dot { animation: lvxPulse 2.4s ease-in-out infinite; }
  @keyframes lvxPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 176, 125, .14); }
    50% { box-shadow: 0 0 0 6px rgba(34, 176, 125, .04); }
  }
}

@media (max-width: 1180px) {
  .lvx-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lvx-span8, .lvx-span5, .lvx-span4, .lvx-span3 { grid-column: span 12; }
}
@media (max-width: 820px) {
  .lvx-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lvx-k-v { font-size: 20px; }
  .lvx-wall { padding: 10px 11px 12px; }
  .lvx-chart { height: 120px; }
  .lvx-stage-k { flex-basis: 72px; }
}

/* =========================================================
 * 我的宠物（网页兜底页 #/pet）
 * 猫用纯 CSS 画，变量 --pt-fur / --pt-fur2 由皮肤决定；
 * 不用图片、不用渐变，样式独立成 .pt-* 防止被 7700 行后的简约风覆盖。
 * ========================================================= */
.pt-advice {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dbe7fb;
  background: #f5f8ff;
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 14px;
}
.pt-advice.is-urge { border-color: #f5d9a8; background: #fdf7ec; }
.pt-advice.is-warn { border-color: #f6c9c7; background: #fdf1f0; }
.pt-advice-main { flex: 1 1 auto; min-width: 0; }
.pt-advice b { font-size: 13px; color: #1f2937; font-weight: 500; }
.pt-advice p { margin: 3px 0 0; font-size: 12px; color: #5f6b7a; line-height: 1.6; }
.pt-advice-cta {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 99px;
  background: #2b6cf6;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}
.pt-advice.is-urge .pt-advice-cta { background: #b45309; }
.pt-advice.is-warn .pt-advice-cta { background: #c0392b; }

.pt-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.pt-left { padding: 16px 16px 18px; text-align: center; }
.pt-right { padding: 14px 16px 16px; }

.pt-stage { position: relative; width: 190px; height: 190px; margin: 0 auto 2px; display: flex; align-items: center; justify-content: center; }
/* 形象是「桌面动物园」的 12 帧精灵表（public/pet-zoo/），尺寸由行内 --pzu 控制 */
.pt-stage .pz { flex: none; }
/* 喂食动效：只抖宠物本体（.pt-stage-body），展示栏里的「我饿了 / 去做题」提醒保持不动 */
.pt-stage-body { position: relative; display: flex; align-items: center; justify-content: center; }
.pt-stage-body.is-eating { animation: ptChew .34s ease-in-out 5; }
@keyframes ptChew {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-6px) scale(1.045, .965); }
  72% { transform: translateY(0) scale(.97, 1.03); }
}
.pt-eat-fx {
  position: absolute; left: 50%; top: 18px; z-index: 2;
  transform: translateX(-50%);
  padding: 2px 9px; border-radius: 99px;
  background: #fff; border: 1px solid #dbe7fb;
  font-size: 12px; color: #2b6cf6; white-space: nowrap;
  pointer-events: none;
  animation: ptEatUp 1.6s ease-out forwards;
}
@keyframes ptEatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.82); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pt-stage-body.is-eating, .pt-eat-fx { animation: none !important; }
}
/* 心情（饿 / 困）的视觉处理在 pet-zoo.js 里按 .pz.mood-* 走，这里不用再写 */

.pt-name b { font-size: 15px; color: #1f2937; font-weight: 500; }
.pt-name em { display: block; font-style: normal; font-size: 12px; color: #6b7280; margin-top: 2px; }
.pt-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
/* 改名：小号描边按钮，别抢名字的注意力 */
.pt-rename {
  flex: none; padding: 1px 7px; font-size: 11px; font-family: inherit; line-height: 1.6;
  color: #6b7280; background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; cursor: pointer;
}
.pt-rename:hover { color: #2b6cf6; border-color: #b9cff8; background: #f7faff; }
.pt-bar { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 11.5px; color: #6b7280; }
.pt-bar > span:first-child { flex: 0 0 26px; text-align: left; }
.pt-bar-track { flex: 1 1 auto; height: 7px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.pt-bar-track i { display: block; height: 100%; background: #2b6cf6; border-radius: 99px; transition: width .3s; }
.pt-bar-track.is-full i { background: #6cc08a; }
.pt-bar-num { flex: 0 0 auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: #9aa3af; }

/* 12 个形象平铺显示（不分组）：5 列，最多 3 行，不需要滚动 */
.pt-skins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 14px; padding-right: 2px; }
.pt-skin {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 2px 3px; border: 1px solid #e6e9ef; background: #fff; border-radius: 9px;
  font-size: 11px; color: #4b5563; cursor: pointer; line-height: 1.2;
}
.pt-skin:hover { background: #eef4ff; border-color: #9dbbf5; }
.pt-skin-art { display: flex; align-items: center; justify-content: center; width: 100%; height: 38px; }
.pt-skin em { font-style: normal; font-size: 10px; color: #6b7280; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pt-skin.on { border-color: #2b6cf6; background: #f5f8ff; color: #1d4ed8; }
.pt-skin.on em { color: #1d4ed8; }
.pt-skin { position: relative; }
.pt-skin.is-lock { opacity: .62; cursor: not-allowed; }
/* 未解锁的形象右上角标一下门槛，光灰掉学生不知道要练到几级 */
.pt-skin-lv {
  position: absolute; top: 2px; right: 2px;
  font-style: normal; font-size: 10px; line-height: 1.4;
  padding: 0 3px; border-radius: 4px;
  background: #fdf6e8; color: #8a5a12;
}
.pt-points { margin-left: auto; font-size: 12px; color: #6b7280; }
.pt-points b { color: #b45309; font-size: 13px; }
.pt-foods { display: grid; gap: 10px; margin-top: 10px; }
.pt-food {
  border: 1px solid #e3e9f3;
  border-radius: 11px;
  padding: 11px 12px;
  background: linear-gradient(180deg, #fcfdff, #f7f9fd);
  transition: border-color .15s, box-shadow .15s;
}
.pt-food:hover { border-color: #cfd9ec; box-shadow: 0 8px 18px -16px rgba(20, 40, 90, .55); }
.pt-food-h { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #1f2937; }
.pt-food-e { font-size: 17px; line-height: 1; }
.pt-stock { margin-left: auto; font-size: 11.5px; color: #7b8494; background: #eef2f8; border-radius: 999px; padding: 1px 8px; }
.pt-food-d { font-size: 11.5px; color: #6b7280; margin: 5px 0 9px; }
.pt-food-a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.pt-btn {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #334155;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s, filter .15s;
}
.pt-btn.is-buy {
  background: #fff7e8;
  border-color: #f0cf94;
  color: #98590a;
}
.pt-btn.is-buy:hover:not(.is-off) {
  background: #ffefd2;
  border-color: #e3b66c;
  transform: translateY(-1px);
}
.pt-btn.is-feed {
  background: linear-gradient(135deg, #2b6cf6, #4b8bff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(43, 108, 246, .95);
}
.pt-btn.is-feed:hover:not(.is-off) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.pt-btn.is-off {
  opacity: 1;
  background: #f3f5f9;
  border-color: #e1e6ee;
  color: #8b95a5;
  box-shadow: none;
  cursor: not-allowed;
}
.pt-tips { margin-top: 12px; border-top: 1px solid #f1f3f7; padding-top: 10px; }
.pt-tips p { margin: 4px 0; font-size: 11.5px; color: #6b7280; line-height: 1.6; }
.pt-tips b { color: #374151; font-weight: 500; }

@media (max-width: 820px) {
  .pt-grid { grid-template-columns: 1fr; }
  .pt-advice { flex-direction: column; align-items: flex-start; }
  .pt-advice-cta { align-self: flex-end; }
}

/* 做题页题面底部的那只宠物：一条浅色横条，不悬浮、不遮挡 */
.pp-pet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid #eef1f5;
  border-radius: 9px;
  background: #fbfcfd;
}
.pp-pet[hidden] { display: none; }
.pp-pet-art {
  flex: 0 0 46px;
  width: 46px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pp-pet-main { flex: 1 1 auto; min-width: 0; }
.pp-pet-top { display: flex; align-items: baseline; gap: 8px; }
.pp-pet-top b { font-size: 12.5px; color: #10283a; font-weight: 500; }
.pp-pet-top em {
  font-style: normal;
  font-size: 11px;
  color: #9aa3af;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.pp-pet-main p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pp-pet-go { flex: 0 0 auto; }
.pp-pet-x {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: #b4bcc8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.pp-pet-x:hover { background: #eef1f5; color: #6b7280; }

@media (max-width: 560px) {
  .pp-pet { gap: 8px; padding: 8px 9px; }
  .pp-pet-main p { -webkit-line-clamp: 1; }
  .pp-pet-go { display: none; }
}
/* ---------- 宠物形象库：39 种动物 × 3 配色 = 117 个 ---------- */
/* 原来的 5 列平铺只够放 12 个，117 个会变成一堵墙。改成「栖息地 → 物种 → 配色」三层：
   一行一个物种（左边名字、右边 3 个配色），整块限高可滚动，栖息地标题吸顶。 */
.pt-skins { display: block; max-height: 372px; overflow-y: auto; overscroll-behavior: contain;
  margin-top: 12px; padding-right: 4px; }
.pt-hab { position: sticky; top: 0; z-index: 1; margin: 10px 0 5px; padding: 3px 2px;
  font-size: 11px; color: #6b7280; background: #fff; border-bottom: 1px solid #eef1f6; }
.pt-hab:first-child { margin-top: 0; }
.pt-sp-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.pt-sp-row.is-lock .pt-sp-name { color: #9ca3af; }
.pt-sp-name { flex: none; width: 58px; font-size: 11px; line-height: 1.25; color: #374151;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-sp-name em { display: block; font-style: normal; font-size: 10px; color: #9ca3af; }
.pt-sp-list { display: flex; gap: 5px; flex: 1 1 auto; min-width: 0; }
.pt-sp-list .pt-skin { flex: 1 1 0; min-width: 0; padding: 3px 2px 2px; }
.pt-sp-list .pt-skin-art { height: 30px; }
.pt-sp-list .pt-skin em { font-size: 9px; }

/* 形象库顶部那行：左边「已拥有 x / 114」，右边一句规则说明（2026-11-16 去掉栖息地标签后加的） */
.pt-skins-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; margin-top: 14px; }
.pt-skins-head > span:first-child { font-size: 12px; font-weight: 600; color: #374151; }
.pt-skins-head em { font-style: normal; margin-left: 6px; font-size: 11px; font-weight: 400; color: #9ca3af; }
.pt-skins-rule { font-size: 11px; color: #9ca3af; }
.pt-skins { margin-top: 8px; }

/* 第 2 / 3 个配色：等级到了但还没买 —— 虚线框 + 右上角标价 */
.pt-skin.is-buy { border-style: dashed; border-color: #dcc39a; background: #fffdf8; }
.pt-skin.is-buy:hover { border-color: #dfa94f; background: #fff8ea; }

/* ---------- 赛季光环（2026-11-16）：积分盈余的长期出口 ----------
   纯 CSS：conic-gradient 画一圈色环，再用 radial mask 挖成「环」。
   上架 / 拥有 / 戴着三种状态，样式只做区分，判断全在服务端。 */
.pt-halos {
  margin: 14px 4px 4px;
  padding: 10px 12px 12px;
  border: 1px solid #e7e3f4;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfaff, #ffffff);
}
.pt-halos-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pt-halos-head > span:first-child { font-size: 12px; font-weight: 600; color: #374151; }
.pt-halos-head em { font-style: normal; margin-left: 6px; font-size: 11px; font-weight: 400; color: #9ca3af; }
.pt-halos-rule { margin-left: auto; font-size: 11px; color: #9ca3af; }
.pt-halo-off {
  border: 0; background: none; padding: 0 2px; cursor: pointer;
  font-size: 11.5px; color: #2b6cf6;
}
.pt-halo-off:hover { text-decoration: underline; }
.pt-halo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.pt-halo {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 78px; padding: 8px 8px 6px;
  border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pt-halo b { font-size: 12px; font-weight: 500; color: #374151; }
.pt-halo em { font-style: normal; font-size: 11px; color: #9ca3af; }
.pt-halo:hover { border-color: #c7d2fe; background: #fafaff; }
.pt-halo.is-on { border-color: #7c6cf6; background: #f5f3ff; }
.pt-halo.is-on b { color: #4c3fd6; }
.pt-halo.is-on em { color: #6f5fe0; }
.pt-halo.is-buy { border-style: dashed; border-color: #d9c6f0; }
.pt-halo.is-off { opacity: .55; cursor: default; }
.pt-halo.is-off:hover { border-color: #e5e7eb; background: #fff; }

/* 小色块：和真正戴上的光环同一套颜色，方便一眼认出是哪款 */
.pt-halo-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--hl-a), var(--hl-b), var(--hl-c), var(--hl-a));
  -webkit-mask: radial-gradient(closest-side, transparent 52%, #000 58%);
  mask: radial-gradient(closest-side, transparent 52%, #000 58%);
}
.pt-halo-dot.is-big { width: 66px; height: 66px; }
.pt-halo-dot.h-star { --hl-a: #ffd76e; --hl-b: #fff6d6; --hl-c: #f2a93b; }
.pt-halo-dot.h-ember { --hl-a: #ff8a3d; --hl-b: #ffd166; --hl-c: #e2452f; }
.pt-halo-dot.h-tide { --hl-a: #56c8e8; --hl-b: #d6f4ff; --hl-c: #2b6cf6; }
.pt-halo-dot.h-nebula { --hl-a: #8f7bff; --hl-b: #ffd1f2; --hl-c: #4c3fd6; }
.pt-halo-dot.h-prism { --hl-a: #7ef2c1; --hl-b: #ffe27a; --hl-c: #7aa8ff; }

/* 展示框 / 浮动宠物身上那圈光 */
.pt-stage.has-halo .pt-stage-body::before,
.fpet-art.has-halo::before,
.ubp-figure.has-halo::before {
  content: '';
  position: absolute; left: 50%; top: 53%;
  width: 104%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 0; pointer-events: none;
  background: conic-gradient(from 0deg, var(--hl-a), var(--hl-b), var(--hl-c), var(--hl-a));
  -webkit-mask: radial-gradient(closest-side, transparent 68%, #000 71%, #000 84%, transparent 86%);
  mask: radial-gradient(closest-side, transparent 68%, #000 71%, #000 84%, transparent 86%);
  opacity: .82;
  animation: haloSpin 9s linear infinite;
}
.pt-stage.has-halo .pz,
.fpet-art.has-halo .pz,
.ubp-figure.has-halo .pz { position: relative; z-index: 1; }
.pt-stage.has-halo.halo-star,
.fpet-art.has-halo.halo-star,
.ubp-figure.has-halo.halo-star { --hl-a: #ffd76e; --hl-b: #fff6d6; --hl-c: #f2a93b; }
.pt-stage.has-halo.halo-ember,
.fpet-art.has-halo.halo-ember,
.ubp-figure.has-halo.halo-ember { --hl-a: #ff8a3d; --hl-b: #ffd166; --hl-c: #e2452f; }
.pt-stage.has-halo.halo-tide,
.fpet-art.has-halo.halo-tide,
.ubp-figure.has-halo.halo-tide { --hl-a: #56c8e8; --hl-b: #d6f4ff; --hl-c: #2b6cf6; }
.pt-stage.has-halo.halo-nebula,
.fpet-art.has-halo.halo-nebula,
.ubp-figure.has-halo.halo-nebula { --hl-a: #8f7bff; --hl-b: #ffd1f2; --hl-c: #4c3fd6; }
.pt-stage.has-halo.halo-prism,
.fpet-art.has-halo.halo-prism,
.ubp-figure.has-halo.halo-prism { --hl-a: #7ef2c1; --hl-b: #ffe27a; --hl-c: #7aa8ff; }
@keyframes haloSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
/* 浮动宠物身上那圈光：容器没有定位，补一个（翻转写在 .fpet-art 上，光跟着一起翻，环是对称的无所谓） */
.fpet-art.has-halo { position: relative; }
@media (prefers-reduced-motion: reduce) {
  .pt-stage.has-halo .pt-stage-body::before,
  .fpet-art.has-halo::before,
  .ubp-figure.has-halo::before { animation: none; }
}
.pt-skin-price { position: absolute; top: -5px; right: -4px; padding: 0 4px; border-radius: 7px;
  background: #f59e0b; color: #fff; font-style: normal; font-size: 9px; font-weight: 600;
  line-height: 14px; box-shadow: 0 2px 6px rgba(245, 158, 11, .35); }
.pt-skin-price::after { content: "分"; font-size: 8px; opacity: .92; }

/* 买配色的确认弹窗 */
.skin-buy { display: flex; align-items: center; gap: 14px; }
.skin-buy-art { flex: none; width: 92px; display: flex; justify-content: center; }
.skin-buy-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.skin-buy-txt b { font-size: 15px; color: var(--text); }
.skin-buy-txt em { font-style: normal; font-size: 12px; color: var(--muted); }
.skin-buy-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; padding-top: 5px;
  border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--text-2); }
.skin-buy-row b { font-size: 13px; color: var(--text); }
.skin-buy-price { color: #b45309 !important; }
.skin-buy-lack { margin-top: 4px; padding: 5px 8px; border-radius: 8px; background: var(--mle-soft);
  color: var(--mle); font-size: 12px; }

/* ---------- 个人主页：宠物卡 ---------- */
/* 宠物页那套（#/pet）是完整管理界面；这里是「展示位」：
   自己的能顺手喂一口，别人的只读 —— 点进任何人的主页都能看到 TA 养的那只。 */
.ub-pet { padding: 14px 16px; }
.ubp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.ubp-title { font-size: 13px; font-weight: 600; color: #374151; }
.ubp-lv { font-size: 12px; color: #6b7280; }
.ubp-body { display: flex; align-items: center; gap: 14px; }
.ubp-art { flex: none; width: 156px; height: 112px; display: flex; align-items: center; justify-content: center; }
.ubp-art .pz { flex: none; }
.ubp-figure { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ubp-info { flex: 1 1 auto; min-width: 0; }
.ubp-name { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ubp-name b { font-size: 15px; color: #111827; }
.ubp-name em { font-style: normal; font-size: 11px; color: #6b7280; background: #f3f4f6; padding: 1px 6px; border-radius: 6px; }
.ubp-mood { font-size: 11px; color: #9ca3af; }
.ubp-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 11px; color: #6b7280; }
.ubp-bar > span { flex: none; width: 26px; }
.ubp-bar > i { flex: 1 1 auto; height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.ubp-bar > i > b { display: block; height: 100%; background: #2b6cf6; border-radius: 4px; }
.ubp-bar.is-full > i > b { background: #22b07d; }
.ubp-bar > em { flex: none; font-style: normal; color: #9ca3af; }
.ubp-acts { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ubp-empty { color: #9ca3af; font-size: 12px; padding: 4px 0; }

/* 侧栏里的宠物卡：窄，改成上下排，形象占满一排 */
.ub-side .ub-pet { padding: 14px; }
.ub-side .ubp-body { flex-direction: column; align-items: stretch; gap: 10px; }
.ub-side .ubp-art { width: 100%; height: 138px; }
.ub-side .ubp-info { width: 100%; }

@media (max-width: 720px) {
  .ubp-body { flex-wrap: wrap; }
  .ubp-art { width: 100%; height: 96px; }
}

/* ---------- 学习报告（周报 / 月报 / 年报）：不要纯文字 ---------- */
/* 顶部四张卡：一个彩色图标 + 数字，第 2 张右侧挂一个活跃率环 */
.rpt-sc { display: flex; align-items: center; gap: 10px; }
.rpt-sc-txt { flex: 1 1 auto; min-width: 0; }
.rpt-sc-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px; line-height: 1;
  background: color-mix(in srgb, var(--c, #2b6cf6) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--c, #2b6cf6) 22%, #fff); }
.rpt-ring { flex: none; width: 34px; height: 34px; border-radius: 50%; margin-left: auto;
  background: conic-gradient(#22b07d calc(var(--p, 0) * 1%), #edf1f7 0);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 57%);
  mask: radial-gradient(circle, transparent 56%, #000 57%); }

/* 全班提交量柱图 */
.rpt-chart { padding: 12px 14px 10px; overflow: hidden; }
.rpt-chart-head { font-size: 12px; color: #374151; margin-bottom: 6px; display: flex;
  justify-content: space-between; gap: 10px; }
.rpt-chart-head .muted { font-size: 11px; }
.rpt-bars { display: flex; align-items: flex-end; gap: 4px; height: 74px;
  padding: 2px 2px 0; overflow-x: auto; overflow-y: hidden; }
.rpt-bars > i { flex: 1 1 0; min-width: 4px; height: var(--h, 2%); border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #6f9dfb, #2b6cf6); cursor: pointer;
  transition: filter .15s, transform .15s; }
.rpt-bars > i.is-idle { background: #e7ebf2; cursor: default; }
.rpt-bars > i:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* 每行：头像 + 名字 + 徽章，数字下面挂相对全班的横条 */
.rpt-av { width: 24px; height: 24px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #7aa6fb, #2b6cf6); vertical-align: middle; }
.rpt-av.is-lg { width: 42px; height: 42px; font-size: 18px; }
.rpt-who { white-space: nowrap; }
.rpt-who .rpt-av { margin-right: 7px; }
.rpt-who-txt { display: inline-block; vertical-align: middle; line-height: 1.3; }
.rpt-who-txt b { display: block; font-size: 13px; }
.rpt-who-txt .rpt-tag { margin-top: 2px; }
.rpt-tag { display: inline-block; font-size: 10px; line-height: 1.6; padding: 0 6px;
  border-radius: 999px; background: #f3f5f9; color: #6b7280; }
.rpt-tag.is-hot { background: #fff1e6; color: #c2620f; }
.rpt-tag.is-ok { background: #e8f7ef; color: #12905f; }
.rpt-tag.is-idle { background: #f3f4f6; color: #9ca3af; }
.rpt-cell { white-space: nowrap; }
.rpt-num { font-size: 13px; color: #111827; font-variant-numeric: tabular-nums; }
.rpt-num b { font-weight: 600; }
.rpt-num em { font-style: normal; font-size: 11px; color: #9ca3af; margin-left: 2px; }
.rpt-cell .rpt-bar { display: block; width: 96px; height: 4px; margin: 4px 0 2px; }
.rpt-sub { font-size: 10px; color: #9ca3af; }
.rpt-bar { display: inline-block; height: 5px; background: #edf1f7; border-radius: 999px; overflow: hidden; }
.rpt-bar > b { display: block; height: 100%; border-radius: 999px; background: #2b6cf6; }
.rpt-bar.is-subs > b { background: linear-gradient(90deg, #6f9dfb, #2b6cf6); }
.rpt-bar.is-ac > b { background: linear-gradient(90deg, #6adea6, #22b07d); }
.rpt-bar.is-study > b { background: linear-gradient(90deg, #a98cf7, #7c5cf0); }
.rpt-bar.is-solved > b { background: linear-gradient(90deg, #f7b267, #e07a1f); }
.rpt-table-rich td { vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
.rpt-table-rich tr.is-idle { opacity: .72; }
.rpt-delta.is-up { color: #12905f; }
.rpt-delta.is-down { color: #c2410c; }

/* 点开的报告卡 */
.rptp-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rptp-who b { display: block; font-size: 16px; color: #111827; }
.rptp-who span { font-size: 12px; color: #6b7280; }
.rptp-badge { margin-left: auto; font-size: 11px; padding: 2px 9px; border-radius: 999px; }
.rptp-badge.is-live { background: #e8f7ef; color: #12905f; }
.rptp-badge.is-idle { background: #f3f4f6; color: #9ca3af; }
.rptp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rptp-kpi { display: flex; flex-direction: column; gap: 5px; padding: 10px 11px;
  background: #f8fafd; border: 1px solid #eef1f6; border-radius: 10px; }
.rptp-kpi > span { font-size: 11px; color: #6b7280; }
.rptp-kpi > b { font-size: 18px; color: #111827; font-variant-numeric: tabular-nums; }
.rptp-kpi .rpt-bar { height: 4px; }
.rptp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rptp-tag { font-size: 11px; color: #4b5563; background: #f3f5f9; border-radius: 999px; padding: 3px 9px; }
.rptp-tag.is-hot { background: #fff1e6; color: #c2620f; }
.rptp-tag.is-ok { background: #e8f7ef; color: #12905f; }
.rptp-wrongs { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rptp-wrongs-k { font-size: 11px; color: #6b7280; margin-right: 2px; }
.rptp-wrong { font-size: 11px; color: #9a3412; background: #fff4ed; border-radius: 6px; padding: 2px 7px; }
.rptp-tip { margin-top: 12px; font-size: 12px; color: #374151; background: #f6f9ff;
  border: 1px solid #e6eeff; border-radius: 10px; padding: 9px 11px; line-height: 1.7; }
.rptp-raw { margin-top: 12px; }
.rptp-raw > summary { font-size: 12px; color: #6b7280; cursor: pointer; }
.rptp-raw > summary:hover { color: #2b6cf6; }
.rptp-raw > pre { margin: 8px 0 0; padding: 10px 12px; background: #f7f9fc; border-radius: 8px;
  font-size: 12px; line-height: 1.75; color: #4b5563; white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow: auto; }
.rptp-empty { margin-top: 12px; font-size: 12px; color: #9ca3af; }
@media (max-width: 720px) {
  .rptp-grid { grid-template-columns: repeat(2, 1fr); }
  .rpt-cell .rpt-bar { width: 68px; }
}

/* ---------- 网页浮动宠物（入口：「个人资料 → 宠物」） ---------- */
.fpet {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 780;
  width: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  /* 位置全靠 transform：每帧只动合成层，不触发重排 */
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.fpet:active { cursor: grabbing; }
.fpet-art.is-flip { transform: scaleX(-1); }
.fpet-art {
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(20, 25, 35, 0.16));
}
/* ---- 宠物定时提醒弹窗（2026-11-16）：响铃 + 必须点「我知道了 / 去做题」才收回，
        故意没有 × 和遮罩点击关闭，Esc 也不响应 ---- */
.prm-modal { max-width: 360px; text-align: center; padding: 22px 24px 18px; }
.prm-modal .prm-emoji { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.prm-modal h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.prm-modal p { margin: 0 0 16px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.prm-modal p b { color: var(--text); }
/* 自定义提醒内容当主文案，宠物名 + 时间降成小字 */
.prm-modal .prm-said { font-size: 14.5px; color: var(--text); margin-bottom: 7px; word-break: break-word; }
.prm-modal .prm-by { font-size: 11.5px; color: var(--muted); margin-bottom: 16px; }
.prm-btns { display: flex; gap: 10px; justify-content: center; }
.prm-btns .btn { min-width: 108px; }
.fpet-bubble {
  position: absolute;
  bottom: 100%;
  right: -4px;
  margin-bottom: 6px;
  width: 208px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 25, 35, 0.13);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  cursor: default;
}
.fpet-bubble b { display: block; font-size: 13px; color: var(--text); }
.fpet-bubble em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.fpet-bubble p { margin: 4px 0 7px; }
.fpet-bubble a { color: var(--brand); font-weight: 500; }
.fpet-bubble[hidden] { display: none; }

/* 宠物交互面板：聊天 / 搜题 / 周报 / 提醒（点浮动宠物打开） */
.fpet-panel {
  position: absolute;
  bottom: 100%;
  right: -4px;
  margin-bottom: 6px;
  width: 272px;
  max-height: min(60vh, 430px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 14px 34px rgba(20, 25, 35, 0.17);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: default;
  overflow: hidden;
}
.fpet-panel[hidden] { display: none; }
.fp-top { display: flex; align-items: center; gap: 8px; padding: 9px 11px 6px; }
.fp-top b { font-size: 13px; color: var(--text); }
.fp-top span { font-size: 11px; color: var(--muted); }
.fp-x { margin-left: auto; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.fp-x:hover { color: var(--text); }
.fp-tabs { display: flex; gap: 3px; padding: 0 8px 7px; border-bottom: 1px solid var(--line-soft); }
.fp-tabs button { flex: 1; border: 0; background: none; font-size: 11px; padding: 5px 2px; border-radius: 7px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.fp-tabs button:hover { background: var(--brand-soft); }
.fp-tabs button.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.fp-body { padding: 9px 11px; overflow-y: auto; flex: 1 1 auto; min-height: 60px; }
.fp-hint { margin: 0 0 8px; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.fp-hint.small { font-size: 10.5px; margin: 6px 0 0; }
.fp-loading { padding: 14px 0; text-align: center; color: var(--muted); font-size: 11.5px; }
.fp-input { display: flex; gap: 5px; padding: 7px 9px 9px; border-top: 1px solid var(--line-soft); }
.fp-input input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; outline: none; }
.fp-input input:focus { border-color: var(--brand); }
.fp-input button { border: 0; border-radius: 8px; padding: 0 11px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.fp-input button:hover { filter: brightness(1.06); }
.fp-find-list { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.fp-find-item { display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 8px; text-decoration: none; color: var(--text-2); }
.fp-find-item:hover { background: var(--brand-soft); }
.fp-find-item b { color: var(--brand); font-size: 11.5px; white-space: nowrap; }
.fp-find-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-find-item em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.fp-week-h { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.fp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.fp-kpis div { text-align: center; background: var(--brand-soft); border-radius: 8px; padding: 6px 2px; }
.fp-kpis b { display: block; font-size: 16px; color: var(--brand-dark); }
.fp-kpis span { font-size: 10px; color: var(--muted); }
.fp-week-bars { display: flex; align-items: flex-end; gap: 4px; height: 74px; margin: 10px 0 4px; }
.fp-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.fp-bar i { display: block; width: 100%; min-height: 2px; background: linear-gradient(180deg, #7aa8ff, var(--brand)); border-radius: 3px 3px 0 0; }
.fp-bar em { font-style: normal; font-size: 9px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.fp-week-foot { font-size: 11px; color: var(--muted); text-align: center; }
.fp-remind-row { display: flex; align-items: center; gap: 9px; }
.fp-switch { position: relative; width: 34px; height: 19px; flex: none; }
.fp-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.fp-switch span { display: block; width: 100%; height: 100%; border-radius: 999px; background: #cbd5e1; transition: background .2s; }
.fp-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s; }
.fp-switch input:checked + span { background: var(--brand); }
.fp-switch input:checked + span::after { transform: translateX(15px); }
.fp-time { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; font-family: inherit; color: inherit; background: #2a2e34; }
/* 提醒内容输入框（可自定义）：多行、跟时间框同色，写满 60 字刚好两行 */
.fp-text {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
  font-size: 12px; font-family: inherit; line-height: 1.55; color: inherit;
  background: #2a2e34; resize: none; outline: none;
}
.fp-text::placeholder { color: #868e99; }
.fp-text:focus { border-color: #7d9fd6; }

/* 浮动宠物卡片：中性灰（2026-11-16 用户要求「改灰色试试」，桌面端仍是近黑）。
   做法：在卡片作用域内重定义主题变量，下面几十条 .fp-* 规则不用逐条改颜色。
   ⚠ 不要改回半透明底 —— 浮层压在页面内容上，半透明底会让小字发虚。 */
.fpet-panel,
.fpet-bubble {
  --line: #444b54;
  --line-soft: #3a4048;
  --text: #f2f4f7;
  --text-2: #d5dae1;
  --muted: #a0a8b3;
  --brand-soft: #3f454e;
  --brand-dark: #b9d2ff;
  background: #33383f;
  border-color: #444b54;
  color: #d5dae1;
  box-shadow: 0 14px 34px rgba(15, 20, 28, .34);
}
.fpet-bubble { box-shadow: 0 10px 26px rgba(15, 20, 28, .34); }
.fpet-bubble b { color: #f2f4f7; }
.fpet-bubble a { color: #a8c6fa; }
.fp-input input {
  background: #2a2e34; border-color: #4a515a; color: #f0f3f7;
}
.fp-input input::placeholder { color: #868e99; }
.fp-input input:focus { border-color: #7d9fd6; }
.fp-switch span { background: #535a64; }
.fp-switch span::after { background: #e3e8ee; }
.fp-kpis b { color: #f4f7fb; }
.fp-tabs button.on { background: #4b525c; color: #f2f5f9; }
.fp-find-item:hover { background: #3d434b; }
/* 灰底下的滚动条（浅色轨道会像一道白边） */
.fpet-panel .fp-body { scrollbar-width: thin; scrollbar-color: #535a64 transparent; }
.fpet-panel .fp-body::-webkit-scrollbar { width: 7px; }
.fpet-panel .fp-body::-webkit-scrollbar-track { background: transparent; }
.fpet-panel .fp-body::-webkit-scrollbar-thumb { background: #535a64; border-radius: 99px; }
.fpet-panel .fp-body::-webkit-scrollbar-thumb:hover { background: #636b76; }
/* 做题页「安静模式」：整体淡一点、精灵表放慢一倍多，不抢注意力 */
.fpet.is-calm { opacity: 0.78; }
.fpet.is-calm .pz { animation-duration: calc(var(--pzd) * 2.2) !important; }
@media (max-width: 720px) {
  /* 手机登录后照样显示浮动宠物：浮层贴着宠物往左展开，限宽不溢出屏幕 */
  .fpet-panel { right: 0; width: min(272px, calc(100vw - 24px)); max-height: min(54vh, 380px); }
  .fpet-bubble { right: 0; width: min(208px, calc(100vw - 24px)); }
}

/* ---------- 宠物页 →「换个玩法」：两张并列卡片（网页浮动 / 桌面版） ---------- */
.pt-set-panel { margin-bottom: 18px; }
.pt-way-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pt-way {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 15px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fd 100%);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  overflow: hidden;
}
/* 右上角一层很淡的光，纯装饰（不影响点击） */
.pt-way::after {
  content: '';
  position: absolute;
  top: -48px;
  right: -38px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 108, 246, 0.1), rgba(43, 108, 246, 0) 70%);
  pointer-events: none;
}
.pt-way-dl::after {
  background: radial-gradient(circle, rgba(15, 157, 110, 0.11), rgba(15, 157, 110, 0) 70%);
}
.pt-way:hover {
  border-color: #c9dcf8;
  box-shadow: 0 10px 24px rgba(20, 40, 80, 0.07);
  transform: translateY(-1px);
}
.pt-way.is-on {
  border-color: #a9c9f6;
  background: linear-gradient(180deg, #f2f8ff 0%, #e9f2ff 100%);
  box-shadow: inset 0 0 0 1px rgba(43, 108, 246, 0.12);
}
.pt-way-top { display: flex; align-items: center; gap: 10px; }
.pt-way-ico {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(150deg, #5b9bfb, var(--brand));
  box-shadow: 0 6px 14px rgba(43, 108, 246, 0.26);
}
.pt-way-dl .pt-way-ico {
  background: linear-gradient(150deg, #34d399, var(--ac));
  box-shadow: 0 6px 14px rgba(15, 157, 110, 0.24);
}
.pt-way-tit { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pt-way-tit b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pt-way-tit em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.pt-way-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.62;
  color: var(--muted);
}
.pt-way-foot {
  margin-top: auto;
  padding-top: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pt-way-badge {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
  white-space: nowrap;
}
.pt-way.is-on .pt-way-badge {
  border-color: #c7ddff;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

/* 开关：44×24 的胶囊，选中时右滑变蓝 */
.pt-sw {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  margin-left: auto;
  cursor: pointer;
}
.pt-sw input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.pt-sw i {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  border-radius: 999px;
  background: #d3dbe7;
  transition: background 0.18s ease;
  pointer-events: none;
}
.pt-sw i::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 21, 38, 0.26);
  transition: transform 0.18s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.pt-sw input:checked + i { background: linear-gradient(135deg, #5b9bfb, var(--brand)); }
.pt-sw input:checked + i::after { transform: translateX(20px); }
.pt-sw input:focus-visible + i { box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.2); }

/* 下载按钮：绿色渐变，和左边蓝卡片区分开 */
.pt-way-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 9px;
  background: linear-gradient(180deg, #21b981, var(--ac));
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(15, 157, 110, 0.24);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.pt-way-btn:hover {
  color: #fff;
  text-decoration: none;
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(15, 157, 110, 0.28);
}
.pt-way-btn:active { transform: translateY(0); }
.pt-way-soon { margin-left: auto; font-size: 12px; color: var(--muted); }

/* 面板底部那行小字（原来 .form-hint 没有样式，浏览器默认 16px 段落太抢眼） */
.pt-set-panel .form-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.62;
  color: var(--muted);
}

/* 窄屏：卡片竖着排，副标题那行不挤 */
@media (max-width: 720px) {
  .pt-way-grid { grid-template-columns: 1fr; }
}

/* ---------- 每周做题任务卡（我的积分） ---------- */
/* 直接复用 .progress-bar 的配色，简约风覆盖自动生效，这里只管排版 */
.wk-card { margin-top: 14px; }
.wk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wk-head b { font-size: 14px; }
.wk-head span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.wk-num { font-size: 22px; font-weight: 700; color: var(--ac); white-space: nowrap; }
.wk-num em { font-size: 13px; font-style: normal; color: #9aa3b0; font-weight: 500; }
.wk-card .progress-bar { width: 100%; height: 7px; margin: 11px 0 7px; }
.wk-foot { font-size: 12px; color: var(--muted); }

/* ---------- 作业延期 / 系统错题作业 ---------- */
.hw-badge.b-delay { background: #ede9fe; color: #6d28d9; }
.hw-badge.b-auto { background: #e0f2fe; color: #0369a1; }
.hw-delay-note { color: #6d28d9; font-size: 11px; margin-left: 4px; }
.hw-foot-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.hw-delay-btn {
  padding: 4px 10px; font-size: 11.5px; font-weight: 600;
  color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 7px;
}
.hw-delay-btn:hover:not([disabled]) { background: #ede9fe; border-color: #c4b5fd; }
.hw-delay-btn[disabled] { opacity: .55; cursor: default; }

/* ---------------- 氛围模拟器（2026-11-17） ---------------- */
/* 题库首页顶部那条：在线人数 + 最近 AC 流水 */
.simb {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 14px; padding: 8px 12px;
  border: 1px solid #e3ecf7; border-radius: 10px;
  background: #f7faff; font-size: 12.5px; color: var(--text-2);
  overflow: hidden;
}
.simb[hidden] { display: none; }
.simb-live { display: inline-flex; align-items: center; gap: 6px; flex: none; font-weight: 600; color: #2563eb; }
.simb-live i {
  width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
  animation: simbPulse 2.2s ease-in-out infinite;
}
@keyframes simbPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .simb-live i { animation: none; } }
.simb-feed { display: flex; gap: 18px; overflow: hidden; white-space: nowrap; min-width: 0; }
.simb-item { color: var(--muted); flex: none; }
.simb-item a { color: #2563eb; text-decoration: none; }
.simb-item a:hover { text-decoration: underline; }

/* 管理页：氛围模拟器面板 */
.sim-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.sim-toggle input { width: 15px; height: 15px; }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.sim-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.sim-grid label em { font-style: normal; font-size: 11px; color: #9aa7b6; }
.sim-grid .input { width: 100%; }
.sim-hint { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* 氛围模拟器：活跃时段（可多段） */
.sim-ranges { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sim-ranges-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sim-ranges-head b { font-size: 13px; color: var(--text); }
.sim-ranges-head .muted { font-size: 12px; }
.sim-range-list { display: flex; flex-direction: column; gap: 8px; }
.sim-range-row { display: flex; align-items: center; gap: 8px; }
.sim-range-row .input { width: 132px; }
.sim-range-sep { font-size: 12.5px; color: var(--muted); }
/* 各老师的模拟学员数：一行一个老师 */
.sim-teacher-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.sim-teacher-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sim-teacher-row .st-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.sim-teacher-row .input { width: 88px; flex: 0 0 auto; }
.sim-teacher-row em { font-size: 11.5px; color: var(--muted); font-style: normal; flex: 0 0 auto; }
/* 班级行里的小字老师名 */
.sim-teacher-row .st-t { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.sim-teachers { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
@media (max-width: 720px) { .sim-teacher-list { grid-template-columns: 1fr; } }
.lv-fd-link { color: #3f4a56; }
/* 模拟同学的评论：只当氛围，点赞/收藏/回复/加好友都没真实对象，整排隐藏 */
.cm-acts.is-sim { display: none; }

/* ---------- 游客浏览模式 + 微信扫码登录（2026-11-17） ---------- */
.pending-bar .pb-text { flex: 1 1 auto; min-width: 0; }
.pending-bar.is-guest { background: #eef4ff; border-color: #c9dbff; color: #2b4a8a; }
.pending-bar.is-guest .btn { flex: none; }
.guest-tag {
  font-size: 12px; color: #5a6b85; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.login-tabs { display: flex; gap: 6px; margin: -6px 0 14px; }
.login-tabs .ltab {
  flex: 1; padding: 8px 10px; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--line); background: #f6f7f9; border-radius: 9px; color: var(--text-2);
}
.login-tabs .ltab.on {
  background: #2b6cf6; border-color: #2b6cf6; color: #fff; font-weight: 600;
}
.wx-qr-iframe {
  display: block; width: 100%; max-width: 320px; height: 400px;
  margin: 10px auto 0; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.wx-qr-tip { font-size: 12.5px; color: var(--text-2); text-align: center; line-height: 1.7; }
.wx-qr-tip.wx-off {
  background: #f6f7f9; border: 1px dashed var(--line); border-radius: 10px;
  padding: 14px; text-align: left;
}
.guest-panel { text-align: center; padding: 28px 20px; }
.guest-panel .guest-emoji { font-size: 34px; margin-bottom: 6px; }
.guest-panel h2 { margin: 0 0 8px; font-size: 16px; }
.guest-panel p {
  margin: 0 auto 14px; max-width: 320px; font-size: 12.5px;
  color: var(--text-2); line-height: 1.7;
}
.guest-acts { display: flex; gap: 8px; justify-content: center; }
.guest-note { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.cm-login-tip {
  margin-bottom: 8px; padding: 7px 10px; background: #eef4ff;
  border: 1px solid #c9dbff; border-radius: 8px; font-size: 12px; color: #2b4a8a;
}
.wx-bind { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 12px; }
.wx-bind-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.wx-bind-head b { font-size: 13.5px; }
.wx-bind-state { font-size: 12px; color: var(--text-2); }
.wx-bind-acts { display: flex; gap: 8px; margin-bottom: 6px; }

/* ============ 游客页宠物（2026-11-17）：右下角小家伙，定时/点击冒「注册可领养」 ============ */
.gpet {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 770;
  width: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  /* 位置全靠 transform（JS 随机漫游每帧只改合成层，不触发重排） */
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.gpet-art {
  width: 100%;
  display: flex;
  justify-content: center;
  animation: gpet-bob 3.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(20, 25, 35, 0.18));
}
.gpet-art * { pointer-events: none; }
@keyframes gpet-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.gpet-name {
  margin-top: -2px;
  font-size: 10.5px;
  color: #fff;
  background: rgba(37, 42, 50, 0.85);
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.5;
  white-space: nowrap;
}
.gpet-bubble {
  position: absolute;
  bottom: 100%;
  right: -6px;
  margin-bottom: 4px;
  width: 224px;
  padding: 10px 12px;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e5e8ee);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(20, 25, 35, 0.16);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2, #4a5462);
  cursor: default;
  animation: gpet-pop 0.18s ease-out;
}
.gpet-bubble b { display: block; font-size: 13px; color: var(--text, #141923); margin-bottom: 3px; }
.gpet-bubble .gpet-say { margin: 0 0 8px; }
.gpet-bubble[hidden] { display: none; }
.gpet-acts { display: flex; gap: 8px; }
@keyframes gpet-pop {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 720px) {
  .gpet { width: 62px; }
  .gpet-bubble { width: 200px; right: -8px; }
  .gpet-name { font-size: 9.5px; }
}

/* ============ 邀请好友卡（账号页，2026-11-17） ============ */
.inv-code { font-family: var(--mono); font-size: 15px; letter-spacing: 2px; }
.inv-acts { display: flex; gap: 8px; margin: 10px 0 8px; flex-wrap: wrap; }
.inv-link-tip { display: block; margin-bottom: 4px; }
.inv-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  word-break: break-all;
  background: var(--line-soft, #f0f2f6);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 11.5px;
  color: var(--text-2, #4a5462);
  font-family: var(--mono);
}
.inv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 8px; }
.inv-stats div { text-align: center; background: var(--brand-soft, #eaf0ff); border-radius: 8px; padding: 7px 2px; }
.inv-stats b { display: block; font-size: 15px; color: var(--brand-dark, #1d54c9); }
.inv-stats span { font-size: 10px; color: var(--muted, #78828f); }

/* 微信绑定按钮的 hidden 修复（2026-11-17）：.btn 是 flex，hidden 属性会被覆盖，
   未开启时「解绑」会漏出来 —— 补一条兜底 */
.wx-bind-acts .btn[hidden] { display: none; }

/* ============ 账号页邀请好友卡放到右列（2026-11-17） ============
   账号页两列：左「个人资料」，右「修改密码」+「邀请好友」上下堆叠。
   窄屏单列时右列容器自然排在个人资料下面。 */
.account-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* 宠物页的邀请好友卡（2026-11-17） */
.pt-invite { margin-top: 14px; }

/* ============ 宠物页顺序调整（2026-11-17）：邀请好友在上、换个玩法在食物背包下方 ============ */
.pt-invite { margin: 14px 0; }
/* 「换个玩法」挪进右栏后做成分节，不再套一层卡片边框 */
.pt-right .pt-set-panel {
  margin: 16px 0 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.pt-right .pt-set-panel > .panel-head {
  padding: 0 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.pt-right .pt-set-panel > .form-body { padding: 0; }

/* ============ 邀请卡一行式（2026-11-17）：邀请码 / 邀请链接并排，窄屏堆叠 ============ */
.inv-one-line { display: flex; align-items: stretch; gap: 12px; margin: 2px 0 12px; }
.inv-code-cell, .inv-link-cell {
  min-width: 0;
  background: var(--line-soft, #f0f2f6);
  border-radius: 8px;
  padding: 9px 11px;
}
.inv-code-cell { flex: 0 0 200px; }
.inv-link-cell { flex: 1 1 auto; }
.inv-cell-label { display: block; font-size: 11px; color: var(--muted, #78828f); line-height: 1.5; }
.inv-cell-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; min-width: 0; }
.inv-cell-row .btn { flex: none; }
.inv-one-line .inv-code { font-size: 15px; letter-spacing: 1px; color: var(--text, #141923); }
.inv-one-line .inv-link {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  background: none;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  font-size: 11.5px;
  color: var(--text-2, #4a5462);
}
/* 学员自定义邀请码（2026-11-22） */
.inv-custom-row {
  margin: 0 0 12px;
  padding: 9px 11px;
  background: var(--line-soft, #f0f2f6);
  border-radius: 8px;
}
.inv-custom-row .inv-code-input { flex: 1 1 auto; width: auto; min-width: 0; letter-spacing: 1px; text-transform: uppercase; }
.inv-custom-row .field-tip { display: block; margin-top: 6px; line-height: 1.5; }
@media (max-width: 720px) {
  .inv-one-line { flex-direction: column; gap: 8px; }
  .inv-code-cell { flex: none; }
  .inv-stats { grid-template-columns: repeat(2, 1fr); }
  .inv-custom-row .inv-cell-row { flex-wrap: wrap; }
}

/* ============ 「我饿了 / 去做题」挪进宠物展示栏（2026-11-17） ============ */
.pt-stage.has-advice { height: 236px; padding-bottom: 54px; box-sizing: border-box; }
.pt-stage.has-advice.has-halo::before { top: 38%; }
.pt-stage-advice {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 1px solid #dbe7fb;
  background: #f5f8ff;
  border-radius: 10px;
  padding: 7px 9px;
}
.pt-stage-advice.is-urge { border-color: #f5d9a8; background: #fdf7ec; }
.pt-stage-advice.is-warn { border-color: #f6c9c7; background: #fdf1f0; }
.pt-stage-advice > span { flex: 1 1 auto; min-width: 0; }
.pt-stage-advice b { display: block; font-size: 11.5px; color: #1f2937; font-weight: 500; }
.pt-stage-advice em {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-style: normal;
  font-size: 11px;
  line-height: 1.45;
  color: #5f6b7a;
}
.pt-stage-advice a {
  flex: none;
  padding: 4px 9px;
  border-radius: 99px;
  background: #2b6cf6;
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}
.pt-stage-advice.is-urge a { background: #b45309; }
.pt-stage-advice.is-warn a { background: #c0392b; }

/* ============ 宠物页买食物 / 换形象的整页重绘用短交叉淡入，消除闪一下（2026-11-17） ============ */
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: 160ms;
  animation-timing-function: ease-in-out;
}

/* ============ 注册验证码：手机 / 邮箱二选一（2026-11-17） ============ */
.reg-verify {
  border: 1px solid var(--line, #e5e8ee);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  background: var(--line-soft, #f8f9fc);
}
.rv-head { font-size: 12px; font-weight: 500; color: var(--muted, #78828f); margin-bottom: 8px; }
.rv-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.rv-tab {
  flex: 1;
  padding: 7px 4px;
  font-size: 12.5px;
  border: 1px solid var(--line, #e5e8ee);
  border-radius: 8px;
  background: var(--panel, #fff);
  color: var(--text-2, #4a5462);
  cursor: pointer;
}
.rv-tab.is-on { border-color: var(--brand, #2b6cf6); color: var(--brand, #2b6cf6); font-weight: 500; }
/* 没绑定的渠道：摆出来让人看见，但灰掉点不了 */
.rv-tab.is-off { opacity: .45; cursor: not-allowed; background: #f2f3f5; }
.rv-row { display: flex; gap: 8px; margin-bottom: 8px; }
.rv-row .input { flex: 1 1 auto; min-width: 0; }
.rv-send { flex: 0 0 auto; white-space: nowrap; }
.rv-code { letter-spacing: 3px; }
.rv-tip { font-size: 11.5px; line-height: 1.6; color: var(--muted, #78828f); word-break: break-all; }
.rv-demo-code { font-family: var(--mono); font-size: 15px; color: var(--brand, #2b6cf6); letter-spacing: 2px; }

/* 账号页 · 手机号 / 邮箱只读行 + 修改按钮；换绑弹窗里的验证码行 */
.contact-row { display: flex; gap: 8px; align-items: stretch; }
.contact-row .input { flex: 1 1 auto; min-width: 0; }
.contact-row .btn { flex: 0 0 auto; white-space: nowrap; }
.contact-row .input[readonly] { color: var(--text-2, #4a5462); background: var(--bg-2, #f4f6f9); cursor: default; }

/* 管理面板 · 注册验证配置 */
.vf-sub { font-size: 13px; font-weight: 500; color: var(--text, #141923); margin: 14px 0 8px; }
.sim-grid label.vf-wide { grid-column: 1 / -1; }
.vf-demo { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 12.5px; color: var(--text-2, #4a5462); }

/* 课程页「上架检查」清单（管理员/可编辑者才看到） */
.cse-check { margin: 0 0 14px; padding: 12px 14px; }
.cse-check-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.cse-check-head b { font-size: 14px; }
.cse-check-sum { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #eef2f8; color: var(--muted); }
.cse-check-sum.is-ok { background: #e7f6ed; color: #1a7f45; }
.cse-check-sum.is-bad { background: #fff4e0; color: #b8730a; }
.cse-check-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cse-check-item { font-size: 12.5px; line-height: 1.7; }
.cse-check-item.is-ok { color: #1a7f45; }
.cse-check-item.is-bad { color: #c0392b; }

/* 讲次封面缩略图（课程页目录）：小卡 16:9，没图时不占位 */
.cse-item .cse-thumb {
  flex: 0 0 64px;
  width: 64px;
  align-self: center;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  background: #eef2f8;
  overflow: hidden;
  padding: 0;
}
.cse-item .cse-thumb img.cse-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .2s ease;
}
.cse-item .cse-thumb img.cse-shot.is-on { opacity: 1; }

/* ============ 管理员建课页（#/admin/course/new） ============ */
.cn-wrap {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1080px) {
  .cn-wrap { grid-template-columns: 1fr; }
}
.cn-form, .cn-lib { padding: 16px 18px; }
.cn-form { display: flex; flex-direction: column; gap: 12px; }
.cn-h { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--text); }
.cn-h .req { color: #e5484d; font-style: normal; }
.cn-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.cn-err {
  border: 1px solid #f3c2c0;
  background: #fdf2f2;
  color: #b42318;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
}
.cn-lib-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cn-lib-count { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.cn-search { width: 190px; }
.cn-lib-note {
  font-size: 12.5px;
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
}
.cn-lib-note.is-bad { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.cn-vid-list { max-height: 58vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.cn-lib-empty, .cn-vid-empty { padding: 22px 0; text-align: center; color: var(--muted); font-size: 13px; }
.cn-vid {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.cn-vid:hover { background: #f6f8fb; }
.cn-vid.is-on { background: #eef4ff; border-color: #c9d9ff; }
.cn-vid.is-disabled { opacity: .55; cursor: not-allowed; }
.cn-vid input { flex: 0 0 auto; }
.cn-vid-no {
  flex: 0 0 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11.5px;
}
.cn-vid-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cn-vid-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-vid-meta { font-size: 11.5px; color: var(--muted); }
.cn-vid-use { flex: 0 0 auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 40%; }
.cn-use {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef1f5;
  color: #4b5563;
  white-space: nowrap;
}
.cn-lib-tip { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.cn-picked { border-top: 1px dashed var(--line); padding-top: 10px; }
.cn-picked-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.cn-picked-head span { font-weight: 600; color: var(--muted); }
.cn-picked-empty { margin-top: 6px; font-size: 12px; color: var(--muted); }
.cn-picked-list { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow: auto; }
.cn-pick-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.cn-pick-no {
  flex: 0 0 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 999px; background: #eef1f5; color: #4b5563; font-size: 11px;
}
.cn-pick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-pick-acts { flex: 0 0 auto; display: flex; gap: 3px; }
.cn-pick-title { flex: 1 1 auto; min-width: 0; height: 28px; font-size: 12.5px; padding: 3px 8px; }

/* ============ 从别的课导入讲次（弹窗） ============ */
.imp-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; }
@media (max-width: 720px) {
  .imp-wrap { grid-template-columns: 1fr; }
}
.imp-col { display: flex; flex-direction: column; min-width: 0; }
.imp-col-h {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.imp-sum { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.imp-courses { max-height: 54vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.imp-course {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.imp-course:hover { background: #f6f8fb; }
.imp-course.on { border-color: #c9d9ff; background: #eef4ff; }
.imp-course b { font-size: 12.5px; font-weight: 650; color: var(--text); }
.imp-course span { font-size: 11px; color: var(--muted); }
.imp-lessons { max-height: 54vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 2px; }
.imp-lesson {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
}
.imp-lesson:hover { background: #f6f8fb; }
.imp-lesson.is-on { background: #eef4ff; border-color: #c9d9ff; }
.imp-lesson input { flex: 0 0 auto; }
.imp-no {
  flex: 0 0 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 999px;
  background: #eef1f5;
  color: #4b5563;
  font-size: 11px;
}
.imp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-meta { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.imp-empty { padding: 18px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.imp-tip { font-size: 11.5px; color: var(--muted); }
.cn-filters { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.cn-filter {
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
}
.cn-filter:hover { background: #f6f8fb; }
.cn-filter.on { background: var(--brand-soft); border-color: #c9d9ff; color: var(--brand-dark); font-weight: 650; }
.cn-use.is-free { background: #f3f4f6; color: #9ca3af; }
/* 从别的课导入：两列要宽一点，讲次名才不被挤 */
.modal.modal-import { width: 680px; max-width: 94vw; }
.modal-import .imp-wrap { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 720px) {
  .modal.modal-import { width: 94vw; }
  .modal-import .imp-wrap { grid-template-columns: 1fr; }
}
.cn-vid-raw { color: #9ca3af; font-size: 11px; }

/* ============ 管理员：云上视频（存储管理与清理） ============ */
.st-panel .cn-vid-list { max-height: 56vh; }
.st-sum { display: flex; gap: 10px; margin: 10px 0 12px; flex-wrap: wrap; }
.st-card {
  flex: 1 1 150px;
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.st-card b { font-size: 19px; line-height: 1.25; color: var(--text); }
.st-card span { font-size: 12px; color: var(--muted); }
.st-card em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.st-card.is-warn { border-color: #fbd5b5; background: #fffaf3; }
.st-card.is-warn b { color: #b45309; }
.st-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.st-all { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.st-selinfo { font-size: 12px; color: var(--muted); font-weight: 600; }
.st-bar .btn { height: 28px; padding: 0 12px; font-size: 12.5px; }
.cn-vid.is-locked { cursor: default; }
.cn-vid.is-locked:hover { background: transparent; }
.cn-vid.is-locked input { cursor: not-allowed; }
.cn-vid .cn-vid-raw { font-size: 11px; color: #9ca3af; }

/* ---------------- 指法练习 + 打字速度榜（2026-11-19） ---------------- */
.typing-panel { padding: 18px 20px 22px; }
.typing-note { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.7; }
.typing-rank-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.typing-rank-bar .chip {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.typing-rank-bar .chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tp-level-sel { width: auto; min-width: 180px; height: 32px; }
.tp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tp-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tp-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tp-table tr.is-me td { background: var(--brand-soft); }
.tp-table .tp-rank { width: 52px; font-size: 15px; }
.tp-table .tp-wpm b { font-size: 16px; color: var(--brand); }
.tp-table .tp-who a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.tp-table .tp-who .avatar, .tp-table .tp-who .av { width: 24px; height: 24px; border-radius: 50%; }
.tp-table .tp-lv { color: var(--muted); font-size: 12px; }
.tp-foot { margin-top: 14px; font-size: 12px; color: var(--muted); }
.ub-typing b { color: var(--brand); }
@media (max-width: 720px) {
  .tp-table th:nth-child(5), .tp-table td:nth-child(5) { display: none; }
}

/* 打字任务 chip 文案较长：占满整行完整显示，不被题目 chip 的 260px 宽度截断 */
.hw-p-typing { max-width: 100% !important; width: 100%; align-items: flex-start; }
.hw-p-typing .hw-p-title { overflow: visible !important; white-space: normal !important; text-overflow: clip !important; line-height: 1.6; }
.hw-p-typing .hw-p-dot { margin-top: 2px; }

/* ---------- 等级提升庆祝弹窗（2026-11-19） ---------- */
.modal-levelup .modal-body { padding: 26px 24px 18px !important; }
.lu { text-align: center; }
.lu-crown { font-size: 46px; line-height: 1; animation: lu-pop .6s cubic-bezier(.2,.9,.3,1.4) both; }
.lu-tag {
  margin: 8px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: 3px;
  color: #b45309; text-transform: uppercase;
}
.lu-level {
  font-size: 60px; font-weight: 800; line-height: 1.1;
  color: #d97706; text-shadow: 0 2px 0 #fde68a;
  animation: lu-pop .7s .05s cubic-bezier(.2,.9,.3,1.4) both;
}
.lu-level small { font-size: 22px; vertical-align: 14px; margin-right: 2px; font-weight: 700; }
.lu-tiername { margin-top: 6px; font-size: 17px; font-weight: 700; color: var(--text); }
.lu-tier {
  margin-top: 12px; padding: 8px 14px; border-radius: 10px;
  background: linear-gradient(90deg,#fff7ed,#fef3c7); color: #92400e;
  font-size: 13.5px; display: inline-block;
}
.lu-xp { margin-top: 14px; font-size: 13px; color: var(--muted); }
.lu-xp b { color: var(--text); }
.lu-prog {
  margin: 14px auto 0; max-width: 320px; padding: 9px 12px; border-radius: 9px;
  background: var(--brand-soft, #eef4ff); color: var(--brand, #2b6cf6); font-size: 12.5px;
}
.lu-prog b { font-weight: 700; }
.lu-encourage { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
@keyframes lu-pop {
  0% { transform: scale(.4) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
/* ---------- 成就达成弹窗：作业完成 / 新徽章（2026-11-19） ---------- */
.modal-achievement .modal-body { padding: 22px 22px 14px !important; }
.ach { text-align: left !important; }
.ach-hero { text-align: center !important; font-size: 44px !important; line-height: 1; animation: lu-pop .6s cubic-bezier(.2,.9,.3,1.4) both; }
.ach-tag { text-align: center !important; margin: 8px 0 16px !important; font-size: 11.5px !important; font-weight: 700 !important; letter-spacing: 2.5px !important; color: #b45309 !important; text-transform: uppercase; }
.ach-sec { margin-top: 12px !important; border: 1px solid var(--border, #e5e9f0) !important; border-radius: 12px !important; padding: 12px 14px !important; }
.ach-sec-h { font-size: 13px !important; font-weight: 700 !important; color: var(--text) !important; margin-bottom: 8px !important; }
.ach-sec-h b { color: var(--brand, #2b6cf6) !important; }
.ach-row { display: flex !important; align-items: center !important; gap: 10px !important; padding: 7px 0 !important; border-top: 1px dashed var(--border, #e9edf3) !important; }
.ach-row:first-of-type { border-top: 0 !important; }
.ach-ic { flex: 0 0 30px !important; font-size: 20px !important; text-align: center !important; }
.ach-badge { font-size: 22px !important; }
.ach-t { flex: 1 1 auto !important; min-width: 0 !important; display: flex !important; flex-direction: column !important; gap: 2px !important; }
.ach-t b { font-size: 13.5px !important; color: var(--text) !important; }
.ach-t em { font-size: 12px !important; color: var(--muted) !important; font-style: normal !important; }
.ach-p { flex: 0 0 auto !important; font-size: 14px !important; color: #16a34a !important; }
.ach-tip { margin-top: 14px !important; text-align: center !important; font-size: 12px !important; color: var(--muted) !important; }
.ach-tip a { color: var(--brand, #2b6cf6) !important; }


/* ---------- 图片消息 / 看大图 / 发图弹窗（2026-11-19） ---------- */
.chat-img-btn {
  display: inline-block;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  max-width: 100%;
}
.chat-img {
  display: block;
  max-width: 240px;
  max-height: 240px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.chat-img-btn:hover .chat-img { border-color: #c2d3f0; }
.chat-bubble .chat-btext + .chat-img-btn { display: block; margin-top: 8px; }
.chat-bubble .chat-img-btn + .chat-btext { display: block; margin-top: 8px; }
@media (max-width: 720px) {
  .chat-img { max-width: 190px; max-height: 190px; }
}
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 16, 28, 0.84);
  cursor: zoom-out;
}
.img-viewer.open { display: flex; }
.img-viewer img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}
.iv-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}
.img-send {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 20, 34, 0.55);
}
.is-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(9, 17, 33, 0.28);
  padding: 16px 18px;
}
.is-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.is-head b { font-size: 15.5px; }
.is-size { font-size: 12px; color: #7b8496; }
.is-preview {
  display: flex;
  justify-content: center;
  max-height: 320px;
  overflow: hidden;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 10px;
  background: #f4f6fa;
}
.is-preview img { max-width: 100%; max-height: 300px; border-radius: 6px; }
.is-room {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #7b8496;
}
.is-room select { flex: 1; }
.is-text { width: 100%; margin-bottom: 10px; }
.is-foot { display: flex; align-items: center; gap: 8px; }
.is-tip { font-size: 12.5px; color: #7b8496; }

/* 截图说明弹窗：http 地址下浏览器不给截屏时的替代路径 */
.shot-help .sh-reason { margin: 0 0 10px; font-size: 13.5px; line-height: 1.75; color: #4b5566; }
.shot-help .sh-list { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; line-height: 1.85; color: #3b4657; }
.shot-help .sh-list li { margin-bottom: 6px; }
.shot-help kbd {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f6f8fb;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 18px;
  color: #33405a;
}
.shot-help code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f0f3f8;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: #2f4f8f;
}

/* 学习笔记 / 讨论区正文里的插图（![说明](/api/img/<id>)）：整块显示，点了看大图 */
.md-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f6fa;
  cursor: zoom-in;
}
.md-img:hover { border-color: #c6d4e8; }
@media (max-width: 640px) {
  .md-img { margin: 8px 0; border-radius: 8px; }
}
/* ===== 开课名单（手动按人头开通课程） ===== */
.modal-grants{width:min(560px,94vw)}
.modal-grants .modal-body{padding:16px 18px 6px}
.gr-wrap{display:flex;flex-direction:column;gap:12px}
.gr-h{font-weight:700;font-size:14px;color:var(--text)}
.gr-tip{margin:4px 0 8px;font-size:12.5px;line-height:1.6;color:var(--muted)}
.gr-tip b{color:var(--text-2)}
.gr-users{width:100%;resize:vertical;min-height:84px;font-family:var(--mono);font-size:13px;line-height:1.7}
.gr-row{display:flex;align-items:flex-end;gap:8px;margin-top:8px;flex-wrap:wrap}
.gr-lab{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.gr-lab select,.gr-lab .input{height:32px}
.gr-note-lab{flex:1;min-width:150px}
.gr-note-lab .input{width:100%}
.gr-row .btn{height:32px;padding:0 16px}
.gr-msg{margin-top:8px;font-size:12.5px;line-height:1.6;color:var(--muted);min-height:18px}
.gr-msg.is-ok{color:var(--ac)}
.gr-msg.is-bad{color:var(--wa)}
.gr-list-h{display:flex;align-items:baseline;gap:8px;font-size:13px;color:var(--text)}
.gr-list-h b{font-weight:700}
.gr-sum{font-size:12px;color:var(--muted)}
.gr-list{display:flex;flex-direction:column;gap:6px;max-height:280px;overflow:auto;padding-right:2px}
.gr-empty{padding:18px 10px;text-align:center;font-size:12.5px;color:var(--muted);border:1px dashed var(--line);border-radius:10px}
.gr-item{display:flex;align-items:flex-start;gap:9px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.gr-item.is-expired{opacity:.62}
.gr-ava{flex:0 0 auto;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:700;color:var(--brand);background:var(--brand-soft)}
.gr-main{flex:1;min-width:0}
.gr-name{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--text);flex-wrap:wrap}
.gr-user{font-weight:400;font-size:12px;color:var(--muted);font-family:var(--mono)}
.gr-tag{font-size:11px;font-weight:600;padding:1px 6px;border-radius:999px;color:var(--ac);background:var(--ac-soft)}
.gr-tag.is-forever{color:var(--brand);background:var(--brand-soft)}
.gr-tag.is-off{color:var(--ce);background:var(--ce-soft)}
.gr-sub{margin-top:2px;font-size:11.5px;color:var(--muted)}
.gr-note{margin-top:3px;font-size:11.5px;color:var(--text-2);word-break:break-all}
.gr-del{flex:0 0 auto;border:1px solid var(--line);background:transparent;color:var(--muted);font-size:11.5px;padding:3px 8px;border-radius:7px;cursor:pointer}
.gr-del:hover{color:var(--wa);border-color:var(--wa);background:var(--wa-soft)}
.gr-csv{border:1px solid var(--line);background:transparent;color:var(--muted);font-size:11.5px;padding:3px 9px;border-radius:7px;cursor:pointer}
.gr-csv:hover{color:var(--brand);border-color:var(--brand);background:var(--brand-soft)}
.gr-foot-tip{font-size:11.5px;color:var(--muted);line-height:1.5;max-width:330px}
.mc-granted{font-size:12.5px;font-weight:700;color:var(--ac)}
.mc-gcount{color:var(--brand)}
@media(max-width:640px){.gr-row{align-items:stretch}.gr-note-lab{min-width:100%}.gr-row .btn{width:100%}}

/* ---------- 课程中心：左「系列课程」+ 右「单个视频」两栏（2026-11-19） ---------- */
.lib-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}
.lib-main,
.lib-side {
  min-width: 0;
}
.lib-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 2px 12px;
}
.lib-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.lib-count {
  font-size: 12.5px;
  color: var(--muted);
}
.lib-count b {
  color: var(--brand);
}
.lib-singles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* 一条单视频：左边缩略图（带时长角标），右边标题 / 老师 / 价格 */
.sv {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.sv:hover {
  border-color: #c7d7f7 !important;
}
.sv-cover {
  position: relative;
  flex: 0 0 136px;
  width: 136px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f4f9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.sv-emoji {
  font-size: 26px;
}
.sv-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.18s;
}
.sv-shot.is-on {
  opacity: 1;
}
.sv-dur {
  position: absolute;
  right: 5px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.sv-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(15, 23, 42, 0.28);
}
.sv-bar i {
  display: block;
  height: 100%;
  background: var(--brand);
}
.sv-done {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(15, 169, 88, 0.92);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sv-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 0;
}
.sv-title {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sv-title:hover {
  color: var(--brand);
}
.sv-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.sv-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.sv-free,
.sv-granted {
  color: var(--ac, #0fa958);
  font-weight: 700;
}
.sv-price {
  color: #b7791f;
  font-weight: 700;
}
.sv-price i {
  font-style: normal;
  font-size: 11px;
}
.sv-lock {
  color: var(--muted);
}
.sv-acts {
  position: absolute;
  right: 6px;
  top: 6px;
  display: none;
  gap: 3px;
}
.sv:hover .sv-acts {
  display: flex;
}
.sv-acts button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.sv-acts button:hover {
  border-color: #c7d7f7;
  color: var(--brand);
}
.lib-empty {
  padding: 26px 14px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
}
.lib-empty .big {
  font-size: 26px;
  margin-bottom: 6px;
}
.lib-empty b {
  display: block;
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 4px;
}
.lib-empty span {
  font-size: 12px;
}
@media (max-width: 1180px) {
  .lib-wrap {
    grid-template-columns: 1fr;
  }
  .lib-side {
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
}
@media (max-width: 520px) {
  .sv-cover {
    flex-basis: 118px;
    width: 118px;
  }
}

.mc-tags span.is-grant { background: #fdf1e3; color: #b45309; }
.mc-grant-tag { color: #b45309; font-size: 12px; }
.sv-buy { margin-left: auto; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--brand); font-size: 11px; cursor: pointer; }

.rec-item { text-decoration: none; color: inherit; }
.rec-item .cse-item-title { color: var(--text); }

.cse-video-wrap { position: relative; }
/* 播放页三块的栅格定位：只在宽屏（两栏）时生效。
   原先这段没包 media —— ≤900px 改成单列后，.cse-side 的 grid-column:2 会
   逼出一条隐式第二列，把播放器挤成窄条、目录跑到右边（手机端几乎不能看）。
   手机端改为单列正常文档流，顺序：播放器 → 目录/作业 → 评论。 */
@media (min-width: 901px) {
  .cse-watch .cse-player-panel { grid-column: 1; grid-row: 1; }
  .cse-watch .cm-panel { grid-column: 1; grid-row: 2; }
  .cse-watch .cse-side { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
}
@media (max-width: 900px) {
  .cse-watch { display: flex; flex-direction: column; gap: 12px; }
  .cse-watch .cse-player-panel,
  .cse-watch .cm-panel,
  .cse-watch .cse-side { width: 100%; min-width: 0; }
  /* 目录紧跟播放器，评论放最后 */
  .cse-watch .cse-player-panel { order: 1; }
  .cse-watch .cse-side { order: 2; }
  .cse-watch .cm-panel { order: 3; margin-top: 0; }

  /* 播放页顶部：标题一行、导航按钮另起一行平分，别把标题挤成竖条 */
  .cse-head { flex-wrap: wrap; gap: 8px; padding: 0; }
  .cse-head-main { flex: 1 1 100%; min-width: 0; }
  .cse-head-main b { white-space: normal; line-height: 1.45; }
  .cse-head-nav {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .cse-head-nav .cse-mini {
    flex: 1 1 auto;
    height: 34px;
    padding: 0 8px;
    font-size: 12.5px;
  }
  .cse-qwrap { flex: 1 1 auto; display: flex; align-items: center; gap: 4px; }
  .cse-qwrap .cse-qsel { flex: 1; height: 34px; }

  /* 播放器：贴边铺满，保持 16:9，不拉伸不变形 */
  .cse-player-panel { padding: 8px; }
  .cse-video-wrap { width: 100%; }
  .cse-video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
  .cse-under .cse-tip { line-height: 1.6; }
}



/* ===== 学员自助注销账号（账号页面板 + 二次确认弹窗） ===== */
.acct-unregister { border-color: #f3c9c9 !important; }
.acct-unregister .panel-head h3 { color: #c53030 !important; }
.acct-unreg-tip {
  margin: 0 0 12px; font-size: 12.5px; line-height: 1.7; color: var(--text-2);
}
.acct-unreg-tip b { color: #c53030; }
/* 没绑手机 / 邮箱：自助注销走不通，用警示块说明只能找管理员 */
.acct-unreg-tip.acct-unreg-block {
  padding: 10px 12px; margin-bottom: 10px; border-radius: 9px;
  background: #fff4f3; border: 1px solid #ffd9d6; color: #9b2c2c;
}
/* 注销弹窗里「发到哪个号码」只读展示 */
#unregTarget[readonly] { background: #f6f8fa; color: var(--text-2); }
.modal-danger .modal-head h3 { color: #c53030 !important; }

/* 账号管理表：昵称为主，真实姓名作为「实名 xxx」小字附在下面（有昵称时才显示） */
.u-cell .u-realname { color: var(--muted); font-size: 11px; }

/* ===== 管理员：访问统计 ===== */
.vk-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.vk-kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.vk-kpi span { font-size: 12px; color: var(--muted); }
.vk-kpi b { font-size: 25px; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.vk-kpi em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.vk-kpi.is-today { border-color: #b9d0f7; }
.vk-kpi.is-today b { color: var(--brand-dark); }
.vk-panel { margin-bottom: 16px; }
.vk-panel .panel-sub { font-size: 12px; color: var(--muted); }
.vk-legend { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: middle; }
.vk-legend.pv { background: #2563eb; }
.vk-legend.uv { background: #93b4f7; }
.vk-chart {
  display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 12px 4px 0;
  overflow-x: auto;
}
.vk-bar-col { flex: 1 0 34px; min-width: 34px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vk-bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.vk-bar { width: 12px; border-radius: 3px 3px 0 0; display: block; }
.vk-bar.pv { background: #2563eb; }
.vk-bar.uv { background: #93b4f7; }
.vk-bar-col span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.vk-note { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.vk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vk-list { padding: 4px 16px 12px; }
.vk-list-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.vk-list-name { flex: 0 0 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.vk-list-bar { flex: 1; height: 8px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.vk-list-bar i { display: block; height: 100%; background: #2563eb; border-radius: 999px; }
.vk-list-row b { flex: 0 0 40px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.vk-empty { color: var(--muted); font-size: 12.5px; padding: 14px 0; text-align: center; }
.vk-table td, .vk-table th { font-size: 12.5px; }
.vk-path { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.vk-new { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: #e7f8f0; color: #0b7a41; font-size: 10px; }
/* 在线 IP 列表（概览页）：一行一个 IP，绿点表示现在在线。
   2026-11-21 重排：原来「当前页面」独占一个 1fr 把中间撑空、右边的设备列只有 150px 被截断，
   现在路径和设备各占一份弹性宽度，再补上「访问次数」列，并加一行表头说明各列是什么 */
.vk-live { display: flex; flex-direction: column; }
.vk-live-head,
.vk-live-row {
  display: grid;
  grid-template-columns: 10px 150px 108px minmax(0, 1.15fr) minmax(0, 1fr) 72px 78px 74px;
  align-items: center;
  gap: 10px;
}
.vk-live-head {
  padding: 2px 2px 8px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.vk-live-head > span:nth-child(n + 6) { text-align: right; }
.vk-live-row {
  padding: 9px 2px; border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}
.vk-live-row:last-child { border-bottom: 0; }
.vk-live-dot {
  width: 7px; height: 7px; border-radius: 999px; background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
}
.vk-live-row .vk-ip { font-family: var(--mono); font-size: 12px; color: var(--text); }
/* IP + 「扫描」标记同一格：IP 可省略，标记不压缩 */
.vk-ip-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vk-ip-cell .vk-ip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vk-ip-cell .vk-bot { margin-left: 0; }
.vk-bot {
  display: inline-block; flex: 0 0 auto;
  margin-left: 5px; padding: 0 6px; border-radius: 999px;
  font-size: 10px; line-height: 15px; font-weight: 600;
  color: #a32d2d; background: #fcebeb; border: 1px solid #f6d5d5;
  vertical-align: 1px; white-space: nowrap;
}
.vk-live-loc { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vk-live-path {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vk-live-dev { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vk-live-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.vk-live-who { text-align: right; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vk-live-at { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 980px) {
  /* 平板：设备列让位，路径和访问次数保留 */
  .vk-live-head,
  .vk-live-row { grid-template-columns: 10px 140px 96px minmax(0, 1fr) 66px 70px 70px; }
  .vk-live-head > span:nth-child(5) { display: none; }
  .vk-live-dev { display: none; }
}
@media (max-width: 760px) {
  /* 窄屏两行：第一行 IP + 归属地 + 时间，第二行当前页面 + 访问次数 + 访客 */
  .vk-live-head { display: none; }
  .vk-live-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 10px 2px; }
  .vk-live-dot { order: 1; flex: 0 0 auto; }
  .vk-live-row .vk-ip { order: 2; }
  .vk-live-loc { order: 3; }
  .vk-live-at { order: 4; margin-left: auto; }
  .vk-live-path { order: 5; flex: 1 1 55%; min-width: 0; padding-left: 17px; }
  .vk-live-count { order: 6; }
  .vk-live-count::after { content: ' 次'; font-size: 10.5px; color: var(--muted); font-weight: 400; }
  .vk-live-who { order: 7; margin-left: auto; }
  .vk-live-dev { display: none; }
}

@media (max-width: 900px) {
  .vk-grid { grid-template-columns: 1fr; }
  .vk-list-name { flex-basis: 100px; }
  .vk-path { max-width: 140px; }
}

/* IP 地址列：等宽、可点复制观感 */
.vk-ip { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
/* IP 访问次数：次数数字 + 占比条 */
.vk-ip-count { font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.vk-ip-bar { display: block; width: 100%; max-width: 160px; height: 8px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.vk-ip-bar i { display: block; height: 100%; background: #2563eb; border-radius: 999px; }
.vk-ip-table th:last-child, .vk-ip-table td:last-child { width: 170px; }
@media (max-width: 900px) {
  .vk-ip-bar { max-width: 90px; }
  .vk-ip-table th:last-child, .vk-ip-table td:last-child { width: 100px; }
}
/* 账号管理新增列：注册时间 / 在线时长 */
.acct-reg, .acct-study { font-variant-numeric: tabular-nums; }
.acct-study { color: var(--text-2); }

/* ===== 页内选项卡（账号管理 / 访问统计等长页面） ===== */
.p-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  padding: 4px; margin-bottom: 14px;
  background: #eef2f8; border-radius: 11px;
  max-width: 100%;
}
.p-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background .12s, color .12s, box-shadow .12s;
}
.p-tab:hover { color: var(--text); }
.p-tab.on {
  background: var(--panel); color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
.p-tab-n {
  min-width: 16px; padding: 0 5px; border-radius: 999px;
  background: #e5484d; color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
}
/* hidden 对 flex 不生效，必须显式关掉 */
.p-pane[hidden] { display: none !important; }
@media (max-width: 820px) {
  .p-tabs { display: flex; width: 100%; overflow-x: auto; }
  .p-tab { flex: 1 0 auto; padding: 7px 12px; justify-content: center; }
}

/* 登录页「忘记密码？」链接 + 找回密码弹窗里的渠道切换 */
/* 登录页三块面板（密码 / 验证码 / 微信）：卡片 gap 只作用于面板之间，
   面板内部自己排纵列，否则输入框会紧贴、忘记密码行会压到输入框下边框上 */
.login-pane { display: flex; flex-direction: column; gap: 13px; }
.login-pane[hidden] { display: none !important; }
.login-forgot { margin: -5px 0 0; text-align: right; font-size: 12.5px; line-height: 1.4; }
.login-pane > .login-err { margin: -6px 0 -4px; }
@media (max-width: 430px) {
  /* 三个登录方式按钮在窄屏会被压成两行字，改成等分不换行 */
  .login-tabs { gap: 4px; }
  .login-tabs .ltab { padding: 8px 4px; font-size: 12px; white-space: nowrap; }
}
.login-forgot a { color: var(--brand); text-decoration: none; }
.login-forgot a:hover { text-decoration: underline; }
.fp-tabs { margin: 6px 0 12px; }

/* ============ 界面主题：暖阳 / 雾蓝 / 青竹（浅色系，不碰代码区 --ed-*） ============ */
/* 默认浅色不带 body 类；这三套各占一个互斥类。只改页面骨架色，编程区配色仍由 edth-* 管。 */
body.theme-sand {
  --bg: #f7f3e8;
  --panel: #fffdf6;
  --line: #e4d9bf;
  --line-soft: #f1ead7;
  --text: #382f23;
  --text-2: #665a47;
  --muted: #8a7e6a;
  --brand: #a65b18;
  --brand-dark: #844510;
  --brand-soft: #f8e7cc;
  --ac: #2f8f5b;
  --ac-soft: #e6f3e9;
  --wa: #c23a30;
  --wa-soft: #f9e4e1;
  --tle: #7959b0;
  --tle-soft: #efe9fa;
  --mle: #a26312;
  --mle-soft: #f9ecd6;
  --re: #bd5a22;
  --re-soft: #f9e9db;
  --ce: #6b6252;
  --ce-soft: #efe9dc;
  background: #f7f3e8 !important;
  color: #382f23 !important;
}
body.theme-mist {
  --bg: #eef4fa;
  --panel: #f8fbff;
  --line: #d5e2ef;
  --line-soft: #e8f0f8;
  --text: #1b2b3d;
  --text-2: #42566b;
  --muted: #6d8195;
  --brand: #2563a8;
  --brand-dark: #174a80;
  --brand-soft: #e2eefb;
  --ac: #138a73;
  --ac-soft: #dff4ef;
  --wa: #c94040;
  --wa-soft: #fbe7e7;
  --tle: #6f5bb5;
  --tle-soft: #ece8fa;
  --mle: #a96a17;
  --mle-soft: #fbf0dd;
  --re: #c25b31;
  --re-soft: #fbede4;
  --ce: #5c7186;
  --ce-soft: #e8eef5;
  background: #eef4fa !important;
  color: #1b2b3d !important;
}
body.theme-bamboo {
  --bg: #eef6ef;
  --panel: #f9fdf9;
  --line: #d3e6d6;
  --line-soft: #e8f3ea;
  --text: #1c3323;
  --text-2: #3f5a45;
  --muted: #6b856f;
  --brand: #1f7a4d;
  --brand-dark: #155c39;
  --brand-soft: #e1f2e6;
  --ac: #15806a;
  --ac-soft: #ddf2ea;
  --wa: #c0433f;
  --wa-soft: #fae6e4;
  --tle: #6a5aa6;
  --tle-soft: #ebe8f7;
  --mle: #9c6a1c;
  --mle-soft: #f8efdc;
  --re: #b85b32;
  --re-soft: #f9e9de;
  --ce: #5b7561;
  --ce-soft: #e7f0e8;
  background: #eef6ef !important;
  color: #1c3323 !important;
}
/* 页面里少量写死的白底组件，统一按当前主题的面板色压一遍（代码区不在名单里） */
body.theme-sand .topbar, body.theme-mist .topbar, body.theme-bamboo .topbar,
body.theme-sand .nav, body.theme-mist .nav, body.theme-bamboo .nav,
body.theme-sand .panel, body.theme-mist .panel, body.theme-bamboo .panel,
body.theme-sand .card, body.theme-mist .card, body.theme-bamboo .card,
body.theme-sand .page-head, body.theme-mist .page-head, body.theme-bamboo .page-head,
body.theme-sand .modal, body.theme-mist .modal, body.theme-bamboo .modal,
body.theme-sand .modal-head, body.theme-mist .modal-head, body.theme-bamboo .modal-head,
body.theme-sand .modal-foot, body.theme-mist .modal-foot, body.theme-bamboo .modal-foot,
body.theme-sand .side-note, body.theme-mist .side-note, body.theme-bamboo .side-note,
body.theme-sand .save-bar, body.theme-mist .save-bar, body.theme-bamboo .save-bar,
body.theme-sand .stat-card, body.theme-mist .stat-card, body.theme-bamboo .stat-card,
body.theme-sand .kv, body.theme-mist .kv, body.theme-bamboo .kv,
body.theme-sand .toolbar, body.theme-mist .toolbar, body.theme-bamboo .toolbar,
body.theme-sand .panel-head, body.theme-mist .panel-head, body.theme-bamboo .panel-head,
body.theme-sand .table-wrap, body.theme-mist .table-wrap, body.theme-bamboo .table-wrap,
body.theme-sand .empty, body.theme-mist .empty, body.theme-bamboo .empty,
body.theme-sand .dropdown, body.theme-mist .dropdown, body.theme-bamboo .dropdown,
body.theme-sand .menu-list, body.theme-mist .menu-list, body.theme-bamboo .menu-list,
body.theme-sand .chat-list, body.theme-mist .chat-list, body.theme-bamboo .chat-list,
body.theme-sand .chat-panel, body.theme-mist .chat-panel, body.theme-bamboo .chat-panel,
body.theme-sand .chat-head, body.theme-mist .chat-head, body.theme-bamboo .chat-head,
body.theme-sand .chat-msg, body.theme-mist .chat-msg, body.theme-bamboo .chat-msg,
body.theme-sand .chat-body, body.theme-mist .chat-body, body.theme-bamboo .chat-body,
body.theme-sand .cr-out, body.theme-mist .cr-out, body.theme-bamboo .cr-out,
body.theme-sand .fr-item, body.theme-mist .fr-item, body.theme-bamboo .fr-item,
body.theme-sand .chat-announce, body.theme-mist .chat-announce, body.theme-bamboo .chat-announce,
body.theme-sand .lv-card, body.theme-mist .lv-card, body.theme-bamboo .lv-card {
  background: var(--panel) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
body.theme-sand .input, body.theme-mist .input, body.theme-bamboo .input,
body.theme-sand input, body.theme-mist input, body.theme-bamboo input,
body.theme-sand select, body.theme-mist select, body.theme-bamboo select,
body.theme-sand textarea, body.theme-mist textarea, body.theme-bamboo textarea,
body.theme-sand .chat-compose-foot, body.theme-mist .chat-compose-foot, body.theme-bamboo .chat-compose-foot,
body.theme-sand .cm-input, body.theme-mist .cm-input, body.theme-bamboo .cm-input,
body.theme-sand .ta-ac, body.theme-mist .ta-ac, body.theme-bamboo .ta-ac {
  background: var(--panel) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
body.theme-sand .muted, body.theme-mist .muted, body.theme-bamboo .muted,
body.theme-sand .field-tip, body.theme-mist .field-tip, body.theme-bamboo .field-tip,
body.theme-sand .side-note, body.theme-mist .side-note, body.theme-bamboo .side-note,
body.theme-sand .page-head p, body.theme-mist .page-head p, body.theme-bamboo .page-head p {
  color: var(--muted) !important;
}
body.theme-sand table th, body.theme-mist table th, body.theme-bamboo table th {
  background: var(--line-soft) !important;
  color: var(--text-2) !important;
  border-color: var(--line) !important;
}
body.theme-sand table td, body.theme-mist table td, body.theme-bamboo table td { border-color: var(--line) !important; }
