
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 正文字体 */
    color: #333;
    background: linear-gradient(135deg, #5D4037 70%, #C5E1A5 25%, #FFECB3 5%);
    overflow-x: hidden; /* 防止横向滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(75, 47, 35, 0.9); /* 半透明深棕色 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar a {
    color: #FFF;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s, transform 0.3s;
}

.navbar a:hover {
    color: #FFB300; /* 点缀色橙色 */
    transform: scale(1.1);
}

/* 主内容区样式 */
.main-content {
    margin-top: 80px; /* 避免被固定导航栏遮挡 */
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 标题样式 */
h2, h3, h4 {
    font-family: 'Playfair Display', serif; /* 主标题字体 */
    color: #3E2723; /* 主色调深棕色 */
}

h2 {
    font-size: 24px;
    margin-top: 40px;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #FFAB40; /* 点缀色亮橙色 */
    margin-top: 10px;
    border-radius: 2px;
}

h3 {
    font-size: 20px;
    margin-top: 30px;
}

h4 {
    font-size: 18px;
    margin-top: 25px;
}

/* 段落样式 */
p {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 15px;
    color: #4E342E; /* 辅色深灰色 */
}

/* 代码块样式 */
pre {
    background-color: #FAF3DD; /* 辅助色米白色 */
    padding: 15px;
    border-left: 5px solid #FFAB40; /* 点缀色橙色 */
    overflow-x: auto;
    border-radius: 4px;
    margin-top: 15px;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 20px 0;
}

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

/* 加载动画样式 */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #C5E1A5; /* 辅色 */
    border-top: 5px solid #5D4037; /* 主色 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 100px auto;
}

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

/* 页脚样式 */
.footer {
    background-color: rgba(75, 47, 35, 0.9); /* 半透明深棕色 */
    color: #FFF;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* 按钮样式 */
.button {
    background-color: #FFAB40; /* 点缀色亮橙色 */
    color: #FFF;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-size: 16px;
}

.button:hover {
    background-color: #E65100; /* 深橙色 */
    transform: scale(1.05);
}

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

    .navbar a {
        margin: 10px 0;
    }

    .main-content {
        padding: 10px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    h4 {
        font-size: 16px;
    }

    p {
        font-size: 14px;
    }

    img.decorative {
        max-width: 100%;
    }
}

