/* Book details */
.book-page { padding-top: 36px; padding-bottom: 20px; }
.book-breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 16px; margin-bottom: 32px; }
.book-breadcrumbs a:hover { color: var(--brand-red); }
.book-breadcrumbs [aria-current] { color: var(--ink); overflow-wrap: anywhere; }
.book-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 44px; }
.book-content { min-width: 0; }
.book-detail { display: flex; align-items: flex-start; gap: 40px; }
.detail-cover { flex: 0 0 auto; width: min(30%, 300px); padding: 0; border: 0; border-radius: 10px; background: transparent; }
.detail-cover img { width: 100%; height: auto; border-radius: 10px; }
.detail-copy { min-width: 0; flex: 1; }
.detail-status { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 15px; }
.status-badge { padding: 5px 10px; border-radius: 6px; background: #f8e3e2; color: var(--ink); font: 600 11px var(--serif); letter-spacing: .05em; }
.detail-copy h1 { margin: 18px 0; font: 400 clamp(34px, 3.5vw, 54px)/1.12 var(--serif); letter-spacing: -1.2px; overflow-wrap: anywhere; }
.detail-description { margin: 24px 0; white-space: pre-line; font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag { padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; font-size: 15px; }
a.tag:hover { color: var(--brand-red); border-color: var(--brand-red); }
.detail-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; }
.book-action, .book-action-primary { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink); font: 600 14px var(--serif); text-align: center; }
.book-action-primary { border-color: var(--ink); background: var(--ink); color: white; }
.book-action:not(:disabled):hover { border-color: var(--brand-red); color: var(--brand-red); }
.book-action:disabled, .book-action-primary:disabled { opacity: .5; cursor: default; }
.book-share { width: 48px; padding: 12px; }
.book-share svg { width: 22px; height: 22px; }
.book-action-message { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.book-action-message:empty { display: none; }
.chapters-section { position: relative; margin-top: 60px; border-top: 1px solid var(--line); padding-top: 26px; }
.chapters-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 16px; }
.chapters-section:has(.chapters-more) .chapters-heading { padding-right: 165px; min-height: 38px; }
.chapters-heading h2 { margin: 0; color: var(--ink); font: 400 26px var(--serif); }
.chapters-heading h2 span { display: inline-block; padding: 3px 8px; border-radius: 8px; background: #f1e8e6; font: 15px var(--body-font); vertical-align: middle; }
.chapter-list { list-style: none; padding: 0; margin: 22px 0 0; }
.chapter-list li { border: 1px solid var(--line); border-radius: 8px; }
.chapter-list li + li { margin-top: -1px; }
.chapters-more summary { position: absolute; top: 26px; right: 0; display: inline-flex; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font: 500 13px var(--serif); }
.chapters-more summary::-webkit-details-marker { display: none; }
.chapters-more summary:hover { color: var(--brand-red); }
.chapters-more .chapters-collapse, .chapters-more[open] .chapters-expand { display: none; }
.chapters-more[open] .chapters-collapse { display: inline; }
.chapters-more .chapter-list { margin-top: -1px; }

.chapter-list a { display: flex; align-items: center; gap: 24px; padding: 17px 20px; }
.chapter-list a:hover { color: var(--brand-red); }
.chapter-number { color: var(--muted); min-width: 24px; font-size: 16px; }
.chapter-title { font: 500 18px var(--serif); overflow-wrap: anywhere; }
.chapter-arrow { margin-left: auto; font-size: 22px; }
.book-sidebar { border-left: 1px solid var(--line); padding-left: 36px; min-width: 0; }
.book-stats { display: grid; gap: 14px; list-style: none; margin: 0; padding: 4px 0 28px; font: 500 14px var(--serif); }
.book-stats li { display: flex; align-items: center; gap: 14px; }
.book-stats li span { width: 22px; text-align: center; font-size: 22px; }
.sidebar-section { border-top: 1px solid var(--line); padding: 24px 0 28px; }
.sidebar-section h2 { margin: 0 0 20px; font: 600 12px var(--serif); letter-spacing: .13em; text-transform: uppercase; }
.author-card { display: flex; align-items: flex-start; gap: 14px; }
.author-avatar { display: grid; place-items: center; flex: 0 0 54px; height: 54px; border-radius: 50%; background: #efe4e1; }
.author-avatar img { width: 26px; height: 26px; }
.author-card strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.author-profile { margin-top: 12px; font-size: 12px; min-height: 40px; }
.similar-books { display: grid; gap: 16px; }
.similar-book { display: flex; align-items: center; gap: 14px; min-width: 0; }
.similar-book img { width: 58px; height: 76px; flex: 0 0 58px; object-fit: contain; border-radius: 5px; }
.similar-book span { min-width: 0; }
.similar-book strong, .similar-book small { display: block; overflow-wrap: anywhere; }
.similar-book strong { font-size: 14px; }
.similar-book small { margin-top: 4px; color: var(--muted); font-size: 15px; }
.similar-book:hover strong { color: var(--brand-red); }
.cover-dialog { max-width: calc(100% - 32px); max-height: calc(100% - 32px); padding: 44px 16px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.cover-dialog::backdrop { background: #19141180; backdrop-filter: blur(5px); }
.cover-dialog img { display: block; max-width: min(100%, 90vw); max-height: calc(100vh - 110px); width: auto; height: auto; border-radius: 6px; }
.cover-dialog-close { position: absolute; right: 10px; top: 4px; width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font: 30px/1 system-ui, sans-serif; }
.cover-dialog-close:hover { color: var(--ink); }
@media (max-width: 1050px) { .book-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 25px; } .book-sidebar { padding-left: 24px; } .book-detail { gap: 24px; } }
@media (max-width: 760px) { .book-layout { grid-template-columns: 1fr; } .book-sidebar { border-left: 0; border-top: 1px solid var(--line); padding: 26px 0 0; } .book-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .detail-cover { width: min(38%, 240px); } .chapters-section { position: relative; margin-top: 40px; } }
@media (max-width: 480px) { .book-page { padding-top: 24px; } .book-detail { flex-direction: column; } .detail-cover { width: min(70%, 240px); } .detail-copy h1 { font-size: 32px; } .detail-actions { align-items: stretch; } .book-action-primary { flex: 1 1 100%; } .book-action:not(.book-share) { flex: 1; } }

.library-confirm { width: min(420px, calc(100% - 32px)); padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.library-confirm::backdrop { background: #19141180; backdrop-filter: blur(5px); }
.library-confirm h2 { margin: 0; font: 500 24px var(--serif); }
.library-confirm p { font-size: 18px; overflow-wrap: anywhere; }
.library-confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.library-confirm-error { color: #ad2929; }
.library-confirm-error:empty { display: none; }
