/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #D32F2F; /* 亿林红 */
    --primary-dark: #B71C1C;
    --text-color: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --bg-light: #f9f9f9;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
    display: inline-block; /* 修复链接可能导致布局塌陷的问题 */
}

/* 块级链接，让内容充满 */
.block-link {
    display: block;
    width: 100%;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    width: 100%; /* 确保图片自适应容器 */
}

/* 辅助类 */
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 容器与通用类 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.section-title h2 a:hover {
    color: var(--primary-color);
}

.section-title .underline {
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0 auto 15px;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* 导航栏 */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    font-weight: 500;
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Page Banner (二级页面顶部) */
.page-banner {
    height: 40vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.page-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.page-banner-content {
    position: relative;
    z-index: 1;
}

.page-banner-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Hero Section (首页) */
.hero {
    height: 80vh;
    background-image: url('https://placehold.co/1920x1080/333333/FFFFFF?text=Background');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(183, 28, 28, 0.8), rgba(211, 47, 47, 0.6));
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
    width: 100%;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.about-features li {
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.about-features i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* Courses Section */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.course-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    display: flex; /* 确保Flex布局 */
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.course-img {
    height: 200px;
    overflow: hidden;
}

.course-img img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.course-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-info h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.course-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
    flex-grow: 1;
}

.btn-text {
    color: var(--primary-color);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
}

.btn-text i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.btn-text:hover i {
    transform: translateX(5px);
}

/* Detailed Course List (for courses.html) */
.course-detail-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
    align-items: center;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.course-detail-item:nth-child(even) {
    grid-template-columns: 1fr 1fr; /* 保持一致，通过 order 控制 */
}

.course-detail-item:nth-child(even) .course-detail-img {
    order: 2;
}
.course-detail-item:nth-child(even) .course-detail-text {
    order: 1;
}

.course-detail-img img {
    border-radius: 8px;
    height: 350px;
    object-fit: cover;
}

.course-detail-text h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

/* Moments Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 5px;
}

.gallery-item img {
    width: 100%;
    height: 300px; /* 固定高度确保整齐，或者auto做瀑布流 */
    object-fit: cover;
    transition: var(--transition);
}

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

/* Moments Full Grid (for moments.html) */
.moments-grid {
    column-count: 3;
    column-gap: 20px;
}

.moment-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.moment-card img {
    width: 100%;
    display: block;
}

.moment-caption {
    padding: 15px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Summit Section */
.summit-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.summit-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    display: block;
}

.summit-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: var(--transition);
}

.summit-card:hover img {
    transform: scale(1.1);
}

.summit-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--white);
    padding: 20px;
}

.summit-info h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.summit-info p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Summit Timeline (for summit.html) */
.summit-timeline-item {
    margin-bottom: 60px;
}

.summit-timeline-img {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
}

.summit-timeline-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.footer-links h4, .footer-contact h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-contact p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 0.9rem;
    color: #888;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .course-detail-item {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .course-detail-item:nth-child(even) .course-detail-img {
        order: 0;
    }
    
    .moments-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 15px 0;
        margin-left: 0; /* Reset margin for mobile */
        text-align: center;
    }

    .hamburger {
        display: block;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-contact p {
        justify-content: center;
    }
    
    .moments-grid {
        column-count: 1;
    }
    
    .summit-timeline-img {
        height: 250px;
    }
    
    .page-banner {
        height: 30vh;
    }
    
    .page-banner-content h1 {
        font-size: 2rem;
    }
}
