/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    min-height: 100vh;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 15px 0;
}

.logo {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}
.project-title h1 {
    font-size: 36px; /* 设置大字标题的字体大小 */
    font-weight: bold; /* 设置字体加粗 */
    color: white; /* 设置字体颜色 */
    text-align: center; /* 使标题居中 */
    margin-top: -20px; /* 给标题和logo之间留点空间 */
}
.nav {
    display: flex;
    gap: 30px;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 6px;
    position: relative;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: #bfdbfe;
    transition: transform 0.3s ease;
}

.nav a:hover {
    color: #bfdbfe;
    background: rgba(255, 255, 255, 0.15);
}

.nav a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
    animation: fadeIn 0.8s ease-out;
}

/* 主布局：左右分栏（用于index.html） */
.main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.left-column {
    flex: 1;
    min-width: 0;
}

.right-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 课前和课中模块布局 - 左右分栏（用于detail.html） */
.modules-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.module-column {
    flex: 1;
    min-width: 0;
}

.module-column .image-grid {
    grid-template-columns: 1fr;
}

/* 标题样式 */
.section-title {
    font-size: 28px;
    font-weight: bold;
    color: #1e3a8a;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 2px;
}

.subtitle {
    font-size: 24px;
    font-weight: 600;
    color: #1e40af;
    margin: 40px 0 20px 0;
    padding-left: 15px;
    border-left: 5px solid #3b82f6;
}

/* 视频容器 */
.video-container {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #e2e8f0;
    width: 100%;
}
.sub-title2 {
    font-size: 24px; /* 设置一个比 h1 小的字号 */
    color: white; /* 可以设置颜色 */
    text-align: center;
    margin-top: 10px; /* 调整与 h1 的间距 */
}

.video-container video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.2);
    background: #000;
}

/* 图片轮播 */
.carousel-container {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.carousel {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    border-radius: 6px;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 将 cover 改为 contain */
    background: #f8fafc;
    display: block;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #3b82f6;
    width: 32px;
    border-radius: 6px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(59, 130, 246, 0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: rgba(59, 130, 246, 1);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

/* 案例介绍区域 */
.case-section {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    border: 1px solid #e2e8f0;
    flex: 1;
}

.case-content {
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    text-align: justify;
}

.case-content p {
    margin-bottom: 15px;
}

.case-content h3 {
    color: #1e40af;
    margin: 20px 0 12px 0;
    font-size: 18px;
}

/* 模块展示区域 */
.module-section {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.module-section:last-child {
    margin-bottom: 0;
}

.module-title {
    font-size: 24px;
    font-weight: bold;
    color: #1e3a8a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
    line-height: 1.3;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.image-item {
    background: #ffffff;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.image-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.image-item img {
    width: 100%;
    height: 360px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8fafc;
    margin-bottom: 10px;
    border: none;
    padding: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    display: block;
}

.zoomable-image {
    cursor: pointer;
}

.zoomable-image:hover {
    opacity: 0.9;
}

.image-item:hover img {
    transform: scale(1.05);
}

.image-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
    min-height: 24px;
    line-height: 1.4;
}

.image-item-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    flex-grow: 1;
    text-align: left;
    margin: 0;
}

/* 版权信息 */
.footer {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: #ffffff;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    box-shadow: 0 -4px 12px rgba(30, 64, 175, 0.2);
}

.footer p {
    font-size: 14px;
    line-height: 1.8;
    margin: 5px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .left-column,
    .right-column {
        flex: none;
        width: 100%;
    }
    
    .modules-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .module-column {
        width: 100%;
    }
    
    .module-column .image-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .carousel {
        height: 350px;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .image-item {
        padding: 10px;
    }
    
    .image-item img {
        height: 280px;
    }
    
    .nav {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
    }
    
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 10px;
    }
    
    .logo-section {
        padding: 10px 0;
    }
    
    .logo {
        height: 50px;
    }
    
    .module-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .module-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .module-section:last-child {
        margin-bottom: 0;
    }
    
    .case-section {
        padding: 20px 15px;
    }
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .carousel-nav.prev {
        left: 10px;
    }
    
    .carousel-nav.next {
        right: 10px;
    }
    
    .container {
        padding: 15px 10px;
    }
    
    .video-container {
        margin-bottom: 20px;
    }
    
    .carousel-container {
        margin-bottom: 0;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .modal-caption {
        font-size: 16px;
        margin-top: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-layout {
        gap: 15px;
    }
    
    .carousel {
        height: 400px;
    }
    
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    .image-item img {
        height: 340px;
    }
}

@media (min-width: 1025px) {
    .image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .image-item img {
        height: 380px;
    }
}

/* 滚动到顶部按钮 */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 图片放大模态框 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    margin-top: 5vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.modal-caption {
    margin: 20px auto;
    text-align: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    max-width: 90%;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
}

.modal-close:hover,
.modal-close:focus {
    color: #bfdbfe;
    text-decoration: none;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

