.gallery-banner {
    background: linear-gradient(135deg, rgba(196, 22, 28, 0.9) 0%, rgba(249, 168, 37, 0.9) 100%);
}

/* Hero Section - Non-index pages only */
body:not(.home) .hero {
    position: relative;
    height: 40vh;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    overflow: hidden;
    margin-bottom: 0;
    padding-top: 80px;
    box-sizing: border-box;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(196, 22, 28, 0.8) 0%, rgba(249, 168, 37, 0.8) 100%);
    z-index: 1;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.7);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-text-wrapper {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    color: #fff;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 24px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 24px;
    margin-bottom: 40px;
    opacity: 0.95;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-breadcrumbs {
    color: #fff;
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease;
}

.hero-breadcrumbs a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.hero-breadcrumbs a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.hero-breadcrumbs span {
    font-weight: 500;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-categories {
    background: var(--bg-light);
    padding: 40px 0;
}

.category-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 28px;
    border: 2px solid var(--border-color);
    background: #fff;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.gallery-section {
    background: #fff;
    padding: 60px 0;
}

.gallery-section .container {
    max-width: 100%;
    padding: 0 40px;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.gallery-filter {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Masonry Grid - 瀑布流布局 */
.gallery-grid {
    column-count: 5;
    column-gap: 24px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.gallery-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 60%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    margin-bottom: 8px;
}

.gallery-overlay h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 纯文字卡片 */
.gallery-item-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 200px;
}

.gallery-item-text.bg-blue {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
}

.gallery-item-text.bg-green {
    background: linear-gradient(135deg, #43a047, #66bb6a);
}

.gallery-item-text.bg-purple {
    background: linear-gradient(135deg, #7b1fa2, #ab47bc);
}

.gallery-item-text.bg-orange {
    background: linear-gradient(135deg, #ef6c00, #ffa726);
}

.gallery-item-text.bg-teal {
    background: linear-gradient(135deg, #00897b, #26a69a);
}

.gallery-item-text.bg-pink {
    background: linear-gradient(135deg, #d81b60, #ec407a);
}

.gallery-item-text.bg-indigo {
    background: linear-gradient(135deg, #3949ab, #5c6bc0);
}

.gallery-text-content {
    padding: 24px;
    color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-text-content .gallery-category {
    align-self: flex-start;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.2);
}

.gallery-text-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.gallery-text-content p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
    margin: 0;
}

/* 视频卡片 */
.gallery-video {
    position: relative;
    width: 100%;
}

.gallery-video img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item-video:hover .gallery-video img {
    transform: scale(1.05);
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-play-icon svg {
    margin-left: 4px;
}

.gallery-item-video:hover .video-play-icon {
    background: var(--primary-color);
    transform: translate(-50%, -50%) scale(1.1);
}

.gallery-item-video .gallery-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 50%);
}

/* 弹窗样式 */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.gallery-modal-content {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    z-index: 1;
}

.gallery-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-modal-close:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-modal-nav:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.gallery-modal-prev {
    left: 16px;
}

.gallery-modal-next {
    right: 16px;
}

.gallery-modal-body {
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

.gallery-modal-media {
    width: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.gallery-modal-media img {
    max-width: 100%;
    max-height: 65vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.gallery-modal-media video {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    display: block;
}

.gallery-modal-media .modal-text-content {
    padding: 60px 40px;
    background: #fff;
    color: var(--text-dark);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.gallery-modal-media .modal-text-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.gallery-modal-media .modal-text-content p {
    font-size: 18px;
    line-height: 1.8;
    max-width: 600px;
    color: var(--text-gray);
}

/* 长图文弹窗样式 */
.modal-article-content {
    width: 100%;
    background: #fff;
}

.modal-article-content .article-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

.modal-article-content .article-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.modal-article-content .article-body {
    padding: 32px 40px;
}

.modal-article-content .article-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.4;
}

.modal-article-content .article-text {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-gray);
    white-space: pre-line;
}

.gallery-modal-info {
    padding: 24px;
    background: #fff;
}

.gallery-modal-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.gallery-modal-info p {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.6;
    margin: 0;
}

.gallery-modal-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

/* 多图/多视频卡片角标 */
.gallery-item-multi .media-count,
.gallery-item-article .article-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
}

.gallery-item-multi .media-count svg,
.gallery-item-article .article-badge svg {
    width: 14px;
    height: 14px;
}

/* 多媒体弹窗样式 */
.multi-media-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.multi-media-container {
    width: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    padding: 20px;
    box-sizing: border-box;
}

.multi-media-container img {
    max-width: 100%;
    max-height: 55vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 8px;
}

.multi-media-container video {
    max-width: 100%;
    max-height: 55vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* 多媒体内部导航 - 放在缩略图两侧 */
.multi-media-nav {
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.multi-media-nav:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.multi-media-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.multi-media-nav:disabled:hover {
    background: #fff;
    border-color: var(--border-color);
    color: var(--text-dark);
}

/* 多媒体缩略图导航区 */
.multi-media-thumbnails-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.multi-media-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    justify-content: center;
    flex: 1;
}

.multi-media-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.multi-media-thumbnails::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.multi-media-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.multi-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.multi-media-thumb:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.multi-media-thumb.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(196, 22, 28, 0.2);
}

.multi-media-thumb.video-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-media-thumb.video-thumb::before {
    content: '\25B6';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    z-index: 1;
}

/* 多媒体计数器 */
.multi-media-counter {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--primary-color);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10;
}

.multi-media-indicators {
    display: none;
}

.download-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #a81118;
}

@media (max-width: 1440px) {
    .gallery-grid {
        column-count: 4;
    }
}

@media (max-width: 1024px) {
    .gallery-grid {
        column-count: 3;
    }
    
    .gallery-section .container {
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        column-count: 2;
        column-gap: 16px;
    }
    
    .gallery-section .container {
        padding: 0 16px;
    }
    
    .gallery-item {
        margin-bottom: 16px;
    }
    
    .gallery-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gallery-filter {
        justify-content: center;
    }
    
    .gallery-modal-nav {
        width: 40px;
        height: 40px;
    }
    
    .gallery-modal-prev {
        left: 8px;
    }
    
    .gallery-modal-next {
        right: 8px;
    }
    
    .gallery-modal-media .modal-text-content {
        padding: 40px 24px;
    }
    
    .gallery-modal-media .modal-text-content h2 {
        font-size: 24px;
    }
    
    .gallery-modal-media .modal-text-content p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        column-count: 2;
    }
}

/* 暗色模式适配 */
[data-theme="dark"] .gallery-section {
    background: #121212;
}

[data-theme="dark"] .filter-btn {
    background: #1e1e1e;
    border-color: var(--border-color);
    color: var(--text-light);
}

[data-theme="dark"] .filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] .gallery-item {
    background: #1e1e1e;
}

[data-theme="dark"] .gallery-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 60%);
}

[data-theme="dark"] .gallery-modal-content {
    background: #252525;
}

[data-theme="dark"] .gallery-modal-media {
    background: #1e1e1e;
}

[data-theme="dark"] .gallery-modal-close {
    background: #333;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .gallery-modal-nav {
    background: #333;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .multi-media-container {
    background: #1e1e1e;
}

[data-theme="dark"] .multi-media-thumbnails {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .multi-media-nav {
    background: #333;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .multi-media-nav:disabled:hover {
    background: #333;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .multi-media-thumbnails-wrapper {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .gallery-modal-info {
    background: #1e1e1e;
}

[data-theme="dark"] .gallery-modal-media .modal-text-content {
    background: #1e1e1e;
}

[data-theme="dark"] .gallery-modal-media .modal-text-content h2 {
    color: var(--text-light);
}

[data-theme="dark"] .modal-article-content {
    background: #1e1e1e;
}

[data-theme="dark"] .modal-article-content .article-title {
    color: var(--text-light);
}

[data-theme="dark"] .modal-article-content .article-text {
    color: var(--text-gray);
}

[data-theme="dark"] .gallery-modal-info h3 {
    color: var(--text-light);
}

[data-theme="dark"] .gallery-modal-info p {
    color: var(--text-gray);
}
