
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #2C3E50 70%, #7F8C8D 25%, #E67E22 5%); /* 渐变背景，主色70%，辅色25%，点缀色5% */
    color: #ecf0f1;
    line-height: 1.6;
    box-sizing: border-box;
}

/* 容器设置，确保响应式布局 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 文章标题样式 */
h2, h3, h4 {
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 15px;
}

h4 {
    font-size: 1.2em;
    margin-top: 25px;
    margin-bottom: 10px;
}

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

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 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;
}

.navbar ul li a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #E67E22;
}

/* 侧边栏菜单样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 250px;
    height: 100%;
    background: #7F8C8D;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding-top: 20px;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar ul {
    list-style: none;
    padding: 0 20px;
}

.sidebar ul li {
    margin: 15px 0;
}

.sidebar ul li a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    padding: 10px 0;
    transition: background 0.3s ease;
}

.sidebar ul li a:hover {
    background: #2C3E50;
    border-radius: 4px;
}

/* 切换按钮样式 */
.toggle-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 24px;
    cursor: pointer;
}

/* 图片样式，圆角、阴影、悬浮效果 */
img.decorative {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 代码块样式，与正文区分 */
pre {
    background: #34495E;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

code {
    color: #1ABC9C;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 按钮样式，渐变、过渡 */
.button {
    background: linear-gradient(45deg, #E67E22, #27AE60);
    border: none;
    padding: 10px 20px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background: linear-gradient(45deg, #27AE60, #E67E22);
    transform: scale(1.05);
}

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

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

/* 响应式媒体查询，确保内容在小屏幕下的排版 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sidebar {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    h2 {
        font-size: 1.8em;
    }
    
    p {
        font-size: 15px;
    }
}

/* 微交互与动效 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 提示信息样式 */
.banner {
    background: rgba(231, 126, 34, 0.9);
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 1.2em;
    position: relative;
    margin-top: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

