.topics-wrap {
    padding-top: 22px;
}

.topics-intro,
.topics-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.topics-intro {
    min-height: 190px;
    padding: 38px 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.topics-intro h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.25;
    letter-spacing: -0.04em;
}

.topics-intro p:last-child {
    max-width: 740px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
}

.topic-count {
    min-width: 110px;
    padding: 16px 20px;
    border-left: 1px solid var(--line);
    flex: 0 0 auto;
    color: #7b8492;
    font-size: 12px;
}

.topic-count strong {
    margin-bottom: 3px;
    display: block;
    color: var(--text);
    font-size: 27px;
}

.topics-panel {
    margin-top: 14px;
    overflow: hidden;
}

.filter-bar {
    min-height: 76px;
    padding: 17px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.filter-bar h2 {
    margin: 0;
    font-size: 21px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tabs button {
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}

.filter-tabs button:hover,
.filter-tabs button.active {
    color: var(--blue);
    background: var(--blue-soft);
}

.filter-tabs button.active {
    box-shadow: inset 0 0 0 1px rgb(63 105 210 / 18%);
    font-weight: 650;
}

.topics-grid {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.topic-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.topic-card:hover {
    border-color: #b8c9ed;
    box-shadow: 0 9px 25px rgba(38, 77, 154, 0.08);
    transform: translateY(-2px);
}

.topic-card[hidden] {
    display: none;
}

.topic-card.featured {
    border-color: #c8d6f2;
}

.topic-cover {
    height: 178px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    color: #fff;
}

.topic-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.16;
    background-image: linear-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    background-size: 25px 25px;
}

.topic-cover::after {
    content: "";
    width: 160px;
    height: 160px;
    position: absolute;
    right: -72px;
    bottom: -84px;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.05);
}

.topic-cover.has-image::before {
    z-index: 2;
    opacity: 1;
    background: linear-gradient(90deg, rgba(16, 23, 38, 0.82), rgba(16, 23, 38, 0.3));
}

.topic-cover > :not(.topic-cover-image) {
    position: relative;
    z-index: 3;
}

.topic-cover-image {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    object-fit: cover;
}

.cover-kicker {
    color: rgba(255, 255, 255, 0.7);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.topic-cover strong {
    max-width: 85%;
    margin-top: 15px;
    font-size: 27px;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.topic-cover small {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
}

.cover-codex {
    background: linear-gradient(135deg, #151b29, #2f4677);
}

.cover-agent {
    background: linear-gradient(135deg, #16645d, #243b56);
}

.cover-content {
    background: linear-gradient(135deg, #a15d31, #5a3527);
}

.cover-project {
    background: linear-gradient(135deg, #294ea4, #172c61);
}

.cover-video {
    background: linear-gradient(135deg, #755ba7, #3e315e);
}

.cover-growth {
    background: linear-gradient(135deg, #98585a, #4f3548);
}

.topic-content {
    min-height: 214px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.topic-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.topic-tag,
.status {
    padding: 4px 7px;
    border-radius: 4px;
    font-size: 10px;
}

.topic-tag {
    color: var(--blue);
    background: var(--blue-soft);
}

.topic-tag.agent {
    color: #24775e;
    background: #e9f6f0;
}

.topic-tag.content {
    color: #a25f28;
    background: #fff1e4;
}

.topic-tag.growth {
    color: #97545e;
    background: #f9ecef;
}

.status {
    color: #76808e;
    background: #f1f3f6;
}

.status.updating,
.status.long-term {
    color: var(--green);
    background: #eaf8ef;
}

.status.complete {
    color: var(--blue);
    background: var(--blue-soft);
}

.status.planning {
    color: #b56d27;
    background: #fff1e4;
}

.topic-content h3 {
    margin: 17px 0 8px;
    font-size: 19px;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.topic-content > p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.72;
}

.topic-meta {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: #7c8694;
    font-size: 11px;
}

.topic-meta i {
    margin-left: auto;
    color: var(--blue);
    font-style: normal;
    font-weight: 650;
}

.topics-empty {
    padding: 70px 20px;
    grid-column: 1 / -1;
    text-align: center;
}

.topics-empty strong,
.topics-empty span {
    display: block;
}

.topics-empty span {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .topics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .topics-wrap {
        padding-top: 16px;
    }

    .topics-intro {
        min-height: 170px;
        padding: 30px;
    }

    .topics-intro h1 {
        font-size: 32px;
    }
}

@media (max-width: 620px) {
    .topics-wrap {
        padding-inline: 9px;
    }

    .topics-intro {
        padding: 25px 20px;
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
    }

    .topics-intro h1 {
        font-size: 30px;
    }

    .topics-intro p:last-child {
        font-size: 14px;
    }

    .topic-count {
        width: 100%;
        padding: 13px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
        display: flex;
        align-items: baseline;
        gap: 7px;
    }

    .topic-count strong {
        margin: 0;
        font-size: 22px;
    }

    .filter-bar {
        padding: 16px;
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .filter-bar h2 {
        font-size: 19px;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 3px;
    }

    .filter-tabs button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .topics-grid {
        padding: 12px;
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .topic-cover {
        height: 170px;
    }

    .topic-content {
        min-height: 205px;
        padding: 18px;
    }
}

@media (max-width: 350px) {
    .topic-meta {
        gap: 8px;
    }

    .topic-meta i {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topic-card {
        transition-duration: 0.01ms;
    }
}
