/* Bible-Web 圣经在线样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #D4AF37;
    --gold-light: #F4D03F;
    --gold-dark: #B8860B;
    --brown: #3D2914;
    --brown-light: #5C3A1E;
    --ivory: #FFFFF0;
    --ivory-dark: #F5F5DC;
    --parchment: #FDF5E6;
    --text-primary: #2C1810;
    --text-secondary: #5C3A1E;
    --font-size-base: 18px;
}

body {
    font-family: 'Noto Serif SC', serif;
    font-size: var(--font-size-base);
    background: var(--parchment);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
}

/* 羊皮纸纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(212,175,55,0.03) 2px, rgba(212,175,55,0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(212,175,55,0.02) 2px, rgba(212,175,55,0.02) 4px);
    pointer-events: none;
    z-index: 0;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: linear-gradient(135deg, var(--brown) 0%, var(--brown-light) 100%);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-bottom: 3px solid var(--gold);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: 1px solid var(--gold-dark);
    color: var(--gold);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--gold);
    color: var(--brown);
}

.nav-link {
    color: var(--ivory);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--gold);
}

/* ===== 搜索面板 ===== */
.search-panel {
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--brown);
    padding: 1.5rem 2rem;
    z-index: 999;
    border-bottom: 2px solid var(--gold);
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--gold);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--ivory);
    font-family: 'Noto Serif SC', serif;
    outline: none;
}

.search-close {
    background: var(--gold);
    border: none;
    color: var(--brown);
    font-size: 1.5rem;
    width: 45px;
    border-radius: 10px;
    cursor: pointer;
}

.search-results {
    max-width: 600px;
    margin: 1rem auto 0;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    background: var(--ivory);
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--gold);
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    transition: all 0.2s;
}

.search-result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-result-item .sr-ref {
    font-size: 0.85rem;
    color: var(--gold-dark);
    font-weight: 600;
}

.search-result-item .sr-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

.search-result-item .sr-highlight {
    background: rgba(212,175,55,0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== 侧边章节导航 ===== */
.chapter-panel {
    position: fixed;
    top: 60px; right: -320px;
    width: 300px;
    height: calc(100vh - 60px);
    background: linear-gradient(180deg, var(--brown), var(--brown-light));
    z-index: 998;
    transition: right 0.3s ease;
    overflow-y: auto;
    border-left: 2px solid var(--gold);
}

.chapter-panel.open {
    right: 0;
}

.chapter-panel-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--gold-dark);
}

.chapter-panel-header h3 {
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.chapter-panel-header span {
    color: var(--ivory);
    font-size: 0.9rem;
}

.close-panel {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    color: var(--ivory);
    font-size: 1.8rem;
    cursor: pointer;
}

.chapter-panel-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 1rem;
}

.chapter-link {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,240,0.1);
    color: var(--ivory);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid rgba(212,175,55,0.3);
    transition: all 0.2s;
}

.chapter-link:hover {
    background: var(--gold);
    color: var(--brown);
}

/* ===== Hero 首页英雄区 ===== */
.hero {
    margin-top: 60px;
    padding: 6rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(180deg, var(--brown) 0%, var(--brown-light) 50%, var(--parchment) 100%);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(212,175,55,0.3) 0%, transparent 70%);
    animation: heroPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.hero-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8), 0 0 30px rgba(212,175,55,0.5);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    letter-spacing: 0.1em;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--ivory);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-desc {
    font-size: 1.3rem;
    color: var(--ivory);
    font-style: italic;
    max-width: 700px;
    margin: 0 auto 0.5rem;
    line-height: 2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
}

.hero-ref {
    font-size: 1rem;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--brown);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.hero-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(212,175,55,0.5);
}

.hero-btn.secondary {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
}

.hero-btn.secondary:hover {
    background: var(--gold);
    color: var(--brown);
}

/* ===== 分类导航 ===== */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cat-nav-link {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, var(--brown) 0%, var(--brown-light) 100%);
    color: var(--gold);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid var(--gold-dark);
    transition: all 0.3s;
}

.cat-nav-link:hover {
    background: var(--gold);
    color: var(--brown);
    transform: translateY(-2px);
}

/* ===== 分类区域 ===== */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.category-section {
    margin-bottom: 4rem;
}

.category-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(212,175,55,0.3);
}

.category-header h2 {
    font-size: 2rem;
    color: var(--brown);
    font-weight: 700;
}

.category-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== 书卷卡片网格 ===== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--ivory) 0%, var(--ivory-dark) 100%);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 5px 20px rgba(61,41,20,0.12);
    border: 2px solid rgba(212,175,55,0.4);
    transition: all 0.3s;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(61,41,20,0.2);
    border-color: var(--gold);
}

.book-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.book-card-info {
    text-align: center;
}

.book-card-info h3 {
    font-size: 1.2rem;
    color: var(--brown);
    margin-bottom: 0.2rem;
}

.book-card-en {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.book-card-desc {
    font-size: 0.85rem;
    color: var(--gold-dark);
    margin: 0.3rem 0;
}

.book-card-chapters {
    font-size: 0.8rem;
    color: var(--ivory);
    background: var(--brown);
    padding: 0.2rem 0.8rem;
    border-radius: 10px;
}

/* ===== 书卷页 - 卷首 ===== */
.book-header {
    margin-top: 80px;
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: linear-gradient(135deg, var(--brown) 0%, var(--brown-light) 100%);
    border-radius: 20px;
    margin-bottom: 2rem;
    position: relative;
}

.book-icon-large {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.book-header h1 {
    font-size: 2.8rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.3rem;
}

.book-en {
    font-size: 1.1rem;
    color: var(--ivory);
    font-style: italic;
}

.book-desc {
    font-size: 1rem;
    color: var(--gold-light);
    margin: 0.5rem 0;
}

.book-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.8rem;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 1rem;
    background: rgba(255,255,240,0.15);
    border-radius: 15px;
    color: var(--ivory);
    font-size: 0.95rem;
}

/* ===== 章节区域 ===== */
.chapter-section {
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--ivory) 0%, var(--ivory-dark) 100%);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    box-shadow: 0 5px 20px rgba(61,41,20,0.1);
    border: 1px solid rgba(212,175,55,0.3);
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--gold);
}

.chapter-header h2 {
    font-size: 1.8rem;
    color: var(--brown);
    font-weight: 700;
}

.chapter-nav-inline {
    display: flex;
    gap: 0.8rem;
}

.nav-prev, .nav-next {
    padding: 0.4rem 1rem;
    background: var(--brown);
    color: var(--gold);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-prev:hover, .nav-next:hover {
    background: var(--gold);
    color: var(--brown);
}

/* ===== 经文卡片 ===== */
.verses-container {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.verse-card {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
    line-height: 2;
}

.verse-card:hover {
    background: rgba(212,175,55,0.08);
}

.verse-speak-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.verse-card:hover .verse-speak-btn {
    opacity: 1;
}

.verse-speak-btn.speaking {
    opacity: 1;
    animation: speakPulse 1s infinite;
}

@keyframes speakPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.verse-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 1.6rem;
    background: var(--brown);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 0.8rem;
    margin-top: 0.3rem;
    flex-shrink: 0;
}

.verse-text {
    flex: 1;
    font-size: 1.05rem;
    line-height: 2;
}

/* 卡拉OK高亮 */
.verse-text .rh-active {
    color: #7C3AED;
    font-weight: 800;
    font-size: 1.15em;
    text-shadow: 0 0 8px rgba(124,58,237,0.4);
}

.verse-text .rh-passed {
    color: #DC2626;
    font-weight: 600;
}

/* ===== 浮动控制栏 ===== */
.floating-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--brown), var(--brown-light));
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    border: 2px solid var(--gold);
    z-index: 1000;
}

.floating-controls span {
    color: var(--ivory);
    font-size: 0.95rem;
}

.ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: rgba(255,255,240,0.1);
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover {
    background: var(--gold);
    color: var(--brown);
}

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--brown);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    z-index: 999;
}

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

.back-to-top:hover {
    background: var(--gold);
    color: var(--brown);
    transform: translateY(-3px);
}

/* ===== 页脚 ===== */
.footer {
    background: linear-gradient(135deg, var(--brown) 0%, var(--brown-light) 100%);
    color: var(--ivory);
    padding: 2rem;
    text-align: center;
    border-top: 3px solid var(--gold);
    margin-top: 4rem;
}

.footer p {
    font-size: 0.95rem;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 0.6rem 1rem;
    }

    .nav-brand {
        font-size: 1.2rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

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

    .chapter-section {
        padding: 1rem;
    }

    .verse-card {
        padding: 0.4rem 0.3rem;
    }

    .verse-number {
        min-width: 1.6rem;
        height: 1.4rem;
        font-size: 0.7rem;
        margin-right: 0.5rem;
    }

    .chapter-panel {
        width: 260px;
        right: -280px;
    }

    .category-nav {
        gap: 0.5rem;
        padding: 1rem;
    }

    .cat-nav-link {
        padding: 0.3rem 0.8rem;
        font-size: 0.85rem;
    }

    .floating-controls {
        bottom: 10px;
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .book-card {
        padding: 1rem 0.5rem;
    }

    .chapter-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}
