
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif; /* 设置全局字体 */
    font-size: 16px; /* 设置基础字体大小 */
    line-height: 1.6; /* 行高 */
    color: #333; /* 文字颜色 */
    background: linear-gradient(135deg, #228B22 0%, #003366 100%); /* 主色调渐变背景 */
}

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

.nav-item {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: #FFA500; /* 鼠标悬停颜色变化为橙色 */
}

/* 主要内容容器 */
.container {
    display: grid;
    grid-template-areas:
        "header"
        "main"
        "footer";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    max-width: 1200px;
    margin: 100px auto 50px; /* 顶部留出导航栏空间 */
    padding: 20px;
}

/* 文章标题 */
h1 {
    font-size: 32px;
    color: #FFA500; /* 点缀色橙色 */
    text-align: center;
    margin-bottom: 40px;
}

/* 章节标题 */
h2, h3, h4 {
    color: #228B22; /* 主色调森林绿 */
    margin-top: 30px;
}

/* 段落样式 */
p {
    font-size: 17px;
    margin-bottom: 1.5em;
    text-align: justify;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 15px; /* 圆角 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* 阴影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px auto;
    display: block;
}

img.decorative:hover {
    transform: scale(1.05); /* 悬停放大 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3); /* 阴影加深 */
}

/* 代码块样式 */
pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

code.language-css {
    color: #d6336c; /* 代码颜色 */
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #228B22;
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* 按钮样式 */
.button {
    background-color: #228B22;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background-color: #FFA500;
    transform: scale(1.05);
}

/* 底部导航栏样式 */
.footer {
    background-color: rgba(0, 51, 102, 0.9);
    color: #fff;
    text-align: center;
    padding: 20px 0;
    position: relative;
    bottom: 0;
    width: 100%;
}

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

    h1 {
        font-size: 40px;
    }

    .navbar {
        padding: 20px 0;
    }
}

@media (max-width: 767px) {
    .navbar {
        flex-direction: column;
    }

    .nav-item {
        padding: 10px 0;
    }

    h1 {
        font-size: 28px;
    }

    p {
        font-size: 15px;
    }

    code.language-css {
        font-size: 14px;
    }
}

/* 微交互效果 */
a {
    color: #228B22;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #FFA500;
}

/* 留白与分隔线 */
.section {
    padding: 50px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 50px;
}

/* 装饰元素 */
.decorative-line {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #228B22, #003366);
    margin: 20px auto;
}

/* 顶部提示 */
.top-banner {
    background-color: rgba(255, 165, 0, 0.9); /* 橙色半透明背景 */
    color: #fff;
    text-align: center;
    padding: 15px 0;
    font-size: 18px;
    position: fixed;
    width: 100%;
    top: 50px; /* 导航栏下方 */
    z-index: 999;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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