/* =============================================================
   英语点读教材 · 会员页通用样式
   配色与书架保持一致；三端自适应（手机 / 平板 / PC）
   ============================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --brand: #2c5f8a;
  --brand-dark: #1e4466;
  --brand-soft: #eaf1f7;
  --ink: #2b2b2b;
  --ink-2: #6b6b6b;
  --ink-3: #9a8f80;
  --line: #e6e0d6;
  --paper: #fffdf9;
  --bg-1: #f7f3ec;
  --bg-2: #ebe3d5;
  --ok: #2e7d52;
  --warn: #b26a00;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 6px 28px rgba(60, 45, 25, .10);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@supports (min-height: 100dvh) { body { min-height: 100dvh; } }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.topbar a { color: #fff; text-decoration: none; font-size: 13px; opacity: .9; white-space: nowrap; }
.topbar a:hover { opacity: 1; text-decoration: underline; }

/* ---------------------------------------------------------- 通用容器 */
.wrap { max-width: 460px; margin: 0 auto; padding: 24px 16px 60px; }

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.card-title { font-size: 17px; font-weight: 600; color: var(--brand-dark); margin-bottom: 4px; }
.card-desc { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; line-height: 1.6; }

/* ---------------------------------------------------------- 表单 */
.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 500;
}
.field label .opt { color: var(--ink-3); font-weight: 400; }
/* 16px 起步：低于 16px 时 iOS 聚焦会自动放大页面 */
.field input, .field select {
  width: 100%;
  padding: 12px 13px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fdfcfa;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44, 95, 138, .13);
}
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }

/* 密码框 + 显示切换 */
.pw-box { position: relative; }
.pw-box input { padding-right: 52px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  padding: 8px 8px;
  cursor: pointer;
  line-height: 1;
}
.pw-toggle:hover { color: var(--brand); }

/* 年级卡片选择器 */
.grade-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.grade-grid label {
  position: relative;
  display: block;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
  background: #fdfcfa;
  cursor: pointer;
  transition: all .15s;
  margin: 0;
}
.grade-grid label:hover { border-color: #b9cfe0; }
.grade-grid input { position: absolute; opacity: 0; pointer-events: none; }
.grade-grid input:checked + span { color: var(--brand-dark); font-weight: 600; }
.grade-grid label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(44, 95, 138, .12);
}
/* 不支持 :has() 的旧浏览器降级 */
.grade-grid label.checked {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ---------------------------------------------------------- 按钮 */
.btn {
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: filter .15s, transform .05s;
  min-height: 48px;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.ghost {
  background: #fff;
  color: var(--brand);
  border: 1px solid #c9d6e2;
  letter-spacing: 0;
}
.btn.sm { padding: 9px 14px; font-size: 14px; letter-spacing: 0; min-height: 40px; width: auto; }

/* ---------------------------------------------------------- 提示 */
.msg {
  margin-top: 12px;
  font-size: 13px;
  padding: 11px 13px;
  border-radius: 10px;
  display: none;
  line-height: 1.5;
}
.msg.show { display: block; }
.msg.err { background: #fdecea; color: #a32d2d; border: 1px solid #f6d3cf; }
.msg.ok { background: #e8f5ec; color: var(--ok); border: 1px solid #cde8d8; }

.switch { text-align: center; font-size: 13px; color: #7a6a58; margin-top: 20px; }
.switch a { color: var(--brand); text-decoration: none; font-weight: 600; }

.notice {
  background: #fff8ec;
  border: 1px solid #f0dcb8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8a6d3b;
  line-height: 1.6;
  margin-top: 14px;
}

.kv { display: flex; justify-content: space-between; font-size: 14px; padding: 9px 0; border-bottom: 1px dashed #eee; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-3); }
.kv .v { font-weight: 500; color: var(--ink); }
.kv .v.hot { color: var(--danger); }
.kv .v.ok { color: var(--ok); }

/* =============================================================
   登录 / 注册：PC 双栏、平板与手机单栏
   ============================================================= */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
@supports (min-height: 100dvh) { .auth-page { min-height: 100dvh; } }

.auth-side {
  background: linear-gradient(150deg, #2c5f8a 0%, #1e4466 55%, #16344f 100%);
  color: #fff;
  padding: 26px 22px 22px;
  position: relative;
  overflow: hidden;
}
.auth-side::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.auth-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
}
.auth-brand b { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.auth-brand span { display: block; font-size: 11px; opacity: .75; font-weight: 400; }

.auth-hero { position: relative; z-index: 1; }
.auth-hero h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; line-height: 1.35; }
.auth-hero p { font-size: 13px; opacity: .82; margin-bottom: 18px; }
.auth-list { list-style: none; display: grid; gap: 9px; }
.auth-list li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; opacity: .92; line-height: 1.5;
}
.auth-list li i { font-style: normal; flex: 0 0 auto; opacity: .9; }

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px 40px;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.auth-head { margin-bottom: 20px; }
.auth-head h1 { font-size: 20px; font-weight: 600; color: var(--brand-dark); }
.auth-head p { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.auth-foot {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.auth-foot a { color: var(--brand); text-decoration: none; font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

.badge-free {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 6px;
  letter-spacing: 0;
}

/* 注册成功卡片 */
.auth-done { text-align: center; padding: 6px 0 0; }
.auth-done .tick {
  width: 58px; height: 58px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: #e8f5ec;
  color: var(--ok);
  font-size: 30px;
  display: flex; align-items: center; justify-content: center;
}
.auth-done h2 { font-size: 18px; color: var(--brand-dark); margin-bottom: 6px; }
.auth-done p { font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }

/* ---------------------------------------------------------- 断点 */
/* 平板：单栏，卡片加宽居中 */
@media (min-width: 600px) {
  .auth-main { padding: 34px 24px 50px; }
  .auth-card { padding: 30px 28px; }
  .grade-grid { grid-template-columns: repeat(4, 1fr); }
  .wrap { padding: 30px 24px 70px; }
}

/* PC：左右分栏，左侧品牌常驻 */
@media (min-width: 900px) {
  .auth-page { flex-direction: row; }
  .auth-side {
    flex: 0 0 42%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 52px;
  }
  .auth-hero h2 { font-size: 27px; margin-bottom: 12px; }
  .auth-hero p { font-size: 14px; margin-bottom: 26px; }
  .auth-list { gap: 12px; }
  .auth-list li { font-size: 14px; }
  .auth-main { padding: 48px 40px; }
  .auth-card { max-width: 400px; }
}

/* 超宽屏：别让表单被拉太长 */
@media (min-width: 1400px) {
  .auth-main { padding: 60px 80px; }
}

/* ----------------------------------------------------------
   管理员联系方式卡片（noperm / account 页共用，见 contacts.js）
   ---------------------------------------------------------- */
.cc-title { font-size: 14px; font-weight: 600; color: #1f2d3d; margin: 14px 0 8px; }
.cc-card {
  display: flex; gap: 12px; align-items: center;
  background: #fdfaf4; border: 1px solid #eadfc8; border-radius: 12px;
  padding: 12px; margin-bottom: 10px;
}
.cc-qr {
  width: 96px; height: 96px; border-radius: 10px;
  border: 1px solid #e5dcc9; object-fit: cover; flex: none; background: #fff;
}
.cc-info { flex: 1; min-width: 0; }
.cc-info b { font-size: 15px; color: #1f2d3d; }
.cc-wx { font-size: 13px; color: #55606c; margin-top: 4px; word-break: break-all; }
.cc-id { font-weight: 600; color: #1f2d3d; margin-right: 6px; }
.cc-copy {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid #c9d6e2; background: #fff; color: #2c5f8a; cursor: pointer;
}
.cc-hint { font-size: 11.5px; color: #a89c8c; margin-top: 5px; }
