
/* 基础样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 设置正文字体 */
    color: #0A3D62; /* 主色调 */
    background-color: #F5F6FA; /* 背景色 */
    line-height: 1.6;
}

/* 全局链接样式 */
a {
    color: #F78C6B; /* 辅色调 */
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: #0A3D62;
}

/* 容器布局 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #0A3D62 70%, #F78C6B 25%, #FF5733 5%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
    position: relative;
}
header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}
header p {
    font-size: 1.2rem;
}
header::after {
    content: "这是一个网页样式设计参考";
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 导航栏样式 */
nav {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}
nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 10px 0;
    margin: 0;
}
nav ul li {
    margin: 0 15px;
}
nav ul li a {
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}
nav ul li a:hover {
    background-color: rgba(247, 140, 107, 0.2);
}

/* 主内容区样式 */
main {
    padding: 40px 0;
}
article {
    max-width: 800px;
    margin: 0 auto;
}
article h2 {
    font-size: 2rem;
    margin-top: 40px;
    color: #0A3D62;
}
article h3 {
    font-size: 1.5rem;
    margin-top: 30px;
    color: #0A3D62;
}
article p {
    font-size: 1rem;
    margin: 15px 0;
}
article pre {
    background-color: #F0F0F0;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}
article pre code {
    font-family: 'Courier New', Courier, monospace;
    color: #333;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
table th, table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
table th {
    background-color: #0A3D62;
    color: #fff;
}
table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}
img.decorative:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 代码示例样式 */
.code-example {
    background-color: #1e1e1e;
    color: #dcdcdc;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin: 20px 0;
}
.code-example::before {
    content: "代码示例";
    display: block;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 5px;
}

/* 导航系统样式 */
.nav-chapter {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background-color: rgba(10, 61, 98, 0.8);
    padding: 10px;
    border-radius: 5px;
}
.nav-chapter a {
    display: block;
    color: #fff;
    margin: 10px 0;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}
.nav-chapter a:hover {
    color: #F78C6B;
}

/* 悬浮返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #0A3D62;
    color: #fff;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    transition: background-color 0.3s ease;
}
.back-to-top:hover {
    background-color: #F78C6B;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    .nav-chapter {
        display: none;
    }
    header h1 {
        font-size: 2rem;
    }
    .back-to-top {
        right: 15px;
        bottom: 15px;
    }
}

