@font-face { font-family: BinPDFBook; src: url("assets/bin-book.woff2") format("woff2"); font-display: block; }
@font-face { font-family: JudouPDF; src: url("assets/judou.woff2") format("woff2"); font-display: block; }
@font-face { font-family: BinTitle; src: url("assets/bin-title.woff2") format("woff2"); font-display: swap; }
:root { color: #343b38; background: #f8f2e4; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; font-synthesis: none; letter-spacing: 0; --ink: #5d6164; --red: #ea5a58; --line: #dde2dc; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100dvh; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; background: none; }
button:disabled { opacity: .3; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid #9c514b; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 4px; color: #747e73; }
.icon-button svg { width: 18px; height: 18px; stroke-width: 1.65; }
.icon-button:hover:not(:disabled) { background: #e9ede6; color: #465644; }
.icon-button.active { color: #974d46; background: #f4e9e5; }
.quickbar { position: fixed; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); z-index: 3; display: flex; align-items: center; gap: 2px; padding: 2px; max-width: calc(100vw - 24px); background: #f8f2e4ed; }
.quickbar .icon-button { width: 28px; height: 24px; flex-basis: 28px; }
.quickbar .icon-button svg { width: 16px; height: 16px; }
.menu-toggle { border: 1px solid #5d616426; }
.quickbar-divider { width: 1px; height: 16px; background: #5d616426; margin-inline: 3px; flex: none; }
.app-shell { height: 100dvh; display: flex; min-width: 0; }
.reader { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.reading-stage { position: relative; flex: 1; min-height: 0; min-width: 0; display: flex; padding: 56px 32px 44px; }
.paper { --font-size: 32px; --note-size: 20.3636px; --row-size: 21.1782px; display: flex; width: 100%; height: 100%; min-height: 0; min-width: 0; margin: 0 auto; padding: 18px 12px; background: #f8f2e4; color: var(--ink); font-family: BinPDFBook, "Songti SC", "SimSun", serif; font-weight: 400; font-kerning: none; font-variant-ligatures: none; overflow: hidden; }
.paper[data-width="book"] { max-width: 980px; }
.paper-heading { flex: none; }
.paper-heading p, .paper-heading h2, .paper-heading h3 { margin: 0; font-weight: 400; }
.volume { font-size: calc(var(--font-size) * .58); color: var(--red); line-height: 1.4; }
.paper-heading h2 { font-size: calc(var(--font-size) * 1.1); line-height: 1.3; }
.byline { font-size: calc(var(--font-size) * .58); line-height: 1.6; }
.byline-edition { white-space: nowrap; }
.paper[data-direction="vertical"] .byline-edition { text-combine-upright: all; text-orientation: mixed; }
.author-choice { position: relative; display: inline-block; cursor: pointer; }
.author-choice input { inset: 0; margin: 0; }
.author-choice input:not(:checked) + span { color: #aaa99f; }
.author-choice input:focus-visible + span { outline: 1px solid #974d46; outline-offset: 3px; }
.chapter-heading { display: flex; gap: 14px; font-size: calc(var(--font-size) * .75); line-height: 1.4; }
#chapter-number { color: var(--red); }
.reading-content { display: flex; }
.paper[data-direction="horizontal"] .reading-content { flex-direction: column; gap: 12px; width: 100%; min-height: 100%; }
.paper[data-direction="horizontal"] .paper-heading { display: grid; gap: 6px; }
.paper[data-direction="horizontal"] .chapter-heading { border-top: 1px solid #5d616425; padding-top: 12px; margin-top: 6px; }
.paper[data-direction="vertical"] .reading-content { flex-direction: row-reverse; gap: 20px; width: max-content; min-width: 100%; height: 100%; }
.paper[data-direction="vertical"] .paper-heading { display: flex; flex-direction: row-reverse; gap: 16px; padding-left: 16px; border-left: 1px solid #5d61641a; }
.paper[data-direction="vertical"] .paper-heading > * { writing-mode: vertical-rl; text-orientation: upright; max-height: 100%; }
.paper[data-direction="vertical"] .chapter-heading { align-items: center; flex-direction: column; writing-mode: horizontal-tb; gap: 16px; }
.paper[data-direction="vertical"] .chapter-heading span { writing-mode: vertical-rl; }
.flow-viewport { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: none; }
.flow-viewport, .menu-panel, #chapter-list { scrollbar-width: none; }
.flow-viewport::-webkit-scrollbar, .menu-panel::-webkit-scrollbar, #chapter-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.flow-viewport:focus-visible { outline-offset: 5px; }
.chapter-edge { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 9px; max-width: calc(100% - 24px); min-height: 24px; font-size: 12px; line-height: 1.5; color: #858578; pointer-events: none; }
.chapter-edge > svg { flex: none; width: 15px; height: 15px; }
#chapter-edge-label { min-width: 0; }
.edge-meter { flex: none; width: 38px; height: 2px; background: #5d616426; overflow: hidden; }
.edge-meter > span { display: block; width: 100%; height: 100%; background: #a55a52; transform: scaleX(var(--edge-progress, 0)); transform-origin: left; }
.chapter-edge[data-ready="true"] { color: #974d46; }
.chapter-edge[data-limit="true"] .edge-meter { display: none; }
.flow-body { display: flex; flex: none; align-content: start; user-select: text; }
.paper[data-direction="horizontal"] .flow-body { flex-direction: column; width: 100%; }
.paper[data-direction="vertical"] .flow-body { flex-direction: row-reverse; height: 100%; }
.reading-line { display: flex; flex: none; align-items: center; }
.paper[data-direction="vertical"] .reading-line { flex-direction: column; }
.reading-unit { display: flex; flex: none; align-items: center; cursor: text; }
.paper[data-direction="vertical"] .reading-unit { flex-direction: column; }
.scripture { font-size: var(--font-size); color: var(--ink); }
.annotation { font-size: var(--note-size); color: var(--red); }
.annotation-lines { display: flex; flex-direction: column; flex: none; }
.annotation-row { display: flex; flex: none; align-items: center; height: var(--row-size); line-height: 1.04; }
.paper[data-direction="vertical"] .annotation-lines { flex-direction: row-reverse; }
.paper[data-direction="vertical"] .annotation-row { flex-direction: column; width: var(--row-size); height: auto; }
.glyph { display: block; flex: none; height: 1em; line-height: 1; white-space: pre; }
.punctuation { font-family: "Songti SC", "SimSun", serif; color: var(--red); }
.paper[data-direction="vertical"] .glyph { writing-mode: vertical-rl; text-orientation: upright; }
.source-marker { display: block; flex: none; width: var(--note-size); height: var(--note-size); color: inherit; }
.source-marker.double { height: calc(var(--note-size) * 2); }
.source-marker svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.source-marker.fallback { border: 1px solid currentColor; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; font-size: calc(var(--note-size) * .78); line-height: 1; }
.source-marker.fallback.double { height: calc(var(--note-size) * 2); }
.reading-unit.search-hit { background: #dbc66f3b; }
.full-section { display: flex; flex: none; min-width: 0; }
.full-chapter-flow { position: relative; flex: none; }
.full-chapter-flow > .reading-line { position: absolute; }
.full-chapter-heading { display: flex; flex: none; align-items: center; gap: 12px; margin: 0; font-size: min(24px, calc(var(--font-size) * .75)); font-weight: 400; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.full-chapter-heading > span:first-child { color: var(--red); }
.paper[data-direction="vertical"] .full-section { flex-direction: row-reverse; height: 100%; padding-left: 24px; }
.paper[data-direction="vertical"] .full-chapter-heading { writing-mode: vertical-rl; padding-block: 12px; border-right: 1px solid #5d616425; }
.paper[data-direction="horizontal"] .full-section { flex-direction: column; width: 100%; padding-bottom: 24px; }
.paper[data-direction="horizontal"] .full-chapter-heading { border-top: 1px solid #5d616425; padding-block: 12px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 4; background: #26372c25; }
.reader-menu { position: fixed; z-index: 5; inset: 0 auto 0 0; width: min(350px, 100vw); background: #fcfdfb; box-shadow: 4px 0 25px #26362320; display: flex; flex-direction: column; min-height: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.menu-heading { min-height: 60px; padding: 10px 18px 6px 22px; display: flex; align-items: center; justify-content: space-between; }
h1 { margin: 0; font-family: "Songti SC", "SimSun", serif; font-size: 21px; font-weight: 600; }
.menu-book { display: grid; gap: 8px; padding: 8px 22px 20px; }
.menu-book select { width: 100%; min-width: 0; background: transparent; padding: 8px 4px; font-size: 15px; border: 0; border-bottom: 1px solid var(--line); }
#edition { color: #8a9189; font-size: 11px; }
.menu-tabs { display: flex; flex: none; padding: 0 14px; border-block: 1px solid var(--line); }
.menu-tabs button { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 4px; border-bottom: 2px solid transparent; font-size: 12px; color: #828b7d; }
.menu-tabs button[aria-selected="true"] { color: #974d46; border-bottom-color: #974d46; }
.menu-tabs svg { width: 15px; height: 15px; }
.menu-panel { flex: 1; min-height: 0; overflow: auto; }
.contents-panel { display: flex; flex-direction: column; }
.search-field { margin: 18px 18px 10px; border: 1px solid #e0e5dc; border-radius: 4px; min-height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 9px; }
.search-field svg { width: 14px; height: 14px; color: #8b9585; flex: none; }
.search-field input { width: 100%; min-width: 0; flex: 1; border: 0; background: none; font-size: 12px; }
#chapter-list { flex: 1; padding: 6px 12px 12px; overflow: auto; }
.chapter-item { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 4px; margin: 2px 0; font-size: 12px; line-height: 1.6; }
.chapter-item:hover { background: #f2f4ef; }
.chapter-item.active { background: #f4eae5; color: #92534b; }
.chapter-item small { display: block; color: #949b8f; font-size: 10px; margin-top: 4px; }
.empty-search { padding: 16px 12px; color: #959e8f; font-size: 12px; }
.settings-panel, .book-panel { padding: 24px 22px; font-size: 12px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; gap: 12px; }
.setting-row select { padding: 7px; border: 1px solid var(--line); border-radius: 3px; background: #fff; font-size: 12px; }
.segmented { display: flex; height: 32px; padding: 2px; gap: 2px; background: #e7ebe4; border: 1px solid #d8ddd5; border-radius: 4px; }
.segmented button { min-width: 46px; padding: 0 10px; border-radius: 2px; font-size: 12px; }
.segmented button.active { background: #fff; color: #374c37; }
.font-tools, .font-input { display: flex; align-items: center; gap: 3px; }
.font-input { font-size: 10px; color: #858d81; }
.font-input input { width: 40px; padding: 6px 0; border: 1px solid var(--line); border-radius: 3px; background: #fff; text-align: center; font-size: 12px; appearance: textfield; }
.font-input input::-webkit-inner-spin-button { display: none; }
fieldset { border: 0; padding: 0; margin: 0 0 26px; display: flex; gap: 22px; }
legend { margin-bottom: 14px; color: #7a8476; font-size: 11px; }
fieldset label { display: flex; align-items: center; gap: 5px; }
input[type="radio"], input[type="checkbox"] { accent-color: #9d514a; }
.menu-action { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 0; text-align: left; border-bottom: 1px solid #edf0e9; font-size: 12px; }
.menu-action:hover { color: #974d46; }
.menu-action svg { width: 17px; height: 17px; }
.contents-source { margin: 0 0 22px; font-size: 11px; line-height: 1.9; color: #939c8c; overflow-wrap: anywhere; }
.menu-footer { flex: none; border-top: 1px solid var(--line); padding: 13px 20px 16px; display: grid; gap: 7px; color: #889180; font-size: 11px; }
.chapter-label { line-height: 1.6; overflow-wrap: anywhere; }
.chapter-navigation { display: flex; align-items: center; gap: 5px; }
#chapter-count { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
#reading-progress { margin-left: auto; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
#reading-status { font-size: 10px; }
body:not([data-ready="true"]) :is(.quickbar, .app-shell, .reader-menu, .drawer-backdrop, .chapter-edge, #toast) { visibility: hidden; }
.load-state { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom)); background: #f8f2e4; color: #686d71; text-align: center; }
.loading-cover { flex: 1; min-height: 0; width: min(100%, 440px); max-height: 760px; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 20px; font-family: BinTitle, "Songti SC", serif; }
.loading-title { margin: 0; writing-mode: vertical-rl; text-orientation: upright; font-family: inherit; font-size: 66px; line-height: 1.2; font-weight: 400; flex: none; }
.loading-authors { display: flex; flex-direction: row-reverse; gap: 4px; font-size: 16px; line-height: 1.2; flex: none; }
.loading-authors > div { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 16px; }
.loading-authors > div > span:last-child { writing-mode: vertical-rl; text-orientation: upright; }
.loading-seal { display: block; width: 16px; height: 16px; line-height: 16px; }
.name-space { display: inline-block; height: 1em; }
.loading-wave { width: 190px; height: auto; max-height: 165px; object-fit: contain; flex: none; }
.loading-status { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 24px; flex: none; font-size: 12px; }
.loading-status p { margin: 0; max-width: 440px; line-height: 1.8; overflow-wrap: anywhere; }
.loading-dots { display: flex; align-items: center; gap: 4px; }
.loading-dots span { width: 3px; height: 3px; border-radius: 50%; background: currentColor; animation: loading-pulse 1.2s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
.load-state[data-error="true"] .loading-dots { display: none; }
@keyframes loading-pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .loading-dots span { animation: none; } }
@media (max-height: 700px) { .loading-cover { gap: 14px; } .loading-title { font-size: 48px; } .loading-authors { font-size: 14px; } .loading-wave { width: 145px; max-height: 126px; } }
@media (max-height: 500px) { .loading-cover { width: min(100%, 600px); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; align-content: center; justify-items: center; gap: 20px; } .loading-title { grid-row: 1 / 3; font-size: 42px; } .loading-wave { width: 130px; max-height: 112px; } }
#retry-load { border-bottom: 1px solid #9a665a; padding: 5px; color: #98574c; font-size: 12px; }
#toast { position: fixed; z-index: 10; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 18px; background: #354238; color: #fff; border-radius: 4px; font-size: 12px; line-height: 1.6; opacity: 0; pointer-events: none; transition: opacity .15s; }
#toast.visible { opacity: 1; }
@media (max-width: 850px) {
  .reading-stage { padding: 52px 12px 44px; }
  .paper { padding: 14px 4px; }
  .paper[data-direction="vertical"] .reading-content { gap: 12px; }
  .paper[data-direction="vertical"] .paper-heading { gap: 10px; padding-left: 10px; }
}
@media (max-width: 360px) {
  .quickbar { gap: 0; }
  .quickbar .icon-button { width: 28px; flex-basis: 28px; }
  .quickbar-divider { margin-inline: 2px; }
}
@media (max-height: 500px) {
  .reading-stage { padding-top: 52px; padding-bottom: 40px; }
  .paper { padding-block: 6px; }
  .menu-heading { min-height: 44px; }
  .menu-book { padding-top: 0; padding-bottom: 10px; gap: 4px; }
  .menu-tabs button { padding-block: 9px; }
  .menu-footer { padding-block: 7px; gap: 1px; }
}
@media print {
  body, .app-shell, .reader, .reading-stage { height: auto; overflow: visible; display: block; padding: 0; background: #fff; }
  .quickbar, .reader-menu, .drawer-backdrop, .chapter-edge, #toast, .load-state { display: none !important; }
  .paper { height: auto; min-height: 240mm; }
  .flow-viewport { overflow: visible; }
}
