/* =========================================================================
   Little Explorer · 设计系统（七律）
   特色字体 / 70-20-10 语义色 / 纵深氛围 / 毛玻璃 / 弹簧微交互 / 无障碍
   注：所有 JS 依赖的 class 名均保留，仅增强视觉与交互。
   ========================================================================= */

:root {
  /* —— 字体（拒绝系统默认，辨识度高） —— */
  --font-display: "ZCOOL KuaiLe", "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", "PingFang SC", "ZCOOL KuaiLe", system-ui, sans-serif;

  /* —— 70-20-10 语义色 —— */
  --ink: #4a3f33;          /* 暖墨（正文） */
  --ink-soft: #6b5f50;
  --muted: #6b7884;        /* 次级文字（已满足 ≥4.5:1） */
  --accent: #ff8a4c;       /* 主色 暖橙 ≈20% */
  --accent-d: #e9702f;
  --accent-2: #54bce0;     /* 次色 天蓝 */
  --accent-2-d: #2f9ecb;
  --good: #5cc06a;
  --gold: #ffce5a;

  /* —— 表面（暖白，非纯白） —— */
  --surface: #fffdf8;
  --surface-2: #fff6ea;
  --glass: rgba(255, 255, 255, .55);

  --radius: 28px;
  --tap: 92px;
  --shadow-sm: 0 4px 14px rgba(90, 120, 140, .14);
  --shadow: 0 10px 30px rgba(80, 110, 130, .16), 0 2px 6px rgba(80, 110, 130, .10);
  --shadow-pop: 0 16px 36px rgba(255, 138, 76, .30);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  display: flex; flex-direction: column;
  overscroll-behavior: none;
  /* 氛围背景：暖光从顶部洒下，天蓝过渡，草绿收尾（禁止纯白/纯灰平铺） */
  background:
    radial-gradient(120% 80% at 50% -12%, #fff3d6 0%, rgba(255, 243, 214, 0) 46%),
    radial-gradient(140% 100% at 50% 122%, #e7f6e6 0%, rgba(231, 246, 230, 0) 50%),
    linear-gradient(180deg, #eaf4fb 0%, #f3f8fb 56%, #eef7ee 100%);
  background-attachment: fixed;
}

/* ============================== 顶栏（毛玻璃） ============================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 8px 26px rgba(86, 116, 138, .14), inset 0 1px 0 rgba(255, 255, 255, .75);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 21px; color: var(--accent-d);
  letter-spacing: .4px;
}
.brand .leaf { font-size: 22px; filter: drop-shadow(0 2px 3px rgba(255, 138, 76, .4)); }
.roles { display: flex; gap: 8px; }
.role-btn {
  border: none; background: #eef4f8; color: var(--muted);
  padding: 9px 14px; border-radius: 16px; font-size: 14px; font-weight: 800; cursor: pointer;
  font-family: var(--font-body); transition: transform .25s, background .25s;
}
.role-btn:hover { transform: translateY(-1px); }
.role-btn.active { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-d); }

main { flex: 1; overflow: auto; padding: 14px; }
.view { display: none; max-width: 760px; margin: 0 auto; }
.view.active { display: block; animation: viewin .4s ease; }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================== 引导角色 Zing（圆形徽章） ============================== */
.guide { display: flex; flex-direction: column; align-items: center; margin: 4px 0 2px; }
.guide-face {
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(255, 217, 191, .55);
  padding: 7px;
}
.zing-guide {
  width: 100%; height: 100%; object-fit: contain; border-radius: 50%;
  animation: float 3s ease-in-out infinite;
}
.zing-happy { animation: pop .5s ease, float 3s ease-in-out infinite .5s; }
.zing-puzzle { animation: wobble .6s ease, float 3s ease-in-out infinite .6s; }
.zing-think { animation: float 1.4s ease-in-out infinite; }
.guide-face.happy .zing-guide { animation: pop .5s ease, float 3s ease-in-out infinite .5s; }
.guide-face.puzzle .zing-guide { animation: wobble .6s ease, float 3s ease-in-out infinite .6s; }
.guide-face.think .zing-guide { animation: float 1.4s ease-in-out infinite; }
.guide-bubble {
  position: relative; margin-top: 10px; background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 9px 18px; border-radius: 18px;
  font-family: var(--font-display); font-size: 17px; font-weight: 400; color: #b07a3a;
  box-shadow: var(--shadow-sm); max-width: 92%;
}
.guide-bubble::before {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-bottom-color: rgba(255, 255, 255, .7); border-top: 0;
}

/* 通用指令大字 */
.instruction {
  text-align: center; font-family: var(--font-display); font-size: 27px; font-weight: 400;
  margin: 10px 0; letter-spacing: .3px; min-height: 36px; color: #4a423a;
}

/* ============================== 按钮（弹簧手感） ============================== */
.ctrls { display: flex; gap: 10px; justify-content: center; margin: 14px 0 10px; flex-wrap: wrap; }
.ctl {
  border: none; background: var(--accent-2); color: #fff; font-size: 16px; font-weight: 800;
  font-family: var(--font-body); padding: 13px 20px; border-radius: 18px; cursor: pointer;
  min-height: 52px; box-shadow: 0 5px 0 var(--accent-2-d);
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1), box-shadow .12s, filter .2s;
}
.ctl:hover { filter: brightness(1.04); }
.ctl:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-2-d); }
.ctl-alt { background: #ffd79a; color: #8a5a1a; box-shadow: 0 5px 0 #e9b46a; }
.ctl-alt:active { box-shadow: 0 1px 0 #e9b46a; }
.primary-ctl {
  border: none; background: var(--accent); color: #fff; font-weight: 800;
  font-family: var(--font-body); padding: 13px 24px; border-radius: 18px; cursor: pointer;
  box-shadow: 0 5px 0 var(--accent-d); font-size: 16px;
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1), box-shadow .12s, filter .2s;
}
.primary-ctl:hover { filter: brightness(1.04); }
.primary-ctl:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-d); }

/* ============================== 藏宝图（学生端） ============================== */
.map { width: 100%; max-width: 720px; margin: 6px auto 0; position: relative; }
.map-svg {
  width: 100%; height: auto; display: block; border-radius: 24px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .4);
  background: linear-gradient(180deg, #cdeaf6 0%, #a9d9ec 100%);
}
.map-path { fill: none; stroke: #ff9a6c; stroke-width: 5; stroke-dasharray: 2 14; stroke-linecap: round; opacity: .85; }
.map-node { cursor: pointer; }
.node-halo { fill: #fff3e6; transition: fill .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1); transform-box: fill-box; transform-origin: center; }
.node-badge { fill: var(--surface); stroke: #ffd9bf; stroke-width: 3; transition: stroke .3s; }
.node-ring { fill: none; stroke: #ff8a5c; stroke-width: 0; transition: stroke-width .3s; }
.map-node:hover .node-halo { transform: scale(1.06); }
.map-node:focus-visible { outline: none; }
.map-node:focus-visible .node-ring { stroke-width: 6; }
.map-node.next .node-ring { stroke-width: 6; animation: pulse 1.5s ease-in-out infinite; }
.map-node.done .node-halo { fill: #e7f6df; }
.map-node.done .node-badge { stroke: #bfe6b0; }
.node-zing { pointer-events: none; }
.node-name { font-family: var(--font-display); font-size: 17px; font-weight: 400; fill: #6b4f23; text-anchor: middle; }
.node-sub { font-size: 11px; fill: #8a6a38; text-anchor: middle; letter-spacing: .3px; font-weight: 700; }
@keyframes pulse { 0%, 100% { stroke-opacity: .25; } 50% { stroke-opacity: 1; } }

.wave { fill: none; stroke: #7fb8d6; stroke-width: 3; stroke-linecap: round; opacity: .5; }
.rock path { stroke-linejoin: round; }
.compass .comp-bg { fill: #fff7e6; }
.compass .comp-ring { fill: none; stroke: #ffb98c; stroke-width: 3; }
.comp-n { font-size: 13px; font-weight: 900; fill: #b5683f; text-anchor: middle; }
.zing-boat { opacity: .96; }
.map-chest { opacity: .96; }

/* 加载 / 空状态 */
.map-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 280px; text-align: center; }
.map-loading.hidden { display: none; }
.map-loading-zing, .map-empty-zing {
  width: 118px; height: 118px; border-radius: 50%;
  background: var(--surface) url(../img/zing.png) center / 74% no-repeat;
  border: 5px solid #ffd9bf; box-shadow: var(--shadow); animation: float 1.6s ease-in-out infinite;
}
.map-loading-text, .map-empty p { color: var(--muted); font-weight: 700; margin-top: 14px; }
.map-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 280px; text-align: center; padding: 40px 20px; }
.map-empty p { max-width: 320px; line-height: 1.7; }

/* ============================== 闯关页（天空花园 · 记忆点） ============================== */
.play-view { position: relative; min-height: 70vh; }
.play-atmos { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: var(--radius); pointer-events: none;
  background:
    radial-gradient(120% 75% at 84% 6%, rgba(255, 226, 150, .55) 0%, rgba(255, 226, 150, 0) 44%),
    linear-gradient(180deg, #aee3ff 0%, #cdeffb 38%, #eaf4ec 72%, #dff1d6 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 2px 18px rgba(255, 255, 255, .5);
}
.at-sun { position: absolute; top: 14px; right: 42px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 231, 158, .95) 0%, rgba(255, 210, 63, .4) 44%, transparent 70%);
  filter: blur(2px); animation: sunPulse 7s ease-in-out infinite; }
.at-ray { position: absolute; inset: -30% -10% auto; height: 120%; width: 120%; left: -10%; top: -25%;
  background: conic-gradient(from 90deg at 84% 8%,
    rgba(255, 240, 190, 0) 0deg, rgba(255, 240, 190, .20) 14deg, rgba(255, 240, 190, 0) 30deg,
    rgba(255, 240, 190, 0) 60deg, rgba(255, 240, 190, .14) 76deg, rgba(255, 240, 190, 0) 92deg);
  mix-blend-mode: screen; opacity: .7; animation: raySpin 90s linear infinite; transform-origin: 84% 8%; }
.at-cloud { position: absolute; background: #fff; border-radius: 50%; filter: blur(7px); opacity: .85; }
.at-c1 { width: 150px; height: 56px; top: 56px; left: -160px; animation: drift 44s linear infinite; }
.at-c2 { width: 104px; height: 42px; top: 132px; left: -130px; opacity: .7; animation: drift 58s linear infinite 7s; }
.at-c3 { width: 180px; height: 64px; top: 28px; left: -200px; opacity: .55; animation: drift 74s linear infinite 14s; }
.at-haze { position: absolute; left: 0; right: 0; bottom: 0; height: 130px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .30) 100%); }
/* 内容浮于氛围之上 */
.play-view > *:not(.play-atmos) { position: relative; z-index: 1; }

/* 单词视觉卡（材质体积） */
.word-visual {
  width: 132px; height: 132px; margin: 8px auto; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, #fff3e2 100%);
  border-radius: 26px; box-shadow: var(--shadow), inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 217, 191, .5);
  position: relative;
}
.word-visual::after { content: ""; position: absolute; inset: 0; border-radius: 26px;
  background: radial-gradient(80% 60% at 32% 26%, rgba(255, 255, 255, .7) 0%, transparent 60%); pointer-events: none; }
.word-visual svg, .word-visual img { width: 100px; height: 100px; object-fit: contain; position: relative; }
.word-visual .emoji { font-size: 66px; }

/* 句子 + 核心词高亮（弹性质感） */
.sentence {
  font-family: var(--font-display); font-size: 30px; line-height: 1.5; font-weight: 400;
  text-align: center; color: #3a4a55; padding: 16px 18px; min-height: 80px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.sentence .kw {
  display: inline-block; color: #fff; background: linear-gradient(180deg, #ff9f5e, var(--accent));
  border: 0; border-radius: 12px; padding: 1px 10px; margin: 0 2px;
  box-shadow: 0 4px 0 var(--accent-d), inset 0 1px 0 rgba(255, 255, 255, .4);
  transform: rotate(-1.5deg); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.sentence .kw:hover { transform: rotate(0) scale(1.06); }
.play-count {
  text-align: center; color: var(--muted); font-weight: 800; margin: 4px 0 8px; font-size: 14px;
  letter-spacing: .3px;
}

/* ============================== 过关宝箱庆祝 ============================== */
#view-play { position: relative; }
.chest-box { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 60; }
.chest-box.hidden { display: none; }
.chest { width: 150px; height: 140px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .2)); transform: scale(.4); opacity: 0; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), opacity .4s ease; }
.chest-box:not(.hidden) .chest { transform: scale(1); opacity: 1; }
.chest-lid { transform-box: fill-box; transform-origin: 0% 100%; transition: transform .6s ease .25s; }
.chest.open .chest-lid { transform: rotate(-62deg); }
.chest-glow { position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 224, 138, .85) 0%, rgba(255, 224, 138, 0) 70%); animation: glowpulse 1.2s ease-out infinite; }
.chest-label { margin-top: 10px; font-family: var(--font-display); font-size: 22px; font-weight: 400; color: #c0792b; text-shadow: 0 2px 0 #fff; }
@keyframes glowpulse { 0%, 100% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.1); opacity: .95; } }

/* ============================== 家长端 ============================== */
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { font-family: var(--font-display); font-size: 23px; font-weight: 400; color: var(--ink); }
.report { background: var(--surface); border-radius: 18px; padding: 16px; margin: 10px 0; box-shadow: var(--shadow); }
.report h3 { font-family: var(--font-display); font-weight: 400; margin: 14px 0 6px; font-size: 17px; }
.report .stat { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #eef3f6; font-weight: 600; }
.bar { height: 10px; border-radius: 6px; background: linear-gradient(180deg, var(--accent-2), var(--accent-2-d)); display: inline-block; vertical-align: middle; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding: 8px 0; }
.tbar { flex: 1; min-width: 10px; background: linear-gradient(180deg, #7ec8e3, #3a9ecb); border-radius: 6px 6px 0 0; }

button.primary { border: none; background: var(--accent); color: #fff; font-weight: 800; padding: 12px 20px; border-radius: 16px; cursor: pointer; box-shadow: 0 4px 0 var(--accent-d); font-family: var(--font-body); }
button.ghost { border: 2px solid #e3edf2; background: #fff; color: var(--muted); padding: 12px 18px; border-radius: 16px; cursor: pointer; font-family: var(--font-body); font-weight: 700; }
.row { display: flex; gap: 10px; margin: 10px 0; }

/* ============================== 特效 ============================== */
.spark { position: absolute; width: 13px; height: 13px; border-radius: 50%; pointer-events: none; animation: sparkfade .8s ease forwards; }
.confetti { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; animation: confetti-fall 1.5s ease-in forwards; }
.ripple { position: absolute; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; animation: ripple-expand .6s ease-out forwards; }

/* ============================== 家长门禁 ============================== */
.gate-btn {
  position: fixed; left: 10px; bottom: 10px; z-index: 30;
  border: none; background: rgba(255, 255, 255, .6); color: #b3a48f;
  font-size: 12px; font-weight: 800; padding: 8px 12px; border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08); cursor: pointer; font-family: var(--font-body);
  transition: transform .2s;
}
.gate-btn:hover { transform: translateY(-1px); }
.gate-btn:active { transform: scale(.96); }

/* ============================== 教师后台（独立入口） ============================== */
.teacher-body { background: radial-gradient(120% 80% at 50% 0%, #e8f3fb 0%, #f3f7fb 60%); }
.back-link { font-size: 14px; font-weight: 800; color: var(--muted); text-decoration: none; }
.teacher-wrap { max-width: 820px; margin: 0 auto; padding-bottom: 30px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin: 14px; box-shadow: var(--shadow); }
.card h2 { font-size: 19px; margin: 4px 0 8px; }

.primary-card { border: 2px solid #ff9a6c; background: #fffdfb; }
.current-badge { display: inline-block; font-size: 12px; font-weight: 800; color: #fff; background: #ff8a5c; border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }
.lv-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.lv-stats span { font-size: 13px; font-weight: 700; color: #6b4f23; background: #fff3e8; border: 1px solid #ffd9bf; border-radius: 999px; padding: 3px 12px; }

.set-block { padding: 12px 0; border-top: 1px dashed #e7d8c4; }
.set-block:first-of-type { border-top: none; padding-top: 4px; }
.sub-h { font-size: 15px; margin: 4px 0 6px; color: #8a5326; font-family: var(--font-body); font-weight: 800; }
.add-word-row input { flex: 1; min-width: 160px; }
.preview { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.pv-cell { width: 98px; padding: 8px 6px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pv-thumb { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; }
.pv-thumb svg, .pv-thumb img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; }
.pv-thumb .emoji { font-size: 38px; }
.pv-label { font-size: 12px; font-weight: 800; color: var(--muted); }
.pv-source { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.src-upload { background: #e6f6ec; color: #2e9e5b; }
.src-system { background: #eaf1fb; color: #3a6fb0; }
.src-emoji { background: #f3eef9; color: #8a5fc0; }
.src-generated { background: #e6f0ff; color: #3a6fd0; }
.pv-upload, .pv-clear { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 10px; cursor: pointer; border: 2px solid #e3edf2; background: #fff; color: var(--muted); }
.pv-clear { border-color: #f3d3d3; color: #c23b54; }
.spec-note { background: #fff8ec; border: 1px solid #f3e2bf; border-radius: 14px; padding: 10px 12px; font-size: 13px; color: #8a6d3b; line-height: 1.6; margin: 6px 0 4px; }
.spec-note b { color: #6b4f23; }
.set-row { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.set-row label { font-size: 13px; font-weight: 800; color: #6b7b86; }
.set-row input { border-radius: 12px; border: 2px solid #e3edf2; padding: 10px; font-size: 15px; font-family: inherit; background: #fff; }

textarea { width: 100%; border-radius: 16px; border: 2px solid #e3edf2; padding: 12px; font-size: 16px; resize: vertical; font-family: inherit; background: #fff; }

/* 关卡管理（主从布局） */
.lv-layout { display: flex; gap: 16px; align-items: flex-start; }
.lv-left { width: 38%; min-width: 220px; }
.lv-right { flex: 1; background: #fafdff; border-radius: 16px; padding: 14px; box-shadow: inset 0 0 0 2px #e7eef5; }
.lv-list { margin-top: 10px; }
.lv-item { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; border: 2px solid transparent; }
.lv-item:hover { border-color: #cfe6f2; }
.lv-item.active { border-color: var(--accent); background: #eef8fd; }
.lv-name { font-weight: 800; flex: 1; }
.lv-diff { font-size: 12px; font-weight: 700; color: #e08a2b; background: #fff3e2; border-radius: 8px; padding: 2px 8px; }
.lv-count { color: var(--muted); font-size: 13px; font-weight: 700; }
.lv-file { display: inline-flex; align-items: center; }
.lv-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lv-detail-head h3 { margin: 0; font-family: var(--font-display); font-weight: 400; }
.d-items { margin-top: 10px; }
.d-item { background: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.d-item-top { display: flex; gap: 8px; align-items: center; }
.d-text { flex: 1; border-radius: 10px; border: 2px solid #e3edf2; padding: 8px; font-size: 15px; font-family: inherit; }
.d-item .btn-ghost { padding: 6px 10px; font-size: 13px; }
.d-words { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kw-chip { display: inline-flex; align-items: center; gap: 4px; background: #fff6e6; border: 1px solid #f0d9a8; border-radius: 999px; padding: 2px 8px; font-size: 13px; font-weight: 700; color: #9a6b1e; }
.kw-x { border: none; background: transparent; color: #c0392b; font-weight: 800; cursor: pointer; font-size: 14px; line-height: 1; }

/* 句子内联资源编辑（合并原模块2：核心词配图 + 发音） */
.d-resources { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.res-card { width: 132px; padding: 8px 6px; background: #fbfdff; border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid #e7eef5; }
.res-thumb { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; }
.res-thumb svg, .res-thumb img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; }
.res-thumb .emoji { font-size: 38px; }
.res-word { font-size: 13px; font-weight: 800; color: var(--muted); }
.res-status { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.res-status.src-upload { background: #e6f6ec; color: #2e9e5b; }
.res-status.src-system { background: #eaf1fb; color: #3a6fb0; }
.res-status.src-emoji { background: #f3eef9; color: #8a5fc0; }
.res-status.src-generated { background: #e6f0ff; color: #3a6fd0; }
.res-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 2px; }
.res-actions .btn-ghost { font-size: 11px; font-weight: 700; padding: 4px 7px; border-radius: 10px; cursor: pointer; border: 2px solid #e3edf2; background: #fff; color: var(--muted); }
.res-actions .res-clearimg, .res-actions .res-clearaudio { border-color: #f3d3d3; color: #c23b54; }
.res-actions .res-rec { border-color: #d9e8cf; color: #4e8b3a; }
.kw-up { cursor: pointer; margin-left: 2px; }
.d-addword { border-radius: 10px; border: 2px dashed #e3edf2; padding: 5px 8px; font-size: 13px; width: 120px; font-family: inherit; }

/* 复用弹窗 */
.modal { position: fixed; inset: 0; background: rgba(40, 50, 60, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.hidden { display: none; }
.modal-card { background: #fff; border-radius: 18px; padding: 18px; max-width: 480px; width: 100%; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.reuse-body { max-height: 50vh; overflow: auto; margin: 10px 0; }
.reuse-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid #f0f3f6; font-size: 14px; }

/* ============================== 场景 / 物体（预留给拖拽原型复用） ============================== */
.scene { position: relative; min-height: 440px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sky { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% -10%, #fff7e0 0%, transparent 60%); }
.sun-deco { position: absolute; top: 18px; right: 22px; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle, #ffe08a 0%, #ffd23f 70%); box-shadow: 0 0 22px #ffd23f99; animation: float 4s ease-in-out infinite; }
.hill { position: absolute; left: -10%; right: -10%; bottom: 0; border-radius: 50% 50% 0 0; }
.hill-back { height: 180px; background: #cdeec0; bottom: 90px; }
.hill-front { height: 150px; background: #bfe6ad; }
.blanket { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 62%; height: 120px; border-radius: 18px;
  background: repeating-linear-gradient(45deg, #ff9aa2 0 16px, #ffd6da 16px 32px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .25) 0 16px, transparent 16px 32px);
  background-blend-mode: overlay; box-shadow: 0 8px 0 rgba(0, 0, 0, .08), inset 0 0 0 4px rgba(255, 255, 255, .45);
  display: flex; align-items: center; justify-content: center; transition: box-shadow .3s, transform .3s; }
.blanket.glow { box-shadow: 0 0 0 5px #fff, 0 0 26px 6px #ffe08a, inset 0 0 0 4px rgba(255, 255, 255, .6); }
.blanket .label { font-size: 13px; font-weight: 800; color: #c0392b; opacity: .65; }
.picnic { position: absolute; inset: 0; }
.picnic .item { position: absolute; width: 42px; height: 42px; animation: bloom .5s ease; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .12)); }
.basket { position: absolute; right: 16px; bottom: 16px; font-size: 42px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .15)); }

.objects { position: absolute; left: 0; right: 0; top: 60px; bottom: 150px; display: flex; flex-wrap: wrap; gap: 18px; align-content: center; justify-content: center; padding: 10px; }
.obj { width: var(--tap); height: var(--tap); border-radius: 22px; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; cursor: grab; user-select: none; touch-action: none; animation: bob 2.6s ease-in-out infinite; }
.obj svg { width: 76px; height: 76px; pointer-events: none; }
.obj img { width: 72px; height: 72px; object-fit: contain; pointer-events: none; border-radius: 12px; }
.obj .emoji { font-size: 56px; line-height: var(--tap); }
.obj:nth-child(2n) { animation-delay: .4s; }
.obj:nth-child(3n) { animation-delay: .9s; }
.obj.dragging { animation: none; cursor: grabbing; transform: scale(1.12); box-shadow: 0 14px 26px rgba(80, 110, 130, .3); z-index: 40; }
.obj.pop { animation: pop .45s ease; }
.obj.wobble { animation: wobble .5s ease; }
.obj.fly { transition: transform .7s cubic-bezier(.4, 1.3, .5, 1), opacity .7s ease; }
.hint { text-align: center; color: var(--muted); margin-top: 10px; font-size: 14px; font-weight: 600; }

/* ============================== 关键帧 ============================== */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-13deg); } 75% { transform: rotate(13deg); } }
@keyframes bloom { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes sparkfade { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes confetti-fall { 0% { opacity: 1; top: -20px; } 100% { opacity: 0; top: 80%; } }
@keyframes ripple-expand { 0% { width: 14px; height: 14px; opacity: .9; } 100% { width: 90px; height: 90px; opacity: 0; } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(1180px); } }
@keyframes sunPulse { 0%, 100% { opacity: .8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes raySpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ============================== 无障碍 ============================== */
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 8px; }
.gate-btn:focus-visible, .ctl:focus-visible, .primary-ctl:focus-visible, .role-btn:focus-visible, .lv-item:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .at-ray, .at-sun, .at-cloud { display: none; }
  .zing-guide { animation: none !important; }
}

/* ============================== 响应式 ============================== */
@media (max-width: 480px) {
  :root { --tap: 78px; }
  .instruction { font-size: 22px; }
  .scene { min-height: 380px; }
  .obj svg { width: 60px; height: 60px; }
  .sentence { font-size: 26px; }
}
@media (max-width: 720px) {
  .lv-layout { flex-direction: column; }
  .lv-left, .lv-right { width: 100%; }
}
