/* 基础变量 */
:root {
    --bg: #ffffff;
    --text: #333333;
    --nav-bg: rgba(255,255,255,0.9);
    --modal-bg: #ffffff;
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --text: #e0e0e0; /* 修复：黑色模式字体变白 */
    --nav-bg: rgba(26,26,26,0.9);
    --modal-bg: #2a2a2a;
}

[data-theme="sepia"] {
    --bg: #f4ecd8;
    --text: #5b4636;
    --nav-bg: rgba(244,236,216,0.9);
    --modal-bg: #f4ecd8;
}

body {
    background-color: var(--bg);
    color: var(--text);
    transition: 0.3s;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

/* 广告位样式 */
.ad-slot-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}
.ad-placeholder {
    width: 336px;
    height: 280px;
    background: rgba(0,0,0,0.05);
    border: 1px dashed rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* 导航与内容 */
.read-nav {
    position: sticky; top: 0;
    height: 60px;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.read-container { max-width: 800px; margin: 0 auto; padding: 20px; }
.chapter-text p { font-family: 'Merriweather', serif; line-height: 1.8; font-size: auto; margin-bottom: 1.5em; }

/* 悬浮下载条 */
.sticky-download-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 15px;
    z-index: 90;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
}
.download-content {
    max-width: 800px; margin: 0 auto;
    display: flex; justify-content:none; align-items: center;
}
.cta-download-btn {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
    color: white; border: none;
    padding: 10px 25px; border-radius: 50px;
    font-weight: bold; cursor: pointer;
    display: flex; align-items: center;
    box-shadow: 0 4px 10px rgba(221, 36, 118, 0.3);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 设置面板 */
.settings-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 200;
    display: flex; align-items: flex-end; justify-content: center;
}
.settings-modal.hidden { display: none; }

.settings-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
}
.settings-card {
    position: relative;
    background: var(--modal-bg);
    width: 100%; max-width: 500px;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    z-index: 201;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from {transform: translateY(100%);} to {transform: translateY(0);} }

.theme-options { display: flex; gap: 20px; margin-top: 10px; }
.theme-circle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #ddd; cursor: pointer; }
.theme-circle.light { background: #fff; }
.theme-circle.sepia { background: #f4ecd8; }
.theme-circle.dark { background: #1a1a1a; }

.font-control { display: flex; align-items: center; gap: 15px; background: rgba(0,0,0,0.05); padding: 5px; border-radius: 8px; }
.font-control button { border: none; background: transparent; padding: 5px 15px; font-size: 1.2rem; cursor: pointer; color: var(--text); }
.ad-flex-center{
    display: flex;
    justify-content: center;
    align-items: center;
}