
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1A237E 70%, #FFFFFF 25%, #FFC107 5%);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* 防止水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(26, 35, 126, 0.9); /* 主色调带透明度 */
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #FFC107; /* 点缀色 */
}

/* 主内容区 */
.main-content {
    padding: 80px 20px 20px 20px; /* 留出导航栏空间 */
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

/* 侧边栏样式 */
.sidebar {
    background-color: #F5F5F5; /* 辅色 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

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

/* 文章内容样式 */
.article {
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article h2, .article h3 {
    color: #1A237E; /* 主色调 */
    font-family: 'Montserrat', sans-serif;
}

.article pre {
    background-color: #F5F5F5; /* 辅色 */
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
}

.article code {
    font-family: 'Courier New', monospace;
    background-color: #F5F5F5;
    padding: 2px 4px;
    border-radius: 4px;
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #1A237E, #FFC107); /* 渐变 */
    border: none;
    border-radius: 25px;
    color: #FFFFFF;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 卡片样式 */
.card {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img {
    width: 100%;
    height: auto;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-direction: column;
        padding: 0.5rem 0;
    }
    
    .navbar a {
        padding: 0.5rem 0;
    }
    
    .button {
        width: 100%;
        padding: 10px;
    }
}

/* 滚动动画 */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* 提示文本样式 */
.prompt-text {
    text-align: center;
    font-size: 18px;
    color: #FFC107; /* 点缀色 */
    margin: 20px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.collapsible:hover {
    background-color: #0D47A1;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #F5F5F5;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* 代码示例样式 */
.code-example {
    background-color: #263238;
    color: #ECEFF1;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

/* 图表样式 */
.chart-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-container svg {
    width: 100%;
    height: auto;
}

.chart-container .bar {
    fill: #FFC107; /* 点缀色 */
    transition: fill 0.3s ease, transform 0.3s ease;
}

.chart-container .bar:hover {
    fill: #1A237E; /* 主色调 */
    transform: scaleY(1.1);
}

