/* ========================================
   星芒教室 - 创新书本翻页式设计
   武汉柏辉网络科技有限公司
   ======================================== */

:root {
    --book-bg: #f4e8d8;
    --page-white: #fffef9;
    --text-ink: #2d2416;
    --accent-red: #c8102e;
    --accent-gold: #d4af37;
    --shadow-book: 0 10px 40px rgba(0, 0, 0, 0.3);
    --border-line: #d4c5b0;
}

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

body {
    font-family: 'Georgia', 'STSong', 'SimSun', serif;
    background: linear-gradient(135deg, #8b7355 0%, #6b5d52 100%);
    color: var(--text-ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ========================================
   侧边书签导航
   ======================================== */
.bookmark-nav {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bookmark {
    background: var(--accent-red);
    color: white;
    padding: 15px 20px 15px 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 8px 0 0 8px;
    box-shadow: -3px 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
}

.bookmark:hover {
    padding-right: 30px;
    background: var(--accent-gold);
}

.bookmark:nth-child(2) { background: #2e7d32; }
.bookmark:nth-child(3) { background: #1976d2; }
.bookmark:nth-child(4) { background: #f57c00; }

/* ========================================
   书本容器
   ======================================== */
.book-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
    flex: 1;
}

.book {
    background: var(--book-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-book);
    position: relative;
    padding: 40px;
}

.book::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, transparent, #8b7355 50%, transparent);
    transform: translateX(-50%);
}

/* ========================================
   书页布局 - 左右对开
   ======================================== */
.book-spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: var(--page-white);
    padding: 60px;
    border-radius: 5px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.05);
    position: relative;
    min-height: 600px;
}

.book-spread::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-line);
    transform: translateX(-50%);
}

.page-left,
.page-right {
    position: relative;
    padding: 20px;
}

/* 页码 */
.page-number {
    position: absolute;
    bottom: 20px;
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
}

.page-left .page-number {
    left: 20px;
}

.page-right .page-number {
    right: 20px;
}

/* ========================================
   封面设计
   ======================================== */
.book-cover {
    background: linear-gradient(135deg, var(--accent-red) 0%, #8b0000 100%);
    color: white;
    padding: 80px 60px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 700px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px),
        radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1), transparent 50%);
}

.cover-content {
    position: relative;
    z-index: 1;
}

.cover-title {
    font-size: 5rem;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 10px;
    font-family: 'KaiTi', 'STKaiti', serif;
}

.cover-subtitle {
    font-size: 1.8rem;
    margin-bottom: 40px;
    opacity: 0.9;
    font-style: italic;
}

.cover-ornament {
    font-size: 4rem;
    margin: 30px 0;
    opacity: 0.8;
}

.cover-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

.btn-cover {
    padding: 18px 40px;
    background: white;
    color: var(--accent-red);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 5px;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-cover:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-cover.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

/* ========================================
   章节标题
   ======================================== */
.chapter-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-red);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--accent-gold);
    position: relative;
}

.chapter-title::before {
    content: '第一章';
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 0.8rem;
    color: #999;
    font-weight: normal;
}

/* ========================================
   段落样式
   ======================================== */
.paragraph {
    text-indent: 2em;
    line-height: 2.2;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: justify;
}

.paragraph:first-letter {
    font-size: 2.5em;
    font-weight: bold;
    float: left;
    line-height: 1;
    margin-right: 8px;
    color: var(--accent-red);
}

/* ========================================
   插图样式
   ======================================== */
.illustration {
    margin: 30px 0;
    text-align: center;
}

.illustration img {
    max-width: 100%;
    border: 5px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.illustration-caption {
    margin-top: 15px;
    font-style: italic;
    color: #666;
    font-size: 0.95rem;
}

/* ========================================
   信息框
   ======================================== */
.info-box {
    background: #fff9e6;
    border-left: 5px solid var(--accent-gold);
    padding: 25px;
    margin: 30px 0;
    border-radius: 3px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.info-box h3 {
    color: var(--accent-red);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-box p {
    line-height: 1.9;
    margin-bottom: 10px;
}

/* ========================================
   漫画阅读器 - 卷轴式
   ======================================== */
.scroll-reader {
    background: var(--page-white);
    padding: 40px;
    border-radius: 5px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.05);
}

.scroll-header {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, var(--accent-red), #d4af37);
    color: white;
    border-radius: 5px;
    margin-bottom: 40px;
}

.scroll-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    font-family: 'KaiTi', 'STKaiti', serif;
}

.scroll-description {
    font-size: 1.2rem;
    line-height: 2;
    max-width: 900px;
    margin: 0 auto;
}

.scroll-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.scroll-panel {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--accent-gold);
}

.scroll-panel img {
    width: 100%;
    display: block;
    border-radius: 3px;
}

/* ========================================
   表单 - 信纸风格
   ======================================== */
.letter-form {
    background: var(--page-white);
    padding: 50px;
    border-radius: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-line);
    position: relative;
}

.letter-form::before {
    content: '';
    position: absolute;
    left: 60px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(
        to bottom,
        var(--accent-red) 0px,
        var(--accent-red) 2px,
        transparent 2px,
        transparent 40px
    );
}

.form-field {
    margin-bottom: 30px;
    padding-left: 40px;
}

.form-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent-red);
    font-size: 1.1rem;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-bottom: 2px solid var(--border-line);
    background: transparent;
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-bottom-color: var(--accent-red);
}

.form-field textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 2;
}

.btn-submit {
    background: var(--accent-red);
    color: white;
    padding: 15px 50px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(200, 16, 46, 0.3);
}

.btn-submit:hover {
    background: #a00d25;
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(200, 16, 46, 0.4);
}

/* ========================================
   页脚 - 书籍封底
   ======================================== */
.book-footer {
    background: var(--book-bg);
    padding: 50px 40px 30px;
    text-align: center;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
    margin-top: 40px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-line);
}

.footer-link {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 20px;
    border: 2px solid var(--accent-red);
    border-radius: 20px;
    transition: all 0.3s;
}

.footer-link:hover {
    background: var(--accent-red);
    color: white;
}

.footer-info {
    color: #666;
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-copyright {
    margin-top: 20px;
    font-style: italic;
    color: #999;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
    .book-spread {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .book-spread::before {
        display: none;
    }
    
    .bookmark-nav {
        display: none;
    }
    
    .cover-title {
        font-size: 3rem;
    }
    
    .scroll-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .book-container {
        padding: 10px;
        margin: 20px auto;
    }
    
    .book {
        padding: 20px;
    }
    
    .book-spread {
        padding: 30px 20px;
    }
    
    .cover-title {
        font-size: 2.5rem;
        letter-spacing: 5px;
    }
    
    .cover-subtitle {
        font-size: 1.3rem;
    }
    
    .cover-buttons {
        flex-direction: column;
    }
    
    .letter-form {
        padding: 30px 20px;
    }
    
    .form-field {
        padding-left: 20px;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes pageFlip {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-180deg); }
}

.page-flip-animation {
    animation: pageFlip 0.6s ease-in-out;
}
