/* ============================================================
   Echo AI 外教 - H5 全站样式
   ============================================================ */
:root {
  --bg1: #241a4e;
  --bg2: #3b2f8f;
  --bg3: #5a49c9;
  --card: rgba(255, 255, 255, 0.10);
  --card2: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.12);
  --txt: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);
  --accent: #8f7ff0;
  --accent2: #f072b6;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #1a1338;
  color: var(--txt);
  margin: 0;
  /* 不锁高度、不用 flex 居中：避免 iOS/微信内滚动锚定异常与底部被裁 */
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; cursor: pointer; }
.muted { color: var(--muted); font-size: 12px; }

/* 手机壳容器 */
.phone {
  width: 100%; max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;          /* 移动端动态视口，避免地址栏导致底部被裁 */
  background: linear-gradient(175deg, var(--bg3) 0%, var(--bg2) 45%, var(--bg1) 100%);
  padding: 0 14px calc(86px + env(safe-area-inset-bottom)); /* 底部留足，内容可滚到 Tab 之上 */
  position: relative;
  box-sizing: border-box;
}

/* ---------- 顶部 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
}
.top-left { display: flex; align-items: center; gap: 8px; }
.logo-dot { font-size: 22px; }
.vip-pill {
  background: linear-gradient(90deg, #f5c76a, #e89b3c);
  color: #4a2c00; font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 20px;
}
.mini-avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); }
.page-title { text-align: center; font-size: 18px; font-weight: 700; padding: calc(14px + env(safe-area-inset-top)) 0 12px; }
.page-title-inline { font-size: 17px; font-weight: 700; }
.pill-link { font-size: 13px; background: var(--card); padding: 6px 12px; border-radius: 20px; }

/* ---------- 首页 ---------- */
.hero { position: relative; margin: 4px -14px 0; }
.hero-img { width: 100%; display: block; aspect-ratio: 4/4.4; object-fit: cover; }
.hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(59,47,143,.55) 82%, var(--bg2) 100%);
}
.chat-btn {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 86%; padding: 15px 0; font-size: 19px; font-weight: 800; color: #fff;
  background: linear-gradient(90deg, #6fa5f5, #8f7ff0 55%, #a56bff);
  border-radius: 32px; box-shadow: 0 8px 24px rgba(90, 73, 201, .55);
  letter-spacing: .5px;
}
.chat-btn:active { transform: translateX(-50%) scale(.97); }

.quick-row { display: flex; gap: 10px; margin-top: 14px; }
.quick-card {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: var(--radius); padding: 12px;
}
.qc-ico {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
}
.qc-txt { font-weight: 700; font-size: 15px; }

.card { background: var(--card); border-radius: var(--radius); }

.grid4 {
  margin-top: 12px; padding: 14px 6px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.g4 { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; }
.g4-ico {
  width: 46px; height: 46px; border-radius: 14px; font-size: 22px;
  background: var(--card2); display: grid; place-items: center;
}

.duo-row { display: flex; gap: 10px; margin: 12px 0 20px; }
.duo { flex: 1; padding: 12px; }
.duo b { display: block; font-size: 14px; margin-bottom: 6px; }
.duo .sub { font-size: 12px; color: var(--muted); }
.tag {
  font-size: 10px; background: linear-gradient(90deg,#ff9a9e,#f072b6);
  border-radius: 6px; padding: 1px 5px; margin-right: 4px;
}
.tag2 { background: linear-gradient(90deg,#a56bff,#6fa5f5); }

/* ---------- 对话页 ---------- */
.chat-top { padding-bottom: 4px; }
.back { font-size: 26px; line-height: 1; padding: 0 8px; }
.chat-top .title { flex: 1; text-align: center; }
.chat-hero { text-align: center; padding: 12px 0 6px; }
.chat-avatar { width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(255,255,255,.6); }
.chat-hero h1 { margin-top: 10px; font-size: 26px; }
.chat-hero h1 em { font-style: normal; color: #cfc4ff; }
.chat-hero p { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.hot { padding: 12px; margin-top: 10px; }
.hot-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.hot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hot-item {
  text-align: left; background: var(--card2); border-radius: 12px;
  padding: 10px; color: var(--txt);
}
.hot-item b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.hot-item span {
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.msgs { padding: 6px 0 8px; display: flex; flex-direction: column; gap: 12px; min-height: 200px; scroll-behavior: smooth; }
.msg { max-width: 82%; display: flex; gap: 8px; align-items: flex-start; }
.msg .m-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.msg .bubble {
  padding: 10px 13px; border-radius: 4px 16px 16px 16px;
  background: var(--card2); font-size: 14.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.msg .b-act { display: flex; gap: 8px; margin-top: 6px; }
.msg .b-act button { background: rgba(255,255,255,.14); border-radius: 12px; font-size: 11px; padding: 3px 9px; color: var(--txt); }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble {
  background: linear-gradient(135deg, #6fa5f5, #8f7ff0);
  border-radius: 16px 4px 16px 16px;
}
.msg .typing i { animation: blink 1s infinite; }
.msg .typing i:nth-child(2) { animation-delay: .2s; }
.msg .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.composer-wrap {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 50;
  background: linear-gradient(180deg, transparent, var(--bg2) 22%);
  padding: 10px 14px calc(78px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  /* 键盘弹出时跟随（配合 JS 的 visualViewport 处理） */
  transition: bottom .15s ease-out;
}
.chips { display: flex; gap: 8px; margin-bottom: 8px; overflow-x: auto; }
.chip {
  flex-shrink: 0; background: var(--card); color: var(--txt);
  border-radius: 18px; padding: 7px 13px; font-size: 12.5px;
}
.composer {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2); border-radius: 24px; padding: 6px 6px 6px 16px;
}
.composer input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--txt); font-size: 14.5px; min-width: 0;
}
.composer input::placeholder { color: var(--muted); }
.mic, .send {
  width: 38px; height: 38px; border-radius: 50%; font-size: 17px;
  background: rgba(255,255,255,.14); color: #fff;
}
.send { background: linear-gradient(135deg, #6fa5f5, #8f7ff0); }
.mic.rec { background: #e74c3c; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(231,76,60,.25); } }

/* ---------- 听读页 ---------- */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 10px; font-size: 15px;
}
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; }
.cat {
  flex-shrink: 0; background: var(--card); color: var(--muted);
  font-size: 11.5px; border-radius: 14px; padding: 5px 10px;
}
.cat.active { color: #fff; background: linear-gradient(135deg,#6fa5f5,#8f7ff0); }

.art-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 20px; }
.art-card {
  border-radius: var(--radius); overflow: hidden; position: relative;
  aspect-ratio: 3/3.6; display: flex; flex-direction: column; justify-content: flex-end;
}
.art-cover {
  position: absolute; inset: 0; opacity: .9;
  display: grid; place-items: center; font-size: 42px;
}
.art-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.75)); }
.art-txt { position: relative; padding: 10px; }
.art-txt b { display: block; font-size: 14px; line-height: 1.35; }
.art-txt span { font-size: 11.5px; color: rgba(255,255,255,.8); }
.art-go {
  position: absolute; top: 8px; right: 8px; font-size: 10.5px;
  background: rgba(0,0,0,.45); border-radius: 12px; padding: 3px 8px;
}

/* ---------- 文章页 ---------- */
.article { padding: 16px 4px 30px; }
.article h2 { font-size: 20px; margin-bottom: 4px; }
.article .cn-title { color: var(--muted); margin-bottom: 16px; }
.article p { font-size: 15px; line-height: 1.9; margin-bottom: 14px; color: rgba(255,255,255,.92); }
.article .actions { display: flex; gap: 10px; margin-top: 10px; }
.article .actions button {
  flex: 1; padding: 12px 0; border-radius: 24px; font-size: 14px; color: #fff;
  background: linear-gradient(135deg,#6fa5f5,#8f7ff0);
}
.article .actions button.ghost { background: var(--card2); }

/* ---------- 学习页 ---------- */
.plan-head { font-size: 16px; margin: 6px 0 16px; }
.timeline { position: relative; padding-left: 46px; }
.timeline::before {
  content: ""; position: absolute; left: 16px; top: 10px; bottom: 30px;
  border-left: 2px dashed rgba(255,255,255,.22);
}
.lesson { position: relative; margin-bottom: 16px; }
.lesson .part {
  position: absolute; left: -46px; top: 14px; width: 36px;
  text-align: center; font-size: 13px; font-weight: 800; color: #b9aefc;
}
.lesson .part small { display: block; font-weight: 400; }
.lesson-card {
  display: flex; gap: 12px; background: var(--card);
  border-radius: var(--radius); padding: 12px; align-items: center;
}
.lesson-card.current { background: linear-gradient(135deg, #6fa5f5, #8f7ff0); box-shadow: 0 6px 18px rgba(90,73,201,.5); }
.lc-ico {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  background: var(--card2); display: grid; place-items: center; font-size: 26px;
}
.lc-body { flex: 1; min-width: 0; }
.lc-body b { font-size: 15px; }
.lc-range { font-size: 11.5px; color: rgba(255,255,255,.75); margin: 3px 0; }
.lc-body p {
  font-size: 11.5px; color: rgba(255,255,255,.72); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-prog {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.8); display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.lesson.locked { opacity: .55; }

/* ---------- 我的页 ---------- */
.profile-card {
  margin-top: 10px; padding: 16px;
  background: linear-gradient(150deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
}
.pc-top { display: flex; align-items: center; gap: 12px; position: relative; }
.pc-avatar { width: 52px; height: 52px; border-radius: 50%; }
.pc-top b { font-size: 17px; }
.price-tag {
  position: absolute; right: -16px; top: -26px;
  background: linear-gradient(90deg,#f5c76a,#e89b3c); color: #4a2c00;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 14px 14px 0 14px;
}
.pc-stats { display: flex; margin: 16px 0 12px; }
.pc-stats > div { flex: 1; text-align: center; }
.pc-stats b { display: block; font-size: 16px; }
.pc-stats span { font-size: 11.5px; color: var(--muted); }
.buy-btn {
  width: 100%; padding: 13px 0; border-radius: 26px; color: #fff;
  font-size: 15.5px; font-weight: 700;
  background: linear-gradient(90deg,#8f7ff0,#f072b6);
}
.pc-feats { display: flex; justify-content: space-around; margin-top: 12px; font-size: 11.5px; color: var(--muted); }

.trio { display: flex; margin-top: 14px; padding: 16px 6px; }
.trio a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; }
.t-ico {
  width: 44px; height: 44px; border-radius: 13px; color: #fff;
  display: grid; place-items: center; font-size: 18px; font-weight: 800;
}
.menu { margin: 14px 0 10px; padding: 4px 16px; }
.menu a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; font-size: 14.5px; border-bottom: 1px solid var(--line);
}
.menu a:last-child { border-bottom: none; }
.menu .arr { color: var(--muted); }

/* ---------- 登录页 ---------- */
.login-card { margin-top: 20px; padding: 26px 20px; }
.login-logo { text-align: center; font-size: 40px; margin-bottom: 18px; }
.login-logo b { font-size: 18px; }
.login-card input {
  width: 100%; background: var(--card2); border: none; outline: none;
  border-radius: 12px; padding: 13px 14px; color: #fff; font-size: 14px;
  margin-bottom: 12px;
}
.login-card input::placeholder { color: var(--muted); }
.btn-primary {
  width: 100%; padding: 13px 0; border-radius: 24px; color: #fff; font-size: 15px; font-weight: 700;
  background: linear-gradient(90deg,#6fa5f5,#8f7ff0); display: block; text-align: center;
}
.btn-ghost {
  width: 100%; padding: 12px 0; border-radius: 24px; font-size: 14px;
  background: var(--card2); color: #fff; margin-top: 10px;
}

/* ---------- 单词本 ---------- */
.word-list { padding: 8px 14px; margin-bottom: 16px; }
.word-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.word-item:last-child { border-bottom: none; }
.word-item .del { color: var(--muted); background: none; font-size: 13px; }
.word-item .say { background: none; font-size: 15px; margin-right: 8px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 60;
  box-sizing: border-box;
  display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(30, 22, 70, .92); backdrop-filter: blur(14px);
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--muted); position: relative; flex: 1;
}
.tab-ico { font-size: 21px; position: relative; font-style: normal; }
.tab.active { color: #fff; }
.new-badge {
  position: absolute; top: -6px; left: 14px;
  background: #e74c3c; color: #fff; font-size: 8px; font-style: normal;
  border-radius: 8px; padding: 1px 4px;
}

/* ============================================================
   v2.0 家长端样式
   ============================================================ */
.pool-banner {
  background: linear-gradient(90deg, #b23b4b, #e67e22);
  border-radius: 12px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 10px;
}
.form-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.form-card input, .form-card select, .form-row input {
  background: var(--card2); border: none; outline: none; border-radius: 12px;
  padding: 12px 14px; color: #fff; font-size: 14px; width: 100%;
}
.form-card input::placeholder { color: var(--muted); }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }
.child-list { display: flex; flex-direction: column; gap: 10px; }
.child-card { padding: 14px; }
.cc-head { display: flex; align-items: center; gap: 10px; }
.cc-avatar { width: 42px; height: 42px; border-radius: 50%; }
.cc-info { flex: 1; }
.cc-info b { font-size: 15px; display: block; }
.cc-del { background: rgba(226, 74, 74, .25); color: #ffb3b3; border-radius: 10px; padding: 5px 10px; font-size: 12px; }
.cc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cc-btn {
  flex: 1; min-width: 70px; text-align: center; font-size: 12.5px;
  background: var(--card2); border-radius: 12px; padding: 9px 4px;
}
.cc-btn.hot { background: linear-gradient(135deg, #6fa5f5, #8f7ff0); font-weight: 700; }
.cc-week { margin-top: 10px; font-size: 12px; }

/* 测评 */
.prep-card, .quiz-card { padding: 18px 16px; margin-bottom: 14px; }
.prep-card h3 { margin-bottom: 10px; }
.prep-list { list-style: none; }
.prep-list li { font-size: 13.5px; line-height: 2; color: rgba(255,255,255,.85); }
.check-row { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; font-size: 13.5px; }
.quiz-progress { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.progress-bar { height: 6px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6fa5f5, #8f7ff0); transition: width .4s; }
.quiz-q { font-size: 17px; font-weight: 700; margin: 16px 0 14px; line-height: 1.6; }
.quiz-opts { display: grid; gap: 10px; }
.opt-btn {
  text-align: left; background: var(--card2); color: #fff;
  border-radius: 14px; padding: 13px 15px; font-size: 14.5px;
}
.opt-btn.picked { outline: 2px solid #8f7ff0; }
.opt-btn.right { background: #2e7d5b; }
.opt-btn.wrong { background: #b23b4b; }
.quiz-open textarea {
  width: 100%; background: var(--card2); border: none; outline: none;
  border-radius: 12px; color: #fff; padding: 12px; font-size: 14px; margin-bottom: 10px;
}
.sop-row { display: flex; gap: 8px; margin-top: 14px; }
.sop-btn {
  flex: 1; background: rgba(255, 213, 79, .18); color: #ffd54f;
  border-radius: 12px; padding: 9px 4px; font-size: 12.5px;
}
.calm-box {
  margin-top: 10px; background: rgba(255, 213, 79, .12); color: #ffe9a8;
  border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.8;
}

/* 报告 */
.grade-card { display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 12px; }
.grade-badge {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #f5c76a, #e89b3c); color: #4a2c00;
  display: grid; place-items: center; font-size: 22px; font-weight: 900;
}
.radar-card, .path-card, .weak-card { padding: 14px; margin-bottom: 12px; }
.path-card p { font-size: 13.5px; line-height: 1.9; margin-top: 8px; color: rgba(255,255,255,.88); }

/* 课程地图 */
.unit-card { padding: 14px; margin-bottom: 12px; }
.unit-card.locked { opacity: .55; }
.uc-head { display: flex; justify-content: space-between; align-items: center; padding-left: 10px; }
.uc-head b { font-size: 15.5px; }
.uc-open { font-size: 11px; background: #3fa66b; border-radius: 10px; padding: 3px 9px; }
.uc-lock { font-size: 16px; }
.uc-goals { font-size: 12px; margin: 8px 0 10px; padding-left: 10px; }
.uc-lessons { display: grid; gap: 7px; }
.uc-lesson {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  background: var(--card2); border-radius: 11px; padding: 9px 12px;
}
.uc-lesson.done { opacity: .75; }
.uc-lesson.locked { opacity: .45; }
.uc-lesson.next { border: 1px solid rgba(143,127,240,.6); }
.ul-no {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 11px;
}
.ul-t { flex: 1; }
.ul-star { font-size: 11.5px; }

/* 上课页 */
.ls-card, .step-card { padding: 16px; margin-bottom: 12px; }
.ls-type { font-size: 11px; background: linear-gradient(90deg,#6fa5f5,#8f7ff0); border-radius: 8px; padding: 2px 8px; }
.ls-card h3 { margin: 8px 0 6px; font-size: 17px; }
.step-card b { display: block; margin-bottom: 10px; font-size: 14.5px; }
.demo-line {
  font-size: 17px; line-height: 1.7; background: var(--card2);
  border-radius: 12px; padding: 14px; margin-bottom: 12px; font-weight: 700;
}
.step-card .btn-primary { padding: 11px 0; }
.repeat-row { display: flex; gap: 8px; margin-bottom: 8px; }
.rep-btn {
  flex: 1; background: var(--card2); color: #fff; border-radius: 12px;
  padding: 11px 0; font-size: 13.5px;
}
.rep-btn.ok { background: #3fa66b; }
.micro-q { margin-bottom: 12px; }
.micro-q p { font-size: 13.5px; margin-bottom: 7px; }
.micro-opts { display: flex; gap: 7px; flex-wrap: wrap; }
.micro-opts .opt-btn { flex: 1; min-width: 90px; text-align: center; padding: 10px 8px; font-size: 13px; }
.badge-pop {
  margin: 12px 0; padding: 14px; text-align: center; font-weight: 800;
  background: linear-gradient(135deg, #f5c76a, #e89b3c); color: #4a2c00; border-radius: 14px;
  animation: pulse 1.2s infinite;
}
.result-line { font-size: 15px; margin: 10px 0; }

/* 月报 */
.matrix { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 14px 14px; }
.mx-cell { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; }
.mx-pct {
  width: 100%; padding: 12px 0; border-radius: 10px; text-align: center;
  color: #fff; font-weight: 800; font-size: 14px;
}
.weak-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.weak-item:last-child { border-bottom: none; }
.warn { color: #ffb3b3; }
.poster-card { padding: 14px; margin-top: 14px; }
.poster-card h3 { margin-bottom: 10px; }
