/* ==========================================================================
   非码 · AI 素养创造中心
   设计基调：明亮的纸张底色 + 大字号 + 圆润卡片 + 彩色素养标识。
   目标用户：小学 2 年级 – 初中 3 年级。所有正文不小于 15.5px，控件不小于 44px。
   ========================================================================== */

:root {
  /* 主色：靛蓝，稳但不冷；强调色：珊瑚橙，用于「去做」的动作 */
  --brand: #5b5bd6;
  --brand-strong: #4640c4;
  --brand-deep: #34309c;
  --brand-soft: #eeecff;
  --brand-line: #d8d4ff;

  --accent: #ff7a45;
  --accent-strong: #f0622a;
  --accent-soft: #fff0e8;

  --sun: #ffc53d;
  --sun-soft: #fff8e3;
  --mint: #17bd92;
  --mint-soft: #e4faf3;
  --sky: #38a3f5;
  --sky-soft: #e8f4ff;
  --pink: #ff6fa5;
  --pink-soft: #ffedf4;
  --grape: #a855f7;
  --grape-soft: #f6ecff;
  --green: #57b32c;
  --green-soft: #f0f9e8;

  --ink: #241f3d;
  --ink-2: #4c4670;
  --ink-3: #7a749b;
  --ink-4: #a8a3c2;

  --bg: #f7f4ff;
  --surface: #ffffff;
  --surface-2: #fbf9ff;
  --surface-3: #f2effc;
  --line: #ebe6fa;
  --line-strong: #dcd5f2;

  --ok: #17a673;
  --warn: #e08a00;
  --danger: #e05252;
  --danger-soft: #fdeeee;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(46, 32, 92, .05);
  --shadow-sm: 0 2px 6px rgba(46, 32, 92, .05), 0 12px 28px -18px rgba(46, 32, 92, .3);
  --shadow-md: 0 16px 40px -22px rgba(46, 32, 92, .35);
  --shadow-pop: 0 30px 70px -30px rgba(36, 24, 80, .45);

  --rail-w: 264px;
  --rail-w-narrow: 212px;
  --rail-w-collapsed: 84px;
  --rail-icons: 64px;
  --topbar-h: 72px;

  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", -apple-system,
    BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.3; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); color: var(--brand-deep); }

* { scrollbar-width: thin; scrollbar-color: #d8d2ef transparent; }
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-thumb { background: #ded8f2; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #c9c0e8; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 启动态 */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: radial-gradient(900px 500px at 50% 20%, #efeaff, transparent 65%), var(--bg);
  z-index: 200;
}
.boot-mark {
  width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center;
  font-size: 38px; color: #fff;
  background: linear-gradient(140deg, #7c6cff, #4b45c9);
  box-shadow: 0 18px 34px -16px rgba(91, 91, 214, .8);
  animation: breathe 1.8s ease-in-out infinite;
}
.boot-text { color: var(--ink-3); font-size: 15px; letter-spacing: .02em; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.93); opacity: .8; } }

/* 模块未开通：沿用启动屏的位置，但不再"呼吸"，它不是一个加载态 */
.boot-blocked {
  max-width: 480px; padding: 0 26px; text-align: center;
}
.boot-blocked-mark {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: var(--brand-deep, #4b45c9);
  background: var(--brand-soft, #eeecff);
}
.boot-blocked h1 { margin: 0 0 10px; font-size: 20px; color: var(--ink); }
.boot-blocked p { margin: 0 0 8px; font-size: 15px; line-height: 1.7; color: var(--ink-3); }
.boot-blocked-btn {
  display: inline-flex; align-items: center; margin-top: 14px; padding: 10px 22px;
  border-radius: 12px; background: var(--brand, #5b5bd6); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 15px;
}
.boot-blocked-wrap { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 200; }

/* ---------------------------------------------------------------- 骨架 */
.app {
  display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr);
  height: 100vh; height: 100dvh; overflow: hidden;
}
.app.is-collapsed { grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr); }

/* ---------------------------------------------------------------- 侧栏 */
.rail {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border-right: 1px solid var(--line);
  padding: 16px 14px 14px; overflow: hidden; position: relative; z-index: 20;
}
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; min-height: 58px; }
.brand-mark {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; font-size: 22px;
  background: linear-gradient(140deg, #7c6cff, #4b45c9);
  box-shadow: 0 10px 20px -12px rgba(91, 91, 214, .95);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; white-space: nowrap; }
.brand-text strong { font-size: 18px; font-weight: 800; letter-spacing: .01em; }
.brand-text span { font-size: 12px; color: var(--ink-3); letter-spacing: .02em; }

.rail-group { margin-top: 10px; }
.rail-label {
  font-size: 12px; color: var(--ink-4); letter-spacing: .08em; font-weight: 600;
  padding: 6px 12px 8px; white-space: nowrap;
}
.rail-item {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 12px;
  border-radius: 16px; color: var(--ink-2); font-weight: 600; font-size: 15px; white-space: nowrap;
  position: relative; transition: background .16s, color .16s, transform .16s;
}
.rail-item svg { flex: 0 0 22px; width: 22px; height: 22px; stroke-width: 1.8; }
.rail-item:hover { background: var(--surface-3); color: var(--ink); }
.rail-item.is-active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.rail-item.is-active::before {
  content: ""; position: absolute; left: -14px; top: 13px; bottom: 13px; width: 4px;
  background: var(--brand); border-radius: 0 4px 4px 0;
}
.rail-item .rail-count {
  margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--ink-3);
  background: var(--surface-3); border-radius: 99px; padding: 2px 8px; min-width: 24px; text-align: center;
}
.rail-item.is-active .rail-count { background: #fff; color: var(--brand-deep); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-user {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px;
  transition: background .15s; text-align: left; width: 100%;
}
.rail-user:hover { background: var(--surface-3); }
.rail-user .avatar { flex: 0 0 38px; }
.rail-user-meta { display: flex; flex-direction: column; overflow: hidden; }
.rail-user-meta b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user-meta small { font-size: 12.5px; color: var(--ink-3); }

/* 收起态（只剩图标）——只在「能并排」的宽度下成立。
   窄屏那边导航是抽屉，抽屉里必须带文字，所以这条规则被 media 挡住，
   不再出现「窗口一窄，标签就被 display:none 砍掉」的情况。 */
@media (min-width: 681px) {
  .app.is-collapsed .brand-text,
  .app.is-collapsed .rail-label,
  .app.is-collapsed .rail-item span,
  .app.is-collapsed .rail-item .rail-count,
  .app.is-collapsed .rail-user-meta { display: none; }
  .app.is-collapsed .rail-item { justify-content: center; padding: 0; }
  .app.is-collapsed .rail-user { justify-content: center; }
  /* button 默认 fit-content，撑满才能让高亮块对齐成一条 */
  .app.is-collapsed .rail-item,
  .app.is-collapsed .rail-user { width: 100%; }
}

/* ---- 沉浸创作：进入绘本/音乐/游戏后，左侧导航默认收成一条「图标栏」，
   图标始终可见（孩子不至于找不到入口）。顶栏 ☰ 展开完整抽屉（覆盖式，
   不挤压画布）。≤680px 屏幕太窄，仍是覆盖抽屉，规则在文件后部。 ---- */
.app.is-immersive { grid-template-columns: var(--rail-icons) minmax(0, 1fr); }
/* 抽屉展开时脱离栅格，画布拿回全部宽度 */
.app.is-immersive.rail-open { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 681px) {
  .app.is-immersive .rail {
    position: relative; transform: none; box-shadow: none; z-index: 20;
    transition: none;
  }
  /* 默认：图标条。只藏文字与计数，图标一律保留 —— 与 is-collapsed 同一套口径 */
  .app.is-immersive:not(.rail-open) .rail { padding: 16px 8px 14px; }
  .app.is-immersive:not(.rail-open) .brand-text,
  .app.is-immersive:not(.rail-open) .rail-label,
  .app.is-immersive:not(.rail-open) .rail-item span,
  .app.is-immersive:not(.rail-open) .rail-item .rail-count,
  .app.is-immersive:not(.rail-open) .rail-user-meta { display: none; }
  .app.is-immersive:not(.rail-open) .rail-item { justify-content: center; padding: 0; }
  /* button 的 width:auto 是 fit-content，不给 100% 就只有图标那么宽，
     高亮块会缩成一个小方块，看着像没对齐 */
  .app.is-immersive:not(.rail-open) .rail-item,
  .app.is-immersive:not(.rail-open) .rail-user { width: 100%; }
  .app.is-immersive:not(.rail-open) .rail-item.is-active::before { left: -8px; }
  .app.is-immersive:not(.rail-open) .rail-brand { justify-content: center; padding: 4px 0 18px; }
  .app.is-immersive:not(.rail-open) .rail-user { justify-content: center; }
  /* rail-open：完整抽屉覆盖展开，文字全部回来 */
  .app.is-immersive.rail-open .rail {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--rail-w);
    padding: 16px 14px 14px; z-index: 60;
    box-shadow: 0 0 60px -12px rgba(30, 20, 60, .45);
  }
}
.rail-backdrop {
  display: none; position: fixed; inset: 0; z-index: 55;
  background: rgba(24, 16, 44, .38);
}
/* 抽屉开着就有遮罩：沉浸创作与极窄屏共用同一条规则 */
.app.rail-open .rail-backdrop { display: block; }
.rail-handle {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  width: 13px; height: 78px; border-radius: 0 12px 12px 0; background: #fff;
  border: 1.5px solid var(--line); border-left: 0; z-index: 50;
  display: none; place-items: center; color: var(--ink-3); transition: width .15s, color .15s;
}
/* 沉浸模式图标条常驻，左缘把手不再需要（≤680px 的抽屉模式会在后面重新打开它） */
.app.is-immersive .rail-handle { display: none; }
.rail-handle:hover { width: 22px; color: var(--brand); }
.rail-handle::before { content: "›"; font-size: 15px; font-weight: 800; }

/* ---------------------------------------------------------------- 主区 */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  /* 不用 backdrop-filter：iOS Safari 上固定顶栏做毛玻璃，滚动时每帧重算，明显掉帧 */
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line); z-index: 15;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-3); min-width: 0; }
.crumbs b { color: var(--ink); font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--ink-4); }
.topbar-spacer { flex: 1; }

/* 返回主站门户。与「工作台」不是同一层：那是创作台内部路由，
   这里是离开本站。所以做成外链样式的描边按钮，靠左于搜索框，视觉上不抢注意力。 */
.topbar-home {
  display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  color: var(--ink-2); font-size: 14.5px; font-weight: 600; white-space: nowrap;
  text-decoration: none; flex: 0 0 auto; transition: .15s;
}
.topbar-home:hover { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand); }
.topbar-home svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
  /* 窄屏只留图标：顶栏还有搜索框和积分，文字版会把它们挤掉 */
  .topbar-home .lbl { display: none; }
  .topbar-home { padding: 0 11px; }
}

.search-trigger {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 14px;
  width: min(300px, 30vw); border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--ink-3); font-size: 14.5px; transition: .15s;
}
.search-trigger:hover { border-color: var(--brand-line); background: #fff; }
.search-trigger kbd {
  margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px;
}
.points-chip {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: 14px; background: var(--sun-soft); color: #8a5a00; font-weight: 700; font-size: 14.5px;
  border: 1.5px solid #ffe8a8; white-space: nowrap; flex: 0 0 auto;
}
.points-chip svg { color: #d99400; }
.points-chip b { font-size: 19px; font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  color: var(--ink-2); border: 1.5px solid transparent; transition: .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; }

.content {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 26px 28px 60px;
  background:
    radial-gradient(1100px 520px at 100% -12%, #efe9ff 0%, transparent 58%),
    radial-gradient(800px 460px at -8% 104%, #fff2e6 0%, transparent 55%),
    var(--bg);
}
.page { max-width: 1420px; margin: 0 auto; animation: fade-in .22s ease-out; }
/* 只做位移不做透明度：低端设备与截图环境下不会出现"半透明首屏" */
@keyframes fade-in { from { transform: translateY(6px); } to { transform: none; } }

/* ---------------------------------------------------------------- 基础件 */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); font-size: 20px; border: 1px solid var(--line); flex: 0 0 auto;
}
.avatar.lg { width: 54px; height: 54px; font-size: 27px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 14px; font-size: 15.5px; font-weight: 700;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: #cfc6ec; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(140deg, #6e63e8, #4f47c8);
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 22px -12px rgba(91, 91, 214, .8);
}
.btn-primary:hover { background: linear-gradient(140deg, #5f53e0, #433bbd); border-color: transparent; }
.btn-accent { background: linear-gradient(140deg, #ff8f5f, #f76a35); border-color: transparent; color: #fff; }
.btn-accent:hover { background: linear-gradient(140deg, #fa8352, #e85f2a); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.btn-sm svg { width: 17px; height: 17px; }
.btn-lg { height: 56px; padding: 0 26px; font-size: 17.5px; border-radius: 18px; }
.btn-lg svg { width: 21px; height: 21px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: #f3cfcf; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .label {
  font-size: 14.5px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px;
}
.label-hint { font-weight: 500; color: var(--ink-3); font-size: 13px; margin-left: auto; }
.input, .textarea, .select {
  width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line-strong);
  border-radius: 14px; background: #fff; font-size: 15.5px; transition: .15s;
}
.textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.75; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91, 91, 214, .12); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a749b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1.5px solid var(--line); }
.card-head h3 { font-size: 18px; font-weight: 800; }
.card-head .sub { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.card-head .spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px;
  border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-size: 14.5px;
  border: 1.5px solid transparent; transition: .15s; font-weight: 600; text-align: left;
}
.chip:hover { background: #eae4fb; }
.chip.is-on { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand-line); font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px;
  font-size: 13px; font-weight: 700; background: var(--surface-3); color: var(--ink-2);
  white-space: nowrap;
}
.tag.teal { background: var(--brand-soft); color: var(--brand-deep); }
.tag.green { background: var(--mint-soft); color: #0d8f6e; }
.tag.orange { background: var(--accent-soft); color: #c4521c; }
.tag.blue { background: var(--sky-soft); color: #1b78c9; }
.tag.purple { background: var(--grape-soft); color: #8b3ddb; }
.tag.warn { background: var(--sun-soft); color: #a46a00; }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.sun { background: var(--sun-soft); color: #9a6200; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.hr { height: 1.5px; background: var(--line); border: 0; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.progress { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7c6cff, #5b5bd6); transition: width .4s ease; }

.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.section-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.section-head h2 { font-size: 20px; font-weight: 800; letter-spacing: .01em; }
.section-head .count { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.section-head .spacer { flex: 1; }
.link { color: var(--brand); font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.link svg { width: 16px; height: 16px; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 24px;
  text-align: center; color: var(--ink-3); border: 2px dashed var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface-2);
}
.empty .em-icon { font-size: 46px; line-height: 1; }
.empty strong { color: var(--ink); font-size: 19px; }
.empty p { font-size: 15px; }

.skeleton { background: linear-gradient(90deg, #efebfb 25%, #faf8ff 37%, #efebfb 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------- 首页 Hero */
.home-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 26px;
  padding: 30px 34px; margin-bottom: 26px; border-radius: var(--r-xl);
  background: linear-gradient(118deg, #ffffff 0%, #f4f1ff 46%, #eae4ff 100%);
  border: 1.5px solid var(--line);
  box-shadow: 0 24px 60px -46px rgba(60, 40, 140, .55);
}
.home-hero::before {
  content: ""; position: absolute; right: -70px; top: -90px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 108, 255, .18), transparent 68%);
}
.home-hero::after {
  content: ""; position: absolute; right: 210px; bottom: -80px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 69, .16), transparent 70%);
}
.hero-copy { position: relative; z-index: 1; max-width: 620px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px;
  background: #fff; border: 1.5px solid var(--brand-line); color: var(--brand-deep);
  font-size: 13px; font-weight: 700; margin-bottom: 12px;
}
.home-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.home-hero p { font-size: 16.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hero-art { margin-left: auto; position: relative; z-index: 1; display: flex; gap: 12px; }
.hero-tile {
  width: 92px; height: 106px; border-radius: 22px; display: grid; place-items: center; font-size: 40px;
  background: #fff; border: 1.5px solid var(--line); box-shadow: var(--shadow-sm);
}
.hero-tile:nth-child(1) { transform: rotate(-6deg) translateY(6px); }
.hero-tile:nth-child(2) { transform: translateY(-8px); background: linear-gradient(160deg, #fff4e8, #ffe3cf); }
.hero-tile:nth-child(3) { transform: rotate(5deg) translateY(8px); background: linear-gradient(160deg, #eef7ff, #dbecff); }

/* ---------------------------------------------------------------- 素养模块卡 */
.track-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.track-card {
  display: flex; flex-direction: column; text-align: left; overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  position: relative;
}
.track-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-line); }
.track-art {
  position: relative; height: 128px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #eae4ff, #f7f4ff);
}
.track-art .emoji { font-size: 52px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(60, 40, 140, .18)); }
.track-art::before, .track-art::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .55);
}
.track-art::before { width: 130px; height: 130px; left: -40px; bottom: -70px; }
.track-art::after { width: 90px; height: 90px; right: -24px; top: -34px; }
.track-card[data-tone="art"] .track-art { background: linear-gradient(140deg, #ffe6f0, #ffd9e8); }
.track-card[data-tone="music"] .track-art { background: linear-gradient(140deg, #e2f0ff, #cfe6ff); }
.track-card[data-tone="logic"] .track-art { background: linear-gradient(140deg, #e6f9ee, #ccf2dd); }
.track-card[data-tone="word"] .track-art { background: linear-gradient(140deg, #fff2d9, #ffe6b8); }
.track-card[data-tone="science"] .track-art { background: linear-gradient(140deg, #eee6ff, #ddd2ff); }
.track-card[data-tone="stage"] .track-art { background: linear-gradient(140deg, #ffe9e0, #ffd8c7); }
.track-badge {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 99px;
  background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 12.5px; font-weight: 800;
  box-shadow: var(--shadow-xs);
}
.track-age {
  position: absolute; right: 14px; top: 14px; z-index: 2;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  background: rgba(255, 255, 255, .78); border-radius: 99px; padding: 3px 10px;
}
.track-body { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.track-body h3 { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.track-body p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; min-height: 46px; }
.track-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-3); flex-wrap: wrap; }
.track-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px; border-top: 1.5px solid var(--line); background: var(--surface-2);
  font-size: 14.5px; font-weight: 700; color: var(--brand-deep);
}
.track-foot .go { display: inline-flex; align-items: center; gap: 6px; }
.track-card.is-soon { opacity: .92; }
.track-card.is-soon .track-art { filter: saturate(.55); }
.track-card.is-soon .track-foot { color: var(--ink-3); }

/* ---------------------------------------------------------------- 旧版模块卡（保留兼容） */
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.module-card {
  display: flex; flex-direction: column; gap: 10px; padding: 15px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s; position: relative; overflow: hidden;
}
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.module-card .tile { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 18px; }
.module-card h3 { font-size: 16px; font-weight: 700; }
.module-card p { font-size: 14px; color: var(--ink-2); }
.module-card .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.module-card .go { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 700; color: var(--brand); }
.module-card.is-soon { background: var(--surface-2); }

/* ---------------------------------------------------------------- 工作台布局 */
.wb-greeting {
  display: flex; align-items: center; gap: 18px; padding: 26px 28px; margin-bottom: 22px;
  background: linear-gradient(118deg, #ffffff 0%, #f4f1ff 60%, #eae4ff 100%);
  border: 1.5px solid var(--line); border-radius: var(--r-xl); position: relative; overflow: hidden;
}
.wb-greeting h1 { font-size: 28px; font-weight: 800; }
.wb-greeting p { font-size: 15.5px; color: var(--ink-2); margin-top: 4px; }
.wb-greeting .actions { margin-left: auto; display: flex; gap: 10px; position: relative; z-index: 1; }

.wb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.wb-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.wb-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; }

.recent-list { display: flex; flex-direction: column; }
.recent-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-radius: 14px;
  transition: background .15s; text-align: left; width: 100%;
}
.recent-row + .recent-row { border-top: 1.5px solid var(--line); }
.recent-row:hover { background: var(--surface-2); }
.thumb {
  width: 66px; height: 50px; border-radius: 12px; overflow: hidden; flex: 0 0 66px;
  background: var(--surface-3); display: grid; place-items: center; font-size: 22px;
  border: 1.5px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-meta { min-width: 0; flex: 1; }
.recent-meta b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta small { font-size: 13.5px; color: var(--ink-3); }

.side-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.side-card .head { display: flex; align-items: center; gap: 8px; padding: 16px 18px; font-size: 15.5px; font-weight: 800; }
.side-card .head svg { width: 18px; height: 18px; color: var(--brand); flex: 0 0 18px; }
.side-card .head .spacer { flex: 1; }
.side-card .body { padding: 0 18px 18px; }

.points-hero {
  padding: 20px; color: #fff; border-radius: var(--r-lg); position: relative; overflow: hidden;
  background: linear-gradient(150deg, #6f63e6, #4b44c6 60%, #3a35a8);
}
.points-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.points-hero .cap { font-size: 13.5px; opacity: .86; letter-spacing: .02em; }
.points-hero .val { font-size: 42px; font-weight: 800; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.points-hero .unit { font-size: 15px; opacity: .85; margin-left: 4px; font-weight: 600; }
.points-hero .bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .24); overflow: hidden; margin-top: 14px; }
.points-hero .bar > i { display: block; height: 100%; background: #ffd98a; border-radius: 99px; }
.points-hero .foot { display: flex; justify-content: space-between; font-size: 12.5px; opacity: .85; margin-top: 8px; }

.continue-item { display: flex; gap: 12px; padding: 12px 0; align-items: center; }
.continue-item + .continue-item { border-top: 1.5px solid var(--line); }
.ring { width: 42px; height: 42px; flex: 0 0 42px; position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring span { position: absolute; font-size: 11.5px; font-weight: 800; color: var(--ink-2); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; }
.mini-stats > div { background: #fff; padding: 12px 12px; }
.mini-stats b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-stats small { font-size: 12.5px; color: var(--ink-3); }

/* 素养成长条（首页右栏 / 成长页共用） */
.dim { display: flex; flex-direction: column; gap: 6px; padding: 9px 0; }
.dim + .dim { border-top: 1.5px solid var(--line); }
.dim-top { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; }
.dim-top .emoji { font-size: 17px; }
.dim-top .lv { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.dim-bar { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.dim-bar > i { display: block; height: 100%; border-radius: 99px; }
.dim-bar > i[data-c="art"] { background: linear-gradient(90deg, #ff9ec4, #ff6fa5); }
.dim-bar > i[data-c="music"] { background: linear-gradient(90deg, #7cc4ff, #38a3f5); }
.dim-bar > i[data-c="logic"] { background: linear-gradient(90deg, #63dfa8, #17bd92); }
.dim-bar > i[data-c="word"] { background: linear-gradient(90deg, #ffd166, #f5a623); }
.dim-bar > i[data-c="science"] { background: linear-gradient(90deg, #c49bff, #a855f7); }
.dim-bar > i[data-c="stage"] { background: linear-gradient(90deg, #ffb08a, #ff7a45); }

/* ---------------------------------------------------------------- 素养地图 */
.growth-hero {
  display: flex; align-items: center; gap: 24px; padding: 26px 30px; margin-bottom: 22px;
  border-radius: var(--r-xl); border: 1.5px solid var(--line);
  background: linear-gradient(120deg, #fff, #f3efff 62%, #e9e2ff);
}
.growth-hero h1 { font-size: 30px; font-weight: 800; }
.growth-hero p { font-size: 16px; color: var(--ink-2); margin-top: 6px; max-width: 760px; }
.growth-hero .seal {
  margin-left: auto; flex: 0 0 auto; width: 118px; height: 118px; border-radius: 34px;
  display: grid; place-items: center; font-size: 52px;
  background: #fff; border: 1.5px solid var(--line); box-shadow: var(--shadow-sm);
}
.growth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dim-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 22px;
  display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden;
}
.dim-card::after { content: ""; position: absolute; right: -40px; top: -50px; width: 150px; height: 150px; border-radius: 50%; background: var(--tint, #f2effc); opacity: .55; }
.dim-card[data-c="art"] { --tint: #ffe1ec; }
.dim-card[data-c="music"] { --tint: #dceeff; }
.dim-card[data-c="logic"] { --tint: #d8f6e7; }
.dim-card[data-c="word"] { --tint: #fff0cc; }
.dim-card[data-c="science"] { --tint: #ece0ff; }
.dim-card[data-c="stage"] { --tint: #ffe7dc; }
.dim-head { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.dim-head .emoji {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: var(--surface-2); border: 1.5px solid var(--line);
}
.dim-head h3 { font-size: 20px; font-weight: 800; }
.dim-head small { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.dim-head .status { margin-left: auto; }
.dim-card .desc { font-size: 15px; color: var(--ink-2); line-height: 1.7; position: relative; z-index: 1; }
.dim-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.dim-tags .tag { height: 28px; font-size: 13px; }
.dim-evidence {
  font-size: 13.5px; color: var(--ink-3); line-height: 1.7; border-left: 4px solid var(--line-strong);
  padding-left: 12px;
}
.dim-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; flex-wrap: wrap; }

.ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ladder-step {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 8px; position: relative;
}
.ladder-step .n {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-deep); font-weight: 800; font-size: 15px;
}
.ladder-step b { font-size: 16.5px; }
.ladder-step p { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }
.ladder-step .who { font-size: 12.5px; color: var(--ink-3); margin-top: auto; }

/* ---------------------------------------------------------------- 工作室 */
.studio {
  --left-w: 344px;
  display: grid; grid-template-columns: var(--left-w) minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr) 112px; height: 100%; gap: 0; background: var(--surface-2);
  position: relative;
}
.studio.is-simple { grid-template-columns: var(--left-w) minmax(0, 1fr); }
/* 参数栏收起：整列宽度归零，画布吃掉全部宽度；用顶部按钮或画布左上角的浮动把手再呼出。
   注意不能 display:none —— 那样 .main 会滑进第一列，栅格整体错位 */
.studio.no-left { --left-w: 0px; }
.studio.no-left .studio-left { visibility: hidden; overflow: hidden; border-right: 0; }
.studio-bar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  height: 66px; background: #fff; border-bottom: 1.5px solid var(--line);
}
.studio-bar .back {
  display: flex; align-items: center; gap: 5px; font-size: 14.5px; color: var(--ink-2); font-weight: 700;
  padding: 8px 12px; border-radius: 12px; white-space: nowrap; flex: 0 0 auto;
}
.studio-bar .back:hover { background: var(--surface-3); }
.studio-title {
  font-size: 17px; font-weight: 800; border: 1.5px solid transparent; border-radius: 12px;
  padding: 7px 10px; min-width: 140px; max-width: 360px; background: transparent;
}
.studio-title:hover { border-color: var(--line); background: var(--surface-2); }
.studio-title:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(91, 91, 214, .12); }
.save-state { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.save-state.is-dirty { color: var(--warn); }

.studio-left, .studio-right { background: #fff; overflow-y: auto; }
.studio-left { border-right: 1.5px solid var(--line); }
.studio-right { border-left: 1.5px solid var(--line); }
.studio-canvas { overflow: hidden; display: flex; flex-direction: column; position: relative; background: var(--surface-3); }

/* 左栏 = 可滚动的参数区 + 固定底部主操作，长表单下按钮也始终可见 */
.studio-left.has-actions { display: flex; flex-direction: column; overflow: hidden; }
/* 不用 mask-image 做渐隐：iOS 上滚动容器带遮罩会走离屏合成，越滚越卡 */
.studio-scroll {
  flex: 1; overflow-y: auto; min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.studio-scroll .panel-block { padding: 16px 20px; }
.studio-scroll .textarea { min-height: 92px; }
.studio-actions {
  flex: 0 0 auto; background: #fff; border-top: 1.5px solid var(--line);
  padding: 16px 22px 18px; box-shadow: 0 -14px 24px -22px rgba(36, 24, 80, .55);
}

/* 参数区底部的成本说明：只占一行，把原来整块黄色成本条让给画布 */
.foot-note {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3);
  padding: 14px 20px 20px; line-height: 1.6;
}
.foot-note b { color: #8a5a00; }

/* 主角设定卡：全书画图都拿它当参照 */
.hero-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2);
}
.hero-card .thumb {
  flex: 0 0 66px; width: 66px; height: 66px; border-radius: 11px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center;
}
.hero-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-card .meta { min-width: 0; }
.hero-card .meta b { font-size: 14px; display: block; margin-bottom: 3px; }
.hero-card .meta p { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }

.panel-block { padding: 20px 22px; border-bottom: 1.5px solid var(--line); }
.panel-block:last-child { border-bottom: 0; }
.panel-block > .label { margin-bottom: 10px; }
.step-no {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 9px;
  background: var(--surface-3); color: var(--ink-2); font-size: 13px; font-weight: 800; font-family: var(--mono);
  flex: 0 0 26px;
}
.panel-block.is-done .step-no { background: var(--brand-soft); color: var(--brand-deep); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 14px; }
.seg button { height: 38px; border-radius: 11px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.seg button.is-on { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow-xs); }

.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-opt {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 9px 5px; text-align: center;
  font-size: 13.5px; color: var(--ink-2); transition: .15s; font-weight: 600;
}
.style-opt.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); font-weight: 800; }
.style-opt .swatch { height: 34px; border-radius: 9px; margin-bottom: 7px; }

.type-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-opt {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 12px; font-size: 14px; text-align: left;
  color: var(--ink-2); transition: .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600;
}
.type-opt:hover { border-color: var(--line-strong); }
.type-opt.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); font-weight: 800; }

.mic-btn {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1.5px solid var(--line-strong); background: #fff; font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.mic-btn.is-live { border-color: var(--accent); background: var(--accent-soft); color: #c4521c; }
.mic-btn.is-live .wave { display: inline-flex; }
/* 等授权：按钮先给出反馈，否则学生以为没点上，会连着点好几次 */
.mic-btn.is-waiting { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); cursor: progress; }
.mic-btn.is-waiting svg { animation: micPulse 1.2s ease-in-out infinite; }
.wave { display: none; gap: 3px; align-items: flex-end; height: 14px; }
.wave i { width: 3px; background: var(--accent); border-radius: 2px; animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .15s; }
.wave i:nth-child(3) { animation-delay: .3s; }
@keyframes wave { 0%, 100% { height: 4px; } 50% { height: 14px; } }

.cost-bar {
  display: flex; align-items: center; justify-content: space-between; font-size: 14.5px; color: var(--ink-2);
  background: var(--sun-soft); border: 1.5px solid #ffe8a8; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
}
.cost-bar b { color: #8a5a00; font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 800; }

.canvas-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px 10px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.canvas-body {
  flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center;
  padding: 0 24px 78px;
}
/* 绘本页专用：竖排 flex 让"页面"直接吃掉可用高度（不靠 height:100% 这种在
   flex 派生高度上解析不出来的写法），画稿用 background-size:contain 保证整张可见。 */
.canvas-body.is-book {
  flex-direction: column; align-items: center; justify-content: flex-start; overflow: hidden;
}
/* 绘本页：图片按完整比例缩放到可用空间里（contain），文字固定在下方，长文只在文字区内部滚动。
   之前用 4/3 定高 + object-fit: cover，横竖图都会被裁掉一圈，孩子看不到完整画面。 */
.book-page {
  /* flex:1 填满画布剩余高度；宽度不再决定高度，横竖图都不会被裁 */
  flex: 1 1 auto; min-height: 0;
  width: min(100%, 700px);
  background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-md);
  position: relative; display: flex; flex-direction: column; border: 1.5px solid var(--line);
}
/* 插画用背景图 contain：无论容器是宽是扁，整张图都完整可见，多出来的地方留白 */
.book-page .art {
  flex: 1 1 auto; min-height: 0;
  background-color: #faf8ff;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  position: relative; overflow: hidden;
}
.book-page .cap {
  flex: 0 0 auto; min-height: 64px; max-height: 38%; overflow-y: auto;
  padding: 18px 26px 20px; font-size: 19px; line-height: 1.8; color: var(--ink);
  border-top: 1.5px solid var(--line); background: #fff; font-weight: 500;
  text-wrap: pretty;
}
.book-page .cap[contenteditable="true"]:focus { outline: none; background: #fffdf4; box-shadow: inset 0 0 0 3px #ffe08a; }
.book-page .folio {
  position: absolute; right: 16px; top: 12px; font-size: 12px; font-family: var(--mono); color: #fff;
  background: rgba(20, 14, 40, .42); border-radius: 99px; padding: 3px 9px; pointer-events: none;
  z-index: 3;
}

/* 参数栏收起后，画布左上角留一个把手，点一下重新展开 */
.panel-peek {
  position: absolute; left: 14px; top: 12px; z-index: 4;
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.panel-peek:hover { border-color: var(--brand-line); color: var(--brand-deep); }
.panel-peek svg { width: 17px; height: 17px; }

.page-nav {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .96); border: 1.5px solid var(--line); border-radius: 99px; padding: 6px;
  box-shadow: var(--shadow-sm);
}
.page-nav button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.page-nav button:hover { background: var(--surface-3); }
.page-nav .idx { font-size: 14px; font-weight: 800; padding: 0 6px; font-variant-numeric: tabular-nums; }

.film {
  grid-column: 1 / -1; border-top: 1.5px solid var(--line); background: #fff; display: flex; align-items: center; gap: 14px;
  padding: 0 20px; overflow: hidden;
}
.film-strip { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 12px 0; flex: 1; height: 100%; align-items: center; }
.film-cell {
  flex: 0 0 104px; height: 84px; border-radius: 12px; overflow: hidden; position: relative; border: 2.5px solid transparent;
  background: var(--surface-3); transition: .15s;
}
.film-cell img { width: 100%; height: 100%; object-fit: cover; }
.film-cell .no {
  position: absolute; left: 5px; bottom: 4px; font-size: 11px; background: rgba(20, 14, 40, .55); color: #fff;
  border-radius: 5px; padding: 1px 5px; font-family: var(--mono);
}
.film-cell.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 91, 214, .16); }
.film-cell.is-edited::after {
  content: ""; position: absolute; right: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
}
.film-cell.is-ph { display: grid; place-items: center; color: var(--ink-4); font-size: 13px; }

.gen-overlay {
  position: absolute; inset: 0; background: rgba(247, 244, 255, .93); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 5; padding: 24px;
}
.gen-card {
  width: min(480px, 100%); background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 28px; box-shadow: var(--shadow-pop);
}
.gen-card h3 { font-size: 19px; font-weight: 800; }
.gen-stage { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); margin: 18px 0 12px; min-height: 22px; }
.gen-spinner { width: 20px; height: 20px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex: 0 0 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-steps { display: flex; gap: 8px; margin-top: 18px; }
.gen-steps > div { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); }
.gen-steps > div.is-done { background: var(--brand); }
.gen-steps > div.is-live { background: linear-gradient(90deg, var(--brand) 50%, var(--surface-3) 50%); background-size: 200% 100%; animation: slide 1.2s linear infinite; }
@keyframes slide { to { background-position: -200% 0; } }

.game-stage { width: min(100%, 640px); aspect-ratio: 4 / 3; background: #0d1730; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-md); position: relative; }
.game-stage canvas { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------ 游戏工坊 v2 */
.studio.game-studio { --left-w: 388px; grid-template-columns: var(--left-w) minmax(0, 1fr) 312px; grid-template-rows: auto auto minmax(0, 1fr) 74px; }
/* 沉浸创作时把全站顶栏收掉：顶部只留一条工作栏，画布多出 70px 高 */
.app[data-view="studio-game"] .topbar { display: none; }
/* 音乐工坊自带顶部工作栏，平台顶栏让位给六步向导 */
.app[data-view="studio-music"] .topbar { display: none; }
.app[data-view="studio-music"] .content { padding: 0; overflow: hidden; }
.game-bar { height: 56px; gap: 8px; }
.studio-title-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.studio-title-wrap .studio-title { min-width: 120px; }
.studio-title-wrap .mic-btn.mic-inline { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; }
.game-points {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
  border-radius: 99px; background: var(--sun-soft); border: 1.5px solid #ffe8a8;
  color: #8a5a00; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.game-points svg { width: 14px; height: 14px; }
.game-points b { font-size: 13px; }
.game-bar .btn svg { width: 15px; height: 15px; }
/* 六步压成一行，省下来的高度全给内容 */
.game-stepper {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 20px; border-bottom: 1.5px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfaff); flex: 0 0 auto;
}
.game-stepper::-webkit-scrollbar { display: none; }
.game-step {
  flex: 1 1 0; min-width: 0; display: flex; gap: 6px; align-items: center; justify-content: center;
  height: 34px; padding: 0 6px; border-radius: 10px; text-align: left; color: var(--ink-3);
}
.game-step:hover { background: var(--surface-2); }
.game-step.is-on { background: var(--brand-soft); color: var(--brand-deep); }
.game-step.is-done { color: var(--brand-deep); }
.game-step .n {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center;
  background: var(--surface-3); font-family: var(--mono); font-size: 10.5px; font-weight: 800;
}
.game-step.is-on .n, .game-step.is-done .n { background: #fff; color: var(--brand); }
.game-step .n svg { width: 11px; height: 11px; }
.game-step b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 左栏内容常常比可视区高，硬切一半会像"字被吃掉了"，
   底部加一层渐隐，既提示还能往下滚，也不会出现半行字 */
/* 左栏 = 固定的六步条 + 可滚动的面板，主操作现在跟着内容走，不再占底部一条 */
.game-left { display: flex; flex-direction: column; overflow: hidden; }
.game-left .studio-scroll {
  padding-bottom: 14px;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent 100%);
}
.game-panel { padding: 16px 18px 20px; }
.game-panel-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 15px; }
.game-panel-head b { display: block; font-size: 15px; }
.game-panel-head p { margin-top: 3px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.game-field { margin-bottom: 13px; }
.game-field-label { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.game-req { color: var(--accent); font-weight: 700; }
.game-field-hint { margin-top: 5px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
/* 「自己写也算数」：放在字段下面，跟其它提示区分开，不然没人会读 */
.game-own-words {
  margin: 12px 0 2px; padding: 8px 11px; border-radius: 10px;
  background: rgba(91, 91, 214, .07);
  border: 1px dashed rgba(91, 91, 214, .26);
  color: var(--ink-2); font-size: 11.5px;
}
.field-voice { display: flex; gap: 7px; align-items: flex-start; }
.field-voice .input, .field-voice .textarea { flex: 1; min-width: 0; }
.mic-btn.mic-inline {
  flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border-radius: 11px;
  justify-content: center; gap: 0;
}
.mic-btn.mic-inline span[data-voice-label] { display: none; }
.mic-btn.mic-inline svg { width: 17px; height: 17px; }
.mic-btn.mic-inline.is-live { animation: micPulse 1.4s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 69, .25); } 50% { box-shadow: 0 0 0 7px rgba(255, 122, 69, 0); } }
.game-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-seg { gap: 2px; padding: 3px; }
.game-seg button { height: 34px; font-size: 12px; }
.game-style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.game-style-card {
  border: 1.5px solid var(--line); border-radius: 13px; padding: 8px; text-align: left;
  background: #fff; transition: .15s; min-width: 0;
}
.game-style-card:hover { border-color: var(--brand-line); }
.game-style-card.is-on { border-color: var(--brand); background: var(--brand-soft); }
.game-style-card .swatch { display: block; height: 28px; border-radius: 8px; margin-bottom: 6px; }
.game-style-card b { display: block; font-size: 12px; }
.game-style-card small { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.4; color: var(--ink-3); }
.game-action-row { display: flex; gap: 8px; }
.game-action-row .grow { flex: 1; }
.game-foot-note { margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--ink-3); text-align: center; }
.game-cost-bar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
  padding: 9px 11px; border-radius: 11px; background: var(--sun-soft); border: 1.5px solid #ffe8a8;
  font-size: 12px; color: #8a5200;
}
.game-cost-bar b { font-size: 17px; }
.game-brief-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.game-build-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 11px; }
.game-build-meta > div { padding: 7px 8px; border-radius: 10px; background: var(--surface-2); border: 1.5px solid var(--line); min-width: 0; }
.game-build-meta span { display: block; font-size: 10px; color: var(--ink-3); }
.game-build-meta b { display: block; margin-top: 2px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-warn {
  display: flex; gap: 7px; align-items: flex-start; margin-bottom: 11px; padding: 8px 10px;
  border-radius: 10px; background: #fff8ec; border: 1.5px solid #ffe8a8;
  font-size: 11px; line-height: 1.6; color: #8a5200;
}
.game-warn svg { flex: 0 0 15px; margin-top: 1px; }
.game-iter-row { display: flex; gap: 6px; align-items: flex-start; }
.game-iter-row .field-voice { flex: 1; }
.game-iter-row > .btn { flex: 0 0 40px; height: 40px; padding: 0; }
.game-chat-log { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; max-height: 210px; overflow-y: auto; }
.game-chat-log .chat-msg { padding: 8px 10px; font-size: 12px; }
.game-ready-card { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--line); }
.game-ready-row { display: flex; gap: 9px; font-size: 12px; line-height: 1.6; }
.game-ready-row span { flex: 0 0 60px; color: var(--ink-3); }
.game-ready-row b { color: var(--ink-2); font-weight: 600; overflow-wrap: anywhere; }
.game-cost-note { display: flex; align-items: center; gap: 6px; margin-top: 11px; font-size: 11px; color: var(--ink-3); }
.game-cost-note b { color: var(--brand-deep); }
.game-progress-inline { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--line); }
.game-legacy-note { margin-bottom: 13px; padding: 10px 12px; border-radius: 11px; background: #fff8ec; border: 1.5px solid #ffe8a8; }
.game-legacy-note b { font-size: 12.5px; color: #8a5200; }
.game-legacy-note p { margin-top: 4px; font-size: 11px; line-height: 1.65; color: #8a5200; }
.game-design-note { display: flex; gap: 7px; margin-top: 13px; padding: 9px 10px; border-radius: 10px; background: var(--brand-soft); font-size: 11px; line-height: 1.6; color: var(--brand-deep); }
.game-design-note svg { flex: 0 0 15px; margin-top: 1px; }

.game-canvas-head { padding-bottom: 8px; }
.game-sandbox-tag { padding: 3px 9px; border-radius: 99px; background: var(--brand-soft); border: 1px solid var(--brand-line); font-size: 11px; font-weight: 700; color: var(--brand-deep); }
.game-tool { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); background: #fff; border: 1.5px solid var(--line); }
.game-tool:hover { border-color: var(--brand-line); color: var(--brand-deep); }
.game-tool svg { width: 15px; height: 15px; }
.game-canvas-body { padding: 0 16px 16px; align-items: stretch; justify-content: stretch; }
.game-preview-shell { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.game-preview-wrap {
  position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden;
  border-radius: 18px; border: 1.5px solid var(--line); background: #0d1730; box-shadow: var(--shadow-md);
}
.game-preview-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.game-preview-loading {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 9px;
  background: rgba(247, 244, 255, .92); color: var(--ink-2); font-size: 13px; font-weight: 700;
}
.game-preview-loading.is-soft { top: auto; height: 42px; background: rgba(255, 255, 255, .94); border-top: 1.5px solid var(--line); }
.game-preview-loading.is-hidden { display: none; }
.game-version-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 10px; background: #fff8ec; border: 1.5px solid #ffe8a8; font-size: 11.5px; color: #8a5200; }
.game-version-banner button { font-size: 11.5px; font-weight: 800; color: var(--brand-deep); }
.game-legacy-stage { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; }
.game-legacy-caption { font-size: 11.5px; color: var(--ink-3); }
.game-empty { max-width: 440px; padding: 24px; text-align: center; }
.game-empty-art {
  width: 76px; height: 76px; margin: 0 auto 13px; border-radius: 22px; display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); font-size: 34px;
}
.game-empty h3 { margin-bottom: 7px; font-size: 18px; font-weight: 800; }
.game-empty p { font-size: 13px; line-height: 1.8; color: var(--ink-3); }
.game-empty-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 15px; }
.game-empty-steps span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; background: #fff; border: 1.5px solid var(--line); font-size: 11px; color: var(--ink-2); }
.game-empty-steps b { color: var(--brand); }
.game-main-progress { width: min(320px, 100%); margin: 15px auto 6px; }
.game-generating .game-empty-art { background: var(--brand-soft); border-color: var(--brand-line); }

.game-right { display: flex; flex-direction: column; gap: 9px; padding: 13px; }
.game-teach-card, .game-info-card, .game-share-card { padding: 12px; border-radius: 13px; background: var(--surface-2); border: 1.5px solid var(--line); }
.game-teach-kicker { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
.game-teach-card h3 { margin: 4px 0 6px; font-size: 14px; font-weight: 800; }
.game-teach-card > p { font-size: 11px; line-height: 1.7; color: var(--ink-3); }
.game-check-head { display: flex; justify-content: space-between; margin-top: 11px; font-size: 10.5px; font-weight: 800; color: var(--ink-3); }
.game-check-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.game-check-item { display: flex; gap: 7px; font-size: 11px; line-height: 1.5; color: var(--ink-3); }
.game-check-item .mark { flex: 0 0 14px; color: var(--ink-4); font-weight: 800; }
.game-check-item.is-done { color: var(--ink-2); }
.game-check-item.is-done .mark { color: var(--brand); }
.game-example, .game-tip { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); }
.game-example b, .game-tip b { font-size: 10.5px; color: var(--ink-2); }
.game-example p, .game-tip p { margin-top: 3px; font-size: 10.5px; line-height: 1.65; color: var(--ink-3); }
.game-info-card { display: flex; flex-direction: column; gap: 6px; }
.game-info-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ink-3); }
.game-info-row b { color: var(--ink-2); font-weight: 700; }
.game-share-card .btn { margin-top: 8px; }
.game-version-strip { align-items: center; gap: 7px; }
.game-version {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
  border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font-size: 11px; color: var(--ink-2);
}
.game-version b { color: var(--brand-deep); font-size: 10.5px; }
.game-version.is-on { border-color: var(--brand); background: var(--brand-soft); }
.game-version-current { font-size: 10px; color: var(--ink-4); white-space: nowrap; }
.code-view {
  max-height: 56vh; overflow: auto; padding: 14px; border-radius: 12px;
  background: #171633; color: #e8e4ff; font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  white-space: pre; tab-size: 2;
}
.game-export-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.game-export-option { padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); text-align: left; }
.game-export-option:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.game-export-option b { display: block; font-size: 13px; }
.game-export-option span { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); }
.game-hud { position: absolute; inset: 14px 16px auto 16px; display: flex; justify-content: space-between; color: #fff; font-size: 15px; font-weight: 800; pointer-events: none; font-variant-numeric: tabular-nums; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 14, 30, .72); color: #fff; text-align: center; padding: 24px; }
.game-overlay h3 { font-size: 26px; margin-bottom: 8px; font-weight: 800; }
.game-overlay p { font-size: 15px; opacity: .88; margin-bottom: 18px; }

.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-msg { font-size: 14.5px; line-height: 1.65; padding: 11px 14px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--line); }
.chat-msg.is-me { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-deep); }

/* ---------------------------------------------------------------- 音乐工坊 */
.music-stage { width: min(100%, 720px); display: flex; flex-direction: column; gap: 16px; }
.lyric-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.lyric-card h3 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.lyric-card .byline { font-size: 13.5px; color: var(--ink-3); margin-bottom: 18px; }
.lyric-section { margin-bottom: 16px; }
.lyric-section .sec-label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--brand-deep);
  background: var(--brand-soft); border-radius: 99px; padding: 3px 10px; margin-bottom: 8px;
}
.lyric-line {
  display: flex; align-items: baseline; gap: 12px; font-size: 19px; line-height: 2.05; color: var(--ink);
  border-radius: 8px; padding: 0 6px; transition: background .15s;
}
.lyric-line:hover { background: #fdfbff; }
.lyric-line .chord {
  flex: 0 0 62px; font-family: var(--mono); font-size: 13.5px; color: var(--brand);
  font-weight: 700; transform: translateY(-2px);
}
.lyric-line .txt[contenteditable="true"]:focus { outline: none; background: #fffdf4; box-shadow: 0 0 0 3px #ffe08a; border-radius: 5px; }
.lyric-line.is-singing { background: var(--sun-soft); }

.play-bar {
  display: flex; align-items: center; gap: 14px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow-sm);
}
.play-btn {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 56px;
  background: linear-gradient(140deg, #6e63e8, #4f47c8); color: #fff;
  box-shadow: 0 12px 24px -12px rgba(91, 91, 214, .85);
}
.play-btn:hover { filter: brightness(1.06); }
.play-btn svg { width: 24px; height: 24px; }
.play-meta { min-width: 0; flex: 1; }
.play-meta b { font-size: 16px; font-weight: 800; display: block; }
.play-meta small { font-size: 13px; color: var(--ink-3); }
.play-progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.play-progress > i { display: block; height: 100%; background: linear-gradient(90deg, #7c6cff, #5b5bd6); border-radius: 99px; }

.piano-roll { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px 12px; overflow: hidden; }
.piano-roll .rows { position: relative; }
.piano-roll .grid-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.piano-roll .beat-line { position: absolute; top: 0; bottom: 0; width: 1px; background: #f1edfc; }
.piano-roll .note {
  position: absolute; height: 11px; border-radius: 4px; min-width: 5px;
  background: linear-gradient(90deg, #7c6cff, #5b5bd6);
  transition: background .2s, transform .2s;
}
.piano-roll .note.is-live { background: linear-gradient(90deg, #ffb066, #ff7a45); transform: scaleY(1.25); }

.theory-card { background: var(--surface-2); border: 1.5px dashed var(--line-strong); border-radius: 16px; padding: 14px 16px; }
.theory-card b { font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.theory-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; margin-top: 5px; }

/* ---------------------------------------------------------------- 作品中心 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .search { position: relative; }
.toolbar .search input { width: 270px; height: 44px; padding-left: 40px; }
.toolbar .search svg { position: absolute; left: 13px; top: 12px; width: 19px; height: 19px; color: var(--ink-3); }

.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 18px; }
.work-card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: .16s; display: flex; flex-direction: column; }
.work-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--brand-line); }
.work-cover { aspect-ratio: 4 / 3; background: var(--surface-3); position: relative; overflow: hidden; }
.work-cover img { width: 100%; height: 100%; object-fit: cover; }
.work-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 52px; }
.work-cover .badge { position: absolute; left: 12px; top: 12px; }
.work-body { padding: 16px 18px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.work-body h3 { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-body p { font-size: 14px; color: var(--ink-3); line-height: 1.55; }
.work-actions { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1.5px solid var(--line); margin-top: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; font-weight: 700; color: var(--ink-3); font-size: 13.5px; padding: 14px 16px;
  border-bottom: 1.5px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1.5px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table-wrap { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table-wrap .head-row { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1.5px solid var(--line); }
.table-wrap .head-row h3 { font-size: 17px; font-weight: 800; }

/* ---------------------------------------------------------------- 管理台 */
.admin-grid { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-nav { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 8px; position: sticky; top: 0; }
.admin-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  border-radius: 12px; font-size: 14.5px; color: var(--ink-2); text-align: left; font-weight: 600;
}
.admin-nav button:hover { background: var(--surface-3); }
.admin-nav button.is-on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 800; }
.admin-nav button svg { width: 18px; height: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.stat-card .k { font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.stat-card .v { font-size: 30px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-card .d { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

.config-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1.5px solid var(--line); }
.config-row:last-child { border-bottom: 0; }
.config-row .meta { flex: 1; min-width: 0; }
.config-row .meta b { display: block; font-size: 15.5px; font-weight: 700; }
.config-row .meta small { font-size: 13px; color: var(--ink-3); }

.switch { width: 46px; height: 27px; border-radius: 99px; background: var(--line-strong); position: relative; transition: .15s; flex: 0 0 46px; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: var(--shadow-xs); }
.switch.is-on { background: var(--brand); }
.switch.is-on::after { transform: translateX(19px); }

/* ---------------------------------------------------------------- 登录 */
.login { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-left {
  position: relative; overflow: hidden; color: #fff; padding: 46px 54px; display: flex; flex-direction: column;
  background: linear-gradient(160deg, #4a3fc0 0%, #5b5bd6 40%, #8b6ff0 100%);
}
.login-left::before, .login-left::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.login-left::before { width: 520px; height: 520px; right: -180px; bottom: -200px; }
.login-left::after { width: 260px; height: 260px; right: 120px; top: -100px; background: rgba(255, 255, 255, .06); }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; position: relative; z-index: 1; }
.login-brand .brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; }
.login-art { display: flex; gap: 12px; margin-bottom: 30px; position: relative; z-index: 1; }
.login-art span {
  width: 62px; height: 66px; border-radius: 19px; display: grid; place-items: center; font-size: 29px;
  background: rgba(255, 255, 255, .17); border: 1.5px solid rgba(255, 255, 255, .24);
  box-shadow: 0 16px 30px -22px rgba(0, 0, 0, .5);
}
.login-art span:nth-child(1) { transform: rotate(-7deg) translateY(3px); }
.login-art span:nth-child(2) { transform: rotate(2deg) translateY(-3px); }
.login-art span:nth-child(3) { transform: rotate(7deg) translateY(4px); }
.login-hero { margin-top: auto; position: relative; z-index: 1; }
.login-hero h1 { font-size: 44px; line-height: 1.35; letter-spacing: -.02em; font-weight: 800; }
.login-hero p { margin-top: 18px; font-size: 17px; line-height: 1.85; color: rgba(255, 255, 255, .84); max-width: 470px; }
.login-points { display: flex; gap: 32px; margin-top: 34px; position: relative; z-index: 1; }
.login-points div { font-size: 13.5px; color: rgba(255, 255, 255, .72); }
.login-points b { display: block; font-size: 30px; color: #fff; font-weight: 800; margin-bottom: 2px; }
.login-right { display: grid; place-items: center; padding: 40px; background: var(--surface); overflow-y: auto; }
.login-box { width: min(440px, 100%); }
.login-box h2 { font-size: 28px; font-weight: 800; }
.login-box .hint { font-size: 15px; color: var(--ink-3); margin: 8px 0 24px; line-height: 1.7; }
.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-opt {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 16px; text-align: left; transition: .15s; background: #fff; width: 100%;
}
.account-opt:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.account-opt .meta { flex: 1; }
.account-opt b { display: block; font-size: 16.5px; font-weight: 700; }
.account-opt small { font-size: 13.5px; color: var(--ink-3); }
.account-opt .arrow { color: var(--ink-4); }
.login-foot { margin-top: 22px; font-size: 12.5px; color: var(--ink-4); line-height: 1.8; }

/* ---------------------------------------------------------------- 浮层 */
.toast-host { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 400; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 14px;
  background: #241f3d; color: #fff; font-size: 15px; font-weight: 600; box-shadow: var(--shadow-pop);
  animation: toast-in .22s ease-out; max-width: 420px;
}
.toast svg { width: 19px; height: 19px; }
.toast.is-error { background: #c2453f; }
.toast.is-ok { background: #10875f; }
.toast.is-warn { background: #b06a15; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal-host { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(28, 20, 56, .42); backdrop-filter: blur(3px); padding: 24px; }
.modal { width: min(480px, 100%); background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 24px 26px 0; }
.modal-head h3 { font-size: 21px; font-weight: 800; }
.modal-body { padding: 14px 26px 6px; font-size: 15.5px; color: var(--ink-2); line-height: 1.75; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 26px 24px; }
.modal.is-wide { width: min(720px, 100%); }

.cmdk { width: min(620px, 100%); background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-pop); }
.cmdk input { width: 100%; height: 58px; border: 0; border-bottom: 1.5px solid var(--line); padding: 0 22px; font-size: 17px; }
.cmdk input:focus { outline: none; }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 15.5px; text-align: left; color: var(--ink-2); font-weight: 600; }
.cmdk-item:hover, .cmdk-item.is-on { background: var(--brand-soft); color: var(--brand-deep); }
.cmdk-item svg { width: 19px; height: 19px; }
.cmdk-item .k { margin-left: auto; font-size: 12.5px; color: var(--ink-4); font-family: var(--mono); }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1380px) {
  .track-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wb-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .studio { --left-w: 320px; grid-template-columns: var(--left-w) minmax(0, 1fr) 300px; }
}
@media (max-width: 1180px) {
  /* 侧栏在 1180–900 之间仍保留文字：很多教室的投影/笔记本窗口正好落在这段，
     之前一到 1180 就把标签全部藏掉，导航只剩一排图标，孩子不知道点哪个。 */
  .wb-grid { grid-template-columns: minmax(0, 1fr); }
  .wb-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .studio { --left-w: 300px; grid-template-columns: var(--left-w) minmax(0, 1fr); }
  .studio-right { display: none; }
  .growth-grid { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* 侧栏**保留文字**，只把宽度和字号收一档。
     这里以前是把 brand-text / rail-label / rail-item span 全部 display:none，
     导航只剩一排没名字的图标 —— 教室的投影和 13 寸笔记本正好落在 900 附近，
     孩子根本不知道哪个图标是「AI 游戏」。文字是这个产品的主导航，不能为了
     省 120px 把它砍掉。真的窄到放不下（<=680）再改成覆盖式抽屉，文字仍然在。 */
  .app { grid-template-columns: var(--rail-w-narrow) minmax(0, 1fr); }
  .app.is-collapsed { grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr); }
  .rail { padding: 14px 10px 12px; }
  .rail-brand { gap: 8px; padding: 2px 6px 14px; min-height: 50px; }
  .rail-item { min-height: 46px; padding: 0 8px; gap: 9px; font-size: 14.5px; border-radius: 14px; }
  .rail-item svg { flex: 0 0 20px; width: 20px; height: 20px; }
  .rail-item.is-active::before { left: -10px; }
  .rail-label { padding: 6px 8px; }
  .rail-user { padding: 8px; gap: 9px; }
  .rail-user-meta b { font-size: 14px; }
  body { font-size: 15.5px; }
  .studio-title { min-width: 0; max-width: 34vw; }
  .studio-bar { gap: 8px; padding: 0 12px; }
  .studio-bar .back span { display: none; }
  .content { padding: 16px 16px 40px; }
  .track-grid, .wb-side, .stat-grid, .ladder { grid-template-columns: 1fr 1fr; }
  .home-hero { padding: 22px; flex-direction: column; align-items: flex-start; }
  .hero-art { margin: 0; }
  .hero-art .hero-tile:nth-child(3) { display: none; }
  .studio { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app.is-immersive { grid-template-columns: minmax(0, 1fr); }
  /* 窄屏/iPad 竖屏：参数栏改成覆盖式抽屉，不再直接消失 ——
     以前 display:none 之后，手机和平板上根本没办法再改页数画风 */
  .studio .studio-left {
    position: absolute; top: 0; bottom: 0; left: 0; width: min(86%, 340px); z-index: 6;
    visibility: visible; border-right: 1.5px solid var(--line);
    box-shadow: 0 0 44px -12px rgba(30, 20, 60, .4);
  }
  .studio.no-left .studio-left { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .search-trigger { width: 44px; padding: 0; justify-content: center; }
  .search-trigger .lbl, .search-trigger kbd { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; gap: 6px; overflow-x: auto; }
  .admin-nav button { width: auto; white-space: nowrap; }
  .film { display: none; }
}
@media (max-width: 640px) {
  .track-grid, .wb-side, .stat-grid, .ladder { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 26px; }
  .section-head h1 { font-size: 24px; }
  .points-chip span:last-child { display: none; }
}

/* 极窄屏（手机 / 分屏半边）：真的没有并排的空间了，导航改成覆盖式抽屉。
   注意仍然是**带文字**的抽屉 —— 之前这里混着另一套「收成图标条」的规则，
   结果窄屏下导航只剩图标。抽屉的样式与沉浸创作共用，文字一个都不少。 */
@media (max-width: 680px) {
  .app, .app.is-collapsed, .app.is-immersive { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(78%, 264px);
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 0 0 60px -12px rgba(30, 20, 60, .45); z-index: 60;
  }
  .app.rail-open .rail { transform: none; }
  /* 顶栏常驻一个可见的开关，别让人找不到导航 */
  .rail-handle { display: none; }
  .app:not(.rail-open) .rail-handle { display: grid; }
}

/* ---------------------------------------------------------------- 模型管理 */

.model-top {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.model-top h3 { margin: 0; }

/* 模块 → 模型 映射 */
.map-list { display: flex; flex-direction: column; }
.map-row {
  display: flex; align-items: center; gap: 14px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.map-row:last-child { border-bottom: 0; }
.map-row b { flex: 0 0 120px; font-size: 15px; }
.map-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* 类别分组 */
.model-group { margin-top: 12px; padding: 4px 0 2px; }
.model-group-head { padding: 14px 20px 12px; border-bottom: 1px solid var(--line); }
.model-group-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15.5px; margin: 0; }
.cat-emoji { font-size: 19px; line-height: 1; }
.count-pill {
  display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 99px;
  background: var(--surface-3); color: var(--ink-3); font-size: 12.5px; font-weight: 700; text-align: center;
}

/* 单个模型 */
.model-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.model-row:last-child { border-bottom: 0; }
.model-row.is-builtin { background: var(--surface-2); }
.model-main { flex: 1; min-width: 0; }
.model-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.model-title b { font-size: 15.5px; }
.model-sub {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--ink-3);
}
.model-url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.model-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 7px; font-size: 13px; color: var(--ink-3);
}
.key-state { padding: 2px 8px; border-radius: 7px; background: var(--mint-soft); color: #0d8f6e; font-weight: 600; }
.key-state.is-empty { background: var(--sun-soft); color: #a46a00; }
.model-test { display: inline-flex; align-items: center; gap: 6px; }
.test-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.test-dot.ok { background: var(--mint); }
.test-dot.bad { background: var(--danger); }
.model-bind { color: var(--brand-deep); }

.model-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tag.muted { background: var(--surface-3); color: var(--ink-4); }

/* 添加模型：类别选择 */
.cat-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; text-align: left; transition: .15s; font-family: inherit;
}
.cat-btn:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.cat-btn.is-on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(91, 91, 214, .12); }
.cat-btn b { font-size: 15px; }
.cat-btn small { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

.chip-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-note {
  margin: 0 0 4px; padding: 10px 12px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; line-height: 1.6;
}
.preset-note a { color: var(--brand-deep); text-decoration: underline; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.empty-line { padding: 22px 20px; color: var(--ink-4); font-size: 14px; }

@media (max-width: 760px) {
  .cat-pick { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .model-row { flex-wrap: wrap; }
  .model-actions { width: 100%; justify-content: flex-end; }
  .map-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .map-row b { flex: none; }
}

/* ---------------------------------------------------------------- 引擎提示条 */

.engine-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 0 22px 14px; padding: 11px 16px;
  border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); font-size: 13.5px;
}
.engine-banner b { color: var(--ink); font-weight: 700; }
.engine-banner.is-warn {
  border-color: #f6c98a;
  background: linear-gradient(180deg, #fff8ec, #fff3df);
  color: #7a4b06;
  align-items: flex-start; flex-direction: column; gap: 4px;
}
.engine-banner.is-warn b { color: #8a5200; }
.engine-banner.is-warn small { color: #9a6c2a; font-size: 12.5px; line-height: 1.6; }

/* 模型最近一次失败原因 */
.model-error {
  margin-top: 8px; padding: 8px 12px; border-radius: 10px;
  background: #fff5f5; border: 1px solid #ffd7d7;
  display: flex; flex-direction: column; gap: 2px;
}
.model-error b { font-size: 12.5px; color: #c03a3a; }
.model-error span { font-size: 13px; color: #8a3030; }
.model-error small { font-size: 12px; color: #b06a6a; }

/* ---------------------------------------------------- 游戏工坊 v2 响应式 */
@media (max-width: 1380px) {
  .studio.game-studio { --left-w: 356px; grid-template-columns: var(--left-w) minmax(0, 1fr) 292px; }
}
@media (max-width: 1180px) {
  .studio.game-studio { --left-w: 330px; grid-template-columns: var(--left-w) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .studio.game-studio { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .game-bar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 12px; }
  .game-bar .save-state { display: none; }
  .game-bar .spacer { flex-basis: 100%; height: 0; }
  .game-bar-lbl { display: none; }
  .game-stepper { padding: 6px 8px; }
  .game-step b { font-size: 11px; }
  .game-two-col { grid-template-columns: 1fr; }
  .game-canvas-body { padding: 0 10px 10px; }
  .game-preview-wrap { border-radius: 14px; }
}
@media (max-width: 640px) {
  .game-stepper { padding: 5px 6px; }
  .game-step { padding: 0 2px; }
  .game-step b { display: none; }
  .game-step .n { flex: 0 0 22px; width: 22px; height: 22px; }
  .game-style-grid { grid-template-columns: 1fr 1fr; }
  .game-build-meta { grid-template-columns: 1fr 1fr; }
  .game-bar #viewCode { display: none; }
  .game-points { display: none; }
}

/* 窄屏游戏工作台：一键在「步骤」和「预览」之间切换 */
.game-mobile-toggle { display: none; }
@media (max-width: 900px) {
  .game-mobile-toggle { display: inline-flex; flex: 0 0 auto; }
  .studio.game-studio.no-left .game-left { display: none; }
}

.game-step-close { display: none; flex: 0 0 auto; align-self: center; }
@media (max-width: 900px) {
  .game-step-close { display: inline-flex; }
  .studio.game-studio .game-stepper { padding-right: 8px; }
}

/* ==========================================================================
   游戏工坊 v3 · 创造流
   灵感卡 / 主角立绘 / 世界场景 / 玩法方案 / 教练对话 / 能力勋章 / 创作板
   ========================================================================== */

/* ---- AI 正在干活 ---- */
.game-ai-working {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin: 0 0 13px;
  background: var(--brand-soft); border: 1.5px dashed var(--brand-line); border-radius: var(--r-md);
}
.game-ai-working b { display: block; font-size: 13px; color: var(--brand-deep); }
.game-ai-working p { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }

.game-empty-inline {
  text-align: center; padding: 22px 10px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1.5px dashed var(--line-strong);
}
.game-empty-inline p { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }

/* ---- 创意卡 ---- */
.game-idea-list { display: flex; flex-direction: column; gap: 8px; }
.game-idea-card {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: var(--r-md); background: var(--surface);
  border: 1.5px solid var(--line); cursor: pointer; transition: transform .12s, border-color .12s, background .12s;
}
.game-idea-card:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.game-idea-card.is-on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(91, 91, 214, .1); }
.game-idea-card .ico {
  flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 11px; background: var(--surface-3); font-size: 17px;
}
.game-idea-card .body { min-width: 0; flex: 1; }
.game-idea-card .body b { display: block; font-size: 13.5px; color: var(--ink); }
.game-idea-card .body small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }

/* ---- 主角卡 ---- */
.game-hero-card {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--r-md);
  background: linear-gradient(160deg, #fff, var(--surface-2));
  border: 1.5px solid var(--line);
}
.game-hero-portrait {
  flex: 0 0 96px; width: 96px; height: 96px; border-radius: 14px;
  background-color: var(--surface-3); background-position: center; background-size: cover;
  background-repeat: no-repeat; border: 1.5px solid var(--line-strong);
}
.game-hero-info { min-width: 0; flex: 1; }
.game-hero-info b { font-size: 15px; color: var(--ink); }
.game-hero-info p { margin-top: 5px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.game-quote {
  display: inline-block; margin-top: 7px; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 11.5px; font-weight: 700;
}

/* ---- 世界卡 ---- */
.game-world-card {
  border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--line); background: var(--surface);
}
.game-world-shot {
  height: 130px; background-color: var(--surface-3); background-position: center;
  background-size: cover; background-repeat: no-repeat; border-bottom: 1.5px solid var(--line);
}
.game-world-meta { padding: 10px 12px 12px; }
.game-world-meta b { font-size: 13.5px; }
.game-world-meta p { margin-top: 4px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.game-palette { display: flex; gap: 6px; margin-top: 8px; }
.game-palette span { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid rgba(0,0,0,.06); }

/* ---- 玩法卡 ---- */
.game-play-list { display: flex; flex-direction: column; gap: 9px; }
.game-play-card {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 12px; border-radius: var(--r-md); background: var(--surface);
  border: 1.5px solid var(--line); cursor: pointer; transition: transform .12s, border-color .12s, background .12s;
}
.game-play-card:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.game-play-card.is-on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(91, 91, 214, .1); }
.game-play-card .ico {
  flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 11px; background: var(--surface-3); font-size: 17px;
}
.game-play-card .body { min-width: 0; flex: 1; }
.game-play-card .body b { display: block; font-size: 13.5px; }
.game-play-card .body small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }
.game-play-card .rules { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.game-play-card .rules span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.game-play-card .rules .win { background: #e7f8ef; color: #12805a; }
.game-play-card .rules .lose { background: #fdeeee; color: #b83a3a; }
.game-play-card .tags { display: flex; gap: 6px; margin-top: 7px; }
.game-play-card .tags i {
  font-style: normal; font-size: 10.5px; color: var(--ink-3);
  background: var(--surface-3); padding: 2px 8px; border-radius: 999px;
}

/* ---- 逻辑训练营 ---- */
.game-camp-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-md);
  background: var(--sun-soft); border: 1.5px solid #ffe6a8; font-size: 11.5px; color: #8a5a00;
}
.game-camp-hint span { flex: 1; min-width: 120px; }
.game-coach-log {
  display: flex; flex-direction: column; gap: 9px; max-height: 300px; overflow: auto;
  padding: 4px 2px 8px; margin-bottom: 12px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
}
.coach-msg { display: flex; flex-direction: column; gap: 4px; max-width: 92%; }
.coach-msg .who { font-size: 10.5px; font-weight: 800; color: var(--ink-4); letter-spacing: .04em; }
.coach-msg p {
  margin: 0; padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.72;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
}
.coach-msg.is-coach p { border-top-left-radius: 5px; background: var(--brand-soft); border-color: var(--brand-line); }
.coach-msg.is-kid { align-self: flex-end; align-items: flex-end; }
.coach-msg.is-kid p { border-top-right-radius: 5px; background: var(--accent-soft); border-color: #ffd9c6; }
.coach-typing { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--ink-3); padding-left: 4px; }

/* ---- 勋章 ---- */
.game-badge-board { padding: 12px; margin-bottom: 12px; border-radius: var(--r-md); background: linear-gradient(150deg, #fffdf4, #fff7e2); border: 1.5px solid #ffe4a3; }
.game-badge-head { font-size: 12px; font-weight: 800; color: #8a5a00; margin-bottom: 9px; }
.game-badge-head b { color: var(--accent-strong); }
.game-badge-row { display: flex; flex-wrap: wrap; gap: 7px; }
.game-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border-radius: 999px; background: var(--surface); border: 1.5px solid #ffdf9b;
  font-size: 11.5px; color: #7a4f00; box-shadow: 0 2px 8px -4px rgba(224, 138, 0, .5);
}
.game-badge i { font-style: normal; font-size: 13px; }
.game-badge b { font-weight: 800; }
.game-badge small { display: none; }
.game-badge-row.is-side { display: flex; flex-direction: column; align-items: flex-start; }
.game-badge-row.is-side .game-badge small { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.game-said { margin: 6px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--ink-3); }
.game-said + .game-said { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* ---- 创作板（画布） ---- */
.game-board {
  width: min(100%, 760px); padding: 26px 26px 30px; border-radius: 24px;
  background: linear-gradient(170deg, #ffffff, #fbf9ff 60%, #f6f3ff);
  border: 1.5px solid var(--line); box-shadow: var(--shadow-md);
}
.game-board-head .kicker {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .12em;
  color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px;
}
.game-board-head h2 { margin: 10px 0 4px; font-size: 26px; letter-spacing: -.2px; color: var(--ink); }
.game-board-head p { font-size: 13.5px; line-height: 1.7; color: var(--ink-3); }
.game-board-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px;
}
.board-tile {
  position: relative; padding: 12px; border-radius: 18px; background: var(--surface);
  border: 1.5px dashed var(--line-strong); min-height: 96px;
}
.board-tile.is-on { border-style: solid; border-color: var(--line); box-shadow: 0 10px 24px -20px rgba(36, 24, 80, .6); }
.board-tile-label {
  position: absolute; top: 10px; right: 12px; font-size: 10px; font-weight: 800;
  letter-spacing: .1em; color: var(--ink-4); text-transform: uppercase;
}
.board-tile b { display: block; font-size: 13.5px; color: var(--ink); }
.board-tile small { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.board-tile-img {
  width: 68px; height: 68px; border-radius: 14px; margin-bottom: 9px;
  background-color: var(--surface-3); background-position: center; background-size: contain;
  background-repeat: no-repeat; border: 1.5px solid var(--line);
}
.board-tile-img.is-wide { width: 100%; height: 76px; background-size: cover; }
.board-tile-empty { font-size: 12px; color: var(--ink-4); padding: 26px 0 4px; text-align: center; }
.board-rule { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.board-rule span { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.board-rule .win { background: #e7f8ef; color: #12805a; }
.board-rule .lose { background: #fdeeee; color: #b83a3a; }
.board-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.board-badges span {
  font-size: 11px; padding: 4px 9px; border-radius: 999px;
  background: var(--sun-soft); border: 1.5px solid #ffe4a3; color: #7a4f00;
}
.game-board-foot { margin-top: 16px; font-size: 11.5px; color: var(--ink-4); text-align: center; }

@media (max-width: 900px) {
  .game-board { padding: 18px; }
  .game-board-head h2 { font-size: 21px; }
  .game-board-grid { grid-template-columns: 1fr; }
}

/* ---- v3.2：操作内联、关卡编辑、创意卡选择标记 ---- */

/* 主操作跟着内容走，但贴在滚动区底边：不常驻占高度，又永远点得到。
   之前是固定 104px 的底栏，直接把内容区压掉一屏的 1/8。 */
.game-actions {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; flex-direction: column;
  margin: 16px -18px -20px; padding: 12px 18px 14px;
  background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, .95));
  border-top: 1.5px solid var(--line);
  box-shadow: 0 -16px 24px -22px rgba(36, 24, 80, .5);
}
.game-actions .game-cost-bar { margin-bottom: 10px; }

.game-idea-card .pick {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; margin-top: 6px;
  display: grid; place-items: center; border: 1.5px solid var(--line);
  background: #fff; color: #fff;
}
.game-idea-card .pick svg { width: 13px; height: 13px; }
.game-idea-card.is-on .pick { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- 关卡设计 ---- */
.game-levels {
  margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed var(--line);
}
.game-levels.is-locked { opacity: .72; }
.game-levels-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.game-levels-head b { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.game-level-list { display: flex; flex-direction: column; gap: 7px; }
.game-level {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 9px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1.5px solid var(--line);
}
.game-level .no {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; margin-top: 6px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-deep);
  font-family: var(--mono); font-size: 11.5px; font-weight: 800;
}
.game-level .body { flex: 1; min-width: 0; }
.game-level .body .input { height: 34px; font-size: 12.5px; }
.game-level .body small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--ink-4); }
.game-level-del {
  flex: 0 0 26px; width: 26px; height: 26px; margin-top: 4px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-4);
}
.game-level-del:hover { background: #fdeeee; color: #b83a3a; }
.game-level-del svg { width: 14px; height: 14px; }
.game-level-tools { display: flex; gap: 7px; margin-top: 8px; }
.game-level-tools .btn { flex: 1; justify-content: center; }

/* ---- 创作板上的关卡列表 ---- */
.board-levels { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.board-levels span { display: flex; gap: 6px; font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
.board-levels b {
  flex: 0 0 16px; width: 16px; height: 16px; border-radius: 5px; margin-top: 1px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-deep);
  font-family: var(--mono); font-size: 10px;
}

/* 面板内容少的时候，主操作贴到面板底部，别在半空留一大片白 */
.game-panel { display: flex; flex-direction: column; min-height: 100%; }
.game-panel > .game-actions { margin-top: auto; }

/* 音乐工坊嵌入页 */
.music-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; min-height: 560px; }

/* ---- v3.3 游戏灵感选择 / 初始画布 ---- */
.game-spark-pick {
  margin-top: 10px; padding: 12px; border-radius: 16px;
  background: linear-gradient(160deg, #fff, var(--surface-2));
  border: 1.5px solid var(--line);
}
.game-spark-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 9px; }
.game-spark-title b { display: block; font-size: 12.5px; color: var(--ink-2); }
.game-spark-title small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }
.game-spark-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.game-mini {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px;
  border-radius: 8px; border: 1.5px solid var(--line); background: #fff;
  color: var(--ink-2); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.game-mini:hover { border-color: var(--brand-line); color: var(--brand-deep); background: var(--brand-soft); }
.game-mini svg { width: 12px; height: 12px; }
.game-spark-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.game-spark-card {
  display: flex; gap: 7px; align-items: center; text-align: left; min-width: 0;
  padding: 8px 9px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  transition: transform .14s, border-color .14s, background .14s, box-shadow .14s;
}
.game-spark-card:hover {
  border-color: var(--brand-line); background: var(--brand-soft); transform: translateY(-1px);
  box-shadow: 0 10px 20px -16px rgba(36, 24, 80, .65);
}
.game-spark-card .emoji {
  flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 9px; background: var(--surface-3); font-size: 15px;
}
.game-spark-card .body { min-width: 0; }
.game-spark-card b { display: block; font-size: 11.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-spark-card small { display: block; margin-top: 1px; font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-idea-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.game-idea-head .game-field-label { margin-bottom: 0; }
.game-idea-card .pick i { font-style: normal; font-size: 10px; font-weight: 800; color: var(--ink-4); }
.game-idea-card.is-on .pick i { color: var(--brand); }

.game-empty.game-empty-wide {
  width: 100%; max-width: 840px; padding: 22px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 26px; align-items: center; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-md);
}
.game-empty-stage {
  position: relative; aspect-ratio: 16 / 10; min-height: 220px; overflow: hidden;
  border-radius: 18px; border: 1.5px solid var(--line);
  background: radial-gradient(circle at 28% 18%, #eef0ff, #f8f6ff 55%, #fff6ef);
  display: flex; flex-direction: column;
}
.game-empty-stage-bar {
  display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
  background: rgba(255, 255, 255, .72); border-bottom: 1px solid rgba(91, 91, 214, .08);
}
.game-empty-stage-bar i { width: 6px; height: 6px; border-radius: 50%; background: #ffc9c9; }
.game-empty-stage-bar i:nth-child(2) { background: #ffe1a8; }
.game-empty-stage-bar i:nth-child(3) { background: #c9efd4; }
.game-empty-stage-bar span { margin-left: auto; font-size: 10px; color: var(--ink-3); letter-spacing: .06em; }
.game-empty-stage-body { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 14px; }
.game-empty-stage .game-empty-art {
  width: 58px; height: 58px; margin: 0; border-radius: 18px; font-size: 26px; box-shadow: var(--shadow-sm);
}
.game-empty-hint { font-size: 11px; color: var(--ink-3); }
.game-empty-copy .game-empty-kicker {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 3px 9px;
}
.game-empty-copy h3 { margin: 10px 0 6px; font-size: 22px; line-height: 1.25; }
.game-empty-copy p { font-size: 13px; line-height: 1.75; color: var(--ink-3); }
.game-empty-copy .game-empty-steps { justify-content: flex-start; margin-top: 14px; }

@media (max-width: 900px) {
  .game-empty.game-empty-wide { grid-template-columns: 1fr; max-width: 520px; padding: 16px; gap: 14px; }
  .game-empty-stage { min-height: 0; max-height: 230px; }
}
@media (max-width: 640px) {
  .game-spark-grid { grid-template-columns: 1fr; }
  .game-spark-head { flex-direction: column; }
  .game-spark-tools { width: 100%; }
  .game-spark-tools .game-mini { flex: 1; justify-content: center; }
}

/* ---- 绘本工作台：顶栏压成一条，画布拿回高度 ---- */
.book-bar { height: 56px; gap: 8px; padding: 0 16px; }
.book-bar .studio-title { max-width: 300px; }
.book-bar .icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; }
.book-bar .icon-btn:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.book-bar .icon-btn:disabled { opacity: .45; }
.book-bar .btn-sm { height: 34px; }
.book-page-chip {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
}
.book-bar .engine-banner { display: none; }
@media (max-width: 1180px) {
  .book-page-chip { display: none; }
}
@media (max-width: 900px) {
  .book-bar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 12px; }
  .book-bar .save-state { display: none; }
  .book-bar .studio-title { max-width: none; flex: 1 1 140px; }
}

/* 绘本也走沉浸创作：收起全站顶栏，只留一条 56px 工作栏 */
.app[data-view="studio-storybook"] .topbar { display: none; }
.app[data-view="studio-storybook"] .content { padding: 0; overflow: hidden; }

/* 平台管理台：音乐模型迁移提示 */
.music-settings-note {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px 14px;
  align-items: start; margin-top: 12px;
  border: 1.5px solid var(--brand-line);
  background: linear-gradient(135deg, #fff, #f4efff 58%, #fff4ed);
}
.music-settings-icon {
  grid-row: 1 / span 2;
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, #7c6cff, #ff8a65);
  box-shadow: 0 12px 24px -14px rgba(108, 92, 231, .8);
}
.music-settings-copy { min-width: 0; }
.music-settings-copy h3 { font-size: 15px; margin: 0 0 4px; }
.music-settings-copy p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--ink-3); }
.music-settings-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 900px) {
  .music-settings-note { grid-template-columns: 40px minmax(0, 1fr); }
  .music-settings-icon { width: 40px; height: 40px; border-radius: 13px; font-size: 20px; }
  .music-settings-actions { justify-content: flex-start; }
}

/* ---- 游戏底部操作条：主操作缩到版本快照左侧 ---- */
.game-film { padding: 0 14px; gap: 10px; }
.game-film-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 0; }
.game-film-actions .btn { height: 34px; padding: 0 13px; font-size: 12.5px; white-space: nowrap; }
.game-film-actions .btn svg { width: 14px; height: 14px; }
.game-film-label { flex: 0 0 auto; }
.game-film-status {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  color: var(--brand-deep); white-space: nowrap;
}
.game-film-status .gen-spinner { width: 16px; height: 16px; border-width: 2px; }
.game-film-note { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.game-film-cost {
  font-size: 11px; font-weight: 800; color: #8a5a00; background: var(--sun-soft);
  border: 1px solid #ffe8a8; border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}
@media (max-width: 900px) {
  .studio.game-studio { grid-template-rows: auto auto minmax(0, 1fr) 62px; }
  .studio.game-studio .film { display: flex; padding: 6px 10px; }
  .studio.game-studio .game-film .film-strip,
  .studio.game-studio .game-film-label { display: none; }
  .studio.game-studio .game-film-actions { width: 100%; justify-content: space-between; }
  .game-film-note { display: none; }
}

/* ---- 游戏：可选反派 / 关卡地图 / 生成等待态 ---- */
.game-monster-box {
  margin-top: 13px; padding: 11px 12px; border-radius: 14px;
  border: 1.5px dashed var(--line-strong); background: var(--surface-2);
}
.game-monster-box.is-empty { background: linear-gradient(160deg, #fff, #f8f4ff); }
.game-monster-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 5px; }
.game-monster-head b { font-size: 12.5px; }
.game-monster-head span { font-size: 10.5px; color: var(--ink-3); text-align: right; }
.game-monster-card { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.game-monster-shot {
  flex: 0 0 58px; width: 58px; height: 58px; border-radius: 14px; background: #fff center/contain no-repeat;
  border: 1.5px solid var(--line);
}
.game-monster-info { flex: 1; min-width: 0; }
.game-monster-info b { display: block; font-size: 13px; }
.game-monster-info p { margin: 2px 0 0; font-size: 11px; line-height: 1.55; color: var(--ink-3); }
.game-monster-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.game-level-map-thumb {
  flex: 0 0 44px; width: 44px; height: 34px; border-radius: 8px; background: var(--surface-3) center/cover no-repeat;
  border: 1.5px solid var(--line); position: relative; overflow: hidden;
}
.game-level-map-thumb i {
  position: absolute; right: 2px; bottom: 1px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; color: var(--brand-deep); font-size: 9px; font-style: normal; font-weight: 800;
  display: grid; place-items: center; border: 1px solid var(--brand-line);
}
.game-level .game-tool { flex: 0 0 28px; width: 28px; height: 28px; }
.game-level .game-tool svg { width: 14px; height: 14px; }

.game-waiting { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 9px; }
.game-waiting-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.game-waiting-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); }
.game-waiting-tabs button {
  border: 0; background: transparent; box-shadow: none; border-radius: 999px; padding: 6px 11px;
  font-size: 11.5px; color: var(--ink-3); font-weight: 700;
}
.game-waiting-tabs button.is-on { background: var(--brand-soft); color: var(--brand-deep); }
.game-waiting-stage { font-size: 11.5px; color: var(--ink-3); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-waiting-body {
  flex: 1; min-height: 0; overflow: hidden; border-radius: 18px;
  border: 1.5px solid var(--line); background: #eaf6ff; position: relative;
}
#waitingDino { display: block; width: 100%; height: 100%; touch-action: none; }
.game-waiting-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  color: rgba(36,31,61,.58); font-size: 11px; white-space: nowrap; pointer-events: none;
}
.game-waiting-code {
  margin: 0; padding: 16px; height: 100%; overflow: auto; background: #101426; color: #d9e2ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.7;
  white-space: pre-wrap;
}
.game-waiting-foot { display: flex; align-items: center; gap: 9px; }
.game-waiting-foot .progress { flex: 1; margin: 0; }

/* 灵感区：AI 方向与起点合并 */
.game-spark-grid.is-ideas { grid-template-columns: 1fr; }
.game-custom-direction { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line); }
.game-custom-direction .game-field-hint { margin-left: 5px; font-weight: 500; }
.game-custom-direction .input { margin-top: 6px; }

/* ---- 游戏：自定义风格、多玩法、关卡画布 ---- */
.game-custom-style { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.game-custom-style .game-field-hint { margin-left: 5px; font-weight: 500; }
.game-play-pick {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center; color: var(--brand);
}
.game-play-pick svg { width: 13px; height: 13px; }
.game-play-card.is-on .game-play-pick { background: var(--brand); border-color: var(--brand); color: #fff; }
.game-level { cursor: pointer; transition: border-color .15s, background .15s; }
.game-level.is-active { border-color: var(--brand-line); background: linear-gradient(90deg, #f7f3ff, #fff); }
.game-level-play { margin-top: 6px; height: 32px; font-size: 11.5px; padding: 4px 8px; }
.game-level-board {
  margin-top: 16px; border: 1.5px solid var(--line); border-radius: 20px; overflow: hidden;
  background: #fff;
}
.game-level-board-head {
  display: flex; align-items: baseline; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.game-level-board-head .kicker {
  font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 3px 8px;
}
.game-level-board-head b { font-size: 14px; }
.game-level-board-map {
  position: relative; height: 210px; background: var(--surface-3) center/cover no-repeat;
  display: grid; place-items: center;
}
.game-level-board-empty { color: var(--ink-3); font-size: 12px; text-align: center; padding: 16px; }
.game-level-avatar {
  position: absolute; bottom: 18px; width: 58px; height: 58px; border-radius: 16px;
  background: #fff center/contain no-repeat; border: 2px solid #fff;
  box-shadow: 0 10px 24px -12px rgba(30, 20, 70, .55);
}
.game-level-avatar.is-hero { left: 18px; }
.game-level-avatar.is-monster { right: 18px; }
.game-level-board-play {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.9);
  font-size: 11px; font-weight: 750; color: var(--ink-2); white-space: nowrap;
}
@media (max-width: 640px) {
  .game-level-board-map { height: 160px; }
  .game-level-board-head { gap: 5px; }
}

/* 游戏提示词设置 */
.game-prompt-settings {
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px;
  min-height: min(64vh, 620px);
}
.game-prompt-list {
  display: flex; flex-direction: column; gap: 5px;
  max-height: min(64vh, 620px); overflow: auto; padding-right: 4px;
}
.game-prompt-tab {
  text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; padding: 9px 10px; cursor: pointer; display: grid; gap: 2px;
  color: var(--ink-2); font-size: 12px; line-height: 1.35;
}
.game-prompt-tab b { font-size: 10px; color: var(--brand); letter-spacing: .05em; }
.game-prompt-tab span { font-weight: 650; color: var(--ink); }
.game-prompt-tab i { font-style: normal; font-size: 10px; color: #b26a00; }
.game-prompt-tab.is-on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(108,92,231,.09); }
.game-prompt-editor { min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.game-prompt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.game-prompt-head h4 { margin: 0 0 3px; font-size: 16px; }
.game-prompt-head p { margin: 0; color: var(--ink-3); font-size: 12px; }
.game-prompt-text {
  flex: 1; min-height: 340px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.65; tab-size: 2;
}
.game-prompt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.game-prompt-actions .small { margin-left: auto; }
@media (max-width: 760px) {
  .game-prompt-settings { grid-template-columns: 1fr; }
  .game-prompt-list { flex-direction: row; overflow-x: auto; max-height: none; }
  .game-prompt-tab { min-width: 150px; }
  .game-prompt-text { min-height: 260px; }
}

/* ---------------------------------------------------- 游戏 · 高级入口 */
.game-mode-switch {
  display: flex; gap: 2px; padding: 3px; border-radius: 10px;
  background: #f2f1f6; border: 1px solid var(--line);
}
.game-mode-switch button {
  height: 26px; padding: 0 11px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-3);
  font-size: 12px; font-weight: 800; cursor: pointer; transition: .15s;
}
.game-mode-switch button:hover { color: var(--ink-1); }
.game-mode-switch button.is-on {
  background: #fff; color: var(--ink-1);
  box-shadow: 0 1px 3px rgba(24, 20, 60, .12);
}
.game-adv-tip {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid #ffe0bd; border-radius: 12px;
  background: #fff8f1; color: #8a4a12;
  font-size: 12px; line-height: 1.65;
}
.game-adv-tip b { font-weight: 800; }
.game-adv-prompt {
  margin-top: 4px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfaff;
}
.game-adv-prompt summary {
  cursor: pointer; font-size: 12.5px; font-weight: 800; color: var(--ink-2);
  list-style: none;
}
.game-adv-prompt summary::-webkit-details-marker { display: none; }
.game-adv-prompt summary::before { content: '▸ '; color: var(--ink-3); }
.game-adv-prompt[open] summary::before { content: '▾ '; }
.game-adv-prompt pre {
  margin: 10px 0 0; max-height: 280px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.75; color: var(--ink-2);
}
.game-adv-prompt .game-adv-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.game-adv-count { font-size: 11px; color: var(--ink-3); font-weight: 700; }

/* 画布区：高级模式把「要发出去的那段话」摊开给人看 */
.game-adv-board {
  margin-top: 18px; padding: 0; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: #fff;
  box-shadow: 0 2px 10px rgba(24, 20, 60, .05);
}
.game-adv-board-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  background: #fbfaff; font-size: 12px; color: var(--ink-3);
}
.game-adv-board-head span { font-weight: 800; color: var(--ink-2); }
.game-adv-board-head b { font-weight: 800; color: var(--brand); }
.game-adv-board-text {
  margin: 0; padding: 16px 18px; max-height: 46vh; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.85; color: var(--ink-2);
  background: #fff;
}
.game-adv-flow {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px;
}
.game-adv-flow span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 99px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 11.5px; color: var(--ink-2);
}
.game-adv-flow b { color: var(--brand); }

/* 右栏：九项进度单 */
.game-adv-check { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 6px; }
.game-adv-check li {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-3);
}
.game-adv-check li i {
  width: 15px; height: 15px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); font-style: normal; font-size: 9px;
  color: var(--ink-3); background: #fff;
}
.game-adv-check li.is-on { color: var(--ink-1); font-weight: 700; }
.game-adv-check li.is-on i { background: var(--brand); border-color: var(--brand); color: #fff; }
.game-adv-check li em {
  font-style: normal; margin-left: 5px; padding: 0 5px; border-radius: 5px;
  background: #fff3e8; color: #b25c11; font-size: 10px; font-weight: 800;
}

/* 引导重构：高级表单字段标题与 AI 生成按钮 */
.game-adv-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.game-adv-label-row .game-field-label { margin: 0; }
.game-adv-label-row .game-mini { white-space: nowrap; }

/* ==========================================================================
   课文游戏（穿越语文）
   纸、墨、朱三色，和平台其它页面区分开：这里是一本书，不是一个工具。
   ========================================================================== */

.cls-page {
  --cls-ink: #3b3326;
  --cls-ink-2: #6b5f4b;
  --cls-ink-3: #9a8d75;
  --cls-paper: #fdf8ec;
  --cls-paper-2: #fbf2df;
  --cls-line: #e6d8bb;
  --cls-red: #c9542f;
  --cls-gold: #e8a33d;
  --cls-green: #3f6b4a;
  min-height: 100%;
  background:
    radial-gradient(1200px 400px at 50% -80px, #fffdf6 0%, rgba(255, 253, 246, 0) 70%),
    var(--cls-paper);
  color: var(--cls-ink);
  padding: 0 0 60px;
}

.cls-page .btn-primary {
  background: linear-gradient(140deg, #d0603a, #b8451f);
  border-color: transparent;
  box-shadow: 0 10px 22px -14px rgba(180, 70, 30, .9);
}
.cls-page .btn-primary:hover { background: linear-gradient(140deg, #c2552f, #a63d1a); }
.cls-page .btn:not(.btn-primary):not(.btn-accent) {
  background: #fffdf7; border-color: var(--cls-line); color: var(--cls-ink);
}
.cls-page .btn:not(.btn-primary):not(.btn-accent):hover { background: #fbf2df; }

/* ------------------------------------------------------------- 书架 */

.cls-hero {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 34px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 34px;
  align-items: center;
}
.cls-back {
  position: absolute; top: 16px; left: 20px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13.5px; font-weight: 700; color: var(--cls-ink-3);
  padding: 6px 10px 6px 4px; border-radius: 10px;
}
.cls-back:hover { background: rgba(59, 51, 38, .06); color: var(--cls-ink); }
.cls-hero-kicker {
  display: inline-block; margin-bottom: 8px; padding: 3px 10px;
  border-radius: 999px; background: #f5e6c8; color: #8a5a1e;
  font-size: 12px; font-weight: 800; letter-spacing: .12em;
}
.cls-hero h1 {
  font-size: 42px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15;
  margin: 4px 0 12px;
}
.cls-hero h1 span {
  color: var(--cls-red);
  background: linear-gradient(transparent 62%, #f7d9a8 62%);
  padding: 0 2px;
}
.cls-hero-sub { font-size: 15.5px; line-height: 1.85; color: var(--cls-ink-2); max-width: 560px; }
.cls-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.cls-hero-actions .btn { border-radius: 999px; }

.cls-book { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cls-book-cover {
  position: relative; width: 176px; height: 236px; border-radius: 8px 14px 14px 8px;
  background: linear-gradient(150deg, #f3e2bd 0%, #e8cfa0 52%, #dcbe86 100%);
  border: 1px solid #d3b47b;
  box-shadow: -6px 8px 0 -2px #e9d6b0, -8px 10px 22px -10px rgba(110, 80, 30, .5);
  padding: 20px 16px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-2.4deg);
}
.cls-book-cover::before {
  content: ''; position: absolute; inset: 10px; border: 1px solid rgba(150, 110, 50, .35); border-radius: 4px 10px 10px 4px;
}
.cls-book-pub { font-size: 10px; letter-spacing: .1em; color: #8a6a3a; margin-bottom: 12px; }
.cls-book-title { font-size: 30px; font-weight: 900; letter-spacing: .3em; color: #5a3f18; }
.cls-book-grade { margin-top: 10px; font-size: 13px; font-weight: 700; color: #7a5a28; letter-spacing: .06em; }
.cls-book-seal {
  position: absolute; right: 14px; bottom: 14px; width: 34px; height: 34px;
  border-radius: 6px; background: #b8402a; color: #fff4e2;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1.1;
  writing-mode: vertical-rl; letter-spacing: .1em; opacity: .9;
}
.cls-book-note { font-size: 11.5px; color: var(--cls-ink-3); }

.cls-shelf { max-width: 1180px; margin: 0 auto; padding: 0 34px; }
.cls-shelf-head { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 14px; }
.cls-shelf-head h2 { font-size: 17px; font-weight: 900; letter-spacing: .02em; }
.cls-shelf-sub { font-size: 12.5px; color: var(--cls-ink-3); }
.cls-unit { margin-bottom: 30px; }
.cls-unit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cls-unit-no { font-size: 14px; font-weight: 800; color: var(--cls-ink); }
.cls-unit-theme { font-size: 13px; color: var(--cls-ink-3); }
.cls-unit-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--cls-line), transparent); }

.cls-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.cls-card {
  position: relative; cursor: pointer; overflow: hidden;
  background: #fffdf7; border: 1px solid var(--cls-line); border-radius: 16px;
  padding: 16px 18px 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.cls-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--cls-tone, var(--cls-gold));
}
.cls-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--cls-tone, #e8a33d) 45%, #e6d8bb);
  box-shadow: 0 16px 30px -22px rgba(90, 60, 20, .55);
}
.cls-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cls-card-unit { font-size: 11.5px; font-weight: 700; color: var(--cls-ink-3); letter-spacing: .02em; }
.cls-card-mark {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 800; color: #9a6a12; background: #fbf0cf;
  padding: 2px 7px; border-radius: 999px;
}
.cls-card-mark svg { width: 11px; height: 11px; }
.cls-card-emoji {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: color-mix(in srgb, var(--cls-tone, #e8a33d) 16%, #fffdf7);
}
.cls-card h3 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.cls-card-meta { font-size: 12px; color: var(--cls-ink-3); }
.cls-card-sum { font-size: 13.5px; line-height: 1.7; color: var(--cls-ink-2); flex: 1; }
.cls-card-demo {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
  padding: 8px 10px; border-radius: 10px; background: #faf3e4;
  font-size: 13px; color: var(--cls-ink);
}
.cls-card-demo b { font-weight: 700; }
.cls-demo-tag { font-size: 11px; font-weight: 700; color: #8a5a1e; background: #f4e3c4; padding: 2px 6px; border-radius: 6px; }
.cls-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.cls-card-go {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 800; color: var(--cls-green);
}
.cls-card-go svg { width: 13px; height: 13px; }
.cls-card-remix {
  font-size: 12.5px; font-weight: 700; color: var(--cls-red);
  padding: 6px 10px; border-radius: 999px; border: 1px solid #f0cdb6; background: #fff5ea;
}
.cls-card-remix:hover { background: #ffe9d6; }

.cls-foot { max-width: 1180px; margin: 8px auto 0; padding: 22px 34px 0; border-top: 1px dashed var(--cls-line); }
.cls-foot p { font-size: 14px; line-height: 1.85; color: var(--cls-ink-2); }
.cls-foot p.small { margin-top: 6px; font-size: 12.5px; }

/* ------------------------------------------------------------- 课文页 */

.cls-lesson { padding-bottom: 40px; }
.cls-bar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: rgba(253, 248, 236, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cls-line);
}
.cls-bar .cls-back { position: static; padding: 6px 8px 6px 4px; }
.cls-bar-title { display: flex; flex-direction: column; line-height: 1.3; }
.cls-bar-unit { font-size: 11.5px; color: var(--cls-ink-3); }
.cls-bar-title b { font-size: 16px; }
.cls-mark-on {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 800; color: #9a6a12;
  background: #fbf0cf; padding: 5px 10px; border-radius: 999px;
}
.cls-mark-on svg { width: 12px; height: 12px; }
.cls-sound {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--cls-ink-2);
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--cls-line); background: #fffdf7;
}
.cls-sound:hover { background: #fbf2df; }

.cls-lesson-grid {
  max-width: 1180px; margin: 0 auto; padding: 22px 34px 8px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 26px;
  align-items: start;
}

.cls-read-head h1 { font-size: 30px; font-weight: 900; letter-spacing: -.01em; }
.cls-read-meta { margin-top: 6px; font-size: 12.5px; color: var(--cls-ink-3); }

.cls-excerpt {
  margin-top: 16px; padding: 20px 22px;
  background: #fffdf7; border: 1px solid var(--cls-line); border-radius: 14px;
  position: relative;
}
.cls-excerpt::before {
  content: '“'; position: absolute; top: 2px; left: 10px;
  font-size: 44px; line-height: 1; color: #e8d5ae; font-family: Georgia, serif;
}
.cls-excerpt p {
  font-size: 16.5px; line-height: 2.05; color: #33291c;
  text-indent: 2em; margin-bottom: 10px; font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
}
.cls-excerpt p:last-child { margin-bottom: 0; }

.cls-read-tip {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px;
  background: #fdf3dd; border: 1px dashed #e6c78f;
}
.cls-tip-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 800; color: #8a5a1e;
}
.cls-tip-label svg { width: 13px; height: 13px; }
.cls-read-tip p { margin-top: 5px; font-size: 14px; line-height: 1.8; color: #6b4b1d; }

.cls-bridge {
  margin-top: 18px; padding: 16px 18px; border-radius: 14px;
  background: #f7f4ea; border: 1px solid var(--cls-line);
}
.cls-bridge-head { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--cls-ink-3); margin-bottom: 10px; }
.cls-bridge-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; padding: 8px 0; }
.cls-bridge-row + .cls-bridge-row { border-top: 1px dashed #e2d5ba; }
.cls-bridge-row span {
  font-size: 11.5px; font-weight: 800; color: var(--cls-ink-3);
  padding: 2px 0;
}
.cls-bridge-row.is-game span { color: var(--cls-red); }
.cls-bridge-row p { font-size: 14px; line-height: 1.75; color: var(--cls-ink); }
.cls-bridge-link {
  margin-top: 8px; padding-top: 10px; border-top: 1px solid #e8dcc4;
  font-size: 13px; line-height: 1.75; color: #7a5a28;
}

.cls-play { position: sticky; top: 68px; }
.cls-stage-wrap {
  background: #fffdf7; border: 1px solid var(--cls-line); border-radius: 16px;
  padding: 10px; box-shadow: 0 18px 34px -30px rgba(90, 60, 20, .6);
}
.cls-stage { position: relative; width: 100%; aspect-ratio: 880 / 520; border-radius: 10px; overflow: hidden; background: var(--cls-paper); }
.cls-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.cls-play-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.cls-play-title { display: flex; flex-direction: column; gap: 3px; }
.cls-play-title b { font-size: 16px; }
.cls-play-goal { font-size: 12.5px; color: var(--cls-ink-3); }
.cls-play-keys {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
  font-size: 12px; color: var(--cls-ink-3);
}
.cls-play-keys svg { width: 13px; height: 13px; }

/* ------------------------------------------------------------- 改编区 */

.cls-remix {
  max-width: 1180px; margin: 10px auto 0; padding: 24px 34px 4px;
}
.cls-remix-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.cls-remix-head h2 { font-size: 24px; font-weight: 900; }
.cls-remix-head p { margin-top: 6px; font-size: 14px; line-height: 1.8; color: var(--cls-ink-2); max-width: 640px; }
.cls-remix-badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12px; font-weight: 800; color: var(--cls-red);
  background: #fff1e6; border: 1px solid #f3d2ba; padding: 6px 12px; border-radius: 999px;
}
.cls-remix-badge svg { width: 13px; height: 13px; }

.cls-remix-field { margin-bottom: 14px; }
.cls-remix-field label {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 700; margin-bottom: 7px;
}
.cls-remix-field label i {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800;
  background: #f0e0c2; color: #8a5a1e;
}
.cls-remix-field textarea {
  width: 100%; max-width: 820px; resize: vertical; min-height: 62px;
  padding: 12px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.7;
  border: 1px solid var(--cls-line); background: #fffdf7; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cls-remix-field textarea:focus { border-color: var(--cls-gold); box-shadow: 0 0 0 3px rgba(232, 163, 61, .16); }
.cls-remix-field textarea::placeholder { color: #b6a98f; }

.cls-seeds { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 18px; }
.cls-seeds-label { font-size: 12.5px; color: var(--cls-ink-3); }
.cls-seed {
  font-size: 12.5px; line-height: 1.6; text-align: left;
  padding: 7px 12px; border-radius: 10px; max-width: 100%;
  border: 1px dashed #e0cfa9; background: #fdf6e6; color: #6b5b3c;
}
.cls-seed:hover { background: #fbeccd; border-color: var(--cls-gold); color: #5a4420; }

.cls-remix-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cls-remix-go { border-radius: 999px; padding: 12px 22px; }

/* ------------------------------------------------------------- 响应式 */

@media (max-width: 980px) {
  .cls-hero { grid-template-columns: 1fr; padding: 26px 20px 20px; }
  .cls-book { display: none; }
  .cls-hero h1 { font-size: 34px; }
  .cls-shelf, .cls-lesson-grid, .cls-remix, .cls-foot { padding-left: 20px; padding-right: 20px; }
  .cls-lesson-grid { grid-template-columns: 1fr; }
  .cls-play { order: -1; }
  .cls-excerpt p { font-size: 16px; }
}

@media (max-width: 680px) {
  .cls-hero h1 { font-size: 28px; }
  .cls-hero-sub { font-size: 14.5px; }
  .cls-cards { grid-template-columns: 1fr; }
  .cls-bar { padding: 10px 12px; }
  .cls-bar-title b { font-size: 14.5px; }
  .cls-sound span { display: none; }
  .cls-lesson-grid, .cls-remix { padding-left: 14px; padding-right: 14px; }
  .cls-remix { padding-bottom: 20px; }
  .cls-remix-head h2 { font-size: 20px; }
  .cls-seeds { gap: 6px; }
  .cls-seed { font-size: 12px; }
}
