:root {
  color-scheme: light;
  --bg: #07111f;
  --bg-soft: #10233d;
  --surface: rgba(11, 25, 44, 0.82);
  --surface-strong: #0e2036;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(168, 191, 221, 0.22);
  --text: #eef4ff;
  --text-soft: #bfd0ea;
  --muted: #88a0c2;
  --primary: #ff8b61;
  --primary-strong: #ff6f3d;
  --accent: #6ec5ff;
  --gold: #ffd27a;
  --shadow: 0 24px 60px rgba(1, 9, 20, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --reader-text: #e8edf5;
  --reader-surface: rgba(12, 19, 31, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(110, 197, 255, 0.12), transparent 24%),
    radial-gradient(circle at left top, rgba(255, 139, 97, 0.16), transparent 28%),
    linear-gradient(180deg, #10213a 0%, #09101b 48%, #07111f 100%);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

img {
  display: block;
  width: 100%;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  color: inherit;
  background: none;
}

.app,
.reader-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.app {
  padding: 20px 0 36px;
}

.reader-shell {
  padding: 24px 0 36px;
}

.shell-card,
.page-header,
.detail,
.journey-card,
.reader-content {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar,
.page-header,
.detail,
.journey-card,
.reader-content,
.highlight-card,
.book-card,
.list-item,
.stat-card,
.empty,
.reader-theme {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar,
.page-header,
.detail,
.journey-card,
.empty {
  background: var(--surface);
  border-radius: var(--radius-xl);
}

.topbar {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.brand-block,
.page-header-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.brand {
  display: grid;
  gap: 4px;
}

.brand h1,
.hero-text h2,
.detail-info h3,
.page-header h2,
.reader-toolbar h2,
.home-intro h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  letter-spacing: -0.03em;
}

.brand h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.brand span,
.page-header p,
.detail-info p,
.highlight-card p,
.list-item small,
.hero-text p,
.home-intro p,
.journey-card p,
.empty p {
  color: var(--text-soft);
  line-height: 1.6;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
}

.utility-row {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.lang-label {
  font-size: 0.76rem;
  color: var(--text-soft);
  text-align: right;
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.lang-switch button {
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-soft);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-switch button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.search {
  position: relative;
}

.search span {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

.search input:focus {
  border-color: rgba(255, 139, 97, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 139, 97, 0.16);
}

.section {
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header h3 {
  margin: 0;
  font-size: 1.18rem;
}

.section-header a {
  color: var(--accent);
  font-size: 0.92rem;
}

.hero {
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.hero-track {
  display: flex;
  transition: transform 0.45s ease;
}

.hero-slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 139, 97, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(6, 18, 33, 0.78), rgba(16, 35, 61, 0.95));
}

.hero-text h2 {
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1.08;
  margin-bottom: 8px;
  max-width: 12ch;
}

.hero-text .eyebrow {
  margin-bottom: 8px;
}

.hero-text p {
  font-size: 0.92rem;
  margin: 0 0 12px;
  max-width: 34ch;
}

.cta,
.btn,
.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cta,
.btn.primary,
.card-action {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.cta:hover,
.btn.primary:hover,
.card-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(255, 111, 61, 0.3);
}

.hero-cover-frame,
.cover-frame {
  display: block;
  padding: 8px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
}

.hero-image,
.detail-cover img {
  border-radius: var(--radius-lg);
  aspect-ratio: 3 / 4.2;
  object-fit: cover;
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px 12px;
}

.hero-dots button {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.hero-dots button.active {
  width: 28px;
  background: var(--primary);
}

.home-intro {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.home-intro h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  margin-bottom: 6px;
}

.home-intro p {
  margin: 0;
  font-size: 0.94rem;
}

.stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat-card,
.highlight-card,
.journey-step {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.stat-card {
  display: grid;
  gap: 6px;
  align-content: center;
}

.stat-card strong {
  font-size: 1.35rem;
  color: #fff;
}

.stat-card span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.book-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.book-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 139, 97, 0.32);
}

.book-card-link {
  display: block;
}

.book-cover {
  aspect-ratio: 3 / 4.2;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.book-card h4 {
  margin: 0 0 4px;
  font-size: 0.94rem;
}

.book-card span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.rating {
  margin-top: 8px;
  color: var(--gold);
  font-size: 0.8rem;
}

.card-action {
  width: 100%;
}

.category-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-row::-webkit-scrollbar {
  height: 5px;
}

.category-chip {
  flex: 0 0 auto;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.category-chip.active,
.category-chip:hover {
  color: #fff;
  background: rgba(110, 197, 255, 0.16);
  border-color: rgba(110, 197, 255, 0.34);
}

.highlight,
.cards-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.highlight-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.page-header {
  padding: 20px;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 6px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
  margin-bottom: 24px;
}

.detail-cover {
  align-self: start;
}

.detail-info .meta {
  margin: 12px 0;
  color: var(--text-soft);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

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

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--card);
}

.list-item span {
  color: var(--accent);
  font-weight: 700;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 30px 20px;
  margin-bottom: 18px;
}

.empty h3 {
  margin: 0;
}

.reader-page {
  background:
    radial-gradient(circle at top right, rgba(110, 197, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #0b1524, #050c17);
  color: var(--reader-text);
}

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

.reader-toolbar h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-top: 10px;
}

.reader-toolbar p {
  color: var(--text-soft);
}

.back-link {
  display: inline-block;
  color: var(--accent);
  font-size: 0.95rem;
}

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

.reader-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--reader-text);
  font-size: 0.88rem;
  line-height: 1;
}

.reader-theme.active {
  background: rgba(255, 139, 97, 0.18);
  border-color: rgba(255, 139, 97, 0.38);
}

.reader-content {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--reader-surface);
  line-height: 1.95;
  font-size: 18px;
}

.reader-content p {
  margin: 0 0 18px;
}

.reader-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.journey-card {
  padding: 20px;
}

.journey-steps {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 16px;
}

.journey-step {
  display: grid;
  gap: 8px;
}

.journey-step span {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.site-footer {
  margin: 8px 0 12px;
  padding: 12px 4px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.reader-footer {
  margin-top: 18px;
  color: rgba(232, 237, 245, 0.68);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(7, 17, 31, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 40;
}

.bottom-nav a {
  padding: 10px 8px;
  text-align: center;
  color: var(--muted);
  border-radius: 14px;
  font-size: 0.82rem;
}

.bottom-nav a.active,
.bottom-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.inline-switch {
  padding: 4px;
}

.inline-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 46px;
  padding: 7px 10px;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reader-page[data-theme="light"] {
  --reader-text: #10223b;
  --reader-surface: rgba(255, 255, 255, 0.93);
  background: linear-gradient(180deg, #eff5fb, #dfe8f4);
}

.reader-page[data-theme="sepia"] {
  --reader-text: #4b3424;
  --reader-surface: rgba(250, 242, 228, 0.95);
  background: linear-gradient(180deg, #efe1cd, #e0cfb6);
}

@media (max-width: 820px) {
  .hero-slide,
  .home-intro,
  .detail {
    grid-template-columns: 1fr;
  }

  .brand-block,
  .page-header-top,
  .reader-toolbar {
    flex-direction: column;
  }

  .utility-row {
    justify-items: start;
  }

  .lang-label {
    text-align: left;
  }

  .hero-slide {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .hero-text h2,
  .hero-text p {
    max-width: none;
  }
}

@media (max-width: 600px) {
  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .app,
  .reader-shell {
    width: min(100% - 24px, 1120px);
  }

  .topbar,
  .page-header,
  .detail,
  .journey-card,
  .reader-content {
    padding: 16px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .brand h1 {
    font-size: 1.55rem;
  }

  .brand span {
    font-size: 0.9rem;
  }

  .hero {
    margin-bottom: 14px;
  }

  .hero-slide {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 12px;
    padding: 14px;
  }

  .hero-text .eyebrow {
    font-size: 0.66rem;
    margin-bottom: 6px;
  }

  .hero-text h2 {
    font-size: 1.18rem;
    margin-bottom: 6px;
  }

  .hero-text p {
    font-size: 0.84rem;
    margin-bottom: 10px;
  }

  .hero-cover-frame {
    padding: 6px;
    align-self: center;
  }

  .cta {
    width: auto;
    min-width: 0;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .home-intro {
    padding: 14px;
    gap: 12px;
  }

  .home-intro h2 {
    font-size: 1.08rem;
  }

  .home-intro p {
    font-size: 0.86rem;
  }

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

  .stat-card {
    padding: 12px 10px;
  }

  .stat-card strong {
    font-size: 1.1rem;
  }

  .stat-card span {
    font-size: 0.74rem;
  }

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

  .detail-actions,
  .reader-nav {
    flex-direction: column;
  }

  .btn,
  .card-action,
  .cta {
    width: 100%;
  }

  .reader-toolbar {
    gap: 12px;
  }

  .controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .reader-theme {
    min-width: 0;
    width: 100%;
    padding: 8px 0;
    font-size: 0.84rem;
  }

  .inline-switch {
    grid-column: span 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-switch button {
    width: 100%;
    min-width: 0;
  }
}
