
/* 整体页面样式 */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 主色调深蓝渐变背景 */
    font-family: 'Roboto', sans-serif; /* 使用无衬线字体确保清晰易读 */
    color: #ecf0f1; /* 主文本颜色 */
    overflow-x: hidden; /* 防止水平滚动条 */
}

/* 章节导航系统 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(20, 28, 40, 0.9);
    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;
    color: #ffffff;
}

.navbar .nav-links a {
    margin: 0 15px;
    text-decoration: none;
    color: #7f8c8d;
    position: relative;
    transition: color 0.3s;
}

.navbar .nav-links a:hover {
    color: #3498db;
}

/* 提示信息样式 */
.reference-note {
    background: rgba(52, 152, 219, 0.8);
    color: #ffffff;
    text-align: center;
    padding: 10px 0;
    font-size: 1.2em;
    position: relative;
    top: 60px;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 250px;
    height: calc(100vh - 60px);
    background: #1e2a38;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.sidebar a {
    text-decoration: none;
    color: #bdc3c7;
    margin: 15px 0;
    transition: color 0.3s;
}

.sidebar a:hover {
    color: #3498db;
}

/* 主内容区域样式 */
.main-content {
    margin-left: 250px;
    padding: 80px 20px 20px 20px;
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 20px;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 3fr 1fr;
    }
}

/* 文章内容样式 */
article {
    background: rgba(30, 42, 56, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

article p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

article pre {
    background: #2c3e50;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

article code {
    color: #e74c3c;
}

/* 图片装饰样式 */
.decorative-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.decorative-images img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.decorative-images img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0,0,0,0.4);
}

/* 代码示例的特别样式 */
.code-example {
    background: #34495e;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.code-example pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    color: #ecf0f1;
}

/* 渐变线条分隔 */
.gradient-divider {
    height: 2px;
    background: linear-gradient(to right, #3498db, #9b59b6);
    margin: 40px 0;
}

/* 微交互动画 */
@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite;
}

/* 按钮样式 */
button {
    background: #2c3e50;
    color: #ecf0f1;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s, transform 0.3s;
    cursor: pointer;
}

button:hover {
    background: #3498db;
    transform: scale(1.05);
}

/* 成功标记样式 */
.success-check {
    width: 20px;
    height: 20px;
    border: 2px solid #2ecc71;
    border-top: none;
    border-right: none;
    transform: rotate(45deg);
    animation: checkMark 0.5s forwards;
}

@keyframes checkMark {
    from { opacity: 0; transform: rotate(45deg) scale(0); }
    to { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        justify-content: space-around;
    }
    
    .main-content {
        margin-left: 0;
    }
}

