.logbook-page { min-height: 100svh; display: grid; place-items: center; padding: 3svh 3vw; background: #ead9b8; }
.logbook-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #463323; overflow: auto; }
.logbook-dialog:not([open]) { display: none; }
.logbook-dialog[open] { display: grid; place-items: center; }
.logbook-dialog::backdrop { background: rgb(30 27 23 / 68%); }
.logbook-modal-open { overflow: hidden; }
.logbook, .logbook * { box-sizing: border-box; }
.logbook {
  --logbook-ink: #463323; --logbook-muted: #70563b; --logbook-line: #be965a; --logbook-red: #853f2a;
  position: relative; display: flex; flex-direction: column; gap: 20px;
  width: min(1240px, 94vw, 167.111svh); height: min(697.5px, 52.875vw, 94svh); aspect-ratio: 16 / 9;
  min-width: 0; min-height: 0; margin: 0; padding: clamp(20px, 2.4vw, 34px); border: 2px solid #b78a47; border-radius: 8px;
  background: radial-gradient(ellipse at 28% 10%, #fff9e9 0, transparent 62%), radial-gradient(circle at 80% 90%, rgb(166 104 37 / 12%), transparent 52%), #f2e1bb;
  box-shadow: 0 0 0 4px #e0bc78, 0 0 0 6px #886039, 0 20px 50px rgb(52 32 15 / 24%), inset 0 0 22px rgb(148 96 40 / 12%);
  color: var(--logbook-ink); font-family: "Microsoft YaHei UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
.logbook::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgb(151 105 50 / 34%); border-radius: 3px; pointer-events: none; }
.logbook [hidden] { display: none !important; }
.logbook :where(button, input, textarea) { font: inherit; }
.logbook button, .logbook a { -webkit-tap-highlight-color: transparent; }
.logbook :is(button, a, input, textarea, [tabindex]):focus-visible { outline: 3px solid #8b482b; outline-offset: 3px; }
.logbook__header { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--logbook-line); }
.logbook__eyebrow { margin: 0 0 8px; color: var(--logbook-muted); font-size: 12px; letter-spacing: .1em; }
.logbook__header h1 { margin: 0; color: var(--logbook-red); font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif; font-size: clamp(30px, 3.2vw, 46px); font-weight: 800; letter-spacing: .08em; line-height: 1.15; text-shadow: 0 1px 0 #fff6d7; }
.logbook__intro { margin: 8px 0 0; font-size: 13px; color: var(--logbook-muted); line-height: 1.5; }
.logbook__local-notice { flex: 0 0 auto; margin: -8px 0 0; padding: 9px 12px; border-left: 3px solid #a67536; background: #f9ebc7; color: #684429; font-size: 12px; line-height: 1.6; }
.logbook[data-logbook-mode="readonly"] .logbook__footer { margin-top: auto; }
.logbook__tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; max-width: 360px; }
.logbook__button, .logbook__text-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid #ac8147; border-radius: 4px; background: #f9edce; color: #513820; font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; cursor: pointer; transition: background-color .18s ease, border-color .18s ease, transform .18s ease; }
.logbook__button:hover { background: #eed39d; border-color: #876035; }
.logbook__button:active, .logbook__text-button:active, .logbook__step:active { transform: translateY(1px); }
.logbook__button--primary { color: #fff8e8; border-color: #81482b; background: #8b4d2d; }
.logbook__button--primary:hover { background: #703c25; }
.logbook__text-button { border-color: transparent; background: transparent; color: #754127; padding-inline: 9px; text-decoration: underline; text-underline-offset: 4px; }
.logbook__text-button:hover { background: rgb(181 129 57 / 12%); }
.logbook button:disabled { opacity: .42; cursor: default; transform: none; }
.logbook__body { display: grid; grid-template-columns: minmax(145px, 21%) minmax(0, 1fr) 44px; flex: 1 1 0; min-height: 0; gap: clamp(14px, 2vw, 28px); }
.logbook__index { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 15px 8px 3px; border-right: 1px solid var(--logbook-line); scrollbar-width: thin; scrollbar-color: #ac8147 transparent; }
.logbook__index h2 { margin: 2px 0 12px; font-family: "Noto Serif SC", "STSong", serif; color: #624426; font-size: 17px; font-weight: 700; }
.logbook__index ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.logbook__index button { display: block; width: 100%; min-height: 56px; padding: 10px 10px 10px 13px; border: 0; border-left: 3px solid transparent; border-radius: 0 3px 3px 0; background: transparent; color: #5c432e; text-align: left; cursor: pointer; transition: background-color .18s ease, border-color .18s ease; }
.logbook__index button:hover { background: rgb(200 156 85 / 12%); }
.logbook__index button[aria-current="true"] { border-left-color: #94472d; background: #e8d0a0; color: #542c1d; }
.logbook__index time { display: block; margin-bottom: 4px; font-size: 12px; font-variant-numeric: tabular-nums; color: #725637; }
.logbook__index span { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.logbook__reading { position: relative; min-width: 0; min-height: 0; }
.logbook__entries, .logbook__editor { height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #aa7b42 transparent; scroll-padding-top: 8px; }
.logbook__entries { padding: 0 14px 16px 3px; }
.logbook__entry { position: relative; padding: 18px 6px 24px; border-bottom: 1px solid rgb(170 122 66 / 40%); scroll-margin-top: 5px; }
.logbook__entry:first-child { padding-top: 6px; }
.logbook__entry:last-child { border-bottom: 0; }
.logbook__entry.is-current h2 { color: #853f2a; }
.logbook__entry-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; color: var(--logbook-muted); font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.logbook__entry-meta span { padding-left: 12px; border-left: 1px solid #b99560; }
.logbook__entry h2 { margin: 8px 0 10px; color: #57402a; font-family: "Noto Serif SC", "STSong", serif; font-size: clamp(20px, 1.9vw, 27px); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; text-wrap: pretty; }
.logbook__entry p { margin: 0; max-width: 65ch; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; white-space: pre-wrap; }
.logbook__tags { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 14px 0 0; padding: 0; color: #775133; font-size: 12px; line-height: 1.6; }
.logbook__tags li::before { content: "·"; margin-right: 5px; color: #94472d; }
.logbook__empty { padding: 28px 10px; color: var(--logbook-muted); font-size: 15px; line-height: 1.8; }
.logbook__rail { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 0; padding: 3px 0; }
.logbook__step { flex: 0 0 44px; display: grid; place-items: center; width: 44px; height: 44px; padding: 8px; border: 1px solid #ae844c; border-radius: 50%; background: #f8edcf; color: #754627; cursor: pointer; transition: background-color .18s ease, transform .18s ease; }
.logbook__step:hover { background: #e9cf97; }
.logbook__step svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logbook__rail input { flex: 1 1 auto; min-height: 40px; width: 30px; height: 100%; margin: 0; writing-mode: vertical-lr; direction: ltr; accent-color: #946033; cursor: pointer; }
.logbook__footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding-top: 14px; border-top: 1px solid var(--logbook-line); }
.logbook__feedback { display: flex; min-width: 0; align-items: baseline; gap: 14px; }
.logbook__count { flex: 0 0 auto; color: #704828; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.logbook__feedback p { margin: 0; color: #6d5137; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.logbook__feedback p[data-kind="error"] { color: #8b3426; }
.logbook__feedback p[data-kind="success"] { color: #3e5a36; }
.logbook__back { flex: 0 0 auto; }
.logbook__editor { padding: 2px 9px 10px 3px; }
.logbook__editor-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 16px; }
.logbook__editor-heading h2 { margin: 0; color: #853f2a; font-family: "Noto Serif SC", "STSong", serif; font-size: 22px; }
.logbook__editor-heading span { color: var(--logbook-muted); font-size: 12px; }
.logbook__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.logbook__fields label { display: grid; min-width: 0; gap: 6px; color: #614329; font-size: 13px; font-weight: 600; }
.logbook__field-wide { grid-column: 1 / -1; }
.logbook__fields input, .logbook__fields textarea { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid #b99863; border-radius: 3px; background: #fff7e3; color: #493321; font-size: 15px; line-height: 1.6; }
.logbook__fields textarea { min-height: 118px; resize: vertical; }
.logbook__form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
.logbook__form-error { padding: 10px 12px; border-left: 3px solid #963f2d; background: #f3ddbf; color: #7d3022; font-size: 13px; line-height: 1.65; }
.logbook__guard { flex: 0 0 auto; padding: 12px 16px; border: 1px solid #b78849; background: #fff3d6; box-shadow: 0 3px 12px rgb(106 67 30 / 12%); }
.logbook__guard p { margin: 0 0 9px; color: #763e25; font-size: 14px; }
.logbook__guard > div { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  .logbook-page { padding: 10px; }
  .logbook { width: calc(100vw - 20px); height: calc(100svh - 20px); aspect-ratio: auto; gap: 14px; padding: 20px 15px 16px; border-radius: 5px; }
  .logbook::before { inset: 6px; }
  .logbook__header { align-items: flex-start; gap: 12px; padding-bottom: 12px; }
  .logbook__eyebrow { font-size: 11px; letter-spacing: .02em; }
  .logbook__header h1 { font-size: 32px; }
  .logbook__intro { max-width: 16em; font-size: 12px; }
  .logbook__tools { flex: 0 0 96px; gap: 4px; }
  .logbook__tools .logbook__button, .logbook__tools .logbook__text-button { width: 100%; padding: 7px 8px; min-height: 38px; font-size: 12px; }
  .logbook__body { grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; }
  .logbook__index { display: none; }
  .logbook__entries { padding-right: 6px; }
  .logbook__entry { padding: 15px 2px 21px; }
  .logbook__entry h2 { font-size: 21px; }
  .logbook__entry p { font-size: 15px; }
  .logbook__rail { gap: 12px; }
  .logbook__footer { align-items: flex-end; gap: 12px; padding-top: 12px; }
  .logbook__feedback { flex-direction: column; gap: 4px; }
  .logbook__feedback p { font-size: 11px; }
  .logbook__back { padding-inline: 11px; font-size: 13px; }
  .logbook__fields { grid-template-columns: 1fr; gap: 12px; }
  .logbook__editor-heading h2 { font-size: 20px; }
  .logbook__guard { padding: 10px; }
  .logbook__guard .logbook__button, .logbook__guard .logbook__text-button { font-size: 12px; padding-inline: 9px; }
}
@media (min-width: 761px) and (max-height: 540px) {
  .logbook { gap: 10px; padding: 16px 22px; }
  .logbook__header { padding-bottom: 9px; }
  .logbook__eyebrow, .logbook__intro { display: none; }
  .logbook__header h1 { font-size: 30px; }
  .logbook__footer { padding-top: 8px; }
  .logbook__body { grid-template-columns: minmax(125px, 22%) minmax(0, 1fr) 44px; gap: 14px; }
  .logbook__tools { gap: 5px; }
  .logbook__tools .logbook__button, .logbook__tools .logbook__text-button { min-height: 38px; padding: 7px 9px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .logbook *, .logbook *::before, .logbook *::after { scroll-behavior: auto !important; transition: none !important; } }
