
/* 
整体页面样式设计
以下样式采用CSS3技术，结合Flexbox和Grid布局，实现响应式设计，适配不同屏幕尺寸。色彩搭配遵循主色70%、辅色25%、点缀色5%的比例，确保视觉上的和谐与高级感。使用线性渐变、阴影效果、关键帧动画等高级特性，增强页面的立体感和视觉层次。
*/

/* 通用设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置字体 */
body {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    color: #FFFFFF;
    background: linear-gradient(135deg, #1E90FF 70%, #2C2C2C 30%);
    line-height: 1.6;
}

/* 头部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(46, 49, 146, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

.navbar:hover {
    background-color: rgba(46, 49, 146, 1);
}

/* 导航链接样式 */
.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 0 15px;
    font-family: 'Roboto', sans-serif;
    position: relative;
    transition: color 0.3s ease;
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: #FFA500;
    left: 0;
    bottom: -5px;
    transition: width 0.3s;
}

.navbar a:hover::after {
    width: 100%;
}

/* 侧边导航菜单 */
.sidebar-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 200px;
    background-color: #2A5298;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 20px;
}

.sidebar-menu.active {
    display: flex;
}

.sidebar-menu a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 10px 0;
    font-size: 16px;
    transition: color 0.3s ease;
}

.sidebar-menu a:hover {
    color: #FFA500;
}

/* 主要内容容器 */
.container {
    display: grid;
    grid-template-areas:
        'header header'
        'sidebar main'
        'footer footer';
    grid-gap: 20px;
    padding: 100px 50px 50px 250px;
}

/* 头部区域 */
.header {
    grid-area: header;
    text-align: center;
    padding: 50px 0;
    background: rgba(46, 49, 146, 0.8);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.header h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 侧边栏样式 */
.sidebar {
    grid-area: sidebar;
    background-color: #1E90FF;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sidebar h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    margin-bottom: 15px;
    color: #FFFFFF;
}

.sidebar ul {
    list-style: none;
}

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

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

.sidebar ul li a:hover {
    color: #FFA500;
}

/* 主内容区域 */
.main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 文章样式 */
article {
    background-color: rgba(44, 44, 44, 0.9);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

article:hover {
    transform: translateY(-5px);
}

article h2, article h3, article h4 {
    font-family: 'Roboto', sans-serif;
    color: #FFA500;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

article p {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    color: #FFFFFF;
    margin-bottom: 20px;
}

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

article code {
    color: #FFA500;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

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

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

/* 提示信息样式 */
.prompt {
    background-color: #FFA500;
    color: #2C2C2C;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

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

.collapsible:hover {
    background-color: #1E90FF;
}

.active, .collapsible:hover {
    background-color: #1E90FF;
}

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

.content p {
    margin: 10px 0;
    font-size: 16px;
}

/* CSS3代码示例外观 */
.code-example {
    background-color: #1E3C72;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.code-example code {
    display: block;
    color: #FFD700;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
}

/* 页脚样式 */
.footer {
    grid-area: footer;
    text-align: center;
    padding: 20px;
    background-color: #2C2C2C;
    border-radius: 10px;
    box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
}

.footer p {
    color: #FFFFFF;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-areas:
            'header'
            'main'
            'footer';
        padding: 100px 30px 30px 30px;
    }
    
    .sidebar-menu {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sidebar-menu {
        width: 100%;
        top: 50px;
    }
    
    .container {
        padding: 100px 20px 20px 20px;
    }
    
    .header h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .navbar a {
        margin: 5px 0;
    }
    
    .sidebar {
        display: none;
    }
    
    .container {
        grid-template-areas:
            'header'
            'main'
            'footer';
    }
    
    img.decorative {
        max-width: 100%;
    }
}

