/* ============================================================
   单词猫英语学习系统 - 学员端样式（PC + 手机自适应）
   ============================================================ */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #333333;
  --muted: #8a8a8a;
  --primary: #ff8c42;
  --primary-d: #e76f2e;
  --soft: #fff3e6;
  --green: #4caf50;
  --red: #e05252;
  --blue: #2b6cb0;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .92em; }
.text-center { text-align: center; }
.mt10 { margin-top: 10px; }
.mt20 { margin-top: 20px; }

/* ---------- 左侧边栏布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 220px; background: #fff; border-right: 1px solid #eee; display: flex; flex-direction: column; z-index: 60; }
.sidebar .brand { display: block; padding: 18px 22px 12px; font-size: 1.25rem; font-weight: 800; color: var(--primary-d); }
.side-nav { flex: 1; padding: 4px 10px 10px; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: .95rem; margin-bottom: 2px; transition: background .15s; }
.side-nav a span { font-size: 1.05rem; }
.side-nav a:hover { background: var(--bg); }
.side-nav a.active { background: var(--soft); color: var(--primary-d); }
.side-foot { padding: 14px 16px; border-top: 1px solid #eee; display: flex; flex-direction: column; gap: 10px; }
.side-foot .user-chip { font-size: .85rem; }
.side-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.side-badges .points-chip, .side-badges .food-badge { font-size: .8rem; padding: 3px 10px; }
/* 学员卡片（侧边栏菜单上方） */
.side-user { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 8px; }
.side-user .avatar { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.side-user-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-user-name { font-size: 1rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-grade { font-size: .78rem; color: var(--muted); }
.side-user .side-badges { gap: 6px; }

/* 通用头像 */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 76px; height: 76px; }
.avatar-sm { width: 44px; height: 44px; }
.avatar-opt { cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.avatar-opt:hover { transform: scale(1.08); }
.avatar-opt.on { border-color: var(--primary); }

/* 个人中心头像编辑 */
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.avatar-main { cursor: pointer; border: 3px dashed #e0d8cc; transition: border-color .15s, transform .15s; }
.avatar-main:hover { border-color: var(--primary); transform: scale(1.04); }
.avatar-edit-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.avatar-grid-label { display: block; font-size: .9rem; font-weight: 600; color: var(--muted); margin: 12px 0 8px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, auto); gap: 10px; margin-bottom: 12px; }
@media (max-width: 480px) { .avatar-grid { grid-template-columns: repeat(4, auto); } }
.side-foot .logout-btn { text-align: center; }
.main { flex: 1; margin-left: 220px; min-width: 0; }
.m-topbar { display: none; }
.side-mask { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 4px 0 18px rgba(0,0,0,.12); }
  .sidebar.open { transform: translateX(0); }
  .side-mask { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .side-mask.show { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .m-topbar { display: flex; align-items: center; gap: 12px; height: 56px; background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 50; padding: 0 14px; }
  .m-topbar .brand { font-size: 1.1rem; flex: 1; }
  .m-badges { display: flex; gap: 6px; }
  .m-badges .points-chip, .m-badges .food-badge { font-size: .75rem; padding: 2px 8px; }
}

/* ---------- 进度条型学习数据 ---------- */
.pstat { margin-bottom: 14px; }
.pstat:last-child { margin-bottom: 0; }
.pstat-head { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; margin-bottom: 5px; }
.pstat-head span { color: var(--muted); }
.pstat-head b { color: var(--primary-d); }
.pstat .bar { height: 10px; }
.pstat .bar i.bar-green { background: linear-gradient(90deg, #7ed6a5, #3fae6a); }
.pstat .bar i.bar-red { background: linear-gradient(90deg, #ffb3a0, #e05252); }

/* ---------- 顶部导航 ---------- */
.topbar { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-size: 1.25rem; font-weight: 800; color: var(--primary-d); white-space: nowrap; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a { padding: 8px 14px; border-radius: 20px; color: var(--ink); font-weight: 600; font-size: .95rem; }
.main-nav a:hover { background: var(--bg); }
.main-nav a.active { background: var(--soft); color: var(--primary-d); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.food-badge { background: var(--soft); padding: 4px 12px; border-radius: 20px; font-weight: 700; color: #b7791f; white-space: nowrap; }
.points-chip { background: linear-gradient(90deg,#ffe9c2,#ffd98a); padding: 4px 12px; border-radius: 20px; font-weight: 700; color: #8a5a14; white-space: nowrap; }
.user-chip { font-size: .9em; color: var(--muted); white-space: nowrap; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--ink); }
.logout-btn { display: inline-block; padding: 4px 12px; font-size: .85rem; font-weight: 600; color: #fff; background: #e05252; border-radius: 8px; text-decoration: none; white-space: nowrap; transition: background .15s; }
.logout-btn:hover { background: #c23b3b; color: #fff; }

/* ---------- 页面主体 ---------- */
.page { padding: 24px 0 48px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 1.1rem; margin-bottom: 14px; }
.grid { display: grid; gap: 20px; }
.dashboard { grid-template-columns: 1fr 1fr; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: 0; border-radius: 22px; padding: 9px 20px;
  font-size: .95rem; cursor: pointer; font-weight: 600; transition: .15s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-soft { background: var(--soft); color: var(--primary-d); }
.btn-soft:hover { background: #ffe8cf; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #3d8b40; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f0c9c9; }
.btn-danger:hover { background: #fdf3f3; }
.btn-sm { padding: 5px 14px; font-size: .85rem; }
.btn-xs { padding: 2px 10px; font-size: .78rem; border-radius: 14px; }
.btn-block { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #e3e3e3; border-radius: 10px;
  font-size: .95rem; background: #fff; outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
label { font-size: .88rem; color: var(--muted); display: block; margin: 10px 0 4px; }

/* ---------- 统计块 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--bg); border-radius: 12px; padding: 14px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; color: var(--primary-d); }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---------- 猫咪养成（v2.0 会动的猫 + 猫盆） ---------- */
.cat-stage { text-align: center; position: relative; padding: 8px 0 2px; overflow: hidden; min-height: 200px; }
.cat-stage .cat-room {
  position: relative; height: 190px; max-width: 340px; margin: 0 auto;
  background: radial-gradient(circle at 50% 8%, #fff7ea 0%, #fdf3e3 55%, #f7ead2 100%);
  border-radius: 18px; border: 1px solid #f0e2c6; overflow: hidden;
}
.cat-stage .cat-room::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34px;
  background: linear-gradient(#f3e6cc, #ead9b8); }
.cat-stage .cat-wrap { position: absolute; left: 50%; bottom: 22px; width: 150px; height: 150px;
  margin-left: -75px; animation: patrol 16s ease-in-out infinite; }
.cat-stage svg { width: 100%; height: 100%; display: block; }
.cat-stage svg .body, .cat-stage svg .head-fill, .cat-stage svg .ear, .cat-stage svg .leg {
  fill: var(--c-body, #ffffff); stroke: var(--c-outline, #d8d8e0); stroke-width: 2; }
.cat-stage svg .belly { fill: var(--c-inner, #f2f2f6); }
.cat-stage svg .ear-inner { fill: var(--c-ear, #ffb3c6); }
.cat-stage svg .tail { stroke: var(--c-outline, #d8d8e0); }
@keyframes patrol {
  0%   { transform: translateX(-42px) scaleX(1); }
  46%  { transform: translateX(42px) scaleX(1); }
  50%  { transform: translateX(42px) scaleX(-1); }
  96%  { transform: translateX(-42px) scaleX(-1); }
  100% { transform: translateX(-42px) scaleX(1); }
}

/* 待机：呼吸 + 尾巴摇 + 四肢迈步 */
.cat-stage svg .head { animation: breathe 3s ease-in-out infinite; transform-origin: 80px 60px; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.cat-stage svg .tail { transform-origin: 130px 100px; animation: wag 2.6s ease-in-out infinite; }
@keyframes wag { 0%,100% { transform: rotate(0); } 50% { transform: rotate(10deg); } }
.cat-stage svg .leg { animation: step .5s ease-in-out infinite; }
.cat-stage svg .leg.leg2, .cat-stage svg .leg.leg4 { animation-delay: .25s; }
@keyframes step { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* 眨眼 */
.cat-stage svg .eyes-open { animation: blink 4.5s infinite; transform-origin: 80px 57px; }
@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  95%, 97% { transform: scaleY(0.08); }
}

/* 跑步：更快 + 速度线 + 身体前倾颠簸 */
.cat-stage.running .cat-wrap { animation: runPatrol 2.6s ease-in-out infinite; }
@keyframes runPatrol {
  0%   { transform: translateX(-50px) scaleX(1); }
  46%  { transform: translateX(50px) scaleX(1); }
  50%  { transform: translateX(50px) scaleX(-1); }
  96%  { transform: translateX(-50px) scaleX(-1); }
  100% { transform: translateX(-50px) scaleX(1); }
}
.cat-stage.running .cat-body-group { animation: runBob .28s ease-in-out infinite; }
@keyframes runBob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-2deg); } }
.cat-stage.running .leg { animation: runStep .2s linear infinite; }
.cat-stage.running .leg.leg2, .cat-stage.running .leg.leg4 { animation-delay: .1s; }
@keyframes runStep { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.cat-stage.running .speed-lines { opacity: 1; }
.cat-stage .speed-lines { transition: opacity .2s; }

/* 表情状态 */
.cat-stage svg .eyes-happy, .cat-stage svg .eyes-closed, .cat-stage svg .mouth-sad,
.cat-stage svg .mouth-hungry, .cat-stage svg .scruff { opacity: 0; }
.cat-stage svg .eyes-open, .cat-stage svg .mouth-happy { opacity: 1; }
.cat-stage.state-happy .blush { opacity: .8; }
.cat-stage.state-sad .eyes-open, .cat-stage.state-sad .mouth-happy { opacity: 0; }
.cat-stage.state-sad .eyes-closed, .cat-stage.state-sad .mouth-sad { opacity: 1; }
.cat-stage.state-hungry .mouth-happy { opacity: 0; }
.cat-stage.state-hungry .mouth-hungry { opacity: 1; }
.cat-stage.state-hungry .blush { opacity: 0; }
.cat-stage.state-hungry .scruff { opacity: .9; }
.cat-stage.state-hungry .tail { animation: droop 2.4s ease-in-out infinite; }
@keyframes droop { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }

/* 撸猫：眯眼开心 */
.cat-stage.petted .eyes-open { opacity: 0; }
.cat-stage.petted .eyes-happy { opacity: 1; }

/* 爱心（撸猫/升级） */
.hearts { position: absolute; inset: 0; pointer-events: none; }
.hearts .heart { position: absolute; font-size: 20px; animation: floatUp 1.4s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(10px) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-52px) scale(1.25); } }

/* 状态角标 */
.cat-status { position: absolute; bottom: 2%; left: 50%; transform: translateX(-50%); font-size: 16px;
  background: rgba(255,255,255,.88); border-radius: 12px; padding: 1px 8px; white-space: nowrap; }
.cat-stage.levelup .cat-wrap { animation: bounce .6s; }
@keyframes bounce { 0%,100% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-3deg); } 70% { transform: scale(.96) rotate(2deg); } }

/* 猫盆（粮碗） */
.cat-bowl { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 2px; }
.cat-bowl .bowl-label { font-size: .8rem; color: var(--muted); }
.cat-bowl .kibble { width: 11px; height: 11px; border-radius: 50% 50% 55% 45%;
  background: #c8873a; display: inline-block; transform: rotate(-12deg);
  box-shadow: inset -1px -1px 0 rgba(0,0,0,.12); transition: background .3s, opacity .3s; }
.cat-bowl .kibble.empty { background: #e7dcc6; box-shadow: inset 0 0 0 1px #d8c9aa; }
.cat-bowl .bowl-cup { width: 46px; height: 18px; border-radius: 0 0 24px 24px; background: #e8b98a;
  border: 2px solid #d19a63; border-top: 0; position: relative; }

.cat-bars { max-width: 320px; margin: 10px auto 0; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: .9rem; }
.bar-row > span { width: 42px; color: var(--muted); flex-shrink: 0; }
.bar { flex: 1; background: #f0ece6; border-radius: 8px; height: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8fd3ff, #4aa8ff); border-radius: 8px; transition: width .4s; }
.bar i.bar-hunger { background: linear-gradient(90deg, #ffd28f, #ff9f43); }
.bar i.bar-mood { background: linear-gradient(90deg, #ffb3c6, #ff7bac); }
.cat-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.tip { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 10px; }
.points-pill { display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(90deg,#ffe9c2,#ffd98a);
  color: #8a5a14; font-weight: 700; padding: 3px 12px; border-radius: 16px; font-size: .9rem; }

/* ---------- 自然拼读彩色 ---------- */
.ph-v { color: #d64541; font-weight: 700; }
.ph-c { color: #2b6cb0; font-weight: 700; }

/* ---------- 背单词页 ---------- */
.word-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.word-card { text-align: center; }
.word-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.word-big { font-size: 2.6rem; letter-spacing: 2px; margin: 18px 0 6px; min-height: 84px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
/* 分段拼读：元红/辅蓝，当前段高亮（不跳动，稳定排版） */
.ph-seg { display: inline-block; padding: 2px 4px; margin: 0 1px; border-radius: 8px; cursor: pointer; transition: background .15s, transform .15s, box-shadow .15s; }
.ph-seg:hover { background: rgba(0,0,0,.06); }
.ph-seg.active { background: #ffe58f; box-shadow: 0 2px 6px rgba(0,0,0,.12); transform: scale(1.08); }

.word-phonetic { color: var(--muted); font-size: 1.1rem; }
.word-meaning { font-size: 1.15rem; margin-top: 10px; background: var(--soft); border-radius: 12px; padding: 10px 18px; display: inline-block; }
.word-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.word-examples { margin-top: 18px; text-align: left; }
.ex-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eee; }
.ex-item:last-child { border-bottom: 0; }
.ex-no { background: var(--soft); color: var(--primary-d); border-radius: 8px; padding: 2px 8px; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.spell-box { margin-top: 18px; background: var(--bg); border-radius: 12px; padding: 16px; }
.spell-box h3 { margin-bottom: 10px; }
.spell-box input { max-width: 340px; margin: 0 auto; display: block; text-align: center; font-size: 1.15rem; }
.spell-box .btn { margin-top: 10px; }
.spell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.spell-head h3 { margin-bottom: 0; }
.spell-hint-area { background: var(--bg); border-radius: 10px; padding: 12px 16px; margin: 4px 0 12px; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.spell-hint-main { font-size: 1.35rem; font-weight: 700; color: var(--ink); line-height: 1.4; }
.spell-hint-sub { font-size: .92rem; color: #c9c2b6; font-style: italic; letter-spacing: 1px; }
#spellInput { max-width: 340px; margin: 0 auto; display: block; text-align: center; font-size: 1.15rem; }
.spell-hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
#spellInput::placeholder { color: #d8d3c8; font-style: italic; letter-spacing: 1px; }
#spellInput:focus::placeholder { color: #e8e3d8; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.spell-feedback { margin-top: 10px; font-weight: 600; }
.tips-card ul { padding-left: 18px; font-size: .92rem; color: #666; }
.tips-card li { margin: 8px 0; }

/* ---------- 默写中心页 ---------- */
.dict-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.dict-card { text-align: center; }
.dict-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.dict-tab { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line, #e2e8f0); background: #fff; cursor: pointer; font-size: .95rem; color: #666; transition: all .15s; }
.dict-tab.active { background: var(--primary, #4aa8ff); color: #fff; border-color: var(--primary, #4aa8ff); font-weight: 700; }
.dict-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dict-question { min-height: 130px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--soft, #f7f9fc); border-radius: 14px; padding: 18px; }
.dict-label { font-size: .85rem; color: var(--muted, #888); letter-spacing: 2px; }
.dict-cn { font-size: 1.5rem; font-weight: 700; margin: 10px 0 4px; line-height: 1.5; max-width: 560px; }
.dict-phonetic { color: var(--muted, #888); font-size: .95rem; min-height: 1.2em; }
.dict-hint { margin-top: 10px; font-size: .95rem; color: #c9c2b6; font-style: italic; letter-spacing: 1px; line-height: 1.5; }
.dict-answer { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.dict-answer input { flex: 1; max-width: 420px; text-align: center; font-size: 1.1rem; }
.dict-feedback { margin-top: 12px; font-weight: 600; min-height: 1.4em; }

/* ---------- 每日阅读页 ---------- */
.reading-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.article-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid #eee; border-radius: 12px; margin-bottom: 12px; background: #fff;
}
.article-card.done { background: #f4fbf4; border-color: #cdeccd; }
.article-card h3 { font-size: 1rem; }
.article-info { min-width: 0; }
.article-content { line-height: 2.1; font-size: 1.06rem; }
/* 例句中英对照 */
.ex-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eee; flex-wrap: wrap; }
.ex-item:last-child { border-bottom: 0; }
.ex-en { font-weight: 600; }
.ex-cn { color: var(--muted); font-size: .88rem; }

/* 阅读逐词注译 + 悬停词义 */
.wt {
  display: inline-flex; flex-direction: column; align-items: center; vertical-align: bottom;
  position: relative; cursor: pointer; margin: 0 .5px; border-bottom: 1.5px dashed var(--primary);
  line-height: 1.3;
}
.wt .wt-en { font-size: inherit; }
.wt .wt-cn { font-size: 10px; color: #9a9a9a; line-height: 1.15; display: block; }
.wt-no { border-bottom-style: dotted; border-color: #c9c9c9; }
.wt.saying { background: #fff3b0; }

/* 逐句上下翻译：每个英文句子成块，下方紧跟中文 */
.article-content .st { display: block; margin: 9px 0; line-height: 1.9; }
.article-content .st.saying { background: #fff3b0; border-radius: 8px; }
.st-en { display: block; }
.st-cn {
  display: block; color: #8a8a8a; font-size: .92rem; line-height: 1.7;
  margin-top: 3px; padding-bottom: 7px; border-bottom: 1px dashed #f0ece6;
}

/* 阅读模式切换按钮组 */
.mode-group { display: inline-flex; border: 1px solid #e3e3e3; border-radius: 18px; overflow: hidden; }
.mode-group button {
  border: 0; background: #fff; padding: 5px 13px; font-size: .82rem; cursor: pointer;
  color: var(--muted); font-family: inherit; transition: .15s;
}
.mode-group button + button { border-left: 1px solid #e3e3e3; }
.mode-group button.active { background: var(--primary); color: #fff; }

/* 全局悬停词义卡（跟随鼠标，避免被滚动容器裁剪） */
.word-tip {
  position: fixed; z-index: 300; display: none; max-width: 320px;
  background: #333; color: #fff; padding: 8px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.6; pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}
.word-tip.show { display: block; }
.word-tip b { color: #ffd28f; font-size: 13px; }
.word-tip .tip-ph { color: #aac4ff; font-size: 11.5px; }
.word-tip .tip-ex { color: #cfcfcf; font-size: 11px; display: block; }

/* 全文翻译区域 */
.article-cn {
  margin-top: 16px; padding: 14px 16px; background: #fffdf5; border: 1px solid #f0e6c8;
  border-radius: 12px; line-height: 2; color: #555; font-size: .98rem;
}
.article-cn::before { content: '🌐 全文中文翻译'; display: block; font-weight: 700; color: #b7791f; margin-bottom: 6px; }
.reader-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.reader-toolbar select { width: auto; min-width: 180px; padding: 6px 10px; }
.reading-progress { color: var(--muted); font-size: .85rem; }

/* ---------- 生词本 ---------- */
.nb-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.nb-tabs .tab { padding: 6px 16px; border-radius: 18px; background: var(--bg); color: var(--muted); font-weight: 600; font-size: .9rem; }
.nb-tabs .tab.active { background: var(--primary); color: #fff; }
.nb-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #eee;
  border-radius: 12px; margin-bottom: 10px; background: #fff; flex-wrap: wrap;
}
.nb-word { font-size: 1.15rem; font-weight: 700; min-width: 110px; }
.nb-ph { color: var(--muted); font-size: .9rem; min-width: 100px; }
.nb-mean { flex: 1; min-width: 160px; color: #555; font-size: .92rem; }
.nb-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.nb-item.mastered { opacity: .65; }
.nb-item.mastered .nb-word { text-decoration: line-through; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 85vh; overflow: auto; padding: 20px; }
.modal-wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { font-size: 1.1rem; }
.modal-close { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-foot { margin-top: 14px; text-align: right; }
.wm-word { font-size: 1.7rem; margin: 4px 0; }
.wm-phonetic { color: var(--muted); }
.wm-meaning { margin: 8px 0; font-size: 1.05rem; background: var(--soft); border-radius: 10px; padding: 8px 12px; display: inline-block; }
.wm-examples p { margin: 6px 0; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: #333; color: #fff; padding: 10px 22px; border-radius: 22px; opacity: 0;
  transition: .25s; z-index: 200; font-size: .95rem; pointer-events: none; max-width: 90vw;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: #c0392b; }

/* ---------- 登录/注册页 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fff6ec, #ffe9d2); padding: 20px;
}
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 8px 30px rgba(214, 122, 60, .18); padding: 30px 28px; width: 100%; max-width: 400px; }
.auth-cat { text-align: center; margin-bottom: 6px; }
.auth-cat img { width: 120px; }
.brand-big { font-size: 1.6rem; font-weight: 800; color: var(--primary-d); text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 16px; font-size: .92rem; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: .9rem; }

/* ---------- 其他 ---------- */
.level-tag { background: var(--soft); color: var(--primary-d); border-radius: 16px; padding: 2px 12px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.qlink { display: block; background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-top: 10px; color: var(--ink); font-weight: 600; }
.qlink:hover { background: var(--soft); color: var(--primary-d); }
.activity-list { list-style: none; }
.activity-list li { padding: 8px 0; border-bottom: 1px dashed #eee; display: flex; justify-content: space-between; gap: 10px; font-size: .93rem; }
.activity-list li:last-child { border-bottom: 0; }
.activity-list .type { font-size: .78rem; background: var(--soft); border-radius: 10px; padding: 1px 10px; color: var(--primary-d); white-space: nowrap; }
.news-item { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 2px; }
.news-title { font-weight: 700; color: var(--ink); font-size: .98rem; }
.news-cn { color: var(--primary-d); font-size: .88rem; font-weight: 600; }
.news-sum { color: #555; font-size: .9rem; line-height: 1.55; }
.news-sum-cn { color: var(--muted); font-size: .85rem; }
.news-src { font-size: .78rem; }
.news-head { display: flex; align-items: flex-start; gap: 8px; width: 100%; }
.news-fav { flex-shrink: 0; font-size: 1.05rem; padding: 2px 10px; color: #d4a017; }
.news-full { width: 100%; margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.news-full-en { font-size: .95rem; line-height: 1.7; color: #444; }
.news-full-cn { font-size: .88rem; color: var(--muted); margin-top: 6px; line-height: 1.65; }
.news-foot { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 4px; }
.news-toggle { font-size: .8rem; color: var(--primary-d); cursor: pointer; font-weight: 600; }
.news-full-head { display: flex; gap: 8px; margin-bottom: 10px; }
.news-sent { margin-bottom: 10px; padding: 6px 8px; border-radius: 8px; transition: background .2s; }
.news-sent.saying { background: #fff6e0; }
.news-sent-en { display: block; font-size: .95rem; line-height: 1.7; color: #333; }
.news-sent-cn { display: block; font-size: .88rem; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.news-sent.saying .news-sent-en { color: var(--primary-d); font-weight: 600; }
.news-item { cursor: pointer; }
.footer { background: #fff; border-top: 1px solid #eee; padding: 18px 0; color: var(--muted); font-size: .85rem; text-align: center; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.records-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.records-table th, .records-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.records-table th { color: var(--muted); font-weight: 600; }
.badge-ok { color: var(--green); font-weight: 700; }
.badge-no { color: var(--red); font-weight: 700; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column;
    padding: 8px 16px 14px; display: none; border-bottom: 1px solid #eee; box-shadow: 0 8px 16px rgba(0,0,0,.06);
  }
  .main-nav.open { display: flex; }
  .user-chip { display: none; }
  .dashboard, .word-layout, .profile-grid { grid-template-columns: 1fr; }
  .word-big { font-size: 2.1rem; }
  .article-card { flex-direction: column; align-items: flex-start; }
  .article-card .btn { align-self: stretch; text-align: center; }
}

/* ---------- 皮肤商店 ---------- */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.skin-item { background: var(--bg); border-radius: 14px; padding: 12px; text-align: center; border: 2px solid transparent; transition: border-color .2s; }
.skin-item.equipped { border-color: var(--primary); }
.skin-item .skin-preview { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px; border: 1px solid #eee; }
.skin-item .skin-name { font-weight: 700; font-size: .92rem; }
.skin-item .skin-price { font-size: .82rem; color: #b7791f; margin: 4px 0; }
.skin-item .skin-tag { font-size: .75rem; color: var(--muted); }
.skin-item .btn { margin-top: 6px; }

/* ---------- 习题训练 ---------- */
.ex-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.ex-question { font-size: 1.25rem; margin: 12px 0; line-height: 1.6; }
.ex-options { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.ex-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid #eee; border-radius: 12px;
  cursor: pointer; transition: border-color .15s, background .15s; }
.ex-option:hover { border-color: var(--primary); background: var(--soft); }
.ex-option.selected { border-color: var(--primary); background: var(--soft); }
.ex-option.correct { border-color: var(--green); background: #e9f8ef; }
.ex-option.wrong { border-color: var(--red); background: #fdeaea; }
.ex-option .opt-key { width: 24px; height: 24px; border-radius: 50%; background: var(--soft); color: var(--primary-d);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ex-answer-box { margin-top: 14px; border-radius: 12px; padding: 14px; background: var(--bg); }
.ex-answer-box .g-title { font-weight: 700; color: var(--primary-d); margin-bottom: 6px; }
.ex-answer-box.correct-box { border-left: 4px solid var(--green); }
.ex-answer-box.wrong-box { border-left: 4px solid var(--red); }
.ex-example { margin-top: 10px; padding: 10px; background: #fff; border-radius: 10px; font-size: .95rem; }
.ex-example .ex-en { font-weight: 600; }
.ex-fill-input { width: 100%; max-width: 280px; padding: 10px 12px; border: 1.5px solid #ddd; border-radius: 10px; font-size: 1rem; }
.qtype-tag { font-size: .78rem; padding: 2px 10px; border-radius: 10px; background: var(--soft); color: var(--primary-d); }

/* ============ 视频专栏 v2.1 ============ */
.vd-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.vd-folder { background: #fff; border: 1.5px solid #eee; border-radius: 14px; padding: 18px 12px; text-align: center; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; }
.vd-folder:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.vd-folder-icon { font-size: 34px; }
.vd-folder-name { font-weight: 700; margin-top: 8px; color: var(--text); }
.vd-folder-count { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.vd-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .vd-wrap { grid-template-columns: 1fr; } }
.vd-player { border-radius: 12px; overflow: hidden; background: #000; }
.vd-player video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 72vh; background: #000; object-fit: contain; }
.vd-player iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
@media (min-width: 1200px) { .vd-player { max-width: 960px; margin: 0 auto; } }
.vd-player-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.vd-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.vd-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border: 1px solid #eee; border-radius: 8px; cursor: pointer; text-align: center; transition: background .12s, border-color .12s; }
.vd-item:hover { background: var(--soft); }
.vd-item.playing { border-color: var(--primary); background: var(--soft); }
.vd-thumb { font-size: 13px; line-height: 1.1; }
.vd-item-title { font-size: .56rem; line-height: 1.2; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.vd-dur { font-size: .52rem; color: var(--muted); }
