
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #1e3c72, #2a5298, #6dd5ed, #2193b0); /* 渐变背景 */
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite; /* 背景动画 */
    color: #ffffff;
}

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

/* 容器布局 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 80px 40px; /* 留出导航栏空间 */
}

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

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

.navbar li {
    position: relative;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
}

.navbar li ul {
    display: none;
    position: absolute;
    top: 35px;
    left: 0;
    background: #2a5298;
    padding: 10px 0;
    border-radius: 5px;
}

.navbar li:hover ul {
    display: block;
}

.navbar li ul li {
    padding: 10px 20px;
}

.navbar li ul li:hover {
    background: #6dd5ed;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(30, 60, 114, 0.8);
    padding: 15px;
    border-radius: 8px;
}

.chapter-nav ul {
    list-style: none;
}

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

.chapter-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
}

.chapter-nav a:hover {
    text-decoration: underline;
}

/* 文章样式 */
article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
}

article h2, article h3, article h4 {
    color: #6dd5ed;
}

article p {
    font-size: 16px;
    line-height: 1.6;
}

article pre {
    background: #2a5298;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

article code {
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
}

/* 卡片式设计 */
.card {
    background: #ffffff;
    color: #333333;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 16px rgba(0, 0, 0, 0.2);
}

.card img {
    width: 100%;
    height: auto;
    border-bottom: 2px solid #6dd5ed;
}

.card-content {
    padding: 20px;
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #6dd5ed, #2193b0);
    border: none;
    border-radius: 25px;
    color: #ffffff;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background: linear-gradient(45deg, #2193b0, #6dd5ed);
}

/* 图片样式 */
img.decorative {
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 折叠区域样式 */
.collapsible {
    background-color: #2a5298;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    margin: 10px 0;
}

.active, .collapsible:hover {
    background-color: #6dd5ed;
}

.content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #1e3c72;
    border-radius: 5px;
}

/* 底部样式 */
.footer {
    background: rgba(30, 60, 114, 0.9);
    color: #ffffff;
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer a {
    color: #6dd5ed;
    text-decoration: none;
    margin-right: 15px;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .chapter-nav {
        position: static;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    article {
        padding: 10px;
    }
    
    .footer {
        flex-direction: column;
        align-items: center;
    }
}

