
/* 基本样式重置，确保各浏览器表现一致 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置全局字体和背景色，采用丰富且和谐的色彩搭配 */
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f5dc 70%, #d3d3d3 25%, #ff6347 5%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* 样式化顶部导航栏，固定在顶部并具有阴影效果 */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(62, 39, 35, 0.9);
    color: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 导航菜单样式，采用黄金比例布局 */
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #ff6347;
}

/* 主内容区样式，设置顶距避免被固定导航遮挡 */
.main-content {
    margin-top: 80px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

/* 侧边栏样式，适应不同屏幕尺寸 */
.sidebar {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    margin-bottom: 15px;
    color: #3e2723;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #00bcd4;
    transition: color 0.3s ease;
}

.sidebar ul li a:hover {
    color: #3e2723;
}

/* 文章内容样式，包含标题、段落、代码块等 */
.article-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.article-content h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #827717;
}

.article-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #00bcd4;
}

.article-content p {
    margin-bottom: 15px;
    font-size: 16px;
}

.article-content pre {
    background: #f0f0f0;
    padding: 10px;
    border-left: 5px solid #00bcd4;
    overflow-x: auto;
    margin-bottom: 15px;
}

/* 图片样式，添加圆角、阴影和悬停效果 */
img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px 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 16px rgba(0,0,0,0.3);
}

/* 按钮样式，具有渐变和悬停效果 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(45deg, #00bcd4, #3e2723);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background: linear-gradient(45deg, #3e2723, #00bcd4);
    transform: scale(1.05);
}

/* 卡片布局样式，用于展示示例数据 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
}

.card-content h4 {
    margin-bottom: 10px;
    color: #3e2723;
}

.card-content p {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.card-content a {
    text-decoration: none;
    color: #00bcd4;
    font-weight: bold;
}

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

/* 响应式设计，适应不同设备 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 微交互效果，增加用户体验 */
.section-title {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: #ff6347;
    left: 0;
    bottom: 0;
    transition: width 0.3s ease;
}

.section-title:hover::after {
    width: 100px;
}

/* 导航链接平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 样式化示例链接，确保所有外部链接添加 rel="nofollow" */
a[rel="nofollow"] {
    color: #00bcd4;
    text-decoration: none;
}

a[rel="nofollow"]:hover {
    color: #ff6347;
}

