/* ================================================
   Index Page - 首页样式
   ================================================ */

/* ================================================
   视频 Hero 区域
   ================================================ */

.video-hero {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 30.303%; /* 1 / 3.3 ≈ 30.303% (3.3:1 比例) */
    overflow: hidden;
    background-color: #000;
}

/* 视频元素 */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: 1;
}

/* 视频遮罩（可选，增加文字对比度） */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* 视频内容文字 */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.95;
    letter-spacing: 0.1em;
}

/* 响应式：中等屏幕 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
}

/* 响应式：小屏幕 */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ================================================
   视频控制按钮
   ================================================ */

.video-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 15px;
    z-index: 4;
}

/* 控制按钮样式 */
.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(95, 38, 88, 0.8); /* 南大紫 */
    border-color: #fff;
}

.control-btn:active {
    background: rgba(95, 38, 88, 0.9);
}

/* 按钮状态 */
.control-btn.active {
    background: rgba(95, 38, 88, 0.9);
    border-color: #7d3372;
}

/* 响应式：小屏幕调整按钮位置和大小 */
@media (max-width: 768px) {
    .video-controls {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .video-controls {
        bottom: 15px;
        right: 15px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ================================================
   视频信息提示框样式
   ================================================ */

/* 信息按钮包装器 */
.info-btn-wrapper {
    position: relative;
    display: inline-block;
}

/* 信息提示框 */
.video-info-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
    pointer-events: none;
}

/* 提示框显示状态 */
.video-info-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 提示框箭头 */
.video-info-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(0, 0, 0, 0.9);
}

/* 提示框标题 */
.tooltip-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
    white-space: nowrap;
}

/* 提示框文本 */
.tooltip-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    white-space: nowrap;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .video-info-tooltip {
        min-width: 240px;
        max-width: 280px;
        padding: 14px 18px;
    }
    
    .tooltip-title {
        font-size: 15px;
    }
    
    .tooltip-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .video-info-tooltip {
        min-width: 200px;
        max-width: 240px;
        padding: 12px 16px;
        bottom: calc(100% + 12px);
    }
    
    .tooltip-title {
        font-size: 14px;
    }
    
    .tooltip-text {
        font-size: 12px;
    }
}

/* ================================================
   介绍、开放信息与新闻（左右分栏）
   ================================================ */

.home-intro-news {
    background: #f8f9fa;
    --home-blocks-gap: 1.5rem;
}

.home-intro-news > .container > .row {
    --bs-gutter-x: var(--home-blocks-gap);
    --bs-gutter-y: var(--home-blocks-gap);
}

/* 统一内容块（参考故宫官网块状布局） */
.home-block {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.75rem 2rem;
    box-sizing: border-box;
}

.home-intro-news .home-block {
    border-left: 4px solid var(--nju-purple-light);
}

.home-intro-news .intro-card {
    background: #fdfcfa;
}

.home-intro-news .opening-info {
    background: #f9fafb;
}

.home-intro-news .news-panel {
    background: #fff;
}

.intro-news-left {
    display: flex;
    flex-direction: column;
    gap: var(--home-blocks-gap);
    min-width: 0;
}

.intro-news-right {
    display: flex;
    min-width: 0;
}

/* 一句话介绍 */
.intro-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.intro-slogan {
    width: 100%;
    min-width: 0;
    text-align: left;
}

.intro-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.45;
    text-align: left;
}

.intro-title-line {
    display: block;
    white-space: nowrap;
}

.intro-subtitle {
    font-size: 1.15rem;
    color: #666;
    margin: 0;
    font-style: italic;
    white-space: nowrap;
    text-align: left;
}

/* 开放信息 */
.opening-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.opening-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.opening-item {
    display: flex;
    align-items: flex-start;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
}

.opening-item i {
    margin-top: 0.3rem;
    flex-shrink: 0;
}

.opening-item span,
.opening-item-body {
    flex: 1;
    min-width: 0;
}

.opening-fit-line {
    display: block;
    min-width: 0;
    white-space: nowrap;
}

.opening-hours-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    border: 1px solid #e0e0e0;
}

.opening-hours-table td {
    padding: 0.35rem 0.5rem;
    vertical-align: top;
    border: 1px solid #e0e0e0;
}

.opening-hours-table thead td {
    background: rgba(125, 51, 114, 0.06);
    font-weight: 600;
    color: #444;
}

.opening-hours-table td:first-child {
    width: 62%;
}

.opening-hours-table td:last-child {
    white-space: nowrap;
    color: #666;
}

.opening-venue-alias {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.85rem;
    color: #888;
    line-height: 1.35;
}

.opening-hours-table tfoot td {
    padding: 0.35rem 0.5rem;
    color: #777;
    background: #fafafa;
}

/* 桌面端：三块固定高度，翻页/换 tab 时版面不跳动 */
@media (min-width: 992px) {
    .home-intro-news {
        --home-panel-height: 33rem;
        --home-intro-card-height: 9.5rem;
        --home-opening-info-height: 22rem;
        --home-news-pagination-height: 2.75rem;
    }

    .home-intro-news .home-block {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .intro-news-left {
        height: var(--home-panel-height);
    }

    .intro-card {
        height: var(--home-intro-card-height);
        flex-shrink: 0;
        overflow: hidden;
        justify-content: center;
    }

    .opening-info {
        height: var(--home-opening-info-height);
        flex-shrink: 0;
        overflow: hidden;
        justify-content: center;
    }

    .news-panel {
        height: var(--home-panel-height);
        min-height: auto;
        padding-bottom: 1.5rem;
    }

    .news-panel-title {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .news-panel-title,
    .news-tabs {
        flex-shrink: 0;
    }

    .opening-info .opening-item {
        line-height: 1.55;
    }

    .opening-info .opening-item.mb-3 {
        margin-bottom: 0.65rem !important;
    }

    .news-list {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .news-list li {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        box-sizing: border-box;
        border-bottom: 1px solid #eee;
    }

    .news-list li:last-child {
        border-bottom: 1px solid #eee;
    }

    .news-list-slot--empty {
        flex: 1 1 0;
    }

    .news-item {
        flex: 1;
        width: 100%;
        align-items: center;
        min-width: 0;
        margin-left: 0;
        padding: 0 0.5rem 0 0.65rem;
        box-sizing: border-box;
    }

    .news-pagination {
        flex: none;
        height: var(--home-news-pagination-height);
        min-height: var(--home-news-pagination-height);
        margin-top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .news-pagination-inner,
    .news-pagination-summary {
        margin: 0;
    }
}

/* 响应式调整 */
@media (max-width: 991px) {
    .home-block {
        padding: 1.5rem;
    }

    .intro-title,
    .intro-subtitle,
    .intro-title-line {
        white-space: normal;
    }

    .intro-title-line {
        display: block;
    }
}

@media (max-width: 768px) {
    .intro-title {
        font-size: 1.5rem;
    }
    
    .intro-subtitle {
        font-size: 1rem;
    }
    
    .opening-title {
        font-size: 1.2rem;
    }
    
    .opening-item {
        font-size: 0.9rem;
    }
}

/* ================================================
   完整播放模态窗口样式
   ================================================ */

/* ================================================
   动画效果
   ================================================ */

/* 按钮淡入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-controls {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

/* 文字淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hero-content {
    animation: fadeIn 1.5s ease-out;
}

/* ================================================
   完整播放模态窗口
   ================================================ */

/* 全屏模态窗口 - 透明背景 */
#fullVideoModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.8);
}

#fullVideoModal .modal-content {
    background-color: transparent;
    border: none;
}

#fullVideoModal .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 100vh;
}

/* 完整视频样式 - 限制最大宽度 */
/* 视频容器 - 需要相对定位来包含关闭按钮 */
.full-video-wrapper {
    position: relative;
    max-width: 1320px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.full-video {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* 隐藏画中画按钮 - 通过 disablePictureInPicture 属性实现 */
/* 隐藏下载按钮 - 通过 controlsList 属性实现 */
/* 隐藏全屏按钮 */
.full-video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.full-video::-moz-media-controls-fullscreen-button {
    display: none !important;
}

/* 关闭按钮 - 相对于视频定位，完全在视频内部 */
.full-video-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.full-video-close:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: #fff;
}

.full-video-close i {
    pointer-events: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .full-video-wrapper {
        width: 95%;
    }
    
    .full-video-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ================================================
   首页内容区块
   ================================================ */

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
}

.section-subtitle {
    font-size: 0.95rem;
    color: #888;
}

.section-more-link {
    font-size: 0.9rem;
    color: var(--nju-purple-light);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.section-more-link:hover {
    color: var(--nju-purple);
}

.home-subheading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
}

/* 展览：主推 Hero + 网格 / 横向滑动 */
.home-exhibitions-hero-wrap:not(:empty) + .home-exhibitions-grid-wrap {
    margin-top: 3rem;
}

.home-exhibitions-carousel {
    position: relative;
}

.home-exhibitions-carousel-viewport {
    overflow: visible;
    padding: 0.75rem 0 1rem;
    margin: -0.75rem 0 -1rem;
}

.home-exhibitions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.home-exhibitions-carousel--active .home-exhibitions-grid {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.75rem 2px 1rem;
    margin: -0.75rem -2px -1rem;
}

.home-exhibitions-carousel--active .home-exhibitions-grid::-webkit-scrollbar {
    display: none;
}

.home-exhibitions-carousel--active .home-exhibitions-grid > .exhibition-card {
    flex: 0 0 calc((100% - 2rem) / 3);
    scroll-snap-align: start;
    min-width: 0;
    height: auto;
}

.home-exhibitions-carousel:not(.home-exhibitions-carousel--stacked) .home-exhibitions-grid > .exhibition-card {
    display: flex;
    flex-direction: column;
}

.home-exhibitions-carousel-controls {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    min-height: 2.5rem;
}

.home-exhibitions-carousel-nav {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1.5px solid var(--nju-purple);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--nju-purple);
    box-shadow: 0 2px 8px rgba(95, 38, 88, 0.15);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.home-exhibitions-carousel-nav:hover:not(:disabled) {
    background: var(--nju-purple);
    border-color: var(--nju-purple);
    color: #fff;
    box-shadow: 0 4px 16px rgba(95, 38, 88, 0.28);
}

.home-exhibitions-carousel-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.home-exhibitions-carousel-dots {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    pointer-events: auto;
}

.home-exhibitions-carousel-dot {
    width: 0.55rem;
    height: 0.55rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #c8c8c8;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.home-exhibitions-carousel-dot.is-active {
    background: var(--nju-purple);
    transform: scale(1.15);
}

.home-exhibitions-carousel-dot:hover {
    background: var(--nju-purple-light);
}

.home-exhibitions-grid > .home-empty {
    grid-column: 1 / -1;
}

/* 首页主推展览（全宽 Hero） */
.exhibition-hero {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.exhibition-hero--text-top {
    display: flex;
    flex-direction: column;
}

.exhibition-hero--text-top .exhibition-hero-body {
    flex: 1 1 auto;
    padding-bottom: 1.25rem;
}

.exhibition-hero--text-top .exhibition-hero-subtitle {
    margin-bottom: 0.65rem;
}

.exhibition-hero--text-top .exhibition-hero-media {
    flex-shrink: 0;
}

.exhibition-hero:hover {
    box-shadow:
        0 0 16px rgba(95, 38, 88, 0.45),
        0 0 32px rgba(95, 38, 88, 0.25),
        0 0 48px rgba(95, 38, 88, 0.12);
    color: inherit;
}

.exhibition-hero:hover .exhibition-hero-title {
    color: var(--nju-purple);
}

.exhibition-hero-media {
    position: relative;
    aspect-ratio: 21 / 9;
    background: #eee;
    overflow: hidden;
}

.exhibition-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.exhibition-hero-media .exhibition-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--nju-purple) 0%, var(--nju-purple-light) 100%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 3rem;
}

.exhibition-hero-body {
    padding: 1.5rem 1.75rem;
}

.exhibition-status-row,
.program-card-status-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0.35rem;
}

.exhibition-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.35;
    transition: color 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
}

.exhibition-hero-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.85rem;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
}

.exhibition-hero-meta {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.exhibition-hero-meta > div,
.exhibition-hero-location > div {
    white-space: nowrap;
    overflow: hidden;
}

.exhibition-hero-location {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.6;
}

.exhibition-hero-meta i,
.exhibition-hero-location i {
    width: 1rem;
    text-align: center;
    margin-right: 0.35rem;
    color: var(--nju-purple-light);
}

.exhibition-meta-date-line {
    padding-left: 1.35rem;
}

.exhibition-card-meta .exhibition-meta-date-line {
    padding-left: 1.35rem;
}

/* 三列网格展览卡片 */
.exhibition-card {
    display: block;
    position: relative;
    z-index: 0;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, z-index 0s;
}

.home-exhibitions-grid > .exhibition-card {
    height: 100%;
}

.exhibition-card:hover {
    z-index: 1;
    box-shadow:
        0 6px 20px rgba(95, 38, 88, 0.28),
        0 2px 10px rgba(0, 0, 0, 0.08);
    color: inherit;
}

.exhibition-card:hover .exhibition-card-title {
    color: var(--nju-purple);
}

.exhibition-card--compact {
    display: flex;
    flex-direction: column;
}

.exhibition-card--text-top .exhibition-card-body {
    flex: 1 1 auto;
    padding-bottom: 1rem;
}

.exhibition-card--text-top .exhibition-card-subtitle {
    margin-bottom: 0.5rem;
}

.exhibition-card--text-top .exhibition-card-media {
    flex-shrink: 0;
    margin-top: auto;
}

.exhibition-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #eee;
    overflow: hidden;
}

.exhibition-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.exhibition-card-media .exhibition-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--nju-purple) 0%, var(--nju-purple-light) 100%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 2.5rem;
}

.exhibition-card-body {
    padding: 1.25rem 1.5rem;
}

.exhibition-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    line-height: 1.4;
    transition: color 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
}

.exhibition-card-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
}

.exhibition-card-meta {
    font-size: 0.85rem;
    color: #777;
    line-height: 1.6;
}

.exhibition-card-meta > div {
    white-space: nowrap;
    overflow: hidden;
}

.exhibition-card-meta i {
    width: 1rem;
    text-align: center;
    margin-right: 0.35rem;
    color: var(--nju-purple-light);
}

.exhibition-badge {
    display: inline-block;
    width: max-content;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}

.exhibition-badge-permanent {
    background: rgba(95, 38, 88, 0.1);
    color: var(--nju-purple);
}

.exhibition-badge-ongoing {
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.exhibition-badge-upcoming {
    background: rgba(13, 110, 253, 0.1);
    color: #0a58ca;
}

.exhibition-badge-extended {
    background: rgba(255, 193, 7, 0.15);
    color: #997404;
}

.exhibition-badge-ended {
    background: rgba(220, 53, 69, 0.1);
    color: #c45555;
}

/* 活动 / 课程卡片 */
#homeEvents.home-card-list,
#homeCourses.home-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#homeEvents .program-card-body,
#homeCourses .program-card-body {
    justify-content: flex-start;
    padding: 1.15rem 1.25rem;
}

#homeEvents .program-card-title-main,
#homeCourses .program-card-title-main {
    font-size: 1.02rem;
    margin-bottom: 0.15rem;
    -webkit-line-clamp: 2;
}

#homeCourses .program-card-subtitle {
    font-size: 0.92rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.3rem;
    line-height: 1.35;
}

#homeEvents .program-card-people,
#homeCourses .program-card-people {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    margin-bottom: 0.35rem;
}

#homeEvents .program-card-people-line,
#homeCourses .program-card-people-line {
    font-size: 0.82rem;
    color: #777;
    line-height: 1.35;
    margin-bottom: 0;
}

/* 大屏 ≥992px：双栏内横向卡片，左竖条海报 */
@media (min-width: 992px) {
    #homeEvents .program-card,
    #homeCourses .program-card {
        flex-direction: row;
        align-items: stretch;
        min-height: 200px;
    }

    #homeEvents .program-card-media,
    #homeCourses .program-card-media {
        flex: 0 0 192px;
        width: 192px;
        align-self: stretch;
    }

    #homeEvents .program-card-media img,
    #homeCourses .program-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #homeEvents .program-card-media-placeholder,
    #homeCourses .program-card-media-placeholder {
        min-height: 100%;
    }
}

/* 中屏 576–991px：单栏全宽，继续横排，海报收窄 */
@media (min-width: 576px) and (max-width: 991.98px) {
    #homeEvents.home-card-list,
    #homeCourses.home-card-list {
        gap: 0.85rem;
    }

    #homeEvents .program-card,
    #homeCourses .program-card {
        flex-direction: row;
        align-items: stretch;
        min-height: 160px;
    }

    #homeEvents .program-card-media,
    #homeCourses .program-card-media {
        flex: 0 0 104px;
        width: 104px;
        align-self: stretch;
    }

    #homeEvents .program-card-media img,
    #homeCourses .program-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #homeEvents .program-card-media-placeholder,
    #homeCourses .program-card-media-placeholder {
        min-height: 100%;
    }

    #homeEvents .program-card-title-main,
    #homeCourses .program-card-title-main {
        font-size: 0.92rem;
    }

    #homeCourses .program-card-subtitle {
        font-size: 0.86rem;
    }
}

/* 小屏 <576px：上下结构，顶图横条（不定比例） */
@media (max-width: 575.98px) {
    #homeEvents.home-card-list,
    #homeCourses.home-card-list {
        gap: 0.75rem;
    }

    #homeEvents .program-card,
    #homeCourses .program-card {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
    }

    #homeEvents .program-card-media,
    #homeCourses .program-card-media {
        flex: none;
        width: 100%;
        height: 7.5rem;
        align-self: auto;
    }

    #homeEvents .program-card-media img,
    #homeCourses .program-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #homeEvents .program-card-media-placeholder,
    #homeCourses .program-card-media-placeholder {
        min-height: 7.5rem;
    }

    #homeEvents .program-card-body,
    #homeCourses .program-card-body {
        padding: 1rem 1.1rem;
    }

    #homeEvents .program-card-title-main,
    #homeCourses .program-card-title-main {
        font-size: 0.92rem;
    }

    #homeCourses .program-card-subtitle {
        font-size: 0.86rem;
    }
}

.home-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.program-card {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: box-shadow 0.3s ease;
}

.program-card:hover {
    box-shadow:
        0 0 16px rgba(95, 38, 88, 0.45),
        0 0 32px rgba(95, 38, 88, 0.25),
        0 0 48px rgba(95, 38, 88, 0.12);
    color: inherit;
}

.program-card:hover .program-card-title {
    color: var(--nju-purple);
}

.program-card-media {
    flex: 0 0 130px;
    width: 130px;
    position: relative;
    overflow: hidden;
}

.program-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.program-card-media-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--nju-purple) 0%, var(--nju-purple-light) 100%);
    color: #fff;
    padding: 0.75rem;
    text-align: center;
}

.program-card-media-placeholder i {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
    opacity: 0.9;
}

.program-card-media-placeholder span {
    font-size: 0.7rem;
    opacity: 0.85;
    line-height: 1.3;
}

.program-card-body {
    flex: 1;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.program-card-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nju-purple-light);
    margin-bottom: 0.25rem;
}

.program-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.program-card-meta {
    font-size: 0.82rem;
    color: #777;
    line-height: 1.5;
}

.program-card-meta i {
    width: 0.9rem;
    text-align: center;
    margin-right: 0.3rem;
    color: var(--nju-purple-light);
}

.program-card-action {
    margin-top: 0.5rem;
}

.program-card-action .btn-register {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background: var(--nju-purple-light);
    color: #fff;
    border: none;
    display: inline-block;
    text-decoration: none;
}

.program-card-action .btn-register:hover {
    background: var(--nju-purple);
    color: #fff;
}

.home-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
    font-size: 0.95rem;
    background: #fff;
    border-radius: 10px;
    border: 1px dashed #ddd;
}

.home-loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* 新闻块（右侧整体白框） */
.news-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    min-width: 0;
    padding-bottom: 1.25rem;
}

.news-panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
}

.news-tabs {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 1.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
    padding: 0;
}

.news-tab-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0;
    margin: 0 0 -1px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    text-align: left;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
}

.news-tab-btn:hover {
    color: var(--nju-purple-light);
}

.news-tab-btn.active {
    color: var(--nju-purple);
    font-weight: 600;
    border-bottom-color: var(--nju-purple-light);
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.news-list li {
    border-bottom: 1px solid #eee;
}

.news-list-slot--empty {
    min-height: 0;
}

.news-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.5rem 0.5rem 0.5rem 0.65rem;
    margin-left: -0.65rem;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    min-width: 0;
    align-items: center;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}

button.news-item {
    width: 100%;
    border: none;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.news-item:hover,
button.news-item:hover {
    color: var(--nju-purple-light);
    background-color: #f8f5f8;
    border-left-color: var(--nju-purple-light);
}

.news-item-date {
    flex-shrink: 0;
    color: #999;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.news-item-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.news-pagination {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
}

.news-pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.news-pagination-summary {
    font-size: 0.88rem;
    color: #777;
    text-align: center;
    min-width: 10rem;
}

.news-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    color: var(--nju-purple-light);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-page-btn:hover:not(:disabled) {
    background: var(--nju-purple-light);
    border-color: var(--nju-purple-light);
    color: #fff;
}

.news-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 新闻正文灯箱 */
body.news-lightbox-open {
    overflow: hidden;
}

.news-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}

.news-lightbox[hidden] {
    display: none !important;
}

.news-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.news-lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(84vh, 880px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    animation: newsLightboxIn 0.22s ease-out;
}

@keyframes newsLightboxIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.news-lightbox-close {
    position: absolute;
    top: 1.15rem;
    right: 1.15rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.news-lightbox-close:hover {
    background: #fff;
    color: var(--nju-purple);
}

.news-lightbox-body {
    max-height: min(84vh, 880px);
    overflow-y: auto;
    padding: 2.75rem 3rem 2.5rem;
}

.news-lightbox-title {
    margin: 0 2.75rem 1rem 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--nju-purple);
}

.news-lightbox-date {
    margin-bottom: 1.35rem;
    font-size: 0.92rem;
    color: #888;
    font-variant-numeric: tabular-nums;
}

.news-lightbox-content {
    margin-bottom: 1.75rem;
}

.news-lightbox-paragraph {
    margin: 0 0 1rem;
    line-height: 1.9;
    color: #333;
    text-align: justify;
    text-indent: 2em;
}

.news-lightbox-paragraph--spacer {
    margin-bottom: 0.35rem;
    line-height: 0;
    text-indent: 0;
}

.news-lightbox-photos {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.news-lightbox-photo {
    margin: 0;
}

.news-lightbox-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f3f3f3;
}

.news-lightbox-photo-caption {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    color: #666;
    line-height: 1.6;
    text-align: center;
}

.news-lightbox-photo-source {
    color: #999;
}

.news-lightbox-author {
    margin-top: 0.5rem;
    padding-top: 1.35rem;
    border-top: 1px solid #eee;
    font-size: 0.92rem;
    color: #666;
    line-height: 1.75;
    white-space: pre-line;
    text-align: right;
}

/* 响应式 */
@media (max-width: 991px) {
    .home-exhibitions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-exhibitions-carousel--active:not(.home-exhibitions-carousel--stacked) .home-exhibitions-grid > .exhibition-card {
        flex: 0 0 calc((100% - 1rem) / 2);
    }
}

@media (max-width: 767px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .home-exhibitions-grid {
        grid-template-columns: 1fr;
    }

    .home-exhibitions-grid > .exhibition-card {
        height: auto;
        min-height: 0 !important;
    }

    .home-exhibitions-carousel--stacked .home-exhibitions-carousel-viewport {
        overflow: visible;
        padding: 0;
        margin: 0;
    }

    .home-exhibitions-carousel--stacked .home-exhibitions-grid {
        display: grid;
        grid-template-columns: 1fr;
        overflow-x: visible;
        scroll-snap-type: none;
        padding: 0;
        margin: 0;
    }

    .home-exhibitions-carousel--stacked .home-exhibitions-grid > .exhibition-card {
        flex: unset;
        width: auto;
        scroll-snap-align: unset;
        min-height: 0 !important;
        height: auto;
    }

    .home-exhibitions-carousel--stacked .home-exhibitions-carousel-controls {
        display: none !important;
    }

    .exhibition-hero-media {
        aspect-ratio: 16 / 9;
    }

    .exhibition-hero-title {
        font-size: 1.35rem;
    }

    .exhibition-hero-body {
        padding: 1.15rem 1.25rem;
    }

    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem 0;
    }

    .news-item-title {
        width: 100%;
    }

    .news-lightbox {
        padding: 1.25rem;
    }

    .news-lightbox-body {
        padding: 2rem 1.5rem 1.75rem;
    }

    .news-lightbox-title {
        margin-right: 2.25rem;
    }
}

@media (max-width: 480px) {
    .exhibition-card-body {
        padding: 1rem;
    }
}
