
/* 全局样式设置 */
/* 设置文档的字体、背景和整体布局 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif; /* 使用现代无衬线字体 */
    font-size: 16px; /* 基础字号 */
    background: linear-gradient(135deg, #6A11CB 70%, #2575FC 25%, #56ab2f 5%); /* 渐变背景 */
    color: #333; /* 文字颜色 */
    line-height: 1.6;
    box-sizing: border-box;
}

/* 设置所有元素的盒模型 */
*, *::before, *::after {
    box-sizing: inherit;
}

/* 导航栏样式 */
/* 使用固定定位，确保在页面滚动时始终可见 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(to right, #2575FC, #6A11CB);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果增加立体感 */
    z-index: 1000;
}

/* 导航链接样式 */
.navbar a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.3s ease, transform 0.3s ease; /* 平滑过渡效果 */
}

.navbar a:hover {
    color: #a8e063; /* 点缀色，吸引注意 */
    transform: scale(1.1); /* 悬停时略微放大 */
}

/* 主内容区域样式 */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 120px 20px 40px 20px; /* 顶部留出导航栏空间 */
}

/* 文章区域样式 */
article {
    background: rgba(255, 255, 255, 0.8); /* 半透明背景，避免使用纯白色 */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 细腻阴影 */
}

article h2, article h3, article h4 {
    color: #2575FC; /* 主色调标题 */
    margin-bottom: 15px;
}

article p {
    font-size: 16px;
    margin-bottom: 20px;
}

article pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 10px;
    overflow: auto;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

article pre code {
    font-family: 'Courier New', Courier, monospace;
    color: #333;
    position: relative;
}

/* 代码块标题样式 */
article pre code::before {
    content: '代码示例';
    display: block;
    background: #6A11CB;
    color: #fff;
    padding: 5px 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    font-size: 14px;
    position: absolute;
    top: -26px;
    left: 0;
    width: 100%;
    text-align: left;
}

/* 图片样式 */
/* 创建一个图片容器，保持图片的圆角和阴影 */
.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.image-container img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 提示文字样式 */
.promo-text {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #a8e063; /* 点缀色突出重点 */
    margin-bottom: 40px;
}

/* 响应式设计 */
/* 针对不同屏幕尺寸调整布局 */
@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 2fr 1fr; /* 两栏布局 */
    }
}

@media (min-width: 1200px) {
    .main-content {
        grid-template-columns: 3fr 1fr 1fr; /* 三栏布局 */
    }
}

/* 过渡动画 */
/* 平滑的元素显示效果 */
.section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

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

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #6A11CB, #2575FC);
    border: none;
    padding: 15px 30px;
    color: #fff;
    cursor: pointer;
    border-radius: 30px;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background: linear-gradient(45deg, #2575FC, #6A11CB);
    transform: translateY(-5px);
}

/* 卡片式布局样式 */
.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 10px 10px;
}

.collapsible.active, .collapsible:focus {
    background-color: #ccc;
}

@media (max-width: 500px) {
    article {
        padding: 20px;
    }
}

