
/* 
整体页面样式定义
采用HTML5和CSS3技术，确保响应式设计在不同设备上均有良好表现。主色调为浅灰和米色，辅色为亮蓝和紫色，点缀色为亮橙色。使用Flexbox和Grid布局，配合渐变、阴影、动画等效果，营造出高端、梦幻的视觉体验。
*/

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f0f0f0 70%, #fffdd0 25%, #ff8c00 5%);
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #4682B4;
    transition: color 0.3s ease;
}

a:hover {
    color: #6A5ACD;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 253, 208, 0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #6A5ACD;
}

.navbar .nav-links {
    display: flex;
    gap: 20px;
}

.navbar .nav-links a {
    font-size: 16px;
    color: #333;
}

.navbar .nav-links a:hover {
    color: #4682B4;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: left 0.3s ease-in-out;
    padding: 60px 20px;
    z-index: 999;
}

.sidebar.active {
    left: 0;
}

.sidebar a {
    display: block;
    margin: 20px 0;
    font-size: 16px;
    color: #6A5ACD;
    transition: color 0.3s ease;
}

.sidebar a:hover {
    color: #4682B4;
}

/* 主页主体内容样式 */
.main {
    padding: 100px 20px 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    padding: 50px 0;
}

.header h1 {
    font-size: 2.5em;
    color: #4682B4;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2em;
    color: #6A5ACD;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chapter-nav h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #333;
}

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

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

.chapter-nav ul li a {
    color: #4682B4;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #6A5ACD;
}

/* 文章内容样式 */
article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

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

article img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

article h2, article h3, article h4 {
    color: #333;
}

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

article h3 {
    font-size: 1.8em;
    margin: 20px 0 10px 0;
}

article h4 {
    font-size: 1.6em;
    margin: 15px 0 5px 0;
}

article p {
    font-size: 17px;
    color: #555;
}

/* 代码块样式 */
pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    position: relative;
}

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

pre.language-css {
    background: #e8f4fd;
    border-left: 4px solid #4682B4;
}

/* 装饰元素 */
.decorative-line {
    height: 2px;
    background: linear-gradient(90deg, #4682B4, #6A5ACD);
    margin: 40px 0;
    border: none;
}

.decorative-element {
    width: 100%;
    height: 50px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center;
    background-size: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.decorative-element:hover {
    transform: rotate(5deg);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    article {
        grid-template-columns: 1fr;
    }
    
    .chapter-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar .nav-links {
        display: none;
    }
    
    .sidebar {
        padding: 60px 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2em;
    }
    
    .header p {
        font-size: 1em;
    }
}

