
/* 全局样式重置，消除不同浏览器的默认样式差异 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 定义主色调、辅色和点缀色 */
:root {
    --main-color-1: #1E3A8A; /* 深蓝色 */
    --main-color-2: #45D7C1; /* 青色 */
    --accent-color-1: #FF9B4F; /* 亮橙色 */
    --accent-color-2: #6EE7B7; /* 亮绿色 */
    --secondary-color: #F3F4F6; /* 辅助颜色，浅灰色 */
    --background-color: #1E3A8A; /* 页面背景主色 */
    --text-color: #FFFFFF; /* 正文字体颜色 */
    --link-color: #6EE7B7; /* 链接颜色 */
    --header-height: 60px; /* 头部导航栏高度 */
}

/* 页面整体背景设置，使用渐变色 */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--main-color-1), var(--main-color-2));
    color: var(--text-color);
    line-height: 1.6;
    min-width: 320px;
    max-width: 1920px;
    margin: 0 auto;
    padding-top: var(--header-height);
    overflow-x: hidden;
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(30, 58, 138, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .logo {
    font-size: 1.5em;
    font-weight: bold;
}

.navbar .menu a {
    color: var(--text-color);
    margin-left: 20px;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease;
}

.navbar .menu a:hover {
    color: var(--accent-color-2);
}

/* 章节导航系统样式 */
.chapter-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 200px;
    height: 100%;
    background: rgba(30, 58, 138, 0.8);
    backdrop-filter: blur(10px);
    padding-top: 20px;
}

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

.chapter-nav ul li {
    margin-bottom: 15px;
}

.chapter-nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 20px;
    display: block;
    transition: background 0.3s ease;
}

.chapter-nav ul li a:hover {
    background: rgba(110, 231, 183, 0.2);
    border-radius: 5px;
}

/* 主内容区样式 */
.main-content {
    margin-left: 220px;
    padding: 20px;
}

.section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.section h2, .section h3, .section h4 {
    color: var(--text-color);
}

.section h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.section h3 {
    font-size: 1.5em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.section h4 {
    font-size: 1.2em;
    margin-top: 15px;
    margin-bottom: 8px;
}

/* 图片样式，圆角、阴影、悬停效果 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.image-gallery 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;
}

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

/* 代码块样式，与正文区分开 */
pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.9em;
}

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

/* 按钮样式 */
button, .button-primary {
    background: linear-gradient(45deg, var(--accent-color-1), var(--accent-color-2));
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    color: var(--text-color);
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

button:hover, .button-primary:hover {
    background: linear-gradient(45deg, var(--accent-color-2), var(--accent-color-1));
    transform: scale(1.05);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

thead {
    background: rgba(30, 58, 138, 0.8);
    color: var(--text-color);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

tr:hover {
    background: rgba(110, 231, 183, 0.1);
}

/* 表单元素样式 */
.form-input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1em;
}

.form-input::placeholder {
    color: #D1D5DB;
}

.submit-button {
    @extend .button-primary;
    width: 100%;
}

.submit-button:hover {
    background: linear-gradient(45deg, var(--accent-color-2), var(--accent-color-1));
}

/* 背景色非白色，使用深色或渐变色 */
body {
    background: linear-gradient(135deg, var(--main-color-1), var(--main-color-2));
}

/* 提示信息样式 */
.promo-banner {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.2em;
}

/* 响应式布局调整 */
@media (max-width: 1200px) {
    .chapter-nav {
        width: 150px;
    }
    .main-content {
        margin-left: 170px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    .chapter-nav {
        position: static;
        width: 100%;
        height: auto;
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .image-gallery {
        flex-direction: column;
        align-items: center;
    }
}

/* 微交互效果 */
a {
    position: relative;
    transition: color 0.3s ease;
}

a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    display: block;
    background: var(--accent-color-2);
    transition: width 0.3s;
    left: 0;
    bottom: -5px;
}

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

/* CSS3 动画示例部分样式 */
.code-example {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #D1D5DB;
    font-family: 'Courier New', Courier, monospace;
}

/* 确保所有内部链接添加 rel="nofollow" */
a[rel="nofollow"] {
    /* 可根据需要添加样式 */
}

