:root {
  color-scheme: light;
  --navy: #17253b;
  --navy-deep: #0c1729;
  --ink: #222b36;
  --muted: #687486;
  --paper: #fbfaf7;
  --line: #dfe4e8;
  --accent: #9b6c48;
  --accent-soft: #efe4d9;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: inherit; }
.preview-badge { position: fixed; z-index: 20; top: .7rem; right: .7rem; padding: .35rem .65rem; border: 1px solid rgba(155, 108, 72, .4); border-radius: 999px; color: #6e4b32; background: rgba(239, 228, 217, .94); font-size: .72rem; letter-spacing: .04em; }
.landing { min-height: 100svh; overflow: hidden; background: linear-gradient(145deg, #0c1729 0%, #17253b 58%, #2b4055 100%); color: #f6f1e8; }
.landing-main { position: relative; min-height: 100svh; max-width: 1200px; margin: auto; padding: clamp(2.5rem, 9vw, 7rem) clamp(1.5rem, 7vw, 7rem); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.landing-wordmark { position: relative; z-index: 3; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.5rem, 10vw, 8rem); letter-spacing: .05em; text-shadow: 0 0 30px rgba(250, 244, 226, .14); }
.landing-books-button { position: relative; z-index: 3; margin: 2.5rem 0 0 1.2rem; padding: .8rem 2.4rem; border: 1px solid rgba(246, 241, 232, .65); border-radius: 999px; text-decoration: none; letter-spacing: .16em; transition: background .2s ease, color .2s ease, transform .2s ease; }
.landing-books-button:hover, .landing-books-button:focus-visible { color: var(--navy-deep); background: #f6f1e8; transform: translateY(-2px); }
.landing-art { position: absolute; z-index: 1; right: 0; bottom: -3svh; width: min(36vw, 760px); max-height: 88svh; object-fit: contain; object-position: bottom right; opacity: .93; pointer-events: none; }
.books-shell, .detail-shell { width: min(980px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 5rem; }
.books-shell { position: relative; }
.books-art { position: fixed; z-index: 0; right: 0; bottom: 0; width: min(34vw, 360px); max-height: 55vh; object-fit: contain; object-position: right bottom; opacity: .18; pointer-events: none; }
.catalog-section { position: relative; z-index: 1; padding-right: min(34vw, 360px); }
.books-header { position: relative; z-index: 1; padding: .5rem 0 1.5rem; }
.small-brand, .back-link { color: var(--muted); text-decoration: none; font-size: .88rem; }
.small-brand:hover, .back-link:hover { color: var(--accent); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { margin: 1.5rem 0 .25rem; font-size: clamp(2.3rem, 6vw, 4.6rem); color: var(--navy); }
h2 { margin: 0 0 .7rem; font-size: 1.2rem; color: var(--navy); }
.books-subtitle { margin: 0; color: var(--muted); }
.update-panel, .catalog-controls, .book-list, .empty-state { position: relative; z-index: 1; }
.update-panel { margin: 1rem 0 1.5rem; padding: 1.1rem 1.25rem; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.update-panel p { margin: .25rem 0 0; }
.update-panel time { color: var(--muted); font-size: .88rem; }
.catalog-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 10rem; gap: .7rem; align-items: center; margin: 1.5rem 0; }
.search-label, .sort-label { color: var(--muted); font-size: .9rem; }
input, select { min-height: 2.65rem; border: 1px solid var(--line); border-radius: .5rem; padding: .55rem .7rem; color: var(--ink); background: #fff; font: inherit; }
input:focus, select:focus { outline: 2px solid rgba(155, 108, 72, .35); outline-offset: 1px; }
.book-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.book-list li { border-bottom: 1px solid var(--line); }
.book-list a { display: block; padding: 1rem .2rem; text-decoration: none; font-size: 1.04rem; }
.book-list a:hover, .book-list a:focus-visible { color: var(--accent); padding-left: .6rem; }
.empty-state { color: var(--muted); padding: 1rem .2rem; }
.detail-shell { position: relative; }
.book-detail { padding: 2rem 0; }
.detail-navigation { display: flex; justify-content: flex-end; align-items: center; gap: .55rem; min-height: 2.75rem; margin: 0 0 .25rem; }
.detail-nav-arrow { display: inline-flex; align-items: center; justify-content: center; width: 2.35rem; height: 2.35rem; border: 1px solid var(--line); border-radius: 50%; color: var(--navy); text-decoration: none; font-size: 1.25rem; line-height: 1; }
.detail-nav-arrow:hover, .detail-nav-arrow:focus-visible { border-color: var(--accent); color: var(--accent); }
.detail-nav-count { min-width: 3.2rem; color: var(--muted); font-size: .82rem; text-align: center; }
.detail-layout { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: .35rem; box-shadow: 0 12px 30px rgba(12, 23, 41, .14); background: #eee; }
.share-button { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; margin-top: .75rem; border: 1px solid var(--line); border-radius: 50%; color: var(--navy); background: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.share-button:hover, .share-button:focus-visible { border-color: var(--accent); color: var(--accent); }
.detail-copy h1 { margin-top: 0; font-size: clamp(2rem, 5vw, 3.4rem); }
.synopsis { margin: 1.25rem 0; color: #485362; line-height: 1.8; }
.synopsis-text { white-space: pre-line; }
.synopsis-text.is-collapsed { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.synopsis-toggle { margin-top: .35rem; border: 0; padding: 0; color: var(--accent); background: transparent; cursor: pointer; font: inherit; }
.synopsis-toggle:hover, .synopsis-toggle:focus-visible { text-decoration: underline; }
.volume-list { margin: 1rem 0 2rem; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.volume-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .85rem .2rem; border-bottom: 1px solid var(--line); }
.volume-label { min-width: 0; color: var(--navy); line-height: 1.45; }
.volume-size { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.volume-total { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.volume-meta { display: inline-flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.download-icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.volume-download { display: inline-flex; align-items: center; justify-content: center; color: var(--navy); min-width: 2.75rem; min-height: 2.75rem; text-decoration: none; }
.volume-download:hover, .volume-download:focus-visible { color: var(--accent); }
.bundle-panel { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.bundle-button, .bundle-cancel { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: .45rem; padding: .65rem 1rem; color: var(--navy); background: transparent; font: inherit; cursor: pointer; }
.bundle-button:hover, .bundle-button:focus-visible { border-color: var(--accent); color: var(--accent); }
.bundle-button:disabled { opacity: .55; cursor: wait; }
.bundle-cancel[hidden] { display: none; }
.bundle-status { color: var(--muted); font-size: .85rem; }
.rating-panel { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.rating-stars { display: inline-flex; gap: .2rem; }
.rating-star { border: 0; padding: 0; color: #b8bec5; background: transparent; cursor: pointer; font-size: 1.7rem; }
.rating-star.is-filled, .rating-star:hover, .rating-star:focus-visible { color: #b27b2d; }
.rating-summary, .totals { color: var(--muted); font-size: .82rem; }
.totals { margin-top: 1rem; }
.rating-hint { margin: .7rem 0; color: #596573; line-height: 1.6; }
.comments-panel { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.comments-toggle, .comments-more { border: 0; padding: 0; color: var(--navy); background: transparent; cursor: pointer; font: inherit; }
.comments-toggle:hover, .comments-toggle:focus-visible, .comments-more:hover, .comments-more:focus-visible { color: var(--accent); text-decoration: underline; }
.comments-body { margin-top: .8rem; }
.comments-list { display: grid; gap: .55rem; }
.comments-empty { margin: 0; color: var(--muted); font-size: .86rem; }
.comment-item { padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .4rem; background: rgba(255,255,255,.5); }
.comment-item header { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .78rem; }
.comment-item header strong { color: var(--ink); font-weight: 500; }
.comment-item p { margin: .35rem 0 0; white-space: pre-line; line-height: 1.55; }
.comment-delete { margin-top: .45rem; border: 0; padding: 0; color: var(--muted); background: transparent; font: inherit; font-size: .78rem; cursor: pointer; }
.comment-delete:hover, .comment-delete:focus-visible { color: var(--accent); text-decoration: underline; }
.comments-more { margin-top: .65rem; font-size: .86rem; }
.comments-form { display: grid; gap: .55rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.comments-form label { display: grid; gap: .25rem; color: var(--muted); font-size: .82rem; }
.comments-form input, .comments-form textarea { width: 100%; min-height: 2.4rem; border: 1px solid var(--line); border-radius: .4rem; padding: .5rem .6rem; color: var(--ink); background: #fff; font: inherit; }
.comments-form textarea { min-height: 5rem; resize: vertical; }
.comments-form button[type=submit] { justify-self: start; border: 1px solid var(--navy); border-radius: .4rem; padding: .5rem .8rem; color: #fff; background: var(--navy); cursor: pointer; font: inherit; }
.comments-form button[type=submit]:disabled { opacity: .55; cursor: wait; }
.comments-status { min-height: 1.2em; margin: 0; color: var(--muted); font-size: .8rem; }
.rating-dialog { width: min(24rem, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: .7rem; padding: 1.2rem; color: var(--ink); background: var(--paper); }
.rating-dialog::backdrop { background: rgba(12, 23, 41, .35); }
.rating-dialog-actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: 1rem; }
.rating-dialog button { border: 1px solid var(--line); border-radius: .4rem; padding: .45rem .85rem; background: #fff; cursor: pointer; }
.rating-dialog .rating-confirm { color: #fff; border-color: var(--navy); background: var(--navy); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { color: var(--muted); }
@media (max-width: 700px) {
  .landing-art { right: -2rem; bottom: 0; width: min(90vw, 520px); max-height: 55svh; opacity: .72; }
  .landing-wordmark { font-size: clamp(3rem, 16vw, 5rem); }
  .books-art { right: 0; bottom: 0; width: min(42vw, 220px); max-height: 42vh; opacity: .12; }
  .catalog-section { padding-right: 0; }
  .catalog-controls { grid-template-columns: 1fr; }
  .search-label, .sort-label { margin-top: .35rem; }
  .detail-layout { grid-template-columns: 110px minmax(0, 1fr); gap: 1rem; }
  .detail-copy h1 { font-size: 1.7rem; }
  .volume-list li { display: flex; align-items: center; gap: .25rem .45rem; min-width: 0; }
  .volume-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .volume-meta { min-width: 0; margin-left: auto; flex-wrap: nowrap; gap: .35rem; }
  .volume-download { min-width: 2.2rem; min-height: 2.2rem; }
  .volume-size, .volume-total { white-space: nowrap; }
}
