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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --hover-color: #2980b9;
}

body {
    font-family: '华文楷体', '楷体', 'KaiTi', '微软雅黑', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.9;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 50%, #f0f8ff 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: #2c3e50;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 背景装饰元素 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="20" fill="rgba(100,120,200,0.05)">书</text><text x="30" y="30" font-size="15" fill="rgba(100,120,200,0.03)">读</text><text x="70" y="80" font-size="18" fill="rgba(100,120,200,0.04)">文</text></svg>') repeat;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,250,255,0.95) 100%);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    text-align: center;
    padding: 4rem 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border-bottom: 3px solid #f39c12;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #f1c40f, #2ecc71, #3498db, #9b59b6);
    animation: rainbow 3s ease-in-out infinite;
}

@keyframes rainbow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.8; }
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #2c3e50, #34495e, #e74c3c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    letter-spacing: 0.1em;
    position: relative;
}

.logo h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #e74c3c, #f39c12);
    border-radius: 2px;
}

header .subtitle {
    font-size: 1.4rem;
    color: #7f8c8d;
    margin-top: 1.5rem;
    font-style: italic;
    opacity: 0.9;
}

.decorative-quote {
    margin-top: 2rem;
    font-size: 1.1rem;
    color: #95a5a6;
    font-style: italic;
    position: relative;
}

.decorative-quote::before,
.decorative-quote::after {
    content: '"';
    font-size: 2rem;
    color: #bdc3c7;
    vertical-align: top;
}

/* 导航栏 - 移到header下方 */
nav {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

nav li {
    flex: 0 0 auto;
}

nav a {
    display: block;
    padding: 1.2rem 2.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.15rem;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #9b59b6);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.05);
}

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

/* 主容器 */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
}

/* 页面标题 */
.page-title {
    text-align: center;
    margin-bottom: 4rem;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.3);
}

.page-title h1 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
    position: relative;
}

.page-title h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #9b59b6);
    border-radius: 2px;
}

.page-title p {
    font-size: 1.35rem;
    color: #556b7c;
    line-height: 2;
    max-width: 800px;
    margin: 1.5rem auto 0;
}

/* 书籍卡片网格 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.book-card {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    border: 2px solid rgba(255,255,255,0.5);
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.book-card:hover::before {
    left: 100%;
}

.book-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
}

.book-cover {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

article:nth-child(1) .book-cover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

article:nth-child(2) .book-cover {
    background: linear-gradient(135deg, #89c4f4 0%, #a8e0da 100%);
}

.book-cover span {
    position: relative;
    z-index: 2;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.book-info {
    padding: 2.5rem;
}

.book-info h2 {
    font-size: 2.1rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-weight: bold;
}

.book-author {
    color: #7f8c8d;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.book-description {
    color: #556b7c;
    font-size: 1.1rem;
    line-height: 2;
    margin-bottom: 1.5rem;
}

.book-meta {
    display: flex;
    gap: 1rem;
    font-size: 1.05rem;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.book-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* 书籍详情页 */
.book-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    margin: -4rem -2rem 4rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
}

.book-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #f1c40f, #2ecc71, #3498db, #9b59b6);
    animation: rainbow 3s ease-in-out infinite;
}

.book-header.zhaohuaxishi {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.book-header.xiyouji {
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,250,255,0.95) 100%);
    color: #2c3e50;
}

.book-header.xiyouji h1,
.book-header.xiyouji .author,
.book-header.xiyouji .intro {
    color: #2c3e50;
}

.book-header-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

.book-header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
}

.book-header h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
}

.book-header .author {
    font-size: 1.5rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.book-header .intro {
    font-size: 1.15rem;
    line-height: 2;
    max-width: 900px;
    opacity: 0.95;
}

/* 内容区域 */
.content-section {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    animation: fadeInUp 0.6s ease-out forwards;
}

.content-section h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #3498db, #9b59b6) 1;
    font-weight: bold;
    position: relative;
}

.content-section h3 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin: 2.5rem 0 1.2rem;
    font-weight: 600;
}

.content-section h4 {
    font-size: 1.35rem;
    color: var(--primary-color);
    margin: 1.8rem 0 1rem;
    font-weight: 600;
}

.content-section h5 {
    font-size: 1.15rem;
    color: var(--primary-color);
    margin: 1.5rem 0 0.8rem;
    font-weight: 600;
}

.content-section p {
    margin-bottom: 1.2rem;
    text-indent: 2em;
    line-height: 2;
    font-size: 1.05rem;
    color: #34495e;
}

.content-section ul, .content-section ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.content-section li {
    margin-bottom: 1rem;
    line-height: 2;
    font-size: 1.05rem;
    color: #34495e;
}

/* 章节列表 */
.chapters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.chapter-item {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(155, 89, 182, 0.05) 100%);
    border-radius: 12px;
    border-left: 4px solid transparent;
    border-image: linear-gradient(135deg, #3498db, #9b59b6) 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chapter-item h3 {
    margin: 0;
    font-size: 1.15rem;
}

.chapter-item:hover {
    background: linear-gradient(135deg, #3498db 0%, #9b59b6 100%);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

/* 返回按钮 */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 0.8rem 1.5rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 25px;
    border: 2px solid var(--secondary-color);
}

.back-link:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateX(-5px);
}

.back-link::before {
    content: "← ";
}

/* 特色链接按钮（如取经路线图、81难） */
a[href*="map"]:hover,
a[href*="risk"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(52, 152, 219, 0.4) !important;
}

a[href*="risk"]:hover {
    box-shadow: 0 15px 40px rgba(231, 76, 60, 0.4) !important;
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    color: var(--primary-color);
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 5rem;
    position: relative;
    border-top: 1px solid rgba(44, 62, 80, 0.1);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #f1c40f, #2ecc71, #3498db, #9b59b6);
    opacity: 0.6;
}

footer p {
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    header {
        padding: 3rem 1rem;
    }

    .logo h1 {
        font-size: 2.5rem;
    }

    header .subtitle {
        font-size: 1.2rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav a {
        padding: 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .container {
        padding: 2rem 1rem;
    }

    .page-title {
        padding: 2rem 1.5rem;
    }

    .page-title h1 {
        font-size: 2.2rem;
    }

    .page-title p {
        font-size: 1.15rem;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .book-info h2 {
        font-size: 1.8rem;
    }

    .book-author {
        font-size: 1.1rem;
    }

    .book-description {
        font-size: 1rem;
    }

    .book-header {
        margin: -2rem -1rem 2rem;
        padding: 3rem 0;
    }

    .book-header h1 {
        font-size: 2.5rem;
    }

    .content-section {
        padding: 2rem 1.5rem;
    }

    .content-section h2 {
        font-size: 1.9rem;
    }

    .content-section h3 {
        font-size: 1.5rem;
    }

    .content-section h4 {
        font-size: 1.25rem;
    }

    .content-section p,
    .content-section li {
        font-size: 1rem;
    }

    .chapters-list {
        grid-template-columns: 1fr;
    }

    .chapter-item h3 {
        font-size: 1.05rem;
    }
}

/* 表格样式优化 */
table {
    font-size: 1.05rem;
}

table th {
    font-size: 1.15rem;
    font-weight: 600;
}

table td {
    font-size: 1.05rem;
    line-height: 2;
    color: #34495e;
}

/* SEO优化的内容区域 */
article {
    margin-bottom: 2rem;
}

/* 打印样式 */
@media print {
    header, footer, nav, .back-link {
        display: none;
    }

    .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
