
/* 定义全局变量，便于色彩统一管理 */
:root {
    --main-color: #1E90FF; /* 主色调 - 蓝色 */
    --secondary-color: #FFFFFF; /* 辅助色 - 白色 */
    --accent-color: #FFD700; /* 点缀色 - 黄色 */
    --background-color: #f0f2f5; /* 页面背景色 */
    --text-color: #333333; /* 正文字体颜色 */
    --header-height: 60px; /* 导航栏高度 */
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(30, 144, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    transition: background 0.3s ease;
}

.navbar.scrolled {
    background: rgba(30, 144, 255, 1);
}

.navbar a {
    color: var(--secondary-color);
    text-decoration: none;
    margin: 0 1rem;
    position: relative;
    transition: color 0.3s ease;
}

.navbar a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.navbar a:hover::after {
    width: 100%;
}

.navbar a:focus {
    outline: none;
}

/* 主内容区域 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

/* 文章区块 */
.article-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-section:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.article-section h2, .article-section h3 {
    color: var(--main-color);
    margin-bottom: 1rem;
}

.article-section p {
    margin-bottom: 1rem;
}

.article-section pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
    overflow: auto;
    margin-bottom: 1rem;
}

.article-section code {
    color: #d14;
    background-color: #f7f7f9;
    padding: 2px 4px;
    border-radius: 4px;
}

/* 图片样式 */
.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

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

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

/* 提示语样式 */
.prompt {
    background: var(--main-color);
    color: var(--secondary-color);
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.active, .collapsible:hover {
    background-color: var(--main-color);
    color: var(--secondary-color);
}

.content {
    padding: 0 1rem;
    display: none;
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.content p {
    margin: 1rem 0;
}

/* 底部样式 */
.footer {
    background: var(--main-color);
    color: var(--secondary-color);
    padding: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer .section {
    flex: 1 1 300px;
    margin: 1rem;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
    }

    .navbar a {
        margin: 0.5rem 0;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .image-container {
        justify-content: center;
    }
}

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

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

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    border: none;
    border-radius: 25px;
    color: white;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    background: linear-gradient(45deg, var(--accent-color), var(--main-color));
}

/* 代码块样式 */
pre code {
    display: block;
    padding: 1rem;
    background: #2d2d2d;
    color: #f8f8f2;
    border-radius: 5px;
    overflow-x: auto;
    position: relative;
}

pre code::before {
    content: "代码示例";
    position: absolute;
    top: -1.5rem;
    left: 0;
    background: #333;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

