﻿@charset "UTF-8";

.topic-detail-page {
    --detail-bg: #fbf7ef;
    --detail-panel: rgba(255, 253, 248, 0.96);
    --detail-panel-soft: rgba(243, 234, 220, 0.58);
    --detail-line: rgba(92, 66, 43, 0.12);
    --detail-line-strong: rgba(172, 103, 43, 0.24);
    --detail-text: #3f3025;
    --detail-heading: #5f3b1f;
    --detail-muted: #746454;
    --detail-dim: #9a8876;
    --detail-accent: #8a5a26;
    --detail-coral: #b85f42;
    --detail-gold: #b7791f;
    --detail-green: #7a8f45;
    --detail-shadow: 0 18px 46px rgba(92, 66, 43, 0.13);
    --detail-radius: 8px;
    --detail-radius-lg: 12px;
    --detail-ease: 180ms ease;
    min-height: calc(100vh - 160px);
    padding: 22px 0 34px;
    background:
        radial-gradient(circle at 8% 5%, rgba(184, 95, 66, 0.08), transparent 30%),
        radial-gradient(circle at 92% 12%, rgba(183, 121, 31, 0.1), transparent 28%),
        linear-gradient(180deg, #fbf7ef 0%, #f7efe2 48%, #fffdf8 100%);
    color: var(--detail-text);
}

.topic-detail-page * {
    box-sizing: border-box;
}

.topic-detail-page a {
    color: inherit;
    text-decoration: none;
}

.topic-detail-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.topic-detail-hero,
.topic-books-panel,
.topic-recommend-panel {
    border: 1px solid var(--detail-line);
    border-radius: var(--detail-radius-lg);
    background: var(--detail-panel);
    box-shadow: var(--detail-shadow);
}

.topic-detail-hero {
    display: grid;
    grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 20px;
}

.topic-detail-cover {
    height: clamp(260px, 28vw, 380px);
    overflow: hidden;
    background: var(--detail-panel-soft);
}

.topic-detail-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.topic-detail-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 22px 24px 22px 0;
}

.topic-detail-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--detail-dim);
    font-size: 12px;
    font-weight: 900;
}

.topic-detail-copy h1,
.topic-section-head h2 {
    margin: 0;
    color: var(--detail-heading);
    font-weight: 900;
    line-height: 1.25;
}

.topic-detail-copy h1 {
    font-size: 28px;
}

.topic-detail-copy p {
    display: -webkit-box;
    margin: 12px 0 0;
    overflow: hidden;
    color: var(--detail-muted);
    font-size: 15px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.topic-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.topic-detail-stats span,
.topic-detail-stats a,
.topic-section-head > a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.topic-detail-stats span {
    padding: 0 12px;
    background: var(--detail-panel-soft);
    color: var(--detail-muted);
}

.topic-detail-stats a,
.topic-section-head > a {
    padding: 0 14px;
    background: linear-gradient(135deg, #a85f2a, #c8892f);
    color: #fff !important;
}

.topic-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 24px;
    align-items: start;
}

.topic-books-panel,
.topic-recommend-panel {
    position: relative;
    overflow: hidden;
    padding: 22px;
}

.topic-books-panel::before,
.topic-recommend-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--detail-coral), var(--detail-gold), var(--detail-green));
}

.topic-recommend-panel {
    position: sticky;
    top: 16px;
}

.topic-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.topic-section-head h2 {
    font-size: 22px;
}

.topic-book-list {
    display: grid;
    gap: 14px;
}

.topic-book-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--detail-line);
    border-radius: var(--detail-radius);
    background: rgba(255, 253, 248, 0.76);
    cursor: pointer;
    transition: transform var(--detail-ease), box-shadow var(--detail-ease), border-color var(--detail-ease);
}

.topic-book-item:hover {
    border-color: var(--detail-line-strong);
    box-shadow: 0 12px 30px rgba(92, 66, 43, 0.11);
    transform: translateY(-2px);
}

.topic-book-cover {
    width: 92px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--detail-radius);
    background: var(--detail-panel-soft);
    box-shadow: 0 12px 22px rgba(92, 66, 43, 0.13);
}

.topic-book-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.topic-book-info {
    min-width: 0;
}

.topic-book-info h3 {
    margin: 0;
    overflow: hidden;
    color: var(--detail-heading);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-book-item:hover .topic-book-info h3 {
    color: var(--detail-accent);
}

.topic-book-info p {
    display: -webkit-box;
    margin: 9px 0 0;
    overflow: hidden;
    color: var(--detail-muted);
    font-size: 14px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.topic-book-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 11px;
}

.topic-book-author {
    max-width: 150px;
    overflow: hidden;
    color: var(--detail-muted);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-tag {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.topic-tag.tag-1 {
    background: var(--detail-coral);
}

.topic-tag.tag-2 {
    background: var(--detail-gold);
}

.topic-tag.tag-3 {
    background: var(--detail-green);
}

.topic-recommend-list {
    display: grid;
    gap: 10px;
}

.topic-recommend-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--detail-line);
    border-radius: var(--detail-radius);
    background: rgba(255, 253, 248, 0.72);
    transition: transform var(--detail-ease), border-color var(--detail-ease), background var(--detail-ease);
}

.topic-recommend-item:hover {
    border-color: var(--detail-line-strong);
    background: rgba(255, 253, 248, 0.96);
    transform: translateY(-1px);
}

.topic-recommend-item img {
    width: 72px;
    aspect-ratio: 16 / 10;
    display: block;
    border-radius: 6px;
    object-fit: cover;
}

.topic-recommend-item span {
    min-width: 0;
    overflow: hidden;
    color: var(--detail-heading);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-detail-empty {
    min-height: 220px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed var(--detail-line-strong);
    border-radius: var(--detail-radius);
    color: var(--detail-muted);
    text-align: center;
}

.topic-detail-empty.compact {
    min-height: 100px;
}

.topic-detail-empty img {
    width: 112px;
    max-width: 36vw;
}

.topic-detail-empty strong {
    color: var(--detail-heading);
    font-size: 18px;
}

@media (max-width: 1024px) {
    .topic-detail-page {
        padding: 14px 0 24px;
    }

    .topic-detail-shell {
        width: min(100% - 24px, 760px);
    }

    .topic-detail-hero,
    .topic-detail-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .topic-detail-copy {
        padding: 16px;
    }

    .topic-detail-cover {
        height: auto;
        aspect-ratio: 16 / 8;
    }

    .topic-books-panel,
    .topic-recommend-panel {
        padding: 14px;
    }

    .topic-recommend-panel {
        position: static;
    }

    .topic-recommend-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .topic-detail-shell {
        width: calc(100% - 20px);
    }

    .topic-detail-copy h1 {
        font-size: 23px;
    }

    .topic-detail-copy,
    .topic-books-panel,
    .topic-recommend-panel {
        padding: 12px;
    }

    .topic-detail-cover {
        aspect-ratio: 16 / 9;
    }

    .topic-book-item {
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .topic-book-cover {
        width: 74px;
    }

    .topic-book-info h3 {
        font-size: 16px;
    }

    .topic-book-info p {
        font-size: 13px;
    }

    .topic-book-author {
        max-width: 100%;
        flex-basis: 100%;
    }

    .topic-recommend-list {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topic-detail-page * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
