/* ========== 登录 / 注册页 ========== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-header);
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary-deep);
  letter-spacing: 0.5px;
}
.auth-title { font-size: 22px; margin: 10px 0 2px; }
.auth-sub { color: var(--text-2); font-size: 14px; margin-bottom: 22px; }
.auth-label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin: 14px 0 6px;
}
.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #fff;
}
.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin: 12px 0 0;
}
/* 协议勾选：链接放在 label 之外，避免点击链接时误勾选 */
.auth-consent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-2);
}
.auth-check {
  width: 16px;
  height: 16px;
  margin: 0 2px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.auth-consent-text { cursor: pointer; }
.auth-consent a { color: var(--primary-deep); text-decoration: none; font-weight: 600; }
.auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 20px;
  font-size: 16px;
}
.auth-submit:disabled { opacity: 0.6; cursor: default; }
.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}
.auth-switch a { color: var(--primary-deep); text-decoration: none; font-weight: 600; }
/* 找回密码：登录页入口、步骤提示、验证码行 */
.auth-forgot {
  margin: 6px 0 0;
  text-align: right;
  font-size: 12.5px;
}
.auth-forgot a {
  color: var(--primary-deep);
  text-decoration: none;
  font-weight: 600;
}
.auth-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row .auth-input { width: auto; flex: 1; min-width: 0; }
.auth-code-row .btn { flex-shrink: 0; height: 44px; padding: 0 14px; font-size: 13.5px; }
.auth-code-row .btn:disabled { opacity: .6; cursor: default; }
.auth-success { padding: 8px 0 0; text-align: center; }
.auth-success .emoji { font-size: 34px; line-height: 1.4; }
a.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ========== 我的页（学习仪表盘） ========== */
.me-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius, 18px);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.me-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
  min-width: 0;
}
.me-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-deep);
  font-size: 23px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}
.me-info { flex: 1; min-width: 0; }
.me-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.me-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-role-chip {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.me-head-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.me-head-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.me-head-btn:active { background: var(--bg-2); color: var(--primary-deep); }

.me-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.me-section-head .card-title { margin: 0; }
.me-section-link {
  padding: 0;
  background: none;
  color: var(--primary-deep);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
}
.me-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}
.me-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  transition: background .15s;
}
.me-metric:active { background: var(--bg-2); }
.me-metric-num { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.me-metric-slash { margin: 0 1px; font-weight: 500; color: var(--text-3); }
.me-metric-label { font-size: 11px; color: var(--text-2); white-space: nowrap; }

.me-plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
}
.me-plan-label { flex-shrink: 0; color: var(--text-2); }
.me-plan-value {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-list-card { padding: 4px 18px; }
.me-menu { margin-top: 0; }
.me-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
}
.me-menu-row:last-child { border-bottom: none; }
.me-menu-row:active .me-menu-label { color: var(--primary-deep); }
.me-menu-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-deep);
  flex-shrink: 0;
}
.me-menu-icon svg { display: block; }
.me-menu-label { flex: 1; }
.me-menu-arrow { color: var(--text-3); font-size: 18px; line-height: 1; }

/* ========== 设置页 ========== */
.settings-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
}
.settings-title { font-size: 18px; font-weight: 700; }
.settings-group {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  transition: background .15s;
}
.settings-row:last-child { border-bottom: none; }
/* 协议链接行：与按钮行外观一致，去掉下划线 */
.settings-row-link { text-decoration: none; }
.settings-row:active { background: var(--bg-2); }
.settings-row-label { flex: 1; font-weight: 500; }
.settings-row-extra {
  max-width: 58%;
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-row-arrow { color: var(--text-3); font-size: 18px; line-height: 1; }
.settings-row-danger .settings-row-label { color: var(--danger); font-weight: 600; }
.set-row-danger .set-row-title { color: var(--danger); }
/* 退出登录：参考设置页的整条浅红按钮 */
.btn-logout {
  display: block;
  width: 100%;
  margin: 22px 0 0;
  padding: 15px;
  border-radius: var(--radius-sm);
  background: rgba(240, 90, 90, .12);
  color: var(--danger);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  transition: background .15s;
}
.btn-logout:active { background: rgba(240, 90, 90, .22); }
.settings-foot {
  margin: 20px 0 4px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* 设置二级弹层 */
.settings-sheet {
  max-width: 400px;
  padding: 18px 20px 20px;
  text-align: left;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sheet-head h3 { margin: 0; font-size: 17px; }
.sheet-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
}
.sheet-close:active { background: var(--bg-2); }
.sheet-body {
  max-height: min(68vh, 560px);
  overflow-y: auto;
  /* 隐藏滚动条本体，内容仍可滚动 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sheet-body::-webkit-scrollbar { width: 0; height: 0; }
.sheet-note {
  margin: 4px 0 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.sheet-note-dim { color: var(--text-3); }

/* 会员订阅弹层 */
.plan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.plan-row:last-of-type { border-bottom: none; }
.plan-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.plan-name { font-size: 15px; font-weight: 700; color: var(--text); }
.plan-desc { font-size: 12.5px; color: var(--text-2); }
.plan-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent, #ff9a3c);
  font-variant-numeric: tabular-nums;
}
.plan-row .btn {
  padding: 7px 16px;
  font-size: 13px;
  border-radius: 20px;
}
.sheet-actions { display: flex; gap: 10px; margin-top: 14px; }
.sheet-actions .btn { flex: 1; padding: 11px; font-size: 15px; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 6px 20px rgba(240, 90, 90, .25); }
.btn-danger:active { transform: scale(.97); }

.set-list { border-top: 1px solid var(--border); }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.set-row:last-child { border-bottom: none; }
.set-row-btn { width: 100%; background: none; font-family: inherit; text-align: left; }
.set-row-btn:active { background: var(--bg-2); }
.set-row-main { flex: 1; min-width: 0; display: block; }
.set-row-title { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.set-row-desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
}
.set-row-value {
  font-size: 13px;
  color: var(--text-2);
  text-align: right;
  word-break: break-all;
}
.set-row-arrow { color: var(--text-3); font-size: 18px; line-height: 1; }
.set-row.is-off .set-row-title { color: var(--text-3); }

/* 开关 */
.set-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.set-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.set-toggle i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d9e5de;
  transition: background .2s;
}
.set-toggle i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .2s;
}
.set-toggle input:checked + i { background: var(--primary); }
.set-toggle input:checked + i::after { transform: translateX(20px); }

.set-time {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.set-time:focus { border-color: var(--primary); }
.set-time:disabled { opacity: .5; }

/* 主题选择 */
.theme-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  text-align: left;
  font-family: inherit;
}
.theme-option.active { border-color: var(--primary); background: var(--primary-light); }
.theme-swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.theme-swatch.normal { background: linear-gradient(135deg, #ffffff 0%, #e8f9f1 100%); }
.theme-swatch.eye { background: linear-gradient(135deg, #fffcf4 0%, #eee4cc 100%); }
.theme-swatch.dark { background: linear-gradient(135deg, #1a221e 0%, #0e1412 100%); }
.theme-option-main { flex: 1; min-width: 0; display: block; }
.theme-option-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.theme-option-desc { display: block; margin-top: 1px; font-size: 12px; color: var(--text-2); }
.theme-check { color: var(--primary-deep); font-weight: 700; opacity: 0; }
.theme-option.active .theme-check { opacity: 1; }

/* 检测更新 / 网络检测 */
.update-box { padding: 18px 0 8px; text-align: center; }
.update-spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 10px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: set-spin .8s linear infinite;
}
@keyframes set-spin { to { transform: rotate(360deg); } }
.update-status { font-size: 14px; font-weight: 600; color: var(--text-2); }
.update-status.ok { color: var(--primary-deep); }
.update-status.bad { color: var(--danger); }

/* 关于我们 */
.about-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.about-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-name { font-size: 15px; font-weight: 700; }
.about-ver { font-size: 12px; color: var(--text-2); }

/* 帮助与反馈（独立页面） */
.help-intro { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.help-group { padding: 4px 16px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.faq-item { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); }
.faq-q { font-size: 13.5px; font-weight: 600; color: var(--text); }
.faq-a { margin-top: 4px; font-size: 12.5px; line-height: 1.65; color: var(--text-2); }

/* ICP 备案号 */
.icp-num { margin: 4px 0 8px; font-size: 15px; font-weight: 700; color: var(--text); }

/* ========== 修改密码弹层 ========== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal-card h3 { font-size: 17px; margin-bottom: 14px; }
.modal-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg);
  margin-bottom: 10px;
}
.modal-input:focus { border-color: var(--primary); background: #fff; }
.modal-err { color: var(--danger); font-size: 13px; margin: 4px 0 0; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}
.modal-actions .btn { padding: 8px 18px; border-radius: var(--radius-xs); }

/* ========== 注册后引导：身份 / 目标选择 ==========
   整页铺满：纸底铺满视口，内容区自撑高度，选项两列铺开，主按钮贴底。 */
body.onb-page.rd-auth {
  display: block;
  background: #f6f8f4;
}
.onb-card {
  width: 100%;
  max-width: 620px;
  height: 100vh;
  height: 100dvh;   /* 固定视口高度，选项多时只在面板内滚动，底部按钮始终可见 */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 18px 0;
}
.onb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 26px;
}
.onb-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: -6px;
  padding: 0;
  border-radius: 999px;
  color: #44544c;
}
.onb-back:active { opacity: .6; }
.onb-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--rd-green);
}
.onb-step { font-size: 11.5px; color: var(--rd-faint); }
.onb-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.rd-auth .onb-panel .auth-title {
  font-size: 25px;
  line-height: 1.35;
  text-align: left;
}
body.rd-auth .onb-panel .auth-sub {
  margin: 8px 0 20px;
  text-align: left;
}
.onb-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  padding-bottom: 6px;
}
.onb-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 88px;
  padding: 14px 13px;
  border: 1px solid #e2ebe3;
  border-radius: 16px;
  background: #fff;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.onb-options > .onb-option:last-child:nth-child(odd) { grid-column: 1 / -1; }
.onb-option-main { display: flex; flex-direction: column; gap: 3px; }
.onb-option-label { font-size: 15px; font-weight: 600; color: var(--rd-ink); }
.onb-option-desc { font-size: 11.5px; line-height: 1.55; color: var(--rd-muted); }
.onb-option-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe5dd;
  border-radius: 50%;
  color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.onb-option.is-on { border-color: #348562; background: #eef6ef; }
.onb-option.is-on .onb-option-check {
  border-color: #348562;
  background: #348562;
  color: #fff;
}
.onb-option:active { background: #f3f7f4; }
.onb-foot {
  flex-shrink: 0;
  padding: 18px 0 calc(18px + env(safe-area-inset-bottom, 0px));
}
body.rd-auth .onb-foot .auth-submit {
  height: 54px;
  margin-top: 0;
  border-radius: 16px;
  background: #348562;
  box-shadow: none;
  letter-spacing: .02em;
}
.onb-foot .auth-submit:disabled { opacity: .45; cursor: default; }

/* 注册页：默认头像二选一（男款 / 女款插画） */
.auth-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.auth-avatar-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.auth-avatar-opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.auth-avatar-opt img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  border: 2px solid var(--border);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.auth-avatar-opt.is-on img {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(52, 133, 98, .14);
  transform: translateY(-1px);
}
.auth-avatar-opt.is-on span { color: var(--primary-deep); font-weight: 600; }
.auth-avatar-tip {
  flex: 1;
  min-width: 118px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3, #8a9a90);
}
