
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #1e3c72 70%, #2a5298 25%, #e94560 5%); /* 主色、辅色及点缀色渐变背景 */
    color: #ffffff;
    transition: background 0.5s ease;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navbar ul li a {
    text-decoration: none;
    color: #ffffff;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #ff7f50; /* 点缀色悬停效果 */
}

/* 响应式导航菜单 */
@media (max-width: 768px) {
    .navbar ul {
        display: none;
    }
    .navbar .hamburger {
        display: block;
        cursor: pointer;
    }
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.9);
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }
    .sidebar.active {
        display: flex;
        animation: slideIn 0.3s forwards;
    }
    @keyframes slideIn {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }
}

/* 主要内容区块 */
.section {
    padding: 100px 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    align-items: center;
}

.section:nth-child(even) {
    flex-direction: row-reverse;
    background: rgba(0, 0, 0, 0.5);
}

.section .text {
    flex: 1;
    min-width: 300px;
}

.section .text h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.section .text p {
    font-size: 16px;
    line-height: 1.6;
}

/* 图片样式 */
.section .image {
    flex: 1;
    min-width: 300px;
}

.section .image img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section .image img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

/* 卡片样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 50px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.card p {
    font-size: 14px;
    line-height: 1.5;
}

/* 底部样式 */
.footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 40px 50px;
    text-align: center;
}

.footer p {
    font-size: 14px;
    color: #cccccc;
}

/* CSS3 动画示例 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

/* 章节导航样式 */
.nav-sidebar {
    position: fixed;
    top: 100px;
    right: 50px;
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 10px;
}

.nav-sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-sidebar ul li a {
    text-decoration: none;
    color: #ffffff;
    font-size: 14px;
    transition: color 0.3s ease;
}

.nav-sidebar ul li a:hover {
    color: #ff7f50;
}

/* 代码块样式 */
.code-block {
    background: rgba(0,0,0,0.6);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-block code {
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 按钮样式 */
.button-primary {
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    border: none;
    border-radius: 5px;
    color: #ffffff;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.button-primary:hover {
    background: linear-gradient(45deg, #0072ff, #00c6ff);
}

/* 加载动效样式 */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .section {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .navbar ul {
        display: none;
    }
    .navbar .hamburger {
        display: block;
    }
}

