:root {
  --paper: #fffdf9;
  --surface: #ffffff;
  --soft: #f4f6f8;
  --line: #e8e1da;
  --ink: #202124;
  --muted: #6f7379;
  --faint: #9aa0a6;
  --brand: #d93f32;
  --brand-dark: #a92922;
  --teal: #1a7f78;
  --gold: #a97924;
  --shadow: 0 8px 22px rgba(32, 33, 36, .07);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.58;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(217, 63, 50, .55);
  outline-offset: 2px;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 249, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar,
.searchbar,
.sort-strip,
.page,
.reader-shell,
.site-footer {
  width: min(100%, 560px);
  margin: 0 auto;
}

.topbar {
  min-height: 52px;
  padding: 8px 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #ef7a45);
  box-shadow: 0 6px 16px rgba(217, 63, 50, .24);
}

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

.top-link {
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  color: var(--brand);
  font-weight: 700;
}

.top-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-trigger {
  min-height: 38px;
  padding: 0 11px;
  display: none;
  align-items: center;
  gap: 7px;
  border: 1px solid #f1cbc5;
  border-radius: 999px;
  color: var(--brand);
  background: #fff3ef;
  font-size: 14px;
  font-weight: 800;
}

.search-trigger .search-icon {
  width: 14px;
  height: 14px;
}

.reader-page .searchbar {
  display: none;
}

.reader-page .search-trigger {
  display: inline-flex;
}

.search-dialog {
  width: min(calc(100% - 28px), 440px);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 22px 60px rgba(32, 33, 36, .26);
}

.search-dialog::backdrop {
  background: rgba(28, 24, 22, .56);
  backdrop-filter: blur(3px);
}

.search-dialog-card {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fff8f5);
}

.search-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.search-dialog-kicker {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.search-dialog h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.search-dialog-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--soft);
  font-size: 26px;
  line-height: 1;
}

.search-dialog-form {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

.search-dialog-form input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
}

.search-dialog-form button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #e85b40);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(217, 63, 50, .2);
}

.search-dialog-form .search-icon {
  width: 14px;
  height: 14px;
}

.search-dialog-tip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.searchbar {
  padding: 0 14px 10px;
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
}

.searchbar input {
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
}

.searchbar button {
  width: 46px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
}

.search-icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  background: currentColor;
  transform: rotate(45deg);
  border-radius: 2px;
}

.sort-strip {
  padding: 0 14px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sort-strip::-webkit-scrollbar {
  display: none;
}

.sort-strip a {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--soft);
  color: #34383d;
  font-size: 14px;
  white-space: nowrap;
}

.page,
.reader-shell {
  padding: 12px 12px 24px;
}

.hero-panel {
  min-height: 164px;
  display: grid;
  grid-template-columns: 1fr 106px;
  gap: 12px;
  align-items: stretch;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(137, 29, 25, .94), rgba(217, 63, 50, .86)),
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .18), transparent 42%);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.hero-copy p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: 14px;
}

.hero-book {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  text-align: center;
  font-size: 13px;
}

.hero-book img {
  width: 88px;
  height: 118px;
  margin: 0 auto;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 9px 18px rgba(0, 0, 0, .22);
}

.hero-book span,
.hero-book small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-book small {
  color: rgba(255, 255, 255, .72);
}

.section {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.section.tight {
  padding-bottom: 12px;
}

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

.section-head h1,
.section-head h2 {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}

.section-head h2 {
  font-size: 18px;
}

.section-head a,
.section-head span,
.section-head p,
.section-head time {
  margin: 0;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.section-head a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--brand);
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.category-grid a,
.text-links a {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f8f2ef;
  color: #51342d;
  font-weight: 700;
  font-size: 14px;
}

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

.book-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.book-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cover {
  display: block;
  width: 78px;
  height: 104px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
  box-shadow: 0 5px 14px rgba(32, 33, 36, .12);
}

.cover.large {
  width: 104px;
  height: 138px;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.book-meta h2,
.book-meta h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
}

.byline,
.summary,
.latest,
.book-meta time {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.summary {
  margin-top: 6px;
  color: #4d5258;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-link {
  margin-top: 8px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--brand);
  font-weight: 800;
  font-size: 14px;
}

.update-list,
.rank-list,
.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.update-list li,
.rank-list li {
  min-height: 44px;
  display: grid;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.update-list li {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 54px;
}

.update-list li:last-child,
.rank-list li:last-child {
  border-bottom: 0;
}

.update-title,
.update-chapter,
.rank-list a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-title {
  font-weight: 700;
}

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

.update-list time,
.rank-list small {
  color: var(--faint);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.rank-list li {
  grid-template-columns: 28px minmax(0, 1fr) 72px;
}

.rank-list span,
.rank-num {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--soft);
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
}

.rank-list.hot li:nth-child(-n+3) span,
.rank-card:nth-child(-n+3) .rank-num {
  color: #fff;
  background: var(--brand);
}

.rank-card {
  grid-template-columns: 28px 70px 1fr;
}

.rank-card .cover {
  width: 70px;
  height: 94px;
}

.pill-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.pill-tabs::-webkit-scrollbar {
  display: none;
}

.pill-tabs a {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

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

.split-section {
  display: grid;
  gap: 14px;
}

.text-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-links a {
  padding: 0 12px;
}

.crumbs {
  margin: 0 0 10px;
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
}

.crumbs a,
.crumbs span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumbs a {
  color: var(--brand);
  flex: 0 0 auto;
}

.crumbs a::after {
  content: "/";
  margin-left: 7px;
  color: var(--faint);
}

.book-hero {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fff7f4);
  border: 1px solid var(--line);
  overflow: hidden;
}

.book-hero-main {
  min-width: 0;
}

.book-hero-promo {
  grid-column: 1 / -1;
  margin: -14px -14px -14px;
  border-top: 1px solid var(--line);
  background: #fff;
  line-height: 0;
}

.book-hero-promo .qid-sable {
  margin: 0;
}

.book-hero h1 {
  margin: 0 0 5px;
  font-size: 22px;
  line-height: 1.25;
}

.meta-row {
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-row span {
  min-height: 28px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: var(--soft);
  color: #4d5258;
  font-size: 12px;
}

.action-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.primary-btn,
.ghost-btn,
.chapter-nav a,
.chapter-nav button,
.reader-tools button,
.form-panel button,
.case-item button {
  min-height: 44px;
  border-radius: 8px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.primary-btn {
  flex: 1 1 auto;
  color: #fff;
  background: var(--brand);
}

.ghost-btn {
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--brand);
  background: #fff1ed;
}

.intro-text p {
  margin: 0 0 10px;
  color: #3f444a;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

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

.chapter-grid a {
  min-height: 42px;
  padding: 10px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: var(--soft);
  color: #30343a;
  font-size: 14px;
  overflow: hidden;
}

.chapter-grid.compact a {
  background: #fff5f1;
}

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

.comment-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
}

.comment-list img {
  border-radius: 50%;
  background: var(--soft);
}

.comment-list strong {
  font-size: 14px;
}

.comment-list time {
  margin-left: 8px;
  color: var(--faint);
  font-size: 12px;
}

.comment-list p {
  margin: 3px 0 0;
  color: #4d5258;
  font-size: 14px;
}

.pager {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pager a,
.pager strong {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.pager strong {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.notice,
.empty-state {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.form-panel {
  display: grid;
  gap: 10px;
}

.form-panel label {
  color: #34383d;
  font-weight: 700;
  font-size: 14px;
}

.form-panel input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.form-panel button {
  margin-top: 4px;
  color: #fff;
  background: var(--brand);
}

.case-list {
  display: grid;
  gap: 10px;
}

.case-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.case-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.case-cover {
  width: 72px;
  height: 96px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--soft);
  box-shadow: 0 5px 14px rgba(32, 33, 36, .13);
}

.case-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-main {
  min-width: 0;
}

.case-item h2 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.35;
}

.case-item h2 a,
.case-item p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.case-item .case-author {
  margin-top: 2px;
  color: var(--faint);
}

.case-continue {
  min-height: 32px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
}

.case-item .case-remove {
  min-height: 36px;
  padding: 0 9px;
  color: var(--brand);
  background: #fff1ed;
  font-size: 13px;
}

.reader-page {
  --reader-bg: #fbf6ee;
  --reader-text: #29231f;
  background: var(--reader-bg);
}

@font-face {
  font-family: "QID Reader Shield";
  src: url("../fonts/qid-reader-shield-sans-v2.woff2") format("woff2");
  font-display: block;
  font-style: normal;
  font-weight: 400;
  /* Only map the 97 PUA codepoints produced by readerprotect.Obfuscate */
  unicode-range: U+E000-E060;
}

.reader-shell {
  padding-top: 10px;
}

.reader-article {
  border: 1px solid #e6d9c9;
  border-radius: 8px;
  background: #fffaf1;
  overflow: hidden;
}

.reader-head {
  padding: 16px 14px 12px;
  border-bottom: 1px solid #eadfce;
  text-align: center;
}

.reader-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.35;
}

.reader-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.reader-tools {
  margin: 0 0 6px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: rgba(255, 246, 232, .82);
}

.reader-tools button {
  min-width: 0;
  min-height: 32px;
  padding: 0 4px;
  color: #5d4037;
  background: #fff;
  border: 1px solid #eadfce;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.reader-tools button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 6px 14px rgba(217, 63, 50, .18);
}

.reader-tools #eyeBtn[aria-pressed="true"] {
  border-color: #668452;
  background: #668452;
  box-shadow: 0 6px 14px rgba(75, 105, 58, .2);
}

.content-body {
  padding: 18px 16px 24px;
  color: var(--reader-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: var(--reader-font-size, 18px);
  line-height: var(--reader-line-height, 1.9);
}

.content-body.reader-text-protected {
  font-family: "QID Reader Shield", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

.content-body p {
  margin: 0 0 1em;
}

.reader-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.chapter-nav {
  width: min(100%, 440px);
  margin: 6px auto 10px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 3px 10px rgba(32, 33, 36, .05);
}

.chapter-nav a,
.chapter-nav button {
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  color: var(--brand-dark);
  background: #fff3ef;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.chapter-nav a:nth-child(2),
.chapter-nav button:nth-child(2) {
  color: #4d5258;
  background: var(--soft);
}

.chapter-nav a:hover,
.chapter-nav button:not([disabled]):hover {
  color: #fff;
  background: var(--brand);
}

.chapter-nav button[disabled] {
  cursor: default;
  opacity: 0.55;
}

body.reader-dark {
  --reader-bg: #161719;
  --reader-text: #d6d0c5;
  background: var(--reader-bg);
  color: #d6d0c5;
}

body.reader-dark .site-top,
body.reader-dark .reader-article,
body.reader-dark .section,
body.reader-dark .site-footer,
body.reader-dark .chapter-nav a,
body.reader-dark .chapter-nav button {
  background: #202225;
  border-color: #34383d;
}

body.reader-dark .reader-tools {
  background: #25282c;
}

body.reader-dark .reader-tools button,
body.reader-dark .searchbar input,
body.reader-dark .sort-strip a {
  background: #2d3035;
  border-color: #3d4248;
  color: #e5ded4;
}

body.reader-dark .reader-head,
body.reader-dark .book-card,
body.reader-dark .rank-list li {
  border-color: #34383d;
}

body.reader-dark .chapter-nav {
  border-color: #34383d;
  background: #25282c;
  box-shadow: none;
}

body.reader-dark .reader-tools button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

body.reader-eye {
  --reader-bg: #e9f0df;
  --reader-text: #263424;
  background: var(--reader-bg);
}

body.reader-eye .site-top,
body.reader-eye .reader-article,
body.reader-eye .section,
body.reader-eye .site-footer {
  border-color: #cbd8bd;
  background: #f3f7ed;
}

body.reader-eye .reader-head {
  border-color: #d4dfc8;
}

body.reader-eye .reader-tools {
  background: #e2ecd7;
}

body.reader-eye .reader-tools button,
body.reader-eye .chapter-nav a,
body.reader-eye .chapter-nav button {
  color: #405438;
  border-color: #c3d2b4;
  background: #f7faf3;
}

body.reader-eye .chapter-nav {
  border-color: #c3d2b4;
  background: rgba(235, 243, 226, .92);
  box-shadow: 0 5px 16px rgba(66, 88, 54, .08);
}

body.reader-eye .chapter-nav a:hover,
body.reader-eye .chapter-nav button:not([disabled]):hover,
body.reader-eye .reader-tools #eyeBtn[aria-pressed="true"] {
  color: #fff;
  border-color: #668452;
  background: #668452;
}

.site-footer {
  padding: 18px 14px 28px;
  color: var(--muted);
  text-align: center;
}

.back-top {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.footer-brand,
.footer-note {
  margin: 0;
  font-size: 13px;
}

.footer-links {
  margin: 8px 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-links a {
  color: var(--brand);
}

.stat-code {
  display: none;
}

.error-panel,
.utility-panel {
  margin-top: 4px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fff9f6);
  box-shadow: var(--shadow);
}

.error-kicker,
.utility-kicker {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.error-kicker span {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: .08em;
}

.error-panel h1,
.utility-panel h1 {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.3;
}

.error-panel > p:not(.error-kicker),
.utility-message {
  margin: 0 0 16px;
  color: var(--muted);
}

.error-search {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 8px;
}

.error-search input,
.captcha-row input {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.error-search button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.utility-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.utility-actions .primary-btn,
.utility-actions .ghost-btn {
  min-width: 0;
  text-align: center;
}

.compact-books .book-card {
  grid-template-columns: 70px 1fr;
}

.compact-books .cover {
  width: 70px;
  height: 94px;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
}

.captcha-image {
  position: relative;
  width: 120px;
  height: 50px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
}

.captcha-image img {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--soft);
}

.captcha-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
  background: var(--soft);
}

.captcha-image.is-placeholder img {
  visibility: hidden;
}

.captcha-image.is-placeholder .captcha-placeholder {
  display: flex;
}

.captcha-image:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.captcha-form .captcha-refresh {
  margin-top: 0;
  color: var(--brand);
  border: 1px solid #f1cbc5;
  background: #fff1ed;
}

.interval-count {
  margin: 4px 0 14px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
}

.interval-count strong {
  color: var(--brand);
  font-size: 20px;
}

.qid-sable {
  box-sizing: border-box;
  width: 100%;
  margin: 12px 0;
}

.qid-sable {
  overflow: hidden;
  text-align: center;
}

.qid-sable iframe,
.qid-sable img {
  max-width: 100% !important;
}

@media (min-width: 561px) {
  body {
    background:
      linear-gradient(90deg, #f1f3f5 0, #f1f3f5 calc((100% - 560px) / 2), var(--paper) calc((100% - 560px) / 2), var(--paper) calc((100% + 560px) / 2), #f1f3f5 calc((100% + 560px) / 2));
  }
}

@media (max-width: 360px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-book {
    grid-template-columns: 56px 1fr;
    text-align: left;
    align-items: center;
  }

  .hero-book img {
    width: 56px;
    height: 74px;
    grid-row: span 2;
  }

  .chapter-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .reader-tools {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .case-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }

  .case-cover {
    width: 64px;
    height: 86px;
  }

  .case-item .case-remove {
    grid-column: 2;
    justify-self: start;
    min-height: 32px;
    margin-top: -2px;
  }
}

@media (max-width: 560px) {
  .reader-tools button {
    min-height: 32px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
