/* =========================================================================
 * style.css —— 初中学习助手 网页版
 * 移动端优先，桌面端居中显示；配色沿用小程序主题色 #4F46E5
 * ========================================================================= */

:root {
  --brand: #4C6FB8;
  --brand2: #7FA0D4;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --text: #1F2937;
  --sub: #6B7280;
  --line: #E5E7EB;
  --radius: 20rpx;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  /* 底部操作栏留白 */
  padding-bottom: 0;
}

/* 桌面端居中，像手机一样 */
@media (min-width: 720px) {
  body {
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, .08);
    background: var(--bg);
    min-height: 100vh;
  }
}

/* ---------------- 顶部栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  padding-top: calc(14px + env(safe-area-inset-top));
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}

.topbar .back,
.topbar .bar-home {
  background: none;
  border: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  padding: 4px 12px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.topbar .back:active,
.topbar .bar-home:active { opacity: .6; }

.topbar .bar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 内容区 ---------------- */

.view { padding-bottom: 40px; }

/* ---------------- 首页 ---------------- */

.hero {
  background-color: var(--brand);
  background-image:
    linear-gradient(180deg, rgba(30, 52, 96, .52), rgba(30, 52, 96, .70)),
    url('../img/hero-campus.jpg');
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
  color: #fff;
  padding: 36px 24px 30px;
  border-radius: 0 0 28px 28px;
}

.hero h1 { margin: 0 0 6px; font-size: 27px; letter-spacing: 1px; }
.hero p { margin: 0 0 18px; opacity: .85; font-size: 14px; }

.hero-stats { display: flex; gap: 22px; font-size: 13px; opacity: .92; }
.hero-stats b { font-size: 19px; margin-right: 3px; }

.fav-bar { padding: 16px 16px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.fav-bar a {
  display: inline-block;
  background: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  color: var(--sub);
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

/* ---------------- 学习 / 练习 切换 ---------------- */

.mode-tabs {
  display: flex;
  gap: 8px;
  padding: 18px 16px 0;
}

.mode-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  border-radius: 13px;
  background: #fff;
  color: var(--sub);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.mode-tab.on {
  background: var(--brand);
  color: #fff;
}

.cr-stat { font-size: 12px; color: var(--brand); margin-top: 3px; display: block; }

.tag-own {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FFF4D6;
  color: #92400E;
  vertical-align: middle;
  font-weight: 400;
}

/* ---------------- 答题页 ---------------- */

.q-bar {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px 4px;
  font-size: 13px;
  color: var(--sub);
}

.q-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 18px;
  margin: 12px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.q-type {
  font-size: 11px;
  color: var(--brand);
  background: #EEF2FF;
  border-radius: 999px;
  padding: 4px 12px;
  display: inline-block;
  margin-bottom: 14px;
}

.q-stem {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 18px;
  white-space: pre-wrap;
}

.q-opts { display: flex; flex-direction: column; gap: 10px; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #FAFAFB;
  border: 2px solid #ECEDEF;
  border-radius: 14px;
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}

.opt:disabled { cursor: default; }
.opt-key {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #E8EAEE;
  color: var(--sub);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opt-text { flex: 1; }
.opt-mark { font-size: 18px; flex-shrink: 0; }
.opt-mark.ok { color: #10B981; }
.opt-mark.no { color: #EF4444; }

.opt.on { border-color: var(--brand); background: #F5F3FF; }
.opt.on .opt-key { background: var(--brand); color: #fff; }

.opt.right { border-color: #10B981; background: #ECFDF5; }
.opt.right .opt-key { background: #10B981; color: #fff; }

.opt.wrong { border-color: #EF4444; background: #FEF2F2; }
.opt.wrong .opt-key { background: #EF4444; color: #fff; }

.fb {
  margin: 0 16px 8px;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 14px;
}

.fb.ok { background: #ECFDF5; color: #065F46; }
.fb.no { background: #FEF2F2; color: #991B1B; }
.fb-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.fb-ans { font-weight: 600; margin-bottom: 6px; }
.fb-exp { line-height: 1.65; }
.fb-link { display: inline-block; margin-top: 10px; color: var(--brand); font-size: 13px; }

.q-actions {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.q-btn {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 0;
  font-size: 15px;
  font-family: inherit;
  color: var(--sub);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.q-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.q-btn:disabled { opacity: .45; cursor: default; }
.q-btn:active { opacity: .85; }

/* 练习结果 */
.res-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  text-align: center;
  padding: 30px 20px;
}

.res-rate { font-size: 56px; font-weight: 800; line-height: 1; }
.res-rate small { font-size: 22px; margin-left: 2px; }
.res-nums { margin-top: 10px; font-size: 14px; opacity: .9; }

.res-msg {
  margin: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--sub);
  text-align: center;
}

.res-msg.good { background: #ECFDF5; color: #065F46; }

.res-list { padding: 0 16px 8px; display: flex; flex-direction: column; gap: 10px; }

.res-row {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  border-left: 4px solid #10B981;
}

.res-row.no { border-left-color: #EF4444; }
.res-no { font-size: 12px; color: var(--sub); }
.res-stem { display: block; font-size: 14px; margin: 4px 0 6px; }
.res-mark { float: right; font-size: 18px; font-weight: 700; }
.res-row.ok .res-mark { color: #10B981; }
.res-row.no .res-mark { color: #EF4444; }
.res-ans { font-size: 12px; color: var(--sub); }

/* ---------------- 导入页 ---------------- */

.imp-intro {
  padding: 18px 16px 6px;
  font-size: 14px;
  color: var(--sub);
}

.imp-intro p { margin: 0 0 8px; }
.imp-tip { font-size: 12px; color: #9CA3AF; }

.imp-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin: 12px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.imp-text {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  color: var(--text);
}

.imp-row { display: flex; gap: 10px; margin-top: 12px; }
.imp-row .q-btn { padding: 12px 0; }
.imp-save { flex-direction: column; align-items: flex-start; gap: 8px; }
.imp-full { width: 100%; margin-top: 10px; }
.imp-radio { font-size: 14px; color: var(--sub); display: flex; align-items: center; gap: 6px; }

.imp-head { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.imp-cur { font-size: 13px; color: var(--sub); }
.imp-cur.muted { color: #9CA3AF; }

.imp-msg {
  margin: 12px 16px;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
}

.imp-msg.ok { background: #ECFDF5; color: #065F46; }
.imp-msg.err { background: #FEF2F2; color: #991B1B; }
.imp-msg ul { margin: 8px 0 0; padding-left: 20px; }

.pv-head {
  margin: 16px 16px 8px;
  font-size: 13px;
  color: var(--sub);
}

.pv-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }

.pv {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.pv-stem { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.pv-opts { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sub); }
.pv-opt.hit { color: #065F46; font-weight: 600; }

.more { text-align: center; font-size: 12px; color: #9CA3AF; padding: 10px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 16px;
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}

.subject-card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  border-top: 4px solid var(--c, var(--brand));
  transition: transform .15s;
}

.subject-card:active { transform: scale(.97); }
.sc-icon { font-size: 34px; }
.sc-name { font-size: 17px; font-weight: 700; margin-top: 8px; }
.sc-desc { font-size: 12px; color: var(--sub); margin-top: 4px; }
.sc-meta { font-size: 11px; color: #9CA3AF; margin-top: 8px; }

.foot {
  text-align: center;
  color: #9CA3AF;
  font-size: 12px;
  padding: 24px 16px 8px;
}

/* ---------------- 学科页 ---------------- */

.subject-hero {
  color: #1E2A47;
  background-color: #E8F0FC;
  background-image: url('../img/subject-macaron.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.subject-hero h2 { margin: 0 0 4px; font-size: 21px; }
.subject-hero p { margin: 0; font-size: 13px; color: #4A5B7C; }
.sh-icon { font-size: 40px; }

.grade-wrap { padding: 20px 16px 4px; }

.sec-label {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.sec-label span {
  font-size: 11px;
  color: #9CA3AF;
  background: #E8EAEE;
  border-radius: 5px;
  padding: 2px 8px;
  margin-left: 4px;
  font-weight: 400;
}

.grade-tabs { display: flex; gap: 9px; }

.grade-tab {
  flex: 1;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 4px;
  min-height: 62px;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all .15s;
}

.grade-tab:active { transform: scale(.96); }
/* 空年级用 gt-empty（不能用 .empty：那会撞上空状态占位类的 padding: 70px） */
.grade-tab.gt-empty { opacity: .55; }
.grade-tab.active { color: #fff; }

.gt-name { font-size: 15px; font-weight: 600; }
.gt-count { font-size: 11px; opacity: .8; margin-top: 2px; }

.sec-title {
  font-size: 15px;
  font-weight: 600;
  padding: 20px 16px 10px;
}

/* ---------------- 列表 ---------------- */

.list { padding: 0 16px; display: flex; flex-direction: column; gap: 11px; }

.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.card-row:active { background: #F8F8F8; }

.cr-num {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 13px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.cr-body { flex: 1; min-width: 0; }
.cr-title { font-size: 16px; font-weight: 600; }
.cr-sub { font-size: 12px; color: var(--sub); margin-top: 3px; }
.cr-arrow { color: #D1D5DB; font-size: 24px; flex-shrink: 0; }

.clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listen-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 999px;
}

.cr-body:has(.listen-tag) { align-items: flex-start; }

.cr-num { align-self: flex-start; }

/* 行内音频按钮：排在序号前面，点一下就地朗读，不跳详情页 */
.row-audio {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  border: 1px solid #E3E8F0;
  border-radius: 12px;
  background: #F4F7FB;
  color: var(--brand);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.row-audio:active { background: #E8EEF7; }

.row-audio.playing {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  animation: rowAudioPulse 1.1s ease-in-out infinite;
}

@keyframes rowAudioPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .35); }
  50%      { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .row-audio.playing { animation: none; }
}

/* ---------------- 进度条（可拖动定位） ---------------- */

.pb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.pb-track {
  position: relative;
  flex: 1;
  min-width: 80px;
  height: 6px;
  border-radius: 999px;
  background: #E8EDF4;
  cursor: pointer;
}

.pb-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: var(--brand);
  transition: width .12s linear;
}

.pb-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transform: translateY(-50%);
  transition: left .12s linear;
}

.pb.dragging .pb-track { height: 8px; }
.pb.dragging .pb-thumb { width: 18px; height: 18px; margin-left: -9px; }
.pb.dragging .pb-fill { transition: none; }
.pb.dragging .pb-thumb { transition: none; }

.pb-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pb-sep { margin: 0 3px; opacity: .6; }

/* 行内进度条：排在标题下方，宽度随卡片 */
.pb-row { margin-top: 10px; }
.pb-row .pb-thumb { width: 12px; height: 12px; margin-left: -6px; }
.pb-row .pb-track { height: 5px; }

/* 详情页大进度条 */
.pb-main { margin-top: 12px; }
.vc-pb:empty { display: none; }

/* ---------------- 详情页 ---------------- */

.crumb {
  color: #fff;
  background: var(--brand);
  padding: 14px 16px;
  font-size: 13px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 16px;
  margin: 14px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.p-title { margin: 0 0 8px; font-size: 21px; }
.p-sum { margin: 0; color: var(--sub); font-size: 14px; }

.c-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 15px;
}

.c-text { margin: 0; font-size: 15px; }
.c-text.pre { white-space: pre-wrap; }

.kp-list { margin: 0; padding-left: 20px; }
.kp-list li { font-size: 14px; margin-bottom: 6px; color: #92400E; }

/* 语音卡片 */
.voice-card {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  border-radius: 18px;
  padding: 20px 16px;
  margin: 14px 16px;
}

.vc-head { display: flex; align-items: center; gap: 13px; }
.vc-icon { font-size: 26px; }
.vc-info { flex: 1; }
.vc-title { font-size: 16px; font-weight: 600; }
.vc-desc { font-size: 12px; opacity: .85; margin-top: 2px; }

.vc-gear {
  background: rgba(255, 255, 255, .18);
  border: 0;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 19px;
  cursor: pointer;
}

.vc-btns { display: flex; gap: 11px; margin-top: 16px; }

.vc-btn {
  flex: 1;
  background: #fff;
  color: var(--brand);
  border: 0;
  border-radius: 12px;
  padding: 13px 0;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.vc-btn:active { opacity: .8; }
.vc-btn.ghost {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.vc-btn.playing { background: #FFE9A8; color: #92400E; }

.vc-hint {
  margin-top: 14px;
  font-size: 11px;
  opacity: .8;
  line-height: 1.6;
}

/* 底部操作栏 */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

@media (min-width: 720px) {
  .bottom-bar {
    left: 50%;
    transform: translateX(-50%);
    width: 640px;
  }
}

.bb-item {
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  min-width: 52px;
}

.bb-ic { font-size: 21px; line-height: 1; }
.bb-ic.on { filter: none; }
.bb-tx { font-size: 11px; color: var(--sub); }

.bb-main {
  flex: 1;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.bb-main:active { opacity: .9; }

/* 有底部栏时给内容留白 */
body:has(.bottom-bar) .view { padding-bottom: 86px; }

/* ---------------- 语音设置面板 ---------------- */

.panel-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s, visibility .22s;
}

.panel-mask.show { opacity: 1; visibility: visible; }

.voice-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: #fff;
  border-radius: 20px 20px 0 0;
  transform: translateY(105%);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  max-height: 84vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 720px) {
  .voice-panel { left: 50%; transform: translate(-50%, 105%); width: 640px; }
  .voice-panel.open { transform: translate(-50%, 0); }
}

.voice-panel.open { transform: translateY(0); }

.vp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
  font-size: 17px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.vp-close {
  background: none;
  border: 0;
  font-size: 20px;
  color: var(--sub);
  cursor: pointer;
  padding: 0 4px;
}

.vp-body { padding: 16px 20px 26px; }

.vp-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px;
}

.vp-label:first-child { margin-top: 0; }
.vp-label b { color: var(--brand); font-weight: 600; }

.vp-select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}

.vp-note { font-size: 12px; color: #9CA3AF; margin-top: 7px; }

.vp-range {
  width: 100%;
  accent-color: var(--brand);
  height: 28px;
}

.vp-preset { display: flex; gap: 9px; margin-top: 8px; }

.vp-chip {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 8px 0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.vp-chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.vp-foot {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 22px;
  text-align: center;
}

.vp-warn { font-size: 14px; color: #B45309; margin: 0; }

/* ---------------- 收藏 / 空状态 ---------------- */

.fav-list { padding: 16px; display: flex; flex-direction: column; gap: 11px; }

.fav-item {
  display: block;
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.fav-crumb { font-size: 11px; color: #9CA3AF; }
.fav-title { font-size: 16px; font-weight: 600; margin: 5px 0; }
.fav-sum {
  font-size: 13px;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty {
  text-align: center;
  padding: 70px 24px;
  color: var(--sub);
}

.empty p { margin: 12px 0 18px; }

.btn-line {
  display: inline-block;
  border: 1px solid var(--brand);
  color: var(--brand);
  border-radius: 999px;
  padding: 9px 22px;
  text-decoration: none;
  font-size: 14px;
}

/* ---------------- 提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(14px);
  background: rgba(31, 41, 55, .93);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, transform .2s, visibility .2s;
  max-width: 84vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================================
 * 会员体系（会员中心 / 收费咨询 / 管理后台）
 * 所有类名统一 mb- 前缀，避免和通用工具类撞车（.empty 那次教训）
 * ========================================================================= */

.mb-loading { padding: 60px 24px; text-align: center; color: var(--sub); }

/* 顶部大块 */
.mb-hero {
  background: linear-gradient(135deg, #4C6FB8, #7FA0D4);
  color: #fff;
  padding: 30px 24px 26px;
  border-radius: 0 0 26px 26px;
}
.mb-hero-title { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.mb-hero-sub { margin-top: 8px; font-size: 13px; opacity: .92; line-height: 1.6; }
.mb-hero-member .mb-hero-title { font-size: 25px; }
.mb-hero-ok { background: linear-gradient(135deg, #15803D, #22A06B); }

/* 通用卡片 */
.mb-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  margin: 14px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}
.mb-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 4px solid var(--brand);
  line-height: 1.3;
}
.mb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* 表单 */
.mb-field { display: block; margin-bottom: 14px; }
.mb-field > span {
  display: block;
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 6px;
}
.mb-field input,
.mb-field select,
.mb-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
}
.mb-field textarea { resize: vertical; line-height: 1.6; }
.mb-field input:focus,
.mb-field select:focus,
.mb-field textarea:focus { border-color: var(--brand); }

/* 按钮 */
.mb-btn {
  display: inline-block;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.mb-btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  width: 100%;
}
.mb-btn-ghost { color: var(--sub); border-color: var(--line); }
.mb-btn:disabled { opacity: .6; }
.mb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.mb-actions .mb-btn-primary { width: auto; flex: 1; min-width: 140px; }

/* 提示 */
.mb-tip {
  margin-top: 12px;
  font-size: 12px;
  color: var(--sub);
  line-height: 1.7;
}
.mb-err { color: #B91C1C; }
.mb-empty {
  padding: 40px 10px;
  text-align: center;
  color: var(--sub);
  font-size: 14px;
}

/* 权益 */
.mb-benefits { display: flex; flex-direction: column; gap: 14px; }
.mb-benefit { display: flex; gap: 12px; align-items: flex-start; }
.mb-benefit-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #EEF2FB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex: 0 0 auto;
}
.mb-benefit-t { font-size: 14px; font-weight: 600; }
.mb-benefit-d { font-size: 12px; color: var(--sub); line-height: 1.6; margin-top: 2px; }

/* 价格卡 */
.mb-plans { display: flex; flex-direction: column; gap: 10px; }
.mb-plan {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.mb-plan:active { border-color: var(--brand); box-shadow: 0 4px 14px rgba(76, 111, 184, .16); }
.mb-plan-top { display: flex; align-items: baseline; justify-content: space-between; }
.mb-plan-name { font-size: 16px; font-weight: 700; }
.mb-plan-price b { font-size: 22px; color: var(--brand); }
.mb-plan-price i { font-size: 12px; color: var(--sub); font-style: normal; margin-left: 2px; }
.mb-plan-desc { font-size: 12px; color: var(--sub); margin-top: 4px; }
.mb-plan-cta { font-size: 13px; color: var(--brand); font-weight: 600; margin-top: 8px; }

.mb-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.mb-price-row:last-of-type { border-bottom: 0; }
.mb-price-row > span { font-weight: 600; font-size: 15px; }
.mb-price-row > b { color: var(--brand); font-size: 14px; }
.mb-price-row > em {
  flex: 1 0 100%;
  font-style: normal;
  font-size: 12px;
  color: var(--sub);
}
.mb-price-on { background: #F5F8FF; border-radius: 10px; padding-left: 10px; padding-right: 10px; }

/* 键值行 */
.mb-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 14px;
}
.mb-kv:last-of-type { border-bottom: 0; }
.mb-kv > span { color: var(--sub); flex: 0 0 auto; }
.mb-kv > b { font-weight: 600; text-align: right; word-break: break-all; }
.mb-ok { color: #15803D; }
.mb-warn { color: #B45309; }

/* 链接行 */
.mb-link-row {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.mb-link-row:last-child { border-bottom: 0; }

/* 底部模式说明 */
.mb-mode {
  text-align: center;
  color: #9CA3AF;
  font-size: 11px;
  padding: 6px 16px 26px;
}

/* 后台 */
.mb-tabs { display: flex; gap: 8px; padding: 14px 16px 0; }
.mb-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 999px;
  background: #fff;
  color: var(--sub);
  text-decoration: none;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.mb-tab.on { background: var(--brand); color: #fff; font-weight: 600; }

.mb-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 16px 0;
}
.mb-stat {
  flex: 1 1 30%;
  min-width: 92px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.mb-stat b { display: block; font-size: 20px; color: var(--brand); }
.mb-stat span { font-size: 11px; color: var(--sub); }

.mb-list { display: flex; flex-direction: column; gap: 10px; }
.mb-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #FCFCFD;
}
.mb-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mb-row-name { font-size: 15px; font-weight: 600; }
.mb-row-time { font-size: 11px; color: #9CA3AF; flex: 0 0 auto; }
.mb-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--sub);
  margin-top: 8px;
}
.mb-row-demand {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: #F3F4F6;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.mb-row-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mb-mini {
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.mb-mini-danger { color: #B91C1C; border-color: #F3C1C1; }

.mb-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: 2px;
}
.mb-badge-normal { background: #F3F4F6; color: var(--sub); }
.mb-badge-vip { background: #FEF3C7; color: #92400E; }
.mb-badge-admin { background: #DBEAFE; color: #1D4ED8; }
.mb-badge-warn { background: #FEE2E2; color: #B91C1C; }

/* 首页会员推广条 */
.mb-promo {
  display: block;
  margin: 14px 16px 0;
  padding: 16px 18px;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, #7C3AED, #4C6FB8);
  box-shadow: 0 6px 18px rgba(76, 111, 184, .22);
}
.mb-promo-t { font-size: 16px; font-weight: 700; }
.mb-promo-s { font-size: 12px; opacity: .92; margin-top: 6px; }
