
/* 全局样式设置 */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* 设置全局字体 */
    font-size: 16px; /* 设置基础字体大小 */
    line-height: 1.6; /* 设置行高 */
    background: linear-gradient(135deg, #FF9800, #2196F3); /* 渐变背景 */
    color: #333; /* 文字颜色 */
    opacity: 0;
    animation: fadeIn 1s ease-in forwards; /* 页面加载淡入效果 */
}

/* 渐变背景实现 */
body {
    background: linear-gradient(135deg, #FF9800, #2196F3);
    background-repeat: no-repeat;
    background-size: cover;
}

/* 页面容器 */
.container {
    display: grid;
    grid-template-areas:
        'header'
        'main'
        'footer';
    grid-gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    grid-area: header;
    background-color: rgba(33, 150, 243, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.navbar a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

/* 主内容区域 */
main {
    grid-area: main;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 文章标题 */
article h2 {
    font-size: 2em;
    margin-bottom: 0.5em;
    color: #FF9800;
}

/* 文章副标题 */
article h3 {
    font-size: 1.5em;
    margin-top: 1.5em;
    color: #2196F3;
}

/* 正文段落 */
article p {
    margin: 1em 0;
    font-size: 1em;
    line-height: 1.8;
}

/* 代码块样式 */
article pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

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

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

table thead {
    background-color: #2196F3;
    color: white;
}

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

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

table tbody tr:hover {
    background-color: #f1f1f1;
}

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 10px;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

/* 导航系统样式 */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-links a {
    background-color: #FF9800;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.nav-links a:hover {
    background-color: #FFB74D;
}

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

.active, .collapsible:hover {
    background-color: #1976D2;
}

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

/* 关键帧动画 */
@keyframes fadeIn {
    to { opacity: 1; }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

/* 动画类 */
.icon-rotate {
    display: inline-block;
    animation: rotate 4s linear infinite;
}

.icon-bounce {
    display: inline-block;
    animation: bounce 2s infinite;
}

/* 页脚样式 */
footer {
    grid-area: footer;
    background-color: rgba(33, 150, 243, 0.8);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-areas:
            'header'
            'main'
            'footer';
    }

    .nav-links {
        flex-direction: column;
    }

    img {
        max-width: 100%;
    }
}

