
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #3498db, #9b59b6); /* 渐变背景，从蓝到紫 */
    color: #ffffff; /* 文字颜色为白色 */
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    width: 100%;
    background: rgba(52, 152, 219, 0.8); /* 半透明背景 */
    transition: background 0.5s ease; /* 过渡效果 */
    padding: 15px 20px; /* 内边距 */
    z-index: 1000; /* 置于最上层 */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar.scrolled {
    background: rgba(52, 152, 219, 1); /* 滚动后背景变为不透明 */
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 10px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #f1c40f; /* 鼠标悬停时颜色变化为黄色 */
}

/* 主要内容容器 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 顶部留出导航栏空间 */
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); /* 最小宽度500px */
    gap: 20px; /* 网格间距 */
}

/* 模块样式 */
.section {
    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; /* 过渡效果 */
}

.section:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); /* 增加阴影 */
}

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

h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

/* 正文段落 */
p {
    font-size: 16px;
    margin-bottom: 15px;
}

/* 按钮样式 */
.btn-primary {
    background-color: #e67e22; /* 橙色背景 */
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #d35400; /* 鼠标悬停变深橙色 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 增加阴影 */
}

/* 图片装饰样式 */
.decorative-image {
    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; /* 过渡效果 */
}

.decorative-image:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 8px 12px rgba(0,0,0,0.5); /* 增强阴影 */
}

/* 代码块样式 */
pre {
    background: rgba(0, 0, 0, 0.8); /* 深色背景 */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}

code {
    color: #f1c40f; /* 代码颜色 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .container {
        grid-template-columns: 1fr; /* 单栏布局 */
    }
}

