:root {
  --ink: #35483e;
  --muted: #637166;
  --paper: #f8f5ed;
  --white: #fffdf8;
  --rose: #526f5c;
  --teal: #426e7c;
  --line: rgba(67, 91, 73, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Noto Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  line-height: 1.9;
}

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

.reader-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 237, 0.96);
  backdrop-filter: blur(16px);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 28px);
}

.reader-bookmark-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.reader-bookmark-status.is-restored {
  color: var(--teal);
}

.reader-shell {
  display: grid;
  grid-template-columns: 35px minmax(0, 880px);
  gap: clamp(18px, 3vw, 42px);
  align-items: start;
  width: min(100% - 36px, 975px);
  margin: 0 auto;
  padding: clamp(54px, 8vw, 92px) 0;
}

.reader-chapters {
  position: fixed;
  top: 86px;
  left: max(18px, calc((100vw - 975px) / 2));
  display: grid;
  width: 35px;
  max-height: calc(100vh - 112px);
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.reader-chapters[hidden] {
  display: none;
}

.reader-chapters button {
  width: 100%;
  padding: 10px 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: 700 13px/1.35 Inter, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
}

.reader-chapters button:hover {
  color: var(--rose);
  background: rgba(255, 253, 250, 0.7);
}

.reader-chapters button.is-active {
  border-color: rgba(29, 93, 104, 0.22);
  color: var(--teal);
  background: var(--white);
  box-shadow: 0 6px 18px rgba(67, 91, 73, 0.06);
}

.reader-article {
  grid-column: 2;
  min-height: 60vh;
  padding: clamp(28px, 6vw, 72px);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 36px rgba(67, 91, 73, 0.06);
}

.reader-article.is-cover {
  display: grid;
  min-height: min(72vh, 860px);
  place-items: center;
}

.reader-cover-page {
  display: grid;
  width: 100%;
  place-items: center;
}

.reader-cover-page img {
  display: block;
  width: min(100%, 620px);
  height: auto;
  max-height: calc(100vh - 190px);
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 12px 36px rgba(67, 91, 73, 0.08);
}

.reader-cover-empty {
  min-height: 46vh;
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
}

.reader-kicker {
  margin: 0 0 12px;
  color: var(--rose);
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.reader-article h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 66px);
  font-weight: 500;
  line-height: 1.16;
}

.reader-meta {
  margin: 18px 0 42px;
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
}

.reader-content {
  font-size: clamp(18px, 2vw, 22px);
}

.reader-content p {
  margin: 0 0 1.2em;
}

.reader-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  border-radius: 6px;
}

.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4,
.reader-content h5,
.reader-content h6 {
  margin: 1.8em 0 0.75em;
  font-weight: 600;
  line-height: 1.45;
}

.reader-content h1,
.reader-content h2 {
  font-size: 1.45em;
}

.reader-content h3,
.reader-content h4,
.reader-content h5,
.reader-content h6 {
  font-size: 1.15em;
}

.reader-content ul,
.reader-content ol,
.reader-content blockquote {
  margin: 1.2em 0;
}

.reader-content blockquote {
  padding-left: 1.2em;
  border-left: 3px solid rgba(82, 111, 92, 0.4);
  color: var(--muted);
}

.reader-content table {
  display: block;
  max-width: 100%;
  margin: 1.5em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.86em;
}

.reader-content th,
.reader-content td {
  padding: 0.55em 0.75em;
  border: 1px solid var(--line);
}

.reader-status {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.reader-chapter-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.reader-chapter-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
}

.reader-chapter-tools button {
  min-height: 40px;
  padding: 6px 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.reader-chapter-navigation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.reader-chapter-navigation a {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
}

.reader-chapter-navigation a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.reader-chapter-navigation a span {
  font-size: 12px;
}

.reader-chapter-navigation .reader-next-chapter {
  color: var(--white);
  background: var(--teal);
}

.reader-chapter-navigation .reader-next-chapter:hover {
  color: var(--white);
  background: var(--ink);
}

.reader-navigation-note {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.reader-storage-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.7;
}

.reader-chapter-tools button:focus-visible,
.reader-chapter-navigation a:focus-visible,
.reader-chapters button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

.reader-footer {
  width: min(100% - 36px, 975px);
  margin: 0 auto;
  padding: 0 0 36px;
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  text-align: center;
}

.reader-footer a:hover {
  color: var(--rose);
}

@media (max-width: 760px) {
  .reader-bookmark-status {
    max-width: 6em;
    line-height: 1.3;
    text-align: right;
  }

  .reader-shell {
    grid-template-columns: 35px minmax(0, 1fr);
    gap: 8px;
    width: min(100% - 16px, 880px);
    padding-top: 28px;
  }

  .reader-chapters {
    top: 76px;
    left: 8px;
    width: 35px;
    max-height: calc(100vh - 92px);
  }

  .reader-chapters button {
    padding: 9px 4px;
    font-size: 11px;
    text-align: center;
  }

  .reader-article {
    padding: 24px 16px;
  }

  .reader-cover-page img {
    max-height: calc(100vh - 150px);
  }

  .reader-chapter-navigation {
    gap: 6px;
    font-size: 13px;
  }

  .reader-chapter-navigation a {
    padding: 10px 4px;
  }
}
