:root {
  color-scheme: light;
  --ink: #303030;
  --muted: #757575;
  --surface: #f5f5f5;
  --surface-hover: #e9e9e9;
  --control: #5a5a5a;
  --border: #dedede;
  --reader-scale: 1;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
a { color: inherit; }
button, select { font: inherit; }
.shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 120px 0 72px; }
.title-row { min-height: 29px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.zoom-controls { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.zoom-controls button {
  height: 26px; min-width: 24px; border: 0; border-radius: 4px; padding: 2px 7px;
  background: var(--control); color: white; font-size: 12px; font-weight: 700; cursor: pointer;
}
.zoom-controls .reset { width: 66px; }
.zoom-controls button:focus-visible, .book-link:focus-visible, .chapter-link:focus-visible, .nav-button:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.book-nos { margin: 90px 0 22px; text-align: center; font-size: 12px; }
.book-directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; align-items: start; }
.testament { display: flex; flex-direction: column; gap: 4px; }
.testament h2 { margin: 0; min-height: 20px; font-size: 14px; line-height: 20px; text-align: center; }
.book-link {
  min-height: 40px; display: flex; align-items: center; justify-content: center; padding: 8px;
  border-radius: 8px; background: var(--surface); text-decoration: none; text-align: center;
  font-size: calc(16px * var(--reader-scale)); transition: background .15s ease, transform .15s ease;
}
.book-link:hover { background: var(--surface-hover); transform: translateY(-1px); }
.back-link { color: var(--muted); font-size: 13px; text-underline-offset: 3px; }
.page-head { margin-bottom: 34px; }
.page-head .subtitle { margin-top: 8px; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.chapter-link {
  min-height: 46px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; text-decoration: none; font-size: calc(15px * var(--reader-scale));
}
.chapter-link:hover { background: var(--surface); }
.reader-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0; }
.reader-toolbar select { min-height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 34px 0 12px; background: #fff; }
.nav-group { display: flex; gap: 8px; }
.nav-button { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 8px; background: var(--surface); text-decoration: none; }
.nav-button[aria-disabled="true"] { opacity: .42; pointer-events: none; }
.chapter-text {
  margin: 0; border-top: 1px solid var(--border); padding: 32px 0 0; white-space: pre-wrap; overflow-wrap: anywhere;
  font: inherit; font-size: calc(18px * var(--reader-scale)); line-height: 1.9;
}
.empty-state, .restricted-state { margin-top: 28px; padding: 28px; border-radius: 10px; background: var(--surface); text-align: center; color: var(--muted); line-height: 1.7; }
.build-note { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.6; }
@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); padding-top: 48px; }
  .title-row { align-items: center; }
  h1 { font-size: 22px; }
  .book-nos { margin-top: 54px; }
  .book-directory { grid-template-columns: 1fr; gap: 30px; }
  .book-link { min-height: 44px; }
  .chapter-grid { grid-template-columns: repeat(5, 1fr); }
  .reader-toolbar { align-items: stretch; }
  .reader-toolbar select { width: 100%; }
  .nav-group { width: 100%; }
  .nav-button { flex: 1; justify-content: center; }
  .chapter-text { font-size: calc(17px * var(--reader-scale)); line-height: 1.85; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
