/* ============================================================
   康弘主题页 · 前台专题首页（蓝白学术 VI）
   ============================================================ */

.theme-body {
    background: var(--bg);
}

/* ---------------- 顶部品牌栏 ---------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 11px;
    border-bottom: 1px solid #E8F3FB;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.brand__logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    box-shadow: 0 5px 14px rgba(23, 78, 126, 0.2);
}

.brand__text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.brand__text strong {
    overflow: hidden;
    color: #153A5D;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.topbar__share {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid var(--line-blue);
    border-radius: 50%;
    background: #FBFDFF;
    color: var(--brand);
    box-shadow: 0 3px 10px rgba(23, 78, 126, 0.06);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.topbar__share svg {
    width: 18px;
    height: 18px;
}

.topbar__share:active {
    transform: scale(0.94);
    background: #EFF8FF;
}

/* ---------------- Banner 轮播 ---------------- */
.hero {
    position: relative;
    border-bottom: 1px solid #D8EAF7;
    background: #EFF9FF;
}

.carousel {
    position: relative;
    overflow: hidden;
}

.carousel__viewport {
    overflow: hidden;
    touch-action: pan-y;
}

.carousel__track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.28, 1);
    will-change: transform;
}

.carousel__slide {
    position: relative;
    display: block;
    flex: 0 0 100%;
    aspect-ratio: 2.4 / 1;
    overflow: hidden;
    background: #103A60;
}

.carousel__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel__slide::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 72%, rgba(23, 58, 93, 0.05));
    content: "";
    pointer-events: none;
}

.carousel__dots {
    position: absolute;
    right: 0;
    bottom: 12px;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.carousel__dot {
    width: 5px;
    height: 5px;
    border-radius: 99px;
    background: rgba(23, 58, 93, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
    pointer-events: auto;
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
}

.carousel__dot.is-active {
    width: 18px;
    background: #1D4E8C;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

/* ---------------- 项目介绍 ---------------- */
.intro {
    position: relative;
    z-index: 3;
    margin: 14px 14px 0;
    padding: 20px 20px 16px;
    border: 1px solid var(--line-blue);
    border-radius: 6px;
    background: #FFFFFF;
    box-shadow: 0 5px 18px rgba(23, 78, 126, 0.05);
}

.intro::before {
    position: absolute;
    top: 0;
    left: 20px;
    width: 48px;
    height: 3px;
    border-radius: 0 0 2px 2px;
    background: linear-gradient(90deg, var(--gold), #E3C58F);
    content: "";
}

.intro__top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.intro__badge {
    display: inline-flex;
    height: 22px;
    align-items: center;
    padding: 0 10px;
    border-radius: 2px;
    background: linear-gradient(135deg, #C39A5D, #8C622E);
    box-shadow: 0 2px 6px rgba(164, 121, 62, 0.18);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 2px;
    line-height: 1;
}

.intro__title {
    color: #153A5D;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.35;
}

.intro__subtitle {
    margin-top: 6px;
    color: #6E8CA8;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2.2px;
}

.intro__body {
    margin-top: 14px;
    color: #2E4052;
    font-size: 13.5px;
    line-height: 1.95;
    text-align: justify;
}

.intro__body p + p {
    margin-top: 8px;
}

.intro.is-collapsible:not(.is-expanded) .intro__body {
    position: relative;
    max-height: 152px;
    overflow: hidden;
}

.intro.is-collapsible:not(.is-expanded) .intro__body::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 46px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #FFFFFF 82%);
    content: "";
}

.intro__more {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 500;
}

.intro__more svg {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
}

.intro.is-expanded .intro__more svg {
    transform: rotate(180deg);
}

.intro__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid #E8F3FB;
    color: #8A9EB0;
    font-size: 10.5px;
    letter-spacing: 0.2px;
}

.intro__note {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.intro__stats {
    flex: 0 0 auto;
    color: #A2B4C4;
}

/* ---------------- 吸顶导航 ---------------- */
.topic-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-top: 14px;
    border-top: 1px solid #EFF7FD;
    border-bottom: 1px solid #DBECF8;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    transition: box-shadow 0.25s ease;
}

.topic-nav.is-stuck {
    box-shadow: 0 8px 22px rgba(18, 54, 92, 0.08);
}

.topic-nav__inner {
    position: relative;
    display: flex;
    max-width: var(--shell);
    margin: 0 auto;
    align-items: stretch;
    padding: 0 8px;
}

.topic-nav__tab {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 51px;
    border: 0;
    color: #7F93A6;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.topic-nav__tab.is-active {
    color: #1B4C81;
    font-weight: 700;
}

.topic-nav__tab:active {
    color: var(--brand);
}

.topic-nav__indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 22px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, #1D4E8C, #4F92C9);
    box-shadow: 0 0 10px rgba(47, 111, 191, 0.24);
    transform: translateX(0);
    transition: transform 0.36s cubic-bezier(0.2, 0.8, 0.3, 1), width 0.3s ease;
}

/* 栏目数量自适应：1 个居中，2–4 个自动均分 */
.topic-nav__inner[data-count="1"] {
    justify-content: center;
}

.topic-nav__inner[data-count="1"] .topic-nav__tab {
    flex: 0 0 auto;
    padding: 0 48px;
}

.topic-nav__inner[data-count="2"] .topic-nav__tab {
    flex: 1 1 0;
}

/* 4 个栏目时自动收紧，保证一屏不拥挤 */
.topic-nav__inner[data-count="4"] .topic-nav__tab {
    font-size: 13.5px;
    letter-spacing: 0;
}

/* ---------------- 内容区 ---------------- */
.topic-main {
    padding: 16px 14px 4px;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
    animation: panel-in 0.36s ease both;
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* 栏目标题：参考蓝底金标样式 */
.section-head {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 15px;
    padding: 16px 16px 12px;
    overflow: visible;
    border-radius: 3px;
    background:
        radial-gradient(320px 150px at 100% 0%, rgba(109, 184, 226, 0.22), transparent 70%),
        linear-gradient(100deg, #2F6FBF 0%, #1D4E8C 100%);
    box-shadow: 0 6px 16px rgba(23, 78, 126, 0.14);
}

.section-head::after {
    position: absolute;
    top: 8px;
    right: 16px;
    color: rgba(255, 255, 255, 0.16);
    content: "”";
    font-family: Georgia, "Times New Roman", serif;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.section-head__tag {
    position: absolute;
    top: -9px;
    left: 14px;
    max-width: 58%;
    padding: 4px 15px 4px 10px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: linear-gradient(135deg, #C39A5D, #8C622E);
    box-shadow: 0 2px 6px rgba(23, 78, 126, 0.2);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}

.section-head__main {
    min-width: 0;
    padding-top: 1px;
    padding-right: 45px;
}

.section-head__title {
    color: #FFFFFF;
    font-size: 18.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.section-head__sub {
    margin-top: 4px;
    color: rgba(226, 241, 252, 0.78);
    font-size: 11px;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.section-head__count {
    flex: 0 0 auto;
    padding-bottom: 2px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* ---------------- 文章卡片 ---------------- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-card {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--line-blue);
    border-radius: 5px;
    background: #FFFFFF;
    box-shadow: 0 3px 10px rgba(23, 78, 126, 0.035);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.article-card:active {
    transform: scale(0.988);
    box-shadow: 0 2px 8px rgba(23, 78, 126, 0.05);
}

.article-card__body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.article-card__title {
    display: -webkit-box;
    overflow: hidden;
    color: #1A2A39;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: 0.1px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.article-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    color: #8296A8;
    font-size: 11px;
    letter-spacing: 0.2px;
}

.article-card__dot {
    width: 2.5px;
    height: 2.5px;
    border-radius: 50%;
    background: #B9CBD9;
}

.article-card__tag {
    display: inline-flex;
    height: 17px;
    align-items: center;
    padding: 0 6px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
}

.article-card__tag--video {
    background: #EAF4FF;
    color: #2F6FBF;
}

.article-card__tag--link {
    background: #F2F7FB;
    color: #6F8296;
}

.article-card__thumb {
    position: relative;
    width: 104px;
    height: 78px;
    flex: 0 0 104px;
    align-self: center;
    padding: 2px;
    overflow: hidden;
    border: 1px solid var(--line-blue);
    border-radius: 2px;
    background: #FFFFFF;
}

.article-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Ccircle cx='18' cy='18' r='17' fill='rgba(255,255,255,0.92)' stroke='rgba(47,111,191,0.35)'/%3E%3Cpath d='M15 11.5 25 18 15 24.5Z' fill='%232F6FBF'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 34px 34px;
    transform: translate(-50%, -50%);
}

.article-card__duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 2px;
    background: rgba(9, 40, 68, 0.78);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.4;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@media (hover: hover) and (pointer: fine) {
    .article-card:hover {
        border-color: #A9D2EE;
        box-shadow: 0 8px 20px rgba(23, 78, 126, 0.08);
        transform: translateY(-2px);
    }

    .article-card:hover .article-card__thumb img {
        transform: scale(1.04);
    }
}

/* ---------------- 空状态 ---------------- */
.topic-empty {
    padding: 48px 24px;
}

.topic-empty__card {
    padding: 40px 24px;
    border: 1px dashed var(--line-blue);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.topic-empty__title {
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 600;
}

.topic-empty__desc {
    margin-top: 8px;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.8;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
    margin-top: 20px;
    padding: 30px 24px calc(26px + env(safe-area-inset-bottom));
    border-top: 1px solid #E7F2FB;
    background: #FFFFFF;
    color: var(--ink-3);
    text-align: center;
}

.site-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #284A68;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.site-footer__brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 9px rgba(23, 78, 126, 0.16);
}

.site-footer__text {
    max-width: 340px;
    margin: 12px auto 0;
    color: #8A9EB0;
    font-size: 10.5px;
    line-height: 1.8;
}

.site-footer__copy {
    margin-top: 8px;
    color: #A8BAC8;
    font-size: 10px;
    letter-spacing: 0.2px;
}

/* ---------------- 404 ---------------- */
.not-found {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 28px;
    text-align: center;
}

.not-found__logo {
    width: 56px;
    height: 56px;
    border-radius: 15px;
    box-shadow: 0 10px 26px rgba(23, 78, 126, 0.2);
}

.not-found__code {
    margin-top: 26px;
    color: rgba(47, 111, 191, 0.16);
    font-size: 66px;
    font-weight: 800;
    letter-spacing: 4px;
    line-height: 1;
}

.not-found h1 {
    margin-top: 10px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
}

.not-found p {
    margin-top: 10px;
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.8;
}

.not-found__btn {
    display: inline-flex;
    height: 42px;
    align-items: center;
    margin-top: 26px;
    padding: 0 24px;
    border-radius: 3px;
    background: linear-gradient(135deg, #2F6FBF, #1D4E8C);
    box-shadow: 0 8px 20px rgba(23, 78, 126, 0.2);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.not-found__brand {
    margin-top: 34px;
    color: #A8BAC8;
    font-size: 10.5px;
    letter-spacing: 1px;
}

/* ---------------- 桌面微调 ---------------- */
@media (min-width: 640px) {
    .page-shell {
        margin-top: 28px;
        margin-bottom: 28px;
        min-height: calc(100vh - 56px);
        border-radius: 14px;
        overflow: hidden;
    }

    .topbar {
        padding-top: 16px;
    }

    .site-footer {
        padding-bottom: 30px;
    }

    .to-top {
        bottom: 44px;
    }
}

@media (max-width: 360px) {
    .intro {
        margin-right: 12px;
        margin-left: 12px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .intro__title {
        font-size: 23px;
    }

    .article-card__thumb {
        width: 92px;
        height: 70px;
        flex-basis: 92px;
    }

    .topic-nav__tab {
        font-size: 13.5px;
    }

    .topic-nav__inner[data-count="4"] .topic-nav__tab {
        font-size: 12.5px;
    }

    .section-head {
        padding-right: 13px;
        padding-left: 13px;
    }

    .section-head__title {
        font-size: 18px;
    }
}
