
/* 全局样式设置 */
/* 设定基本字体、颜色和背景 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1E3A8A 70%, #3B82F6 25%, #F59E0B 5%);
    color: #1F2937;
    line-height: 1.6;
}

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

.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.navbar li {
    position: relative;
}

.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    padding: 8px 12px;
    transition: background 0.3s ease, border-radius 0.3s ease;
}

.navbar a:hover {
    background: #2563EB;
    border-radius: 4px;
}

/* 多级菜单样式 */
.navbar li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #3B82F6;
    padding: 10px 0;
    border-radius: 5px;
    min-width: 150px;
}

.navbar li:hover ul {
    display: block;
}

.navbar li ul li {
    padding: 5px 20px;
}

.navbar li ul li a:hover {
    background: #2563EB;
}

/* 主内容区 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* 这是一个网页样式设计参考 */
.reference-banner {
    text-align: center;
    font-size: 1.5rem;
    color: #FFFFFF;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* 文章内容区 */
article {
    background: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

article h2 {
    font-size: 2rem;
    color: #1E3A8A;
    margin-bottom: 20px;
    position: relative;
}

article h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: #F59E0B;
    margin-top: 10px;
    border-radius: 2px;
}

article h3 {
    font-size: 1.5rem;
    color: #3B82F6;
    margin-top: 30px;
    margin-bottom: 15px;
}

article p {
    margin-bottom: 15px;
    text-align: justify;
}

article pre {
    background: #F3F4F6;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    position: relative;
}

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

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.image-gallery img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(45deg, #F59E0B, #EF4444);
    border: none;
    color: #FFFFFF;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #EF4444, #F59E0B);
    transform: translateY(-3px);
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 1fr 3fr;
    }

    .image-gallery {
        justify-content: flex-start;
    }
}

@media (min-width: 1024px) {
    .container {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

.code-example code {
    display: block;
    white-space: pre;
}

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

.collapsible:hover {
    background-color: #2563EB;
}

.content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #F3F4F6;
    border-radius: 5px;
}

.content p {
    color: #1F2937;
}

/* 鼠标滚动效果 */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* 图标样式 */
.icon {
    font-size: 1.5rem;
    color: #3B82F6;
    margin-right: 10px;
}

