
/* 整体页面样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    font-size: 16px; /* 正文字号设置为16px */
    color: #ecf0f1; /* 正文字体颜色 */
    background: linear-gradient(135deg, #2c3e50 70%, #34495e 25%, #f39c12 5%); /* 渐变背景，符合黄金比例 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(44, 62, 80, 0.9); /* 半透明背景 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
}

.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar li {
    margin: 0 15px;
    position: relative;
}

.navbar a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #f39c12; /* 悬停时颜色变化 */
}

.navbar li ul {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background-color: #34495e;
    list-style: none;
    padding: 10px 0;
    border-radius: 5px;
}

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

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

.navbar li ul li a {
    font-weight: normal;
    color: #ecf0f1;
}

.navbar li ul li a:hover {
    color: #f1c40f;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background-color: rgba(44, 62, 80, 0.8);
    padding: 10px;
    border-radius: 8px;
}

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

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

.chapter-nav a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #f39c12;
}

/* 主内容区域 */
main {
    padding: 100px 20px 20px 20px; /* 避免导航栏遮挡 */
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(44, 62, 80, 0.8);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 标题样式 */
h2, h3, h4 {
    color: #f1c40f;
    margin-top: 20px;
    margin-bottom: 10px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

/* 段落样式 */
p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 15px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* 阴影效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img.decorative:hover {
    transform: scale(1.05); /* 悬停时放大效果 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

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

code {
    color: #1abc9c;
    font-family: 'Courier New', Courier, monospace;
}

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

th, td {
    border: 1px solid #34495e;
    padding: 10px;
    text-align: left;
}

th {
    background-color: #1abc9c;
    color: #2c3e50;
}

tr:nth-child(even) {
    background-color: #2c3e50;
}

tr:hover {
    background-color: #16a085;
}

/* 按钮样式 */
.button-primary {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.button-primary:hover {
    background: linear-gradient(45deg, #e67e22, #d35400);
    transform: scale(1.05);
}

/* 折叠区域样式 */
.collapsible {
    background-color: #34495e;
    color: #ecf0f1;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: #3c5a72;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        background-color: #2c3e50;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        display: none;
    }
    
    .navbar ul.active {
        display: flex;
    }
    
    .navbar li {
        margin: 10px 0;
    }
    
    .chapter-nav {
        display: none;
    }
}

