
/* 全局样式设置，定义字体、颜色和基础布局 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，增强现代感 */
    background: linear-gradient(135deg, #0d47a1, #1976d2); /* 主色调渐变背景，传达稳重与科技感 */
    color: #333;
    line-height: 1.6;
    font-size: 16px; /* 正文字号设置为16px，保证可读性 */
}

/* 容器样式，使用flex布局实现响应式设计 */
.container {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 文章区域样式，使用网格布局 */
article {
    flex: 3;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8); /* 半透明背景，增加层次感 */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 细腻阴影，提升质感 */
    margin: 10px;
}

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

/* 标题样式，增强视觉层次 */
h2, h3, h4 {
    color: #0d47a1;
    margin-top: 20px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}
h2:hover, h3:hover, h4:hover {
    color: #ff9800; /* 悬停时颜色变化，增强互动性 */
}

/* 段落样式 */
p {
    margin-bottom: 15px;
    text-align: justify;
}

/* 图片样式，添加圆角、阴影和悬浮效果 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 10px 0;
}
img.decorative:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 代码块样式，区分于正文内容 */
pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}
code {
    font-family: 'Courier New', Courier, monospace;
    color: #d14;
}

/* 导航栏样式，固定在顶部 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(13, 71, 161, 0.9);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background 0.3s ease;
}
.navbar:hover {
    background: rgba(13, 71, 161, 1);
}
.navbar a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
    position: relative;
}
.navbar a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #ff9800;
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}
.navbar a:hover::after {
    width: 100%;
}

/* 折叠面板样式 */
.accordion {
    border-top: 1px solid #ccc;
}
.accordion-item {
    border-bottom: 1px solid #ccc;
}
.accordion-header {
    padding: 15px;
    cursor: pointer;
    background: #f5f5f5;
    transition: background 0.3s ease;
}
.accordion-header:hover {
    background: #e0e0e0;
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 15px;
    background: #fafafa;
}
.accordion-item.active .accordion-content {
    max-height: 500px;
    padding: 15px;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
}
.button:hover {
    background: #e65100;
}

/* 提示信息样式 */
.notice {
    background: #4caf50;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    font-size: 18px;
    position: relative;
}
.notice::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 4px;
    background: #ff9800;
}
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar a {
        margin: 5px 0;
    }
}

