:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-soft: #f4efe6;
  --text: #1f1d1a;
  --text-muted: #6e675e;
  --border: #e6dfd3;
  --accent: #a8422b;
  --accent-soft: rgba(168, 66, 43, 0.1);
  --shadow: 0 10px 30px rgba(31, 29, 26, 0.06);
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif CN", Georgia, serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --reader-font-size: 18px;
}

body.theme-sepia {
  --bg: #f2ead8;
  --surface: #f8f2e4;
  --surface-soft: #e9dec7;
  --text: #2d261e;
  --text-muted: #706454;
  --border: #ddd0b7;
}

body.theme-night {
  --bg: #15171b;
  --surface: #1d2026;
  --surface-soft: #252932;
  --text: #d8d5ce;
  --text-muted: #9398a3;
  --border: #2e333e;
  --accent: #d46c54;
  --accent-soft: rgba(212, 108, 84, 0.15);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.hidden {
  display: none !important;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 90;
  transition: width 0.1s linear;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-seal {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: #fbf8f3;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 2px rgba(251, 248, 243, 0.45);
}

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

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.brand-text small {
  font-size: 12px;
  color: var(--text-muted);
}

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

.nav-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* Main */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 36px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.hero-copy {
  max-width: 640px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.hero-bio {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.continue-slot {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.continue-slot small {
  font-size: 12px;
  color: var(--text-muted);
}

.continue-slot strong {
  font-family: var(--font-serif);
  font-size: 16px;
}

/* Filter Bar */
.shelf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.shelf-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* Novel Grid */
.novels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 22px;
}

.novel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  gap: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.novel-card:hover {
  transform: translateY(-2px);
}

.book-cover {
  flex: 0 0 116px;
  height: 164px;
  border-radius: 6px 12px 12px 6px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: inset 10px 0 14px rgba(0, 0, 0, 0.18), 4px 8px 18px rgba(0, 0, 0, 0.14);
}

.book-cover::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8px;
  width: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.book-cover-genre {
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.88;
  padding-left: 6px;
  line-height: 1.3;
}

.book-cover-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  padding-left: 6px;
  margin: auto 0;
}

.book-cover-seal {
  align-self: flex-end;
  font-size: 11px;
  border: 1px solid currentColor;
  padding: 1px 7px;
  border-radius: 4px;
  opacity: 0.82;
}

.novel-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.novel-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}

.novel-info h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.3;
}

.novel-subtitle {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.novel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag-chip {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-muted);
}

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

.novel-stats {
  font-size: 12px;
  color: var(--text-muted);
}

/* Buttons */
.btn-primary,
.btn-outline,
.btn-ghost,
.btn-danger-outline {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(200, 68, 58, 0.45);
  color: #c8443a;
}

.btn-danger-outline:hover {
  background: rgba(200, 68, 58, 0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
}

.full-width {
  width: 100%;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Novel Detail */
.detail-topbar {
  margin-bottom: 16px;
}

.novel-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.detail-header {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}

.detail-header .book-cover {
  flex: 0 0 140px;
  height: 198px;
}

.detail-meta {
  flex: 1;
  min-width: 240px;
}

.detail-meta h1 {
  margin: 8px 0 10px;
  font-family: var(--font-serif);
  font-size: 30px;
}

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

.chapter-item-btn {
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.16s ease;
}

.chapter-item-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.chapter-item-btn span {
  font-weight: 600;
  font-family: var(--font-serif);
  font-size: 15px;
}

.chapter-item-btn small {
  color: var(--text-muted);
  font-size: 12px;
}

/* Reader */
button,
a,
input,
select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.reader-toolbar {
  position: sticky;
  top: 72px;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.reader-toolbar.toolbar-hidden {
  transform: translateY(-150%);
  opacity: 0;
  pointer-events: none;
}

.reader-toolbar-left,
.reader-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
}

.tool-btn,
.swatch-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.tool-btn.active,
.swatch-btn.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.tool-label {
  font-size: 12px;
  padding: 0 6px;
  color: var(--text-muted);
}

.reader-article {
  max-width: 740px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 48px 54px;
  box-shadow: var(--shadow);
}

.reader-chapter-header {
  text-align: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 34px;
}

.reader-novel-name {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.reader-chapter-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.35;
}

.reader-chapter-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.reader-body {
  font-family: var(--font-serif);
  font-size: var(--reader-font-size);
  line-height: 2;
  letter-spacing: 0.02em;
}

.reader-body p {
  margin: 0 0 1.25em;
}

.reader-body.indented p {
  text-indent: 2em;
}

.reader-chapter-footer {
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* TOC Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 60;
}

.toc-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 88vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 70;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.2);
}

.toc-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.toc-drawer-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-list button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.toc-list button:hover {
  background: var(--surface-soft);
}

.toc-list button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* About & Studio */
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.about-card h1 {
  font-family: var(--font-serif);
  margin: 4px 0 16px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.about-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.about-box h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
}

.about-box p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.about-lead {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  max-width: 820px;
}

.couple-signoff {
  margin-top: 28px;
  padding: 18px 22px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.04em;
}

.detail-toc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-toc-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toc-search-input {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  min-width: 210px;
  outline: none;
}

.toc-search-input:focus {
  border-color: var(--accent);
}

.studio-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  min-height: 460px;
}

.studio-sidebar {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-novel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-novel-item {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.16s ease;
}

.studio-novel-item:hover {
  border-color: var(--accent);
}

.studio-novel-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.studio-novel-item strong {
  font-size: 14px;
  font-family: var(--font-serif);
}

.studio-novel-item small {
  font-size: 12px;
  color: var(--text-muted);
}

.studio-main {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}

.studio-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stack-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-textarea {
  min-height: 240px;
  resize: vertical;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.85;
  padding: 14px;
}

.studio-chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  gap: 10px;
}

.studio-row-actions {
  display: flex;
  gap: 8px;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.footer-colophon {
  margin: 0 0 4px;
}

.footer-sub {
  margin: 0;
  font-size: 12px;
  opacity: 0.78;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: #23211e;
  color: #fbf8f3;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

/* Responsive & Mobile Adaptation */
@media (max-width: 820px) {
  .novels-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .studio-layout {
    grid-template-columns: 1fr;
  }

  .reader-article {
    padding: 28px 22px;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding: 10px 14px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-seal {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 7px;
    flex-shrink: 0;
  }

  .brand-text strong {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-text small {
    display: none;
  }

  .site-nav {
    gap: 4px;
    flex-shrink: 0;
  }

  .nav-link {
    font-size: 13px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .app-main {
    padding: 14px 12px calc(44px + env(safe-area-inset-bottom, 0px));
  }

  /* Mobile Hero */
  .hero-card {
    padding: 20px 16px;
    border-radius: 14px;
    gap: 16px;
    margin-bottom: 18px;
  }

  .hero-copy h1 {
    font-size: 21px;
    margin-bottom: 8px;
  }

  .hero-bio {
    font-size: 13.5px;
    line-height: 1.65;
  }

  .continue-slot {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
  }

  /* Horizontal Swipe Filter Pills on Mobile */
  .shelf-toolbar {
    margin-bottom: 14px;
    gap: 8px;
  }

  .filter-pills {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .pill {
    flex-shrink: 0;
    padding: 6px 13px;
    font-size: 12.5px;
  }

  /* Mobile Book Card (Keep vertical cover on left, content on right) */
  .novel-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 15px;
    gap: 14px;
    border-radius: 14px;
  }

  .book-cover {
    flex: 0 0 86px;
    width: 86px;
    height: 124px;
    padding: 10px 8px;
    border-radius: 4px 10px 10px 4px;
  }

  .book-cover-genre {
    font-size: 9.5px;
  }

  .book-cover-title {
    font-size: 17px;
  }

  .book-cover-seal {
    font-size: 9.5px;
    padding: 0 5px;
  }

  .novel-info h2 {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .novel-subtitle {
    font-size: 13px;
    margin-bottom: 8px;
    -webkit-line-clamp: 2;
  }

  .novel-tags {
    gap: 5px;
    margin-bottom: 10px;
  }

  .tag-chip {
    font-size: 11px;
    padding: 1px 7px;
  }

  .novel-card-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .novel-card-actions > div {
    display: flex;
    gap: 6px;
    width: 100%;
  }

  .novel-card-actions > div button {
    flex: 1;
    padding: 7px 10px;
  }

  /* Mobile Book Detail & TOC */
  .novel-detail-card,
  .about-card {
    padding: 18px 15px;
    border-radius: 14px;
  }

  .detail-header {
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 18px;
  }

  .detail-header .book-cover {
    flex: 0 0 92px;
    width: 92px;
    height: 132px;
  }

  .detail-meta {
    min-width: 160px;
  }

  .detail-meta h1 {
    font-size: 19px;
    margin: 4px 0 6px;
  }

  .detail-meta .hero-bio {
    font-size: 13px;
  }

  .detail-toc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .detail-toc-controls {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .toc-search-input {
    flex: 1;
    min-width: 0;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chapter-item-btn {
    padding: 12px 14px;
  }

  /* Mobile Immersive Reader */
  .reader-toolbar {
    top: 56px;
    padding: 8px 10px;
    gap: 6px;
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .reader-toolbar-left,
  .reader-toolbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .tool-btn,
  .swatch-btn {
    padding: 5px 8px;
    font-size: 12px;
  }

  .reader-article {
    padding: 20px 15px 24px;
    border-radius: 14px;
  }

  .reader-chapter-header {
    padding-bottom: 18px;
    margin-bottom: 20px;
  }

  .reader-chapter-title {
    font-size: 21px;
  }

  .reader-body {
    line-height: 1.92;
  }

  .reader-chapter-footer {
    margin-top: 32px;
    padding-top: 18px;
    gap: 8px;
  }

  .reader-chapter-footer button {
    flex: 1;
    min-height: 42px;
    padding: 8px 10px;
    font-size: 13.5px;
  }

  .toc-drawer {
    width: min(320px, 86vw);
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
