:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-soft: #faf8f3;
  --text: #241f1a;
  --muted: #71685f;
  --line: #e6ddd2;
  --brand: #b7692f;
  --brand-deep: #8e4f1f;
  --shadow: 0 12px 36px rgba(48, 31, 12, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  background: linear-gradient(180deg, #f7f2ea 0%, #f0ece5 100%);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: transparent;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.site-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 20px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(182, 162, 141, 0.22);
}

.topbar__eyebrow,
.section-head__eyebrow,
.profile-card__eyebrow,
.hero-panel__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.topbar__title,
.section-head h2,
.hero-panel h2,
.detail-hero h2,
.reader-article h2,
.empty-card h2,
.locked-reader h2,
.vip-card h2,
.profile-card h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
}

.topbar__subtitle,
.detail-hero__meta,
.detail-hero__intro,
.reader-article__head p,
.vip-card p,
.profile-card p,
.notice-card p,
.empty-card p,
.locked-reader p,
.hero-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.topbar__action,
.text-link {
  color: var(--brand-deep);
  font-weight: 600;
}

.page-body {
  padding: 16px 16px 0;
}

.page-body--reader {
  padding-inline: 0;
}

.hero-panel,
.notice-card,
.profile-card,
.vip-card,
.empty-card,
.detail-hero,
.reader-article,
.locked-reader {
  background: var(--surface);
  border: 1px solid rgba(197, 177, 156, 0.34);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(250, 194, 131, 0.38), transparent 34%),
    linear-gradient(135deg, #fff8ee, #fffef9);
}

.hero-panel__actions,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.section-block {
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-pills,
.tag-row,
.vip-benefits {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-pills {
  margin-top: 16px;
}

.category-quick-nav {
  position: sticky;
  top: 82px;
  z-index: 8;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -2px 18px;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.category-quick-nav::-webkit-scrollbar {
  display: none;
}

.category-quick-nav__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.92);
  border: 1px solid rgba(197, 177, 156, 0.42);
  box-shadow: 0 10px 24px rgba(48, 31, 12, 0.06);
  color: var(--brand-deep);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(183, 105, 47, 0.1);
  color: var(--brand-deep);
  font-size: 0.86rem;
}

.tag {
  min-height: 28px;
  background: rgba(80, 54, 26, 0.07);
  color: #6d5138;
}

.book-grid {
  display: grid;
  gap: 12px;
}

.book-card,
.rank-item,
.chapter-item,
.menu-item,
.plan-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.book-card {
  grid-template-columns: 92px minmax(0, 1fr);
}

.book-card__cover {
  display: block;
}

.book-card__content {
  min-width: 0;
}

.book-card__title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
}

.book-card__meta,
.book-card__intro,
.book-card__footer,
.rank-item__body p,
.chapter-item p,
.menu-item span,
.plan-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.book-card__intro {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 8px;
}

.book-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  padding: 12px;
  border-radius: 16px;
  color: #fffef9;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.cover::after {
  content: "";
  position: absolute;
  inset: auto -24px -28px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.cover--compact {
  min-height: 136px;
}

.cover__badge {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.72rem;
}

.cover__title,
.cover__meta {
  position: relative;
  z-index: 1;
}

.cover__title {
  font-size: 1.1rem;
  line-height: 1.35;
}

.cover__meta {
  font-size: 0.78rem;
  opacity: 0.88;
}

.cover--ember { background: linear-gradient(160deg, #4f1c09, #b75b1d 58%, #f0a562); }
.cover--jade { background: linear-gradient(160deg, #0f403a, #267a68 58%, #7ac0a4); }
.cover--navy { background: linear-gradient(160deg, #0f2340, #2d4f82 58%, #6b94d1); }
.cover--gold { background: linear-gradient(160deg, #5a3c0a, #aa6b1f 58%, #ecc273); }
.cover--rose { background: linear-gradient(160deg, #5c2135, #a84e72 58%, #ebb3c7); }
.cover--violet { background: linear-gradient(160deg, #35205e, #6a49a3 58%, #b39ce8); }
.cover--ink { background: linear-gradient(160deg, #20242c, #485463 58%, #95a0b0); }
.cover--cyan { background: linear-gradient(160deg, #0b4558, #1e7891 58%, #71cad8); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c77a36, #a95f26);
  color: #fff;
  font-weight: 700;
}

.button--ghost {
  background: rgba(183, 105, 47, 0.08);
  color: var(--brand-deep);
}

.button--small {
  min-height: 36px;
  padding-inline: 14px;
  font-size: 0.88rem;
}

.rank-list,
.chapter-list,
.menu-list,
.plan-grid {
  display: grid;
  gap: 10px;
}

.rank-item {
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
}

.rank-item__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(183, 105, 47, 0.12);
  color: var(--brand-deep);
  font-weight: 800;
}

.notice-card,
.profile-card,
.vip-card,
.empty-card,
.locked-reader {
  padding: 18px;
}

.detail-hero {
  padding: 16px;
}

.detail-hero__cover {
  margin-bottom: 16px;
}

.detail-hero__meta {
  font-size: 0.92rem;
}

.chapter-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.chapter-item.is-locked {
  background: linear-gradient(180deg, #fffaf4, #f8f2ea);
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.search-box__input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.menu-item {
  color: inherit;
}

.menu-item strong {
  font-size: 1rem;
}

.menu-item--button {
  text-align: left;
}

.vip-benefits span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8ece0;
}

.vip-card {
  background: linear-gradient(145deg, #2f1a0f, #7b3e1d);
  color: #fff;
}

.vip-card p,
.vip-card h2,
.vip-card .profile-card__eyebrow {
  color: inherit;
}

.tab-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.tab-strip__item {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(183, 105, 47, 0.08);
  color: var(--brand-deep);
  display: inline-flex;
  align-items: center;
}

.tab-strip__item.is-active {
  background: linear-gradient(135deg, #c77a36, #a95f26);
  color: #fff;
}

.reader-article {
  padding: 22px 18px 26px;
  border-radius: 0;
  box-shadow: none;
  border-inline: 0;
  border-top: 0;
}

.reader-article__head {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reader-book-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  line-height: 1.35;
  font-weight: 700;
  color: #221b14;
}

.reader-book-meta,
.reader-chapter-meta {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

.reader-chapter-meta {
  margin-top: 8px;
}

.reader-article p {
  margin: 0 0 14px;
  font-size: 1.02rem;
  line-height: 1.9;
  color: #3c332b;
}

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

.reader-lock {
  margin-top: 24px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8ee, #fffef9);
  border: 1px solid rgba(183, 105, 47, 0.18);
}

.reader-lock p {
  margin-top: 8px;
  font-size: 0.92rem;
}

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  min-height: var(--nav-height);
  padding: 10px;
  border-radius: 24px;
  background: rgba(28, 24, 20, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.bottom-nav__item {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: rgba(255, 245, 236, 0.7);
  font-size: 0.82rem;
}

.bottom-nav__item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(27, 19, 10, 0.36);
}

.modal-card {
  position: relative;
  width: min(100%, 520px);
  padding: 20px;
  border-radius: 24px;
  background: #fffefb;
  box-shadow: 0 20px 44px rgba(28, 17, 4, 0.18);
}

.modal-card__eyebrow,
.modal-card__text {
  margin: 0;
  color: var(--muted);
}

.modal-card__close {
  position: absolute;
  top: 16px;
  right: 16px;
  min-width: 52px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(80, 54, 26, 0.08);
  color: #6d5138;
  font-size: 0.82rem;
}

.modal-card__title {
  margin: 10px 0 0;
  font-size: 1.22rem;
}

.modal-card__text {
  margin-top: 10px;
  line-height: 1.7;
}

.modal-card__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.purchase-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8ee, #fffef9);
  border: 1px solid rgba(197, 177, 156, 0.34);
}

.purchase-summary__label,
.purchase-summary__hint {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.purchase-summary__value {
  display: block;
  margin-top: 6px;
  color: var(--brand-deep);
  font-size: 1.42rem;
}

.purchase-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.purchase-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.purchase-option.is-selected {
  border-color: rgba(183, 105, 47, 0.56);
  background: rgba(183, 105, 47, 0.08);
}

.purchase-option__body {
  min-width: 0;
}

.purchase-option__title,
.purchase-option__desc {
  margin: 0;
}

.purchase-option__title {
  display: block;
  font-size: 0.98rem;
}

.purchase-option__desc {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.purchase-option__price {
  color: var(--brand-deep);
  font-weight: 700;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 36px);
  transform: translateX(-50%);
  z-index: 35;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(35, 25, 12, 0.92);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
}

@media (min-width: 720px) {
  .site-shell {
    max-width: 680px;
    margin: 0 auto;
  }

  .detail-hero {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .detail-hero__cover {
    margin-bottom: 0;
  }
}
