:root {
  --bg: #eef1f7;
  --panel: #ffffff;
  --border: #e3e7f0;
  --text: #1e2733;
  --muted: #6b7480;
  --primary: #2f5bea;
  --primary-d: #2447c4;
  --primary-soft: #eaf0ff;
  --accent: #d8392b;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(20,30,60,.05), 0 6px 18px rgba(20,30,60,.06);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 顶栏 */
.topbar {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand .logo { color: var(--primary); font-size: 20px; }
.auth-area { display: flex; align-items: center; gap: 10px; }
.auth-area .user { font-size: 14px; color: var(--muted); }
.mem-badge { background: linear-gradient(135deg,#f6c453,#e8a33d); color: #5a3a00; padding: 3px 11px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.btn.mem-btn { background: linear-gradient(135deg,#f6c453,#e8a33d); color: #5a3a00; font-weight: 700; }
.btn.mem-btn:hover { filter: brightness(1.05); }
.tag-admin { background: #fff1e6; color: #b45309; padding: 2px 9px; border-radius: 10px; font-size: 12px; }

/* 布局 */
.layout { flex: 1 1 auto; display: flex; min-height: 0; overflow: hidden; }
.layout.sidebar-hidden .sidebar { margin-left: -248px; opacity: 0; pointer-events: none; }

/* 左侧导航 */
.sidebar {
  width: 248px; flex: 0 0 248px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: margin-left .25s ease, opacity .25s ease;
}
.nav-head {
  padding: 14px 18px 8px; font-size: 12px; font-weight: 700;
  color: var(--muted); letter-spacing: 1px; text-transform: uppercase;
}
.nav { overflow-y: auto; padding: 4px 10px 16px; flex: 1 1 auto; }
.nav .empty { color: var(--muted); font-size: 13px; padding: 12px; }

.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  font-size: 14.5px; color: var(--text); user-select: none;
  border: 1px solid transparent;
}
.nav-item:hover { background: #f3f6fd; }
.nav-item.active {
  background: var(--primary-soft); color: var(--primary-d);
  font-weight: 600; border-color: #d4e0ff;
}
.nav-item .ico { width: 18px; text-align: center; color: var(--primary); }
.nav-item.group { font-weight: 600; color: var(--muted); cursor: default; background: none; font-size: 12.5px; letter-spacing: .5px; padding-left: 6px; }
.nav-item.group:hover { background: none; }
.nav-item.child { margin-left: 14px; font-size: 14px; }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--muted); }

/* 右侧内容 */
.content { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* 首页 */
.home { flex: 1 1 auto; overflow-y: auto; padding: 40px 28px 60px; }
.hero { max-width: 720px; margin: 0 auto 30px; text-align: center; }
.hero h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: 1px; }
.hero .subtitle { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
.search { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.search input {
  flex: 1 1 auto; border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; font-size: 15px; outline: none; background: #fff;
}
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,91,234,.12); }
.search-results { max-width: 560px; margin: 16px auto 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.search-results .sr-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px; }
.search-results .sr-item:last-child { border-bottom: 0; }
.search-results .sr-item:hover { background: #f5f8ff; }
.search-results .sr-ico { color: var(--primary); }
.search-results .sr-path { color: var(--muted); font-size: 12px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }

.widgets { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .widgets { grid-template-columns: 1fr; } }
.widget { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.widget-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wh-title { font-weight: 700; font-size: 15px; }

/* 计时器 */
.timer-display { font-size: 46px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--primary-d); letter-spacing: 2px; margin-bottom: 12px; }
.timer-display.run { color: var(--accent); }
.timer-presets { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 6px 13px; font-size: 13px; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--primary); color: var(--primary-d); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.timer-ctrl { display: flex; gap: 10px; justify-content: center; }
/* 计时器模式切换 */
.timer-modes { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.tmode { flex: 1; padding: 7px 0; border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 9px; font-size: 13px; cursor: pointer; transition: .15s; }
.tmode.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
/* 正计时段记录 */
.timer-laps { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 10px; max-height: 150px; overflow-y: auto; }
.laps-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.lap-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 2px; color: var(--text); font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--border); }
.lap-row:last-child { border-bottom: 0; }
/* 计时器自定义时长 */
.timer-custom { display: flex; gap: 8px; justify-content: center; align-items: center; margin-bottom: 14px; }
.timer-custom .tc-label { font-size: 13px; color: var(--muted); }
.timer-custom input { width: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; outline: none; }
.timer-custom input:focus { border-color: var(--primary); }

/* 学习管理工具 */
.study-gate { grid-column: 1 / -1; text-align: center; padding: 30px 18px; }
.sg-icon { font-size: 30px; margin-bottom: 8px; }
.sg-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.sg-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
/* 待办清单 */
.todo-add, .goal-add { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.todo-add input, .goal-add input { flex: 1 1 120px; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; }
.todo-add input:focus, .goal-add input:focus { border-color: var(--primary); }
.todo-list, .goal-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-text { flex: 1 1 auto; word-break: break-all; }
.todo-del, .goal-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 2px; }
.todo-del:hover, .goal-del:hover { color: var(--accent); }
/* 每日打卡 */
.checkin-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.streak { font-weight: 700; font-size: 15px; color: var(--primary-d); }
.checkin-dots { display: flex; gap: 7px; }
.dot { flex: 1; height: 26px; border-radius: 7px; background: #eef1f7; border: 1px solid var(--border); }
.dot.on { background: var(--primary); border-color: var(--primary); }
/* 目标进度 */
.goal-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 8px; gap: 8px; }
.goal-num { color: var(--muted); font-size: 13px; white-space: nowrap; }
.goal-bar { height: 8px; background: #eef1f7; border-radius: 6px; overflow: hidden; margin-bottom: 9px; }
.goal-fill { height: 100%; background: var(--primary); border-radius: 6px; transition: width .25s; }
.goal-ctrl { display: flex; gap: 8px; }

/* 自定义常用 */
.custom-list { display: flex; flex-direction: column; gap: 9px; }
.custom-empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.custom-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; text-decoration: none; color: var(--text); font-size: 14px; background: #fff; }
.custom-card:hover { border-color: var(--primary); background: #f5f8ff; }
.custom-card .cc-ico { color: var(--primary); }
.custom-card .cc-title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-card .cc-del { color: var(--muted); cursor: pointer; border: 0; background: none; font-size: 16px; }
.custom-card .cc-del:hover { color: var(--danger); }
.custom-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.custom-form input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 14px; }
.custom-form-ctrl { display: flex; gap: 8px; }

/* 栏目视图 */
.folder-view { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.folder-head {
  background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 6px 20px; gap: 14px; flex: 0 0 auto;
}
.folder-head-main { display: flex; align-items: baseline; gap: 9px; min-width: 0; overflow: hidden; }
.folder-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; flex: 0 0 auto; }
.folder-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.folder-actions .btn { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.file-switch { background: #fafbfe; border-bottom: 1px solid var(--border); padding: 7px 20px; display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; flex: 0 0 auto; scrollbar-width: thin; }
.file-switch::-webkit-scrollbar { height: 5px; }
.file-switch::-webkit-scrollbar-thumb { background: #c7d0e6; border-radius: 5px; }
.file-chip {
  border: 1px solid var(--border); background: #fff; border-radius: 14px;
  padding: 3px 11px; font-size: 12px; cursor: pointer; color: var(--text); max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto;
}
.file-chip:hover { border-color: var(--primary); color: var(--primary-d); }
.file-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.file-chip .fc-date { color: var(--muted); font-size: 11px; margin-left: 6px; }
.file-chip.active .fc-date { color: #eaf0ff; }
.file-chip.more-chip { font-weight: 600; color: var(--primary-d); border-style: dashed; }
.file-chip .dl { margin-left: 6px; color: var(--primary); cursor: pointer; font-size: 12px; padding: 0 2px; }
.file-chip .dl:hover { color: var(--accent); }
.viewer-wrap { flex: 1 1 auto; position: relative; background: #fff; min-height: 0; border-top: 1px solid #eef1f7; padding: 12px 36px; box-sizing: border-box; }
.viewer-inner { width: 100%; height: 100%; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(15,23,42,.06); background: #f6f8fc; }
#viewer { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
#viewer { width: 100%; height: 100%; border: 0; display: block; }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 6px; }
.placeholder .ph-icon { font-size: 48px; }
.placeholder .ph-sub { font-size: 12px; }

/* 右侧悬浮：扫码加老师 / 联系作者 */
.side-fab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; align-items: center; }
.side-fab .fab-tab {
  writing-mode: vertical-rl; letter-spacing: 2px; font-size: 12px; color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-d));
  padding: 14px 6px; border-radius: 10px 0 0 10px; cursor: pointer; user-select: none;
  box-shadow: -2px 2px 8px rgba(15,23,42,.12);
}
.side-fab .fab-tab:hover { background: linear-gradient(180deg, var(--primary-d), var(--primary)); }
.side-fab .fab-drawer {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  background: var(--panel); border: 1px solid var(--border); border-right: 0;
  border-radius: 12px 0 0 12px; padding: 14px 14px 12px; width: 180px;
  box-shadow: -4px 4px 18px rgba(15,23,42,.14);
  transition: transform .22s ease, opacity .18s ease;
  opacity: 0; transform: translate(100%, -50%); pointer-events: none;
}
.side-fab.open .fab-drawer { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.side-fab.open .fab-tab { display: none; }
.fab-drawer .fd-qr { width: 152px; height: 152px; background: #fafbfd; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fab-drawer .fd-qr img { width: 100%; height: 100%; object-fit: contain; }
.fab-drawer .fd-qr-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 8px; line-height: 1.5; }
.fab-drawer .fd-title { font-size: 13px; font-weight: 600; margin: 8px 0 4px; text-align: center; }
.fab-drawer .fd-sub { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.5; }
.fab-drawer .fd-close { position: absolute; top: 6px; right: 8px; background: transparent; border: 0; font-size: 16px; color: var(--muted); cursor: pointer; }
.fab-drawer .fd-close:hover { color: var(--text); }

/* 按钮 */
.btn { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--primary-d); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn:disabled { background: #c7d0e6; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: #f0f3f9; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.icon-btn { background: transparent; border: 0; cursor: pointer; font-size: 16px; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.hidden { display: none !important; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: var(--panel); border-radius: 14px; padding: 24px; width: 360px; box-shadow: 0 12px 44px rgba(0,0,0,.22); max-height: 90vh; overflow-y: auto; }
.modal-card.wide { width: 470px; }
.modal-card h3 { margin: 0 0 12px; font-size: 18px; }
.modal-card input, .modal-card textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; font-family: inherit; }
.modal-card textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, monospace; }
.modal-card .row { display: flex; flex-direction: column; margin-bottom: 8px; }
.modal-card .row label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.modal-card .row input[type=checkbox] { width: auto; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.modal-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.modal-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 12px; }
.modal-switch a { color: var(--primary); cursor: pointer; }
.token-box { display: flex; align-items: center; gap: 8px; }
.token-box code { flex: 1; background: #f3f4f6; padding: 6px 8px; border-radius: 6px; font-size: 12px; word-break: break-all; }

/* 提示 */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 100; }

/* 会员中心 */
.mem-wrap { max-width: 880px; margin: 0 auto; padding: 40px 28px 60px; }
.mem-hero { text-align: center; margin-bottom: 26px; }
.mem-hero h1 { font-size: 30px; margin: 0 0 8px; }
.mem-hero .subtitle { color: var(--muted); margin: 0; font-size: 15px; }
.mem-status { text-align: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; background: #fff; }
.mem-status .sg-icon { font-size: 28px; margin-bottom: 6px; }
.mem-status .sg-title { font-weight: 700; font-size: 16px; margin-bottom: 5px; }
.mem-status .sg-sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.mem-status.ok { border-color: #f3d28a; background: #fffaf0; }
.mem-status.ok .sg-title { color: #b45309; }
.mem-status.gate .sg-icon, .mem-status.none .sg-icon { color: var(--primary); }
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 680px) { .tier-grid { grid-template-columns: 1fr; } }
.tier-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 18px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; }
.tier-card:hover { border-color: var(--primary); }
.tier-name { font-weight: 700; font-size: 19px; }
.tier-dur { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.tier-price { font-size: 26px; font-weight: 800; color: var(--primary-d); margin-bottom: 16px; min-height: 34px; }
.tier-price .free { font-size: 17px; color: #16a34a; }
.tier-btn { width: 100%; }
.mem-note { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 22px; line-height: 1.7; }
/* 扫码支付弹窗 */
.pay-card { width: 360px; text-align: center; }
.pay-qr { margin: 10px 0 6px; display: flex; justify-content: center; }
.pay-qr-img { width: 220px; height: 220px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.pay-qr-note { color: var(--muted); font-size: 13px; padding: 30px 10px; }
#payAmount { color: var(--accent); }

/* 备案信息页脚 */
.site-footer {
  border-top: 1px solid var(--border, #e3e7ee);
  padding: 12px 16px 16px;
  text-align: center;
  font-size: 12px;
  color: #8a93a6;
  line-height: 1.8;
  background: #fafbfc;
}
.site-footer a { color: #8a93a6; text-decoration: none; }
.site-footer a:hover { color: var(--primary, #2563eb); text-decoration: underline; }
.site-footer .sep { margin: 0 6px; }

/* ===================== 手机端适配（≤768px） ===================== */
.mob-tabbar, .mob-mask { display: none; }

@media (max-width: 768px) {
  /* 顶栏精简 */
  .topbar { height: 50px; padding: 0 10px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand #siteName { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .auth-area { gap: 6px; }
  .auth-area .btn.sm { padding: 6px 9px; font-size: 12px; }
  .auth-area .user, .auth-area .mem-badge, .auth-area .tag-admin { display: none; }

  /* 左侧导航 → 抽屉式（默认收起，点 ☰ 或底部「栏目」展开） */
  .layout { display: block; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
    width: 76vw; max-width: 300px; margin-left: 0 !important;
    box-shadow: 6px 0 24px rgba(15,23,42,.16);
    transform: translateX(-100%);
    transition: transform .24s ease;
    opacity: 1 !important; pointer-events: auto !important;
  }
  .layout.sidebar-open .sidebar { transform: translateX(0); }
  .layout.sidebar-hidden .sidebar { transform: translateX(-100%); }
  .mob-mask { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 55; display: block; }
  .mob-mask.hidden { display: none; }

  /* 内容区全宽，底部预留 tabbar 高度 */
  .content { padding-bottom: 58px; height: calc(100vh - 50px); }

  /* 首页 */
  .home { padding: 18px 12px 40px; }
  .hero { margin-bottom: 18px; }
  .hero h1 { font-size: 24px; }
  .hero .subtitle { font-size: 13px; margin-bottom: 16px; }
  .search input { padding: 11px 12px; font-size: 14px; }
  .widgets { gap: 12px; }

  /* 栏目视图 */
  .folder-head { padding: 6px 10px; gap: 8px; flex-wrap: wrap; }
  .folder-head-main { flex: 1 1 auto; min-width: 0; }
  .folder-title { font-size: 13px; }
  .folder-sub { font-size: 10.5px; }
  .folder-actions .btn { padding: 4px 8px; font-size: 11px; }
  .file-switch { padding: 6px 10px; }
  .file-chip { max-width: 150px; }
  .viewer-wrap { padding: 6px; }
  .viewer-inner { border-radius: 4px; }

  /* 底部导航栏 */
  .mob-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: #fff; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mtab {
    flex: 1; border: 0; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 0 6px; font-size: 18px; color: var(--muted);
  }
  .mtab span { font-size: 10.5px; line-height: 1; }
  .mtab.active { color: var(--primary-d); font-weight: 600; }
  .mtab.active span { color: var(--primary-d); }

  /* 侧边栏底部登录提示（抽屉内） */
  .sidebar .nav-head { padding-top: 18px; }

  /* 弹窗适配 */
  .modal-card { width: 92vw; max-width: 380px; padding: 18px; }
  .modal-card.wide { width: 92vw; }

  /* 右侧浮窗加老师：手机上收窄为小胶囊，避免挡内容 */
  .side-fab .fab-tab { font-size: 10px; padding: 10px 4px; letter-spacing: 1px; }

  /* 备案页脚 */
  .site-footer { padding: 10px 12px 66px; font-size: 11px; }
}
@media (max-width: 768px) and (min-width: 400px) {
  .code-row { margin-bottom: 12px; }
}

/* 注册方式切换（桌面端也生效） */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.atab {
  flex: 1; padding: 8px 0; border: 1px solid var(--border); background: #fff;
  border-radius: 9px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.atab.active { background: var(--primary-soft); color: var(--primary-d); border-color: #d4e0ff; font-weight: 600; }
.atab-pane .modal-err { min-height: 16px; }
.wx-reg-box { text-align: center; padding: 8px 0 4px; }
.wx-reg-box .fd-qr { margin: 0 auto 12px; }
.wx-reg-tip { color: var(--muted); font-size: 12.5px; line-height: 1.9; text-align: center; margin: 0; }
.code-row { display: flex; gap: 8px; margin-bottom: 10px; }
.code-row input { flex: 1 1 auto; margin-bottom: 0; }
.code-row .btn { flex: 0 0 auto; white-space: nowrap; }
