:root {
  color-scheme: light;
  --background: #fbf7ed;
  --paper: #fffdfa;
  --ink: #262c2a;
  --muted: #565e55;
  --forest: #275343;
  --border: #dcded0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--background);
  line-height: 1.58;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 8px clamp(16px, 6vw, 72px); border-bottom: 1px solid var(--border); }
a { color: var(--forest); }
.brand { font-weight: 740; text-decoration: none; }
main { width: min(960px, calc(100% - 32px)); margin: 36px auto 72px; }
h1 { margin: 0 0 14px; font-size: clamp(26px, 5vw, 44px); letter-spacing: -.03em; line-height: 1.2; }
h2 { margin: 0 0 10px; font-size: 20px; }
p { margin: 12px 0; }
.layout { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 36px; }
.welcome { padding: min(7vw, 60px) 0; }
.welcome p { max-width: 24em; font-size: 18px; }
.card { padding: clamp(18px, 4vw, 34px); background: var(--paper); border: 1px solid var(--border); border-radius: 18px; }
#record, #progress, #sample { max-width: 630px; margin: auto; }
button, input { font: inherit; }
button { cursor: pointer; min-height: 44px; padding: 9px 16px; background: var(--paper); color: var(--ink); border: 1px solid #adb6a8; border-radius: 8px; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #a66422; outline-offset: 3px; }
.primary { background: var(--forest); color: white; border-color: var(--forest); font-weight: 700; }
.text-button { border: 0; padding-inline: 4px; background: transparent; color: var(--forest); }
label, summary { font-weight: 650; }
summary { cursor: pointer; padding-block: 7px; }
input[type=password], input[type=file] { max-width: 100%; width: 100%; display: block; margin: 8px 0 14px; }
input[type=password] { background: white; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.actions,.record-controls,.turn { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-block: 18px; }
.turn { justify-content: space-between; }
.turn button { flex: 1 1 120px; }
.script { padding: 13px 16px; background: #edf2e9; border-radius: 10px; }
.helper,.privacy { color: var(--muted); font-size: 15px; }
.helper:empty { display: none; }
.privacy { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 10px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 15px 0 18px; font-size: 15px; font-weight: 500; }
.check input { width: 20px; height: 20px; flex: 0 0 20px; }
audio { display: block; width: 100%; margin: 10px 0; min-height: 44px; }
.books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.book { display: block; width: 100%; overflow: hidden; text-align: left; padding: 0; border-radius: 16px; }
.book img { display: block; width: 100%; aspect-ratio: 1.55; object-fit: contain; background: #efe9d7; }
.book span { padding: 10px 15px 0; display: block; font-weight: 750; font-size: 20px; }
.book small { display: block; padding: 4px 15px 14px; color: var(--muted); }
#reader { max-width: 760px; margin: auto; }
.reader-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 12px; }
.reader-head h1 { font-size: clamp(20px, 5vw, 30px); margin: 0; text-align: center; }
.reader-head button { justify-self: start; }
#page-count { justify-self: end; color: var(--muted); }
.picture { background: #ede8d7; border-radius: 16px; overflow: hidden; }
.picture img { display: block; width: 100%; max-height: 62vh; object-fit: contain; }
.original { text-align: center; font-size: clamp(24px, 7vw, 44px); line-height: 1.3; font-weight: 700; }
.compare-page { margin: 26px 0; }
.version-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 15px; }
.version { padding: 14px; border-radius: 12px; background: #f0f4e9; }
.version p { min-height: 3.2em; }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--border); border-radius: 14px; max-width: min(480px, calc(100% - 32px)); padding: 22px; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(25 33 27 / 50%); overflow: hidden; overscroll-behavior: contain; }
.danger { color: #922d21; border-color: #bc786c; }
@media (max-width: 560px) {
  main { margin-top: 22px; }
  .layout { grid-template-columns: 1fr; gap: 6px; }
  .welcome { padding: 16px 3px; }
  .books { grid-template-columns: 1fr; }
  .book { display: grid; grid-template-columns: 112px 1fr; }
  .book img { grid-row: span 2; width: 112px; height: 100%; }
  .version-pair { grid-template-columns: 1fr; }
  .version p { min-height: 0; }
}
