/* ============================================================
   Etyma · 词源 — 样式表
   风格：学术编辑风（暖米白 + 墨色 + 陶土点缀 + 衬线大字标）
   衬线标题 + 无衬线正文 · 响应式（手机底部导航 / 电脑顶部导航）
   ============================================================ */

:root {
  --bg:        #F5F4EF;   /* 暖米白底 */
  --bg-raise:  #FAF9F5;   /* 卡片/浮层 */
  --bg-sink:   #EEEDE6;   /* 凹陷区 */
  --ink:       #2A2724;   /* 正文墨色 */
  --ink-soft:  #6B655C;   /* 次要文字 */
  --ink-faint: #A39C90;   /* 最弱文字 */
  --line:      #E3E0D8;   /* 分隔线 */
  --clay:      #C96442;   /* 陶土珊瑚主点缀（Claude 感） */
  --clay-soft: #E8C4B4;
  --clay-bg:   #F6E9E2;
  --sage:      #6E8B6A;   /* 正确/成功 */
  --sage-bg:   #E6EEE3;
  --amber:     #B78A34;   /* 提示 */
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(40,36,32,.04), 0 8px 24px rgba(40,36,32,.06);
  --shadow-lg: 0 2px 4px rgba(40,36,32,.05), 0 16px 48px rgba(40,36,32,.10);
  --serif: "Palatino Linotype", "Book Antiqua", Georgia, "Songti SC", STSong, "Noto Serif SC", "Times New Roman", serif;
  --sans:  -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1080px;
}

[data-theme="dark"] {
  --bg:        #22201D;
  --bg-raise:  #2C2926;
  --bg-sink:   #1B1917;
  --ink:       #EDE9E2;
  --ink-soft:  #B3ACA0;
  --ink-faint: #7C756A;
  --line:      #3A3631;
  --clay:      #E08A66;
  --clay-soft: #7A5240;
  --clay-bg:   #3A2C25;
  --sage:      #8FB089;
  --sage-bg:   #2A342A;
  --shadow:    0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.25), 0 16px 48px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: var(--sans);
  background: transparent;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
  padding-bottom: 0;
  min-height: 100dvh; display: flex; flex-direction: column;
  position: relative; isolation: isolate;
}

/* 词脉星图：静态 Image 2 背景 + 低频 CSS 微动态 */
.site-atmosphere {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: center / cover no-repeat url("../assets/backgrounds/root-atlas-motion-v2-poster.webp");
  opacity: .72;
  transition: opacity .3s, filter .3s;
}
.site-atmosphere::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 44%, transparent 20%, color-mix(in srgb, var(--bg) 18%, transparent) 72%);
}
.atmos-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease; will-change: opacity;
}
.site-atmosphere.video-ready .atmos-video { opacity: 1; }
.site-atmosphere.video-ready .atmos-orbit,
.site-atmosphere.video-ready .atmos-glow,
.site-atmosphere.video-ready .atmos-nodes { opacity: 0; transition: opacity 1s ease; }
.atmos-orbit {
  position: absolute; display: block; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--sage) 44%, transparent);
  box-shadow: inset 0 0 36px color-mix(in srgb, var(--amber) 13%, transparent);
  opacity: .54; will-change: transform;
  animation: atmos-spin 20s linear infinite;
}
.atmos-orbit::before,
.atmos-orbit::after {
  content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--clay); box-shadow: 0 0 18px color-mix(in srgb, var(--clay) 72%, transparent);
}
.atmos-orbit::before { left: 11%; top: 18%; }
.atmos-orbit::after { right: 13%; bottom: 12%; background: var(--sage); }
.atmos-orbit-a { width: 320px; height: 320px; left: -154px; top: -110px; }
.atmos-orbit-b { width: 260px; height: 260px; right: -120px; bottom: -92px; animation-direction: reverse; animation-duration: 24s; }
.atmos-orbit-c { width: 120px; height: 120px; right: 6%; top: 11%; animation-duration: 16s; opacity: .38; }
.atmos-glow {
  position: absolute; display: block; width: 250px; height: 250px; right: 4%; top: 12%;
  border-radius: 50%; background: color-mix(in srgb, var(--amber) 22%, transparent);
  filter: blur(30px); opacity: .3; will-change: transform, opacity;
  animation: atmos-breathe 6.5s ease-in-out infinite alternate;
}
.atmos-nodes {
  position: absolute; display: block; left: 4%; bottom: 12%; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); opacity: .52;
  box-shadow: 46px -18px var(--clay), 92px 12px var(--sage), 138px -42px var(--amber), 188px 2px var(--clay);
  will-change: transform, opacity; animation: atmos-drift 8s ease-in-out infinite alternate;
}
[data-theme="dark"] .site-atmosphere { opacity: .3; filter: brightness(.48) saturate(.78) sepia(.12); }

@keyframes atmos-spin { to { transform: rotate(360deg); } }
@keyframes atmos-breathe { to { transform: translate(-38px, 24px) scale(1.18); opacity: .5; } }
@keyframes atmos-drift { to { transform: translate(36px, -42px); opacity: .26; } }

@media (max-width: 1100px) {
  .site-atmosphere { background-image: url("../assets/backgrounds/root-atlas-tablet.webp"); opacity: .66; }
  .atmos-orbit-c { display: none; }
  .atmos-orbit-a { width: 250px; height: 250px; left: -132px; top: -78px; }
  .atmos-orbit-b { width: 210px; height: 210px; right: -118px; bottom: -70px; }
}
@media (max-width: 640px) {
  .site-atmosphere { background-image: url("../assets/backgrounds/root-atlas-mobile.webp"); opacity: .58; }
  .atmos-orbit-b, .atmos-orbit-c, .atmos-nodes { display: none; }
  .atmos-orbit-a { width: 190px; height: 190px; left: -106px; top: -46px; opacity: .4; animation-duration: 24s; }
  .atmos-glow { width: 180px; height: 180px; right: -48px; top: auto; bottom: 4%; opacity: .26; animation-duration: 8s; }
}
@media (min-width: 641px) and (max-width: 1100px) and (hover: hover) and (pointer: fine) {
  .site-atmosphere { background-image: url("../assets/backgrounds/root-atlas-motion-v2-poster.webp"); opacity: .72; }
}
@media (prefers-reduced-motion: reduce) {
  .atmos-video { display: none !important; }
  .atmos-orbit, .atmos-glow, .atmos-nodes { animation: none !important; }
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 2.4rem; line-height: 1.15; }
h2 { font-size: 1.7rem; margin-bottom: .5rem; }
h3 { font-size: 1.2rem; }
a { color: var(--clay); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
main.wrap { width: 100%; flex: 1 0 auto; }

/* ---------------- 顶部导航（电脑） ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 8px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin-right: auto; }
.brand .flake { color: var(--clay); font-size: 1.3rem; }
.navlinks { display: flex; gap: 2px; }
.navlinks button {
  background: none; border: 0; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 999px; font-size: .93rem; transition: .15s;
}
.navlinks button:hover { background: var(--bg-sink); color: var(--ink); }
.navlinks button.active { background: var(--clay-bg); color: var(--clay); font-weight: 600; }
.iconbtn {
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  width: 38px; height: 38px; border-radius: 999px; font-size: 1rem; transition: .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { background: var(--bg-sink); color: var(--ink); }
.iconbtn.on { background: var(--clay-bg); color: var(--clay); border-color: var(--clay-soft); }

/* ---------------- 底部导航（手机） ---------------- */
.tabbar { display: none; }

/* ---------------- 视图容器 ---------------- */
.view { display: none; padding: 40px 0 80px; animation: fade .35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { color: var(--clay); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lead { color: var(--ink-soft); font-size: 1.05rem; max-width: 60ch; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--clay); color: #fff; border: 0;
  padding: 11px 20px; border-radius: 999px; font-size: .95rem; font-weight: 600;
  transition: .18s; box-shadow: var(--shadow);
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.ghost { background: var(--bg-raise); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-sink); }
.btn.sm { padding: 7px 14px; font-size: .85rem; }

/* ---------------- 首页 ---------------- */
.hero { text-align: center; padding: 30px 0 20px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 18px 0 14px; }
.hero .lead { margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 雪球动画 */
.snowball-demo {
  margin: 40px auto; max-width: 760px; background: var(--bg-raise);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow); text-align: center;
}
.snowball-demo .core {
  display: inline-block; background: var(--clay); color: #fff; font-family: var(--serif);
  font-size: 1.4rem; padding: 12px 22px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(201,100,66,.35);
}
.snowball-demo .core small { display:block; font-size:.7rem; opacity:.85; font-weight:400; }
.snow-words { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; min-height: 44px; }
.snow-words span {
  background: var(--clay-bg); color: var(--clay); padding: 7px 14px; border-radius: 999px;
  font-size: .92rem; font-weight: 600; opacity: 0; transform: scale(.7);
  animation: pop .4s forwards;
}
@keyframes pop { to { opacity: 1; transform: scale(1); } }

.feature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 46px; }
.fcard { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: .2s; text-align: left; }
.fcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.fcard .ico { font-size: 1.6rem; }
.fcard h3 { margin: 12px 0 6px; }
.fcard p { color: var(--ink-soft); font-size: .92rem; }

/* 作者的其他作品（方法论页底部） */
.works-grid { margin-top: 30px; }
a.fcard { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
a.fcard h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.work-badge { font-size: .68rem; font-weight: 600; color: var(--clay); background: var(--clay-bg); border-radius: 999px; padding: 3px 10px; letter-spacing: .04em; white-space: nowrap; }
.work-go { margin-top: auto; padding-top: 14px; color: var(--clay); font-size: .86rem; font-weight: 600; opacity: .55; transition: opacity .2s, transform .2s; }
a.fcard:hover .work-go { opacity: 1; transform: translateX(2px); }

.stat-row { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.stat { text-align: center; }
.stat b { font-family: var(--serif); font-size: 2rem; color: var(--clay); display: block; }
.stat span { color: var(--ink-soft); font-size: .85rem; }

/* ---------------- 对话式学习 ---------------- */
.learn-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.learn-progress { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: .85rem; }
.learn-progress b { color: var(--clay); }

.chat {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; min-height: 300px; max-height: 62vh; overflow-y: auto; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth;
}
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 88%; animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .avatar { flex: none; width: 32px; height: 32px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--bg-sink); }
.msg.tutor { align-self: flex-start; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .avatar { background: var(--clay); color: #fff; font-size: .72rem; }
.bubble { padding: 11px 15px; border-radius: 16px; font-size: .97rem; line-height: 1.55; }
.msg.tutor .bubble { background: var(--bg-sink); color: var(--ink); border-top-left-radius: 5px; }
.msg.user .bubble { background: var(--clay); color: #fff; border-top-right-radius: 5px; }
.bubble b.hl { background: var(--clay-bg); color: var(--clay); padding: 1px 7px; border-radius: 6px; }
.msg.tutor .bubble .seg { background: var(--bg); }
.sys-note { text-align: center; color: var(--ink-faint); font-size: .8rem; margin: 4px 0; }
.sys-note .lv-badge { vertical-align: middle; }

.chat-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; justify-content: center; min-height: 44px; }
.chip-opt {
  background: var(--bg-raise); border: 1.5px solid var(--line); color: var(--ink);
  padding: 11px 20px; border-radius: 999px; font-size: .96rem; font-weight: 600; transition: .15s; animation: rise .3s ease;
}
.chip-opt:hover { border-color: var(--clay-soft); background: var(--clay-bg); transform: translateY(-1px); }
.chip-opt.primary { background: var(--clay); color: #fff; border-color: var(--clay); }
.chip-opt.primary:hover { filter: brightness(1.06); }

.mini-list { display: grid; gap: 8px; margin-top: 8px; }
.mini-word { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.mini-word .mw { font-weight: 700; font-family: var(--serif); }
.mini-word .speak { width: 26px; height: 26px; }
.mini-add { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink-soft); border-radius: 999px; padding: 3px 10px; font-size: .76rem; }
.mini-add:hover { background: var(--clay-bg); color: var(--clay); border-color: var(--clay-soft); }
.mini-add:disabled { opacity: .6; }

/* ---- 积木拆解图（结构图 · 帮助理解词是怎么搭出来的） ---- */
.brick-diagram { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; margin: 8px 0 2px; padding: 12px 10px; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; }
.brick { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.brick .seg { font-family: var(--serif); font-weight: 700; padding: 6px 12px; border-radius: 8px; background: var(--bg-sink); color: var(--ink-soft); font-size: 1rem; letter-spacing: .01em; }
.brick.root .seg { background: var(--clay-bg); color: var(--clay); box-shadow: 0 0 0 2px var(--clay-soft) inset; }
.brick .gloss { font-size: .7rem; color: var(--ink-faint); min-height: 1em; }
.brick.root .gloss { color: var(--clay); font-weight: 600; }
.brick-plus { align-self: center; color: var(--ink-faint); font-size: .9rem; padding-bottom: 16px; }
.brick-arrow { align-self: center; color: var(--ink-faint); font-size: 1.1rem; padding: 0 4px 16px; }
.brick-result { align-self: center; margin-bottom: 16px; font-weight: 700; color: var(--clay); background: var(--clay-bg); padding: 6px 12px; border-radius: 8px; font-size: .95rem; }
.brick-result.q { color: var(--ink-faint); background: var(--bg-sink); }

/* ---- 词根记忆插画（推出词根后配图，帮记住核心义） ---- */
.root-illus { display: inline-block; margin: 6px 0 2px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-raise); max-width: 260px; }
.root-illus img { display: block; width: 100%; height: auto; }
.root-illus .cap { display: block; text-align: center; font-family: var(--serif); font-weight: 700; color: var(--clay); font-size: .9rem; padding: 6px 8px; }
.detail-illus { margin: 4px 0 16px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-raise); max-width: 380px; }
.detail-illus img { display: block; width: 100%; height: auto; }
.detail-illus .cap { display: block; text-align: center; font-family: var(--serif); font-weight: 700; color: var(--clay); padding: 8px; }
/* SVG 图标兜底（抽象词根） */
.ricon-wrap { display: flex; justify-content: center; align-items: center; padding: 28px; background: var(--bg-sink); }
.ricon { width: 84px; height: 84px; fill: var(--clay); color: var(--clay); }
.detail-illus .ricon { width: 110px; height: 110px; }

.learn-head { align-items: flex-start; }
.learn-tools { display: flex; align-items: center; gap: 10px; }
.iconbtn.sm { width: 32px; height: 32px; font-size: .95rem; }
.bubble .tip { display: block; margin-top: 4px; font-size: .78rem; color: var(--ink-faint); }
.msg.tutor .bubble .tip { color: var(--ink-faint); }

/* 输入框（微信式） */
.composer { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.composer input {
  flex: 1; border: 1.5px solid var(--line); background: var(--bg-raise); color: var(--ink);
  border-radius: 999px; padding: 12px 18px; font-size: 1rem; outline: none; font-family: inherit;
}
.composer input:focus { border-color: var(--clay-soft); }
.send-btn { flex: none; background: var(--clay); color: #fff; border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 600; font-size: .95rem; }
.send-btn:hover { filter: brightness(1.05); }

/* ---------------- 词根探索器 ---------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 22px 0 26px; }
.search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.search input { flex: 1; border: 0; background: none; color: var(--ink); font-size: .95rem; outline: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--bg-raise); border: 1px solid var(--line); color: var(--ink-soft);
  padding: 6px 13px; border-radius: 999px; font-size: .84rem; transition: .15s;
}
.chip:hover { background: var(--bg-sink); }
.chip.active { background: var(--clay-bg); color: var(--clay); border-color: var(--clay-soft); font-weight: 600; }

/* 筛选行 */
.filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-label { font-size: .82rem; color: var(--ink-faint); font-weight: 600; min-width: 32px; }

/* 难度标 */
.lv-badge { font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.lv-badge.lv1 { background: var(--sage-bg); color: var(--sage); }
.lv-badge.lv2 { background: var(--clay-bg); color: var(--clay); }
.lv-badge.lv3 { background: #ECE3F0; color: #8A5893; }
[data-theme="dark"] .lv-badge.lv3 { background: #352A3A; color: #C9A6D0; }

/* 难度分区 */
.level-section { margin-bottom: 34px; }
.level-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.level-head .lv-badge { font-size: .85rem; padding: 4px 14px; }
.level-sub { color: var(--ink-soft); font-size: .88rem; }
.level-count { margin-left: auto; color: var(--ink-faint); font-size: .82rem; }

.root-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.root-card {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: .2s; text-align: left;
}
.root-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--clay-soft); }
.root-card .rtop { display: flex; align-items: baseline; justify-content: space-between; }
.root-card .rname { font-family: var(--serif); font-size: 1.5rem; color: var(--clay); font-weight: 600; }
.root-card .rmean { font-size: 1rem; color: var(--ink); font-weight: 600; }
.root-card .rorigin { font-size: .78rem; color: var(--ink-faint); margin-top: 2px; }
.root-card .rcount { font-size: .8rem; color: var(--ink-soft); margin-top: 12px; }
.root-card .rcount b { color: var(--clay); }
.badge-affix { font-size: .68rem; background: var(--sage-bg); color: var(--sage); padding: 2px 8px; border-radius: 999px; font-weight: 700; }

/* 词根详情 */
.detail-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.detail-head .rname { font-family: var(--serif); font-size: 2.6rem; color: var(--clay); }
.detail-head .rmean { font-size: 1.3rem; font-weight: 600; }
.detail-head .rorigin { color: var(--ink-faint); font-size: .9rem; }
.story {
  background: var(--clay-bg); border-left: 3px solid var(--clay); border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 20px 0; color: var(--ink); font-size: .96rem;
}
.story .lbl { color: var(--clay); font-weight: 700; font-size: .8rem; letter-spacing: .05em; }

.leverage {
  display: flex; align-items: center; gap: 10px; background: var(--sage-bg); color: var(--sage);
  border-radius: 999px; padding: 8px 16px; font-size: .9rem; font-weight: 600; margin: 6px 0 22px;
}

.word-list { display: grid; gap: 12px; }
.word-item {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; transition: .15s;
}
.word-item:hover { border-color: var(--clay-soft); }
.word-item .wtop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.word-item .wword { font-size: 1.25rem; font-weight: 700; font-family: var(--serif); }
.word-item .parts { display: inline-flex; gap: 3px; font-size: .82rem; }
.word-item .parts .seg { background: var(--bg-sink); color: var(--ink-soft); padding: 2px 7px; border-radius: 6px; }
.word-item .parts .seg.root { background: var(--clay-bg); color: var(--clay); font-weight: 700; }
.word-item .wmean { color: var(--ink); margin-top: 6px; }
.word-item .wmean .en { color: var(--ink-soft); font-style: italic; }
.word-item .wex { color: var(--ink-soft); font-size: .9rem; margin-top: 4px; }
.word-item .wex::before { content: "“"; } .word-item .wex::after { content: "”"; }
.speak { background: none; border: 1px solid var(--line); color: var(--ink-soft); width: 30px; height: 30px; border-radius: 999px; font-size: .8rem; margin-left: auto; }
.speak:hover { background: var(--clay-bg); color: var(--clay); border-color: var(--clay-soft); }

/* 英语脑模式：隐藏中文 */
body.brain-mode .zh-hide { display: none !important; }

/* ---------------- 词根图谱 ---------------- */
#graphStage { position: relative; width: 100%; height: 620px; background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
#graphSvg { position: absolute; inset: 0; width: 100%; height: 100%; }
.node { position: absolute; transform: translate(-50%,-50%); border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s, box-shadow .15s; text-align: center; }
.node:hover { transform: translate(-50%,-50%) scale(1.08); z-index: 5; }
.node.family { background: var(--clay); color: #fff; font-family: var(--serif); box-shadow: 0 6px 18px rgba(201,100,66,.35); }
.node.family b { font-size: 1rem; } .node.family small { font-size: .66rem; opacity: .85; }
.node.root { background: var(--bg-sink); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.node.root b { font-size: .92rem; color: var(--clay); font-family: var(--serif); } .node.root small { font-size: .64rem; color: var(--ink-soft); }
.graph-tip { color: var(--ink-soft); font-size: .88rem; margin: 8px 0 16px; }

/* ---------------- 游戏（猜词 / 拆词） ---------------- */
.game-card {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); max-width: 640px; margin: 0 auto; text-align: center;
}
.game-progress { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--ink-soft); font-size: .85rem; margin-bottom: 8px; }
.pbar { flex: 1; max-width: 240px; height: 6px; background: var(--bg-sink); border-radius: 999px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--clay); border-radius: 999px; transition: width .3s; }

.guess-word { font-family: var(--serif); font-size: 2.4rem; color: var(--ink); margin: 8px 0; }
.guess-hint { color: var(--ink-soft); margin-bottom: 20px; }
.guess-hint .seg { background: var(--clay-bg); color: var(--clay); padding: 2px 8px; border-radius: 6px; font-weight: 700; margin: 0 2px; }
.opts { display: grid; gap: 10px; margin: 20px 0; }
.opt {
  background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 18px; text-align: left; font-size: 1rem; color: var(--ink); transition: .15s;
}
.opt:hover:not(:disabled) { border-color: var(--clay-soft); background: var(--clay-bg); }
.opt.correct { border-color: var(--sage); background: var(--sage-bg); color: var(--sage); font-weight: 600; }
.opt.wrong { border-color: #c0563c; background: #f6e2dc; color: #a5432c; }
.reveal { background: var(--clay-bg); border-radius: var(--radius-sm); padding: 16px; margin: 18px 0; text-align: left; display: none; }
.reveal.show { display: block; }
.reveal .rword { font-weight: 700; color: var(--clay); }

/* 拆词：积木拖放 */
.breakdown-target { font-family: var(--serif); font-size: 2.2rem; margin: 10px 0 6px; }
.slots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 56px; margin: 18px 0; padding: 12px; background: var(--bg-sink); border-radius: var(--radius-sm); border: 2px dashed var(--line); }
.slot { min-width: 60px; height: 40px; border-radius: 8px; border: 1.5px dashed var(--ink-faint); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: .8rem; }
.slot.filled { border-style: solid; }
.bank { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.brick {
  background: var(--clay); color: #fff; padding: 9px 16px; border-radius: 8px; font-weight: 600;
  border: 0; font-size: .95rem; box-shadow: var(--shadow); transition: .12s;
}
.brick:hover { transform: translateY(-2px); }
.brick.used { opacity: .3; pointer-events: none; }
.brick.plain { background: var(--bg-sink); color: var(--ink-soft); }

/* ---------------- 复习闪卡 ---------------- */
.flashcard {
  perspective: 1200px; max-width: 520px; margin: 0 auto 20px; height: 300px; cursor: pointer;
}
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius);
  background: var(--bg-raise); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.flash-face.back { transform: rotateY(180deg); }
.flash-face .fword { font-family: var(--serif); font-size: 2.2rem; color: var(--ink); }
.flash-face .fparts { margin-top: 10px; }
.flash-face .fmean { font-size: 1.3rem; font-weight: 600; }
.flash-face .fex { color: var(--ink-soft); margin-top: 10px; font-size: .92rem; }
.flash-face .flip-tip { position: absolute; bottom: 14px; color: var(--ink-faint); font-size: .78rem; }
.rate-row { display: flex; gap: 10px; justify-content: center; }
.rate { border: 1.5px solid var(--line); background: var(--bg-raise); border-radius: var(--radius-sm); padding: 10px 18px; font-weight: 600; color: var(--ink); transition: .15s; }
.rate.again { border-color: #d99; } .rate.again:hover { background: #f6e2dc; }
.rate.hard:hover { background: var(--clay-bg); }
.rate.good:hover { background: var(--sage-bg); color: var(--sage); border-color: var(--sage); }
.review-empty { text-align: center; color: var(--ink-soft); padding: 60px 0; }

/* ---------------- 词块 ---------------- */
.chunk-scene { margin-bottom: 30px; }
.chunk-scene h3 { color: var(--clay); }
.chunk-scene .stitle { color: var(--ink-soft); font-size: .88rem; margin-bottom: 12px; }
.chunk-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.chunk-item { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.chunk-item .ck { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.chunk-item .czh { color: var(--ink-soft); font-size: .88rem; }
.chunk-item .cex { color: var(--ink-faint); font-size: .85rem; margin-top: 4px; font-style: italic; }

/* ---------------- 学习法页 ---------------- */
.method-hero { text-align: center; margin-bottom: 40px; }
.principle { display: flex; gap: 18px; background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.principle .pn { font-family: var(--serif); font-size: 2rem; color: var(--clay-soft); line-height: 1; }
.principle h3 { margin-bottom: 6px; }
.principle p { color: var(--ink-soft); font-size: .95rem; }
.vs-table { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 24px 0; }
.vs-table .h { padding: 14px; font-weight: 700; text-align: center; }
.vs-table .h.bad { background: var(--bg-sink); color: var(--ink-soft); }
.vs-table .h.good { background: var(--clay-bg); color: var(--clay); }
.vs-table .c { padding: 14px 16px; border-top: 1px solid var(--line); font-size: .92rem; }
.vs-table .c.bad { color: var(--ink-soft); }

.section-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.back-link { background: none; border: 0; color: var(--clay); font-size: .9rem; margin-bottom: 16px; display: inline-flex; align-items: center; gap: 6px; }
.mt40 { margin-top: 40px; } .mt24 { margin-top: 24px; }
.empty-note { color: var(--ink-faint); text-align: center; padding: 40px; grid-column: 1/-1; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: 999px; font-size: .9rem;
  opacity: 0; transition: .3s; z-index: 200; box-shadow: var(--shadow-lg); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--ink-faint); font-size: .85rem; text-align: center; margin-top: auto; flex: none; }

/* ============================================================
   响应式 —— 手机端
   ============================================================ */
@media (max-width: 860px) {
  h1 { font-size: 2rem; }
  .feature-grid, .root-grid { grid-template-columns: 1fr 1fr; }
  .chunk-grid { grid-template-columns: 1fr; }
  #graphStage { height: 520px; }
}
@media (max-width: 560px) {
  .navlinks { display: none; }         /* 手机隐藏顶部链接 */
  body { padding-bottom: 68px; }        /* 给底部导航留位 */
  .feature-grid, .root-grid { grid-template-columns: 1fr; }
  .view { padding: 24px 0 40px; }
  .detail-head .rname { font-size: 2rem; }
  .game-card { padding: 20px; }
  .guess-word { font-size: 1.8rem; }
  .vs-table { grid-template-columns: 1fr; }

  /* 底部标签导航 */
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button {
    flex: 1; background: none; border: 0; color: var(--ink-faint);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: .64rem; padding: 4px 0;
  }
  .tabbar button .ti { font-size: 1.2rem; }
  .tabbar button.active { color: var(--clay); }

  /* ---- 对话学习：微信式满屏，精简无关文字 ---- */
  #view-learn.active {
    display: flex; flex-direction: column;
    height: calc(100dvh - 62px - 66px);   /* 顶栏 + 底部导航 */
    padding: 6px 0 4px;
  }
  #view-learn .learn-title { display: none; }        /* 标题手机端默认不占屏 */
  #view-learn .learn-head { margin-bottom: 8px; }
  #view-learn .learn-tools { width: 100%; justify-content: space-between; }
  #view-learn .learn-progress span:first-child { font-size: .78rem; }
  #view-learn .chat { flex: 1 1 auto; max-height: none; min-height: 0; padding: 14px; border-radius: 14px; }
  #view-learn .chat-actions { flex: none; margin-top: 8px; gap: 8px; }
  #view-learn .chip-opt { padding: 9px 16px; font-size: .9rem; }
  #view-learn .composer { flex: none; margin-top: 8px; }
  #view-learn .composer input { padding: 11px 16px; }
  #view-learn .msg { max-width: 92%; }
  /* 学习页把脚注移出视野（满屏聊天） */
  body:has(#view-learn.active) footer { display: none; }
}

/* ============================================================
   养成升级 —— 雪核成长 / 无尽猜 / 打卡热力图 / 成就墙 / 助记
   ============================================================ */

/* ---- 图谱：掌握点亮 / 未掌握置灰 ---- */
.node.root.dim { filter: grayscale(1); opacity: .5; }
.node.root.lit { background: var(--clay-bg); border-color: var(--clay-soft); box-shadow: 0 4px 14px rgba(201,100,66,.28); }
.node.root.lit b { color: var(--clay); }
.node.family.complete { box-shadow: 0 0 0 4px var(--clay-soft), 0 8px 22px rgba(201,100,66,.45); }

/* ---- 首页雪核成长小组件 ---- */
.snowgrow { max-width: 760px; margin: 28px auto 0; }
.snowgrow:empty { display: none; }
.snowgrow-inner {
  display: flex; align-items: center; gap: 24px; background: var(--bg-raise);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow);
}
.core-svg { flex: none; }
.sg-meta { flex: 1; text-align: left; }
.sg-num { font-size: 1rem; color: var(--ink); }
.sg-num b { font-family: var(--serif); font-size: 1.8rem; color: var(--clay); }
.sg-num span { color: var(--ink-soft); font-size: .85rem; }
.sg-bar { height: 8px; background: var(--bg-sink); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.sg-bar i { display: block; height: 100%; background: var(--clay); border-radius: 999px; transition: width .6s ease; }
.sg-sub { color: var(--ink-soft); font-size: .82rem; margin-bottom: 10px; }

/* ---- 「我的」页 ---- */
.profile-hero {
  display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px; box-shadow: var(--shadow); margin-top: 18px;
}
.ph-core { flex: none; }
.ph-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 22px 34px; }
.ph-stat b { font-family: var(--serif); font-size: 2rem; color: var(--clay); display: block; line-height: 1; }
.ph-stat b small { font-size: 1rem; color: var(--ink-faint); }
.ph-stat span { color: var(--ink-soft); font-size: .82rem; }

/* ---- 打卡热力图 ---- */
.heatmap { margin-top: 14px; overflow-x: auto; padding-bottom: 6px; }
.hm-grid { display: flex; gap: 4px; min-width: min-content; }
.hm-col { display: flex; flex-direction: column; gap: 4px; }
.hm-cell {
  width: 15px; height: 15px; border-radius: 3px; background: var(--bg-sink); display: inline-block;
}
.hm-cell.hidden { visibility: hidden; }
.hm-cell.l0 { background: var(--bg-sink); }
.hm-cell.l1 { background: #EAD3C6; }
.hm-cell.l2 { background: #E0A98D; }
.hm-cell.l3 { background: #D07E58; }
.hm-cell.l4 { background: var(--clay); }
[data-theme="dark"] .hm-cell.l1 { background: #4A342A; }
[data-theme="dark"] .hm-cell.l2 { background: #6E4632; }
[data-theme="dark"] .hm-cell.l3 { background: #A65E3E; }
[data-theme="dark"] .hm-cell.l4 { background: var(--clay); }
.hm-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; color: var(--ink-soft); font-size: .78rem; }
.hm-legend .hm-cell { width: 13px; height: 13px; }

/* ---- 成就墙 ---- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.ach {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 14px; text-align: center; transition: .2s;
}
.ach.got { border-color: var(--clay-soft); box-shadow: var(--shadow); }
.ach.locked { opacity: .55; filter: grayscale(.6); }
.ach-ico { font-size: 1.9rem; line-height: 1; }
.ach-name { font-family: var(--serif); font-weight: 700; margin-top: 8px; font-size: 1rem; }
.ach.got .ach-name { color: var(--clay); }
.ach-desc { color: var(--ink-soft); font-size: .78rem; margin-top: 4px; }
#profReset.danger { color: #fff; background: var(--clay); border-color: var(--clay); }
.profile-about-link {
  width: min(100%, 540px); margin: 24px auto 0; padding: 15px 17px;
  display: flex; align-items: center; gap: 13px; text-align: left;
  color: var(--ink); background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); transition: border-color .2s, transform .2s, box-shadow .2s;
}
.profile-about-link:hover { border-color: var(--clay-soft); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.profile-about-mark {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  color: #fff; background: var(--ink); border-radius: 10px; font: 600 1.1rem/1 var(--serif);
}
.profile-about-link > span:nth-child(2) { display: grid; gap: 3px; flex: 1; }
.profile-about-link b { font-family: var(--serif); font-size: 1rem; }
.profile-about-link small { color: var(--ink-faint); font-size: .78rem; }
.profile-about-link svg { width: 18px; height: 18px; color: var(--ink-faint); }

/* ---- 无尽猜词 ---- */
.endless-stage { max-width: 520px; margin: 24px auto 0; }
.endless-card {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 40px 28px; min-height: 400px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  cursor: pointer; user-select: none;
}
.endless-card.slide-in { animation: slideUp .32s cubic-bezier(.2,.7,.3,1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(38px); } to { opacity: 1; transform: none; } }
.ec-count { color: var(--ink-faint); font-size: .78rem; margin-bottom: 18px; }
.ec-word { font-family: var(--serif); font-size: 2.4rem; color: var(--ink); font-weight: 600; }
.ec-parts { margin: 20px 0; }
.ec-parts .seg { font-size: 1.05rem; }
.ec-prompt { color: var(--ink-soft); font-size: .92rem; margin-top: 14px; line-height: 1.8; }
.ea-word { font-family: var(--serif); font-size: 1.7rem; color: var(--clay); }
.ea-zh { font-size: 1.15rem; margin: 12px 0; }
.ea-en { color: var(--ink-soft); font-style: italic; font-size: .95rem; }
.ea-ex { color: var(--ink-soft); font-size: .9rem; margin-top: 6px; }
.ec-grade { display: flex; gap: 12px; margin-top: 26px; }
.endless-foot { text-align: center; color: var(--ink-faint); font-size: .82rem; margin-top: 16px; }

/* ---- 词条内的助记众筹块 ---- */
.mnemo { margin-top: 12px; background: var(--clay-bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.mn-head { font-weight: 700; color: var(--clay); font-size: .9rem; margin-bottom: 8px; }
.mn-crowd { font-size: .68rem; background: var(--clay); color: #fff; padding: 1px 7px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.mn-item { font-size: .88rem; margin-bottom: 6px; line-height: 1.6; }
.mn-type { font-size: .7rem; background: var(--bg-raise); color: var(--clay); border: 1px solid var(--clay-soft); padding: 1px 7px; border-radius: 999px; margin-right: 6px; }
.mn-by { color: var(--ink-faint); font-size: .76rem; margin-left: 4px; }
.mn-empty { color: var(--ink-soft); font-size: .85rem; margin-bottom: 8px; }
.mn-submit { display: inline-block; margin-top: 4px; font-size: .82rem; font-weight: 600; color: var(--clay); }

/* ============================================================
   Fable 5 升级 —— UI 精修 + 动态观感 + 今日雪球 + AI 导师
   （保持米白+陶土底子；所有动效尊重 prefers-reduced-motion）
   ============================================================ */

/* ---- 全局质感：多层极淡的环境光晕 + 更精致的阴影 ---- */
body {
  background-image:
    radial-gradient(1100px 500px at 85% -80px, rgba(201,100,66,.055), transparent 60%),
    radial-gradient(900px 460px at -10% 30%, rgba(110,139,106,.05), transparent 60%),
    radial-gradient(700px 400px at 60% 110%, rgba(201,100,66,.035), transparent 60%);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(1100px 500px at 85% -80px, rgba(224,138,102,.06), transparent 60%),
    radial-gradient(900px 460px at -10% 30%, rgba(143,176,137,.045), transparent 60%);
}

/* ---- 视图切换过渡：更顺滑的浮现 ---- */
.view { animation: viewIn .45s cubic-bezier(.22,.9,.3,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- 滚动渐现 ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.22,.9,.3,1), transform .6s cubic-bezier(.22,.9,.3,1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
body.no-motion .reveal { opacity: 1; transform: none; transition: none; }

/* ---- 微交互：按钮按压 / 卡片悬浮统一升级 ---- */
.btn, .chip-opt, .send-btn, .rate, .opt, .brick { will-change: transform; }
.btn:active, .chip-opt:active, .send-btn:active, .rate:active { transform: translateY(1px) scale(.97); }
.btn { background: linear-gradient(160deg, var(--clay), color-mix(in srgb, var(--clay) 82%, #8a3c22)); }
.btn.ghost { background: var(--bg-raise); }
.fcard, .root-card { transition: transform .25s cubic-bezier(.22,.9,.3,1), box-shadow .25s, border-color .25s; }
.fcard:hover, .root-card:hover { transform: translateY(-4px); }
.brand .flake { display: inline-block; transition: transform .5s cubic-bezier(.22,.9,.3,1); }
.brand:hover .flake { transform: rotate(180deg) scale(1.15); }
.iconbtn:active { transform: scale(.92); }

/* 手机底部导航：活性 pill */
.tabbar button { position: relative; transition: color .2s; }
.tabbar button.active .ti { transform: translateY(-2px) scale(1.12); }
.tabbar button .ti { display: inline-block; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }

/* ---- 首页飘雪画布 ---- */
.hero { position: relative; }
.snow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.hero > *:not(.snow-canvas) { position: relative; z-index: 1; }
body.no-motion .snow-canvas { display: none; }

/* ---- 庆祝爆花 ---- */
.fx-burst-wrap { position: fixed; left: 50%; top: 42%; z-index: 300; pointer-events: none; }
.fx-burst {
  position: absolute; left: 0; top: 0; color: var(--clay); opacity: 0;
  animation: burstFly 1.3s cubic-bezier(.16,.8,.3,1) forwards;
}
@keyframes burstFly {
  0% { opacity: 0; transform: translate(0,0) rotate(0) scale(.4); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
}

/* ---- 聊天升级：气泡入场弹性 + 打字指示点 ---- */
.msg { animation: msgIn .35s cubic-bezier(.22,1.2,.36,1); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.bubble.dots { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.bubble.dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--ink-faint); animation: dotPulse 1.1s ease-in-out infinite; }
.bubble.dots i:nth-child(2) { animation-delay: .18s; }
.bubble.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dotPulse { 0%,100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.composer input { transition: border-color .2s, box-shadow .2s; }
.composer input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 18%, transparent); }

/* ---- AI 导师 ---- */
.ai-badge { font-size: .7rem; font-weight: 700; background: linear-gradient(120deg, var(--clay), #a35), linear-gradient(var(--clay),var(--clay)); color: #fff; padding: 3px 10px; border-radius: 999px; letter-spacing: .05em; }
.ai-cursor { display: inline-block; width: 8px; height: 1em; vertical-align: text-bottom; background: var(--clay); border-radius: 2px; animation: aiBlink .9s steps(2) infinite; margin-left: 2px; }
@keyframes aiBlink { 50% { opacity: 0; } }
.ai-err-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ai-err-actions .chip-opt { padding: 7px 14px; font-size: .85rem; }

/* ---- 设置弹窗 ---- */
.modal-mask {
  position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center;
  background: rgba(30,26,22,.4); backdrop-filter: blur(6px); animation: fade .25s ease; padding: 16px;
}
.modal {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 90dvh; overflow-y: auto; padding: 22px 22px 18px;
  animation: msgIn .3s cubic-bezier(.22,1.2,.36,1);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-tip { color: var(--ink-soft); font-size: .85rem; margin-bottom: 14px; line-height: 1.6; }
.fld { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 12px; }
.fld input[type="text"], .fld input[type="password"], .fld select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 14px; font-size: .95rem; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); outline: none;
}
.fld input:focus, .fld select:focus { border-color: var(--clay-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 15%, transparent); }
.fld.chk { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.fld.chk input { accent-color: var(--clay); }
.chk-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin-bottom: 12px; color: var(--ink-soft); }
.chk-row .chk { display: flex; align-items: center; gap: 5px; cursor: pointer; margin: 0; font-size: .85rem; }
.chk-row input { accent-color: var(--clay); }
.modal-status { min-height: 20px; font-size: .84rem; margin: 4px 0 8px; }
.modal-status.ok { color: var(--sage); } .modal-status.err { color: #c0563c; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- 今日雪球 ---- */
.daily-head { text-align: center; margin-bottom: 10px; }
.daily-meta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.d-chip { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: .82rem; color: var(--ink-soft); }
.daily-ring-wrap { display: flex; justify-content: center; margin: 22px 0; }
.daily-ring {
  width: 116px; height: 116px; border-radius: 999px; display: flex; align-items: baseline; justify-content: center;
  background: conic-gradient(var(--clay) var(--p, 0deg), var(--bg-sink) 0deg); position: relative;
  transition: --p .5s; box-shadow: var(--shadow);
}
.daily-ring::before { content: ""; position: absolute; inset: 10px; background: var(--bg); border-radius: 999px; }
.daily-ring b, .daily-ring span { position: relative; align-self: center; }
.daily-ring b { font-family: var(--serif); font-size: 2.3rem; color: var(--clay); }
.daily-ring span { color: var(--ink-faint); font-size: .95rem; margin-left: 2px; }
.quest-list { display: grid; gap: 14px; max-width: 640px; margin: 0 auto; }
.quest {
  display: flex; align-items: center; gap: 16px; background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .22s cubic-bezier(.22,.9,.3,1), box-shadow .22s, border-color .22s;
}
.quest:hover:not(.ok) { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--clay-soft); }
.quest.ok { cursor: default; opacity: .78; background: var(--sage-bg); border-color: color-mix(in srgb, var(--sage) 35%, var(--line)); }
.q-ico { font-size: 1.7rem; flex: none; }
.q-body { flex: 1; min-width: 0; }
.q-title { font-weight: 700; font-family: var(--serif); font-size: 1.05rem; }
.q-desc { color: var(--ink-soft); font-size: .84rem; margin-top: 2px; }
.q-bar { height: 6px; background: var(--bg-sink); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.q-bar i { display: block; height: 100%; background: var(--clay); border-radius: 999px; transition: width .5s cubic-bezier(.22,.9,.3,1); }
.quest.ok .q-bar i { background: var(--sage); }
.q-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.q-count { font-size: .8rem; color: var(--ink-faint); font-weight: 700; }
.daily-tip { text-align: center; color: var(--ink-faint); font-size: .82rem; margin-top: 18px; }
.daily-done {
  text-align: center; max-width: 560px; margin: 26px auto 0; background: var(--bg-raise);
  border: 1px solid var(--clay-soft); border-radius: var(--radius); padding: 30px 24px; box-shadow: var(--shadow-lg);
}
.daily-done .dd-flake { font-size: 2.6rem; animation: floatY 3s ease-in-out infinite; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.daily-done h3 { font-size: 1.4rem; margin: 8px 0 6px; }
.daily-done p { color: var(--ink-soft); font-size: .95rem; }
.dd-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* 首页今日雪球组件 */
.daily-widget { max-width: 760px; margin: 26px auto 0; }
.daily-widget:empty { display: none; }
.dw-inner {
  display: flex; align-items: center; gap: 14px; background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 20px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.dw-inner:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--clay-soft); }
.dw-inner.all { background: var(--sage-bg); border-color: color-mix(in srgb, var(--sage) 35%, var(--line)); }
.dw-flake { font-size: 1.6rem; flex: none; }
.dw-meta { flex: 1; min-width: 0; text-align: left; }
.dw-meta b { display: block; font-size: .95rem; }
.dw-meta span { color: var(--ink-soft); font-size: .8rem; }
.dw-dots { display: flex; gap: 5px; flex: none; }
.dw-dots i { width: 9px; height: 9px; border-radius: 999px; background: var(--bg-sink); border: 1px solid var(--line); }
.dw-dots i.on { background: var(--clay); border-color: var(--clay); }
.dw-go { flex: none; color: var(--clay); font-weight: 700; font-size: .88rem; }

/* ---- reduced-motion：一律直出 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .quest { padding: 14px 14px; gap: 10px; }
  .q-right .btn { padding: 6px 12px; font-size: .8rem; }
  .daily-ring { width: 96px; height: 96px; }
  .modal { padding: 18px 16px 14px; }
}

@media (max-width: 560px) {
  .snowgrow-inner { flex-direction: column; text-align: center; gap: 14px; }
  .sg-meta { text-align: center; }
  .profile-hero { flex-direction: column; text-align: center; gap: 18px; }
  .ph-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; width: 100%; }
  .ec-word { font-size: 2rem; }
  .endless-card { min-height: 62dvh; }
}


/* ============================================================
   ETYMA 高级层（2026-07-18 专业化跃迁）
   入场幕 / 品牌字标 / SVG 图标适配 / 赞助弹窗 / 页脚 / 排印精修
   ============================================================ */

/* ---------- 入场幕（3A 式：墨色底 + 字标逐字显现 + 细进度线） ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #1B1917;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .9s cubic-bezier(.4,0,.2,1), visibility .9s;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
/* 手机端入场动画（animated WebP 放在 <img> 里，加载后淡入） */
.pl-intro {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0; opacity: 0; transition: opacity .7s ease;
  background-color: #1B1917; background-size: cover; background-position: center;
  background-repeat: no-repeat; pointer-events: none;
}
#preloader.video-on .pl-intro { opacity: 1; }
#preloader.video-on::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(27,25,23,.35) 0%, rgba(27,25,23,.55) 55%, rgba(27,25,23,.82) 100%);
}
.pl-inner { position: relative; z-index: 2; text-align: center; padding: 0 20px; }
/* 名言 */
.pl-quote {
  max-width: min(460px, 84vw); margin: 26px auto 0; min-height: 3.6em;
  color: #CDC6BA; font-size: .92rem; line-height: 1.75; font-family: var(--serif);
  opacity: 0; transition: opacity .5s ease;
}
.pl-quote.show { opacity: 1; }
.pl-quote em { display: block; margin-top: 7px; font-style: normal; font-size: .78rem; letter-spacing: .08em; color: #8F877C; }
.pl-mark { font-family: var(--serif); color: #EDE9E2; font-size: clamp(2.6rem, 9vw, 4.4rem); letter-spacing: .38em; margin-left: .38em; }
.pl-letter { display: inline-block; opacity: 0; transform: translateY(14px); animation: plRise 1.1s cubic-bezier(.22,1,.36,1) forwards; }
.pl-letter:nth-child(1) { animation-delay: .15s; }
.pl-letter:nth-child(2) { animation-delay: .27s; }
.pl-letter:nth-child(3) { animation-delay: .39s; }
.pl-letter:nth-child(4) { animation-delay: .51s; }
.pl-letter:nth-child(5) { animation-delay: .63s; }
@keyframes plRise { to { opacity: 1; transform: none; } }
.pl-sub {
  color: #7C756A; font-size: .78rem; letter-spacing: .5em; margin: 18px 0 0 .5em;
  opacity: 0; animation: plFade 1.2s ease .9s forwards;
}
@keyframes plFade { to { opacity: 1; } }
.pl-bar {
  width: min(220px, 50vw); height: 1px; background: #3A3631;
  margin: 34px auto 0; overflow: hidden;
  opacity: 0; animation: plFade .6s ease .7s forwards;
}
.pl-bar i { display: block; height: 100%; width: 0; background: #C96442; transition: width .3s ease; }
@media (prefers-reduced-motion: reduce) {
  #preloader { transition: opacity .2s; }
  .pl-letter, .pl-sub, .pl-bar { animation: none; opacity: 1; transform: none; }
}

/* ---------- 品牌字标 ---------- */
.brand { gap: 12px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
}
[data-theme="dark"] .brand-mark { background: var(--clay); color: #fff; }
.brand-name { letter-spacing: .02em; }
.brand-name em { font-style: normal; color: var(--ink-faint); font-size: .85em; margin-left: 6px; font-weight: 400; }

/* ---------- SVG 图标适配 ---------- */
.fcard .ico { width: 34px; height: 34px; color: var(--clay); }
.fcard .ico svg { width: 100%; height: 100%; }
.tabbar button .ti { width: 22px; height: 22px; }
.tabbar button .ti svg { width: 100%; height: 100%; display: block; }
.search svg { color: var(--ink-faint); flex: none; }
.iconbtn svg { display: block; }

/* ---------- 排印精修 ---------- */
h1 { letter-spacing: -.015em; }
.hero { padding: 44px 0 26px; }
.hero .eyebrow { letter-spacing: .34em; }
.eyebrow { letter-spacing: .18em; }
.lead { line-height: 1.85; }

/* ---------- 赞助弹窗 ---------- */
.modal-veil {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(27,25,23,.55); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: fade .25s ease;
}
/* 内容不超屏时仍垂直居中；超屏时靠顶部并可滚动，保证关闭按钮始终够得着 */
.modal-veil > * { margin: auto; }
.modal-veil[hidden] { display: none; }
.sponsor-modal {
  position: relative; width: min(400px, 94vw);
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 30px 28px 24px; text-align: center;
  animation: sponsorIn .35s cubic-bezier(.22,1,.36,1);
}
@keyframes sponsorIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.sponsor-modal h3 { font-size: 1.25rem; margin: 8px 0 10px; }
.sponsor-note { color: var(--ink-soft); font-size: .9rem; line-height: 1.8; margin-bottom: 18px; }
.modal-x {
  position: absolute; top: 6px; right: 8px; z-index: 2;
  background: none; border: 0; color: var(--ink-faint); font-size: 1.5rem; line-height: 1;
  padding: 8px 12px; cursor: pointer; transition: color .15s;
}
.modal-x:hover { color: var(--ink); }
.sponsor-tabs { display: inline-flex; background: var(--bg-sink); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 18px; }
.sponsor-tabs button {
  border: 0; background: none; color: var(--ink-soft);
  padding: 7px 22px; border-radius: 999px; font-size: .88rem; transition: .18s;
}
.sponsor-tabs button.on { background: var(--bg-raise); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.sponsor-qr {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; width: 232px; margin: 0 auto;
}
.sponsor-qr img { display: block; width: 200px; height: 200px; object-fit: contain; }
.sponsor-thanks { color: var(--ink-faint); font-size: .78rem; letter-spacing: .12em; margin-top: 16px; }

/* ---------- 页脚 ---------- */
footer { padding: 44px 0 40px; text-align: center; }
.foot-brand { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }
.foot-brand em { font-style: normal; color: var(--ink-faint); font-size: .85em; margin-left: 6px; }
.foot-line { margin-top: 6px; }
.foot-actions { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.foot-dot { color: var(--ink-faint); }
.linklike { background: none; border: 0; color: var(--clay); font-size: .85rem; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* ---------- 音效按钮态 ---------- */
#soundBtn.muted .sw1, #soundBtn.muted .sw2 { display: none; }

/* ---------- 响应式工作台：训练页优先占满有效视口 ---------- */
@media (min-width: 861px) {
  :root { --maxw: 1180px; }
  #view-learn.active { display: flex; flex-direction: column; padding: 32px 0 14px; }
  #view-learn .chat { height: clamp(420px, calc(100dvh - 310px), 680px); max-height: none; }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review).active {
    display: grid; grid-template-columns: 280px minmax(480px, 680px);
    grid-template-rows: auto auto 1fr; column-gap: 48px;
    align-items: start; justify-content: center; padding-bottom: 14px;
  }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review) > .eyebrow { grid-column: 1; grid-row: 1; }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review) > h2 { grid-column: 1; grid-row: 2; }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review) > .lead { grid-column: 1; grid-row: 3; }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review) > :is(.game-card, .endless-stage, #reviewArea) {
    grid-column: 2; grid-row: 1 / span 3; width: 100%; max-width: none; margin: 0;
  }
  #view-endless .endless-card { min-height: min(560px, calc(100dvh - 150px)); }
  #view-review .flashcard { max-width: none; height: 420px; }
  footer { padding: 12px 0; }
  footer .wrap { display: flex; align-items: center; justify-content: center; gap: 18px; }
  .foot-line, .foot-actions { margin-top: 0; }
}

@media (max-width: 860px) {
  .navlinks { display: none; }
  body { padding-bottom: 68px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    justify-content: space-evenly; gap: 2px;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
  }
  .tabbar button {
    flex: 0 1 72px; min-width: 52px; background: none; border: 0; color: var(--ink-faint);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: .64rem; padding: 4px 0;
  }
  .tabbar button.active { color: var(--clay); }
  footer { display: none; }
  body:has(#view-home.active) footer { display: block; padding: 28px 0 calc(24px + env(safe-area-inset-bottom)); }
  body:has(:is(#view-guess, #view-endless, #view-breakdown, #view-review).active) { padding-bottom: 0; }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review).active { padding: 14px 0 16px; }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review) > :is(.eyebrow, .lead) { display: none; }
  :is(#view-guess, #view-endless, #view-breakdown, #view-review) > h2 {
    font-family: var(--sans); font-size: 1.05rem; line-height: 1.3; margin: 0 0 10px;
  }
  #view-endless .endless-stage { max-width: none; margin: 0; }
  #view-endless .endless-card { min-height: max(360px, calc(100dvh - 250px)); padding: 24px 18px; }
  :is(#view-guess, #view-breakdown) > .game-card {
    max-width: none; min-height: max(360px, calc(100dvh - 205px)); padding: 20px;
    display: flex; flex-direction: column; justify-content: center;
  }
  #view-review > #reviewArea { margin-top: 0; }
  #view-review .flashcard { height: clamp(280px, calc(100dvh - 300px), 420px); }
  #view-review .review-empty { min-height: max(360px, calc(100dvh - 205px)); display: grid; place-content: center; }
}

@media (min-width: 561px) and (max-width: 860px) {
  #view-learn.active { display: flex; flex-direction: column; min-height: calc(100dvh - 131px); padding: 18px 0 12px; }
  #view-learn .chat { flex: 1 1 auto; min-height: 520px; max-height: none; }
}

/* ---------- 无尽解码卡面 · 语言观察室 ---------- */
#view-endless .endless-card {
  background-color: var(--bg-raise);
  background-image: url("../assets/card-backgrounds/card-bg-lab-desktop.webp?v=3");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
[data-theme="dark"] #view-endless .endless-card {
  background-image:
    linear-gradient(color-mix(in srgb, var(--bg-raise) 76%, transparent), color-mix(in srgb, var(--bg-raise) 76%, transparent)),
    url("../assets/card-backgrounds/card-bg-lab-desktop.webp?v=3");
}
@media (max-width: 860px) {
  #view-endless .endless-card { background-image: url("../assets/card-backgrounds/card-bg-lab-tablet.webp?v=3"); }
  [data-theme="dark"] #view-endless .endless-card {
    background-image:
      linear-gradient(color-mix(in srgb, var(--bg-raise) 76%, transparent), color-mix(in srgb, var(--bg-raise) 76%, transparent)),
      url("../assets/card-backgrounds/card-bg-lab-tablet.webp?v=3");
  }
}
@media (max-width: 560px) {
  #view-endless .endless-card { background-image: url("../assets/card-backgrounds/card-bg-lab-mobile.webp?v=3"); }
  [data-theme="dark"] #view-endless .endless-card {
    background-image:
      linear-gradient(color-mix(in srgb, var(--bg-raise) 76%, transparent), color-mix(in srgb, var(--bg-raise) 76%, transparent)),
      url("../assets/card-backgrounds/card-bg-lab-mobile.webp?v=3");
  }
}

/* ---------- 导师对话背景 · 语言观察室 ---------- */
#view-learn .chat {
  background-color: var(--bg-raise);
  background-image: url("../assets/tutor-backgrounds/tutor-dialog-desktop.webp?v=1");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
[data-theme="dark"] #view-learn .chat {
  background-image:
    linear-gradient(color-mix(in srgb, var(--bg-raise) 82%, transparent), color-mix(in srgb, var(--bg-raise) 82%, transparent)),
    url("../assets/tutor-backgrounds/tutor-dialog-desktop.webp?v=1");
}
@media (max-width: 860px) {
  #view-learn .chat {
    background-image: url("../assets/tutor-backgrounds/tutor-dialog-tablet.webp?v=1");
  }
  [data-theme="dark"] #view-learn .chat {
    background-image:
      linear-gradient(color-mix(in srgb, var(--bg-raise) 82%, transparent), color-mix(in srgb, var(--bg-raise) 82%, transparent)),
      url("../assets/tutor-backgrounds/tutor-dialog-tablet.webp?v=1");
  }
}
@media (max-width: 560px) {
  #view-learn .chat {
    background-image: url("../assets/tutor-backgrounds/tutor-dialog-mobile.webp?v=1");
  }
  [data-theme="dark"] #view-learn .chat {
    background-image:
      linear-gradient(color-mix(in srgb, var(--bg-raise) 82%, transparent), color-mix(in srgb, var(--bg-raise) 82%, transparent)),
      url("../assets/tutor-backgrounds/tutor-dialog-mobile.webp?v=1");
  }
}

/* ---------- Etyma 高级层 · 组件适配 ---------- */
/* 每日任务与档案图标（SVG 化） */
.q-ico { width: 30px; height: 30px; color: var(--clay); flex: none; }
.q-ico svg { width: 100%; height: 100%; }
.quest.ok .q-ico { color: var(--sage); }
.dw-flake { width: 26px; height: 26px; color: var(--clay); flex: none; }
.dw-flake svg { width: 100%; height: 100%; }
.dd-flake { width: 44px; height: 44px; color: var(--clay); margin: 0 auto 6px; }
.dd-flake svg { width: 100%; height: 100%; }
.ach-ico { width: 30px; height: 30px; color: var(--clay); margin: 0 auto; }
.ach-ico svg { width: 100%; height: 100%; }
.ach.locked .ach-ico { color: var(--ink-faint); }

/* 完成态印章（替代 emoji 的大字符）：衬线单字 + 陶土环 */
.finish-mark {
  width: 64px; height: 64px; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--clay); border-radius: 999px;
  color: var(--clay); font-family: var(--serif); font-size: 1.7rem; font-weight: 600;
}

/* 导师头像（生成肖像 + 字标兜底） */
.avatar.tutor-ava { position: relative; overflow: hidden; background: var(--ink); }
.avatar.tutor-ava .ava-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--bg); font-family: var(--serif); font-weight: 600;
}
.avatar.tutor-ava img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
}
/* 用户头像：登录后用登录头像，缺图/游客退回「你」字标 */
.avatar.user-ava { position: relative; overflow: hidden; }
.avatar.user-ava .ava-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .72rem;
}
.avatar.user-ava img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
}

/* 朗读按钮里的 SVG 对齐 */
.speak svg { vertical-align: -2px; }

/* ---------- 账户（GitHub 登录） ---------- */
.iconbtn.auth-ava { padding: 0; overflow: hidden; }
.iconbtn.auth-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }
.account-card {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-top: 28px; box-shadow: var(--shadow);
}
.ac-ava { width: 40px; height: 40px; border-radius: 999px; object-fit: cover; }
.ac-meta { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.ac-meta b { font-size: .95rem; }
.ac-meta span { color: var(--ink-soft); font-size: .82rem; }
.ac-actions { display: flex; gap: 8px; }

/* ---------------- 商城（学识集市） ---------------- */
.wallet-card {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-top: 28px; box-shadow: var(--shadow);
}
.wallet-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wallet-coin { display: flex; align-items: center; gap: 8px; color: var(--amber); }
.wallet-coin b { font-size: 1.6rem; font-family: var(--serif); color: var(--ink); }
.wallet-coin span { color: var(--ink-soft); font-size: .85rem; }
.wallet-streak { flex: 1; min-width: 180px; color: var(--ink-soft); font-size: .88rem; }
.wallet-streak b { color: var(--clay); }
.ck-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 16px; }
.ck-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-sink);
  padding: 8px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.ck-cell b { font-size: .95rem; color: var(--ink-soft); }
.ck-cell span { font-size: .7rem; color: var(--ink-faint); }
.ck-cell.done { background: var(--clay-bg); border-color: var(--clay-soft); }
.ck-cell.done b { color: var(--clay); }
.ck-cell.next { border-color: var(--clay); box-shadow: 0 0 0 1px var(--clay); }
.ck-cell.next b { color: var(--clay); }

/* 永久免费会员徽章 */
.unlimited-badge {
  margin-top: 14px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--clay-bg); border: 1px solid var(--clay-soft); color: var(--clay);
  font-size: .86rem; text-align: center; font-weight: 600;
}

/* 兑换码输入 */
.code-redeem { display: flex; gap: 8px; margin-top: 16px; }
.code-redeem input {
  flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg-sink); color: var(--ink);
  font-size: .9rem; letter-spacing: .5px;
}
.code-redeem input:focus { outline: none; border-color: var(--clay); }
.code-hint { margin-top: 8px; color: var(--ink-faint); font-size: .78rem; }
.code-hint b { color: var(--clay); }

/* 站长公告栏（商城） */
.announce-board { margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); box-shadow: var(--shadow); overflow: hidden; }
.ab-head { display: flex; align-items: center; gap: 7px; padding: 10px 16px; background: var(--bg-sink); color: var(--ink-soft); font-weight: 600; font-size: .82rem; border-bottom: 1px solid var(--line); }
.ab-item { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ab-item:last-child { border-bottom: none; }
.ab-item.pinned { background: var(--clay-bg); }
.ab-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ab-top b { color: var(--ink); }
.ab-pin { font-size: .66rem; font-weight: 700; color: #fff; background: var(--clay); border-radius: 999px; padding: 2px 8px; }
.ab-time { color: var(--ink-faint); font-size: .74rem; margin-left: auto; }
.ab-body { margin-top: 6px; color: var(--ink-soft); font-size: .88rem; line-height: 1.6; white-space: normal; }

/* 打折活动横幅 */
.promo-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin: 18px 0; padding: 12px 18px; border-radius: var(--radius);
  background: var(--clay-bg); border: 1px solid var(--clay-soft);
}
.promo-banner b { color: var(--clay); }
.promo-tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; color: #fff;
  background: var(--clay); border-radius: 999px; padding: 3px 10px;
}
.promo-sub { color: var(--ink-soft); font-size: .85rem; }
.price.sale s { color: var(--ink-faint); font-weight: 400; margin-right: 4px; }
.price.sale { color: var(--clay); }

/* 推广邀请块 */
.referral-box {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px dashed var(--clay-soft); background: var(--bg-sink);
}
.rf-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.rf-head b { color: var(--clay); }
.rf-head span { color: var(--ink-soft); font-size: .82rem; }
.rf-link { display: flex; gap: 8px; }
.rf-link input {
  flex: 1; min-width: 0; padding: 8px 10px; font-size: .82rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raise); color: var(--ink-soft);
}

/* 神秘库预告 */
.mystery-teaser {
  display: flex; align-items: flex-start; gap: 12px; margin-top: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-sink);
}
.mystery-teaser.on { border-color: var(--clay-soft); background: var(--clay-bg); }
.mystery-teaser .my-mark { color: var(--ink-soft); flex: none; }
.mystery-teaser.on .my-mark { color: var(--clay); }
.mystery-teaser .my-mark svg { width: 20px; height: 20px; display: block; }

/* ============ 站长功能箱 ============ */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; }
.astat { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.astat b { display: block; font-size: 1.5rem; color: var(--clay); }
.astat span { font-size: .8rem; color: var(--ink-soft); }
.admin-self { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; color: var(--ink-soft); font-size: .88rem; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .86rem; white-space: nowrap; }
.admin-table th, .admin-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--bg-sink); color: var(--ink-soft); font-weight: 600; font-size: .78rem; }
.admin-table tbody tr:hover { background: var(--bg-sink); }
.au-name b { display: block; } .au-name small { color: var(--ink-faint); font-size: .72rem; }
.au-coins b { color: var(--clay); }
.au-code { font-family: ui-monospace, monospace; }
.tag-used { color: var(--ink-faint); } .tag-free { color: var(--clay); font-weight: 600; }
.hc-plus { color: #2e9e5b; } .hc-minus { color: #c0492e; }
.au-meta { white-space: normal; color: var(--ink-soft); font-size: .78rem; max-width: 280px; }
.au-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 2px; white-space: normal; }
.au-ctrl label { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--ink-soft); }
.au-ctrl input { width: 92px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-raise); color: var(--ink); }
.au-ctrl .au-item { width: 130px; }
.au-sep { color: var(--line); }
.btn.sm.danger { color: #c0492e; border-color: #e2b3a8; }
.au-detail-box:not(:empty) { margin-top: 10px; padding: 10px 12px; background: var(--bg-sink); border-radius: 8px; font-size: .8rem; color: var(--ink-soft); white-space: normal; }
.au-detail-in b { color: var(--ink); }
.admin-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 20px 0; }
.atool { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.atool > b { display: block; margin-bottom: 10px; }
.atool-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.atool-row select, .atool-row input { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-sink); color: var(--ink); }
.atool-row input[type=number] { width: 84px; }
.atool-note { display: block; margin-top: 8px; color: var(--ink-faint); font-size: .76rem; line-height: 1.5; }
.atool #genResult { margin-top: 10px; }
.admin-search { margin: 12px 0; }
.admin-search input { width: 100%; max-width: 360px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raise); color: var(--ink); }
.atool-ta { width: 100%; margin-top: 8px; min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-sink); color: var(--ink); font: inherit; font-size: .84rem; resize: vertical; }
.atool-wide { grid-column: 1 / -1; margin-top: 4px; }
.ann-form { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.ann-form input[type=text] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-sink); color: var(--ink); }
.ann-pin { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-soft); }
.ann-list { display: flex; flex-direction: column; gap: 6px; }
.ann-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--bg-sink); border-radius: 8px; font-size: .84rem; }
.ann-row b { margin-right: 6px; }
.my-body { display: flex; flex-direction: column; gap: 3px; }
.my-body b { color: var(--ink); }
.mystery-teaser.on .my-body b { color: var(--clay); }
.my-body span { color: var(--ink-soft); font-size: .82rem; line-height: 1.5; }

/* 站长面板 */
.owner-panel {
  margin-top: 40px; padding: 22px 24px; border: 1px solid var(--clay-soft);
  border-radius: var(--radius); background: var(--bg-raise); box-shadow: var(--shadow);
}
.owner-head { margin-bottom: 18px; }
.owner-tag {
  display: inline-block; font-size: .72rem; letter-spacing: .06em; font-weight: 600;
  color: var(--clay); background: var(--clay-bg); border: 1px solid var(--clay-soft);
  padding: 3px 10px; border-radius: 999px;
}
.owner-head h3 { font-size: 1.15rem; margin: 12px 0 4px; }
.owner-sub { color: var(--ink-soft); font-size: .85rem; margin: 0; }
.owner-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.owner-field { display: flex; flex-direction: column; gap: 6px; }
.owner-field > span { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.owner-field select, .owner-field input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-sink); color: var(--ink); font-size: .9rem; height: 42px;
}
.owner-field select:focus, .owner-field input:focus { outline: none; border-color: var(--clay); }
.owner-field-count { width: 96px; }
.owner-field-count input { width: 100%; }
.owner-form .btn { height: 42px; }
.owner-result {
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.owner-out {
  width: 100%; min-height: 84px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-sink); color: var(--ink);
  font-family: ui-monospace, monospace; font-size: .92rem; line-height: 1.7;
  letter-spacing: .5px; resize: vertical;
}
@media (max-width: 560px) {
  .owner-panel { padding: 18px 16px; }
  .owner-form { gap: 10px; }
  .owner-field { flex: 1; min-width: 140px; }
  .owner-field-count { flex: 0 0 84px; width: 84px; }
  .owner-form .btn { width: 100%; }
}

.lottery-card {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-raise); border: 1px dashed var(--clay-soft); border-radius: var(--radius);
  padding: 16px 18px; margin-top: 16px;
}
.lot-meta { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.lot-meta > b { font-size: .95rem; }
.lot-meta span { color: var(--ink-soft); font-size: .84rem; }
.lot-result {
  width: 100%; text-align: center; font-family: var(--serif); font-size: 1.05rem;
  color: var(--clay); padding: 10px 0 2px; min-height: 1.6em;
}

.shop-cat-note { color: var(--ink-faint); font-size: .78rem; font-weight: 400; margin-left: 8px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.shop-item {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
  transition: .15s;
}
.shop-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.shop-item.owned { border-color: var(--sage); }
.si-head { display: flex; align-items: center; gap: 8px; }
.price {
  background: var(--clay-bg); color: var(--clay); font-size: .76rem; font-weight: 600;
  border-radius: 999px; padding: 3px 10px;
}
.price.free { background: var(--sage-bg); color: var(--sage); }
.owned-mark { background: var(--sage-bg); color: var(--sage); font-size: .74rem; border-radius: 999px; padding: 3px 10px; }
.special-mark { background: var(--bg-sink); color: var(--amber); font-size: .74rem; border-radius: 999px; padding: 3px 10px; }
.si-title { font-size: 1rem; font-family: var(--serif); }
.si-sub { color: var(--ink-faint); font-size: .78rem; }
.si-desc { color: var(--ink-soft); font-size: .85rem; line-height: 1.55; flex: 1; }
.si-act { margin-top: 6px; }
.btn.dl { display: inline-block; text-decoration: none; }

@media (max-width: 640px) {
  .ck-strip { gap: 5px; }
  .ck-cell { padding: 6px 2px; }
  .shop-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ---------------- 登录方式选择弹窗 ---------------- */
.login-modal {
  position: relative; width: min(360px, 92vw);
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-lg); text-align: center;
}
.login-modal h3 { margin: 6px 0 4px; font-family: var(--serif); }
.login-note { color: var(--ink-soft); font-size: .85rem; line-height: 1.55; margin-bottom: 18px; }
.login-opt {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 10px; padding: 11px 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .95rem; color: var(--ink); transition: .15s;
}
.login-opt:hover { border-color: var(--clay); background: var(--clay-bg); }

/* 顶部「登录」按钮：中性入口，点击弹 GitHub/Google 选择框 */
.iconbtn.login-text { width: auto; padding: 0 14px; gap: 6px; font-size: .9rem; }

/* 登录选择框：Google「需境外网络」提示 */
.login-opt .opt-hint { color: var(--ink-faint); font-size: .72rem; margin-left: 2px; }
.login-tip { color: var(--ink-faint); font-size: .76rem; margin-top: 14px; line-height: 1.5; }
