/* ============================================================
   书即是阅 · 全局样式（第 7 课 M1 + 第 8 课 M2 + 第 9 课 M3 + 第 10 课 M4）
   配色：蓝白黑 —— 背景近黑的深蓝，文字与高光用白与蓝
   原则：不用图片、不用外链字体，全部靠 CSS 渐变和系统字体实现
   M2 新增：内容页框架、书架封面卡片、类型筛选条、分类入口卡片
   M3 新增：阅读页正文区、工具条、章节目录、白/绿/黑三种阅读主题
   M4 新增：阅读页底部的书评墙（表单 + 展示墙 + 本地模式说明）
   ============================================================ */

/* ---------- 1. 全局变量：改这里就能换全站配色 ---------- */
:root {
  --ink: #05070d;          /* 最深的底色（近黑） */
  --navy: #0b1b3a;         /* 深海军蓝 */
  --blue: #2f6bff;         /* 主蓝 */
  --blue-soft: #7ea6ff;    /* 浅蓝（高光） */
  --white: #f5f8ff;        /* 文字白 */
  --muted: #9db0d0;        /* 弱化文字（灰蓝） */
  --line: rgba(126, 166, 255, .28);  /* 分隔线/描边 */
  --font-title: "Microsoft YaHei", "SimHei", "PingFang SC", sans-serif;
  --font-body: "Microsoft YaHei", "PingFang SC", "SimSun", sans-serif;
}

/* ---------- 2. 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--white);
  /* 蓝白黑主背景：从近黑过渡到深蓝，宏大感的关键 */
  background: linear-gradient(180deg, var(--ink) 0%, var(--navy) 55%, #12305f 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---------- 3. 星空背景 ---------- */
.stars {
  position: fixed;
  inset: 0;               /* 铺满全屏 */
  pointer-events: none;   /* 不挡鼠标点击 */
  z-index: 0;
}

.stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 6px 1px rgba(126, 166, 255, .8);  /* 星光晕 */
  opacity: .5;
  animation: twinkle 3s ease-in-out infinite;       /* 闪烁动画 */
}

/* 让星星一明一暗地闪 */
@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50%      { opacity: .9;  transform: scale(1.15); }
}

/* ---------- 4. 顶栏 ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 13, .35);
}

.logo {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--white);
}

.topnav a {
  margin-left: 28px;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.topnav a:hover { color: var(--white); }

/* 当前所在页的导航项：高亮蓝色下划线 */
.topnav a.active {
  color: var(--blue-soft);
  border-bottom-color: var(--blue-soft);
}

/* ---------- 5. 首屏主视觉 ---------- */
.hero {
  position: relative;
  z-index: 1;
  flex: 1;                       /* 撑满剩余高度，让内容居中于整屏 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 24px 40px;
}

/* 标题背后的一团蓝色光晕，纯径向渐变 */
.hero::before {
  content: "";
  position: absolute;
  top: 30%;
  left: 50%;
  width: 720px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(47, 107, 255, .30) 0%, transparent 65%);
  pointer-events: none;
}

.hero-kicker {
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--muted);
  margin-bottom: 26px;
  animation: fadeIn 1s .1s both;
}

/* 大标题：每个字依次升起 + 发光 */
.hero-title {
  font-family: var(--font-title);
  font-size: clamp(64px, 16vw, 150px);   /* clamp：小屏自动缩小 */
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.15;
  text-shadow: 0 0 24px rgba(47, 107, 255, .55), 0 0 60px rgba(47, 107, 255, .30);
}

.hero-title span {
  display: inline-block;
  animation: riseIn .9s ease-out both;
}

/* 四个字错开 0.15s 依次出场 */
.hero-title span:nth-child(1) { animation-delay: .15s; }
.hero-title span:nth-child(2) { animation-delay: .30s; }
.hero-title span:nth-child(3) { animation-delay: .45s; }
.hero-title span:nth-child(4) { animation-delay: .60s; }

/* 标题下的渐变分隔线 */
.hero-divider {
  width: min(420px, 70%);
  height: 2px;
  margin: 28px 0 22px;
  background: linear-gradient(90deg, transparent, var(--blue-soft), transparent);
  animation: fadeIn 1s .7s both;
}

.hero-subtitle {
  max-width: 560px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--muted);
  min-height: 3.8em;   /* 打字机效果时预留高度，防止页面跳动 */
  animation: fadeIn 1s .8s both;
}

/* ---------- 6. 入口按钮 ---------- */
.hero-actions {
  display: flex;
  gap: 22px;
  margin-top: 36px;
  animation: fadeIn 1s 1s both;
}

.btn {
  display: inline-block;
  padding: 14px 44px;
  font-size: 17px;
  letter-spacing: 3px;
  border-radius: 4px;
  border: 1px solid var(--blue-soft);
  transition: transform .2s, box-shadow .2s, background .2s;
}

/* 主按钮：蓝底白字 */
.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, #1b3f9e 100%);
  color: var(--white);
  box-shadow: 0 4px 18px rgba(47, 107, 255, .40);
}

/* 副按钮：透明底白描边 */
.btn-ghost {
  background: transparent;
  color: var(--white);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(47, 107, 255, .55);
}

/* ---------- 7. 三个小卖点 ---------- */
.hero-points {
  display: flex;
  gap: 18px;
  margin-top: 56px;
  list-style: none;
  animation: fadeIn 1s 1.2s both;
}

.hero-points li {
  padding: 14px 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(11, 27, 58, .45);
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}

.hero-points b {
  display: block;
  font-size: 16px;
  color: var(--blue-soft);
  letter-spacing: 3px;
  margin-bottom: 6px;
}

/* ---------- 8. 页脚 ---------- */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 18px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- 9. 动画定义 ---------- */

/* 整体淡入 */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 从下方升起并淡入（大标题用） */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 10. 空壳页（书架 / 分类 / 阅读，后续课程点亮） ---------- */
.shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
}

.shell h1 {
  font-family: var(--font-title);
  font-size: clamp(36px, 8vw, 64px);
  letter-spacing: .3em;
  margin-bottom: 18px;
  text-shadow: 0 0 18px rgba(47, 107, 255, .45);
}

.shell-tag {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 18px;
  margin-bottom: 22px;
}

.shell p {
  max-width: 480px;
  color: var(--muted);
  line-height: 2;
  margin-bottom: 34px;
}

.back-link {
  color: var(--blue-soft);
  border-bottom: 1px solid var(--blue-soft);
  padding-bottom: 2px;
  transition: color .2s;
}

.back-link:hover { color: var(--white); border-bottom-color: var(--white); }

/* ---------- 11. 响应式：窗口拉窄到手机宽度也不崩 ---------- */
@media (max-width: 640px) {
  .topbar { padding: 14px 20px; }
  .logo { font-size: 18px; letter-spacing: 3px; }
  .topnav a { margin-left: 16px; font-size: 13px; }

  .hero { padding: 40px 16px; }
  .hero-subtitle { font-size: 15px; }

  /* 两个按钮在窄屏上下排列 */
  .hero-actions { flex-direction: column; gap: 14px; width: 100%; max-width: 280px; }
  .btn { width: 100%; text-align: center; padding: 13px 0; }

  /* 三个卖点改成竖排 */
  .hero-points { flex-direction: column; width: 100%; max-width: 280px; gap: 10px; margin-top: 36px; }
  .hero-points li { text-align: center; }

  /* M2：书架网格变单列，分类卡片两列，窄屏也能看全 */
  .book-grid { grid-template-columns: 1fr; max-width: 300px; }
  .book-card { flex-direction: row; align-items: stretch; }
  .book-cover { width: 96px; min-width: 96px; height: auto; min-height: 136px; }
  .cover-title { font-size: 20px; }
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   以下为第 8 课 M2 新增样式：内容页框架 / 书架 / 分类
   ============================================================ */

/* ---------- 12. 内容页框架（书架 / 分类共用） ---------- */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 32px 56px;
}

.page-head {
  text-align: center;
  margin-bottom: 30px;
}

.page-head h1 {
  font-family: var(--font-title);
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: .3em;
  text-shadow: 0 0 18px rgba(47, 107, 255, .45);
  animation: fadeIn .8s .05s both;
}

.page-sub {
  margin-top: 12px;
  color: var(--muted);
  letter-spacing: 2px;
  animation: fadeIn .8s .2s both;
}

.page-back {
  text-align: center;
  margin-top: 40px;
}

/* ---------- 13. 类型筛选条（书架页顶部） ---------- */
.genre-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  animation: fadeIn .8s .3s both;
}

/* 筛选小按钮：胶囊样式，选中的亮蓝底 */
.genre-chip {
  padding: 8px 22px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 27, 58, .45);
  transition: color .2s, background .2s, border-color .2s;
}

.genre-chip:hover { color: var(--white); border-color: var(--blue-soft); }

.genre-chip.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue) 0%, #1b3f9e 100%);
  border-color: var(--blue-soft);
  box-shadow: 0 3px 14px rgba(47, 107, 255, .45);
}

/* 当前筛选状态提示 */
.shelf-status {
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 24px;
  animation: fadeIn .8s .35s both;
}

/* ---------- 14. 书架网格 + 封面卡片 ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px;
}

/* 整张卡片可点：封面 + 信息区上下结构，悬停轻轻浮起 */
.book-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(11, 27, 58, .45);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  animation: fadeIn .8s .4s both;
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: var(--blue-soft);
  box-shadow: 0 10px 30px rgba(47, 107, 255, .35);
}

/* 封面：渐变底 + 竖排书名 + 底部作者（全 CSS，不用图片） */
.book-cover {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 竖排书名：像传统书封一样从上往下读 */
.cover-title {
  writing-mode: vertical-rl;
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(5, 7, 13, .6);
}

.cover-author {
  position: absolute;
  left: 12px;
  bottom: 10px;
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: .2em;
  color: rgba(245, 248, 255, .75);
}

/* 信息区：类型标签 / 书名 / 简介 / 字数 */
.book-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-genre {
  align-self: flex-start;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 10px;
}

.book-name {
  font-family: var(--font-title);
  font-size: 19px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.book-intro {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  flex: 1;                       /* 简介・撑开，让"字数"始终贴底对齐 */
  margin-bottom: 12px;
}

.book-words {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--blue-soft);
}

/* ---------- 15. 四套封面渐变：4 本占位书颜色各异 ---------- */
.cover-sci {  /* 科幻《星尘航线》：深空蓝紫星云 */
  background: linear-gradient(160deg, #101c4a 0%, #2f3bd8 55%, #7a4fd8 100%);
}

.cover-fan {  /* 玄幻《剑落青云》：青碧剑光 */
  background: linear-gradient(160deg, #062b2b 0%, #0f7d6c 55%, #46c78c 100%);
}

.cover-mys {  /* 悬疑《旧巷灯影》：夜蓝路灯昏黄 */
  background: linear-gradient(160deg, #0a0f1e 0%, #23345c 55%, #c8a24a 130%);
}

.cover-rom {  /* 言情《晚风信箱》：橙粉晚霞 */
  background: linear-gradient(160deg, #3a1740 0%, #b8447a 55%, #f0966a 100%);
}

/* ---------- 16. 分类入口卡片（分类页） ---------- */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  animation: fadeIn .8s .3s both;
}

/* 每张类型卡：类型大字 + 一句介绍 + 在架数量，整卡可点 */
.genre-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 34px 18px 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 27, 58, .45);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.genre-card:hover {
  transform: translateY(-6px);
  border-color: var(--blue-soft);
  box-shadow: 0 10px 30px rgba(47, 107, 255, .35);
}

/* 卡片顶部一条渐变色带，悬停时变亮，暗示点进去书封的颜色 */
.genre-card::before {
  content: "";
  width: 44px;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, var(--blue), var(--blue-soft));
}

.genre-card:hover::before { box-shadow: 0 0 12px rgba(126, 166, 255, .8); }

.genre-card-name {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .25em;
  margin-bottom: 10px;
}

.genre-card-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.genre-card-count {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--blue-soft);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  width: 100%;
}

/* 分类页兜底提示（禁用 JS 时）与"直接进书架"按钮间距 */
.genre-empty { text-align: center; color: var(--muted); padding: 30px 0; }
.genre-all { margin-bottom: 18px; }

/* ---------- 17. M2 响应式补充：窄屏布局调整 ---------- */
@media (max-width: 900px) {
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .page { padding: 32px 18px 44px; }
  .book-grid { gap: 18px; }
}

/* ============================================================
   以下为第 9 课 M3 新增样式：阅读页（正文区 + 工具条 + 目录 + 三种主题）
   ============================================================ */

/* ---------- 19. 阅读页整体框架 ---------- */
.reader-page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 56px;
  display: flex;
  flex-direction: column;
}

/* 页头：书名 + 作者/类型/章数 */
.reader-head h1 {
  font-family: var(--font-title);
  font-size: clamp(26px, 5vw, 40px);
  letter-spacing: .12em;
  text-align: center;
  text-shadow: 0 0 18px rgba(47, 107, 255, .45);
  animation: fadeIn .8s .05s both;
}

.reader-meta {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
  animation: fadeIn .8s .15s both;
}

/* ---------- 20. 工具条：目录 / 字号 / 背景 ---------- */
.reader-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 14px;
  animation: fadeIn .8s .25s both;
}

.tool-group {
  display: inline-flex;
  gap: 6px;
}

/* 工具按钮：胶囊描边样式，沿用筛选条的观感 */
.reader-btn {
  padding: 7px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  letter-spacing: 1px;
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 27, 58, .45);
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}

.reader-btn:hover { color: var(--white); border-color: var(--blue-soft); }

.reader-btn.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue) 0%, #1b3f9e 100%);
  border-color: var(--blue-soft);
}

/* 翻到头时禁用的按钮：置灰且不可点 */
.reader-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  border-color: var(--line);
}

/* ---------- 21. 章节目录（默认收起，toc-open 时展开） ---------- */
.reader-toc {
  display: none;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 27, 58, .45);
  padding: 12px 8px;
}

.reader-page.toc-open .reader-toc { display: block; animation: fadeIn .3s both; }

.reader-toc ol {
  list-style: none;
  max-height: 220px;             /* 章多时目录内部滚动 */
  overflow-y: auto;
}

.reader-toc a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--muted);
  border-radius: 6px;
  transition: color .2s, background .2s;
}

.reader-toc a:hover { color: var(--white); background: rgba(47, 107, 255, .18); }

/* 当前正在读的一章在目录里高亮 */
.reader-toc a.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue) 0%, #1b3f9e 100%);
}

/* ---------- 22. 正文区：白/绿/黑 三种主题 ---------- */
.reader-stage {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 34px 36px;
  animation: fadeIn .8s .3s both;
}

.reader-stage h2 {
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.reader-text p {
  line-height: 2;
  margin-bottom: 1em;
  text-align: justify;           /* 两端对齐，正文更像书页 */
  /* 默认字号由 js/reader.js 写 style.fontSize（记住上次设置） */
}

/* 三种阅读背景：挂在 main 容器上，标题/正文颜色跟着换。
   dark（默认）贴近全站蓝白黑；green 是护眼豆沙绿；white 是普通白纸。 */
.reader-theme-dark .reader-stage { background: rgba(11, 27, 58, .45); color: var(--white); }
.reader-theme-green .reader-stage { background: #cde8cf; border-color: rgba(43, 71, 43, .35); color: #23301f; }
.reader-theme-green .reader-stage h2 { border-bottom-color: rgba(43, 71, 43, .3); }
.reader-theme-white .reader-stage { background: #f7f6f2; border-color: rgba(5, 7, 13, .2); color: #23262b; }
.reader-theme-white .reader-stage h2 { border-bottom-color: rgba(5, 7, 13, .15); }

/* ---------- 23. 底部章节切换 ---------- */
.reader-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  animation: fadeIn .8s .35s both;
}

.reader-nav span {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
  white-space: nowrap;
}

.reader-back { text-align: center; margin-top: 34px; }

/* ---------- 24. 兜底提示（id 不对 / 还没导入正文） ----------
   main 加 has-error 类时隐藏正文相关区块（含 M4 书评墙），只显示提示和返回链接 */
.reader-page.has-error .reader-head,
.reader-page.has-error .reader-tools,
.reader-page.has-error .reader-toc,
.reader-page.has-error .reader-stage,
.reader-page.has-error .reader-nav,
.reader-page.has-error .reader-back,
.reader-page.has-error .review-wall { display: none; }

.reader-empty { display: none; text-align: center; padding: 60px 0 20px; color: var(--muted); }
.reader-page.has-error .reader-empty { display: block; }
.reader-empty .back-link { display: inline-block; margin-top: 18px; }

/* ---------- 25. M3 响应式补充：窄屏阅读 ---------- */
@media (max-width: 640px) {
  .reader-page { padding: 26px 14px 44px; }
  .reader-stage { padding: 22px 18px 26px; }
  .reader-nav span { font-size: 12px; }
}

/* ============================================================
   以下为第 10 课 M4 新增样式：阅读页底部的书评墙（表单 + 展示墙）
   ============================================================ */

/* ---------- 27. 书评墙整体 ---------- */
.review-wall {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 27, 58, .45);
  padding: 24px 26px 26px;
  animation: fadeIn .8s .45s both;
}

.review-title {
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 6px;
  text-align: center;
  text-shadow: 0 0 18px rgba(47, 107, 255, .45);
}

/* 汇总行："共 N 条书评 · 平均 X.X 分"（还没有书评时留空） */
.review-summary {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--blue-soft);
}

/* ---------- 28. 书评表单 ---------- */
.review-form { margin-top: 18px; }

.review-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.review-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 150px;
}

.review-field-wide { margin-top: 14px; }

.review-field label {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
}

/* 输入框：深色半透明底，聚焦时亮蓝描边 */
.review-field input,
.review-field select,
.review-field textarea {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--white);
  background: rgba(5, 7, 13, .55);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.review-field textarea {
  min-height: 84px;
  resize: vertical;            /* 只允许上下拉伸，不破坏页面版式 */
  line-height: 1.8;
}

.review-field input:focus,
.review-field select:focus,
.review-field textarea:focus {
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(47, 107, 255, .25);
}

.review-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 发书评主按钮：比工具条按钮大一号，蓝底 */
.review-submit {
  padding: 9px 34px;
  font-size: 15px;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--blue) 0%, #1b3f9e 100%);
  border-color: var(--blue-soft);
}

.review-submit:disabled { opacity: .5; cursor: wait; }

/* 提交后的反馈一行：已提交 / 错误原因等 */
.review-status {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--blue-soft);
}

/* ---------- 29. 展示墙：一条书评一张小卡，新的在前 ---------- */
.review-list {
  list-style: none;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 7, 13, .35);
  padding: 12px 16px;
}

.review-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.review-name {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--white);
}

.review-score {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--blue-soft);
  white-space: nowrap;
}

.review-text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--white);
}

.review-time {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
}

/* 还没有书评时的占位一行 */
.review-empty {
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
  padding: 18px 0 6px;
}

/* 本地模式说明：只在连不上书评服务器时出现 */
.review-mode {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  text-align: center;
}

/* ---------- 30. M4 响应式补充：窄屏书评墙 ---------- */
@media (max-width: 640px) {
  .review-wall { padding: 18px 14px 20px; }
  .review-row { flex-direction: column; }
  .review-field { min-width: 0; }
}

/* ---------- 31. 尊重系统"减少动态效果"设置（M1+M2+M3+M4 全部动画元素） ----------
   注意：本块必须放在文件最末尾——放前面会被后面定义的 animation 盖掉。
   命中后所有动画直接跳到结束状态（opacity:1），页面无动态但仍完整可读。 */
@media (prefers-reduced-motion: reduce) {
  .stars i, .hero-title span, .hero-kicker,
  .hero-divider, .hero-subtitle, .hero-actions, .hero-points,
  .page-head h1, .page-sub, .genre-bar, .shelf-status,
  .book-card, .genre-grid,
  .reader-head h1, .reader-meta, .reader-tools,
  .reader-page.toc-open .reader-toc, .reader-stage, .reader-nav,
  .review-wall {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
