:root {
  color-scheme: light;
  --paper: #f7f1e7;
  --paper-deep: #efe3d2;
  --ink: #27231f;
  --muted: #72685f;
  --line: rgba(78, 67, 56, 0.16);
  --panel: rgba(255, 252, 247, 0.86);
  --accent: #2f6f73;
  --accent-dark: #214f53;
  --shadow: 0 18px 44px rgba(70, 54, 38, 0.12);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(247, 241, 231, 0.86), rgba(247, 241, 231, 1)),
    repeating-linear-gradient(90deg, rgba(70, 54, 38, 0.03) 0 1px, transparent 1px 9px);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px 18px 44px;
}

.page-narrow {
  width: min(760px, 100%);
}

.site-header {
  padding: 26px 0 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.site-header h1,
.notice h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 38px;
  line-height: 1.16;
  letter-spacing: 0;
}

.site-header p:not(.eyebrow),
.notice p:not(.eyebrow) {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.bookshelf {
  display: grid;
  gap: 16px;
}

.book-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.book-cover {
  display: grid;
  width: 74px;
  min-height: 108px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
  font-weight: 700;
}

.tone-mist .book-cover {
  background: linear-gradient(160deg, #405f68, #7c8f85);
}

.tone-reef .book-cover {
  background: linear-gradient(160deg, #244a5a, #c08a5a);
}

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

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.book-card h2 {
  margin: 8px 0 4px;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.byline,
.summary,
.loading {
  color: var(--muted);
}

.byline {
  margin: 0;
  font-size: 14px;
}

.summary {
  margin: 12px 0;
  font-size: 15px;
  line-height: 1.72;
}

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(47, 111, 115, 0.24);
  border-radius: 6px;
  background: #fffaf3;
  color: var(--accent-dark);
  cursor: pointer;
}

.chapter-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.chapter-list {
  display: grid;
  gap: 8px;
}

.chapter-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(78, 67, 56, 0.1);
}

.chapter-link span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.chapter-link strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 700;
}

.chapter-link em {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.reader {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 20px 18px 36px;
}

.reader-header {
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.reader-header p {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.reader-header h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

.chapter-content {
  padding: 22px 0 10px;
  font-family: Georgia, "Songti SC", "SimSun", serif;
}

.chapter-content h1,
.chapter-content h2 {
  margin: 1.2em 0 0.7em;
  line-height: 1.35;
  letter-spacing: 0;
}

.chapter-content h1 {
  font-size: 28px;
}

.chapter-content h2 {
  font-size: 22px;
}

.chapter-content p {
  margin: 0 0 1em;
  color: #2c2824;
  font-size: 18px;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.chapter-content hr {
  width: 72px;
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.reader-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.button.secondary,
.button.ghost {
  background: #fffaf3;
  color: var(--accent-dark);
}

.button.disabled {
  border-color: var(--line);
  background: rgba(255, 250, 243, 0.55);
  color: rgba(114, 104, 95, 0.62);
}

.notice {
  margin-top: 52px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

@media (min-width: 760px) {
  .page {
    padding: 46px 28px 64px;
  }

  .site-header h1,
  .notice h1 {
    font-size: 52px;
  }

  .bookshelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .book-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
  }

  .book-cover {
    width: 96px;
    min-height: 142px;
    font-size: 36px;
  }

  .reader {
    padding-top: 38px;
  }

  .reader-header h1 {
    font-size: 38px;
  }
}
