﻿@charset "UTF-8";

.topic-page {
    --topic-bg: #fbf7ef;
    --topic-panel: rgba(255, 253, 248, 0.96);
    --topic-panel-soft: rgba(243, 234, 220, 0.58);
    --topic-line: rgba(92, 66, 43, 0.12);
    --topic-line-strong: rgba(172, 103, 43, 0.24);
    --topic-text: #3f3025;
    --topic-heading: #5f3b1f;
    --topic-muted: #746454;
    --topic-dim: #9a8876;
    --topic-accent: #8a5a26;
    --topic-coral: #b85f42;
    --topic-gold: #b7791f;
    --topic-green: #7a8f45;
    --topic-shadow: 0 18px 46px rgba(92, 66, 43, 0.13);
    --topic-radius: 8px;
    --topic-radius-lg: 12px;
    --topic-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(--topic-text);
}

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

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

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

.topic-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--topic-line);
    border-radius: var(--topic-radius-lg);
    background: var(--topic-panel);
    box-shadow: var(--topic-shadow);
}

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

.topic-hero h1 {
    margin: 0;
    color: var(--topic-heading);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
}

.topic-hero p {
    margin: 8px 0 0;
    color: var(--topic-muted);
    font-size: 14px;
}

.topic-hero strong {
    color: var(--topic-accent);
    font-size: 18px;
}

.topic-library-link,
.topic-card-action {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--topic-radius);
    background: linear-gradient(135deg, #a85f2a, #c8892f);
    color: #fff !important;
    font-size: 14px;
    font-weight: 900;
}

.topic-library-link {
    flex: 0 0 auto;
    padding: 0 16px;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.topic-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--topic-line);
    border-radius: var(--topic-radius-lg);
    background: var(--topic-panel);
    box-shadow: var(--topic-shadow);
    transition: transform var(--topic-ease), border-color var(--topic-ease), box-shadow var(--topic-ease);
}

.topic-card:hover {
    border-color: var(--topic-line-strong);
    box-shadow: 0 20px 48px rgba(92, 66, 43, 0.16);
    transform: translateY(-3px);
}

.topic-cover {
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: var(--topic-panel-soft);
}

.topic-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 240ms ease;
}

.topic-card:hover .topic-cover img {
    transform: scale(1.025);
}

.topic-card-body {
    padding: 16px;
}

.topic-card h2 {
    margin: 0;
    overflow: hidden;
    color: var(--topic-heading);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-card p {
    display: -webkit-box;
    min-height: 44px;
    margin: 9px 0 14px;
    overflow: hidden;
    color: var(--topic-muted);
    font-size: 14px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.topic-card-action {
    padding: 0 13px;
}

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

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

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

.topic-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.topic-page-btn,
.topic-page-ellipsis {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--topic-radius);
    font-size: 13px;
    font-weight: 900;
}

.topic-page-btn {
    border: 1px solid var(--topic-line);
    background: #fffdf8;
    color: var(--topic-muted);
    transition: background var(--topic-ease), color var(--topic-ease), transform var(--topic-ease), border-color var(--topic-ease);
}

.topic-page-btn:hover,
.topic-page-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, #a85f2a, #c8892f);
    color: #fff;
    transform: translateY(-1px);
}

.topic-page-btn.disabled {
    pointer-events: none;
    opacity: 0.46;
}

.topic-page-ellipsis {
    color: var(--topic-dim);
}

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

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

    .topic-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .topic-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

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

    .topic-hero,
    .topic-card-body {
        padding: 12px;
    }

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

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

    .topic-page-btn:first-child,
    .topic-page-btn:last-child {
        flex: 1 1 92px;
    }
}

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