
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

/* 导航栏样式 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #00ffcc;
    margin-right: auto;
}

.header nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #ffffff;
    position: relative;
    transition: color 0.3s ease;
}

.header nav a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: #00ffcc;
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}

.header nav a:hover::after {
    width: 100%;
}

.header nav a:hover {
    color: #00ffcc;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 70px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

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

.chapter-nav ul li a:hover {
    color: #00ffcc;
}

/* 主内容区域 */
.container {
    display: grid;
    grid-template-columns: none;
    grid-template-rows: auto;
    grid-gap: 20px;
    padding: 100px 30px 30px 30px;
}

.main-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    overflow: hidden;
}

.main-content h2, .main-content h3 {
    color: #00ffcc;
}

.main-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.main-content pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
}

.main-content code {
    color: #00ffcc;
    font-family: 'Courier New', Courier, monospace;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.image-gallery img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 按钮样式 */
.button {
    background: rgba(0, 255, 192, 0.2);
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    color: #00ffc0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background: rgba(0, 255, 192, 0.4);
    transform: translateY(-5px);
}

/* 代码示例样式 */
.code-example {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #00ffcc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 80px 20px 20px 20px;
    }

    .chapter-nav {
        position: static;
        margin-bottom: 20px;
    }

    .image-gallery {
        justify-content: center;
    }

    .image-gallery img {
        width: 100%;
        height: auto;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.main-content {
    animation: fadeIn 1s ease-in;
}

/* 点缀色使用 */
.accent {
    color: #ff4081;
}

/* 提示信息样式 */
.notice {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 链接样式 */
a {
    color: #00ffcc;
    text-decoration: none;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: #00ffcc;
    left: 0;
    bottom: -2px;
    transition: width 0.3s ease;
}

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

/* 按照黄金比例设置颜色分配 */
:root {
    --main-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #00ffcc;
}

.header, .chapter-nav, .main-content, .button, a {
    color: var(--main-color);
}

/* 图标样式 */
.icon {
    width: 24px;
    height: 24px;
    fill: var(--accent-color);
    transition: fill 0.3s ease, transform 0.3s ease;
}

.icon:hover {
    fill: #ffffff;
    transform: rotate(20deg);
}

/* 其他装饰元素 */
.decorative-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    margin: 30px 0;
    border-radius: 1px;
}


