/* ==========================================================================
   站点自定义样式（基于 Bootstrap 5.3）
   仅保留 Bootstrap 无法覆盖的品牌色、卡片、正文排版等少量样式
   ========================================================================== */

:root {
    --site-primary: #6D2DCC;
    --site-primary-dark: #55257d;
    --site-primary-rgb: 109, 45, 204;
    --bs-primary: #6D2DCC;
    --bs-primary-rgb: 109, 45, 204;
    --bs-link-color: #6D2DCC;
    --bs-link-color-rgb: 109, 45, 204;
    --bs-link-hover-color: #55257d;
    --bs-link-hover-color-rgb: 85, 37, 125;
    --bs-body-color: #333;
    --bs-body-bg: #f6f5fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

a {
    text-decoration: none;
}

/* 主色按钮 */
.btn-primary {
    --bs-btn-bg: var(--site-primary);
    --bs-btn-border-color: var(--site-primary);
    --bs-btn-hover-bg: var(--site-primary-dark);
    --bs-btn-hover-border-color: var(--site-primary-dark);
    --bs-btn-active-bg: var(--site-primary-dark);
    --bs-btn-active-border-color: var(--site-primary-dark);
    --bs-btn-disabled-bg: var(--site-primary);
    --bs-btn-disabled-border-color: var(--site-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--site-primary);
    --bs-btn-border-color: var(--site-primary);
    --bs-btn-hover-bg: var(--site-primary);
    --bs-btn-hover-border-color: var(--site-primary);
    --bs-btn-active-bg: var(--site-primary-dark);
    --bs-btn-active-border-color: var(--site-primary-dark);
}

/* 分页 */
.pagination {
    --bs-pagination-color: var(--site-primary);
    --bs-pagination-hover-color: var(--site-primary-dark);
    --bs-pagination-active-bg: var(--site-primary);
    --bs-pagination-active-border-color: var(--site-primary);
    --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(var(--site-primary-rgb), .2);
}

/* 导航 */
.site-logo {
    max-height: 48px;
    width: auto;
}

.navbar .nav-link {
    color: #333;
    font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--site-primary);
}

/* 轮播：按 1950×1040 比例完整显示，不裁切 */
.hero-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1950 / 1040;
    object-fit: contain;
    background-color: #f3f0f9;
}

/* 区块标题 */
.section-title {
    position: relative;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    font-weight: 700;
    padding-left: .75rem;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: .2em;
    bottom: .2em;
    width: 4px;
    border-radius: 2px;
    background: var(--site-primary);
}

.section-more {
    color: var(--site-primary);
    font-size: .875rem;
    white-space: nowrap;
}

/* 卡片 */
.card-lift {
    transition: transform .18s ease, box-shadow .18s ease;
}

.card-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 1.5rem rgba(31, 26, 43, .12) !important;
}

.thumb-4x3 {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.thumb-16x9 {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* 多行截断 */
.clamp-2,
.clamp-5 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clamp-2 {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.clamp-5 {
    -webkit-line-clamp: 5;
    line-clamp: 5;
}

/* 视频播放角标 */
.play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
    background: rgba(20, 12, 38, .18);
    transition: background .2s ease;
}

.card-lift:hover .play-badge {
    background: rgba(var(--site-primary-rgb), .35);
}

/* 资源区只有一个条目时：横向卡片，避免半屏空白与整行大图 */
.resource-grid > .col-lg-6:only-child {
    flex: 0 0 100%;
    max-width: 100%;
}

.resource-grid > .col-lg-6:only-child .resource-card {
    flex-direction: row;
}

.resource-grid > .col-lg-6:only-child .resource-card > img,
.resource-grid > .col-lg-6:only-child .resource-card > .position-relative {
    flex: 0 0 50%;
    width: 50%;
}

.resource-grid > .col-lg-6:only-child .resource-card .thumb-4x3 {
    aspect-ratio: 16 / 9;
}

.resource-grid > .col-lg-6:only-child .resource-card > .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 50%;
    padding: 1.5rem 2rem;
}

.resource-grid > .col-lg-6:only-child .resource-card > .card-body .card-title {
    font-size: 1.5rem;
    line-height: 1.4;
    -webkit-line-clamp: 3;
}

.resource-more {
    display: none;
}

.resource-grid > .col-lg-6:only-child .resource-more {
    display: inline-block;
    margin-top: .75rem;
    color: var(--site-primary);
    font-weight: 600;
    font-size: .9375rem;
}

@media (max-width: 767.98px) {
    .resource-grid > .col-lg-6:only-child .resource-card {
        flex-direction: column;
    }

    .resource-grid > .col-lg-6:only-child .resource-card > img,
    .resource-grid > .col-lg-6:only-child .resource-card > .position-relative,
    .resource-grid > .col-lg-6:only-child .resource-card > .card-body {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* 正文排版 */
.article-content {
    font-size: 1rem;
    line-height: 1.9;
    color: #333;
    word-wrap: break-word;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
}

.article-content iframe,
.article-content video {
    max-width: 100%;
    border: 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.article-content table th,
.article-content table td {
    border: 1px solid #e5e3ee;
    padding: .5rem .75rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1.25rem 0 .75rem;
    font-weight: 700;
    line-height: 1.4;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content a {
    color: var(--site-primary);
}

.intro-text img {
    max-width: 100%;
    height: auto;
}

/* 联系页侧栏 */
.contact-nav-link {
    display: block;
    padding: .5rem .75rem;
    border-radius: .5rem;
    color: #333;
}

.contact-nav-link:hover {
    background: #f3eefb;
    color: var(--site-primary);
}

.contact-nav-link.active {
    background: var(--site-primary);
    color: #fff;
}

.contact-info-list li {
    padding: .5rem 0;
    border-bottom: 1px dashed #e5e3ee;
}

.contact-info-list li:last-child {
    border-bottom: 0;
}

/* 页脚 */
.site-footer {
    background: #1f1a2b;
    color: rgba(255, 255, 255, .72);
}

.site-footer a {
    color: rgba(255, 255, 255, .72);
}

.site-footer a:hover {
    color: #fff;
}

.footer-linklist {
    line-height: 2;
}

/* 无竖线分隔的链接行：用词间距分隔 */
.footer-linklist-plain a {
    display: inline-block;
    margin-right: 1.25rem;
}

.footer-linklist-plain a:last-child {
    margin-right: 0;
}

.footer-linklist .separator {
    margin: 0 .5rem;
    color: rgba(255, 255, 255, .35);
}

/* 视频弹窗 */
#videoModal video {
    display: block;
    width: 100%;
    height: auto;
}
