:root {
  color-scheme: light;
  --ink: #222625;
  --muted: #737774;
  --line: #dddfda;
  --page-height: min(calc(100dvh - 246px), calc((100vw - 224px) * 1.5));
  --page-scale: 1;
  font-family: "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f0f0ed;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, .manual-canvas:focus-visible { outline: 2px solid #2463a0; outline-offset: 4px; }
[hidden] { display: none !important; }
.reader-header { height: 74px; flex-shrink: 0; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; background: #fafbf8; border-bottom: 1px solid var(--line); }
.reader-brand { display: inline-flex; }
.reader-brand img { display: block; width: 126px; height: auto; }
.reader-header__edition { font-size: 10px; font-weight: 600; letter-spacing: .2em; }
.reader-header__edition span { color: var(--muted); margin-left: 10px; }
.reader-home { font-size: 12px; display: flex; gap: 20px; align-items: center; min-height: 44px; }
.reader-home span { font-size: 19px; }
.manual-reader { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reader-toolbar { padding: 18px 32px; display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 16px; }
.reader-eyebrow { display: block; font-size: 9px; letter-spacing: .2em; font-weight: 600; color: var(--muted); margin: 0 0 7px; }
.reader-heading { min-width: 0; }
.reader-heading h1 { font-size: 15px; margin: 0; line-height: 1.4; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-heading__divider { margin: 0 12px; color: #a5a9a5; }
#pageTitle { font-size: 12px; color: var(--muted); }
.reader-tools { display: flex; flex-shrink: 0; gap: 8px; }
.tool-button { display: flex; gap: 7px; align-items: center; min-height: 42px; border: 1px solid #d5d8d2; background: transparent; color: var(--ink); border-radius: 3px; padding: 0 14px; font-size: 12px; }
.tool-button > span:first-child { font-size: 20px; line-height: 1; }
.tool-button:hover, .tool-button[aria-pressed="true"] { background: #232726; color: #fff; border-color: #232726; }
.reader-workspace { position: relative; flex: 1; min-height: 0; }
.manual-canvas { height: 100%; overflow: auto; overscroll-behavior: contain; display: flex; padding: 12px 72px 24px; touch-action: pan-y pinch-zoom; scrollbar-width: thin; }
.manual-sheet { flex: 0 0 auto; margin: auto; width: calc(var(--page-height) * 2 / 3 * var(--page-scale)); height: calc(var(--page-height) * var(--page-scale)); background: #fff; box-shadow: 0 3px 6px #0000000c, 0 20px 46px #1720191c; }
.manual-sheet img { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; }
.manual-sheet.is-turning-forward { animation: turn-forward .32s ease-out; transform-origin: left center; }
.manual-sheet.is-turning-backward { animation: turn-backward .32s ease-out; transform-origin: right center; }
@keyframes turn-forward { from { opacity: .3; transform: perspective(1400px) rotateY(-9deg) translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes turn-backward { from { opacity: .3; transform: perspective(1400px) rotateY(9deg) translateX(-12px); } to { opacity: 1; transform: none; } }
.page-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #d4d7d1; border-radius: 50%; background: #fafbf8ed; color: var(--ink); font-size: 23px; transition: background .15s, opacity .15s; }
.page-arrow--previous { left: 30px; }
.page-arrow--next { right: 30px; }
.page-arrow:hover:enabled { background: #232726; border-color: #232726; color: #fff; }
.page-arrow:disabled { cursor: default; opacity: .26; }
.reader-message { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); margin: 0; padding: 10px 18px; max-width: calc(100% - 32px); width: max-content; background: #252a27e8; color: white; font-size: 12px; border-radius: 3px; }
.retry-button { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 12px 20px; border: 1px solid #bfc3bd; background: #fff; border-radius: 3px; }
.reader-footer { flex-shrink: 0; min-height: 78px; padding: 14px 32px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr minmax(220px, 320px) 1fr; gap: 24px; align-items: center; }
.reader-hint { margin: 0; font-size: 10px; color: var(--muted); line-height: 1.8; }
.reader-hint span { margin: 0 5px; }
.reader-pagination { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.page-form { display: flex; align-items: center; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.page-form input { width: 45px; padding: 3px; text-align: center; border: 0; border-bottom: 1px solid #b9beb7; background: transparent; color: var(--ink); appearance: textfield; -moz-appearance: textfield; border-radius: 0; }
.page-form input::-webkit-inner-spin-button, .page-form input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.page-form__separator { color: #a2a8a0; }
#pageTotal { color: var(--muted); min-width: 24px; }
.page-progress { width: 100%; height: 14px; margin: 0; accent-color: #252a27; cursor: pointer; }
.reader-footer__signature { text-align: right; color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.contents-dialog { width: min(840px, calc(100% - 40px)); max-height: calc(100dvh - 64px); padding: 0; border: 1px solid #d8dcd3; border-radius: 5px; background: #fafbf8; color: var(--ink); box-shadow: 0 32px 90px #0004; }
.contents-dialog::backdrop { background: #151a17a6; backdrop-filter: blur(5px); }
.contents-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 28px; background: #fafbf8; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); }
.contents-header h2 { font-size: 22px; font-weight: 500; margin: 0; }
.contents-header h2 span { font-size: 9px; font-weight: 400; letter-spacing: .1em; color: var(--muted); margin-left: 12px; }
.contents-close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 26px; }
.contents-list { padding: 0 28px 28px; }
.contents-chapter h3 { margin: 26px 0 14px; font-size: 12px; font-weight: 500; color: var(--muted); }
.contents-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.contents-page { min-width: 0; border: 1px solid #e0e3dc; background: #fff; text-align: left; padding: 8px; color: var(--ink); border-radius: 2px; }
.contents-page:hover { border-color: #737b6e; }
.contents-page[aria-current="page"] { border-color: #232726; box-shadow: 0 0 0 1px #232726; }
.contents-page img { width: 100%; height: auto; aspect-ratio: 2 / 3; display: block; object-fit: contain; background: #f0f0ed; }
.contents-page__title { display: block; font-size: 11px; line-height: 1.6; margin-top: 8px; }
.contents-page__number { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.reader-noscript { position: fixed; left: 16px; right: 16px; bottom: 10px; background: white; padding: 16px; border: 1px solid var(--line); font-size: 13px; }
.reader-noscript a { text-decoration: underline; }
body.is-zoomed { --page-scale: 2; }
body.is-zoomed .manual-canvas { touch-action: pan-x pan-y pinch-zoom; }
@media (max-width: 760px) {
  :root { --page-height: min(calc(100dvh - 244px - env(safe-area-inset-bottom)), calc((100vw - 32px) * 1.5)); }
  .reader-header { height: 62px; padding: 0 18px; }
  .reader-brand img { width: 103px; }
  .reader-header__edition { display: none; }
  .reader-home { font-size: 11px; gap: 12px; }
  .reader-toolbar { padding: 16px; align-items: flex-start; }
  .reader-heading h1 { font-size: 14px; }
  .reader-heading__divider { display: none; }
  #pageTitle { display: block; margin-top: 4px; font-size: 10px; max-width: 175px; overflow: hidden; text-overflow: ellipsis; }
  .reader-eyebrow { font-size: 8px; margin-bottom: 5px; letter-spacing: .1em; }
  .reader-tools { gap: 6px; }
  .tool-button { padding: 0 10px; min-height: 40px; font-size: 11px; gap: 4px; }
  .tool-button > span:first-child { font-size: 17px; }
  .tool-button--fullscreen { display: none; }
  .manual-canvas { padding: 4px 16px 18px; }
  .page-arrow { width: 44px; height: 44px; font-size: 20px; top: auto; bottom: -64px; transform: none; z-index: 1; }
  .page-arrow--previous { left: 16px; }
  .page-arrow--next { right: 16px; }
  .reader-footer { grid-template-columns: minmax(0, 1fr); padding: 12px 82px calc(12px + env(safe-area-inset-bottom)); gap: 0; min-height: 80px; }
  .reader-hint, .reader-footer__signature { display: none; }
  .reader-pagination { gap: 6px; }
  .reader-message { bottom: 22px; }
  .contents-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 28px); }
  .contents-header { padding: 18px; }
  .contents-header h2 { font-size: 20px; }
  .contents-list { padding: 0 18px 24px; }
  .contents-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .contents-page { padding: 5px; }
  .contents-page__title { font-size: 10px; }
}
@media (max-width: 360px) {
  .reader-toolbar { gap: 6px; }
  #pageTitle { max-width: 130px; }
  .tool-button { padding: 0 8px; }
  .contents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 540px) and (min-width: 761px) {
  :root { --page-height: min(calc(100dvh - 186px), calc((100vw - 224px) * 1.5)); }
  .reader-header { height: 54px; }
  .reader-toolbar { padding-block: 9px; }
  .reader-footer { min-height: 58px; padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
