/* 同步新版原型：独立横封、桌面三列、平板左侧双封面、手机资料展开后显示横封。 */
.detail-page { max-width: 1080px; margin: 28px auto 0; --detail-surface: oklch(.975 .01 280); }
.detail-hero { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.detail-primary { display: grid; grid-template-columns: 196px minmax(0, 1fr); align-items: start; gap: 24px; }
.detail-media, .detail-tools { min-width: 0; }
.detail-primary:not(.has-wide-cover) { row-gap: 12px; }
.detail-primary:not(.has-wide-cover) .detail-media { grid-row: 1 / 3; }
.detail-primary:not(.has-wide-cover) .detail-tools { grid-column: 2; }
.detail-tools { display: grid; align-content: start; gap: 12px; }
.detail-primary.has-wide-cover { grid-template-columns: 180px minmax(0, 1fr) 224px; gap: 20px; }
.detail-primary.has-wide-cover .detail-cover { width: 180px; height: 248px; }
.detail-primary.has-wide-cover .detail-actions { flex-direction: column; align-items: stretch; }
.detail-primary.has-wide-cover .detail-button { width: 100%; min-width: 0; }
.detail-primary.has-wide-cover .detail-facts { column-gap: 16px; }
.detail-primary.has-wide-cover .detail-facts > div { grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
.detail-primary.has-wide-cover .detail-facts time { font-size: 12px; }
.detail-wide-cover { width: 100%; aspect-ratio: 5 / 3; margin: 0; align-self: start; overflow: hidden; border-radius: 8px; background: var(--surface); }
.detail-wide-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.detail-cover { width: 196px; height: 270px; border-radius: 8px; box-shadow: 0 2px 5px oklch(.25 .04 280 / .07); }
.detail-cover::after { display: none; }
.detail-info { min-width: 0; display: grid; align-content: start; gap: 12px; }
.detail-heading-authors, .detail-more-toggle { display: none; }
.detail-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.detail-title-row h1 { font-size: 28px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
.detail-status { padding: 4px 8px; border: 1px solid oklch(.78 .035 280); border-radius: 8px; background: oklch(.92 .035 280); color: oklch(.36 .10 280); font-size: 12px; white-space: nowrap; }
.detail-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "authors rating" "category tags" "frequency language" "region published" "updated updated" "edited edited"; gap: 4px 24px; margin: 0; min-width: 0; }
.detail-fact-authors { grid-area: authors; }
.detail-fact-rating { grid-area: rating; }
.detail-fact-category { grid-area: category; }
.detail-fact-tags { grid-area: tags; }
.detail-fact-frequency { grid-area: frequency; }
.detail-fact-updated { grid-area: updated; }
.detail-fact-region { grid-area: region; }
.detail-fact-language { grid-area: language; }
.detail-fact-edited { grid-area: edited; }
.detail-fact-published { grid-area: published; }
.detail-facts > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; min-height: 28px; align-items: center; }
.detail-facts dt { color: var(--muted); font-size: 12px; line-height: 28px; }
.detail-facts dd { margin: 0; min-width: 0; font-size: 13px; line-height: 28px; overflow-wrap: anywhere; }
.detail-facts a { color: var(--primary); }
.detail-fact-rating dd { display: flex; align-items: baseline; gap: 6px; }
.detail-fact-rating strong { font-size: 18px; }
.detail-fact-rating span { font-size: 12px; color: var(--muted); }
.detail-facts time { font-weight: 500; font-variant-numeric: tabular-nums; }
.detail-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.detail-tag { flex: 0 0 auto; max-width: 100%; padding: 2px 8px; border: 1px solid oklch(.85 .025 280); border-radius: 6px; font-size: 12px; line-height: 22px; color: oklch(.43 .085 280); background: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-tags.is-compact { flex-wrap: nowrap; }
.detail-tags.is-expanded .detail-tag { white-space: normal; overflow-wrap: anywhere; }
.detail-tags-toggle { flex: 0 0 auto; min-width: 36px; min-height: 28px; padding: 2px 6px; border: 0; border-radius: 6px; font-size: 12px; line-height: 22px; font-variant-numeric: tabular-nums; color: var(--primary); background: var(--lavender); cursor: pointer; }
.detail-tags-toggle:hover { background: oklch(.93 .025 280); }
.detail-tags-toggle[hidden], .detail-tag[hidden] { display: none; }
.detail-tags .detail-tags-empty { padding: 0; border: 0; background: none; color: var(--muted); }
.detail-actions { display: flex; align-items: center; gap: 8px; }
.detail-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; min-height: 48px; min-width: 150px; padding: 0 18px; border-radius: 8px; font-size: 14px; }
.detail-button.primary { color: white; background: var(--primary); min-width: 172px; }
.detail-button.secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
.detail-button.unavailable { color: var(--muted); background: var(--surface); }
.detail-button[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); }
.detail-button:hover { filter: brightness(.96); }
.detail-overview { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 20px; }
.detail-synopsis { min-width: 0; }
.detail-synopsis h2 { font-size: 14px; margin: 0 0 8px; line-height: 24px; }
.detail-description { max-width: 76ch; margin: 0; font-size: 14px; line-height: 1.85; white-space: pre-line; overflow-wrap: anywhere; color: oklch(.41 .025 280); }
.detail-description.is-collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.description-toggle { min-height: 44px; padding: 0 8px; margin: 4px 0 -8px -8px; border: 0; background: none; color: var(--primary); font-size: 12px; }
.detail-content { display: grid; grid-template-columns: minmax(0, 1fr) 256px; gap: 24px; padding-top: 20px; align-items: start; }
.detail-content.without-related { grid-template-columns: 1fr; }
.chapter-section, .detail-related { min-width: 0; }
.chapter-heading, .related-heading { display: flex; align-items: center; gap: 8px; min-height: 52px; margin: 0 0 12px; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.chapter-heading { justify-content: space-between; }
.chapter-heading-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.chapter-heading h2 { margin: 0; font-size: 20px; }
.chapter-directory-edited { font-size: 12px; font-weight: 400; line-height: 1.6; color: var(--muted); }
.chapter-directory-edited time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.chapter-heading button { min-height: 44px; padding: 8px 12px; flex-shrink: 0; border: 0; background: none; }
.chapter-ranges { display: flex; flex-wrap: wrap; gap: 8px; }
.chapter-ranges button { min-height: 44px; width: 144px; padding: 8px 16px; border: 1px solid var(--line); background: white; border-radius: 8px; font-size: 13px; }
.chapter-ranges button[aria-pressed="true"] { background: var(--primary); color: white; border-color: var(--primary); }
.chapter-range-status { color: var(--muted); font-size: 12px; margin: 14px 0; }
.chapter-range-status:empty { display: none; }
/* 章节卡片只展示名称和阅读状态，不展示或加载章节封面。 */
.chapters-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.chapter-entry { position: relative; min-width: 0; }
.chapter-entry > a { min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 7px; min-height: 52px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.4; background: white; }
.chapter-number { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-entry > a:hover, .chapter-entry > a:focus-visible { color: var(--primary); border-color: var(--primary); background: var(--lavender); }
.chapter-entry > a.current { border: 2px solid var(--primary); background: var(--lavender); color: var(--primary); box-shadow: 2px 3px 0 var(--comic-outline); }
.chapter-last-read { font-size: 11px; color: white; background: var(--primary); padding: 3px 6px; border-radius: 6px; }
.related-heading { justify-content: space-between; flex-wrap: wrap; }
.related-heading h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 16px; }
.related-heading button { border: 0; background: none; padding: 0 4px; color: var(--primary); }
.related-list { display: grid; gap: 12px; }
.related-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; background: transparent; }
.related-item:hover { background: var(--lavender); }
.related-cover { position: relative; flex: 0 0 64px; width: 64px; height: 88px; background: var(--lavender) url("../images/logo.svg") center / 30px no-repeat; border-radius: 8px; }
.related-cover img { border-radius: 8px; }
.related-cover .cover-feedback { padding: 0; font-size: 11px; }
.related-cover .cover-retry { padding: 4px; min-width: 44px; }
.related-copy { min-width: 0; }
.related-copy h3 { font-size: 13px; margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.related-copy p, .related-copy > span { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 6px 0 0; }
.detail-empty { padding: 32px 20px; background: var(--surface); border-radius: 10px; line-height: 1.9; color: var(--muted); }
.detail-empty a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.comic-notice { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 8px; background: var(--ink); color: white; z-index: 40; font-size: 13px; }
.comic-notice:empty { display: none; }
@media (min-width: 761px) and (max-width: 1100px) {
    .detail-primary { grid-template-columns: 164px minmax(0, 1fr); gap: 18px; }
    .detail-cover { width: 164px; height: 226px; }
    .detail-primary.has-wide-cover { grid-template-columns: 164px minmax(0, 1fr); grid-template-rows: minmax(344px, auto) auto; gap: 18px; }
    .detail-primary.has-wide-cover .detail-cover { width: 164px; height: 226px; }
    .detail-primary.has-wide-cover .detail-media { grid-column: 1; grid-row: 1; }
    .detail-primary.has-wide-cover .detail-info { grid-column: 2; grid-row: 1; }
    .detail-primary.has-wide-cover .detail-tools { display: contents; }
    .detail-primary.has-wide-cover .detail-wide-cover { grid-column: 1; grid-row: 1; align-self: end; }
    .detail-primary.has-wide-cover .detail-actions { grid-column: 1 / -1; grid-row: 2; flex-direction: row; }
    .detail-primary.has-wide-cover .detail-button { width: auto; min-width: 150px; }
    .detail-facts > div, .detail-primary.has-wide-cover .detail-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; align-content: start; }
    .detail-facts dt { line-height: 20px; }
    .detail-facts dd, .detail-facts time { font-size: 12px; }
    .detail-content { grid-template-columns: minmax(0, 1fr) 224px; }
    .chapter-heading, .related-heading { min-height: 72px; }
    .chapters-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
}
@media (max-width: 760px) {
    .detail-page { margin-top: 20px; }
    .detail-hero { padding: 16px; background: white; border-color: oklch(.93 .008 280); }
    .detail-primary, .detail-primary.has-wide-cover { grid-template-columns: 96px minmax(0, 1fr); gap: 16px 14px; }
    .detail-media, .detail-primary:not(.has-wide-cover) .detail-media { grid-column: 1; grid-row: 1; }
    .detail-cover, .detail-primary.has-wide-cover .detail-cover { width: 96px; height: 132px; }
    .detail-info, .detail-tools { display: contents; }
    .detail-heading { min-width: 0; grid-column: 2; grid-row: 1; align-self: center; }
    .detail-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .detail-title-row h1 { font-size: 23px; }
    .detail-status { font-size: 11px; padding: 2px 7px; }
    .detail-subtitle { margin-top: 8px; font-size: 12px; }
    .detail-heading-authors { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 0; font-size: 12px; line-height: 1.7; }
    .detail-heading-authors > span:first-child { flex-shrink: 0; color: var(--muted); }
    .detail-heading-authors > span:last-child { min-width: 0; overflow-wrap: anywhere; }
    .detail-facts, .detail-actions { grid-column: 1 / -1; }
    .detail-actions, .detail-primary.has-wide-cover .detail-actions { grid-column: 1 / -1; grid-row: 2; flex-direction: row; align-items: center; }
    .detail-facts { grid-row: 3; grid-template-areas: "rating rating" "category tags" "frequency frequency" "language published" "region region" "updated updated" "edited edited"; gap: 12px 16px; }
    .detail-facts > div, .detail-primary.has-wide-cover .detail-facts > div { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 2px; min-height: 0; }
    .detail-enhanced .detail-facts { display: none; }
    .detail-enhanced .detail-info.is-expanded .detail-facts { display: grid; }
    .detail-facts > .detail-fact-authors, .detail-primary.has-wide-cover .detail-fact-authors { display: none; }
    .detail-facts > .detail-fact-frequency, .detail-primary.has-wide-cover .detail-fact-frequency { grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
    .detail-facts dt { font-size: 11px; line-height: 18px; }
    .detail-facts dd { font-size: 13px; line-height: 22px; }
    .detail-facts time { font-size: 12px; font-weight: 500; }
    .detail-tags-toggle { min-width: 44px; min-height: 44px; }
    .detail-actions .detail-button, .detail-actions .detail-button.primary { min-width: 0; padding: 0 6px; flex: 1 1 0; gap: 6px; font-size: 13px; white-space: nowrap; }
    .detail-more-toggle { display: inline-flex; flex: 0 0 48px; justify-content: center; align-items: center; gap: 2px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 8px; color: var(--primary); background: transparent; }
    .detail-more-toggle:hover, .detail-more-toggle[aria-expanded="true"] { background: var(--lavender); }
    .detail-info-symbol { width: 20px; height: 20px; }
    .detail-info-chevron { width: 12px; height: 12px; transform: rotate(90deg); transition: transform .18s; }
    .detail-more-toggle[aria-expanded="true"] .detail-info-chevron { transform: rotate(-90deg); }
    .detail-wide-cover { display: none; }
    .detail-enhanced:has(.detail-info.is-expanded) .detail-wide-cover { display: block; width: min(100%, 320px); grid-column: 1 / -1; grid-row: 4; }
    .detail-overview { margin-top: 16px; padding-top: 16px; }
    .detail-description { font-size: 13px; line-height: 1.9; }
    .detail-content { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
    .chapter-heading, .related-heading { min-height: 68px; }
    .chapter-heading-title { flex-direction: column; align-items: flex-start; }
    .chapter-ranges { gap: 10px; }
    .chapter-ranges button { width: 132px; padding: 12px; font-size: 12px; }
    .chapters-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 14px; }
    .chapter-entry > a { min-height: 56px; }
}
.detail-more-toggle[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
    .detail-info-chevron { transition: none; }
}
