/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #4facfe;
    --success-color: #00c851;
    --warning-color: #ffbb33;
    --danger-color: #ff4444;
    --dark-color: #333333;
    --light-color: #f5f5f5;
    --gray-color: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

img:not([src]):not([srcset]) {
    opacity: 0;
}

/* 图片加载失败时的样式 */
img[alt]:after {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    content: attr(alt);
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 20px;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

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

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 4px;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

/* 章节样式 */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
    display: block;
}

.section-subtitle {
    font-size: 16px;
    color: var(--gray-color);
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
    display: block;
}

/* 页面标题 */
.page-header {
    padding: 100px 0 60px;
    text-align: center;
    color: #ffffff;
}

.page-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-subtitle {
    font-size: 18px;
    margin-bottom: 24px;
    opacity: 0.9;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    opacity: 0.9;
}

.breadcrumb a {
    color: #ffffff;
    text-decoration: underline;
}

.breadcrumb .current {
    text-decoration: none;
}

/* 文本居中 */
.text-center {
    text-align: center;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 28px;
    }

    .page-header {
        padding: 80px 0 40px;
    }

    .page-title {
        font-size: 36px;
    }
}
