
/* =======================================
   基础样式设置
======================================= */
/* 设置全局字体、背景渐变和基本布局 */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: #333;
}

/* 背景渐变动画 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar li {
    margin-left: 25px;
    position: relative;
}

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

.navbar a:hover {
    color: #ff7e5f;
}

/* =======================================
   主内容区样式
======================================= */
.container {
    max-width: 1200px;
    margin: 100px auto 50px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

h1, h2, h3, h4 {
    color: #1e3c72;
}

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

h3 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
}

p {
    font-size: 16px;
    margin-bottom: 15px;
}

code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

/* =======================================
   表格样式
======================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

table th {
    background: #1e3c72;
    color: #fff;
}

table tr:nth-child(even) {
    background: #f9f9f9;
}

/* =======================================
   图片样式
======================================= */
/* 设置图片的圆角、阴影和悬浮效果 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 10px;
}

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

/* 图片容器实现响应式排版 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* =======================================
   按钮样式
======================================= */
.button {
    display: inline-block;
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.5s, transform 0.3s;
    text-decoration: none;
    font-size: 16px;
}

.button:hover {
    background: linear-gradient(45deg, #feb47b, #ff7e5f);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* =======================================
   折叠内容样式
======================================= */
.collapsible {
    background-color: #2a5298;
    color: white;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    transition: background 0.3s;
    border-radius: 5px;
    margin-top: 20px;
}

.collapsible:hover {
    background: linear-gradient(45deg, #6a11cb, #2575fc);
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 0 0 5px 5px;
}

.content p {
    margin: 15px 0;
}

/* =======================================
   导航锚点样式
======================================= */
.section {
    padding: 60px 20px;
}

.section:nth-child(odd) {
    background: linear-gradient(45deg, #283E51, #4CA1AF);
}

.section:nth-child(even) {
    background: linear-gradient(45deg, #AA076B, #61045F);
    color: #fff;
}

.section a {
    color: #ff7e5f;
    text-decoration: none;
}

.section a:hover {
    text-decoration: underline;
}

/* =======================================
   响应式设计
======================================= */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        background: rgba(30, 60, 114, 0.95);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        display: none;
    }

    .navbar ul.active {
        display: flex;
    }

    .navbar li {
        margin: 15px 0;
        text-align: center;
    }

    .container {
        margin: 80px 10px 30px;
        padding: 15px;
    }

    .image-gallery {
        flex-direction: column;
        align-items: center;
    }
}

/* =======================================
   代码块样式
======================================= */
.code-block {
    background: #2d2d2d;
    color: #ccc;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
}

.code-block code {
    color: #f8f8f2;
}

