/* ============================================================
   阅读小岛 · 儿童化主题（Bootstrap 4 之上的覆盖层）
   第一部分：基础变量、排版、导航、按钮、卡片、地图、阅读、答题、结算
   ============================================================ */

:root {
  --cream: #fff6e9;
  --cream-deep: #fce9c9;
  --ink: #2a2a3c;
  --ink-soft: #5b5a6e;
  --muted: #8c8a99;
  --coral: #ee5d3e;
  --coral-strong: #d64726;
  --coral-soft: #ffe1d8;
  --yellow: #ffc94a;
  --yellow-soft: #fff1c9;
  --teal: #189c8d;
  --teal-strong: #12776b;
  --teal-soft: #ddf3ef;
  --blue: #4b7bd6;
  --blue-soft: #e3ecfb;
  --purple: #7a63d2;
  --purple-soft: #ede7fc;
  --green: #2f9e5f;
  --green-soft: #dff4e6;
  --line: #efe0cc;
  --radius-lg: 32px;
  --radius: 24px;
  --radius-sm: 16px;
  --shadow-sm: 0 4px 14px rgba(88, 64, 40, 0.08);
  --shadow: 0 10px 26px rgba(88, 64, 40, 0.1);
  --shadow-md: 0 16px 40px rgba(88, 64, 40, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 8% -10%, #ffe7cc 0%, rgba(255, 231, 204, 0) 68%),
    radial-gradient(900px 520px at 100% 0%, #ddf3ef 0%, rgba(221, 243, 239, 0) 62%),
    var(--cream);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 6px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }

p { margin: 0 0 10px; }

a { color: var(--teal-strong); }

img,
svg {
  max-width: 100%;
}

/* ------------------------------------------------------------ 图标尺寸约束 */

.icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
  vertical-align: -0.18em;
  fill: none;
  stroke: currentColor;
}

.island-logo {
  width: 42px;
  height: 42px;
  flex: none;
}

/* ------------------------------------------------------------ 页面骨架 */

.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 72px;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-hero h1 {
  font-size: clamp(28px, 3vw, 38px);
  margin: 6px 0 6px;
}

.page-hero p {
  max-width: 640px;
  color: var(--ink-soft);
  font-size: 16px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

/* ------------------------------------------------------------ 顶部导航 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 0;
  background: rgba(255, 253, 249, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  text-decoration: none;
}

.brand:hover,
.brand:focus {
  text-decoration: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.navbar-toggler {
  border: none;
  background: transparent;
  padding: 8px;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.navbar-toggler-bar {
  display: block;
  width: 24px;
  height: 3px;
  margin: 4px 0;
  border-radius: 3px;
  background: var(--ink);
}

.topnav {
  gap: 2px;
}

.topnav .nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
}

.topnav .nav-link:hover {
  color: var(--coral-strong);
  background: var(--coral-soft);
}

.topnav .nav-link.is-active {
  color: var(--coral-strong);
  background: var(--coral-soft);
}

.nav-count {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
}

.nav-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  flex: none;
}

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fffdf9;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

.wallet-chip .icon {
  width: 17px;
  height: 17px;
  color: var(--coral-strong);
}

.sound-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-left: 10px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fffdf9;
  color: var(--ink-soft);
  flex: none;
}

.sound-toggle .icon {
  width: 20px;
  height: 20px;
}

.sound-toggle .sound-off { display: none; }
.sound-toggle.is-muted .sound-on { display: none; }
.sound-toggle.is-muted .sound-off { display: inline-block; }

/* ------------------------------------------------------------ 提示条 / 轻提示 */

.flash-stack {
  margin-top: 16px;
}

.flash {
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}

/* 站内轻提示：使用自己的 class，避免继承 Bootstrap .toast 的 flex-basis 和圆角 */
.toast-root .island-toast {
  flex: none;
  width: auto;
  max-width: min(88vw, 460px);
  padding: 12px 22px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  box-shadow: var(--shadow-md);
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-root .island-toast.is-leaving {
  opacity: 0;
  transform: translateY(10px);
}

/* ------------------------------------------------------------ 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 201, 74, 0.45);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-lg {
  min-height: 56px;
  padding: 14px 28px;
  font-size: 18px;
}

.btn-xl {
  min-height: 66px;
  padding: 16px 34px;
  font-size: 20px;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 16px;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(180deg, #ff7e5f, var(--coral));
  color: #fff;
  box-shadow: 0 8px 18px rgba(238, 93, 62, 0.28);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(180deg, #ff8d71, #e85234);
  color: #fff;
}

.btn-teal {
  background: linear-gradient(180deg, #2fbfad, var(--teal));
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 156, 141, 0.26);
}

.btn-teal:hover,
.btn-teal:focus {
  background: linear-gradient(180deg, #3fd0be, #13887b);
  color: #fff;
}

.btn-ghost {
  background: #fffdf9;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: #fff;
  border-color: #e3cdb2;
  color: var(--ink);
}

.btn-danger-ghost {
  background: #fff1ee;
  border-color: #f6c7bc;
  color: #c4402a;
}

.btn-danger-ghost:hover {
  background: #ffe6df;
  color: #b33a24;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.text-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--teal-strong);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.text-btn:hover {
  background: var(--teal-soft);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-strong);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--coral-strong);
  text-decoration: none;
}

.text-link .icon {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------ 进度条 */

.progress {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: #f4e7d3;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb648, var(--coral));
  transition: width 0.4s ease;
}

.progress--small { height: 8px; }
.progress--daily { height: 16px; }

/* ------------------------------------------------------------ 面板 */

.panel {
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 20px;
  margin: 0 0 3px;
}

.panel-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.panel-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #8a5a08;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.panel-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 首页欢迎页 */

.welcome {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: center;
  padding: 18px 0 40px;
}

.welcome-art {
  position: relative;
  height: min(58vh, 460px);
  min-height: 320px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffefd9, #e7f8f2);
  box-shadow: var(--shadow);
}

.art-sun {
  position: absolute;
  top: 34px;
  left: 38px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 14px rgba(255, 201, 74, 0.22);
}

.art-cloud {
  position: absolute;
  height: 44px;
  border-radius: 999px;
  background: #fff;
  opacity: 0.92;
}

.art-cloud--one { top: 46px; right: 44px; width: 118px; }
.art-cloud--two { top: 108px; right: 152px; width: 84px; }

.art-hill {
  position: absolute;
  bottom: -40px;
  left: -10%;
  width: 120%;
  height: 220px;
  border-radius: 50% 50% 0 0;
}

.art-hill--back { background: #b9e6dc; bottom: -70px; }
.art-hill--front { background: #2aa79a; }

.art-book {
  position: absolute;
  top: 52%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 28px;
  background: #fff;
  color: var(--coral-strong);
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
  animation: floaty 4.6s ease-in-out infinite;
}

.art-book > .icon {
  width: 86px;
  height: 86px;
}

.art-sparkle {
  position: absolute;
  color: var(--yellow);
}

.art-sparkle--one { top: 6px; right: 8px; }
.art-sparkle--two { bottom: 8px; left: 4px; color: var(--teal); }

.art-sparkle .icon {
  width: 26px;
  height: 26px;
}

.welcome-copy h1 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.2;
}

.welcome-copy .highlight {
  color: var(--coral);
}

.welcome-lead {
  max-width: 520px;
  font-size: 17px;
  color: var(--ink-soft);
}

.start-form {
  margin-top: 22px;
}

.start-label {
  font-size: 16px;
  font-weight: 800;
}

.start-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.start-input {
  flex: 1;
  min-height: 54px;
  padding: 0 20px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 17px;
  color: var(--ink);
  outline: none;
}

.start-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(238, 93, 62, 0.14);
}

.start-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.welcome-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.welcome-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.point-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex: none;
}

.point-icon .icon {
  width: 18px;
  height: 18px;
}

.point-icon--coral { background: var(--coral-soft); color: var(--coral-strong); }
.point-icon--teal { background: var(--teal-soft); color: var(--teal-strong); }
.point-icon--yellow { background: var(--yellow-soft); color: #a66a00; }

/* ------------------------------------------------------------ 地图首屏 */

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 20px;
  padding: 30px;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(620px 260px at 10% 0%, #ffe6ca 0%, rgba(255, 230, 202, 0) 70%),
    radial-gradient(620px 280px at 94% 8%, #d9f3ed 0%, rgba(217, 243, 237, 0) 70%),
    #fffdf9;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(30px, 3.4vw, 44px);
}

.hero-sub {
  max-width: 520px;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.level-ring {
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--percent, 0) * 1%), #f0e3d0 0);
}

.level-ring-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: #fffdf9;
  box-shadow: inset 0 0 0 2px var(--line);
}

.level-ring-label {
  font-size: 12px;
  color: var(--muted);
}

.level-ring-inner strong {
  font-size: 42px;
  line-height: 1.1;
  color: var(--coral-strong);
}

.level-bar {
  width: 100%;
  max-width: 260px;
}

.level-bar-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--yellow-soft);
  color: #a66a00;
  flex: none;
}

.stat-icon .icon {
  width: 22px;
  height: 22px;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.stat-card span {
  font-size: 12px;
  color: var(--muted);
}

.stat-card--coins .stat-icon { background: var(--yellow-soft); color: #a66a00; }
.stat-card--streak .stat-icon { background: var(--coral-soft); color: var(--coral-strong); }
.stat-card--book .stat-icon { background: var(--teal-soft); color: var(--teal-strong); }
.stat-card--words .stat-icon { background: var(--blue-soft); color: #2f4f74; }

.daily-card {
  margin: 6px 0 22px;
  padding: 22px 26px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.daily-card.is-met {
  border-color: #bfe6dd;
  background: linear-gradient(160deg, #e9f8f2, #fffdf9 70%);
}

.daily-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.daily-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.daily-copy h2 {
  margin: 2px 0 0;
  font-size: 30px;
}

.daily-copy h2 span {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.daily-copy p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.daily-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #a66a00;
}

.daily-badge .icon {
  width: 30px;
  height: 30px;
}

/* ------------------------------------------------------------ 关卡地图 */

.map-section {
  margin-top: 26px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.section-heading p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.stage-list {
  display: grid;
  gap: 20px;
}

.stage-card {
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.stage--forest { background: linear-gradient(170deg, #f3fbf7, #fffdf9 60%); }
.stage--valley { background: linear-gradient(170deg, #fdf6ff, #fffdf9 60%); }
.stage--cloud { background: linear-gradient(170deg, #eff4ff, #fffdf9 60%); }

.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.stage-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff;
  color: var(--teal-strong);
  box-shadow: var(--shadow-sm);
  flex: none;
}

.stage-mark .icon {
  width: 26px;
  height: 26px;
}

.stage-copy {
  flex: 1;
  min-width: 200px;
}

.stage-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.stage-head h3 {
  margin: 2px 0 3px;
  font-size: 20px;
}

.stage-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.stage-count {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.stage-path {
  display: grid;
  gap: 10px;
}

.level-node {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

/* 锁定关卡提示：放进卡片内部换行排列，不覆盖其它关卡 */
.level-tip {
  position: relative;
  display: inline-block;
  width: fit-content;
  max-width: calc(100% - 58px);
  margin: 10px 0 2px 58px;
  padding: 10px 16px;
  border: 2px solid #f3c98c;
  border-radius: 14px;
  background: #fffaf0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 6px 14px rgba(151, 106, 39, 0.12);
}

.level-tip::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 22px;
  width: 12px;
  height: 12px;
  border-top: 2px solid #f3c98c;
  border-left: 2px solid #f3c98c;
  background: #fffaf0;
  transform: rotate(45deg);
}

.level-node:hover {
  border-color: #f3c98c;
  box-shadow: var(--shadow);
  text-decoration: none;
  transform: translateY(-2px);
  color: var(--ink);
}

.is-current .level-node {
  border-color: #b7e3d9;
  background: linear-gradient(120deg, #edfbf7, #fff);
}

.is-locked .level-node {
  background: #fcf7ef;
  opacity: 0.68;
}

.node-circle {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--yellow-soft);
  color: #a66a00;
  font-weight: 900;
  flex: none;
}

.is-done .node-circle {
  background: var(--teal-soft);
  color: var(--teal-strong);
}

.is-locked .node-circle {
  background: #f1e8db;
  color: var(--muted);
}

.node-circle .icon {
  width: 26px;
  height: 26px;
}

.node-number {
  font-size: 20px;
}

.node-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.node-topline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-index {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.node-difficulty {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #2f4f74;
  font-size: 11px;
  font-weight: 800;
}

.node-title {
  font-size: 18px;
  font-weight: 900;
}

.node-sub {
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.node-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-strong);
  font-size: 13px;
  font-weight: 800;
  flex: none;
  white-space: nowrap;
}

.is-locked .node-cta {
  background: #f1e8db;
  color: var(--muted);
}

.node-cta .icon {
  width: 15px;
  height: 15px;
}

.stars-row {
  display: inline-flex;
  gap: 2px;
}

.star-slot {
  display: inline-flex;
  color: #d9cdbb;
}

.star-slot.is-filled {
  color: var(--yellow);
}

.stars-row .icon {
  width: 16px;
  height: 16px;
}

.finish-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 20px 24px;
  border: 2px dashed #f0d79b;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fff3d2, #fffdf9);
}

.finish-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #fff;
  color: #a66a00;
  flex: none;
}

.finish-banner h2 {
  margin: 0;
  font-size: 20px;
}

.finish-banner p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.finish-banner .btn {
  margin-left: auto;
}

/* ------------------------------------------------------------ 阅读关卡页 */

.level-wrap {
  max-width: 940px;
  margin: 0 auto;
}

.level-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-strong);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  color: var(--coral-strong);
  text-decoration: none;
}

.back-link .icon {
  width: 16px;
  height: 16px;
}

.level-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.level-hero h1 {
  margin: 8px 0 4px;
  font-size: clamp(26px, 3vw, 36px);
}

.level-hero p {
  color: var(--ink-soft);
}

.level-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.level-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.level-meta .icon {
  width: 16px;
  height: 16px;
}

.done-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.story-card {
  padding: 26px 30px;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.story-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.story-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--teal-strong);
}

.story-head h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.story-length {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.story-text {
  padding: 6px 0;
  font-size: 26px;
  line-height: 2.05;
  letter-spacing: 0.02em;
  color: #23222f;
}

.story-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}

.story-tip {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 答题 */

.quiz-card {
  margin-top: 20px;
  padding: 24px 26px;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.quiz-head {
  margin-bottom: 14px;
}

.quiz-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.quiz-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.quiz-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.quiz-dots {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.quiz-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #efe2ce;
  transition: background 0.2s ease, transform 0.2s ease;
}

.quiz-dot.is-active {
  background: var(--yellow);
  transform: scale(1.15);
}

.quiz-dot.is-done {
  background: var(--teal);
}

.question-kind {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #8a5a08;
  font-size: 13px;
  font-weight: 800;
}

.question-kind.is-inference {
  background: var(--purple-soft);
  color: var(--purple);
}

.question-panel h3 {
  margin: 12px 0 16px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.55;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.option:hover:not(:disabled) {
  border-color: #f3c98c;
  background: #fffbf1;
  transform: translateY(-1px);
}

.option-letter {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow-soft);
  color: #8a5a08;
  font-weight: 900;
  flex: none;
}

.option-text {
  flex: 1;
}

.option.is-correct {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #0f6b5f;
}

.option.is-correct .option-letter {
  background: #fff;
  color: var(--teal-strong);
}

.option.is-wrong {
  border-color: #e8a79a;
  background: #fff0ec;
  color: #b33d28;
}

.option.is-wrong .option-letter {
  background: #fff;
  color: #b33d28;
}

.option.is-dim {
  opacity: 0.5;
}

.option:disabled {
  cursor: default;
}

.feedback {
  min-height: 26px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
}

.feedback.is-correct { color: var(--teal-strong); }
.feedback.is-wrong { color: #c4402a; }

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ------------------------------------------------------------ 结算弹层 */

.result-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(42, 42, 60, 0.5);
  backdrop-filter: blur(3px);
  overflow: auto;
}

.confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.result-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  text-align: center;
  overflow: auto;
  animation: pop 0.28s ease;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.result-star {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f4e8d6;
  color: #dccdb6;
  transform: scale(0.9);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.result-star .icon {
  width: 30px;
  height: 30px;
}

.result-star.is-earned {
  background: linear-gradient(160deg, #ffe9a8, var(--yellow));
  color: #8a5a08;
  box-shadow: 0 10px 20px rgba(201, 138, 19, 0.3);
  transform: scale(1);
}

.result-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.result-card h2 {
  margin: 6px 0;
  font-size: 26px;
}

.result-sub {
  font-size: 15px;
  color: var(--ink-soft);
}

.result-rewards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.result-reward {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.result-reward strong {
  font-size: 22px;
  color: var(--coral-strong);
}

.result-reward > span:last-child {
  font-size: 12px;
  color: var(--muted);
}

.reward-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--yellow-soft);
  color: #a66a00;
}

.result-reward--coin .reward-icon { background: var(--yellow-soft); color: #a66a00; }
.result-reward--xp .reward-icon { background: var(--purple-soft); color: var(--purple); }
.result-reward--streak .reward-icon { background: var(--coral-soft); color: var(--coral-strong); }

.result-sand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -4px 0 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 14px;
  font-weight: 700;
}
.result-sand[hidden] { display: none; }
.result-sand strong { font-size: 17px; }
.result-sand span { font-size: 12px; font-weight: 500; color: var(--ink-soft); }

.levelup-note {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 15px;
  font-weight: 800;
}

.unlock-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.unlock-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px dashed #efdcaf;
  border-radius: 14px;
  background: #fffbf0;
  text-align: left;
}

.unlock-icon {
  color: var(--yellow);
  font-size: 18px;
}

.unlock-copy {
  display: flex;
  flex-direction: column;
}

.unlock-copy strong { font-size: 14px; }
.unlock-copy span { font-size: 12px; color: var(--muted); }

.daily-result {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f6f1e6;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.daily-result.is-met {
  background: var(--green-soft);
  color: var(--green);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

/* ------------------------------------------------------------ 徽章墙 */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.badge-card {
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.badge-card.is-locked {
  background: #fbf6ed;
  opacity: 0.72;
}

.medal {
  display: grid;
  place-items: center;
  width: var(--medal-size, 64px);
  height: var(--medal-size, 64px);
  margin: 0 auto 8px;
  border-radius: 50%;
}

.medal .icon {
  width: calc(var(--medal-size, 64px) * 0.52);
  height: calc(var(--medal-size, 64px) * 0.52);
}

.medal--gold { background: linear-gradient(160deg, #ffe9a8, var(--yellow)); color: #8a5a08; }
.medal--silver { background: linear-gradient(160deg, #f1f3f6, #cfd6e0); color: #4a5568; }
.medal--bronze { background: linear-gradient(160deg, #f6d8bd, #d9a273); color: #7a4420; }

.badge-tier {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.badge-card h2 {
  margin: 4px 0;
  font-size: 18px;
}

.badge-card p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.badge-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.badge-state .icon {
  width: 14px;
  height: 14px;
}

.badge-progress {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.badge-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 家长中心 */

.parent-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.parent-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.parent-stat strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.parent-stat small {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.parent-stat div > span {
  font-size: 12px;
  color: var(--muted);
}

.parent-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
}

.week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.week-xp {
  font-size: 12px;
  font-weight: 800;
}

.week-bar-wrap {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 130px;
  border-radius: 10px;
  background: #f8f1e5;
  overflow: hidden;
}

.week-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffd36b, #ffb648);
}

.week-bar.is-met {
  background: linear-gradient(180deg, #3fc7b4, var(--teal));
}

.week-label {
  font-size: 12px;
  color: var(--muted);
}

.week-col.is-today .week-label {
  color: var(--coral-strong);
  font-weight: 800;
}

.goal-form label {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}

.goal-controls {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.goal-controls select {
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.reset-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.reset-block h3 {
  font-size: 17px;
}

.reset-block p {
  font-size: 13px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.parent-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
}

.parent-table th,
.parent-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.parent-table th {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #fffaf0;
}

.parent-table tbody tr:nth-child(even) {
  background: #fffaf4;
}

.parent-table tr.is-locked {
  opacity: 0.58;
}

.table-level {
  font-weight: 800;
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1e8db;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill--done { background: var(--green-soft); color: var(--green); }
.status-pill--open { background: var(--teal-soft); color: var(--teal-strong); }

.parent-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.parent-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.parent-badge .medal {
  margin: 0;
}

/* ------------------------------------------------------------ 查词弹窗 */

.dict-modal {
  border: none;
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.26);
}

.dict-modal .modal-header {
  padding: 18px 22px 10px;
  border-bottom: 1px dashed var(--line);
}

.dict-modal .modal-title {
  font-weight: 900;
}

.dict-modal .modal-body {
  padding: 16px 22px;
}

.dict-modal .modal-footer {
  padding: 10px 22px 20px;
  border-top: none;
}

.dict-word {
  font-size: 40px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.06em;
}

.dict-pinyin {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--coral-strong);
}

.dict-section h3 {
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dict-meaning {
  font-size: 17px;
}

.dict-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dict-examples li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 13px;
  font-weight: 700;
}

.dict-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 16px;
}

.dict-word--small {
  font-size: 26px;
}

.dict-part {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

/* ------------------------------------------------------------ 动画 */

@keyframes pop {
  0% { opacity: 0; transform: scale(0.92) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes floaty {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -56%); }
}

/* ============================================================
   升级新增：每日任务 / 复习 / 生字本 / 角色装扮
   仍然是 Bootstrap 之上的儿童化覆盖，配色与圆角沿用上面的变量
   ============================================================ */

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card--mastery .stat-icon {
  background: var(--purple-soft);
  color: var(--purple);
}

.daily-tasks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 12px;
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.task-card--review {
  background: linear-gradient(160deg, #e9f7f3, #fffdf9 72%);
}

.task-card--vocab {
  background: linear-gradient(160deg, #eef2ff, #fffdf9 72%);
}

.task-card--chest {
  background: linear-gradient(160deg, #fff4cf, #fffdf9 72%);
}

.task-card.is-done {
  opacity: 0.78;
}

.task-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #fff;
  color: var(--coral-strong);
  box-shadow: var(--shadow-sm);
}

.task-icon .icon {
  width: 24px;
  height: 24px;
}

.task-copy h2 {
  margin-bottom: 4px;
  font-size: 19px;
}

.task-copy p {
  font-size: 15px;
  color: var(--ink-soft);
}

.task-card .btn {
  margin-top: auto;
  align-self: flex-start;
  min-height: 44px;
  padding: 9px 18px;
  font-size: 15px;
}

.task-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.streak-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 22px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #fffdf9;
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}

.streak-note .icon {
  color: var(--coral-strong);
}

/* ------------------------------------------------------------ 阅读页点选字词 */

.story-token {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}

.story-char {
  border-bottom: 1px dotted rgba(24, 156, 141, 0.35);
}

.story-word {
  border-bottom: 2px dotted rgba(238, 93, 62, 0.4);
  background: rgba(255, 201, 74, 0.13);
}

.story-token:hover,
.story-token:focus-visible {
  background: var(--yellow-soft);
  color: var(--coral-strong);
}

.dict-loading {
  color: var(--muted);
  font-size: 17px;
}

.dict-meta {
  color: var(--ink-soft);
  font-size: 15px;
}

/* ------------------------------------------------------------ 复习 / 生字练习 */

.review-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.review-stats {
  display: flex;
  gap: 10px;
  flex: none;
}

.mini-stat {
  min-width: 82px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf9;
  text-align: center;
}

.mini-stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  color: var(--coral-strong);
}

.mini-stat span {
  font-size: 12px;
  color: var(--muted);
}

.review-source {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #2f4f74;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.review-card .option-text {
  font-size: 18px;
}

.mastery-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 700;
  font-size: 15px;
}

.mistake-note {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.empty-panel {
  padding: 46px 26px;
  text-align: center;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-strong);
}

.empty-icon .icon {
  width: 34px;
  height: 34px;
}

.empty-panel h2 {
  margin-bottom: 8px;
}

.empty-panel p {
  max-width: 560px;
  margin: 0 auto 18px;
  color: var(--ink-soft);
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ 生字本 */

.vocab-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.vocab-actions {
  display: flex;
  gap: 10px;
  flex: none;
}

.mastery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.mastery-card {
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
}

.mastery-card--new { border-color: #f3d9b0; background: #fff8ec; }
.mastery-card--familiar { border-color: #bfe6dd; background: #eefaf6; }
.mastery-card--mastered { border-color: #d4c7f5; background: #f4f0ff; }

.mastery-label {
  display: inline-block;
  margin-bottom: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.mastery-card strong {
  display: block;
  font-size: 21px;
}

.mastery-card p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.vocab-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.vocab-summary-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fffdf9;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.vocab-group {
  margin-bottom: 26px;
}

.vocab-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.vocab-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.vocab-card--new { border-color: #f3e2c6; }
.vocab-card--familiar { border-color: #cfe9e2; }
.vocab-card--mastered { border-color: #ddd3f6; background: #fbf9ff; }

.vocab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vocab-text {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0.05em;
}

.vocab-badge {
  background: var(--cream-deep);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.vocab-pinyin {
  font-size: 15px;
  font-weight: 700;
  color: var(--coral-strong);
  letter-spacing: 0.05em;
}

.vocab-meaning {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.vocab-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vocab-examples span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 700;
}

.vocab-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
}

.vocab-due.is-due {
  color: var(--coral-strong);
  font-weight: 800;
}

/* ------------------------------------------------------------ 家长中心新增 */

.review-meter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.review-meter {
  padding: 14px 12px;
  border-radius: 14px;
  background: #fffaf0;
  border: 1px solid var(--line);
  text-align: center;
}

.review-meter strong {
  display: block;
  font-size: 22px;
  color: var(--teal-strong);
}

.review-meter span {
  font-size: 12px;
  color: var(--muted);
}

.mastery-panel {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px dashed var(--line);
}

.mastery-panel h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.mastery-rows {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.mastery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fffaf0;
  font-size: 14px;
}

.weak-list {
  display: grid;
  gap: 10px;
  margin: 8px 0 12px;
}

.weak-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weak-tag {
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-strong);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.weak-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #f2e9dc;
  overflow: hidden;
}

.weak-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb648, var(--coral));
}

.weak-count {
  min-width: 40px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.weak-kinds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.weak-kinds-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.weak-kind-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #2f4f74;
  font-size: 13px;
  font-weight: 700;
}

/* ------------------------------------------------------------ 角色与装扮 */

.character-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--line);
  background:
    radial-gradient(600px 240px at 12% 0%, #ffe6ca 0%, rgba(255, 230, 202, 0) 70%),
    radial-gradient(600px 260px at 92% 10%, #d9f3ed 0%, rgba(217, 243, 237, 0) 70%),
    #fffdf9;
  box-shadow: var(--shadow-md);
}

.avatar-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 250px;
  justify-content: center;
}

.avatar-halo {
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d4 0%, rgba(255, 246, 212, 0) 70%);
}

.avatar-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.avatar-face {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffe9b6, #ffc94a);
  box-shadow: inset 0 -8px 0 rgba(201, 138, 19, 0.22), 0 14px 30px rgba(201, 138, 19, 0.25);
}

.avatar-face .icon {
  width: 56px;
  height: 56px;
  color: #8a5a08;
}

.avatar-body {
  display: grid;
  place-items: center;
  width: 150px;
  height: 92px;
  border-radius: 40px 40px 28px 28px;
  background: linear-gradient(165deg, #bfe9ff, #ffe9c9);
  border: 3px solid #fff;
  box-shadow: 0 12px 26px rgba(88, 64, 40, 0.14);
}

.avatar-body .icon {
  width: 46px;
  height: 46px;
  color: var(--ink);
}

.avatar-outfit {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 270px;
}

.outfit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--item-color, var(--line));
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.outfit-chip .icon {
  width: 14px;
  height: 14px;
  color: var(--item-color, var(--coral-strong));
}

.character-copy h1 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 3vw, 42px);
}

.character-copy > p {
  max-width: 560px;
  color: var(--ink-soft);
}

.character-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.character-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.wardrobe-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.wardrobe-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 12px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf9;
  text-align: center;
}

.wardrobe-item.is-equipped {
  border-style: solid;
  border-color: var(--teal);
  background: var(--teal-soft);
}

.wardrobe-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #fff;
  color: var(--item-color, var(--coral-strong));
  box-shadow: var(--shadow-sm);
}

.wardrobe-slot {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.wardrobe-item .text-btn {
  padding: 4px 8px;
  font-size: 13px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shop-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.shop-card.is-owned {
  opacity: 0.8;
}

.shop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid var(--item-color, var(--line));
  color: var(--item-color, var(--coral-strong));
}

.shop-icon .icon {
  width: 26px;
  height: 26px;
}

.shop-card h3 {
  font-size: 18px;
}

.shop-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.shop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.shop-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 15px;
  color: var(--coral-strong);
}

.shop-owned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
}

.shop-foot .btn {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 14px;
}

.shop-foot .btn:disabled {
  opacity: 0.45;
  box-shadow: none;
  transform: none;
}

.role-next {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.role-next-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--yellow-soft);
  color: #a66a00;
  flex: none;
}

.role-next h2 {
  font-size: 20px;
}

.role-next p {
  color: var(--muted);
  font-size: 14px;
}

.role-next .btn {
  margin-left: auto;
  flex: none;
}

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

@media (max-width: 991.98px) {
  .nav-wallet {
    margin: 8px 0 2px;
  }

  .welcome {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .welcome-art {
    height: 300px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .hero-level {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
  }

  .parent-grid {
    grid-template-columns: 1fr;
  }

  .parent-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .daily-tasks { grid-template-columns: 1fr; }
  .character-hero { grid-template-columns: 1fr; }
  .avatar-stage { min-height: 210px; }
}

@media (max-width: 767.98px) {
  body { font-size: 16px; }

  .page { padding: 18px 14px 56px; }

  .topbar { padding: 8px 0; }

  .topnav .nav-link { padding: 8px 10px; }

  .nav-wallet { margin: 8px 0 6px; }

  .brand-sub { display: none; }

  .page-hero,
  .level-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .story-card { padding: 20px 18px; }
  .story-text { font-size: 20px; line-height: 1.95; }

  .quiz-card { padding: 18px; }
  .question-panel h3 { font-size: 19px; }

  .level-node { gap: 10px; padding: 12px; }
  .node-circle { width: 42px; height: 42px; }
  .node-sub { display: none; }
  .node-cta { padding: 5px 10px; font-size: 12px; }

  .result-rewards { grid-template-columns: 1fr; }
  .result-star { width: 52px; height: 52px; }

  .start-row { flex-direction: column; }
  .start-row .btn { width: 100%; }

  .parent-stat { padding: 12px; }
}

@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-hero,
  .vocab-hero { flex-direction: column; align-items: flex-start; }
  .review-stats { width: 100%; }
  .mini-stat { flex: 1; }
  .mastery-grid { grid-template-columns: 1fr; }
  .review-meter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocab-actions { flex-wrap: wrap; }
  .role-next { flex-wrap: wrap; }
  .role-next .btn { margin-left: 0; }
}

/* ------------------------------------------------------------ 多账号：登录 / 注册 / 管理员 */
.impersonation-bar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 18px;
  background: #3b2f63;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.impersonation-bar form {
  margin: 0;
}

.impersonation-bar .btn {
  padding: 4px 12px;
  font-size: 13px;
}

.nav-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  flex: none;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf9;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.account-chip em {
  font-style: normal;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 11px;
  font-weight: 800;
}

.logout-form {
  margin: 0;
}

.nav-guest {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.auth-page .topbar {
  position: static;
}

.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 48px 18px 64px;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 30px 28px;
}

.auth-panel--wide {
  width: min(100%, 760px);
}

.auth-panel .panel-head {
  margin-bottom: 20px;
}

.auth-panel h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.auth-panel .panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-error {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 2px solid #f3b4a6;
  border-radius: 12px;
  background: var(--coral-soft);
  color: var(--coral-strong);
  font-size: 14px;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.auth-field input[type="text"],
.auth-field input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.auth-field input:focus {
  outline: none;
  border-color: #f3c98c;
  box-shadow: 0 0 0 3px #fff1d6;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.auth-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.auth-group {
  margin: 0;
  padding: 14px 16px 16px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  display: grid;
  gap: 12px;
}

.auth-group legend {
  width: auto;
  padding: 0 8px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--teal-strong);
}

.avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-choice span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 24px;
  cursor: pointer;
}

.avatar-choice input:checked + span {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px #d8f1ec;
}

.panel-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.panel-note a {
  color: var(--teal-strong);
  font-weight: 800;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-head h1 {
  margin: 4px 0;
  font-size: 32px;
}

.admin-head .hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* 管理员用户表：带分隔线的规整表格，沿用儿童化配色 */
.admin-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}

.admin-table thead th {
  background: #fff4e2;
  color: #8a5a08;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
  background: #fffaf4;
}

.admin-table tbody tr:hover {
  background: #fff2df;
}

.admin-table .cell-account,
.admin-table .cell-relation {
  min-width: 168px;
}

.admin-table .cell-time {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.admin-table .cell-progress {
  min-width: 210px;
}

.admin-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

.admin-person {
  display: block;
  font-weight: 800;
  line-height: 1.35;
}

.admin-username {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.relation-label {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.cell-empty {
  color: var(--muted);
  font-weight: 700;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.metric-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f7eee0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
  white-space: nowrap;
}

.admin-table form {
  display: inline-block;
  margin: 0;
}

/* 账号管理：新建表单与表格内的重置密码入口 */
.auth-field select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.auth-field select:focus {
  outline: none;
  border-color: #f3c98c;
  box-shadow: 0 0 0 3px #fff1d6;
}

.pwd-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.pwd-reset {
  display: inline-block;
  margin-right: 6px;
  text-align: left;
  vertical-align: top;
}

.pwd-reset summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
}

.pwd-reset summary::-webkit-details-marker {
  display: none;
}

.pwd-reset form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.pwd-reset input[type="password"] {
  width: 140px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 1199.98px) {
  .nav-account {
    flex-wrap: wrap;
    margin: 10px 0 4px;
  }
}

@media (max-width: 575.98px) {
  .auth-wrap {
    padding: 28px 10px 48px;
  }

  .auth-panel {
    padding: 22px 18px;
  }
}

/* ============================================================
   手机端适配（375px 竖屏基线，兼顾 390–430px）
   所有规则只作用于窄屏，桌面与平板横屏保持原有视觉
   ============================================================ */

/* 刘海屏安全区：顶部、横向与底部留白 */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.topbar {
  padding-top: calc(10px + env(safe-area-inset-top));
}

/* 身份提示条已经占住顶部安全区时，顶栏不再重复留白 */
.impersonation-bar + .topbar {
  padding-top: 10px;
}

.toast-root {
  bottom: calc(26px + env(safe-area-inset-bottom));
}

/* 顶栏工具区：金币、连胜、音量、折叠按钮常驻右侧 */
.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  order: 2;
  flex: none;
}

.topbar-wallet {
  display: none;
}

.navbar-collapse {
  order: 1;
}

/* 结算弹层关闭按钮：仅手机抽屉显示 */
.result-close {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink-soft);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(16%); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1199.98px) {
  .topbar-tools {
    order: 1;
    gap: 6px;
  }
  .navbar-collapse { order: 2; flex-basis: 100%; }

  .topbar-tools .navbar-toggler {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 2px;
    padding: 0;
    border-radius: 12px;
  }

  .topbar-tools .navbar-toggler .navbar-toggler-bar {
    margin: 3px 0;
  }

  .topbar-wallet {
    display: inline-flex;
    gap: 4px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .topbar-wallet .icon {
    width: 15px;
    height: 15px;
  }

  .wallet-unit { display: none; }

  .sound-toggle {
    width: 44px;
    height: 44px;
    margin-left: 0;
  }

  .brand { gap: 6px; }
  .brand .island-logo { width: 36px; height: 36px; }
  .brand-name { font-size: 17px; }

  .navbar-collapse {
    margin-top: 10px;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: 20px;
    background: #fffdf9;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .topnav {
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  .topnav .nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 16px;
  }

  .nav-account {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 10px 0 0;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
  }

  /* 金币、连胜已经在顶栏右侧，菜单里不再重复 */
  .nav-wallet-chip { display: none; }

  .account-chip {
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 14px;
    white-space: normal;
  }

  .logout-form .btn {
    width: 100%;
    min-height: 46px;
  }

  .impersonation-bar {
    padding-top: calc(10px + env(safe-area-inset-top));
    gap: 8px;
  }

  .impersonation-bar .btn { min-height: 40px; }
}

@media (max-width: 767.98px) {
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }

  .page {
    padding: 16px 14px calc(44px + env(safe-area-inset-bottom));
  }

  /* 触控尺寸：可点元素不小于 44px */
  .btn { min-height: 46px; padding: 10px 18px; }
  .btn-sm { min-height: 44px; }
  .text-btn,
  .text-link,
  .back-link { min-height: 44px; }

  input,
  select,
  textarea { font-size: 16px; }
  .form-control { min-height: 44px; }

  .panel { padding: 18px 16px; border-radius: 20px; }
  .panel-head { gap: 8px; }

  /* 地图首屏 */
  .hero { padding: 18px; gap: 16px; border-radius: 20px; }
  .hero h1 { font-size: 26px; }
  .hero-sub { font-size: 15px; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-level { gap: 12px; }
  .level-ring { width: 132px; height: 132px; }
  .level-ring-inner { width: 106px; height: 106px; }
  .level-ring-inner strong { font-size: 32px; }

  .stats-grid { gap: 10px; }
  .stat-card { min-width: 0; padding: 12px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; border-radius: 12px; }
  .stat-card strong { font-size: 18px; overflow-wrap: anywhere; }
  .stat-card div { min-width: 0; }

  .task-card { padding: 16px; }
  .task-card .btn { width: 100%; }
  .daily-card { padding: 16px 18px; }
  .daily-main { gap: 10px; }
  .daily-copy h2 { font-size: 24px; }
  .streak-note { border-radius: 18px; padding: 10px 14px; font-size: 13px; }

  /* 探险地图：单列关卡，卡片内上下重排 */
  .map-section { margin-top: 18px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-heading h2 { font-size: 21px; }
  .stage-list { gap: 14px; }
  .stage-card { padding: 14px; border-radius: 20px; }
  .stage-head { gap: 10px; margin-bottom: 12px; }
  .stage-mark { width: 42px; height: 42px; border-radius: 12px; }
  .stage-mark .icon { width: 22px; height: 22px; }
  .stage-copy { min-width: 0; flex: 1 1 120px; }
  .stage-head h3 { font-size: 18px; }
  .stage-head p { font-size: 12px; }
  .stage-count { padding: 4px 10px; font-size: 12px; }

  .stage-path { gap: 10px; }
  .level-node {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "circle body"
      "cta cta";
    align-items: center;
    gap: 8px 10px;
    padding: 12px 14px;
    border-radius: 16px;
  }
  .node-circle { grid-area: circle; width: 44px; height: 44px; }
  .node-circle .icon { width: 20px; height: 20px; }
  .node-number { font-size: 18px; }
  .node-body { grid-area: body; min-width: 0; gap: 1px; }
  .node-topline { flex-wrap: wrap; gap: 6px; }
  .node-title { font-size: 17px; white-space: normal; overflow-wrap: anywhere; }
  .node-sub { display: none; }
  .node-meta { gap: 10px; font-size: 12px; }
  .node-cta {
    grid-area: cta;
    width: 100%;
    min-height: 44px;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
  }
  .level-tip { max-width: 100%; margin: 8px 0 0; }

  /* 阅读页：字号分级下调，保留儿童阅读行高 */
  .level-topline { gap: 6px; }
  .level-hero h1 { font-size: 26px; }
  .level-hero p { font-size: 15px; }
  .level-meta { gap: 6px; }
  .level-meta span { padding: 4px 10px; font-size: 12px; }
  .story-card { padding: 16px; border-radius: 20px; }
  .story-head { flex-wrap: wrap; gap: 4px; }
  .story-head h2 { font-size: 21px; }
  .story-text {
    padding: 4px 0 8px;
    font-size: clamp(19px, 5.5vw, 22px);
    line-height: 1.95;
    letter-spacing: 0.015em;
  }
  .story-actions { margin-top: 12px; }
  .story-actions .btn { width: 100%; }
  .btn-xl { min-height: 56px; padding: 13px 20px; font-size: 17px; }
  .story-tip { font-size: 12px; }

  /* 答题页 */
  .quiz-card { margin-top: 16px; padding: 16px; border-radius: 20px; }
  .quiz-head-top { gap: 8px; }
  .quiz-head h2 { font-size: 20px; }
  .quiz-dots { flex-wrap: wrap; gap: 6px; }
  .quiz-dot { width: 10px; height: 10px; }
  .question-panel h3 { margin: 10px 0 12px; font-size: 18px; }
  .options { gap: 10px; }
  .option {
    gap: 10px;
    min-height: 56px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 16px;
  }
  .option-letter { width: 32px; height: 32px; font-size: 15px; }
  .quiz-actions .btn { width: 100%; }
  .review-card .option-text { font-size: 17px; }

  /* 避免 iOS 聚焦输入框时自动放大 */
  .auth-field input[type="text"],
  .auth-field input[type="password"],
  .goal-controls select,
  .start-input { font-size: 16px; }

  /* 结算弹层：底部抽屉 + 安全区 */
  .result-backdrop { align-items: flex-end; padding: 0; }
  .result-card {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    animation: sheet-up 0.26s ease;
  }
  .result-card::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #e3d6c4;
  }
  .result-close {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    z-index: 2;
  }
  .result-stars { gap: 8px; }
  .result-star { width: 48px; height: 48px; }
  .result-star .icon { width: 24px; height: 24px; }
  .result-card h2 { font-size: 22px; }
  .result-rewards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
  .result-reward { padding: 10px 6px; border-radius: 14px; }
  .result-reward strong { font-size: 18px; }
  .result-reward > span:last-child { font-size: 11px; }
  .reward-icon { width: 30px; height: 30px; }
  .result-actions { flex-direction: column; gap: 8px; }
  .result-actions .btn { width: 100%; }
  .unlock-item { padding: 8px 10px; }
  .daily-result { font-size: 13px; }

  /* 查词弹窗：底部抽屉 */
  .modal { padding: 0 !important; }
  #dict-modal .modal-dialog {
    display: flex;
    align-items: flex-end;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
  }
  #dict-modal .modal-content {
    width: 100%;
    max-height: 84vh;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
  }
  #dict-modal .modal-content::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 999px;
    background: #e3d6c4;
  }
  #dict-modal .modal-header { padding: 12px 18px 10px; }
  #dict-modal .modal-title { font-size: 17px; }
  #dict-modal .modal-header .close {
    min-width: 44px;
    min-height: 44px;
    margin: -8px -8px -8px 0;
    font-size: 2rem;
  }
  #dict-modal .modal-body { padding: 14px 18px; }
  #dict-modal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 1;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 18px 16px;
    background: #fffdf9;
  }
  #dict-modal .modal-footer .btn { flex: 1; }
  .dict-word { font-size: 34px; }
  .dict-word--small { font-size: 24px; }

  /* 家长中心：卡片两列、指标不横向溢出 */
  .parent-hero h1 { font-size: 26px; }
  .parent-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .parent-stat { min-width: 0; gap: 8px; padding: 12px; align-items: flex-start; }
  .parent-stat .stat-icon { width: 36px; height: 36px; border-radius: 12px; }
  .parent-stat strong { font-size: 19px; }
  .parent-stat small { font-size: 12px; }
  .parent-stat div { min-width: 0; }
  .parent-stat div > span { display: block; font-size: 11px; line-height: 1.5; }
  .parent-grid { gap: 14px; }
  .review-meter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .review-meter { padding: 10px 8px; }
  .review-meter strong { font-size: 19px; }
  .mastery-row { gap: 6px; font-size: 13px; }
  .mastery-row strong { text-align: right; }
  .week-chart { gap: 4px; }
  .week-xp { font-size: 11px; }
  .week-bar-wrap { height: 100px; border-radius: 8px; }
  .week-label { font-size: 11px; }
  .goal-controls { flex-wrap: wrap; }
  .goal-controls select { flex: 1 1 120px; }
  .goal-controls .btn { flex: 1 1 auto; }
  .weak-row { gap: 6px; }
  .weak-tag { min-width: 56px; font-size: 12px; }
  .weak-count { min-width: 36px; font-size: 12px; }

  /* 徽章墙：两列卡片 */
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .badge-card { padding: 14px 10px; border-radius: 18px; }
  .badge-card .medal { --medal-size: 64px !important; }
  .badge-card h2 { font-size: 16px; }
  .badge-card p { font-size: 12px; }
  .badge-state { padding: 4px 9px; font-size: 11px; }

  /* 管理员后台：每条用户一张小卡片，不再横向滚动 */
  .admin-head h1 { font-size: 26px; }
  .admin-table {
    min-width: 0;
    border: none;
    border-collapse: separate;
    border-spacing: 0;
  }
  .admin-table thead { display: none; }
  .admin-table,
  .admin-table tbody { display: block; width: 100%; }
  .admin-table tr {
    display: block;
    margin-bottom: 12px;
    border: 2px solid var(--line);
    border-radius: 18px;
    background: #fffdf9;
    overflow: hidden;
  }
  .admin-table tr:nth-child(even),
  .admin-table tr:hover { background: #fffdf9; }
  .admin-table td {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    border-bottom: 1px dashed var(--line);
    text-align: left;
    white-space: normal;
    word-break: break-word;
  }
  .admin-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
  }
  .admin-table td:last-child { border-bottom: none; }
  .admin-table .cell-time { white-space: normal; }
  .admin-table .cell-progress { min-width: 0; }
  .admin-table .metric-row { justify-content: flex-start; }
  .admin-table .cell-actions { padding: 10px 14px 14px; }
  .admin-table .cell-actions::before { display: none; }
  .admin-table .cell-actions form { display: block; }
  .admin-table .cell-actions .btn { width: 100%; min-height: 44px; }

  /* 家长中心逐关表格：窄屏改为紧凑卡片，避免横向滚动 */
  .parent-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: none;
  }
  .parent-table thead { display: none; }
  .parent-table tbody { display: block; }
  .parent-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: #fffdf9;
  }
  .parent-table tr:nth-child(even) { background: #fffdf9; }
  .parent-table td {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    padding: 4px 0;
    border: none;
    white-space: normal;
  }
  .parent-table td:first-child {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    margin-bottom: 2px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--line);
  }
  .parent-table td:first-child::before { display: none; }
  .parent-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .table-wrap { overflow: visible; }
}

/* 横屏时不塌：抽屉仍可滚动，内容不被裁切 */
@media (max-width: 900px) and (orientation: landscape) {
  .result-card { max-height: 94vh; padding-top: 14px; }
  .result-card::before { margin-bottom: 4px; }
  #dict-modal .modal-content { max-height: 88vh; }
  .hero-level { flex-direction: row; }
}

/* 触屏设备取消只有 hover 才有的位移反馈，避免点击后卡住 */
@media (hover: none) {
  .btn:hover,
  .level-node:hover,
  .option:hover:not(:disabled),
  .shop-card:hover { transform: none; }
}

/* ------------------------------------------------------------ 年级地图 / 插画 / 挑战 */
.island-art { display: block; width: 100%; height: auto; }

.bgm-toggle { border-color: var(--line); }
.bgm-toggle .icon { width: 19px; height: 19px; }
.bgm-toggle.is-muted { opacity: 0.45; }
.bgm-toggle:not(.is-muted) { color: var(--teal-strong); border-color: var(--teal-soft, #bfe3da); background: #f2fbf8; }

.grade-list { display: grid; gap: 34px; }

.grade-block {
  position: relative;
  padding: 20px 20px 24px;
  border: 2px solid var(--line);
  border-radius: 28px;
  background: #fffaf2;
}
.grade-block--1 { background: #fffaf0; border-color: #f2e3c8; }
.grade-block--2 { background: #f4fbf2; border-color: #dbead2; }
.grade-block--3 { background: #f2f7ff; border-color: #d6e4f5; }
.grade-block--4 { background: #f7f3ff; border-color: #e0d8f4; }
.grade-block.is-current { box-shadow: 0 0 0 4px rgba(238, 93, 62, 0.08); }
.grade-block.is-locked { background: #f7f3ec; border-style: dashed; }

.grade-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.grade-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff;
  color: var(--coral-strong);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  flex: none;
}
.grade-block--2 .grade-mark { color: #4f8a3f; }
.grade-block--3 .grade-mark { color: #3f6fa8; }
.grade-block--4 .grade-mark { color: #6c5ec0; }
.grade-mark .icon { width: 24px; height: 24px; color: var(--muted); }
.grade-copy { flex: 1; min-width: 0; }
.grade-kicker { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.grade-copy h3 { margin: 2px 0 4px; font-family: var(--font-display); font-size: 24px; }
.grade-copy p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }

.grade-progress { flex: none; width: 136px; text-align: right; }
.grade-progress span { font-size: 13px; color: var(--muted); }
.progress--grade { height: 8px; margin-top: 8px; }
.progress--grade span { display: block; height: 100%; border-radius: 999px; background: var(--teal); }

.grade-lock-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}
.grade-lock-note .icon { width: 16px; height: 16px; }

.stage-card {
  background: var(--stage-bg, #fffdf9);
  border-color: color-mix(in srgb, var(--stage-main, #ddd) 22%, #fff);
}
.stage-head { align-items: center; }
.stage-mark--art {
  width: 104px;
  height: 60px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--stage-bg, #fff);
  border: 2px solid color-mix(in srgb, var(--stage-main, #ddd) 26%, #fff);
}
.stage-mark--art .island-art { width: 100%; height: 100%; }
.stage-label { color: var(--stage-main, var(--muted)); }
.stage-card h3 { color: var(--stage-ink, var(--ink)); }

.level-row.is-challenge .level-node {
  border-color: color-mix(in srgb, var(--stage-accent, #f3c98c) 70%, #fff);
  background: linear-gradient(120deg, #fff 0%, color-mix(in srgb, var(--stage-accent, #ffe3a3) 16%, #fff) 100%);
}
.challenge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--stage-accent, #ffc94a);
  color: #6b4a12;
  font-size: 12px;
  font-weight: 700;
}
.challenge-chip .icon { width: 14px; height: 14px; }
.challenge-chip--hero { margin: 2px 0 6px; }

.node-art {
  width: 92px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  background: var(--stage-bg, #fff);
  border: 2px solid color-mix(in srgb, var(--stage-main, #ddd) 24%, #fff);
}
.node-art .island-art { width: 100%; height: 100%; }
.is-locked .node-art { filter: grayscale(0.65); opacity: 0.55; }

.level-hero { flex-wrap: wrap; }
.level-hero-art {
  width: min(320px, 40%);
  min-width: 200px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.level-hero-art .island-art { width: 100%; height: auto; }

.result-art {
  width: min(320px, 100%);
  margin: 8px auto 4px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: #fff;
}
.result-art .island-art { width: 100%; height: auto; }

@media (max-width: 640px) {
  .grade-block { padding: 16px 14px 18px; border-radius: 22px; }
  .grade-head { gap: 12px; }
  .grade-mark { width: 48px; height: 48px; font-size: 22px; border-radius: 14px; }
  .grade-copy h3 { font-size: 20px; }
  .grade-progress { width: 92px; }
  .stage-mark--art { width: 76px; height: 44px; }
  .node-art { width: 64px; height: 38px; }
  .node-circle { width: 42px; height: 42px; flex: none; }
  .level-node { gap: 10px; padding: 12px; }
  .node-cta { display: none; }
  .level-hero-art { width: 100%; min-width: 0; order: 2; }
  .result-art { width: 100%; }
}

/* ============================================================
   成长小岛
   ============================================================ */

.island-board {
  margin: 22px 0 26px;
  padding: 22px 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.island-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.island-head h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 2.4vw, 28px);
}

.island-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.island-progress,
.island-phase {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: var(--yellow-soft);
  color: #8a6512;
}

.island-phase {
  background: var(--teal-soft);
  color: var(--teal-strong);
}

.island-zoom {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #f3ece1;
  border: 1px solid var(--line);
}

.island-zoom-btn {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.island-zoom-btn.is-active {
  background: #fff;
  color: var(--coral-strong);
  box-shadow: var(--shadow-sm);
}

.island-viewport {
  position: relative;
  overflow: auto;
  border-radius: 26px;
  border: 1px solid rgba(90, 73, 50, 0.18);
  background: #dff1f6;
  box-shadow: inset 0 2px 12px rgba(60, 80, 90, 0.08);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.island-viewport .island-scene {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.island-viewport.is-fit .island-scene {
  min-width: 0;
}

.island-hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 14px;
}

/* -------- 场景配色 / 昼夜 -------- */

.island-scene {
  --i-sky: #d8f1f7;
  --i-sky-low: #eef9fb;
  --i-sea: #87cfe5;
  --i-sea-deep: #6cbbd3;
  --i-land: #efe1b5;
  --i-land-2: #e7d3a2;
  --i-beach: #f8ebcb;
  --i-trail: #c6924c;
  --i-trail-off: #b9aa8e;
  --i-ink: #5a4932;
  --i-fog: #e8eef2;
  --i-sun: #ffd56b;
}

.island-scene .island-sky { fill: var(--i-sky); }
.island-scene .island-sea { fill: var(--i-sea); }
.island-scene .island-land { fill: var(--i-land); stroke: var(--i-ink); stroke-width: 3; }
.island-scene .island-beach { fill: var(--i-beach); opacity: 0.8; }
.island-scene .island-terrace { fill: var(--i-land-2); opacity: 0.42; }
.island-scene .island-wave {
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 5;
  stroke-linecap: round;
}
.island-scene .island-trail {
  fill: none;
  stroke: var(--i-trail);
  stroke-width: 5;
  stroke-dasharray: 10 7;
  stroke-linecap: round;
  opacity: 0.9;
}
.island-scene .island-trail.is-locked {
  stroke: var(--i-trail-off);
  opacity: 0.25;
}
.island-scene .island-grade-label {
  fill: var(--i-ink);
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.8;
}
.island-scene .island-grade-label.is-locked { opacity: 0.4; }
.island-scene .island-sun circle:first-child { fill: var(--i-sun); }
.island-scene .island-stars,
.island-scene .island-moon { opacity: 0; }
.island-scene .island-fog-band {
  fill: var(--i-fog);
  opacity: 0.72;
}

.island-scene[data-phase="dusk"] {
  --i-sky: #f7cba6;
  --i-sky-low: #fbe2c6;
  --i-sea: #7fb8c9;
  --i-sea-deep: #6aa3b6;
  --i-land: #ecd4a9;
  --i-land-2: #e0c08f;
  --i-beach: #f6ddb6;
  --i-trail: #b9803f;
  --i-trail-off: #b8a58c;
  --i-ink: #5a442f;
  --i-fog: #f1e4d9;
  --i-sun: #ff9d5c;
}

.island-scene[data-phase="dusk"] .island-stars { opacity: 0.25; }
.island-scene[data-phase="dusk"] .island-sun { opacity: 1; }

.island-scene[data-phase="night"] {
  --i-sky: #2a3460;
  --i-sky-low: #38437a;
  --i-sea: #264f68;
  --i-sea-deep: #1f4358;
  --i-land: #a9a38f;
  --i-land-2: #96917e;
  --i-beach: #bdb49b;
  --i-trail: #c7a66e;
  --i-trail-off: #8a8878;
  --i-ink: #46433b;
  --i-fog: #dde3ea;
  --i-sun: #ffd56b;
}

.island-scene[data-phase="night"] .island-stars { opacity: 1; }
.island-scene[data-phase="night"] .island-moon { opacity: 1; }
.island-scene[data-phase="night"] .island-sun { opacity: 0; }
.island-scene[data-phase="night"] .island-wave { stroke: rgba(200, 225, 240, 0.32); }
.island-scene[data-phase="night"] .island-fog-band { opacity: 0.5; }

/* -------- 建筑与地块 -------- */

.island-scene .island-plot-hit {
  cursor: pointer;
  outline: none;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.island-scene .island-plot.is-built .island-plot-hit:hover,
.island-scene .island-plot.is-built .island-plot-hit:focus-visible {
  filter: drop-shadow(0 6px 10px rgba(70, 50, 25, 0.28)) brightness(1.04);
}

.island-scene .island-plot.is-next .island-plot-hit:hover {
  filter: brightness(1.06);
}

.island-scene .island-next-tag { pointer-events: none; }

.island-scene .island-beacon {
  animation: island-beacon 2.4s ease-in-out infinite;
}

@keyframes island-beacon {
  0%, 100% { opacity: 0.55; r: 8; }
  50% { opacity: 1; r: 11; }
}

.island-scene .b-glow { opacity: 0.22; transition: opacity 0.4s ease; }
.island-scene[data-phase="dusk"] .b-glow { opacity: 0.6; }
.island-scene[data-phase="night"] .b-glow { opacity: 0.9; }
.island-scene .b-beam { opacity: 0.06; }
.island-scene[data-phase="night"] .b-beam { opacity: 0.34; }

.island-scene .b-blades {
  transform-origin: 0 0;
  animation: island-mill 26s linear infinite;
}

@keyframes island-mill {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .island-scene .b-blades,
  .island-scene .island-beacon { animation: none; }
}

/* -------- 建筑说明弹层 -------- */

body.is-island-modal { overflow: hidden; }

.island-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.island-modal-back {
  position: absolute;
  inset: 0;
  background: rgba(36, 28, 54, 0.46);
  backdrop-filter: blur(3px);
}

.island-modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 82vh;
  overflow: auto;
  padding: 26px 26px 20px;
  border-radius: 26px;
  background: #fffdf9;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-md);
  animation: island-pop 0.22s ease-out;
}

@keyframes island-pop {
  from { transform: translateY(10px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.island-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f3ece1;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.island-modal-kicker {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.island-modal-card h3 {
  margin: 10px 0 8px;
  font-size: 22px;
}

.island-modal-copy {
  color: var(--ink-soft);
  font-size: 15px;
}

.island-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 18px;
}

.island-modal-meta span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f5eee3;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.island-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* -------- 完整路线折叠 -------- */

.route-details {
  margin: 8px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.route-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  cursor: pointer;
  list-style: none;
}

.route-summary::-webkit-details-marker { display: none; }

.route-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.route-summary-copy strong {
  font-size: 18px;
  font-weight: 900;
}

.route-summary-copy span {
  color: var(--muted);
  font-size: 13px;
}

.route-summary-count {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-strong);
  font-size: 13px;
  font-weight: 800;
}

.route-details[open] .route-summary {
  border-bottom: 1px solid var(--line);
}

.route-details .map-section {
  margin: 0;
  padding: 18px 20px 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 640px) {
  .island-board {
    padding: 16px 14px 12px;
    border-radius: 22px;
  }
  .island-head {
    align-items: flex-start;
    gap: 10px;
  }
  .island-tools {
    justify-content: flex-start;
    gap: 6px;
  }
  .island-progress,
  .island-phase { font-size: 12px; padding: 5px 10px; }
  .island-viewport { border-radius: 18px; }
  .island-viewport .island-scene { min-width: 620px; }
  .island-hint { font-size: 13px; }
  .island-modal { padding: 14px; }
  .island-modal-card { padding: 22px 18px 16px; border-radius: 20px; }
  .route-details .map-section { padding: 14px 12px 6px; }
  .route-summary { padding: 14px 16px; }
  .route-summary-copy strong { font-size: 16px; }
}

/* ============================================================
   图鉴 / 每日任务 / 随机事件 / 岛屿装饰
   ============================================================ */

/* -------- 小岛上的图鉴装饰 -------- */
.island-deco {
  transition: filter 0.2s ease;
}

.island-deco:hover {
  filter: brightness(1.06);
}

.deco-butterfly {
  animation: deco-flutter 5s ease-in-out infinite;
}

@keyframes deco-flutter {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .deco-butterfly { animation: none; }
}

/* -------- 随机小事件 -------- */
.island-event {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  margin: 0 0 18px;
  padding: 18px 54px 18px 20px;
  border: 1px dashed rgba(75, 123, 214, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f2f7ff 0%, #fffdf9 100%);
  box-shadow: var(--shadow-sm);
}

.event-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 30px;
}

.event-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.event-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.event-copy h2 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.event-copy p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 14px;
}

.event-goal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 420px;
  font-size: 13px;
  color: var(--muted);
}

.event-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  overflow: hidden;
}

.event-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.3s ease;
}

.event-action {
  flex: none;
}

.event-wait {
  font-size: 13px;
  color: var(--muted);
}

.event-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.event-close:hover {
  background: #fff;
  color: var(--ink);
}

/* -------- 每日小任务 -------- */
.quest-board {
  margin: 0 0 18px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.quest-board.is-ready {
  border-color: rgba(255, 201, 74, 0.7);
  box-shadow: 0 12px 30px rgba(255, 201, 74, 0.22);
}

.quest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.quest-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.quest-count {
  flex: none;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 13px;
  font-weight: 900;
}

.quest-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.quest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.quest-item.is-done {
  border-color: rgba(47, 158, 95, 0.35);
  background: var(--green-soft);
}

.quest-icon {
  flex: none;
  font-size: 22px;
}

.quest-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.quest-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-bar {
  height: 7px;
  margin-top: 6px;
  border-radius: 999px;
  background: #f2ece1;
  overflow: hidden;
}

.quest-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 0.3s ease;
}

.quest-state {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.quest-item.is-done .quest-state {
  color: var(--green);
}

.quest-chest {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fff6dd, #fffdf9);
  border: 1px solid rgba(255, 201, 74, 0.5);
}

.quest-chest.is-done {
  background: #fffdf9;
  border-color: var(--line);
}

.quest-chest.is-ready {
  background: linear-gradient(135deg, #ffeec2, #fff7e2);
  box-shadow: 0 8px 22px rgba(255, 201, 74, 0.25);
}

.quest-chest-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255, 201, 74, 0.55);
  color: var(--coral);
}

.quest-chest-icon svg {
  width: 24px;
  height: 24px;
}

.quest-chest-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.quest-chest-copy strong {
  display: block;
  font-size: 15px;
}

.quest-chest-copy span {
  font-size: 13px;
  color: var(--ink-soft);
}

.quest-lock {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
}

/* -------- 小岛日记 -------- */
.island-diary {
  margin: 0 0 22px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.island-diary h2 {
  font-size: 17px;
  margin-bottom: 10px;
}

.island-diary ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.island-diary li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.diary-day {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* -------- 结算里的新卡片 -------- */
.card-unlock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.card-unlock-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.card-unlock-item.rarity-rare {
  border-color: rgba(75, 123, 214, 0.45);
  background: var(--blue-soft);
}

.card-unlock-item.rarity-legendary {
  border-color: rgba(255, 201, 74, 0.75);
  background: linear-gradient(135deg, #fff3cd, #fffdf9);
}

.card-unlock-emoji {
  flex: none;
  font-size: 26px;
}

.card-unlock-copy strong {
  display: block;
  font-size: 14px;
}

.card-unlock-copy span {
  font-size: 12px;
  color: var(--ink-soft);
}

/* -------- 图鉴页 -------- */
.codex-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
  padding: 26px 30px;
  border-radius: var(--radius);
  background: radial-gradient(420px 220px at 100% 0%, #ede7fc, transparent 70%),
    radial-gradient(420px 240px at 0% 100%, #ddf3ef, transparent 70%), #fffdf9;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.codex-hero h1 {
  margin: 4px 0 6px;
  font-size: 30px;
}

.codex-sub {
  margin: 0;
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 14px;
}

.codex-progress {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.codex-progress-ring {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: conic-gradient(var(--purple) calc(var(--percent) * 1%), #f3ece2 0);
  position: relative;
}

.codex-progress-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fffdf9;
}

.codex-progress-ring strong {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 900;
}

.codex-progress span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.codex-section {
  margin: 0 0 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.codex-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.codex-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--purple);
}

.codex-section-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
  font-weight: 700;
}

.codex-count {
  flex: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.codex-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.codex-card.is-owned:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.codex-card-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 92px;
  background: radial-gradient(120px 90px at 50% 20%, #fff6df, #fdf6ec);
  border-bottom: 1px solid var(--line);
}

.codex-card.is-locked .codex-card-art {
  background: repeating-linear-gradient(135deg, #faf7f1, #faf7f1 10px, #f5efe4 10px, #f5efe4 20px);
}

.codex-card--rare .codex-card-art {
  background: radial-gradient(120px 90px at 50% 20%, #dfeaff, #f4f8ff);
}

.codex-card--legendary .codex-card-art {
  background: radial-gradient(120px 90px at 50% 20%, #ffe9a8, #fff8e3);
}

.codex-emoji {
  font-size: 44px;
  line-height: 1;
}

.codex-card.is-locked .codex-emoji {
  filter: brightness(0) opacity(0.18);
  user-select: none;
}

.codex-rarity {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
}

.codex-card--rare .codex-rarity {
  color: var(--blue);
  border-color: rgba(75, 123, 214, 0.4);
}

.codex-card--legendary .codex-rarity {
  color: #a37500;
  border-color: rgba(163, 117, 0, 0.35);
}

.codex-owned-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.codex-owned-mark svg {
  width: 13px;
  height: 13px;
}

.codex-card-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 12px;
}

.codex-card-copy strong {
  font-size: 14px;
  font-weight: 800;
}

.codex-card-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.codex-card.is-locked .codex-card-text {
  color: var(--muted);
}

.codex-reward {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: #fffaf0;
}

.codex-reward.is-placed {
  border-style: solid;
  border-color: rgba(47, 158, 95, 0.35);
  background: var(--green-soft);
}

.codex-reward-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--coral);
}

.codex-reward-icon svg {
  width: 20px;
  height: 20px;
}

.codex-reward-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.codex-reward-copy strong {
  display: block;
  font-size: 14px;
}

.codex-reward-copy span {
  font-size: 12px;
  color: var(--ink-soft);
}

.codex-note {
  margin: 0 0 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.codex-card--legendary.is-owned {
  border-color: rgba(255, 201, 74, 0.7);
}

@media (max-width: 860px) {
  .quest-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .island-event {
    flex-wrap: wrap;
    padding: 16px 46px 16px 16px;
  }
  .event-icon { width: 44px; height: 44px; font-size: 24px; }
  .event-action { width: 100%; }
  .quest-board { padding: 18px 16px; }
  .quest-chest { flex-wrap: wrap; }
  .quest-chest form { width: 100%; }
  .quest-chest .btn { width: 100%; }
  .codex-hero { padding: 20px 18px; }
  .codex-hero h1 { font-size: 24px; }
  .codex-progress-ring { width: 66px; height: 66px; }
  .codex-progress-ring strong { font-size: 16px; }
  .codex-section { padding: 16px 14px; }
  .codex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .codex-card-art { height: 78px; }
  .codex-emoji { font-size: 36px; }
  .codex-reward { flex-wrap: wrap; }
  .codex-reward .btn { width: 100%; }
  .island-diary { padding: 16px; }
}

/* ============================================================ 主线剧情 */

.story-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 220px at 100% 0%, #fff1c9 0%, rgba(255, 241, 201, 0) 70%),
    #fffdf9;
  box-shadow: var(--shadow-sm);
}

.story-hero h1 {
  margin: 4px 0 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.story-hero p {
  margin: 0;
  max-width: 520px;
  color: var(--ink-soft);
}

.story-hero-progress {
  flex: 0 0 auto;
  min-width: 140px;
  padding: 16px 18px;
  text-align: center;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.story-hero-progress strong {
  display: block;
  font-size: 30px;
  line-height: 1.2;
  color: var(--teal-strong);
}

.story-hero-progress strong span {
  font-size: 16px;
  color: var(--muted);
}

.story-hero-progress > span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.story-now {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(238, 93, 62, 0.28);
  background: linear-gradient(120deg, #fff6e9 0%, #ffe1d8 100%);
  box-shadow: var(--shadow-sm);
}

.story-now-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  color: var(--coral);
  box-shadow: var(--shadow-sm);
}

.story-now-icon svg {
  width: 26px;
  height: 26px;
}

.story-now-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.story-now-copy h2 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.story-now-copy p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.story-list {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.story-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.story-card.is-new {
  border-color: rgba(238, 93, 62, 0.4);
  box-shadow: 0 10px 26px rgba(238, 93, 62, 0.12);
}

.story-card.is-read {
  background: #fff;
}

.story-card.is-locked {
  opacity: 0.78;
}

.story-card.is-locked:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.story-card-art {
  position: relative;
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 118px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--story-bg, #fff6e9);
}

.story-card-art svg {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: block;
}

.story-card.is-locked .story-card-art svg {
  filter: grayscale(0.6) opacity(0.55);
}

.story-card-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 246, 233, 0.6);
}

.story-card-lock svg {
  width: 28px;
  height: 28px;
  filter: none;
}

.story-card-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.story-card-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.story-new-chip {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.story-card-copy h2 {
  margin: 4px 0 6px;
  font-size: 21px;
  font-weight: 800;
}

.story-card-copy p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.story-card-state {
  font-size: 12px;
  color: var(--muted);
}

.story-card-action {
  flex: 0 0 auto;
}

.story-locked-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink-soft);
  font-size: 13px;
}

.story-locked-chip svg {
  width: 15px;
  height: 15px;
}

.story-note {
  margin: 0 0 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* -------- 地图入口 */

.story-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  margin: 20px 0;
  border: 1px solid rgba(238, 93, 62, 0.26);
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fff8ec 0%, #ffe9dc 100%);
  box-shadow: var(--shadow-sm);
}

.story-banner-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  color: var(--coral);
}

.story-banner-icon svg {
  width: 24px;
  height: 24px;
}

.story-banner-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.story-banner-copy h2 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.story-banner-copy p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* -------- 逐屏播放 */

.story-player {
  max-width: 880px;
  margin: 0 auto 28px;
  padding: 22px 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(520px 260px at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 72%),
    #fffdf9;
  box-shadow: var(--shadow);
}

.story-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.story-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-weight: 600;
}

.story-back svg {
  width: 16px;
  height: 16px;
}

.story-player-kicker {
  flex: 1 1 auto;
  text-align: center;
}

.story-skip {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.story-player-title {
  margin: 12px 0 18px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--story-ink, var(--ink));
}

.story-screen {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.story-art {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--story-bg, #fff6e9);
}

.story-art svg {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: block;
}

.story-lines {
  display: grid;
  gap: 10px;
  padding: 20px 22px 22px;
}

.story-line {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
}

.story-line--narrator {
  color: var(--ink-soft);
  font-size: 15px;
}

.story-line--speech {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.story-who {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--story-accent, var(--yellow-soft));
  color: var(--story-ink, var(--ink));
  font-size: 12px;
  font-weight: 700;
}

.story-text {
  flex: 1 1 auto;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fff8ee;
}

.story-line--narrator .story-text {
  padding: 0;
  border-radius: 0;
  background: none;
}

.story-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.story-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.story-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.2s ease, transform 0.2s ease;
}

.story-dots span.is-active {
  background: var(--story-main, var(--teal));
  transform: scale(1.3);
}

.story-ending {
  margin-top: 4px;
  padding: 26px 22px;
  text-align: center;
  border: 1px dashed rgba(238, 93, 62, 0.35);
  border-radius: var(--radius);
  background: #fff8f2;
}

.story-ending-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #fff;
  color: var(--coral);
  box-shadow: var(--shadow-sm);
}

.story-ending-icon svg {
  width: 22px;
  height: 22px;
}

.story-ending h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.story-ending p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 14px;
}

.story-ending-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.story-ending-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .story-card-art { flex-basis: 160px; height: 104px; }
  .story-player-title { font-size: 24px; }
}

@media (max-width: 640px) {
  .story-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 18px;
  }
  .story-hero h1 { font-size: 26px; }
  .story-hero-progress { min-width: 0; }
  .story-now,
  .story-banner {
    flex-wrap: wrap;
    padding: 16px;
  }
  .story-now .btn,
  .story-banner .btn { width: 100%; justify-content: center; }
  .story-card {
    flex-wrap: wrap;
    padding: 12px;
  }
  .story-card-art {
    flex: 1 1 100%;
    height: 150px;
  }
  .story-card-copy { flex: 1 1 100%; }
  .story-card-action { width: 100%; }
  .story-card-action .btn,
  .story-card-action .story-locked-chip { width: 100%; justify-content: center; }
  .story-player { padding: 16px 14px 20px; border-radius: var(--radius); }
  .story-player-head { flex-wrap: wrap; }
  .story-player-kicker { flex: 1 1 100%; order: 3; text-align: left; }
  .story-player-title { font-size: 22px; text-align: left; }
  .story-lines { padding: 16px; }
  .story-line { font-size: 15px; }
  .story-controls { flex-wrap: wrap; }
  .story-controls .btn { flex: 1 1 auto; }
  .story-dots { order: 3; flex: 1 1 100%; justify-content: center; }
  .story-ending { padding: 20px 16px; }
}

/* ============================================================ 看得见的成长 */

.growth-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 220px at 100% 0%, #e7f7ec 0%, rgba(231, 247, 236, 0) 70%),
    #fffdf9;
  box-shadow: var(--shadow-sm);
}

.growth-hero h1 {
  margin: 4px 0 8px;
  font-size: 32px;
  font-weight: 800;
}

.growth-hero p {
  margin: 0;
  max-width: 540px;
  color: var(--ink-soft);
}

.growth-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 0 0 auto;
}

.growth-hero-stats > div {
  min-width: 82px;
  padding: 10px 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
}

.growth-hero-stats strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  color: var(--teal-strong);
}

.growth-hero-stats span {
  font-size: 11px;
  color: var(--muted);
}

.growth-section {
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.growth-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.growth-section-head h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
}

.growth-section-head p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.growth-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbf4;
}

.growth-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.growth-legend-item strong {
  color: var(--ink);
}

.growth-legend-total {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.growth-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
}

.growth-dot--new { background: #8fc46a; }
.growth-dot--familiar { background: #4e9b6b; }
.growth-dot--mastered { background: var(--coral); }

.growth-grades {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.growth-grade {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.growth-grade.is-empty {
  background: #fdfbf6;
}

.growth-grade-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #f4faf0, #fffdf9);
}

.growth-grade-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.growth-grade-count {
  font-size: 12px;
  color: var(--muted);
}

.growth-grade-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 14px;
}

.growth-tree {
  flex: 0 0 158px;
}

.growth-tree-svg {
  display: block;
  width: 100%;
  height: auto;
}

.growth-grade-info {
  flex: 1 1 auto;
  min-width: 0;
}

.growth-meters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 6px;
}

.growth-meter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-soft);
}

.growth-meter strong {
  font-size: 14px;
  color: var(--ink);
}

.growth-details {
  font-size: 13px;
}

.growth-details summary {
  margin: 4px 0;
  color: var(--teal-strong);
  cursor: pointer;
  font-size: 12px;
}

.growth-chip-group {
  margin: 8px 0 2px;
}

.growth-chip-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
}

.growth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.growth-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #d9e8cf;
  background: #eff8e8;
  color: #3f6b33;
  font-size: 13px;
  line-height: 1.5;
}

.growth-chip--familiar {
  border-color: #c6e6d2;
  background: #e8f5ec;
  color: #2f6b49;
}

.growth-chip--mastered {
  border-color: #f6c9b9;
  background: #fff0e8;
  color: #b6432b;
}

.growth-chip.is-word {
  font-weight: 700;
}

.growth-empty-tip {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.shelf-count {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink-soft);
  font-size: 12px;
}

.shelf-board {
  position: relative;
  padding: 18px 16px 20px;
  border: 1px solid #e8d3b4;
  border-radius: var(--radius);
  background: linear-gradient(#fdf6e9, #f7e7cc);
  box-shadow: inset 0 2px 10px rgba(120, 90, 50, 0.08);
}

.shelf-books {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 112px;
}

.book-spine {
  position: relative;
  flex: 0 0 32px;
  height: 106px;
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-radius: 3px 7px 7px 3px;
  background: linear-gradient(180deg, var(--spine, #5fae83), var(--spine-deep, #3f5d4c));
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 2px 2px 0 rgba(74, 55, 28, 0.14);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.book-spine:hover,
.book-spine:focus {
  transform: translateY(-4px);
  box-shadow: 3px 6px 0 rgba(74, 55, 28, 0.16);
}

.book-band {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--band, #f2a65a);
}

.book-title {
  writing-mode: vertical-rl;
  text-orientation: upright;
  max-height: 86px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.shelf-board-line {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(#e0b98a, #c69a63);
  box-shadow: 0 3px 6px rgba(74, 55, 28, 0.14);
}

.shelf-foot {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.shelf-empty {
  padding: 30px 18px;
  text-align: center;
  border: 1px dashed #e8d3b4;
  border-radius: var(--radius);
  background: #fdf8ef;
}

.shelf-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #fff;
  color: var(--amber);
  box-shadow: var(--shadow-sm);
}

.shelf-empty-icon svg {
  width: 24px;
  height: 24px;
}

.shelf-empty p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 14px;
}

.growth-note {
  margin: 0 0 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .growth-grades { grid-template-columns: 1fr; }
  .growth-hero-stats { flex: 0 1 auto; }
}

@media (max-width: 640px) {
  .growth-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 18px;
  }
  .growth-hero h1 { font-size: 26px; }
  .growth-hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .growth-hero-stats > div { min-width: 0; padding: 8px 6px; }
  .growth-hero-stats strong { font-size: 20px; }
  .growth-section { padding: 16px 14px; }
  .growth-section-head { flex-direction: column; align-items: stretch; }
  .growth-section-head .btn,
  .growth-section-head .shelf-count { align-self: flex-start; }
  .growth-legend { gap: 6px 12px; }
  .growth-legend-total { margin-left: 0; }
  .growth-grade-body { flex-wrap: wrap; }
  .growth-tree { flex: 1 1 100%; max-width: 220px; margin: 0 auto; }
  .growth-grade-info { flex: 1 1 100%; }
  .shelf-books { gap: 6px; }
  .book-spine { flex: 0 0 28px; height: 98px; }
  .book-title { max-height: 78px; font-size: 11px; }
}


/* ============================================================ 家庭互动（共同目标 / 作品集） */

.family-goal-form {
  flex-wrap: wrap;
}

.family-goal-track {
  margin-top: 6px;
}

.family-goal-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--cream-deep);
  overflow: hidden;
}

.family-goal-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) 0%, #4fc3b4 100%);
}

.family-goal-tip,
.family-goal-top {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.family-goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--ink);
}

.family-goal-title {
  font-weight: 700;
}

.family-goal-top strong {
  color: var(--teal-strong);
  font-size: 18px;
}

.family-goal-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, #f4fbf9 0%, #fffdf9 70%);
}

.family-badge,
.family-achievement {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 201, 74, 0.6);
  background: var(--yellow-soft);
  color: #7a5b00;
  font-size: 13px;
}

.family-badge svg,
.family-achievement svg {
  width: 16px;
  height: 16px;
}

.family-achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.growth-works {
  margin-top: 22px;
}

.growth-works h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 18px;
}

.growth-works-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.work-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.work-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.work-form-row select {
  flex: 1 1 160px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf9;
  color: var(--ink);
  font-size: 14px;
}

.work-form textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf9;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.work-form textarea:focus,
.work-form-row select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.work-form button {
  align-self: flex-start;
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.work-card.is-liked {
  border-color: rgba(238, 93, 62, 0.4);
  background: linear-gradient(120deg, #fff8f5 0%, #fff 70%);
}

.work-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.work-head strong {
  font-size: 15px;
}

.work-kind {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}

.work-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.work-text {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.work-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.work-foot form {
  margin: 0;
}

.work-liked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 600;
}

.work-liked svg {
  width: 16px;
  height: 16px;
}

.work-wait {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .family-goal-card {
    padding: 14px;
  }

  .family-goal-top {
    flex-wrap: wrap;
  }

  .work-head .work-date {
    margin-left: 0;
  }

  .work-form-row select {
    flex-basis: 100%;
  }

  .family-badge,
  .family-achievement {
    max-width: 100%;
    white-space: normal;
  }
}

/* ============================================================ 连胜日历 */

.stat-card--link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-card--link:hover {
  transform: translateY(-2px);
  border-color: var(--coral);
  box-shadow: 0 10px 24px rgba(238, 93, 62, 0.16);
  color: inherit;
  text-decoration: none;
}

.streak-page .page-shell,
.streak-page .container {
  max-width: 1080px;
}

.streak-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 20px;
  padding: 26px 30px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fffdf9 0%, #fff3e6 100%);
  box-shadow: var(--shadow-sm);
}

.streak-hero h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 8px;
  font-size: 32px;
  color: var(--ink);
}

.streak-flame {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--coral-soft);
  color: var(--coral-strong);
}

.streak-encourage {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.streak-figures {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.streak-figure {
  min-width: 104px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fffdf9;
}

.streak-figure span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.streak-figure strong {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 20px;
  color: var(--ink);
}

.shield-panel {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 20px;
  padding: 22px 26px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.shield-orbs {
  display: flex;
  gap: 10px;
}

.shield-orb {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line);
  border-radius: 16px;
  color: #c9c6d4;
  background: #faf8f4;
}

.shield-orb.is-filled {
  border-style: solid;
  border-color: #b9d9ff;
  background: var(--blue-soft);
  color: #2f4f74;
  box-shadow: 0 6px 14px rgba(47, 79, 116, 0.12);
}

.shield-copy h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--ink);
}

.shield-copy p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  max-width: 620px;
}

.shield-meta {
  color: var(--muted) !important;
  font-size: 13px !important;
}

.shield-copy form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.shield-hint {
  font-size: 13px;
  color: var(--muted);
}

.streak-calendar {
  padding: 24px 26px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.calendar-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  color: var(--ink);
}

.calendar-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.calendar-tally {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tally {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fbf9f5;
  color: var(--ink-soft);
}

.tally--read { background: var(--teal-soft); border-color: #bfe6df; color: var(--teal-strong); }
.tally--shield { background: var(--blue-soft); border-color: #c9dff7; color: #2f4f74; }
.tally--broken { background: #f4f2ee; color: var(--muted); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday {
  padding: 4px 2px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.calendar-cell {
  position: relative;
  display: flex;
  min-height: 74px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fbf9f5;
  color: var(--muted);
  font-size: 13px;
}

.calendar-cell.is-outside,
.calendar-cell.is-future {
  border-color: transparent;
  background: transparent;
}

.calendar-cell.is-read {
  border-color: #bfe6df;
  background: var(--teal-soft);
  color: var(--teal-strong);
}

.calendar-cell.is-shield {
  border-color: #c9dff7;
  background: var(--blue-soft);
  color: #2f4f74;
}

.calendar-cell.is-broken {
  border-style: dashed;
  background: #f7f5f1;
  color: #a9a6b3;
}

.calendar-cell.is-pending {
  border-style: dashed;
  border-color: var(--coral);
  background: #fff8f2;
  color: var(--coral-strong);
}

.calendar-cell.is-today {
  box-shadow: 0 0 0 3px rgba(238, 93, 62, 0.12);
}

.cell-day {
  font-size: 15px;
  font-weight: 600;
}

.cell-mark {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.cell-mark svg {
  width: 18px;
  height: 18px;
}

.cell-pending,
.cell-month {
  font-size: 11px;
}

.cell-month {
  position: absolute;
  top: 4px;
  left: 6px;
  color: var(--muted);
}

.cell-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cfccd6;
}

.calendar-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
  list-style: none;
  font-size: 13px;
  color: var(--ink-soft);
}

.calendar-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  border: 2px solid var(--line);
  background: #fbf9f5;
}

.legend-dot--read { background: var(--teal-soft); border-color: #bfe6df; }
.legend-dot--shield { background: var(--blue-soft); border-color: #c9dff7; }
.legend-dot--broken { border-style: dashed; }
.legend-dot--today { border-color: var(--coral); border-style: dashed; background: #fff8f2; }

.streak-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin: 20px 0 8px;
}

@media (max-width: 720px) {
  .streak-hero { padding: 20px; }
  .streak-hero h1 { font-size: 24px; }
  .shield-panel { flex-direction: column; align-items: flex-start; }
  .shield-orb { width: 44px; height: 44px; }
  .streak-calendar { padding: 18px 14px 14px; }
  .calendar-grid { gap: 5px; }
  .calendar-cell { min-height: 58px; border-radius: 12px; }
  .cell-day { font-size: 13px; }
  .calendar-legend { grid-template-columns: 1fr; }
}

/* ============================================================ 头像切换 */

.avatar-panel {
  margin: 14px 0 4px;
  padding: 12px 18px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: #fffdf9;
}

.avatar-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
  list-style: none;
}

.avatar-panel summary::-webkit-details-marker {
  display: none;
}

.avatar-panel[open] summary {
  margin-bottom: 10px;
  color: var(--ink);
}

.avatar-current {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--coral-soft);
  font-size: 15px;
}

.avatar-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
}

.avatar-settings .avatar-form + .avatar-form {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.avatar-label {
  width: 100%;
  font-size: 13px;
  color: var(--muted);
}

.avatar-panel .avatar-row {
  margin: 0;
}

/* ============================================================ 能量与小卖部 */

.stat-card--energy {
  background: linear-gradient(135deg, #fff1ec, #ffe6e6);
}

.stat-card--energy .stat-icon {
  color: #e2574c;
}

.level-energy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff1ec;
  border: 1px solid #f6cfc7;
  color: #b8443a;
  font-size: 13px;
  font-weight: 600;
}

.level-energy small {
  color: #b98a84;
  font-weight: 500;
  font-size: 12px;
}

.btn.is-empty-energy {
  background: #f4e3df;
  color: #b8443a;
  border-color: #f0cdc6;
}

.shop-panel .panel-head {
  margin-bottom: 8px;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fffaf3;
  border: 2px dashed #f1dcc7;
  flex-wrap: wrap;
}

.shop-item-art {
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #fff1ec;
  color: #e2574c;
}

.shop-item-copy {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-item-copy span {
  font-size: 13px;
  color: var(--muted);
}

.shop-note {
  margin: 12px 2px 0;
  font-size: 13px;
  color: var(--muted);
}

.shop-actions {
  margin: 18px 0 40px;
}

/* ---------------------------------------------------------------- 阅读MAX 会员 */
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff2cf, #ffe0bd);
  border: 1px solid #f0c987;
  color: #8a5a12;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff2cf;
  border: 1px solid #f0c987;
  color: #8a5a12;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
}

.cell-member form {
  margin-top: 6px;
}

.stat-card--member {
  background: linear-gradient(135deg, #fffaf0, #fdf0d9);
  border: 2px solid #f0d9b0;
}

.stat-card--member .stat-icon {
  background: #fff2cf;
  color: #c98a1e;
}

.stat-card--member strong {
  color: #8a5a12;
}

.parent-stat--member strong {
  color: #8a5a12;
}

.parent-stat--member .stat-icon {
  background: #fff2cf;
  color: #c98a1e;
}

/* 徽章 / 图鉴统计卡 */
.stat-card--badges .stat-icon {
  background: #fff2cf;
  color: #c98a1e;
}

.stat-card--codex .stat-icon {
  background: #efe7ff;
  color: #7a5ccc;
}

#quest-board {
  scroll-margin-top: 92px;
}

/* ============================================================
   阅读伙伴「阅阅」：模拟视频通话
   ============================================================ */

.nav-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffc94a, #ff9f43);
  color: #5a3b00;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.page.buddy-page {
  max-width: 800px;
  padding-top: 18px;
}

.buddy-call {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 620px;
  padding: 22px;
  border-radius: 36px;
  overflow: hidden;
  color: #f4fffb;
  background:
    radial-gradient(420px 260px at 82% 6%, rgba(103, 220, 200, 0.34), transparent 70%),
    radial-gradient(360px 260px at 8% 92%, rgba(255, 201, 74, 0.2), transparent 70%),
    linear-gradient(160deg, #143c3d 0%, #0e2a2c 55%, #0a2123 100%);
  box-shadow: 0 26px 60px rgba(10, 42, 43, 0.35);
}

.buddy-glow {
  position: absolute;
  inset: -30% -10% auto;
  height: 62%;
  background: radial-gradient(circle at 50% 30%, rgba(103, 220, 200, 0.35), transparent 62%);
  filter: blur(18px);
  pointer-events: none;
}

.buddy-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.buddy-peer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buddy-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5ee3a5;
  box-shadow: 0 0 0 0 rgba(94, 227, 165, 0.55);
  animation: buddyPulse 1.9s ease-out infinite;
  flex: none;
}

.buddy-peer-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.buddy-peer-copy strong {
  font-size: 17px;
  font-weight: 900;
}

.buddy-peer-copy span {
  font-size: 12.5px;
  color: rgba(244, 255, 251, 0.65);
}

.buddy-timer {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.buddy-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 0 2px;
}

.buddy-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 196px;
  height: 196px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(103, 220, 200, 0.32), rgba(16, 58, 59, 0.18) 72%);
}

.buddy-avatar::before,
.buddy-avatar::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 2px solid rgba(103, 220, 200, 0.35);
  animation: buddyRing 3.4s ease-out infinite;
}

.buddy-avatar::after {
  animation-delay: 1.7s;
}

.buddy-avatar svg {
  position: relative;
  width: 78%;
  height: 78%;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.35));
  animation: buddyFloat 4.2s ease-in-out infinite;
}

.buddy-wave {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 20px;
}

.buddy-wave span {
  width: 4px;
  border-radius: 3px;
  background: #67dcc8;
  opacity: 0.8;
  animation: buddyWave 1.3s ease-in-out infinite;
}

.buddy-wave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.buddy-wave span:nth-child(2) { height: 14px; animation-delay: 0.12s; }
.buddy-wave span:nth-child(3) { height: 20px; animation-delay: 0.24s; }
.buddy-wave span:nth-child(4) { height: 13px; animation-delay: 0.36s; }
.buddy-wave span:nth-child(5) { height: 7px; animation-delay: 0.48s; }

.buddy-topic {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(244, 255, 251, 0.6);
}

.buddy-panel {
  position: relative;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.buddy-bubble {
  min-height: 78px;
  padding: 16px 18px;
  border-radius: 22px 22px 22px 8px;
  background: rgba(255, 253, 249, 0.97);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  transition: box-shadow 0.2s ease;
}

.buddy-bubble.is-correct {
  box-shadow: 0 0 0 2px rgba(94, 227, 165, 0.55), 0 14px 30px rgba(0, 0, 0, 0.22);
}

.buddy-bubble.is-wrong {
  box-shadow: 0 0 0 2px rgba(255, 138, 112, 0.6), 0 14px 30px rgba(0, 0, 0, 0.22);
}

.buddy-bubble-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 800;
}

.buddy-bubble p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.buddy-bubble .buddy-reason {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.buddy-review-chip {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-strong);
  font-size: 12px;
  font-weight: 800;
}

.buddy-progress {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(244, 255, 251, 0.7);
}

.buddy-progress b {
  color: #ffd88a;
}

.buddy-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.buddy-reply {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4fffb;
  font-size: 15.5px;
  font-weight: 700;
  text-align: left;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.buddy-reply:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 220, 200, 0.7);
  background: rgba(255, 255, 255, 0.16);
}

.buddy-reply:disabled {
  cursor: default;
  opacity: 0.72;
}

.buddy-reply-letter {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 900;
  flex: none;
}

.buddy-reply.is-picked {
  border-color: rgba(255, 255, 255, 0.45);
}

.buddy-reply.is-correct {
  border-color: #5ee3a5;
  background: rgba(94, 227, 165, 0.18);
}

.buddy-reply.is-wrong {
  border-color: #ff8a70;
  background: rgba(238, 93, 62, 0.18);
}

.buddy-next-row {
  display: flex;
  justify-content: flex-end;
}

.buddy-next {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--yellow);
  color: #5a3b00;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(255, 201, 74, 0.3);
}

.buddy-next:hover {
  transform: translateY(-1px);
}

.buddy-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.buddy-hangup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6a52, #e0442a);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(224, 68, 42, 0.35);
  flex: none;
}

.buddy-hangup:hover {
  transform: translateY(-1px);
}

.buddy-hangup-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.buddy-hangup-icon svg {
  width: 18px;
  height: 18px;
}

.buddy-tip {
  font-size: 12.5px;
  color: rgba(244, 255, 251, 0.6);
  text-align: right;
}

.buddy-result {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 32, 33, 0.78);
  backdrop-filter: blur(6px);
}

.buddy-result-card {
  width: min(100%, 420px);
  padding: 26px 24px;
  border-radius: 28px;
  background: #fffaf0;
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.buddy-result-kicker {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 900;
}

.buddy-result-card h2 {
  margin: 10px 0 6px;
  font-size: 24px;
}

.buddy-result-card > p {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.buddy-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 12px;
}

.buddy-result-stats div {
  padding: 12px 8px;
  border-radius: 18px;
  background: #fff3da;
  border: 1px solid #ffe1ac;
}

.buddy-result-stats strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--coral-strong);
}

.buddy-result-stats span {
  font-size: 12px;
  color: var(--ink-soft);
}

.buddy-result-note {
  font-size: 12.5px !important;
  color: var(--muted) !important;
}

.buddy-result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.buddy-gate {
  max-width: 640px;
  margin: 34px auto;
  padding: 36px 28px;
  border-radius: 32px;
  background: #fffdf9;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.buddy-gate-art {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
}

.buddy-gate-art svg {
  width: 100%;
  height: 100%;
  animation: buddyFloat 4.2s ease-in-out infinite;
}

.buddy-gate h1 {
  font-size: clamp(24px, 3vw, 32px);
}

.buddy-gate-lead {
  max-width: 470px;
  margin: 8px auto 0;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.buddy-gate-list {
  display: grid;
  gap: 8px;
  max-width: 440px;
  margin: 18px auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.buddy-gate-list li {
  position: relative;
  padding-left: 26px;
  font-size: 15px;
  color: var(--ink-soft);
}

.buddy-gate-list li::before {
  content: "✦";
  position: absolute;
  left: 4px;
  color: var(--teal);
}

.buddy-gate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.buddy-gate-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

@keyframes buddyPulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 227, 165, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(94, 227, 165, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 227, 165, 0); }
}

@keyframes buddyRing {
  0% { transform: scale(0.82); opacity: 0.65; }
  100% { transform: scale(1.18); opacity: 0; }
}

@keyframes buddyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes buddyWave {
  0%, 100% { transform: scaleY(0.55); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 0.95; }
}

@media (max-width: 575px) {
  .page.buddy-page {
    padding: 12px 12px 40px;
  }

  .buddy-call {
    min-height: calc(100vh - 150px);
    padding: 18px 16px 20px;
    border-radius: 28px;
  }

  .buddy-avatar {
    width: 150px;
    height: 150px;
  }

  .buddy-bubble p {
    font-size: 15px;
  }

  .buddy-reply {
    padding: 12px 14px;
    font-size: 14.5px;
  }

  .buddy-tip {
    display: none;
  }

  .buddy-actions {
    justify-content: center;
  }

  .buddy-result-card {
    padding: 22px 18px;
  }

  .buddy-gate {
    margin: 16px auto;
    padding: 28px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .buddy-avatar svg,
  .buddy-avatar::before,
  .buddy-avatar::after,
  .buddy-wave span,
  .buddy-live-dot {
    animation: none;
  }
}

/* ==================== 每日挑战 / 时间宝 ==================== */

.challenge-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px auto;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff6e9 0%, #ffeecb 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.challenge-banner--new {
  background: linear-gradient(135deg, #fff1c9 0%, #ffe1d8 100%);
  border-color: #f6cf8f;
}

.challenge-banner--active {
  background: linear-gradient(135deg, #e3ecfb 0%, #ede7fc 100%);
  border-color: #c9d6f5;
}

.challenge-banner--done {
  background: linear-gradient(135deg, #ddf3ef 0%, #e3ecfb 100%);
  border-color: #bfe6de;
}

.challenge-banner-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 18px;
  background: #fff;
  color: var(--coral);
  box-shadow: var(--shadow-sm);
}

.challenge-banner-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.challenge-banner-copy strong {
  font-size: 18px;
  color: var(--ink);
}

.challenge-banner-copy > span:last-child {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.challenge-banner-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.challenge-hero h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(24px, 4vw, 34px);
}

.challenge-intro,
.challenge-run,
.challenge-result,
.challenge-locked {
  max-width: 860px;
  margin: 0 auto;
}

.challenge-rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.challenge-rule-list li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--line);
}

.challenge-rule-list strong {
  color: var(--ink);
  font-size: 15px;
}

.challenge-rule-list span {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.challenge-intro-actions,
.challenge-locked-actions,
.challenge-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.challenge-intro-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.challenge-locked {
  text-align: center;
  padding: 38px 26px;
}

.challenge-locked-art {
  display: inline-grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 26px;
  background: var(--yellow-soft);
  color: var(--ink);
  margin-bottom: 12px;
}

.challenge-locked p {
  max-width: 520px;
  margin: 8px auto 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.challenge-locked-actions {
  justify-content: center;
}

.challenge-run-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.challenge-progress {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.challenge-timer {
  flex: 1 1 auto;
  height: 12px;
  border-radius: 999px;
  background: var(--cream-deep);
  overflow: hidden;
}

.challenge-timer-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) 0%, #4cc7b7 100%);
  transition: width 0.12s linear;
}

.challenge-timer-fill.is-low {
  background: linear-gradient(90deg, var(--coral-strong) 0%, var(--coral) 100%);
}

.challenge-timer-text {
  flex: 0 0 52px;
  text-align: right;
  font-size: 16px;
  color: var(--ink);
}

.challenge-source {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13.5px;
}

.challenge-prompt {
  margin: 0 0 18px;
  font-size: clamp(19px, 3vw, 24px);
  line-height: 1.55;
  color: var(--ink);
}

.challenge-options {
  display: grid;
  gap: 10px;
}

.challenge-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.challenge-option:hover:not(:disabled),
.challenge-option:focus-visible {
  border-color: var(--yellow);
  background: var(--yellow-soft);
  transform: translateY(-1px);
}

.challenge-option:disabled {
  cursor: default;
}

.challenge-option-key {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 10px;
  background: var(--cream-deep);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}

.challenge-option.is-picked {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.challenge-option.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.challenge-option.is-correct .challenge-option-key {
  background: var(--green);
  color: #fff;
}

.challenge-option.is-wrong {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.challenge-option.is-wrong .challenge-option-key {
  background: var(--coral);
  color: #fff;
}

.challenge-feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14.5px;
  line-height: 1.65;
}

.challenge-feedback strong {
  font-size: 16px;
}

.challenge-feedback.is-correct {
  background: var(--green-soft);
  color: var(--teal-strong);
}

.challenge-feedback.is-wrong,
.challenge-feedback.is-timeout {
  background: var(--coral-soft);
  color: var(--coral-strong);
}

.challenge-run-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.challenge-gems {
  color: var(--ink-soft);
  font-size: 14px;
}

.challenge-timeout {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(42, 42, 60, 0.45);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.challenge-timeout.is-open {
  opacity: 1;
}

.challenge-timeout-card {
  width: min(420px, 100%);
  padding: 26px 24px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.challenge-timeout-icon {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: var(--coral-soft);
  color: var(--coral-strong);
  margin-bottom: 10px;
}

.challenge-timeout-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--ink);
}

.challenge-timeout-card p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.challenge-timeout-gems {
  color: var(--ink);
  font-size: 14.5px;
  margin-bottom: 16px;
}

.challenge-timeout-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challenge-result {
  text-align: center;
  padding: 34px 26px;
}

.challenge-result.is-passed {
  background: linear-gradient(160deg, #fff9ea 0%, #e6f7f2 100%);
  border: 1px solid #c8ead9;
}

.challenge-result.is-failed {
  background: linear-gradient(160deg, #fff7f2 0%, #fff1c9 100%);
  border: 1px solid #f3dcc5;
}

.challenge-result-badge {
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 28px;
  background: #fff;
  color: var(--yellow);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.challenge-result h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.6vw, 28px);
  color: var(--ink);
}

.challenge-result-line {
  color: var(--ink-soft);
  font-size: 15px;
}

.challenge-pass-tag,
.challenge-fail-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.challenge-pass-tag {
  background: var(--green);
  color: #fff;
}

.challenge-fail-tag {
  background: var(--coral-soft);
  color: var(--coral-strong);
}

.challenge-reward-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.challenge-reward {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}

.challenge-level-up {
  color: var(--purple);
  font-weight: 700;
}

.challenge-result-note {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.challenge-result-actions {
  justify-content: center;
}

@media (max-width: 720px) {
  .challenge-banner {
    flex-wrap: wrap;
    padding: 16px;
    gap: 12px;
  }

  .challenge-banner-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 14px;
  }

  .challenge-banner-copy {
    flex-basis: calc(100% - 60px);
  }

  .challenge-banner-btn {
    width: 100%;
    justify-content: center;
  }

  .challenge-rule-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .challenge-run-head {
    gap: 10px;
  }

  .challenge-option {
    font-size: 15px;
    padding: 12px 14px;
  }

  .challenge-timeout-actions .btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------ 可穿戴角色 / 装扮特效 */

/* 角色本人：分层 SVG，穿脱只切换 data-on */
.char-doll {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  overflow: visible;
}

.char-layer[data-on="0"] {
  display: none;
}

.char-decor[data-on="0"] {
  display: none;
}

.avatar-figure {
  width: 100%;
  justify-content: center;
}

.avatar-figure.is-changing .char-doll {
  animation: charPop 0.42s ease;
}

.avatar-stage {
  padding: 16px 12px 12px;
  border: 2px solid #F0DFC3;
  border-radius: 26px;
  background: linear-gradient(180deg, #FFF4DE 0%, #FCE6C6 62%, #E9F7EC 100%);
  overflow: hidden;
}

.avatar-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 14% 16%, #FFF6D8 55%, transparent 56%),
    radial-gradient(2.4px 2.4px at 32% 9%, #FFF6D8 55%, transparent 56%),
    radial-gradient(1.8px 1.8px at 58% 14%, #FFF6D8 55%, transparent 56%),
    radial-gradient(2.2px 2.2px at 78% 8%, #FFF6D8 55%, transparent 56%),
    radial-gradient(1.6px 1.6px at 88% 20%, #FFF6D8 55%, transparent 56%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.character-hero[data-phase="day"] .avatar-stage {
  background: linear-gradient(180deg, #FFF9E8 0%, #FDEBCB 62%, #E9F7EC 100%);
}

.character-hero[data-phase="dusk"] .avatar-stage {
  background: linear-gradient(180deg, #FFE3C0 0%, #F8C79C 58%, #DCD4EE 100%);
  border-color: #EBC7A4;
}

.character-hero[data-phase="night"] .avatar-stage {
  background: linear-gradient(180deg, #2B3464 0%, #3A4376 58%, #223052 100%);
  border-color: #3C477E;
}

.character-hero[data-phase="night"] .avatar-stage::before {
  opacity: 1;
}

.character-hero[data-phase="night"] .avatar-halo {
  background: radial-gradient(circle, rgba(255, 228, 150, 0.42) 0%, rgba(255, 228, 150, 0) 70%);
}

.char-stage-note {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #8A7052;
  text-align: center;
}

.character-hero[data-phase="night"] .char-stage-note {
  color: #D9E2FF;
}

/* 部位速览条 */
.char-slot-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.slot-strip-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 9px;
  border: 1px dashed #DBC9AE;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  color: #9C8A70;
}

.slot-strip-item.is-on {
  border-style: solid;
  border-color: #7FC9B4;
  background: #F1FBF7;
}

.slot-strip-item strong {
  font-size: 11.5px;
  color: #4A3B33;
}

.slot-strip-item:not(.is-on) strong {
  font-weight: 600;
  color: #B3A48E;
}

/* 衣柜：按部位分组，一组只能穿一件 */
.slot-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.slot-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf9;
}

.slot-card.is-on {
  border-style: solid;
  border-color: var(--teal);
  background: var(--teal-soft);
}

.slot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slot-card-label {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
}

.slot-card-state {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.slot-card.is-on .slot-card-state {
  color: #0F7F73;
}

.slot-card-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 9px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.slot-option.is-equipped {
  border-color: var(--teal);
  background: #E8F8F3;
}

.slot-option--locked {
  opacity: 0.62;
}

.slot-option-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--item-color, var(--coral-strong));
}

.slot-option-icon .icon {
  width: 17px;
  height: 17px;
}

.slot-option-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-option-btn {
  min-height: 26px;
  padding: 2px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
}

.slot-option.is-equipped .slot-option-btn {
  border-color: #12A08C;
  color: #0F6F60;
}

.slot-option-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.slot-option-price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 800;
  color: var(--coral-strong);
}

.slot-option-price .icon {
  width: 13px;
  height: 13px;
}

.slot-card-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

.slot-empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* 小岛场景里的迷你角色：不拦截点击 */
.island-avatar {
  pointer-events: none;
}

/* ---- 装扮特效：全部是 CSS 动画，可被 prefers-reduced-motion 关掉 ---- */
@keyframes charPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes charSway {
  0%, 100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.4deg); }
}

.fx-sway {
  transform-box: fill-box;
  transform-origin: 50% 4%;
  animation: charSway 4.2s ease-in-out infinite;
}

@keyframes charStarFall {
  0% { transform: translateY(-7px); opacity: 0; }
  20% { opacity: 0.95; }
  70% { opacity: 0.85; }
  100% { transform: translateY(28px); opacity: 0; }
}

.fx-star-particle {
  animation: charStarFall 3.6s ease-in-out infinite;
}

@keyframes charShimmer {
  0%, 40% { transform: translateX(0); }
  100% { transform: translateX(320px); }
}

.fx-shimmer {
  animation: charShimmer 3.8s ease-in-out infinite;
}

@keyframes charGlare {
  0%, 55% { transform: translateX(0); }
  100% { transform: translateX(92px); }
}

.fx-glare {
  animation: charGlare 5.2s ease-in-out infinite;
}

@keyframes charShine {
  0%, 45% { transform: translateX(0); }
  100% { transform: translateX(42px); }
}

.fx-shine {
  animation: charShine 3.4s ease-in-out infinite;
}

@keyframes charGlow {
  0%, 100% { opacity: 0.16; transform: scale(0.92); }
  50% { opacity: 0.32; transform: scale(1.05); }
}

@keyframes charGlowNight {
  0%, 100% { opacity: 0.4; transform: scale(0.96); }
  50% { opacity: 0.68; transform: scale(1.1); }
}

.fx-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: charGlow 3.2s ease-in-out infinite;
}

.fx-lantern-cone {
  opacity: 0.3;
  transition: opacity 0.4s ease;
}

.char-doll[data-phase="night"] .fx-glow {
  animation: charGlowNight 2.6s ease-in-out infinite;
}

.char-doll[data-phase="night"] .fx-lantern-cone {
  opacity: 0.95;
}

.char-doll[data-phase="night"] .char-lantern {
  filter: drop-shadow(0 0 9px rgba(255, 201, 74, 0.85));
}

.char-doll[data-phase="dusk"] .fx-lantern-cone {
  opacity: 0.6;
}

@keyframes charScarf {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-5deg); }
}

.fx-scarf {
  transform-box: fill-box;
  transform-origin: 55% 4%;
  animation: charScarf 3.6s ease-in-out infinite;
}

@keyframes charFlagWave {
  0%, 100% { transform: skewY(0deg) scaleX(1); }
  50% { transform: skewY(2.6deg) scaleX(0.95); }
}

.fx-flag {
  transform-box: fill-box;
  transform-origin: 0% 50%;
  animation: charFlagWave 2.4s ease-in-out infinite;
}

@keyframes charFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.fx-float {
  animation: charFloat 4s ease-in-out infinite;
}

@keyframes charTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.1); }
}

.fx-twinkle {
  transform-box: fill-box;
  transform-origin: center;
  animation: charTwinkle 2.6s ease-in-out infinite;
}

.fx-twinkle--late {
  animation-delay: 1.2s;
}

@keyframes charStep {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.6); }
  40% { opacity: 1; transform: translateY(-4px) scale(1); }
}

.fx-step-star {
  transform-box: fill-box;
  transform-origin: center;
  animation: charStep 2.8s ease-in-out infinite;
}

.fx-step-star--late {
  animation-delay: 1.1s;
}

@keyframes charBobSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.4px); }
}

.fx-bob-soft {
  animation: charBobSoft 5s ease-in-out infinite;
}

@media (max-width: 575.98px) {
  .character-hero {
    padding: 16px;
    gap: 18px;
  }

  .avatar-stage {
    padding: 14px 10px 12px;
  }

  .char-doll {
    max-width: 240px;
  }

  .slot-board {
    grid-template-columns: 1fr;
  }

  .slot-option-name {
    max-width: 96px;
  }

  .slot-option {
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .char-doll [class*="fx-"],
  .avatar-figure.is-changing .char-doll {
    animation: none !important;
  }
}

/* ------------------------------------------------------------ 称号轨 */

.hero-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-left: 6px solid var(--title-color, var(--teal));
  border-radius: 16px;
  background: #fffdf9;
  text-align: left;
}

.hero-title-emblem {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff7e8;
  color: var(--title-color, var(--teal));
  flex: none;
}

.hero-title-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hero-title-label {
  font-size: 11px;
  color: var(--muted);
}

.hero-title-name {
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
}

.hero-title-note,
.hero-title-next {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.hero-title-next b {
  color: var(--title-color, var(--teal));
}

.hero-title-unlock {
  display: block;
  color: var(--muted);
}

.hero-title-bar {
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: #f0e3d0;
  overflow: hidden;
}

.hero-title-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--title-color, var(--teal));
  transition: width 0.4s ease;
}

.passport {
  min-width: 0;
}

.passport-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.passport-grade {
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
}

.passport-grade.is-unavailable {
  opacity: 0.72;
  background: #faf7f1;
}

.passport-grade-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.passport-grade-head h3 {
  font-size: 15px;
}

.passport-grade-head span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.passport-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.passport-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 5px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #faf7f1;
  text-align: center;
}

.passport-cell.is-earned {
  border-style: solid;
  border-color: var(--title-color, var(--teal));
  background: #fffdf9;
}

.passport-cell.is-current {
  outline: 3px solid var(--title-color, var(--teal));
  outline-offset: 2px;
}

.passport-icon {
  display: grid;
  place-items: center;
  color: var(--title-color, var(--teal));
}

.passport-cell.is-locked .passport-icon {
  color: #b9b2a7;
  opacity: 0.55;
  filter: grayscale(1);
}

.passport-name {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.passport-cell.is-locked .passport-name {
  color: #a29a8e;
}

.passport-req {
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted);
}

.passport-capstone {
  margin-top: 14px;
  padding: 12px;
  border: 2px solid #eadcc4;
  border-radius: 16px;
  background: #fff8ea;
}

.passport-capstone h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.passport-cell--capstone {
  border-style: solid;
}

.passport-legacy {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.passport-legacy .icon {
  flex: none;
  margin-top: 1px;
}

/* ------------------------------------------------------------ 升级仪式 */

body.ceremony-open {
  overflow: hidden;
}

.ceremony {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(42, 42, 60, 0.52);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.ceremony[hidden] {
  display: none;
}

.ceremony-card {
  position: relative;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 30px 22px 22px;
  border: 3px solid var(--ceremony-color, var(--teal));
  border-radius: 26px;
  background: #fffdf9;
  box-shadow: 0 26px 60px rgba(22, 26, 46, 0.32);
  text-align: center;
}

.ceremony-card.is-in {
  animation: ceremonyPop 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.ceremony-rays {
  position: absolute;
  top: -32%;
  left: 50%;
  width: 150%;
  height: 90%;
  margin-left: -75%;
  background: conic-gradient(
    from 0deg,
    transparent 0 12deg,
    var(--ceremony-color, var(--teal)) 12deg 16deg,
    transparent 16deg 34deg
  );
  opacity: 0.16;
  pointer-events: none;
  animation: ceremonySpin 18s linear infinite;
}

.ceremony[data-mode="big"] .ceremony-rays {
  opacity: 0.24;
}

.ceremony-medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--ceremony-color, var(--teal));
  color: #fff;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.72), 0 14px 28px rgba(22, 26, 46, 0.16);
}

.ceremony[data-mode="big"] .ceremony-medal {
  width: 108px;
  height: 108px;
}

.ceremony-kicker {
  display: block;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.ceremony-card h2 {
  margin: 4px 0 8px;
  font-size: 28px;
  color: var(--ink);
}

.ceremony[data-mode="big"] .ceremony-card h2 {
  font-size: 32px;
  color: var(--ceremony-color, var(--teal));
}

.ceremony-sub {
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.ceremony-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff6df;
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.ceremony-badge[hidden] {
  display: none;
}

.ceremony-badge-icon {
  flex: none;
  color: #c58a00;
}

.ceremony-skip {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.ceremony-skip:hover,
.ceremony-skip:focus-visible {
  background: #f4ece0;
}

#ceremony-continue {
  min-width: 150px;
}

@keyframes ceremonyPop {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ceremonySpin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------ 称号光环 */

.char-aura {
  transform-box: fill-box;
  transform-origin: center;
}

.char-aura--glow {
  animation: auraBreathe 4.6s ease-in-out infinite;
}

.char-aura--wings {
  animation: auraBreathe 5.4s ease-in-out infinite;
}

.char-aura--orbit {
  animation: auraDrift 24s linear infinite;
}

.char-aura-spark {
  animation: auraTwinkle 3.2s ease-in-out infinite;
}

@keyframes auraBreathe {
  0%, 100% { opacity: 0.75; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes auraDrift {
  to { transform: rotate(360deg); }
}

@keyframes auraTwinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ceremony-card.is-in,
  .ceremony-rays,
  .char-aura,
  .char-aura-spark {
    animation: none !important;
  }
}

@media (max-width: 991.98px) {
  .hero-title {
    max-width: none;
    flex: 1 1 220px;
  }
}

@media (max-width: 575.98px) {
  .passport-grid {
    grid-template-columns: 1fr;
  }

  .passport-cell {
    padding: 7px 4px;
  }

  .passport-name {
    font-size: 11px;
  }

  .ceremony-card {
    padding: 28px 16px 18px;
  }

  .ceremony-card h2 {
    font-size: 24px;
  }

  .ceremony[data-mode="big"] .ceremony-card h2 {
    font-size: 27px;
  }

  .ceremony-medal {
    width: 78px;
    height: 78px;
  }

  .ceremony[data-mode="big"] .ceremony-medal {
    width: 92px;
    height: 92px;
  }
}

/* ------------------------------------------------------------ 整卷提交 · 错题回原文 */

/* 题号圆点现在是可点击的按钮，去掉浏览器默认外观 */
.quiz-dot {
  padding: 0;
  border: 0;
  cursor: pointer;
}

/* 作答阶段只表示“我选了它”，不透露对错 */
.option.is-selected {
  border-color: var(--teal);
  background: #eefaf7;
  box-shadow: 0 0 0 3px rgba(24, 156, 141, 0.16);
}

.option.is-selected .option-letter {
  background: var(--teal);
  color: #fff;
}

.story-para {
  margin: 0 0 0.55em;
}

.story-para:last-child {
  margin-bottom: 0;
}

.story-sentence {
  border-radius: 6px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.story-sentence.is-hinted {
  background: #ffe9a8;
  box-shadow: 0 0 0 4px #ffe9a8;
  animation: sentenceHint 1.4s ease-in-out 2;
}

@keyframes sentenceHint {
  0%, 100% { background: #ffe9a8; }
  50% { background: #ffd977; }
}

/* 非连续文本：正文里的数据表，窄屏下只收缩不溢出 */
.story-table-wrap {
  margin: 0.2em 0 1em;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.story-table-caption {
  margin-bottom: 8px;
  font-size: 0.78em;
  font-weight: 700;
  color: #6b4e2e;
}

.story-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
  background: #fffdf8;
  font-size: clamp(15px, 2.6vw, 19px);
  line-height: 1.55;
}

.story-table th,
.story-table td {
  padding: 10px 14px;
  border: 1px solid #eadcc8;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.story-table th {
  background: #fff3e0;
  color: #6b4e2e;
  font-weight: 700;
}

.story-table th + th,
.story-table td + td {
  text-align: right;
  white-space: nowrap;
}

.story-table tr.is-hinted {
  background: #ffe9a8;
}

@media (max-width: 640px) {
  .story-table th,
  .story-table td {
    padding: 9px 10px;
  }
}

/* 结算里的逐题回顾 */
.quiz-review {
  margin-top: 18px;
  text-align: left;
}

.quiz-review[hidden] {
  display: none;
}

.review-title {
  margin: 0 0 10px;
  font-size: 16px;
  text-align: left;
}

.review-item {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.review-item.is-wrong {
  border-color: #f2c2b6;
  background: #fff8f5;
}

.review-item.is-recovered {
  border-color: #9fd8c9;
  background: #f3fbf8;
}

.review-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.review-no {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--yellow-soft);
  color: #8a5a08;
  font-size: 12px;
  font-weight: 900;
  flex: none;
}

.review-prompt {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.review-flag {
  font-size: 12px;
  font-weight: 800;
  color: #c0532f;
  flex: none;
}

.review-item.is-correct .review-flag,
.review-item.is-recovered .review-flag {
  color: #0f7f73;
}

.review-chosen {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.review-hint {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--yellow-soft);
  color: #8a5a08;
  font-size: 13px;
  line-height: 1.55;
}

.review-quote {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fffbf1;
  color: #6b5a43;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* 复习原文侦探：选依据段 → 读原文 → 再答一次 */
.reread-summary {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #eef8f4;
  color: #0f7f73;
  font-size: 13px;
  font-weight: 800;
}

.reread-summary[hidden] {
  display: none;
}

.reread-box {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed #b9dcca;
  border-radius: 14px;
  background: #f7fcfa;
}

.reread-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.reread-badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: #0f7f73;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.reread-title {
  flex: 1 1 160px;
  min-width: 0;
  color: #135c53;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.reread-open {
  margin-top: 8px;
}

.reread-panel {
  margin-top: 8px;
}

.reread-panel[hidden] {
  display: none;
}

.reread-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reread-chip {
  padding: 6px 10px;
  border: 1px solid #cfe7dc;
  border-radius: 999px;
  background: #fff;
  color: #35665d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.reread-chip.is-active {
  border-color: #0f7f73;
  background: #0f7f73;
  color: #fff;
}

.reread-chip:disabled {
  cursor: default;
  opacity: 0.72;
}

.reread-viewer {
  margin-top: 8px;
  padding: 10px 12px;
  max-height: 280px;
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e3efe9;
}

.reread-viewer[hidden] {
  display: none;
}

.reread-text {
  margin: 0;
  color: #3f4a48;
  font-size: 14px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.reread-mark {
  padding: 0 2px;
  border-radius: 4px;
  background: #ffe9a8;
  color: inherit;
}

.reread-caption {
  margin: 0 0 6px;
  color: #35665d;
  font-size: 12px;
  font-weight: 800;
}

.reread-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.reread-table th,
.reread-table td {
  padding: 6px 8px;
  border: 1px solid #e3efe9;
  text-align: left;
  overflow-wrap: anywhere;
}

.reread-table th {
  background: #eef8f4;
  color: #135c53;
}

.reread-table tr.is-mark td {
  background: #ffe9a8;
}

.reread-confirm {
  margin-top: 8px;
}

.reread-status {
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--yellow-soft);
  color: #8a5a08;
  font-size: 12.5px;
  line-height: 1.55;
}

.reread-status.is-good {
  background: #e6f6f0;
  color: #0f7f73;
  font-weight: 800;
}

.reread-status[hidden] {
  display: none;
}

.reread-answer {
  margin-top: 10px;
}

.reread-answer[hidden] {
  display: none;
}

.reread-answer-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-locate {
  margin-top: 8px;
}

.review-retry {
  margin-top: 10px;
}

.review-retry-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.review-retry-options {
  display: grid;
  gap: 8px;
}

.option-compact {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.option-compact .option-letter {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.review-explain {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.review-explain.is-good {
  color: #0f7f73;
  font-weight: 700;
}

/* 交卷后：用放大镜重答错题 */
.review-peek {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.review-peek-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #0f7f73;
}

.review-peek-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.review-peek-options {
  margin-top: 8px;
}

/* 回原文时固定在底部的“回到结果” */
.review-return {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 1100;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
}

.review-return[hidden] {
  display: none;
}

.review-return .btn {
  width: 100%;
  box-shadow: 0 14px 30px rgba(22, 26, 46, 0.22);
}

@media (max-width: 575.98px) {
  .result-card {
    padding: 20px 16px;
  }

  .review-item {
    padding: 10px 12px;
  }

  .review-prompt {
    flex-basis: 100%;
    order: 3;
  }

  .option-compact {
    font-size: 13.5px;
  }

  .review-return {
    bottom: 12px;
    width: calc(100% - 24px);
  }
}



/* ============================================================ 小岛巡检与记忆修缮（P1 只读展示） */
.memory-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 0;
  padding: 18px 20px;
  border: 1.5px solid #d9e2ea;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f7fbfd, #eef4f8);
  box-shadow: var(--shadow-sm);
}

.memory-banner-icon {
  font-size: 28px;
  line-height: 1;
}

.memory-banner-copy {
  flex: 1;
  min-width: 0;
}

.memory-banner-copy h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--ink);
}

.memory-banner-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.memory-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef4f8;
  border: 1px solid #d5e0e8;
  color: #607383;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.memory-chip--star {
  background: #fff7e4;
  border-color: #f0ddb0;
  color: #9a7a34;
}

.island-plot.is-memory-faded .island-building,
.island-plot.is-memory-faded {
  filter: saturate(0.42) brightness(0.92);
}

.island-memory-sleep {
  filter: none;
  animation: memory-sleep-float 3.4s ease-in-out infinite;
}

@keyframes memory-sleep-float {
  0%, 100% { transform: translate(24px, -76px); }
  50% { transform: translate(24px, -80px); }
}

.level-row.is-memory-faded {
  border-color: #d8e2ea;
  background: linear-gradient(180deg, #fbfdff, #f4f8fb);
}

.memory-passport-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #d9e2ea;
  background: #f5f9fc;
}

.memory-passport-copy {
  flex: 1;
  display: grid;
  gap: 3px;
}

.memory-passport-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.memory-passport-copy span {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.inspection-list {
  display: grid;
  gap: 14px;
  margin: 22px 0 0;
}

.inspection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: #fffdf8;
  box-shadow: var(--shadow-sm);
}

.inspection-card.is-memory-faded {
  border-color: #d8e2ea;
  background: linear-gradient(135deg, #fbfdff, #f3f8fb);
}

.inspection-card-main {
  min-width: 0;
}

.inspection-kicker {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.inspection-card h2 {
  margin: 4px 0 6px;
  font-size: 19px;
  color: var(--ink);
}

.inspection-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.inspection-card-side {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex-shrink: 0;
}

.inspection-note {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  color: #7a622a;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .memory-banner,
  .inspection-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .inspection-card-side {
    width: 100%;
    justify-items: stretch;
  }

  .inspection-card-side .btn {
    width: 100%;
    text-align: center;
  }

  .memory-passport-strip {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .island-memory-sleep {
    animation: none;
    transform: translate(24px, -76px);
  }
}

/* ------------------------------------------------ 衣柜：每件装扮各级小样 */
.tier-strip {
  flex-basis: 100%;
  display: flex;
  gap: 6px;
  padding: 8px 6px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.tier-preview {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: zoom-in;
  touch-action: manipulation;
}

.tier-preview:focus-visible {
  outline: 3px solid #e8b54d;
  outline-offset: 2px;
}

.tier-preview-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tier-preview-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.tier-preview-label {
  font-size: 10px;
  line-height: 1.2;
  color: #5a6b7b;
  white-space: nowrap;
}

.tier-preview.is-current {
  border-color: #1c9c70;
  background: #eaf7ef;
}

.tier-preview.is-next {
  border-color: #e8b54d;
  background: #fff8e6;
}

.tier-preview-tag {
  position: absolute;
  top: -7px;
  right: 2px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #1c9c70;
  color: #fff;
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
}

.tier-preview-tag--next {
  background: #e8b54d;
  color: #5b4310;
}

/* 小样只做静态对比，避免整页几十个图层同时呼吸/闪烁 */
.tier-preview .char-layer {
  animation: none !important;
}

.tier-preview .char-spark,
.tier-preview .char-decor-star {
  animation: none !important;
}

@media (max-width: 420px) {
  .tier-preview-label {
    font-size: 9px;
  }

  .tier-preview-tag {
    font-size: 8px;
  }
}

/* ------------------------------------------------ 升级小样放大查看 */
body.tier-modal-open {
  overflow: hidden;
}

.tier-modal {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.tier-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 42, 60, 0.55);
  backdrop-filter: blur(4px);
}

.tier-modal-card {
  position: relative;
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px 16px;
  border: 2px solid var(--line);
  border-radius: 26px;
  background: #fffdf9;
  box-shadow: var(--shadow-md);
}

.tier-modal-title {
  margin: 0 46px 10px 0;
  font-size: 20px;
}

.tier-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.tier-modal-compare {
  display: flex;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
}

.tier-modal-panel {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tier-modal-panel.is-focus {
  border-color: #e8b54d;
  background: #fffaf0;
}

.tier-modal-panel figcaption {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  text-align: center;
}

.tier-modal-art {
  width: 100%;
  height: min(46vh, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tier-modal-art .tier-preview-svg {
  width: 100%;
  height: 100%;
}

.tier-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.tier-modal-nav {
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.tier-modal-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.tier-modal-dots {
  display: flex;
  gap: 6px;
}

.tier-modal-dot {
  min-width: 44px;
  min-height: 40px;
  padding: 4px 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.tier-modal-dot.is-active {
  border-color: #e8b54d;
  background: #e8b54d;
  color: #5b4310;
}

.tier-modal-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .tier-modal {
    padding: 10px;
  }

  .tier-modal-card {
    padding: 16px 12px 12px;
    border-radius: 20px;
  }

  .tier-modal-compare {
    gap: 8px;
  }

  .tier-modal-panel {
    padding: 6px;
  }

  .tier-modal-art {
    height: min(34vh, 220px);
  }

  .tier-modal-hint {
    display: none;
  }
}

/* ------------------------------------------------ 装扮升级：★1 新装 / ★2 盛装 / ★3 星辉 */
.char-layer[data-tier="1"],
.char-layer[data-tier="2"],
.char-layer[data-tier="3"] {
  filter: hue-rotate(var(--item-hue, 0deg)) saturate(var(--item-sat, 1))
    brightness(var(--item-bright, 1))
    drop-shadow(0 0 1.6px var(--item-accent, #ffe9a8));
}

.char-layer[data-tier="2"],
.char-layer[data-tier="3"] {
  animation: charTierGlow 3.6s ease-in-out infinite;
}

.char-layer[data-tier="3"] {
  animation-duration: 2.8s;
  filter: hue-rotate(var(--item-hue, 0deg)) saturate(var(--item-sat, 1))
    brightness(var(--item-bright, 1))
    drop-shadow(0 0 4px var(--item-accent, #ffe9a8));
}

@keyframes charTierGlow {
  0%,
  100% {
    filter: hue-rotate(var(--item-hue, 0deg)) saturate(var(--item-sat, 1))
      brightness(var(--item-bright, 1))
      drop-shadow(0 0 2px var(--item-accent, #ffe9a8));
  }
  50% {
    filter: hue-rotate(var(--item-hue, 0deg)) saturate(var(--item-sat, 1))
      brightness(1.1) drop-shadow(0 0 7px var(--item-accent, #ffe9a8));
  }
}

.char-spark {
  transform-box: fill-box;
  transform-origin: center;
}

.char-decor {
  pointer-events: none;
}

.char-decor-star {
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .char-layer[data-tier="2"],
  .char-layer[data-tier="3"] {
    animation: none;
  }
}

.slot-option-stars {
  font-size: 11px;
  letter-spacing: 1px;
  color: #c98a13;
}

.slot-option--upgrade {
  border-style: dashed;
  gap: 5px;
}

.slot-option--upgrade.is-short {
  opacity: 0.72;
}

.slot-option--max {
  border-style: dashed;
  opacity: 0.75;
}

.slot-upgrade-label {
  font-size: 12px;
  font-weight: 800;
}

.slot-upgrade-cost {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.slot-upgrade-cost .icon {
  width: 12px;
  height: 12px;
}

/* ------------------------------------------------ 小岛大件景物 */
.scenery-panel .panel-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.scenery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.scenery-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid rgba(200, 178, 120, 0.45);
  border-radius: 16px;
  background: #fffdf8;
}

.scenery-card.is-locked {
  opacity: 0.62;
}

.scenery-card.is-owned {
  border-color: #8fd3b8;
  background: #f4fbf6;
}

.scenery-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #fff3d1;
  color: #c98a13;
  flex: none;
}

.scenery-copy {
  flex: 1;
  min-width: 140px;
}

.scenery-copy strong {
  font-size: 14px;
}

.scenery-copy p {
  margin: 2px 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.scenery-unlock {
  font-size: 11px;
  font-weight: 700;
  color: #8a6a2f;
}

.scenery-actions {
  margin-left: auto;
}

.scenery-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #9a9488;
}

.scenery-spin {
  animation: scenerySpin 12s linear infinite;
  transform-box: fill-box;
}

@keyframes scenerySpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scenery-spin {
    animation: none;
  }
}
.shop-card.is-locked {
  opacity: 0.62;
}

.shop-locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #8a6a2f;
}

/* 记忆巡检：家长端卡片 */
.memory-parent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.memory-parent-item { background: var(--paper, #fdf8ef); border-radius: 14px; padding: 12px 8px; text-align: center; }
.memory-parent-item strong { display: block; font-size: 1.35rem; color: var(--ink); }
.memory-parent-item span { font-size: 0.82rem; color: var(--muted); }
.memory-parent-note { margin-top: 10px; font-size: 0.9rem; color: var(--ink-soft); }
.memory-parent-fast { margin-top: 10px; font-size: 0.9rem; color: var(--ink-soft); }
.memory-parent-fast summary { cursor: pointer; }
.memory-parent-fast ul { margin: 6px 0 0 18px; }
@media (max-width: 700px) {
  .memory-parent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 每日复习分段：本段 / 今日进度 */
.review-segment-line { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: 0.9rem; color: var(--ink-soft); }
.review-segment-line span { background: var(--cream-deep); border-radius: 999px; padding: 4px 10px; }
.segment-note { margin: 14px 0 6px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--teal-strong); font-weight: 600; }
.inspection-review-tip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--yellow-soft); color: var(--ink-soft); }

/* 原文放大镜 */
.quiz-head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.peek-btn { color: var(--blue); }
.peek-btn.is-open { color: var(--teal-strong); }
.peek-btn[hidden] { display: none; }
.review-peek { margin-left: 8px; font-size: 0.78rem; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 2px 8px; }
body.peek-open { overflow: hidden; }
.peek-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(42, 42, 60, 0.45); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.peek-sheet { width: min(720px, 100%); max-height: 82vh; display: flex; flex-direction: column; background: var(--cream); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.peek-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--blue-soft); }
.peek-head strong { font-size: 1.05rem; color: var(--ink); }
.peek-hint { flex: 1; font-size: 0.82rem; color: var(--ink-soft); }
.peek-body { overflow-y: auto; padding: 6px 20px 18px; }
.peek-paragraph { margin: 12px 0; line-height: 1.9; font-size: 1.02rem; color: var(--ink); }
.peek-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px dashed var(--line); font-size: 0.82rem; color: var(--muted); }
@media (min-width: 760px) {
  .peek-overlay { align-items: center; }
}

/* 家长端：生字本最近新增 */
.vocab-recent { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.vocab-recent-hint { margin: 4px 0 10px; font-size: 0.88rem; color: var(--muted); }
.vocab-recent-list { display: flex; flex-direction: column; gap: 8px; }
.vocab-recent-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.vocab-recent-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; }
.vocab-recent-copy strong { font-size: 1.05rem; }
.vocab-recent-copy small { flex-basis: 100%; color: var(--ink-soft); }
.vocab-recent-pinyin { color: var(--muted); font-size: 0.85rem; }
.vocab-recent-source { font-size: 0.75rem; color: var(--teal-strong); background: var(--teal-soft); border-radius: 999px; padding: 2px 8px; }

/* 家长端：默写记录（只记录错字与错因，不存笔迹） */
.dictation-record { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.dictation-record h3 { margin: 0 0 4px; font-size: 1rem; }
.dictation-record-hint { margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); }
.dictation-record-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.dictation-record-stats > div {
  flex: 1 1 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  background: var(--cream);
}
.dictation-record-stats strong { font-size: 1.35rem; color: var(--teal-strong); }
.dictation-record-stats span { font-size: 0.78rem; color: var(--muted); }
.dictation-wrong { margin-top: 12px; }
.dictation-wrong h4 { margin: 0 0 6px; font-size: 0.9rem; color: var(--ink-soft); }
.dictation-wrong ul { display: flex; flex-direction: column; gap: 6px; }
.dictation-wrong li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
}
.dictation-wrong li strong { font-size: 1.05rem; }
.dictation-wrong li span { font-size: 0.8rem; color: var(--muted); }
.dictation-wrong li em {
  font-style: normal;
  font-size: 0.75rem;
  color: #b33d28;
  background: #fff0ec;
  border-radius: 999px;
  padding: 1px 8px;
}
.dictation-wrong li small { color: var(--muted); font-size: 0.75rem; margin-left: auto; }
.dictation-record-empty { margin: 0; font-size: 0.88rem; color: var(--muted); }

/* 默写：田字格、并排标准字与自评 */
.dictation-panel { margin-top: 6px; }
.dictation-hint { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.92rem; }
.dictation-board { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.dictation-grids { --cell: 190px; display: flex; flex-wrap: wrap; gap: 10px; }
.dictation-cell {
  position: relative;
  width: var(--cell);
  height: var(--cell);
  border: 2px solid #dccbb5;
  border-radius: 12px;
  background: #fffdf8;
  overflow: hidden;
}
.dictation-cell::before,
.dictation-cell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-color: #e6d7c3;
}
.dictation-cell::before {
  left: 50%;
  top: 8px;
  bottom: 8px;
  border-left: 1px dashed #e6d7c3;
}
.dictation-cell::after {
  top: 50%;
  left: 8px;
  right: 8px;
  border-top: 1px dashed #e6d7c3;
}
.dictation-cell canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.dictation-grids.len-1 { --cell: 190px; }
.dictation-grids.len-2 { --cell: 190px; }
.dictation-grids.len-3 { --cell: 160px; }
.dictation-grids.len-4 { --cell: 130px; }
.dictation-standard-wrap { display: flex; flex-direction: column; gap: 8px; }
.dictation-standard-label { font-size: 0.82rem; color: var(--muted); }
.dictation-standard { --cell: 190px; display: flex; flex-wrap: wrap; gap: 10px; }
.dictation-standard.len-1 { --cell: 190px; }
.dictation-standard.len-2 { --cell: 190px; }
.dictation-standard.len-3 { --cell: 160px; }
.dictation-standard.len-4 { --cell: 130px; }
.dictation-standard-char {
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  border: 2px solid var(--teal);
  border-radius: 12px;
  background: var(--teal-soft);
  color: #17403a;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif CJK SC", serif;
  font-size: calc(var(--cell) * 0.66);
  line-height: 1;
}
.dictation-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.dictation-tools .btn-primary { margin-left: auto; }
.dictation-choice { margin-top: 16px; }
.dictation-choice-title { margin: 0 0 10px; font-weight: 800; }
.dictation-choice-row { display: flex; flex-wrap: wrap; gap: 12px; }
.dictation-choice-row .option-compact {
  width: auto;
  min-width: 120px;
  justify-content: center;
  font-size: 26px;
  letter-spacing: 0.08em;
}
.dictation-reveal { margin-top: 16px; }
.dictation-note { margin: 0 0 10px; font-size: 0.88rem; color: var(--ink-soft); }
.dictation-selfcheck { display: flex; flex-wrap: wrap; gap: 10px; }
.dictation-reasons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.dictation-chip {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
}
.dictation-chip.is-selected { border-color: #e8a79a; background: #fff0ec; color: #b33d28; }

@media (pointer: coarse) {
  .dictation-grids,
  .dictation-standard { --cell: 280px; }
  .dictation-grids.len-2,
  .dictation-standard.len-2 { --cell: 240px; }
  .dictation-grids.len-3,
  .dictation-standard.len-3 { --cell: 180px; }
  .dictation-grids.len-4,
  .dictation-standard.len-4 { --cell: 150px; }
}

@media (max-width: 520px) {
  .dictation-grids,
  .dictation-standard { --cell: 170px; }
  .dictation-grids.len-2,
  .dictation-standard.len-2 { --cell: 130px; }
  .dictation-grids.len-3,
  .dictation-standard.len-3 { --cell: 92px; }
  .dictation-grids.len-4,
  .dictation-standard.len-4 { --cell: 72px; }
}
