
/* 页面整体样式设置 */
/* 使用 Roboto 字体，确保文字清晰易读 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    /* 设置渐变背景色，满足主色、辅色、点缀色的比例 */
    background: linear-gradient(135deg, #2a5298 70%, #1e3c72 25%, #ff4081 5%);
    color: #ffffff;
    /* 确保页面高度至少为100vh，避免内容不足时背景不覆盖 */
    min-height: 100vh;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(30, 60, 114, 0.9);
    padding: 15px 30px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 导航栏标题 */
.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
}

/* 导航链接样式 */
.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar ul li {
    margin-left: 20px;
}

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

.navbar ul li a:hover {
    color: #ff4081;
}

/* 主内容区块样式 */
.section {
    padding: 100px 20px 60px 20px;
    /* 使用 flexbox 布局，确保内容居中且响应式 */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 章节标题样式 */
.section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #ffffff;
    position: relative;
}

.section h2::after {
    content: '';
    width: 50px;
    height: 3px;
    background-color: #ff4081;
    display: block;
    margin: 10px auto 0;
    border-radius: 2px;
}

/* 章节内容样式 */
.section p {
    font-size: 16px;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 20px auto;
    color: #f0f0f0;
}

/* 图片样式 */
.section img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 10px;
}

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

/* 代码块样式 */
pre code {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #ffeb3b;
    margin: 20px 0;
}

/* 章节导航系统样式 */
.nav-sidebar {
    position: fixed;
    top: 80px;
    left: 20px;
    background-color: rgba(30, 60, 114, 0.8);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-sidebar ul li {
    margin-bottom: 10px;
}

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

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

/* 提示信息样式 */
.alert {
    background-color: rgba(255, 64, 129, 0.9);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1001;
}

/* 响应式设计媒体查询 */
/* 针对宽度小于768px的设备 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar ul {
        flex-direction: column;
        width: 100%;
    }

    .navbar ul li {
        margin: 10px 0;
    }

    .nav-sidebar {
        display: none;
    }

    .section {
        padding: 80px 15px 40px 15px;
    }

    .section h2 {
        font-size: 24px;
    }

    .section p {
        font-size: 14px;
    }

    .section img {
        width: 100%;
        height: auto;
    }
}

/* 针对宽度小于480px的设备 */
@media (max-width: 480px) {
    .navbar {
        padding: 10px 15px;
    }

    .navbar .logo {
        font-size: 20px;
    }

    .navbar ul li a {
        font-size: 14px;
    }

    .nav-sidebar {
        display: none;
    }

    .section h2 {
        font-size: 20px;
    }

    .section p {
        font-size: 13px;
    }

    .section img {
        width: 100%;
        height: auto;
    }
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    border: none;
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    font-size: 16px;
}

.button:hover {
    background: linear-gradient(45deg, #2a5298, #1e3c72);
    transform: scale(1.05);
}

/* 悬停链接样式 */
a {
    color: #ff4081;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffffff;
}

/* 3D 变换效果 */
.card {
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
}

.card-front {
    background-color: #1e3c72;
    color: white;
}

.card-back {
    background-color: #ff4081;
    color: white;
    transform: rotateY(180deg);
}

/* 光滑过渡效果 */
.transition-all {
    transition: all 0.3s ease;
}

/* 阴影效果 */
.shadow {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* 装饰元素样式 */
.decorative-line {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #1e3c72, #2a5298, #1e3c72);
    margin: 10px auto;
    border-radius: 2px;
    animation: moveGradient 3s linear infinite;
}

@keyframes moveGradient {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* 按需添加其他CSS样式以满足页面设计需求 */

