:root {
  --paper: #f5f2ec;
  --surface: #fffdf8;
  --ink: #263a33;
  --muted: #7d847d;
  --line: #e2e3da;
  --accent: #31594a;
  --accent-light: #e6ede4;
  --reader-bg: #f8f5ee;
  --reader-ink: #302e29;
  --read-size: 20px;
  --read-line: 1.8;
  --read-width: 760px;
  --read-gap: 1em;
  --read-font: system-ui;
  --read-align: left;
  --read-indent: 2em;
  font-family: Inter, "Segoe UI", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #92ad87;
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
  color: inherit;
}
a {
  color: var(--accent);
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  letter-spacing: -0.04em;
}
small,
.muted {
  color: var(--muted);
}
.boot {
  padding: 25vh 20px;
  text-align: center;
}
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  border-right: 1px solid var(--line);
  padding: 34px 24px;
  display: flex;
  flex-direction: column;
  background: #efeee7;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 0;
  margin: 0 0 46px;
}
.brand img {
  width: 36px;
  height: 36px;
}
.brand strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 19px;
  letter-spacing: -0.5px;
}
.brand span {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
}
.nav-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #899087;
  margin: 8px 14px 14px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 3px 0;
  font-size: 14px;
  text-align: left;
  color: #68746b;
}
.nav-item.active {
  background: #dce5d9;
  color: var(--ink);
  font-weight: 650;
}
.nav-item:hover {
  background: #e1e5da;
}
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dde5d7;
  font-size: 14px;
}
.profile strong {
  font-size: 12px;
}
.profile small {
  font-size: 10px;
}
.page {
  padding: 0 5.4vw 60px;
  max-width: 1550px;
  width: 100%;
  margin: auto;
}
.topbar {
  height: 90px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.topbar .crumb {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.topbar .crumb b {
  color: var(--ink);
  font-weight: 500;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.btn.secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.ghost {
  background: none;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn.danger {
  background: #975247;
}
.icon-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 7px;
  border: 1px solid transparent;
}
.icon-btn:hover {
  background: var(--accent-light);
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 25px;
  padding: 42px 0 28px;
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.7px;
  margin-bottom: 12px;
}
.intro h1 {
  font-size: 32px;
  font-weight: 650;
  margin-bottom: 12px;
}
.intro p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.8;
}
.stats {
  display: flex;
  gap: 32px;
  padding-bottom: 5px;
}
.stat strong {
  display: block;
  font-size: 26px;
  font-family: Georgia, serif;
  font-weight: 400;
}
.stat small {
  font-size: 11px;
}
.continue {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 200px;
  padding: 24px 32px;
  border: 1px solid #d8dfd1;
  border-radius: 12px;
  background: #e8eddf;
  margin-bottom: 36px;
  overflow: hidden;
  position: relative;
}
.continue:after {
  content: "";
  position: absolute;
  right: 10%;
  top: -160px;
  width: 380px;
  height: 380px;
  border: 1px solid #d5decb;
  border-radius: 50%;
  pointer-events: none;
}
.continue .mini-cover {
  width: 107px;
  height: 150px;
  margin: auto;
  transform: rotate(-7deg);
  box-shadow: 6px 9px 12px #213c3522;
}
.continue .eyebrow {
  font-size: 9px;
}
.continue h2 {
  font-family: Georgia, "Noto Serif TC", "PMingLiU", serif;
  font-size: 25px;
  margin-bottom: 10px;
}
.continue p {
  font-size: 12px;
  color: #75826e;
  line-height: 1.8;
  max-width: 500px;
  margin-bottom: 12px;
}
.continue .btn {
  position: relative;
  z-index: 1;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.section-heading h2 {
  font-size: 18px;
  letter-spacing: 0.5px;
  margin: 0;
}
.section-heading small {
  margin-left: 10px;
  font-size: 11px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.chip {
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 25px;
  font-size: 12px;
  color: var(--muted);
}
.chip.active {
  background: var(--ink);
  color: var(--surface);
}
.tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0 12px;
  border-radius: 7px;
  max-width: 290px;
  width: 100%;
}
.search-field svg {
  width: 16px;
  color: var(--muted);
}
.search-field input {
  height: 42px;
  border: 0;
  outline: 0;
  background: none;
  min-width: 0;
  width: 100%;
  font-size: 12px;
  color: var(--ink);
}
.select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  max-width: 160px;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.book-card {
  min-width: 0;
}
.cover-wrap {
  display: flex;
  width: 100%;
  padding: 26px 22px;
  background: #ebe9e1;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  min-height: 255px;
  position: relative;
  overflow: hidden;
}
.cover-wrap:hover .book-cover {
  transform: translateY(-5px) rotate(-1deg);
}
.book-cover {
  height: 210px;
  aspect-ratio: 0.69;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cover, #39534b);
  color: #fff7e8;
  box-shadow:
    3px 5px 0 #10271c33,
    8px 12px 18px #242b2420;
  overflow: hidden;
  transition: transform 0.25s;
  border-radius: 1px 4px 4px 1px;
  padding: 20px 14px;
}
.book-cover:before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid #fff4d02e;
  pointer-events: none;
}
.book-cover:after {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  border-left: 1px solid #ffffff24;
  box-shadow: 2px 0 2px #0003;
  pointer-events: none;
}
.book-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-number {
  font-size: 8px;
  letter-spacing: 3px;
  opacity: 0.55;
  margin-bottom: 16px;
}
.cover-title {
  font-family: Georgia, "PMingLiU", serif;
  font-size: 23px;
  line-height: 1.4;
  letter-spacing: 5px;
  writing-mode: vertical-rl;
  max-height: 135px;
  position: relative;
}
.cover-author {
  font-family: serif;
  letter-spacing: 3px;
  font-size: 8px;
  opacity: 0.6;
  margin-top: 16px;
}
.mini-cover .cover-title {
  font-size: 19px;
  letter-spacing: 4px;
}
.mini-cover .cover-number,
.mini-cover .cover-author {
  display: none;
}
.cover-wrap .badge {
  position: absolute;
  right: 12px;
  top: 12px;
}
.badge {
  font-size: 10px;
  background: #fffc;
  padding: 5px 8px;
  border-radius: 4px;
  color: #6b7c66;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  line-height: 1.4;
}
.badge.original {
  color: #987758;
  background: #f7eddf;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 17px;
  gap: 5px;
}
.card-title h3 {
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
  letter-spacing: 0.5px;
}
.card-title .icon-btn {
  margin-top: -9px;
  margin-right: -9px;
  color: var(--muted);
}
.book-card p {
  font-size: 11px;
  color: var(--muted);
  margin: 3px 0 12px;
  line-height: 1.8;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #92978e;
  gap: 8px;
}
.progress-track {
  height: 3px;
  background: #e1e4d9;
  border-radius: 2px;
  overflow: hidden;
  margin: 13px 0 9px;
}
.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: #879b75;
}
.library-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 45px 0 0;
  font-size: 10px;
  color: #99a091;
  letter-spacing: 2px;
}
.empty {
  grid-column: 1/-1;
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.empty h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 20px 0 10px;
  color: var(--ink);
}
.empty p {
  font-size: 13px;
  line-height: 1.8;
}
.mobile-brand,
.mobile-nav {
  display: none;
}
.login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100dvh;
}
.login-art {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: flex-start;
  padding: 10vw;
  background: #213c35;
  color: #eeeede;
  position: relative;
  overflow: hidden;
}
.login-art:after {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border: 1px solid #ffffff18;
  border-radius: 50%;
  left: 25%;
  top: 35%;
}
.login-art img {
  width: 52px;
  margin-bottom: 60px;
}
.login-art .eyebrow {
  color: #afc6a1;
}
.login-art h1 {
  font-family: Georgia, "PMingLiU", serif;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 7px;
  font-size: 38px;
}
.login-art p {
  color: #a7b8a6;
  line-height: 2;
  font-size: 13px;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form form {
  max-width: 340px;
  width: 100%;
}
.login-form h2 {
  font-size: 26px;
  margin: 14px 0;
}
.login-form p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0;
  font-size: 12px;
  color: var(--muted);
}
.field input,
.field textarea,
.field select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 46px;
  border-radius: 6px;
  padding: 11px 12px;
  width: 100%;
}
.field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.8;
}
.field .check {
  width: auto;
  min-height: 20px;
}
.full {
  width: 100%;
}
.error {
  color: #a24e3c;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.hint {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
}
.detail-header {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 38px;
  margin: 40px 0;
}
.detail-header .book-cover {
  height: 260px;
}
.detail-header h1 {
  font-family: Georgia, "PMingLiU", serif;
  font-weight: 500;
  font-size: 31px;
  margin: 15px 0;
}
.detail-header p {
  line-height: 1.9;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}
.meta-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0 20px;
}
.tag {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 10px;
  color: var(--muted);
}
.toc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 30px;
}
.toc-row {
  border-bottom: 1px solid var(--line);
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 13px 7px;
  gap: 12px;
  font-size: 12px;
  min-height: 49px;
}
.toc-row.current {
  background: var(--accent-light);
  border-radius: 5px;
  color: var(--accent);
}
.toc-row small {
  font-size: 10px;
  flex-shrink: 0;
}
.toc-group {
  margin: 10px 0 18px;
}
.toc-group summary {
  padding: 14px 7px;
  font-weight: 650;
  font-size: 12px;
  cursor: pointer;
}
.reader {
  background: var(--reader-bg);
  color: var(--reader-ink);
  min-height: 100dvh;
  padding-bottom: 130px;
}
.reader-tools {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--reader-bg);
  border-bottom: 1px solid #8882;
  z-index: 10;
  transition: transform 0.2s;
  padding: env(safe-area-inset-top) 22px 0;
}
.reader-top {
  max-width: 1100px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
  gap: 15px;
}
.reader-top .reader-label {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 50vw;
  color: inherit;
  opacity: 0.6;
}
.reader .icon-btn:hover {
  background: #8882;
}
.reader-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 18px calc(8px + env(safe-area-inset-bottom));
  background: var(--reader-bg);
  border-top: 1px solid #8882;
  z-index: 10;
  transition: transform 0.2s;
}
.reader-bottom-inner {
  max-width: 760px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 11px;
}
.reader-bottom button {
  min-height: 44px;
  min-width: 44px;
}
.reader-status {
  font-size: 10px;
  opacity: 0.55;
  text-align: center;
  line-height: 1.6;
}
.reader-hide .reader-tools {
  transform: translateY(-100%);
}
.reader-hide .reader-bottom {
  transform: translateY(100%);
}
.reveal-tools {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: 9;
  background: var(--reader-bg);
  border: 1px solid #8883;
  box-shadow: 0 3px 12px #0001;
  opacity: 0.8;
}
.reader-article {
  max-width: calc(var(--read-width) + 48px);
  margin: auto;
  padding: 112px 24px 20px;
  font-size: var(--read-size);
  line-height: var(--read-line);
  font-family: var(--read-font);
  overflow-wrap: anywhere;
}
.reader-article h1 {
  font-size: 1.4em;
  line-height: 1.7;
  font-weight: 500;
  margin: 20px 0 44px;
  letter-spacing: 0.06em;
}
.reader-article .chapter-eyebrow {
  font: 10px system-ui;
  letter-spacing: 2px;
  opacity: 0.45;
  margin-bottom: 10px;
}
.reader-article p {
  margin: 0 0 var(--read-gap);
  text-align: var(--read-align);
  text-indent: var(--read-indent);
  white-space: pre-wrap;
  scroll-margin-top: 100px;
}
.reader-article p.highlight {
  background: #c6aa4a38;
  border-radius: 3px;
}
.reader-article mark {
  background: #d0b54e66;
  color: inherit;
}
.chapter-end {
  border-top: 1px solid #8883;
  margin-top: 45px;
  padding: 30px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 13px system-ui;
}
.reader-note {
  font: 12px system-ui;
  line-height: 1.8;
  color: #9d7145;
  background: #bfa66820;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 24px;
}
.reader-note:empty {
  display: none;
}
.return-point {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 11;
  background: var(--reader-bg);
  color: var(--reader-ink);
  border: 1px solid #8883;
  box-shadow: 0 5px 20px #0001;
}
.loading {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  width: min(660px, calc(100vw - 32px));
  max-height: 85dvh;
  box-shadow: 0 25px 100px #15231833;
}
dialog::backdrop {
  background: #18261f66;
  backdrop-filter: blur(3px);
}
.panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 13px 22px;
}
.panel-head h2 {
  font-size: 17px;
  margin: 0;
}
.panel-body {
  padding: 20px 24px 28px;
}
.panel-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 22px;
}
.panel-body .tools {
  margin-bottom: 10px;
}
.panel-body .toc-grid {
  display: block;
}
.panel-body .toc-group {
  margin-bottom: 5px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  min-height: 44px;
}
.swatch.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bookmark-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.bookmark-item .jump {
  display: block;
  text-align: left;
  width: 100%;
  padding: 0;
}
.bookmark-item h3 {
  font-size: 13px;
  line-height: 1.8;
  margin: 0 0 7px;
}
.bookmark-item p {
  font-size: 12px;
  line-height: 1.9;
  margin: 0 0 8px;
  color: var(--muted);
}
.bookmark-item .actions {
  justify-content: flex-end;
  font-size: 11px;
}
.note-text {
  white-space: pre-wrap;
}
.search-result {
  display: block;
  text-align: left;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  font-size: 12px;
  line-height: 1.8;
}
.search-result strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}
.search-result span {
  color: var(--muted);
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 100;
  border-radius: 8px;
  background: #253c33;
  color: #fff;
  padding: 13px 19px;
  box-shadow: 0 5px 24px #0002;
  font-size: 12px;
  max-width: calc(100vw - 30px);
  line-height: 1.8;
  display: none;
  align-items: center;
  gap: 14px;
}
#toast.show {
  display: flex;
}
#toast button {
  color: #d2e2a3;
  white-space: nowrap;
  font-weight: 700;
  min-height: 28px;
}
.import-book {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 8px;
  margin: 18px 0;
}
.import-book h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.import-book small {
  line-height: 1.8;
}
.import-chapter {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  display: grid;
  grid-template-columns: 1fr 80px auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.import-chapter input,
.import-chapter select {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 4px;
  min-height: 35px;
  font-size: 11px;
}
.import-chapter .icon-btn {
  width: 33px;
  min-width: 33px;
  height: 35px;
}
.import-chapter .actions {
  gap: 1px;
}
.import-chapter .actions svg {
  width: 15px;
}
.import-list {
  max-height: 350px;
  overflow: auto;
}
.import-chapter code {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.switch-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  line-height: 1.8;
  margin: 16px 0;
}
.switch-row input {
  width: 18px;
  height: 18px;
}
.split-content {
  font-family: monospace;
  white-space: pre-wrap;
}
.import-editor textarea {
  min-height: 260px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.conflict-option {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin: 8px 0;
  min-height: 75px;
}
.conflict-option strong {
  display: block;
  font-size: 14px;
  margin-bottom: 7px;
}
.conflict-option small {
  line-height: 1.8;
}
.conflict-option:hover {
  background: var(--accent-light);
}
.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}
.install-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 10px;
}
.code {
  font: 11px monospace;
  background: #e5e7dd;
  padding: 2px 5px;
  border-radius: 3px;
}
@media (min-width: 1500px) {
  .page {
    padding-left: 75px;
    padding-right: 75px;
  }
  .book-grid {
    gap: 38px;
  }
  .cover-wrap {
    min-height: 295px;
  }
  .cover-wrap .book-cover {
    height: 240px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sidebar {
    padding: 30px 16px;
  }
  .brand strong {
    font-size: 16px;
  }
  .page {
    padding: 0 28px 50px;
  }
  .continue {
    grid-template-columns: 110px 1fr;
    gap: 20px;
    padding: 22px;
  }
  .continue > .btn {
    grid-column: 2;
    justify-self: start;
    margin-top: -10px;
  }
  .continue .mini-cover {
    grid-row: 1/3;
  }
  .continue h2 {
    font-size: 22px;
  }
  .book-grid {
    gap: 20px;
  }
  .cover-wrap {
    padding: 22px 12px;
    min-height: 220px;
  }
  .cover-wrap .book-cover {
    height: 180px;
  }
  .cover-title {
    font-size: 20px;
  }
  .stats {
    gap: 18px;
  }
  .intro h1 {
    font-size: 28px;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .page {
    padding: 0 20px 100px;
  }
  .topbar {
    height: 76px;
  }
  .topbar .crumb {
    display: none;
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Georgia, serif;
    font-size: 18px;
  }
  .mobile-brand img {
    width: 32px;
    height: 32px;
  }
  .topbar .actions .btn {
    padding: 10px 12px;
    font-size: 11px;
  }
  .intro {
    padding: 30px 0 24px;
    display: block;
  }
  .intro h1 {
    font-size: 28px;
  }
  .intro p {
    font-size: 12px;
  }
  .intro .stats {
    margin-top: 22px;
    gap: 28px;
  }
  .stat {
    display: flex;
    align-items: baseline;
    gap: 7px;
  }
  .stat strong {
    font-size: 23px;
  }
  .stat small {
    font-size: 10px;
  }
  .eyebrow {
    font-size: 9px;
    margin-bottom: 10px;
  }
  .continue {
    padding: 22px 18px;
    grid-template-columns: 80px 1fr;
    gap: 15px;
    margin-bottom: 30px;
    border-radius: 8px;
    min-height: 170px;
  }
  .continue .mini-cover {
    width: 72px;
    height: 108px;
  }
  .mini-cover .cover-title {
    font-size: 16px;
    letter-spacing: 2px;
  }
  .continue h2 {
    font-size: 20px;
    margin-bottom: 6px;
  }
  .continue p {
    font-size: 10px;
    margin-bottom: 10px;
  }
  .continue > .btn {
    font-size: 11px;
    min-height: 40px;
    padding: 8px 13px;
  }
  .continue:after {
    right: -150px;
  }
  .section-heading {
    margin-bottom: 12px;
  }
  .section-heading h2 {
    font-size: 17px;
  }
  .section-heading small {
    display: none;
  }
  .filters {
    gap: 0;
  }
  .chip {
    font-size: 11px;
    padding: 8px 10px;
  }
  .tools {
    margin-bottom: 20px;
    gap: 8px;
  }
  .search-field {
    max-width: none;
  }
  .select {
    font-size: 11px;
    max-width: 108px;
    padding: 0 6px;
  }
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px 16px;
  }
  .cover-wrap {
    padding: 22px 10px;
    min-height: 207px;
    border-radius: 7px;
  }
  .cover-wrap .book-cover {
    height: 165px;
  }
  .cover-wrap .badge {
    right: 6px;
    top: 6px;
    font-size: 8px;
    padding: 4px 6px;
  }
  .cover-title {
    font-size: 19px;
    letter-spacing: 3px;
    max-height: 115px;
  }
  .cover-number {
    font-size: 7px;
    margin-bottom: 10px;
  }
  .cover-author {
    font-size: 7px;
    margin-top: 9px;
  }
  .card-title {
    padding-top: 12px;
  }
  .card-title h3 {
    font-size: 14px;
  }
  .book-card p {
    font-size: 10px;
    margin-bottom: 9px;
  }
  .card-footer {
    font-size: 9px;
    align-items: flex-start;
  }
  .library-foot {
    margin-top: 35px;
    font-size: 8px;
    letter-spacing: 1px;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: #f9f8f1f2;
    border-top: 1px solid var(--line);
    padding: 7px 0 calc(5px + env(safe-area-inset-bottom));
    z-index: 8;
    backdrop-filter: blur(12px);
  }
  .mobile-nav button {
    min-height: 45px;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 9px;
    color: var(--muted);
  }
  .mobile-nav button.active {
    color: var(--accent);
    font-weight: 700;
  }
  .mobile-nav svg {
    width: 19px;
    height: 19px;
  }
  .login {
    display: block;
  }
  .login-art {
    padding: 34px 30px;
    min-height: 235px;
  }
  .login-art img {
    width: 34px;
    margin-bottom: 18px;
  }
  .login-art h1 {
    font-size: 25px;
    letter-spacing: 4px;
    margin-bottom: 0;
  }
  .login-art p {
    display: none;
  }
  .login-form {
    padding: 30px 25px;
  }
  .login-form h2 {
    font-size: 22px;
  }
  .detail-header {
    grid-template-columns: 105px 1fr;
    gap: 20px;
    margin: 30px 0;
  }
  .detail-header .book-cover {
    height: 153px;
  }
  .detail-header .cover-title {
    font-size: 18px;
  }
  .detail-header h1 {
    font-size: 24px;
    margin: 5px 0 10px;
  }
  .detail-header p {
    font-size: 12px;
  }
  .detail-header .btn {
    padding: 9px 13px;
    min-height: 42px;
    font-size: 11px;
  }
  .detail-header .description {
    grid-column: 1/-1;
  }
  .toc-grid {
    grid-template-columns: 1fr;
  }
  .reader-article {
    padding: 98px 22px 20px;
  }
  .reader-article h1 {
    margin: 12px 0 32px;
    font-size: 1.25em;
  }
  .reader-tools {
    padding-left: 10px;
    padding-right: 10px;
  }
  .reader-top {
    height: 59px;
    gap: 5px;
  }
  .reader-top .reader-label {
    max-width: 46vw;
    font-size: 10px;
  }
  .reader-top .actions {
    gap: 0;
  }
  .reader-bottom-inner {
    gap: 6px;
    font-size: 10px;
  }
  .reader-status {
    font-size: 9px;
  }
  .reader-bottom {
    padding-left: 10px;
    padding-right: 10px;
  }
  .panel-head {
    padding: 10px 16px;
  }
  .panel-body {
    padding: 16px 18px 24px;
  }
  dialog {
    max-height: 89dvh;
    width: calc(100vw - 20px);
    border-radius: 10px;
  }
  .settings-grid {
    gap: 0 12px;
  }
  .form-row {
    gap: 10px;
  }
  .import-chapter {
    grid-template-columns: 1fr 68px auto;
    gap: 4px;
  }
  .import-chapter .actions {
    flex-wrap: wrap;
    width: 65px;
  }
  .import-chapter .icon-btn {
    width: 30px;
    min-width: 30px;
  }
  .return-point {
    bottom: 90px;
    right: 10px;
    font-size: 11px;
  }
  .reader-bottom .icon-btn {
    width: 36px;
    min-width: 36px;
  }
  .intro .stats {
    flex-wrap: wrap;
  }
  .topbar .actions {
    gap: 0;
  }
  .panel-actions .btn {
    flex: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* The public reading site keeps a portrait layout on every screen. */
.public-mode .shell {
  display: block;
  max-width: 480px;
  margin: auto;
  border-inline: 1px solid var(--line);
  min-height: 100dvh;
}
.public-mode .sidebar {
  display: none;
}
.public-mode .page {
  max-width: 480px;
  padding: 0 20px 100px;
}
.public-mode .topbar {
  height: 76px;
}
.public-mode .topbar .crumb {
  display: none;
}
.public-mode .mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    18px Georgia,
    serif;
}
.public-mode .mobile-brand img {
  width: 32px;
  height: 32px;
}
.public-mode .intro {
  display: block;
  padding: 30px 0 24px;
}
.public-mode .intro h1 {
  font-size: 28px;
}
.public-mode .intro p {
  font-size: 12px;
}
.public-mode .stats {
  margin-top: 22px;
  gap: 28px;
  flex-wrap: wrap;
}
.public-mode .stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.public-mode .stat strong {
  font-size: 23px;
}
.public-mode .stat small {
  font-size: 10px;
}
.public-mode .continue {
  grid-template-columns: 80px 1fr;
  gap: 15px;
  padding: 22px 18px;
  min-height: 170px;
  margin-bottom: 30px;
}
.public-mode .continue .mini-cover {
  width: 72px;
  height: 108px;
  grid-row: 1/3;
}
.public-mode .mini-cover .cover-title {
  font-size: 16px;
  letter-spacing: 2px;
}
.public-mode .continue h2 {
  font-size: 20px;
}
.public-mode .continue p {
  font-size: 10px;
}
.public-mode .continue > .btn {
  grid-column: 2;
  justify-self: start;
  font-size: 11px;
  min-height: 40px;
  padding: 8px 13px;
  margin-top: -10px;
}
.public-mode .section-heading {
  gap: 5px;
}
.public-mode .section-heading h2 {
  font-size: 17px;
  white-space: nowrap;
}
.public-mode .section-heading small {
  display: none;
}
.public-mode .filters {
  gap: 0;
  flex-wrap: nowrap;
}
.public-mode .chip {
  padding: 8px 9px;
  font-size: 11px;
  white-space: nowrap;
}
.public-mode .tools {
  gap: 8px;
}
.public-mode .tools .actions {
  gap: 8px;
}
.public-mode .select {
  max-width: 100px;
  padding: 0 6px;
  font-size: 11px;
}
.public-mode .search-field {
  min-width: 0;
}
.public-mode .search-field input {
  font-size: 11px;
}
.public-mode .book-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 25px 16px;
}
.public-mode .cover-wrap {
  padding: 22px 10px;
  min-height: 207px;
}
.public-mode .cover-wrap .book-cover {
  height: 165px;
}
.public-mode .cover-title {
  font-size: 19px;
  letter-spacing: 3px;
  max-height: 115px;
}
.public-mode .card-title h3 {
  font-size: 14px;
}
.public-mode .book-card p {
  font-size: 10px;
}
.public-mode .card-footer {
  font-size: 9px;
}
.public-mode .mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: max(0px, calc((100% - 480px) / 2));
  width: min(100%, 480px);
  justify-content: space-around;
  background: #f9f8f1f2;
  border-top: 1px solid var(--line);
  padding: 7px 0 calc(5px + env(safe-area-inset-bottom));
  z-index: 8;
  backdrop-filter: blur(12px);
}
.public-mode .mobile-nav button {
  min-height: 45px;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}
.public-mode .mobile-nav button.active {
  color: var(--accent);
  font-weight: 700;
}
.public-mode [data-action="book-menu"],
.public-mode [data-action="import"],
.public-mode [data-action="logout"],
.public-mode [data-action="archives"] {
  display: none !important;
}
.public-mode .detail-header {
  grid-template-columns: 105px 1fr;
  gap: 20px;
  margin: 30px 0;
}
.public-mode .detail-header .book-cover {
  height: 153px;
}
.public-mode .detail-header h1 {
  font-size: 24px;
  margin: 5px 0 10px;
}
.public-mode .detail-header p {
  font-size: 12px;
}
.public-mode .detail-header .description {
  grid-column: 1/-1;
}
.public-mode .detail-header .btn {
  padding: 9px 13px;
  font-size: 11px;
}
.public-mode .toc-grid {
  grid-template-columns: 1fr;
}
.public-mode .reader {
  max-width: 480px;
  margin: auto;
}
.public-mode .reader-article {
  max-width: 480px;
  padding: 98px 22px 20px;
}
.public-mode .reader-article h1 {
  font-size: 1.25em;
}
.public-mode .reader-tools,
.public-mode .reader-bottom {
  left: max(0px, calc((100% - 480px) / 2));
  right: auto;
  width: min(100%, 480px);
}
.public-mode .reader-tools {
  padding-inline: 10px;
}
.public-mode .reader-top {
  height: 59px;
  gap: 5px;
}
.public-mode .reader-top .reader-label {
  max-width: 46%;
  font-size: 10px;
}
.public-mode .reader-top .actions {
  gap: 0;
}
.public-mode .reader-bottom-inner {
  gap: 6px;
  font-size: 10px;
}
.public-mode .reader-status {
  font-size: 9px;
}
.public-mode dialog {
  width: min(440px, calc(100vw - 20px));
}
.public-mode .return-point {
  right: max(10px, calc((100% - 460px) / 2));
}
