:root {
  --bg1: #efe5d4;
  --bg2: #f8f0e3;
  --ink: #3a2a1a;
  --accent: #789893;
  --accent2: #527872;
  --card: #fffdf8;
  --paper: #fffdf8;
  --paper2: #f6efe4;
  --line: #dac6a8;
  --seal: #5c462c;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, .76) 0%, rgba(248, 240, 227, .5) 44%, rgba(239, 228, 210, .74) 100%),
    url("mhlsHomePageBG.png") center center / cover no-repeat fixed;
  min-height: 100vh;
  padding-bottom: 88px; /* 给底部播放条留空间 */
}

.home-body,
.practice-body,
.study-body {
  padding-bottom: 0;
}

/* ---------- Main entry ---------- */
.home-header {
  max-width: 980px;
  margin: 0 auto;
  padding: 58px 20px 18px;
}
.home-kicker {
  margin: 0 0 10px;
  color: var(--accent2);
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 253, 248, .82);
}
.home-header h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 54px);
  color: var(--seal);
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(255, 253, 248, .78);
}
.hub-grid {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 20px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.hub-card {
  min-height: 210px;
  text-decoration: none;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .97), rgba(248, 239, 224, .95)),
    radial-gradient(circle at 88% 18%, rgba(125, 155, 149, .12), transparent 28%);
  border: 1px solid rgba(218, 198, 168, .9);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(83, 59, 30, .12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .08s ease, box-shadow .2s, border-color .2s;
}
.hub-card:hover {
  transform: translateY(-2px);
  border-color: rgba(82, 120, 114, .58);
  box-shadow: 0 14px 30px rgba(83, 59, 30, .16);
}
.hub-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #789893;
  color: #fffdf8;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 30px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), 0 6px 12px rgba(63, 82, 75, .16);
}
.hub-title {
  color: var(--seal);
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 32px;
  font-weight: 900;
}
.hub-desc {
  color: #8a6a44;
  font-size: 15px;
  line-height: 1.5;
  flex: 1;
}
.hub-action {
  align-self: flex-start;
  color: #fffdf8;
  background: #789893;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .1);
}
.hub-card-todo {
  opacity: .82;
}
.hub-card-todo .hub-action {
  background: #8a6a44;
}

/* ---------- Practice video ---------- */
.compact-header {
  padding-bottom: 12px;
}
.video-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 18px 46px;
}
.video-shell {
  background: var(--card);
  border: 2px solid #ffe0bd;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
  overflow: hidden;
}
.video-placeholder {
  aspect-ratio: 16 / 9;
  background: #1f2933;
  color: #fff;
  display: grid;
  place-items: center;
  position: relative;
}
.video-play-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.42);
  font-size: 34px;
}
.video-todo {
  position: absolute;
  left: 18px;
  bottom: 16px;
  color: rgba(255,255,255,.78);
  font-weight: 800;
}
.video-controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.video-controls-row .player-btn:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.video-meta {
  flex: 1;
  min-width: 0;
}

/* ---------- Study modules ---------- */
.study-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 18px 16px;
}
.study-kicker {
  margin: 0 0 8px;
  color: #527872;
  font-weight: 800;
}
.study-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 6vw, 52px);
  color: #5c462c;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  line-height: 1.1;
}
.study-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.study-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(218, 198, 168, .9);
  border-radius: 999px;
  background: rgba(255, 253, 248, .92);
  color: #6b4f30;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .08);
}
.study-stat strong {
  color: #527872;
  font-size: 20px;
}
.study-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px 48px;
}
.study-toolbar {
  position: sticky;
  top: 58px;
  z-index: 20;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(218, 198, 168, .86);
  border-radius: 24px;
  background: rgba(255, 253, 248, .9);
  box-shadow: 0 8px 20px rgba(83, 59, 30, .1);
  backdrop-filter: blur(8px);
}
.module-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.module-tab {
  border: 1px solid rgba(125, 155, 149, .42);
  border-radius: 999px;
  background: #f6efe4;
  color: #6b4f30;
  cursor: pointer;
  min-height: 42px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .08);
}
.module-tab strong {
  color: #8a6a44;
  font-size: 13px;
}
.module-tab.active {
  background: #789893;
  border-color: #557f73;
  color: #fffdf8;
}
.module-tab.active strong {
  color: rgba(255, 253, 248, .86);
}
.study-search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b4f30;
  font-weight: 800;
}
.study-search span {
  color: #527872;
}
.study-search input {
  width: min(280px, 42vw);
  border: 1px solid rgba(125, 155, 149, .42);
  border-radius: 999px;
  background: #f6efe4;
  color: #3a2a1a;
  font: inherit;
  padding: 9px 11px;
  box-shadow: inset 0 1px 3px rgba(83, 59, 30, .08);
}
.study-search input:focus {
  outline: 2px solid rgba(82, 120, 114, .24);
  border-color: #527872;
}
.study-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-header,
.resource-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-title,
.resource-section-title {
  margin: 0;
  color: #5c462c;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 28px;
}
.section-count {
  color: #527872;
  font-weight: 800;
}
.lesson-list {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 960px;
  margin: 0 auto;
  gap: 20px;
}
.lesson-card,
.diagram-card,
.resource-section {
  background: #fffdf8;
  border: 1px solid #e6d2b8;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(77, 51, 24, .08);
}
.lesson-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lesson-top {
  position: relative;
  min-height: 220px;
  margin-bottom: 24px;
  padding: 34px 46px;
  display: flex;
  gap: 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(211, 190, 160, .88);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, .95), rgba(248, 239, 225, .9)),
    radial-gradient(circle at 80% 28%, rgba(128, 150, 143, .11), transparent 26%);
  box-shadow: 0 10px 24px rgba(79, 56, 28, .14);
}
.lesson-top::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(215, 196, 165, .9);
  border-radius: 20px;
  pointer-events: none;
}
.lesson-top::after {
  content: "";
  position: absolute;
  right: 58px;
  bottom: 24px;
  width: 310px;
  height: 95px;
  opacity: .26;
  background:
    linear-gradient(150deg, transparent 42%, rgba(118, 97, 69, .26) 43%, transparent 45%),
    radial-gradient(ellipse at 28% 88%, rgba(110, 91, 64, .24) 0 28%, transparent 29%),
    radial-gradient(ellipse at 58% 78%, rgba(110, 91, 64, .18) 0 34%, transparent 35%),
    radial-gradient(ellipse at 82% 84%, rgba(110, 91, 64, .14) 0 22%, transparent 23%);
  pointer-events: none;
}
.complete-button {
  position: absolute;
  right: 28px;
  top: 24px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(125, 155, 149, .46);
  border-radius: 50%;
  background: #f6efe4;
  color: #6b4f30;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .1);
}
.complete-button:hover,
.complete-button:focus-visible {
  border-color: #2c7be8;
  color: #2c7be8;
}
.complete-button.completed {
  border-color: #557f73;
  background: #789893;
  color: #fffdf8;
}
.lesson-completed .lesson-top {
  border-color: rgba(85, 127, 115, .72);
}
.lesson-no {
  position: relative;
  z-index: 1;
  flex: none;
  width: 98px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(71, 105, 99, .42);
  border-radius: 14px;
  background: #789893;
  color: #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24), 0 8px 16px rgba(63, 82, 75, .18);
  font-size: 28px;
  font-weight: 900;
}
.lesson-title-box {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  justify-items: center;
}
.lesson-title {
  margin: 0;
  font-size: clamp(66px, 11vw, 116px);
  color: #5c462c;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  line-height: .95;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .42);
}
.lesson-subtitle {
  margin: 18px 0 0;
  color: #6b5233;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 30px;
  letter-spacing: 0;
}
.primary-actions,
.diagram-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.primary-link,
.text-link,
.resource-link {
  text-decoration: none;
}
.primary-link {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  background: #e8612c;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}
.materials-panel {
  position: relative;
  overflow: hidden;
  padding: 24px 28px 26px;
  border: 1px solid rgba(218, 198, 168, .9);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .97), rgba(248, 239, 224, .95)),
    radial-gradient(circle at 90% 10%, rgba(125, 155, 149, .12), transparent 25%);
  box-shadow: 0 10px 24px rgba(83, 59, 30, .12);
}
.materials-panel::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 22px;
  width: 140px;
  height: 96px;
  opacity: .1;
  background:
    linear-gradient(90deg, transparent 44%, #8b785d 45% 48%, transparent 49%),
    linear-gradient(0deg, transparent 44%, #8b785d 45% 48%, transparent 49%);
  transform: rotate(7deg);
  pointer-events: none;
}
.materials-grid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.material-tile {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(218, 198, 168, .72);
}
.material-tile:first-child {
  padding-top: 0;
}
.material-tile:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.material-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.material-section-title {
  margin: 0;
  color: #6b4f30;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 30px;
  font-weight: 900;
}
.material-icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #7d9b95;
  color: #fffdf8;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 24px;
  font-weight: 900;
}
.material-title-button,
.material-side-button,
.material-action-button,
.material-video-link,
.material-number-button {
  border: 0;
  background: transparent;
  color: #527872;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  font-weight: 900;
  padding: 0;
  text-decoration: none;
}
.material-title-button:hover,
.material-title-button:focus-visible,
.material-side-button:hover,
.material-side-button:focus-visible,
.material-action-button:hover,
.material-action-button:focus-visible,
.material-video-link:hover,
.material-video-link:focus-visible,
.material-number-button:hover,
.material-number-button:focus-visible {
  color: #2c7be8;
  text-decoration: underline;
}
.material-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.material-number-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(125, 155, 149, .42);
  border-radius: 999px;
  background: #f6efe4;
  color: #8a6a44;
  font-size: 15px;
  padding: 0;
  text-decoration: none;
}
.material-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.material-action-button {
  min-height: 38px;
  border: 1px solid rgba(125, 155, 149, .42);
  border-radius: 999px;
  background: #f6efe4;
  font-size: 18px;
  padding: 8px 14px;
  text-decoration: none;
}
.material-side-button {
  margin-left: auto;
  color: #8a6a44;
  font-size: 18px;
}
.material-video-list {
  display: grid;
  gap: 12px;
}
.material-video-item {
  display: grid;
  gap: 7px;
}
.material-video-link {
  justify-self: start;
  color: #8a6a44;
  font-size: 16px;
}
.material-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #111;
  box-shadow: 0 6px 14px rgba(83, 59, 30, .12);
}
.material-count {
  margin-left: auto;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #efe3d1;
  color: #8a6a44;
  font-size: 14px;
  font-weight: 900;
}
.text-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
  color: #2c7be8;
  font-weight: 800;
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.related-block {
  position: relative;
  overflow: hidden;
  padding: 24px 32px;
  border: 1px solid rgba(218, 198, 168, .86);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .96), rgba(249, 241, 229, .94)),
    radial-gradient(circle at 92% 12%, rgba(120, 150, 142, .1), transparent 20%);
  box-shadow: 0 9px 20px rgba(83, 59, 30, .11);
}
.related-block::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 22px;
  width: 120px;
  height: 84px;
  opacity: .12;
  background:
    linear-gradient(90deg, transparent 44%, #8b785d 45% 48%, transparent 49%),
    linear-gradient(0deg, transparent 44%, #8b785d 45% 48%, transparent 49%);
  transform: rotate(7deg);
  pointer-events: none;
}
.related-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.related-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #7d9b95;
  color: #fffdf8;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 24px;
  font-weight: 900;
}
.related-title {
  margin: 0;
  color: #6b4f30;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 32px;
  font-weight: 900;
}
.related-title::after {
  content: "";
  display: block;
  width: 80px;
  height: 2px;
  margin-top: 8px;
  background: #90aaa2;
}
.related-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.related-title-button {
  border: 0;
  background: transparent;
  color: #527872;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  padding: 0 2px;
}
.related-title-button:hover,
.related-title-button:focus-visible {
  color: #2c7be8;
  text-decoration: underline;
}
.related-muted,
.study-empty {
  color: #8a6a44;
  font-weight: 700;
}
.resource-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.compact-list {
  grid-template-columns: 1fr;
}
.diagram-mini-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.diagram-feature {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 28px;
  align-items: center;
}
.diagram-feature-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
  min-height: 52px;
}
.resource-link {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e6d2b8;
  border-radius: 8px;
  background: #fffdf8;
  color: #3a2a1a;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
}
.resource-link.strong {
  color: #2f271c;
  font-weight: 900;
}
.resource-link::after {
  content: attr(data-group);
  display: block;
  margin-top: 3px;
  color: #9a7c55;
  font-size: 12px;
  font-weight: 700;
}
.diagram-mini {
  display: block;
}
.diagram-mini img {
  width: min(180px, 38vw);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid #dfcbb0;
  background: #fbf4e8;
  box-shadow: 0 6px 14px rgba(83, 59, 30, .12);
  cursor: zoom-in;
}
.diagram-mini-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.diagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.diagram-card {
  overflow: hidden;
}
.diagram-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #f1e6d5;
}
.diagram-thumb {
  cursor: zoom-in;
}
.diagram-body {
  padding: 10px;
}
.diagram-title {
  margin: 0 0 8px;
  color: #2f271c;
  font-size: 17px;
}
.resource-section {
  padding: 14px;
}
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(47, 39, 28, .72);
}
.image-viewer.active {
  display: flex;
}
.image-viewer-panel {
  width: min(960px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #e6d2b8;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .25);
}
.image-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e6d2b8;
}
.image-viewer-title {
  margin: 0;
  color: #2f271c;
  font-size: 18px;
}
.image-viewer-close {
  border: 1px solid #d9bd96;
  border-radius: 8px;
  background: #fff1df;
  color: #3a2a1a;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 7px 10px;
}
.image-viewer-frame {
  overflow: auto;
  padding: 12px;
  background: #f7efe3;
}
.image-viewer-image {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #e6d2b8;
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }

  .study-toolbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }
  .module-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .module-tab {
    justify-content: center;
  }
  .study-search input {
    width: 100%;
  }
  .lesson-list,
  .diagram-grid,
  .resource-list {
    grid-template-columns: 1fr;
  }
  .lesson-list {
    gap: 16px;
  }
  .lesson-top {
    min-height: 205px;
    margin-bottom: 20px;
    padding: 28px 26px;
    gap: 18px;
  }
  .lesson-top::after {
    right: 20px;
    bottom: 18px;
    width: 210px;
    height: 74px;
  }
  .lesson-no {
    width: 76px;
    height: 56px;
    font-size: 24px;
  }
  .lesson-title {
    font-size: clamp(58px, 20vw, 90px);
  }
  .lesson-subtitle {
    margin-top: 12px;
    font-size: 26px;
  }
  .related-block {
    padding: 22px 24px;
    border-radius: 22px;
  }
  .related-heading {
    gap: 12px;
    margin-bottom: 16px;
  }
  .related-icon {
    width: 46px;
    height: 46px;
    font-size: 25px;
  }
  .related-title {
    font-size: 34px;
  }
  .diagram-feature {
    grid-template-columns: minmax(150px, 190px) 1fr;
    gap: 18px;
  }
  .diagram-mini img {
    width: min(185px, 44vw);
  }
  .diagram-feature-actions {
    align-self: center;
    flex-wrap: wrap;
    gap: 14px;
  }
  .related-title-button {
    font-size: 22px;
  }
  .materials-panel {
    padding: 22px 22px 24px;
  }
  .materials-grid {
    row-gap: 16px;
  }
  .materials-panel-title {
    font-size: 34px;
  }
  .material-section-title {
    font-size: 32px;
  }
  .material-title-button {
    font-size: 25px;
  }
  .material-action-button {
    font-size: 18px;
  }
  .material-side-button {
    font-size: 18px;
  }
  .diagram-mini img {
    width: min(175px, 46vw);
  }
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 34px 18px 24px;
  overflow: hidden;
}

.site-header h1 {
  font-size: clamp(28px, 6vw, 52px);
  margin: 0 0 8px;
  color: var(--seal);
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  text-shadow: 0 2px 0 rgba(255,255,255,.42);
}

.subtitle {
  margin: 0 0 18px;
  font-size: clamp(14px, 3vw, 20px);
  color: #8a6a44;
}

.floating-deco {
  position: absolute;
  font-size: 38px;
  opacity: .85;
}
.deco1 { left: 8%;  top: 30%; }
.deco2 { right: 10%; top: 20%; }
.deco3 { right: 22%; bottom: 14%; font-size: 30px; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid rgba(85, 127, 115, .34);
  cursor: pointer;
  font-size: 17px;
  padding: 12px 22px;
  border-radius: 999px;
  color: #fffdf8;
  background: #789893;
  box-shadow: 0 5px 12px rgba(83, 59, 30, .14);
  transition: transform .08s ease, box-shadow .08s ease, background .2s;
  font-weight: 900;
}
.btn:hover,
.btn:focus-visible { background: #527872; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 6px rgba(83, 59, 30, .16); }
.btn-all { background: #789893; box-shadow: 0 5px 12px rgba(83, 59, 30, .14); }
.btn-all:active { box-shadow: 0 2px 6px rgba(83, 59, 30, .16); }

.btn-download {
  display: inline-block;
  text-decoration: none;
  margin-left: 10px;
  font-size: 16px;
  padding: 12px 18px;
  background: #8a6a44;
  box-shadow: 0 5px 12px rgba(83, 59, 30, .14);
}
.btn-download:active { box-shadow: 0 2px 6px rgba(83, 59, 30, .16); }

/* ---------- Voice picker / warning ---------- */
.voice-bar {
  margin-top: 16px;
  font-size: 15px;
  color: #6b4f30;
}
.voice-bar select {
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 155, 149, .42);
  background: #f6efe4;
  color: var(--ink);
  max-width: 70vw;
}
.voice-warning {
  max-width: 640px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff3cd;
  border: 2px solid #ffd66e;
  color: #7a5a12;
  font-size: 14px;
  line-height: 1.7;
  text-align: left;
}
.voice-warning code {
  background: rgba(0,0,0,.06);
  padding: 1px 6px;
  border-radius: 6px;
}

/* ---------- Pages ---------- */
.pages {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.page-card {
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .97), rgba(248, 239, 224, .95));
  border: 1px solid rgba(218, 198, 168, .9);
  border-radius: 28px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(83, 59, 30, .12);
}
.page-card.reading { outline: 4px solid rgba(120, 152, 147, .5); outline-offset: 2px; }

.comic-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #f3ead9;
  border: 1px solid rgba(218, 198, 168, .9);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.4);
}

.comic-img {
  display: block;
  width: 100%;
  height: auto;
}

.sparkle { display: none; }

.page-body { padding: 14px 8px 6px; }
.page-no {
  font-size: 14px;
  color: #527872;
  font-weight: 700;
  margin-bottom: 6px;
}
.page-text {
  font-size: clamp(17px, 3.4vw, 21px);
  line-height: 1.9;
  margin: 0 0 16px;
}

.page-dialogue {
  margin: 0 0 16px;
}
.dialogue-title {
  font-size: 15px;
  font-weight: 700;
  color: #527872;
  margin-bottom: 8px;
}
.dialogue-line {
  margin: 0 0 8px;
  padding: 10px 14px;
  background: #f6efe4;
  border: 1px solid rgba(218, 198, 168, .9);
  border-radius: 14px 14px 14px 4px;
  font-size: clamp(15px, 3vw, 18px);
  line-height: 1.7;
}
.dialogue-line .speaker {
  font-weight: 700;
  color: #527872;
}

.site-footer {
  text-align: center;
  padding: 18px;
  color: #8a6a44;
}

/* ---------- Playlist ---------- */
.playlist {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 0;
}
.playlist-title {
  font-size: 20px;
  color: #527872;
  margin: 8px 0 12px;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 253, 248, .95);
  border: 1px solid rgba(218, 198, 168, .9);
  border-radius: 22px;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(83, 59, 30, .1);
  transition: transform .08s ease, box-shadow .2s;
}
.playlist-item:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(83, 59, 30, .14); }
.pl-cover {
  width: 56px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.pl-meta { flex: 1; min-width: 0; }
.pl-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.pl-sub { font-size: 13px; color: #8a6a44; margin: 2px 0; }
.pl-dur { font-size: 13px; color: var(--accent); font-weight: 700; }
.pl-play {
  font-size: 22px;
  color: #fff;
  background: #789893;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  box-shadow: 0 4px 0 #b7421a;
}

/* ---------- Bottom player ---------- */
.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(255, 253, 248, .96);
  border-top: 1px solid rgba(218, 198, 168, .9);
  box-shadow: 0 -6px 20px rgba(83, 59, 30, .12);
  backdrop-filter: blur(6px);
}
.player-btn {
  border: 1px solid rgba(85, 127, 115, .34);
  cursor: pointer;
  background: var(--accent2);
  color: #fffdf8;
  width: 52px; height: 52px;
  border-radius: 50%;
  font-size: 22px;
  flex: none;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .14);
}
.player-btn.small {
  width: 38px; height: 38px;
  font-size: 16px;
  background: #8a6a44;
  box-shadow: 0 3px 8px rgba(83, 59, 30, .14);
}
.player-btn:active { transform: translateY(3px); box-shadow: none; }
.player-info { flex: 1; min-width: 0; }
.player-track { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.player-progress {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #8a6a44;
}
.seek { flex: 1; accent-color: #789893; cursor: pointer; }

/* ---------- Keyframes ---------- */
@keyframes ken-burns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.06) translate(-1%, -1%); }
}
@keyframes live-pan {
  from { transform: scale(1.02) translate(0, 0); }
  to   { transform: scale(1.06) translate(-1.5%, -1%); }
}
@keyframes live-bob {
  0%,100% { translate: 0 0; rotate: 0deg; }
  50% { translate: 0 -6px; rotate: -0.4deg; }
}
@keyframes character-hop {
  0%,100% { translate: 0 0; scale: 1; }
  35% { translate: 0 -12px; scale: 1.015; }
  60% { translate: 0 2px; scale: 0.99; }
}
@keyframes frame-jump {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(0.5deg); }
}
@keyframes wobble {
  0%,100% { rotate: 0deg; }
  25% { rotate: .6deg; }
  75% { rotate: -.6deg; }
}
@keyframes float {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}
@keyframes twinkle {
  0%,100% { opacity: 0; transform: scale(.6); }
  50% { opacity: 1; transform: scale(1.2); }
}
@keyframes pop-in {
  0% { transform: scale(.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .comic-img, .floating-deco, .sparkle, .site-header h1 { animation: none !important; }
}

/* ---------- 书架总页面 ---------- */
.catalog-status {
  margin-top: 10px;
  font-size: 14px;
  color: #527872;
  font-weight: 800;
}
.book-grid {
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.book-card {
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .97), rgba(248, 239, 224, .95)),
    radial-gradient(circle at 88% 18%, rgba(125, 155, 149, .1), transparent 28%);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(83, 59, 30, .11);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(218, 198, 168, .9);
}
.book-card.playing { border-color: #557f73; box-shadow: 0 12px 28px rgba(83, 59, 30, .16); }
.book-card.not-ready { opacity: .72; }
.book-no {
  font-size: 26px;
  font-weight: 800;
  color: #527872;
  letter-spacing: 1px;
}
.book-title {
  color: var(--seal);
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.4;
  flex: 1;
}
.book-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.book-actions .btn {
  font-size: 15px;
  padding: 9px 14px;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .12);
}
.book-actions .btn-read {
  text-decoration: none;
  background: #527872;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .12);
}
.btn-disabled {
  background: #c9bca9 !important;
  box-shadow: 0 4px 10px rgba(83, 59, 30, .1) !important;
  cursor: not-allowed;
}

/* ---------- 顶部导航（阅读页） ---------- */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 253, 248, .92);
  border-bottom: 1px solid rgba(218, 198, 168, .9);
  box-shadow: 0 6px 16px rgba(83, 59, 30, .08);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topnav a {
  text-decoration: none;
  font-weight: 700;
  color: var(--accent2);
  font-size: 16px;
  border: 1px solid rgba(125, 155, 149, .34);
  border-radius: 999px;
  background: #f6efe4;
  padding: 7px 12px;
}

.not-ready-box {
  max-width: 640px;
  margin: 20px auto;
  padding: 18px;
  background: #fff3cd;
  border: 2px solid #ffd66e;
  border-radius: 14px;
  color: #7a5a12;
  text-align: center;
  font-size: 16px;
  line-height: 1.7;
}

