
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 采用现代无衬线字体 */
    background: linear-gradient(135deg, #2c3e50 70%, #34495e 25%, #e74c3c 5%); /* 主色、辅色、点缀色的渐变背景 */
    color: #ecf0f1; /* 文字颜色 */
    line-height: 1.6;
}

/* 盒模型调整 */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.9); /* 半透明深蓝色背景 */
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #e67e22; /* 点缀色悬停效果 */
}

/* 主内容区域 */
.main-content {
    padding: 100px 20px 50px 20px; /* 顶部留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    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 8px 12px rgba(0,0,0,0.2);
}

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

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

/* 文章样式 */
article {
    grid-column: 1 / -1;
    background: rgba(44, 62, 80, 0.8);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

article h2, article h3, article h4 {
    color: #e67e22; /* 点缀色用于标题 */
}

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

/* 代码块样式 */
pre {
    background: #1abc9c;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

code {
    font-family: 'Courier New', Courier, monospace;
    color: #2c3e50;
    background: #ecf0f1;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }

    nav a {
        margin: 10px 0;
    }

    .main-content {
        padding: 100px 10px 30px 10px;
    }
}

/* 提示信息样式 */
.alert {
    background: #e74c3c;
    color: #fff;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: bold;
}

/* 按钮样式 */
button {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: #2980b9;
}

/* 链接样式 */
a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
}

/* 页脚样式 */
footer {
    background: rgba(44, 62, 80, 0.9);
    color: #ecf0f1;
    text-align: center;
    padding: 30px 20px;
    position: relative;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

footer a {
    color: #e67e22;
    margin: 0 10px;
}

footer a:hover {
    color: #d35400;
}

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

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