
/* 全局样式设置 */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1E3C72, #2A5298); /* 主色调蓝色渐变背景 */
    color: #ecf0f1;
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(44, 62, 80, 0.9); /* 半透明深蓝色 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ecf0f1;
    text-decoration: none;
}

.navbar .nav-links {
    display: flex;
    gap: 1.5rem;
}

.navbar .nav-links a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.navbar .nav-links a:hover {
    color: #FF9500; /* 点缀色橙色 */
}

/* 侧边工具栏样式 */
.sidebar {
    position: fixed;
    top: 60px; /* 导航栏高度 */
    left: 0;
    width: 250px;
    height: calc(100% - 60px);
    background-color: #34495E;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar .menu-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: #ecf0f1;
    transition: padding 0.3s ease;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar .menu-item img {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    transition: margin 0.3s ease;
}

.sidebar.collapsed .menu-item img {
    margin: 0;
}

.sidebar .menu-text {
    display: inline;
    transition: display 0.3s ease;
}

.sidebar.collapsed .menu-text {
    display: none;
}

/* 主内容区域样式 */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    background: linear-gradient(135deg, #1E3C72, #2A5298);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

.article-content {
    max-width: 800px;
    margin: auto;
    background-color: rgba(44, 62, 80, 0.8);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.article-content h2, .article-content h3, .article-content h4 {
    color: #ecf0f1;
    margin-top: 1.5rem;
}

.article-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #bdc3c7;
}

.article-content a {
    color: #FF9500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: #2ECC71; /* 辅助色绿 */
}

/* 图片样式 */
.article-content img {
    width: 100%;
    max-width: 320px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 1rem 0;
}

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

/* 代码块样式 */
.article-content pre {
    background-color: #2C3E50;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.article-content code {
    color: #1ABC9C;
    font-family: 'Courier New', Courier, monospace;
}

/* 章节导航系统 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 0;
    background-color: rgba(44, 62, 80, 0.9);
    padding: 1rem;
    border-top-left-radius: 8px;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
}

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

.chapter-nav ul li {
    margin: 0.5rem 0;
}

.chapter-nav ul li a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .navbar .nav-links {
        display: none;
    }
    
    .sidebar {
        top: 60px;
    }
    
    .main-content {
        margin-left: 250px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 1rem;
    }
    
    .chapter-nav {
        display: none;
    }
}

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

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

/* 按钮样式 */
.button {
    background-color: #FF9500;
    border: none;
    padding: 0.75rem 1.5rem;
    color: #fff;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background-color: #2ECC71;
    transform: scale(1.05);
}

/* 折叠区域样式 */
.collapsible {
    background-color: #2C3E50;
    color: #ecf0f1;
    cursor: pointer;
    padding: 0.75rem;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    border-radius: 4px;
}

.collapsible:hover {
    background-color: #34495E;
}

.content-collapsible {
    padding: 0 1rem;
    display: none;
    overflow: hidden;
    background-color: rgba(44, 62, 80, 0.8);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.content-collapsible.show {
    display: block;
}

/* 标签页样式 */
.tag {
    background-color: #2A5298;
    color: #ecf0f1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

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

/* 图标按钮样式 */
.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.icon-button:hover {
    transform: scale(1.2);
}

/* 加载动画样式 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2A5298;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: auto;
    display: block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 代码示例样式 */
.code-sample {
    background-color: #2C3E50;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', Courier, monospace;
    color: #1ABC9C;
}

.code-sample:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table, th, td {
    border: 1px solid #34495E;
}

th, td {
    padding: 0.75rem;
    text-align: left;
}

th {
    background-color: #1E3C72;
}

tr:nth-child(even) {
    background-color: rgba(44, 62, 80, 0.5);
}

