/* ============================================================
   B-Practice 交安C刷题系统 · 全站样式（移动端优先）
   小屏单列布局、44px+ 触控目标；≥760px 平板/桌面自适应加宽
   ============================================================ */
:root {
  --primary: #4f5ed7;        /* 克制靛蓝：仅用于主操作与选中态 */
  --primary-dark: #3d4bb8;
  --primary-light: #eef0fb;
  --success: #2f9e63;
  --success-light: #ecf6f0;
  --danger: #cf4c52;
  --danger-light: #fbeeef;
  --warning: #b97f2a;
  --warning-light: #f9f2e6;
  --text: #1f2329;
  --text-sub: #717784;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e6e8ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 25, 38, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- 顶栏与导航 ---------- */
.appbar {
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}
.appbar .brand { font-weight: 700; font-size: 17px; white-space: nowrap; }
.appbar .who { font-size: 13px; color: var(--text-sub); max-width: 40vw; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.appbar .brand .dot { color: var(--primary); }

.tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 40;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabs a {
  flex: 1 0 auto;
  text-align: center;
  padding: 11px 14px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.container { max-width: 860px; margin: 0 auto; padding: 14px 12px 40px; }
.container.wide { max-width: 1080px; }

/* ---------- 卡片与通用 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  margin-bottom: 14px;
}
.card h2 { font-size: 16px; margin-bottom: 10px; }
.card h2 .badge { vertical-align: 2px; margin-left: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 12px; text-align: center;
}
.stat .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat .num.green { color: var(--success); }
.stat .num.orange { color: var(--warning); }
.stat .lbl { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ---------- 徽章 / 按钮 ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.7; white-space: nowrap;
}
.badge.blue { background: var(--primary-light); color: var(--primary-dark); }
.badge.green { background: var(--success-light); color: var(--success); }
.badge.red { background: var(--danger-light); color: var(--danger); }
.badge.orange { background: var(--warning-light); color: var(--warning); }
.badge.gray { background: #e2e8f0; color: var(--text-sub); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px;
  border: none; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: filter .15s;
}
.btn:active { filter: brightness(.9); }
.btn.block { width: 100%; }
.btn.gray { background: #565e6b; }
.btn.green { background: var(--success); }
.btn.red { background: var(--danger); }
.btn.ghost {
  background: var(--card); color: var(--text);
  border: 1px solid #d4d8e0;
}
.btn.small { min-height: 34px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn + .btn { margin-left: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* ---------- 进度条 ---------- */
.progress { background: #e2e8f0; border-radius: 999px; height: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.progress i.green { background: var(--success); }

/* ---------- 模块列表 ---------- */
.module-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 10px; text-decoration: none; color: var(--text);
}
.module-item .info { flex: 1; min-width: 0; }
.module-item .name { font-weight: 600; font-size: 15px; }
.module-item .sub { font-size: 12px; color: var(--text-sub); margin: 3px 0 7px; }
.module-item .arrow { color: #cbd5e1; font-size: 20px; }
.module-item .progress { margin-top: 6px; }

/* ---------- 题目与选项 ---------- */
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.q-no { font-size: 13px; color: var(--text-sub); }
.q-stem { font-size: 16px; font-weight: 600; margin: 6px 0 12px; white-space: pre-wrap;
  word-break: break-word; }
.case-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 12px; font-size: 14px; white-space: pre-wrap;
  word-break: break-word;
}
.case-box .case-title { font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 15px;
  min-height: 44px;
}
.opt .letter {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  background: #eef2f7; color: var(--text-sub);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; margin-top: 1px;
}
.opt .text { flex: 1; word-break: break-word; }
.opt.picked { border-color: var(--primary); background: #eff6ff; }
.opt.picked .letter { background: var(--primary); color: #fff; }
.opt.right { border-color: var(--success); background: var(--success-light); }
.opt.right .letter { background: var(--success); color: #fff; }
.opt.wrongpick { border-color: var(--danger); background: var(--danger-light); }
.opt.wrongpick .letter { background: var(--danger); color: #fff; }
.opts input[type=radio], .opts input[type=checkbox] { display: none; }

/* ---------- 选项标记（粉笔式）：长按=标记排除，点已标记=取消 ---------- */
/* 可作答选项禁用长按选中/系统呼出，避免干扰长按标记手势 */
.opts label.opt {
  position: relative;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.opt.lp-holding { background: #f1f3f7; }
.opt.marked { border-style: dashed; border-color: var(--warning); background: var(--warning-light); }
.opt.marked .letter {
  background: transparent; color: var(--warning);
  box-shadow: inset 0 0 0 1.5px var(--warning);
}
.opt.marked .text { opacity: .45; }
.opt.marked::after {
  content: "已标记";
  position: absolute; top: -9px; right: 10px;
  background: var(--warning); color: #fff;
  font-size: 11px; line-height: 1; padding: 3px 8px;
  border-radius: 999px; pointer-events: none;
}

/* 长按标记的一次性新手提示（每设备仅首答页出现） */
.opt-mark-toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 999;
  transform: translateX(-50%) translateY(8px);
  max-width: 86vw; text-align: center; pointer-events: none;
  background: rgba(31, 35, 41, .92); color: #fff;
  font-size: 13px; padding: 9px 14px; border-radius: 999px;
  opacity: 0; transition: opacity .25s, transform .25s;
}
.opt-mark-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sub-block { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 12px; }
.sub-block:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

/* ---------- 判分结果 ---------- */
.verdict {
  display: flex; align-items: center; gap: 8px;
  border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-weight: 700;
}
.verdict.ok { background: var(--success-light); color: var(--success); }
.verdict.no { background: var(--danger-light); color: var(--danger); }
.answer-line { font-size: 14px; margin: 8px 0; }
.answer-line b { color: var(--success); }
.explain {
  background: #f7f8fa; border: 1px solid #eceef2; border-left: 3px solid var(--primary);
  border-radius: 8px; color: var(--text);
  padding: 10px 12px; font-size: 14px; margin-top: 10px; white-space: pre-wrap;
  word-break: break-word;
}
.explain:empty { display: none; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 16px; /* ≥16px 避免 iOS 聚焦自动放大，输入法全兼容 */
  background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }
.form-error {
  background: var(--danger-light); color: var(--danger);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px;
}
.hint { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* ---------- 消息提示 ---------- */
.messages { margin-bottom: 12px; }
.messages li {
  list-style: none; border-radius: 10px; padding: 10px 12px; font-size: 14px;
  margin-bottom: 8px;
}
.messages li.success { background: var(--success-light); color: var(--success); }
.messages li.error { background: var(--danger-light); color: var(--danger); }
.messages li.info, .messages li.warning { background: var(--warning-light); color: var(--warning); }

/* ---------- 表格类（桌面展示，移动端横向滚动） ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.list th, table.list td {
  padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left;
  white-space: nowrap;
}
table.list td.wrap, table.list th.wrap { white-space: normal; word-break: break-word; }
table.list th { color: var(--text-sub); font-weight: 500; font-size: 13px; }
table.list tr:last-child td { border-bottom: none; }

/* ---------- 考试模式 ---------- */
.exam-timer {
  position: sticky; top: 52px; z-index: 45;
  background: #2b303b; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-radius: 0 0 10px 10px;
}
.exam-timer .clock { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.exam-timer .clock.warn { color: #f2b8b5; }
.exam-timer .meta { font-size: 12px; opacity: .85; }

.card-toggle {
  width: 100%; min-height: 44px; border: 1.5px solid var(--primary);
  color: var(--primary); background: #fff; border-radius: 10px;
  font-size: 15px; font-weight: 600; margin-top: 14px;
}
.answer-card {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .45);
}
.answer-card.open { display: block; }
.answer-card .panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 16px 16px 0 0;
  max-height: 72vh; overflow-y: auto; padding: 16px 14px 24px;
}
.answer-card .panel h3 { font-size: 15px; margin-bottom: 10px; }
.answer-card .close { float: right; border: none; background: none;
  font-size: 20px; color: var(--text-sub); padding: 2px 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.slot {
  display: flex; align-items: center; justify-content: center;
  height: 42px; border-radius: 8px; background: #eef2f7; color: var(--text-sub);
  font-size: 14px; text-decoration: none; border: 1.5px solid transparent;
}
.slot.answered { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.submit-bar { margin-top: 18px; }
.fixed-submit {
  position: fixed; right: 16px; bottom: 18px; z-index: 46;
  box-shadow: 0 4px 12px rgba(18, 25, 38, .18);
}

/* ---------- 成绩页 ---------- */
.score-hero { text-align: center; padding: 22px 14px 18px; }
.score-ring {
  --p: 0;
  width: 150px; height: 150px; margin: 0 auto 8px; border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), #e2e8f0 0);
  display: flex; align-items: center; justify-content: center;
}
.score-ring.pass { background: conic-gradient(var(--success) calc(var(--p) * 1%), #e2e8f0 0); }
.score-ring .inner {
  width: 118px; height: 118px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-ring .score { font-size: 34px; font-weight: 800; color: var(--text); line-height: 1.1; }
.score-ring .cap { font-size: 12px; color: var(--text-sub); }

/* ---------- 图标按钮：返回上级/搜索等低频操作，省空间（移动端友好） ---------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 40px;
  border: 1px solid #d4d8e0; border-radius: 10px;
  background: var(--card); color: var(--text-sub);
  font-size: 17px; line-height: 1; text-decoration: none; cursor: pointer;
}
.icon-btn:active { background: #f1f3f7; }
.btn-row .icon-btn { flex: 0 0 40px; margin-top: 2px; }

/* ---------- 更多操作下拉：非常规操作（如停用题目）折叠收纳 ---------- */
.more-menu { position: relative; margin-left: auto; }
.more-menu summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; min-width: 40px; padding: 5px 12px;
  border: 1px solid #d4d8e0; border-radius: 8px;
  background: var(--card); color: var(--text-sub);
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
}
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu[open] summary { color: var(--text); border-color: #c9cfda; }
.more-menu .menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(18, 25, 38, .12);
  padding: 6px; min-width: 140px;
}
.more-menu .menu-pop button {
  display: block; width: 100%; min-height: 38px; padding: 8px 12px;
  border: none; background: none; border-radius: 8px;
  color: var(--danger); font-size: 13px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.more-menu .menu-hint { display: block; padding: 8px 12px; font-size: 13px;
  color: var(--text-sub); white-space: nowrap; }

/* ---------- 题目编辑：选项行与文本域 ---------- */
.opt-editor { display: flex; flex-direction: column; gap: 8px; }
.opt-edit-row { display: flex; align-items: center; gap: 8px; }
.opt-edit-row .opt-text {
  flex: 1; min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--text);
}
.opt-edit-row .opt-text:focus { outline: none; border-color: var(--primary); }
.ans-pick {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 6px 8px; border: 1.5px solid var(--border); border-radius: 10px;
  background: #fff; flex: 0 0 auto;
}
.ans-pick input { width: 16px; height: 16px; margin: 0; }
.ans-pick .letter-badge {
  width: 22px; height: 22px; border-radius: 50%;
  background: #eef2f7; color: var(--text-sub);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.opt-del {
  width: 36px; height: 36px; flex: 0 0 36px;
  border: none; border-radius: 8px; background: none;
  color: var(--text-sub); font-size: 18px; cursor: pointer;
}
.opt-del:active { background: #f1f3f7; }
textarea.opt-textarea {
  width: 100%; padding: 10px 12px; min-height: 96px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 16px; line-height: 1.6; background: #fff; color: var(--text);
  font-family: inherit; resize: vertical;
}
textarea.opt-textarea:focus { outline: none; border-color: var(--primary); }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 13px; border-radius: 8px; background: #fff; color: var(--text-sub);
  text-decoration: none; border: 1px solid var(--border); font-size: 13px;
}
.pager span.current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 登录页 ---------- */
.login-hero { text-align: center; padding: 42px 0 20px; }
.login-hero .logo {
  width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 18px;
  background: var(--primary); color: #fff; font-size: 30px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.login-hero h1 { font-size: 20px; }
.login-hero p { color: var(--text-sub); font-size: 13px; margin-top: 4px; }
.login-card { max-width: 400px; margin: 0 auto; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--text-sub); padding: 30px 10px; }
.empty .icon { font-size: 40px; margin-bottom: 8px; }

/* ---------- 排行榜 ---------- */
.lb-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 12px; }
.lb-tab { flex: 1; padding: 10px 4px; border: none; background: none; font-size: 14px;
  color: var(--text-sub); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; text-align: center; min-height: 40px; }
.lb-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.lb-table td, .lb-table th { padding: 8px 6px; }
.lb-rank { font-size: 15px; width: 42px; text-align: center; white-space: nowrap; }
.lb-name { font-weight: 500; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ---------- 排行榜（兼容企业微信 X5 内核） ---------- */
.lb-card { padding: 16px 12px; }
.lb-tabs { display: -webkit-box; display: -webkit-flex; display: flex; background: #f1f5f9; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.lb-tab { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; padding: 8px 4px; border: none; background: transparent; font-size: 14px; color: #64748b; cursor: pointer; border-radius: 8px; text-align: center; min-height: 36px; }
.lb-tab.active { background: #ffffff; color: var(--text); font-weight: bold; -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.1); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.lb-list { display: block; }
.lb-row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; background: #f1f5f9; }
.lb-row:last-child { margin-bottom: 0; }
.lb-top, .lb-1st, .lb-2nd, .lb-3rd { background: #fafbfc; border: 1px solid var(--border); }
.lb-pos { width: 32px; min-width: 32px; text-align: center; font-size: 18px; font-weight: bold; color: #64748b; -webkit-flex-shrink: 0; flex-shrink: 0; }
.lb-1st .lb-pos { font-size: 22px; }
.lb-2nd .lb-pos { font-size: 20px; }
.lb-3rd .lb-pos { font-size: 20px; }
.lb-user { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; font-weight: bold; font-size: 15px; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 19px; font-weight: 700; color: var(--text); white-space: nowrap; -webkit-flex-shrink: 0; flex-shrink: 0; }
.lb-score small { font-size: 12px; font-weight: normal; color: #717784; margin-left: 2px; }
.lb-empty { text-align: center; color: #64748b; padding: 20px; font-size: 14px; }

/* ---------- 平板 / 桌面 ---------- */
@media (min-width: 760px) {
  body { font-size: 15px; }
  .container { padding: 20px 16px 60px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .tabs { top: 55px; }
  .answer-card .panel {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -50%);
    width: 560px; max-height: 78vh; border-radius: 16px;
  }
  .q-stem { font-size: 17px; }
  .fixed-submit { display: none; } /* 桌面用卷内提交按钮 */
}

/* ---------- 排行榜 v2 ---------- */
.lb-card { padding: 16px 12px; }
.lb-tabs { display: flex; gap: 0; background: var(--bg); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.lb-tab { flex: 1; padding: 8px 4px; border: none; background: transparent; font-size: 14px;
  color: var(--text-sub); cursor: pointer; border-radius: 8px; text-align: center; transition: all .2s; min-height: 36px; }
.lb-tab.active { background: var(--card); color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.lb-top, .lb-1st, .lb-2nd, .lb-3rd { background: #fafbfc; border: 1px solid var(--border); }
.lb-pos { flex: 0 0 32px; text-align: center; font-size: 18px; font-weight: 700; color: var(--text-sub); }
.lb-1st .lb-pos { font-size: 22px; }
.lb-2nd .lb-pos { font-size: 20px; }
.lb-3rd .lb-pos { font-size: 20px; }
.lb-user { flex: 1; font-weight: 600; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 19px; font-weight: 700; color: var(--text); white-space: nowrap; }
.lb-score small { font-size: 12px; font-weight: 400; color: var(--text-sub); margin-left: 2px; }
.lb-empty { text-align: center; color: var(--text-sub); padding: 20px; font-size: 14px; }

/* ---------- 错题反馈 ---------- */
.issue-report { margin-top: 10px; }
.issue-toggle {
  background: none; border: none; padding: 2px 0;
  font-size: 13px; color: var(--text-sub); cursor: pointer;
  text-decoration: underline dotted;
}
.issue-panel {
  margin-top: 8px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
}
.issue-tip { font-size: 13px; color: var(--text); margin: 0 0 8px; }
.issue-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.issue-chips .chip {
  min-height: 34px; padding: 5px 14px;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text-sub);
  font-size: 13px; cursor: pointer;
}
.issue-chips .chip.on {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary-dark); font-weight: 600;
}
.issue-chips .chip.all { border-style: dashed; }
.issue-msg { margin: 6px 0 0; }
.issue-remark {
  width: 100%; margin-top: 8px; padding: 8px 10px; min-height: 64px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--text); resize: vertical;
}
.issue-remark:focus { outline: none; border-color: var(--primary); }

/* ---------- 排行榜 v3：单一榜单（三项指标合一） ---------- */
.lb-head { display: grid; grid-template-columns: 32px 1fr 62px 52px 56px; gap: 6px;
  padding: 0 12px 6px; font-size: 12px; color: var(--text-sub); }
.lb-head .lb-user { font-weight: 400; }
.lb-head .lb-m { text-align: center; }
.lb-row { display: grid; grid-template-columns: 32px 1fr 62px 52px 56px; gap: 6px;
  align-items: center; padding: 9px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  transition: transform .15s, border-color .15s; }
.lb-row:hover { transform: translateX(3px); border-color: #c9cfda; }
.lb-m { text-align: center; font-size: 13px; color: var(--text);
  font-variant-numeric: tabular-nums; }
.lb-m small { font-size: 11px; color: var(--text-sub); margin-left: 1px; }
.lb-m.strong { font-weight: 700; }
/* 数值分级配色：通过率/正确率红黄绿（阈值见 _leaderboard） */
.lb-m.lb-good { color: var(--success); font-weight: 700; }
.lb-m.lb-warn { color: var(--warning); font-weight: 700; }
.lb-m.lb-bad { color: var(--danger); font-weight: 700; }
/* 刷题量不做颜色区分，按投入度以字重/字号突出 */
.lb-m.lb-hot { color: var(--primary); font-weight: 800; font-size: 15px; }
.lb-m.lb-warm { font-weight: 600; }
.lb-top { background: #fafbfc; }
@media (min-width: 760px) {
  .lb-row, .lb-head { grid-template-columns: 40px 1fr 80px 70px 74px; }
}

/* ---------- 消息列表（邮箱风） ---------- */
.mail-list { display: flex; flex-direction: column; }
.mail-row { display: flex; gap: 8px; align-items: flex-start; padding: 11px 4px;
  border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.mail-row:last-child { border-bottom: none; }
.mail-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent;
  margin-top: 7px; flex-shrink: 0; }
.mail-row.unread .mail-dot { background: var(--primary); }
.mail-row.unread .mail-subject { font-weight: 700; }
.mail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mail-subject { font-size: 14px; }
.mail-snippet { font-size: 12px; color: var(--text-sub); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.mail-time { font-size: 12px; color: var(--text-sub); flex-shrink: 0; }

/* ---------- 站内消息 ---------- */
.tabs .nav-badge { display: inline-block; min-width: 16px; padding: 0 5px;
  margin-left: 2px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
  vertical-align: 1px; }
.msg-unread { border-left: 3px solid var(--danger); }

/* ---------- 题目反馈会话（学员↔管理员私密对话） ---------- */
.issue-details { margin-top: 2px; }
.issue-details .issue-toggle {
  display: inline-block; list-style: none;
}
.issue-details .issue-toggle::-webkit-details-marker { display: none; }
.issue-details[open] .issue-toggle { color: var(--primary); font-weight: 600; }
.issue-session { margin-top: 8px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; }
.issue-first { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.issue-head { display: flex; align-items: center; gap: 6px; font-size: 13px;
  flex-wrap: wrap; }
.issue-time { color: var(--text-sub); font-size: 12px; margin-left: auto; }
.issue-kinds { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.issue-body { font-size: 14px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.issue-threads { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.issue-replies { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
/* 会话消息聊天气泡：反馈人右侧蓝泡、管理侧左侧灰泡（双方视角一致） */
.issue-msg { display: flex; flex-direction: column; margin-top: 4px; }
.issue-msg.self { align-items: flex-end; }
.issue-msg.other { align-items: flex-start; }
.issue-msg-meta { display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--text-sub); margin-bottom: 3px; }
.issue-msg-meta b { color: var(--text); font-size: 13px; }
.issue-bubble { max-width: 88%; padding: 8px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.issue-msg.self .issue-bubble { background: var(--primary-light);
  color: var(--primary-dark); border-top-right-radius: 4px; }
.issue-msg.other .issue-bubble { background: var(--card);
  border: 1px solid var(--border); border-top-left-radius: 4px; }
.issue-hidebtn {
  border: none; background: none; padding: 0; cursor: pointer;
  font-size: 12px; color: var(--danger);
}
.issue-reply-form { margin-top: 6px; }
.issue-reply-form .issue-reply-input {
  width: 100%; min-height: 56px; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--text);
  font-family: inherit; resize: vertical;
}
.issue-reply-form .issue-reply-input:focus { outline: none; border-color: var(--primary); }
/* 管理后台会话卡的回复输入框（textarea.issue-reply） */
textarea.issue-reply {
  width: 100%; min-height: 88px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--text);
  font-family: inherit; line-height: 1.5; resize: vertical;
}
textarea.issue-reply:focus { outline: none; border-color: var(--primary); }
