/* ==========================================================================
   Echo 英语 · 全局样式
   设计基调：极度简洁 / 深色沉浸 / 单一强调色（紫）
   ========================================================================== */

:root {
  --bg: #000208;
  --bg-2: #0a0b12;
  --card: #12131b;
  --card-2: #1a1c26;
  --card-3: #23252f;
  --line: #262833;
  --line-2: #333645;

  --text: #f3f4f8;
  --text-2: #9a9caa;
  --text-3: #62646f;

  --purple: #7c5cff;
  --purple-2: #a78bfa;
  --blue: #4b9bff;
  --cyan: #43d9d9;
  --green: #2fd07a;
  --red: #ff4d5e;
  --amber: #ffb020;

  --grad: linear-gradient(90deg, #7c5cff 0%, #4b9bff 55%, #43d9d9 100%);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .55);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2c38; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 原子工具 ---------- */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.grow { flex: 1; }
.hide { display: none !important; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 顶部细渐变条 ---------- */
.topline {
  position: fixed; inset: 0 0 auto 0; height: 2px;
  background: var(--grad); z-index: 60;
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
  transition: .16s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--card-3); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad); border: 0; color: #fff; font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--card-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card-hover { transition: .18s ease; }
.card-hover:hover { border-color: #3b3550; transform: translateY(-2px); }

/* ---------- 胶囊标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
}
.chip-purple { color: var(--purple-2); border-color: #3a2f6b; background: #1a1630; }
.chip-blue { color: #8ec2ff; border-color: #234a7a; background: #101d2e; }
.chip-green { color: #74e0a8; border-color: #1f4d38; background: #0f231b; }
.chip-amber { color: #ffcf6b; border-color: #5a4517; background: #241c0c; }

/* ---------- 开关 ---------- */
.switch {
  position: relative; width: 38px; height: 21px; border-radius: 999px;
  background: #33353f; transition: .2s ease; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%; background: #fff;
  transition: .2s ease;
}
.switch.on { background: var(--purple); }
.switch.on::after { transform: translateX(17px); }
.switch-wrap { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }

/* ---------- 输入 ---------- */
.input, .textarea, .select {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; outline: none; transition: .16s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--purple); }
.textarea { resize: vertical; min-height: 82px; line-height: 1.7; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: 12.5px; color: var(--text-2); }

/* ---------- 进度条 ---------- */
.bar { height: 4px; background: #1e202a; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .35s ease; }

/* 品牌 Logo 管理 */
.brand-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.brand-preview {
  width: 104px; height: 104px; flex: none; border-radius: 16px;
  background: var(--card-2); border: 1px dashed var(--line-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  text-align: center; padding: 8px;
}
.brand-preview img { width: 100%; height: 100%; object-fit: contain; }
.switch-row { margin-top: 8px; }
.switch-wrap input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--purple); }

/* ---------- 头像 ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex: none;
  overflow: hidden; position: relative;
}
.avatar-lg { width: 46px; height: 46px; font-size: 18px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; border-radius: 50%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-badge {
  position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%;
  background: #07c160; border: 2px solid var(--bg);
}
/* 可点击的资料入口 */
.profile-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px;
  border-radius: 10px; cursor: pointer; transition: .16s; border: 1px solid transparent;
}
.profile-btn:hover { background: var(--card); border-color: var(--line); }

/* 编辑资料弹窗 */
.avatar-picker { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar-choose { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* 个人中心 */
.profile-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.badge { padding: 2px 8px; border-radius: 7px; font-family: var(--mono); font-size: 12px; flex: none; }
.badge.in { background: rgba(65, 209, 165, .14); color: var(--green); }
.badge.out { background: rgba(255, 107, 129, .14); color: var(--red); }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: 0; }
.shop-item .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 应用框架 ---------- */
.app { min-height: 100%; padding-bottom: 60px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(6, 7, 12, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 60px; display: flex; align-items: center; gap: 22px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .3px; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; font-weight: 800;
}
.nav-tabs { display: flex; gap: 4px; }
.nav-tab {
  padding: 7px 14px; border-radius: 9px; color: var(--text-2); font-size: 13.5px;
  transition: .16s;
}
.nav-tab:hover { color: var(--text); background: var(--card); }
.nav-tab.active { color: var(--text); background: var(--card-2); font-weight: 600; }

/* ---------- Toast ---------- */
#toast-box {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #23252f; border: 1px solid var(--line-2); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow); animation: toastIn .22s ease;
}
.toast.ok { border-color: #1f4d38; }
.toast.err { border-color: #5c2028; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .68);
  z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(3px);
}
.modal {
  width: 100%; max-width: 560px; max-height: 86vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 16px; box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg-2); z-index: 2;
}
.modal-title { font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  padding: 16px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--bg-2);
}

/* ---------- 空态 ---------- */
.empty {
  padding: 52px 20px; text-align: center; color: var(--text-3);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
}

/* ==========================================================================
   登录页
   ========================================================================== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
}
.login-glow {
  position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, .22) 0%, transparent 62%);
  top: -180px; left: 50%; transform: translateX(-50%); filter: blur(20px);
}
.login-card {
  position: relative; width: 100%; max-width: 400px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 40px 34px; text-align: center;
  box-shadow: var(--shadow);
}
.login-title { font-size: 22px; font-weight: 700; margin: 18px 0 6px; letter-spacing: .5px; }
.login-sub { color: var(--text-2); font-size: 13px; margin-bottom: 26px; }

.qr-box {
  width: 190px; height: 190px; margin: 0 auto; padding: 12px;
  background: #fff; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; position: relative;
}
.qr-box canvas,
.qr-box img.qr-real { width: 100%; height: 100%; display: block; }
.qr-box img.qr-real { filter: none; }
.qr-refresh {
  position: absolute; inset: 12px; background: rgba(0, 0, 0, .78); color: #fff;
  border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; font-size: 13px;
}
.qr-tip { margin-top: 16px; color: var(--text-2); font-size: 13px; }
.qr-tip b { color: var(--purple-2); }

.login-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 22px; }
.login-step { width: 26px; height: 3px; border-radius: 3px; background: #2a2c38; }
.login-step.on { background: var(--purple); }

.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; letter-spacing: 6px; text-align: center; font-family: var(--mono); }

.login-foot { margin-top: 22px; color: var(--text-3); font-size: 12px; line-height: 1.8; }

/* ==========================================================================
   主页（用户中心）
   ========================================================================== */
.hero {
  margin-top: 28px; padding: 26px 28px; border-radius: 18px;
  background: linear-gradient(115deg, #191447 0%, #141527 52%, #101322 100%);
  border: 1px solid #2b2a4a;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
}
.hero-title { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.hero-meta { color: #b9b6d8; font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero-progress { margin-top: 16px; width: 100%; max-width: 420px; }
.hero-progress .bar { height: 5px; background: rgba(255, 255, 255, .12); }
.hero-actions { display: flex; gap: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-label { color: var(--text-2); font-size: 12.5px; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 3px; }

/* 打卡 + 概况合并行：左「本周打卡」右「四项数据」 */
.overview-row {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 16px; align-items: stretch;
}
.overview-week { display: flex; align-items: center; padding: 18px 22px; }
.stat-grid.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 0; }
.stat-grid.mini .stat { padding: 12px 15px; display: flex; flex-direction: column; justify-content: center; }
.stat-grid.mini .stat-label { font-size: 12px; }
.stat-grid.mini .stat-value { font-size: 21px; margin-top: 3px; }
.stat-grid.mini .stat-value small { font-size: 12px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 34px 0 16px; }
.section-title { font-size: 16.5px; font-weight: 650; }
.section-desc { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.course-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .18s ease;
}
.course-card:hover { border-color: #3b3550; transform: translateY(-2px); }
.course-cover { height: 132px; background: var(--card-2); position: relative; overflow: hidden; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px);
  padding: 3px 9px; border-radius: 7px; font-size: 11.5px; color: #dcd9f5;
}
.course-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.course-title { font-size: 14.5px; font-weight: 620; line-height: 1.45; }
.course-sub { color: var(--text-3); font-size: 12.5px; }
.course-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.price { color: #ffd479; font-weight: 700; font-size: 15px; }
.price small { font-weight: 400; font-size: 11.5px; color: var(--text-3); margin-left: 4px; }

.post-box { display: flex; gap: 12px; align-items: flex-start; }
.post { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.post-name { font-size: 13.5px; font-weight: 600; }
.post-time { color: var(--text-3); font-size: 12px; font-weight: 400; margin-left: 8px; }
.post-text { color: #d6d7de; font-size: 13.5px; white-space: pre-wrap; }
.post-acts { display: flex; gap: 18px; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.post-acts span { cursor: pointer; transition: .15s; }
.post-acts span:hover { color: var(--purple-2); }

.rank-item { display: flex; align-items: center; gap: 14px; padding: 11px 0; }
.rank-no {
  width: 24px; height: 24px; border-radius: 7px; background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-2); flex: none;
}
.rank-no.top1 { background: linear-gradient(135deg, #ffcf6b, #ff9d3d); color: #2a1e00; }
.rank-no.top2 { background: linear-gradient(135deg, #d9dee8, #a9b2c1); color: #1a1d24; }
.rank-no.top3 { background: linear-gradient(135deg, #e0a878, #c07f4b); color: #2a1a0c; }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }

/* ==========================================================================
   学习页
   ========================================================================== */
.learn-page {
  min-height: 100vh; background: var(--bg); display: flex; flex-direction: column;
  user-select: none; position: relative;
}
.learn-topline { height: 2px; background: #16181f; }
.learn-topline > i { display: block; height: 100%; background: var(--grad); transition: width .35s ease; }

.learn-head {
  height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px;
  border-bottom: 1px solid var(--line);
}
.learn-back {
  width: 32px; height: 32px; border-radius: 50%; background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; flex: none;
}
.learn-title { font-size: 15.5px; font-weight: 650; }
.learn-title .cnt { color: var(--purple-2); margin-left: 2px; }
.learn-sub { color: var(--text-3); font-size: 12px; margin-top: 1px; }

.learn-hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; gap: 16px; flex-wrap: wrap;
}
.hud-left, .hud-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hud-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  font-size: 12.5px; color: var(--text-2);
}
.hud-pill b { color: var(--text); font-family: var(--mono); font-weight: 600; letter-spacing: .5px; }
.hud-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 9px; background: var(--card); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2); transition: .16s;
}
.hud-btn:hover { background: var(--card-2); color: var(--text); }
.hud-btn.on { color: var(--purple-2); border-color: #3a2f6b; background: #191434; }
.hud-btn i { font-style: normal; font-size: 13px; }

.learn-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; padding: 12px 22px 16px; min-height: 0;
  overflow-y: auto;
}

.learn-figure { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.figure-img {
  width: 264px; height: 158px; object-fit: cover; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
}

/* 句子展示 */
.sentence { text-align: center; }
.sentence-en {
  font-size: 34px; font-weight: 600; letter-spacing: .4px; line-height: 1.45;
  font-family: "Georgia", "Times New Roman", serif;
}
.sentence-en .done { color: var(--blue); }
.sentence-en .todo { color: #8c8f9c; }
.sentence-en .bad { color: var(--red); text-decoration: underline; text-decoration-color: var(--red); }
.sentence-en .caret {
  display: inline-block; width: 2px; height: .92em; background: var(--purple);
  vertical-align: -.1em; margin-left: 1px; animation: blink 1s steps(2) infinite;
}
.sentence-en .blank {
  display: inline-block; min-width: 96px; border-bottom: 3px solid #4a4d5c;
  margin: 0 6px; text-align: center;
}
.sentence-en .blank.filled { color: var(--blue); border-color: var(--blue); }
@keyframes blink { 50% { opacity: 0; } }

.sentence-zh { color: var(--text-2); font-size: 16px; margin-top: 12px; }
.sentence-tag { color: var(--text-3); font-size: 12.5px; margin-top: 8px; }
.sentence-zh.blur { filter: blur(7px); opacity: .5; }

/* 图片选择（听句辨图） */
.choice-grid { display: grid; gap: 16px; }
.choice-grid.n2 { grid-template-columns: repeat(2, 268px); }
.choice-grid.n3 { grid-template-columns: repeat(3, 232px); }
.choice-grid.n4 { grid-template-columns: repeat(4, 202px); }
.choice {
  border: 2px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--card); cursor: pointer; transition: .16s; position: relative;
}
.choice img { width: 100%; height: 148px; object-fit: cover; }
.choice:hover { border-color: #4a4d5c; }
.choice.right { border-color: var(--green); }
.choice.wrong { border-color: var(--red); }
.choice .mark {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
}
.choice.right .mark { background: var(--green); }
.choice.wrong .mark { background: var(--red); }

/* 虚拟键盘 */
.keyboard-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kb {
  background: #17181f; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 18px 24px; position: relative;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}
.kb-row { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.kb-row:last-child { margin-bottom: 0; }
.key {
  width: 42px; height: 38px; border-radius: 8px; background: #262833;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: #c9cbd6; font-family: var(--mono);
  border: 1px solid #2f3242; transition: .14s; position: relative;
}
.key.space { width: 250px; }
.key.hl {
  background: var(--purple); color: #fff; border-color: var(--purple-2);
  animation: keyPulse 1.1s ease-in-out infinite;
}
@keyframes keyPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(124, 92, 255, .30); }
  50%      { box-shadow: 0 0 0 8px rgba(124, 92, 255, .10); }
}
/* 基准键（F / J 定位点）的下沿凸起，符合真实键帽盲打定位 */
.key.home::after {
  content: ""; position: absolute; left: 50%; bottom: 5px;
  width: 14px; height: 2px; border-radius: 2px;
  background: #4a4d5c; transform: translateX(-50%);
}
.kb-hands { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.kb-tip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: center; color: var(--text-2); font-size: 13px;
}
.kb-tip b {
  color: #fff; background: var(--purple); font-family: var(--mono);
  font-size: 15px; font-weight: 700; padding: 2px 10px; border-radius: 7px;
}

/* 底部工具栏 */
.learn-tools {
  border-top: 1px solid var(--line); padding: 12px 22px;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  background: rgba(8, 9, 14, .6);
}
.tool-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 14px;
  border-radius: 10px; background: var(--card-2); border: 1px solid var(--line);
  font-size: 13.5px; transition: .16s;
}
.tool-btn:hover { background: var(--card-3); }
.tool-btn:active { transform: translateY(1px); }
.tool-btn.primary { background: var(--grad); border: 0; font-weight: 600; }
.kbd {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  background: #0d0e14; border: 1px solid var(--line-2); border-bottom-width: 2px;
  padding: 1px 6px; border-radius: 5px; white-space: nowrap;
}

/* 学习页内的浮层 */
.panel {
  position: absolute; top: 64px; right: 22px; width: 320px; z-index: 30;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.panel-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.panel-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--line);
}
.panel-item:last-child { border-bottom: 0; }
.panel-item .k {
  font-family: var(--mono); font-size: 11.5px; color: var(--purple-2);
  background: #171331; border: 1px solid #322a5c; padding: 2px 8px; border-radius: 6px;
  cursor: pointer;
}
.panel-item .k:hover { background: #221a45; }

.content-list { display: flex; flex-direction: column; gap: 2px; }
.content-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text-2);
}
.content-row:hover { background: var(--card); color: var(--text); }
.content-row.on { background: #191434; color: var(--purple-2); }
.content-row .idx { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); width: 26px; }

/* 报告页 */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.report-cell { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.report-cell b { display: block; font-size: 19px; margin-bottom: 2px; }

/* 完成页 */
.done-box { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.done-ring {
  width: 88px; height: 88px; border-radius: 50%; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-size: 36px;
}

/* ==========================================================================
   管理后台
   ========================================================================== */
.upload-drop {
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--text-2); cursor: pointer;
  transition: .16s; background: var(--card);
}
.upload-drop:hover { border-color: var(--purple); background: #15132a; }
.upload-drop b { color: var(--purple-2); }

.img-thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.img-thumb {
  width: 104px; height: 78px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); position: relative; background: var(--card);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .del {
  position: absolute; top: 4px; right: 4px; width: 19px; height: 19px;
  border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.img-thumb .nm {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px;
  background: rgba(0, 0, 0, .72); padding: 2px 4px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table th { color: var(--text-2); font-weight: 500; font-size: 12.5px; background: #101119; }
.data-table tr:hover td { background: #101119; }

.steps { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  border-radius: 10px; background: var(--card); border: 1px solid var(--line);
  font-size: 13px; color: var(--text-2);
}
.step.on { border-color: #3a2f6b; background: #191434; color: var(--purple-2); }
.step-no {
  width: 20px; height: 20px; border-radius: 50%; background: var(--card-3);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px;
}
.step.on .step-no { background: var(--purple); color: #fff; }

/* 响应式 */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .overview-row { grid-template-columns: 1fr; }
  .choice-grid.n3, .choice-grid.n4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .sentence-en { font-size: 27px; }
  .choice-grid.n2, .choice-grid.n3, .choice-grid.n4 { grid-template-columns: repeat(2, 1fr); }
  .choice img { height: 108px; }
  .kb { transform: scale(.72); transform-origin: top center; }
  .nav-tabs { overflow-x: auto; }
}

/* ---------- 邀请码 ---------- */
.invite-code {
  background: var(--card-2); border: 1px dashed var(--line-2);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.code {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  letter-spacing: 4px; color: var(--purple-2);
}
.invite-member {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-2);
}
.invite-member .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }

/* ==========================================================================
   管理控制台
   ========================================================================== */
.console { display: grid; grid-template-columns: 214px 1fr; min-height: 100vh; }
.side {
  background: #0a0b11; border-right: 1px solid var(--line);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
}
.side-brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 18px; font-weight: 700; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: var(--text-2); font-size: 13.5px; cursor: pointer; transition: .15s;
}
.side-nav a:hover { background: var(--card); color: var(--text); }
.side-nav a.active { background: #191434; color: var(--purple-2); font-weight: 600; }
.side-nav a i { font-style: normal; width: 16px; text-align: center; opacity: .9; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }

.main { padding: 22px 28px 70px; min-width: 0; }
.main-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.main-title { font-size: 20px; font-weight: 700; }
.main-sub { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.mod { display: none; }
.mod.on { display: block; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi-l { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi-v { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin-top: 6px; }
.kpi-v small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 3px; }
.kpi-d { font-size: 12px; margin-top: 5px; color: var(--text-3); }
.kpi-d .up { color: var(--green); }
.kpi-d .down { color: var(--red); }
.kpi-label { color: var(--text-2); font-size: 12.5px; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin-top: 6px; }
.kpi-value.green { color: var(--green); }
.kpi-value.purple { color: var(--purple-2); }
.kpi-sub { font-size: 12px; margin-top: 5px; color: var(--text-3); line-height: 1.5; }

/* 图表内文字与网格 */
.chart-svg .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart-svg .ax { fill: var(--text-3); font-size: 10.5px; font-family: var(--mono); }

/* 排名序号 */
.rk {
  width: 22px; height: 22px; flex: none; border-radius: 7px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11.5px; font-family: var(--mono);
  background: var(--card-3); color: var(--text-3);
}
.rk.top { background: #191434; color: var(--purple-2); font-weight: 700; }
.mini-row .bar { width: 110px; flex: none; height: 6px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.mini-row .bar > i { display: block; height: 100%; border-radius: 999px; }
.legend-wrap { margin-top: 12px; }
.legend-wrap .legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.legend-wrap .legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-wrap .legend b { font-family: var(--mono); margin-left: auto; }
.legend-wrap .legend .dim { min-width: 42px; text-align: right; }

/* SEO 预览与自检 */
.seo-preview .sp-url { color: #5f9e5f; font-size: 12.5px; margin-bottom: 4px; word-break: break-all; }
.seo-preview .sp-title { color: #8ab4f8; font-size: 17px; line-height: 1.4; }
.seo-preview .sp-desc { color: #b8b9c4; font-size: 13px; line-height: 1.6; margin-top: 5px; }
.audit-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.5; margin-bottom: 6px;
}
.audit-item.warn { background: rgba(242, 181, 60, .1); color: #f2b53c; }
.audit-item.ok { background: rgba(65, 209, 165, .1); color: var(--green); }

/* 图表 */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.chart-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chart-h b { font-size: 14px; font-weight: 620; }
.chart-h span { color: var(--text-3); font-size: 12px; }
.chart-svg { width: 100%; height: 168px; display: block; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 142px; }
.bars .bi { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.bars .bi > i {
  width: 100%; max-width: 26px; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #7c5cff, #4b9bff); min-height: 3px; transition: .3s;
}
.bars-x { display: flex; gap: 6px; margin-top: 8px; }
.bars-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--text-3); }

/* 构成条 */
.stack-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--card-3); }
.stack-bar > i { display: block; height: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: block; }

/* 通用表格式列表 */
.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .vl { color: var(--text-2); font-family: var(--mono); font-size: 12.5px; }

/* 搜索 / 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 200px; }

/* SEO 表单 */
.seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seo-grid .full { grid-column: 1 / -1; }
.seo-preview {
  background: #101119; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.seo-preview .t { color: #8ab4f8; font-size: 17px; line-height: 1.4; }
.seo-preview .u { color: #5f9e5f; font-size: 12.5px; margin: 3px 0 5px; }
.seo-preview .d { color: #b8b9c4; font-size: 13px; line-height: 1.6; }
.code-block {
  background: #0b0c12; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-family: var(--mono); font-size: 12px;
  color: #b9c2d8; max-height: 320px; overflow: auto; white-space: pre; line-height: 1.7;
}
.seo-field-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.seo-field-row:last-child { border-bottom: 0; }
.seo-field-row .lb { width: 150px; flex: none; color: var(--text-2); font-size: 13px; }
.seo-field-row .vl { flex: 1; font-size: 13px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  padding: 7px 13px; border-radius: 9px; background: var(--card); border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px;
}
.tabs button.on { background: #191434; border-color: #3a2f6b; color: var(--purple-2); font-weight: 600; }

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .console { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; }
  .side-nav { flex-direction: row; }
  .side-foot { display: none; }
}
