
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #2C3E50 70%, #95A5A6 25%, #E67E22 5%);
    color: #2C3E50;
    line-height: 1.6;
}

/* 容器布局 */
.container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    padding: 40px;
}

/* 侧边导航样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 20%;
    height: 100vh;
    background-color: rgba(44, 62, 80, 0.9);
    padding-top: 60px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

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

.navbar li {
    margin: 20px 0;
    text-align: center;
}

.navbar a {
    color: #ECF0F1;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #E67E22;
}

/* 主体内容样式 */
.main-content {
    margin-left: 20%;
    padding: 20px;
    background-color: rgba(236, 240, 241, 0.8);
    min-height: 100vh;
}

/* 标题样式 */
h2, h3, h4 {
    color: #2C3E50;
    margin-top: 30px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

/* 段落样式 */
p {
    font-size: 16px;
    margin: 15px 0;
}

/* 强调文字 */
strong {
    color: #E67E22;
}

/* 代码块样式 */
pre {
    background-color: #34495E;
    color: #ECF0F1;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
    margin: 20px 0;
}

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

/* 图片样式 */
img {
    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;
}

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

/* 按钮样式 */
.btn-primary {
    background-color: #E67E22;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
    background-color: #D35400;
    transform: scale(1.05);
}

/* 导航链接样式 */
.nav-link {
    display: block;
    padding: 10px 15px;
    color: #ECF0F1;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover {
    border-left: 4px solid #E67E22;
    background-color: rgba(236, 240, 241, 0.1);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* 动画效果 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 过渡效果 */
.card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* 背景渐变 */
.hero-section {
    background: linear-gradient(120deg, #2C3E50, #95A5A6);
    color: #fff;
    padding: 100px 20px;
    text-align: center;
    position: relative;
}

.hero-section h1 {
    font-size: 36px;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out forwards;
}

.hero-section p {
    font-size: 18px;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 折叠内容样式 */
.collapsible {
    background-color: #ECF0F1;
    color: #2C3E50;
    cursor: pointer;
    padding: 10px 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin: 10px 0;
}

.collapsible:hover {
    background-color: #D0D3D4;
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: #F2F3F4;
}

/* 章节导航系统 */
.chapter-nav {
    position: sticky;
    top: 60px;
    padding: 20px;
    background-color: rgba(44, 62, 80, 0.8);
    border-radius: 10px;
}

.chapter-nav a {
    display: block;
    color: #ECF0F1;
    text-decoration: none;
    margin: 10px 0;
    font-size: 16px;
    transition: color 0.3s ease;
}

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

/* 代码示例样式 */
.code-sample {
    background-color: #34495E;
    color: #ECF0F1;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    overflow-x: auto;
    margin: 20px 0;
}

/* 链接样式 */
a[rel="nofollow"] {
    color: #2980B9;
    text-decoration: none;
}

a[rel="nofollow"]:hover {
    text-decoration: underline;
}

/* 点缀色应用 */
.accent {
    color: #E67E22;
}

/* 过渡与动画优化 */
.transition-all {
    transition: all 0.3s ease;
}


