
/* 基础样式设置 */
/* 使用盒模型和边距重置，确保跨浏览器的一致性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置全局字体和背景色 */
body {
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    font-size: 16px; /* 正文字号 */
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #2D3436 70%, #8DB4E2 25%, #F77F00 5%);
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    width: 100%;
    background-color: #0D3B66;
    color: #fff;
    padding: 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s ease;
}

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

/* 主要内容容器 */
.container {
    display: flex;
    flex-wrap: wrap;
    padding: 100px 20px 20px 20px; /* 上方留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 侧边栏样式 */
.sidebar {
    flex: 1 1 300px;
    background-color: #8DB4E2;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
}

.sidebar img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sidebar img:hover {
    transform: scale(1.05);
}

/* 主内容区样式 */
.main-content {
    flex: 3 1 700px;
    background-color: #F4F4F4;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.main-content h2, .main-content h3, .main-content h4 {
    color: #0D3B66;
}

.main-content h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.main-content h3 {
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.main-content h4 {
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.main-content p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

/* 图片样式 */
.main-content img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.main-content img:hover {
    transform: scale(1.05);
}

/* 代码块样式 */
pre {
    background-color: #2D3436;
    color: #00FF00;
    padding: 15px;
    border-radius: 8px;
    overflow: auto;
    margin-bottom: 20px;
    position: relative;
}

pre::before {
    content: "CSS3 示例代码";
    position: absolute;
    top: -20px;
    left: 0;
    background-color: #0D3B66;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #F77F00;
    color: #fff;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background-color: #C55C00;
    transform: scale(1.05);
}

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

.active, .collapsible:hover {
    background-color: #0D3B66;
}

.content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #F4F4F4;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 页脚样式 */
.footer {
    background-color: #0D3B66;
    color: #fff;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

.footer a {
    color: #8DB4E2;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #F77F00;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        margin-right: 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-content img {
        width: 100%;
    }
    .collapsible {
        font-size: 14px;
    }
    .footer {
        font-size: 14px;
    }
}

