/* 通用样式 */
:root {
    --primary-color: #3f51b5; /* 深蓝紫，代表智慧与深邃 */
    --secondary-color: #6a82fb; /* 浅蓝紫 */
    --accent-color: #ffc107;   /* 金色，代表启迪 */
    --dark-bg: #212121;      /* 深色背景 */
    --light-bg: #f5f5f5;     /* 浅色背景 */
    --text-color-dark: #333; /* 深色文本 */
    --text-color-light: #fdfdfd; /* 浅色文本 */
    --border-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark);
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased; /* 平滑字体 */
    -moz-osx-font-smoothing: grayscale; /* 平滑字体 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
}

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

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

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

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

/* 头部样式 */
header {
    background-color: var(--dark-bg);
    color: var(--text-color-light);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* 允许换行，适应小屏幕 */
}

.logo h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.logo p {
    font-size: 0.9em;
    opacity: 0.8;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

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

.main-nav ul li a {
    color: var(--text-color-light);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover {
    color: var(--accent-color);
}

.language-switcher select {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 20px; /* 与导航项保持距离 */
}

.menu-toggle {
    display: none; /* 默认隐藏，在H5尺寸显示 */
    background: none;
    border: none;
    color: var(--text-color-light);
    font-size: 2em;
    cursor: pointer;
    order: 1; /* 移动到右侧 */
    margin-left: auto; /* 推到最右边 */
}

/* Hero Section */
.hero-section {
    /* 使用了 Unsplash 的浩瀚星空与山峦图片 */
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1517596825409-a0388d75e52a?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') no-repeat center center/cover;
    color: var(--text-color-light);
    text-align: center;
    padding: 150px 0;
    position: relative;
}

.hero-section h2 {
    font-size: 3.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: var(--accent-color);
}

.hero-section p {
    font-size: 1.3em;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 内容区通用样式 */
.content-section {
    padding: 80px 0;
    text-align: center;
}

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

.content-section h3 {
    font-size: 2.8em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.section-description {
    font-size: 1.1em;
    color: #666;
    max-width: 800px;
    margin: 0 auto 50px auto;
}

/* 网格布局 (经典区, 智慧应用) */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 响应式网格 */
    gap: 30px;
    margin-top: 50px;
}

.grid-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.grid-item img {
    max-width: 100%;
    height: 200px; /* 固定高度，图片按比例缩放 */
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 20px;
}

.grid-item h4 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.grid-item p {
    font-size: 1em;
    color: #555;
    margin-bottom: 20px;
}

/* 媒体预览区 */
.media-preview {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
    flex-wrap: wrap; /* 允许换行 */
}

.media-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    padding: 25px;
    text-align: center;
    flex: 1; /* 弹性伸缩 */
    min-width: 300px; /* 最小宽度 */
    max-width: 45%; /* 最大宽度 */
}

.media-item img {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.media-item h4 {
    font-size: 1.6em;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.media-item p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
}


/* 底部样式 */
footer {
    background-color: var(--dark-bg);
    color: var(--text-color-light);
    padding: 40px 0;
    text-align: center;
    font-size: 0.9em;
}

footer .footer-links a,
footer .social-icons a {
    color: var(--text-color-light);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

footer .footer-links a:hover,
footer .social-icons a:hover {
    color: var(--accent-color);
}

.social-icons {
    margin-top: 20px;
}

.social-icons img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* 移动端响应式布局 */
@media (max-width: 768px) {
    header .container {
        flex-direction: row; /* 保持logo和菜单切换按钮在同一行 */
        justify-content: space-between;
    }

    .main-nav {
        order: 2; /* 导航移到下一行 */
        flex-basis: 100%; /* 占据整行 */
        margin-top: 15px;
    }

    .main-nav ul {
        flex-direction: column;
        display: none; /* 默认隐藏 */
        width: 100%;
        text-align: center;
        background-color: var(--dark-bg);
    }

    .main-nav ul.active {
        display: flex; /* 点击后显示 */
    }

    .main-nav ul li {
        margin: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav ul li a {
        display: block;
        padding: 15px 20px;
    }

    .language-switcher {
        order: 3; /* 语言切换器移到下一行 */
        flex-basis: 100%;
        text-align: center;
        margin-top: 15px;
    }

    .language-switcher select {
        margin: 0; /* 移除左右边距 */
        width: 100%; /* 占满宽度 */
        max-width: 250px; /* 限制最大宽度 */
    }

    .menu-toggle {
        display: block; /* 在小屏幕显示 */
    }

    .hero-section {
        padding: 100px 0;
    }

    .hero-section h2 {
        font-size: 2.5em;
    }

    .hero-section p {
        font-size: 1.1em;
    }

    .content-section {
        padding: 50px 0;
    }

    .content-section h3 {
        font-size: 2em;
    }

    .section-description {
        font-size: 1em;
    }

    .grid-container {
        grid-template-columns: 1fr; /* 单列布局 */
        gap: 20px;
    }

    .media-preview {
        flex-direction: column; /* 垂直堆叠 */
        align-items: center;
    }

    .media-item {
        max-width: 90%; /* 适应小屏幕宽度 */
        margin-bottom: 20px; /* 增加间距 */
    }

    footer .footer-links,
    footer .social-icons {
        margin-top: 15px;
    }
}

/* 更小屏幕（如 iPhone SE）适配 */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.8em;
    }
    .logo p {
        font-size: 0.8em;
    }
    .hero-section h2 {
        font-size: 2em;
    }
    .hero-section p {
        font-size: 1em;
    }
    .content-section h3 {
        font-size: 1.8em;
    }
    .grid-item h4, .media-item h4 {
        font-size: 1.4em;
    }
    .btn {
        padding: 8px 20px;
        font-size: 0.9em;
    }
}