/* 全局样式 */
:root {
    --primary-color: #3f51b5;
    --secondary-color: #f50057;
    --background-color: #f5f5f5;
    --text-color: #333;
    --heading-color: #1a237e;
    --link-color: #3f51b5;
    --link-hover-color: #f50057;
    --section-bg: #fff;
    --border-color: #e0e0e0;
    --footer-bg: #263238;
    --footer-text: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

h4 {
    font-size: 1.25rem;
    margin-top: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover-color);
}

/* 列表样式 */
ol, ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* 头部样式 */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    color: white;
    margin-bottom: 0.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

nav li {
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}

nav a {
    color: white;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav a:hover {
    color: rgba(255, 255, 255, 0.8);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: white;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* 主要内容样式 */
main {
    padding: 2rem 0;
}

.section {
    background-color: var(--section-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section h2 {
    padding: 1.5rem;
    margin: 0;
    background-color: rgba(63, 81, 181, 0.05);
}

.content {
    padding: 1.5rem;
}

.content strong {
    color: var(--primary-color);
}

/* 页脚样式 */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* 打印样式 */
@media print {
    header, footer, nav {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .section {
        box-shadow: none;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    h2 {
        page-break-after: avoid;
    }
    
    h3, h4 {
        page-break-after: avoid;
    }
    
    p, li {
        page-break-inside: avoid;
    }
}

/* 动画效果 */
.section {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
}
