/* =========================================================
   各页面视图
   ========================================================= */

/* =========================================================
   登录 / 注册
   ========================================================= */
.auth-view {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  overflow: hidden;
}

.auth-brand {
  position: relative;
  padding: 34px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 215, 112, 0.18), transparent 30%),
    radial-gradient(circle at 84% 22%, rgba(179, 136, 255, 0.2), transparent 34%);
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand::before {
  width: 340px;
  height: 340px;
  right: -150px;
  bottom: -180px;
  border: 1px solid rgba(255, 215, 112, 0.16);
  box-shadow: 0 0 0 40px rgba(255, 215, 112, 0.025), 0 0 0 90px rgba(179, 136, 255, 0.025);
}

.auth-brand::after {
  width: 7px;
  height: 7px;
  left: 12%;
  top: 22%;
  background: var(--gold);
  box-shadow:
    38px 42px 0 -2px rgba(255, 233, 168, 0.7),
    150px -10px 0 -2px rgba(255, 255, 255, 0.6),
    240px 80px 0 -2px rgba(201, 220, 255, 0.55),
    90px 160px 0 -2px rgba(255, 217, 138, 0.6);
  opacity: 0.8;
}

.auth-brand-inner {
  width: min(100%, 480px);
  position: relative;
  z-index: 1;
}

.auth-brand .brand-mark {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
  border-radius: 19px;
  margin-bottom: 14px;
}

.auth-brand .brand-mark img { border-radius: 17px; }

.auth-brand h1 {
  margin: 8px 0 10px;
  font-size: clamp(27px, 7vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.auth-brand h1 em { color: var(--gold); }

.auth-lead {
  max-width: 430px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.auth-features {
  display: none;
  gap: 12px;
  margin-top: 26px;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-feature .fi {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: rgba(255, 215, 112, 0.09);
  border: 1px solid var(--gold-line);
}

.auth-feature strong { display: block; font-size: 12.5px; color: var(--text); }
.auth-feature small { display: block; font-size: 10.5px; color: var(--muted-2); line-height: 1.5; margin-top: 1px; }

.auth-panel {
  padding: 10px 18px 34px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.auth-card {
  width: min(100%, 430px);
  padding: 18px;
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(3, 10, 29, 0.35);
  border: 1px solid var(--line-soft);
  margin-bottom: 18px;
}

.auth-tabs button {
  min-height: 38px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--dur-fast);
}

.auth-tabs button.active {
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  box-shadow: 0 5px 14px rgba(255, 179, 71, 0.2);
}

.auth-form .btn-block { margin-top: 6px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  color: var(--muted-2);
  font-size: 10px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.auth-switch {
  margin-top: 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

.demo-hint {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--line-soft);
}

.demo-hint strong { color: var(--gold); font-weight: 600; }

.auth-privacy {
  margin-top: 14px;
  text-align: center;
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--muted-2);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 2px 0 12px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--gold);
  flex: 0 0 16px;
}

.checkbox-row a { color: var(--gold); }

.auth-orbit {
  display: none;
}

/* =========================================================
   首页
   ========================================================= */
.home-view {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* 首页顶部：左侧大标题 + 右侧头像，对齐参考图 */
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 6px 18px;
}

.home-top-copy { min-width: 0; }

.home-top h1 {
  margin: 0;
  font-size: 30px;
  font-weight: var(--w-black);
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #fff5dc;
  text-shadow: 0 6px 24px rgba(255, 207, 107, 0.16);
}

.home-top p {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: var(--w-medium);
  color: var(--muted);
}

.home-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 2px;
  background: linear-gradient(135deg, #ffd98a, #7bd7ff 55%, #b388ff);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), 0 0 18px rgba(255, 207, 107, 0.12);
}

.home-avatar span {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: var(--w-black);
  color: #2b1c48;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.85), transparent 45%),
    linear-gradient(150deg, #ffe7b8, #a9d8ff);
}

/* 首页主视觉：居中大字 + 金色胶囊按钮，对齐参考图 */
.home-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 34px 22px 22px;
  background:
    radial-gradient(circle at 82% 14%, rgba(255, 206, 112, 0.42), transparent 20%),
    radial-gradient(circle at 16% 86%, rgba(99, 130, 255, 0.24), transparent 42%),
    linear-gradient(158deg, #2c2f79 0%, #202a66 48%, #182354 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 207, 107, 0.04) inset;
}

.home-hero::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  top: -100px;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 112, 0.16);
  box-shadow: 0 0 0 34px rgba(255, 215, 112, 0.025), 0 0 0 78px rgba(179, 136, 255, 0.03);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(38px, 10.6vw, 46px);
  font-weight: var(--w-black);
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 6px 30px rgba(255, 207, 107, 0.18);
}

.hero-copy h2 em { color: var(--gold); }

.hero-copy > p:not(.eyebrow) {
  max-width: 420px;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: var(--w-bold);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  width: 100%;
}

.hero-actions .btn { width: 100%; min-height: 56px; font-size: 19px; }

/* 参考图里的暖光球、星点与小鲸鱼 */
.hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-art .orb {
  position: absolute;
  right: -26px;
  top: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 42%, rgba(255, 244, 196, 0.95), rgba(255, 199, 92, 0.52) 34%, rgba(255, 176, 71, 0.08) 66%, transparent 72%);
  filter: blur(2px);
  animation: breathe 6s ease-in-out infinite;
}

.hero-art .orbit {
  position: absolute;
  right: 2px;
  top: 26px;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(255, 224, 150, 0.22);
  border-radius: 50%;
  transform: rotate(-14deg);
}

.hero-art .whale {
  position: absolute;
  bottom: 96px;
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28));
  animation: floatY 6s ease-in-out infinite;
}

.hero-art .whale.w1 { left: 14px; font-size: 36px; opacity: 0.9; animation-delay: 0.6s; }
.hero-art .whale.w2 { right: 16px; font-size: 44px; animation-delay: 1.4s; }

.hero-art .s1,
.hero-art .s2,
.hero-art .s3 {
  position: absolute;
  color: #ffe6a6;
  animation: twinkle 3.4s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(255, 224, 150, 0.6);
}

.hero-art .s1 { right: 58px; top: 22px; font-size: 17px; }
.hero-art .s2 { left: 28px; top: 46px; font-size: 11px; animation-delay: 0.8s; }
.hero-art .s3 { right: 24px; bottom: 128px; font-size: 13px; animation-delay: 1.4s; }

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* 我的绘本统计卡：三列数字 + 竖分隔线 */
.stat-card {
  padding: 18px 8px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

/* 手机端网格子项默认会被内容最小宽度撑开（横向溢出），显式允许收缩 */
.home-main,
.home-side { min-width: 0; }

/* 手机端侧栏为普通块级流，卡片的 margin 为 0，必须靠 gap 撑开间距，
   否则提示卡、快速开始、最近动态三张卡会紧贴在一起（看起来像重叠） */
.home-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.continue-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
}

.continue-cover {
  width: 96px;
  flex: 0 0 96px;
}

.continue-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.continue-info .eyebrow { font-size: 10.5px; letter-spacing: 0.04em; }

.continue-info h4 {
  font-size: 18px;
  font-weight: var(--w-heavy);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-info p {
  font-size: 12px;
  color: var(--muted);
}

.continue-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.continue-progress .progress { flex: 1; height: 5px; }
.continue-progress small { font-size: 11px; color: var(--muted-2); white-space: nowrap; }

.continue-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.continue-actions .btn {
  min-height: 44px;
  padding: 8px 22px;
  font-size: 15.5px;
}

.continue-actions .btn-ghost {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 13px;
}

.book-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
}

.mini-book {
  width: 136px;
  flex: 0 0 136px;
  scroll-snap-align: start;
  text-align: left;
  color: var(--text);
}

.mini-book .book-cover { margin-bottom: 7px; }
.mini-book h4 {
  font-size: 11.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-book small { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 2px; }

.tip-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 18px;
  background:
    radial-gradient(circle at 95% 10%, rgba(255, 215, 112, 0.18), transparent 30%),
    linear-gradient(150deg, rgba(255, 215, 112, 0.1), rgba(179, 136, 255, 0.08));
  border: 1px solid var(--gold-line);
}

.tip-card h3 { font-size: 14px; margin-bottom: 8px; }
.tip-card p { font-size: 11.5px; line-height: 1.8; color: var(--text-soft); }
.tip-card .tip-emoji { font-size: 26px; margin-bottom: 8px; display: block; }

.quick-card h3 { margin-bottom: 10px; }

.quick-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.quick-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  color: var(--text-soft);
  text-align: left;
  font-size: 11.5px;
  transition: all var(--dur-fast);
}

.quick-item:hover { border-color: var(--gold-line); background: rgba(255, 215, 112, 0.05); }
.quick-item .qi { font-size: 16px; width: 22px; text-align: center; }
.quick-item small { margin-left: auto; color: var(--muted-2); font-size: 9px; }

.history-mini-list { display: flex; flex-direction: column; gap: 9px; }

.history-mini {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.55;
}

.history-mini .hm-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 112, 0.1);
}

.history-mini strong { color: var(--text-soft); font-weight: 600; }
.history-mini time { display: block; font-size: 9px; color: var(--muted-2); margin-top: 1px; }

/* =========================================================
   书架
   ========================================================= */
.library-view {
  max-width: var(--content-max);
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 16px;
}

.page-head h2 {
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.page-head p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.page-head .head-action { flex-shrink: 0; }

.library-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.library-sort {
  min-height: 42px;
  padding: 8px 28px 8px 11px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background-color: rgba(8, 18, 45, 0.48);
  color: var(--muted);
  font-size: 11px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% + 1px),
    calc(100% - 9px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 11px;
  margin-top: 4px;
}

.book-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.book-card-cover {
  position: relative;
  width: 100%;
  text-align: left;
  border-radius: var(--r-md);
  transition: transform var(--dur) var(--ease);
}

.book-card-cover:hover { transform: translateY(-3px); }

/* 封面按钮需要撑满卡片宽度，否则会按内容收缩成小图标；
   只作用于打开绘本的主按钮，避免影响右上角的收藏按钮 */
.book-card-cover > button[data-action="open-book"] {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  text-align: left;
}

.book-card-cover .book-cover { width: 100%; }

/* 书架卡片用右上角的可点击收藏按钮，避免与封面内的星标重复 */
.book-card-cover .cover-heart { display: none; }

.book-fav {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: rgba(6, 14, 36, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gold-bright);
  backdrop-filter: blur(6px);
}

.book-fav:hover { background: rgba(6, 14, 36, 0.78); }

.book-card-body {
  padding: 8px 2px 0;
  min-width: 0;
}

.book-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.book-card-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-title:hover { color: var(--gold); }

.book-card-menu {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  color: var(--muted-2);
  font-size: 15px;
  display: grid;
  place-items: center;
}

.book-card-menu:hover { color: var(--gold); background: rgba(255, 255, 255, 0.06); }

.book-card-meta {
  margin-top: 3px;
  font-size: 9.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px;
  font-size: 9px;
  color: var(--muted-2);
  /* 卡片在窄屏会被压到 140px 左右，禁止单项内部换行，放不下时整块日期移到下一行 */
  white-space: nowrap;
}

.book-card-foot > span { flex: 0 0 auto; }
.book-card-foot .read-count { display: inline-flex; align-items: center; gap: 3px; }
.book-card-foot .spacer { flex: 1 1 0; min-width: 0; }

.library-empty { margin-top: 8px; }

/* =========================================================
   绘本详情
   ========================================================= */
.detail-view {
  max-width: var(--content-max);
  margin: 0 auto;
}

.detail-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 207, 107, 0.12), transparent 32%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
}

.detail-cover-wrap {
  width: 100%;
  align-self: start;
}

/* 详情页封面列较窄，书名限制在 18px 以内，避免最后一个字单独换行 */
.detail-cover-wrap .book-cover.lg .cover-title { font-size: 18px; }

.detail-info { min-width: 0; }

.detail-info h2 {
  font-size: 21px;
  font-weight: var(--w-black);
  line-height: 1.28;
  letter-spacing: -0.015em;
  margin: 4px 0 4px;
}

.detail-subtitle {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.detail-created {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted-2);
}

/* 本次教育目标：参考图的标题 + 三个彩色胶囊 */
.detail-goal-title {
  margin: 10px 0 7px;
  font-size: 16px;
  font-weight: var(--w-heavy);
  color: var(--gold-bright);
}

.detail-goal-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-goal-tags .tag {
  padding: 6px 12px;
  font-size: 12.5px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.detail-age {
  font-size: 13px;
  font-weight: var(--w-medium);
  color: var(--text-soft);
}

.detail-age strong {
  margin: 0 3px;
  font-size: 20px;
  font-weight: var(--w-black);
  color: var(--gold-bright);
}

.detail-goal {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 207, 107, 0.06);
  border: 1px solid rgba(255, 207, 107, 0.16);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 10px 0 4px;
}

.detail-goal .goal-label { color: var(--gold); flex: 0 0 auto; font-weight: var(--w-bold); font-size: 11px; }

.detail-meta { margin: 10px 0; }

.detail-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.detail-actions .btn {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 8px 12px;
  font-size: 16px;
}

.detail-actions .btn-soft { font-size: 15px; }

.detail-actions .icon-btn {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  min-height: 50px;
  font-size: 18px;
}

.detail-save-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 22px 0 4px;
  font-size: 12px;
  font-weight: var(--w-medium);
  color: var(--muted-2);
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.detail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-section-title h3 { font-size: 20px; font-weight: var(--w-heavy); }

.page-thumbs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.page-thumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-soft);
  text-align: left;
  width: 100%;
  color: var(--text);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.page-thumb:hover { border-color: var(--gold-line); background: rgba(255, 207, 107, 0.05); }

.page-thumb-art {
  width: 48px;
  height: 52px;
  flex: 0 0 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 23px;
  background:
    radial-gradient(circle at 80% 20%, var(--theme-c), transparent 35%),
    linear-gradient(145deg, var(--theme-a), #152454);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.page-thumb-body { min-width: 0; }
.page-thumb-label { font-size: 11px; font-weight: var(--w-bold); color: var(--gold); letter-spacing: 0.03em; }
.page-thumb-text {
  margin-top: 3px;
  font-size: 13px;
  font-weight: var(--w-medium);
  line-height: 1.5;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guide-block { margin-top: 12px; }
.guide-block h4 { font-size: 11.5px; color: var(--gold); margin-bottom: 5px; }
.guide-block p { font-size: 11px; line-height: 1.7; color: var(--muted); }
.guide-block ul { display: flex; flex-direction: column; gap: 5px; }
.guide-block li {
  position: relative;
  padding-left: 13px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}
.guide-block li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 8px;
}

.plan-list { display: flex; flex-direction: column; gap: 9px; }
.plan-item {
  display: flex;
  gap: 9px;
  padding: 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
}
.plan-item .pi-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: var(--gold-soft);
}
.plan-item strong { display: block; font-size: 11px; color: var(--gold); margin-bottom: 1px; }
.plan-item p { font-size: 10.5px; line-height: 1.6; color: var(--muted); }

.detail-danger-zone {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

/* =========================================================
   历史记录
   ========================================================= */
.history-view {
  max-width: 880px;
  margin: 0 auto;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 4px;
}

.history-group { margin-top: 18px; }
.history-group h3 {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 2px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.history-group h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.038);
  border: 1px solid var(--line-soft);
  margin-bottom: 8px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.history-item:hover { border-color: var(--gold-line); background: rgba(255, 215, 112, 0.035); }

.history-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--gold-soft);
  border: 1px solid rgba(255, 215, 112, 0.18);
}
.history-icon.read { background: rgba(79, 195, 247, 0.09); border-color: rgba(79, 195, 247, 0.2); }

.history-main { flex: 1; min-width: 0; }
.history-main h4 {
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-main p {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-main time {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  color: var(--muted-2);
}

.history-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
}

.history-actions .icon-btn { width: 30px; height: 30px; min-height: 30px; font-size: 13px; }

.history-empty { margin-top: 12px; }

/* =========================================================
   个人中心
   ========================================================= */
.profile-view {
  max-width: var(--content-max);
  margin: 0 auto;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 94% 0%, rgba(255, 215, 112, 0.16), transparent 28%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line-soft);
}

.profile-head-info { flex: 1; min-width: 0; }
.profile-head-info h2 { font-size: 19px; line-height: 1.35; }
.profile-head-info p { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }

.profile-head .logout-btn { flex: 0 0 auto; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.settings-list { display: flex; flex-direction: column; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.settings-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.settings-copy { flex: 1; min-width: 0; }
.settings-copy strong { display: block; font-size: 12px; font-weight: 600; }
.settings-copy small { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 1px; line-height: 1.5; }

.about-list { display: flex; flex-direction: column; gap: 9px; }
.about-item { display: flex; gap: 8px; font-size: 10.5px; line-height: 1.65; color: var(--muted); }
.about-item .ai { color: var(--gold); flex: 0 0 auto; }

.child-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  margin-top: 8px;
}
.child-profile-card .cp-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(179, 136, 255, 0.12);
  border: 1px solid rgba(179, 136, 255, 0.2);
  font-size: 18px;
}
.child-profile-card strong { display: block; font-size: 12px; }
.child-profile-card small { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 1px; }

.disclaimer {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed var(--line-soft);
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--muted-2);
}

/* =========================================================
   创作流程
   ========================================================= */
.create-view {
  max-width: var(--content-max);
  margin: 0 auto;
}

.flow-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.flow-main { min-width: 0; }

.flow-card {
  border-radius: var(--r-xl);
  padding: 22px 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
}

.flow-card-head { margin-bottom: 18px; }
.flow-card-head h2 {
  font-size: 24px;
  font-weight: var(--w-black);
  line-height: 1.32;
  letter-spacing: -0.015em;
  margin-top: 4px;
}
.flow-card-head p { margin-top: 6px; font-size: 13px; line-height: 1.65; color: var(--muted); }

/* 儿童资料分组：参考图的“基础信息 / 沟通与学习 / 感知与偏好” */
.form-section {
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.form-section:last-of-type { border-bottom: 0; padding-bottom: 0; margin-bottom: 4px; }

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  font-size: 17px;
  font-weight: var(--w-heavy);
  color: #fff1cf;
}

.form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

/* 身份步骤底部提示：居中、无边框，对齐参考图 */
.role-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 2px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: var(--w-medium);
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.role-hint .ico { font-size: 15px; }

.flow-aside { display: none; }

.summary-card {
  position: sticky;
  top: 8px;
  border-radius: var(--r-xl);
  padding: 16px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 215, 112, 0.13), transparent 30%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--gold-line);
}

.summary-card h3 { font-size: 13px; color: var(--gold); margin-bottom: 10px; }

.summary-list { display: flex; flex-direction: column; gap: 9px; }
.summary-line { display: flex; gap: 8px; align-items: flex-start; }
.summary-line .sl-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
}
.summary-line div { min-width: 0; }
.summary-line small { display: block; font-size: 9px; color: var(--muted-2); }
.summary-line strong {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.summary-line.muted strong { color: var(--muted-2); font-weight: 400; }

.summary-tip {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--muted-2);
}

.flow-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.flow-actions .btn-primary {
  flex: 1;
  min-height: 56px;
  font-size: 18px;
}

.flow-actions .btn-ghost {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 8px 18px;
  font-size: 14px;
}

/* 第 1 步只有一个主按钮：去掉分隔线，按钮单独占满整行 */
.flow-actions.solo {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}

.flow-actions.solo .btn-primary {
  min-height: 58px;
  font-size: 19px;
}

.analysis-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(255, 215, 112, 0.1), rgba(179, 136, 255, 0.08));
  border: 1px solid var(--gold-line);
  margin-bottom: 12px;
}

.verdict-emoji {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 27px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.verdict-copy { min-width: 0; }
.verdict-copy small { display: block; font-size: 9px; color: var(--muted-2); letter-spacing: 0.08em; }
.verdict-copy strong { display: block; font-size: 16px; color: var(--gold-bright); margin: 1px 0 2px; }
.verdict-copy p { font-size: 10px; line-height: 1.55; color: var(--muted); }

.score-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.score-row { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.score-row .score-label { width: 84px; flex: 0 0 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-row .score-bar { flex: 1; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.score-row .score-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--violet)); }
.score-row .score-num { width: 24px; text-align: right; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.override-chips { margin-top: 8px; }

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.theme-card {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  text-align: left;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 20%, var(--theme-c), transparent 24%),
    linear-gradient(145deg, var(--theme-a), #101d47 82%);
  transition: transform var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.theme-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -38px;
  bottom: -52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.theme-card:hover { transform: translateY(-2px); }
.theme-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 215, 112, 0.22), 0 12px 26px rgba(0, 0, 0, 0.2);
}

.theme-card .tc-emoji { font-size: 25px; line-height: 1; display: block; margin-bottom: 14px; }
.theme-card strong { display: block; font-size: 12px; }
.theme-card small { display: block; font-size: 9px; color: rgba(255, 255, 255, 0.66); margin-top: 1px; }
.theme-card .tc-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}
.theme-card.active .tc-check { display: grid; }

.book-preview-line {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--gold-line);
  margin-top: 12px;
}
.book-preview-line .bp-emoji { font-size: 26px; }
.book-preview-line div { min-width: 0; }
.book-preview-line small { display: block; font-size: 9px; color: var(--muted-2); }
.book-preview-line strong { display: block; font-size: 13px; color: var(--gold-bright); margin-top: 1px; }

.plan-list.compact .plan-item { padding: 8px 9px; }

.generate-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 22, 0.72);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.generate-panel {
  width: min(92vw, 390px);
  padding: 24px 20px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 80% 0%, rgba(179, 136, 255, 0.18), transparent 30%),
    linear-gradient(160deg, #152a63, #0b1738);
  border: 1px solid var(--gold-line);
  box-shadow: var(--shadow-float);
  text-align: center;
}

.generate-orb {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 31px;
  background: radial-gradient(circle at 35% 28%, #ffe9a8, #b388ff 55%, #4f3d9f);
  box-shadow: 0 0 38px rgba(179, 136, 255, 0.35);
  animation: floatY 2.2s ease-in-out infinite;
}

.generate-panel h3 { font-size: 17px; }
.generate-panel > p { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

.generate-steps {
  margin: 18px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.generate-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--muted-2);
  transition: color var(--dur);
}
.generate-step .gs-dot {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
}
.generate-step.active { color: var(--text); }
.generate-step.active .gs-dot { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.generate-step.done { color: var(--gold); }
.generate-step.done .gs-dot { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.theme-preview-art {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 20px;
  margin-top: 4px;
}

/* =========================================================
   阅读器 / 演示
   ========================================================= */
.reader-view {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 7%, var(--theme-c), transparent 20%),
    radial-gradient(circle at 18% 86%, var(--theme-b), transparent 32%),
    linear-gradient(160deg, #14245b 0%, #0a1639 60%, #08112c 100%);
  isolation: isolate;
}

.reader-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 99%, transparent),
    radial-gradient(1px 1px at 28% 14%, #ffe9a8 99%, transparent),
    radial-gradient(1px 1px at 47% 34%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 68% 18%, #fff 99%, transparent),
    radial-gradient(1px 1px at 82% 42%, #ffe9a8 99%, transparent),
    radial-gradient(1px 1px at 22% 64%, #d9c8ff 99%, transparent),
    radial-gradient(1.5px 1.5px at 62% 72%, #fff 99%, transparent),
    radial-gradient(1px 1px at 88% 82%, #fff 99%, transparent);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

.reader-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  position: relative;
  z-index: 4;
}

.reader-topbar .icon-btn { background: rgba(4, 10, 28, 0.34); backdrop-filter: blur(8px); }

.reader-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.35;
  text-align: center;
}
.reader-title strong {
  max-width: 100%;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-title small { font-size: 9px; color: var(--muted); margin-top: 1px; }

.reader-top-actions { display: flex; gap: 4px; }

.reader-progress {
  height: 2px;
  flex: 0 0 2px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 16px;
  border-radius: 2px;
  overflow: hidden;
}

.reader-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width var(--dur) var(--ease-soft);
}

.reader-stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reader-art {
  position: relative;
  min-height: 220px;
  flex: 0 0 38vh;
  max-height: 340px;
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 78% 18%, var(--theme-c), transparent 23%),
    radial-gradient(circle at 20% 84%, var(--theme-b), transparent 38%),
    linear-gradient(145deg, var(--theme-a), #101c48 82%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.24), 0 18px 44px rgba(0, 0, 0, 0.2);
}

.reader-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 16% 22%, #fff 99%, transparent),
    radial-gradient(1px 1px at 36% 14%, #fff 99%, transparent),
    radial-gradient(1px 1px at 72% 28%, #ffe9a8 99%, transparent),
    radial-gradient(1.5px 1.5px at 86% 62%, #fff 99%, transparent),
    radial-gradient(1px 1px at 24% 72%, #d9c8ff 99%, transparent),
    radial-gradient(1px 1px at 58% 82%, #fff 99%, transparent);
  opacity: 0.6;
}

.reader-art::after {
  content: "";
  position: absolute;
  width: 150%;
  height: 46%;
  left: -25%;
  bottom: -28%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.075);
  filter: blur(10px);
}

.reader-art-emoji {
  position: relative;
  z-index: 1;
  font-size: clamp(96px, 30vw, 150px);
  line-height: 1;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.3));
  animation: floatY 5.5s ease-in-out infinite;
}

.reader-art-caption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.68);
  letter-spacing: 0.08em;
}

.reader-art-index {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: rgba(4, 10, 28, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
}

.reader-copy {
  flex: 1;
  min-height: 170px;
  padding: 2px 2px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.reader-label {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.reader-page-title {
  font-size: clamp(21px, 5.8vw, 30px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.reader-text {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.reader-view.font-lg .reader-text { font-size: 18px; line-height: 2; }
.reader-view.font-xl .reader-text { font-size: 21px; line-height: 2.05; }
.reader-view.font-xl .reader-page-title { font-size: clamp(24px, 6.4vw, 34px); }

.reader-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.reader-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
  transition: all var(--dur-fast);
}

.reader-option:hover { border-color: var(--gold-line); background: rgba(255, 215, 112, 0.06); }
.reader-option .opt-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: var(--gold);
}
.reader-option.correct {
  border-color: rgba(129, 199, 132, 0.55);
  background: rgba(129, 199, 132, 0.1);
}
.reader-option.correct .opt-mark { background: var(--green); color: #0d2b16; }
.reader-option.wrong {
  border-color: rgba(255, 128, 128, 0.4);
  background: rgba(255, 128, 128, 0.07);
}
.reader-option.wrong .opt-mark { background: var(--danger); color: #3b0d0d; }

.reader-feedback {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(129, 199, 132, 0.08);
  border: 1px solid rgba(129, 199, 132, 0.22);
  font-size: 11.5px;
  line-height: 1.7;
  color: #c8f0cc;
}

.reader-affirm {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--r-md);
  background: radial-gradient(circle at 82% 20%, rgba(255, 215, 112, 0.18), transparent 34%), rgba(255, 255, 255, 0.05);
  border: 1px solid var(--gold-line);
}

.reader-affirm .affirm-star { font-size: 25px; }
.reader-affirm p { margin-top: 5px; font-size: 12px; line-height: 1.7; color: var(--text-soft); }

.reader-controls {
  flex: 0 0 auto;
  padding: 8px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 3;
  background: linear-gradient(0deg, rgba(6, 14, 35, 0.82), rgba(6, 14, 35, 0));
}

.reader-nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-nav-row .btn { flex: 1; }
.reader-nav-row .btn:disabled { opacity: 0.35; }

.reader-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 1px 0;
}

.reader-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all var(--dur) var(--ease);
}

.reader-dot.active { width: 19px; border-radius: 4px; background: var(--gold); }
.reader-dot.done { background: rgba(255, 215, 112, 0.5); }

.reader-tools {
  display: flex;
  gap: 7px;
}

.reader-tools .btn { flex: 1; font-size: 11.5px; min-height: 38px; }
.reader-tools .btn.active { background: var(--gold); color: var(--ink); border-color: transparent; }

.reader-complete {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  background: rgba(5, 12, 31, 0.8);
  backdrop-filter: blur(7px);
  animation: viewIn 320ms var(--ease) both;
}

.complete-stars {
  position: relative;
  font-size: 66px;
  line-height: 1;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 26px rgba(255, 215, 112, 0.5));
  animation: floatY 3s ease-in-out infinite;
}

.reader-complete h2 { font-size: 24px; color: var(--gold-bright); }
.reader-complete p { max-width: 330px; margin: 8px 0 18px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.reader-complete .btn { min-width: 160px; }

.confetti-star {
  position: absolute;
  color: var(--gold);
  font-size: 12px;
  animation: confetti 1.4s var(--ease-soft) both;
  pointer-events: none;
}

@keyframes confetti {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4) rotate(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--cx), var(--cy)) scale(1.1) rotate(140deg); }
}

.reader-guide {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  justify-content: flex-end;
  background: rgba(3, 8, 22, 0.5);
}

.reader-guide-panel {
  width: min(88vw, 380px);
  height: 100%;
  overflow-y: auto;
  padding: 18px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 90% 0%, rgba(124, 77, 255, 0.16), transparent 30%),
    linear-gradient(165deg, #14265a, #0a1535);
  border-left: 1px solid var(--gold-line);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
  animation: slideInRight 260ms var(--ease) both;
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.reader-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.reader-guide-head h3 { font-size: 16px; }

.reader-guide .guide-block h4 { font-size: 12px; }
.reader-guide .guide-block p,
.reader-guide .guide-block li { font-size: 11.5px; }

.reader-error {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.reader-error .re-emoji { font-size: 48px; margin-bottom: 12px; }
.reader-error h2 { font-size: 20px; }
.reader-error p { margin: 6px 0 16px; font-size: 12px; color: var(--muted); }

/* =========================================================
   动效
   ========================================================= */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* =========================================================
   平板/桌面增强
   ========================================================= */
@media (min-width: 768px) {
  .auth-panel { align-items: center; padding: 24px; }
  .auth-card { padding: 22px; }
  .auth-features { display: flex; flex-direction: column; }
  .auth-orbit {
    display: block;
    position: absolute;
    right: 6%;
    top: 18%;
    font-size: 30px;
    letter-spacing: 16px;
    opacity: 0.6;
    transform: rotate(-8deg);
  }

  .home-hero { padding: 38px 34px 30px; }
  .hero-art .orb { width: 190px; height: 190px; right: -40px; top: -52px; }
  .hero-art .orbit { width: 168px; height: 168px; right: 10px; top: 16px; }
  .hero-art .whale.w1 { left: 34px; bottom: 118px; font-size: 52px; }
  .hero-art .whale.w2 { right: 40px; bottom: 116px; font-size: 60px; }
  .hero-art .s1 { right: 96px; top: 30px; font-size: 21px; }
  .hero-art .s2 { left: 64px; top: 56px; font-size: 13px; }
  .hero-art .s3 { right: 52px; bottom: 160px; font-size: 16px; }

  .home-grid { grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr); gap: 20px; align-items: start; }
  .home-side { position: sticky; top: 6px; }

  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }

  .detail-hero { grid-template-columns: 190px minmax(0, 1fr); padding: 22px; gap: 24px; }
  .detail-cover-wrap { width: 100%; align-self: flex-start; }
  .detail-info { padding-top: 4px; }
  .detail-actions .btn { font-size: 17px; min-height: 54px; }
  .detail-grid { grid-template-columns: 1.1fr 0.9fr; }
  .page-thumbs { grid-template-columns: 1fr 1fr; }
  .page-thumb-art { width: 44px; height: 48px; flex-basis: 44px; font-size: 21px; }

  .profile-grid { grid-template-columns: 1fr 1fr; }
  .profile-head { padding: 22px; }

  .flow-card { padding: 24px; }
  .theme-grid { grid-template-columns: repeat(4, 1fr); }

  .reader-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 20px;
    padding: 12px 24px 10px;
    align-items: stretch;
    overflow: hidden;
  }
  .reader-art { flex: 1; height: auto; min-height: 0; max-height: none; }
  .reader-copy { overflow-y: auto; padding: 8px 4px 12px; }
  .reader-view .reader-text { font-size: 17px; }
  .reader-view.font-lg .reader-text { font-size: 19px; }
  .reader-view.font-xl .reader-text { font-size: 22px; }
  .reader-controls { padding-left: 24px; padding-right: 24px; }

  .reader-topbar { padding-left: 24px; padding-right: 24px; }
  .reader-progress { margin-left: 26px; margin-right: 26px; }
}

@media (min-width: 1024px) {
  .auth-view { grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr); }
  .auth-brand { padding: 40px; }
  .auth-panel { padding: 30px 40px; }
  .auth-brand h1 { font-size: 42px; }
  .auth-lead { font-size: 13.5px; }
  .auth-orbit { font-size: 38px; right: 12%; top: 14%; }

  .hero-copy h2 { font-size: 46px; }
  .home-hero { padding: 42px 40px 34px; }

  .flow-layout { grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.72fr); align-items: start; }
  .flow-aside { display: block; }

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

  .detail-hero { grid-template-columns: 220px minmax(0, 1fr); }
  .detail-cover-wrap { width: 100%; }

  .reader-stage { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 28px; padding: 18px 44px 12px; }
  .reader-view .reader-text { font-size: 18px; line-height: 2; }
  .reader-view.font-lg .reader-text { font-size: 20px; }
  .reader-view.font-xl .reader-text { font-size: 24px; }
  .reader-page-title { font-size: 34px; }
  .reader-controls { padding-left: 44px; padding-right: 44px; }
  .reader-tools { max-width: 520px; margin: 0 auto; width: 100%; }
  .reader-nav-row { max-width: 520px; margin: 0 auto; width: 100%; }
  .reader-controls { align-items: center; }
  .reader-controls > * { width: 100%; }
}

@media (min-width: 1280px) {
  .auth-brand h1 { font-size: 46px; }
  .hero-copy h2 { font-size: 52px; }
  .home-hero { padding: 50px 48px 40px; }
}
