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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* 页面切换 */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.reader-header button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.reader-header button:active {
    background: rgba(255,255,255,0.3);
}

.reader-header span {
    font-weight: 600;
    flex: 1;
    text-align: center;
}

/* 作品列表 */
.book-list {
    padding: 20px;
}

.book-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.book-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.book-item h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}

.book-item p {
    color: #666;
    font-size: 14px;
}

/* 章节列表 */
.chapter-list {
    padding: 10px;
}

.chapter-item {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-item:active {
    background: #f8f8f8;
}

.chapter-item.reading {
    border-left: 4px solid #667eea;
}

/* 阅读区域 */
.reader-content {
    padding: 30px 20px;
    min-height: calc(100vh - 140px);
    max-width: 100%;
    overflow-y: auto;
}

#content {
    font-size: 18px;
    line-height: 1.8;
    color: #2c3e50;
}

#content p {
    margin-bottom: 1em;
    text-indent: 2em;
}

/* 底部导航 */
.reader-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.reader-footer button {
    flex: 1;
    padding: 12px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.reader-footer button:active {
    opacity: 0.8;
}

/* 设置面板 */
.settings-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.settings-panel.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
}

.settings-content h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 20px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group label {
    display: block;
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

.font-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.font-controls button {
    width: 50px;
    height: 50px;
    border: 2px solid #667eea;
    border-radius: 50%;
    background: white;
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.font-controls button:active {
    background: #667eea;
    color: white;
}

.font-size-display {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    min-width: 60px;
    text-align: center;
}

.close-settings {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.close-settings:active {
    background: #e0e0e0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .reader-content {
        padding: 25px 20px;
        padding-bottom: 100px;
    }

    #content {
        font-size: 18px;
    }

    .book-item {
        padding: 15px;
    }

    header h1 {
        font-size: 20px;
    }
}

/* 触摸滑动动画 */
.touch-feedback {
    animation: touchPulse 0.3s ease-out;
}

@keyframes touchPulse {
    0% {
        background: rgba(102, 126, 234, 0.1);
    }
    100% {
        background: transparent;
    }
}

/* 文件夹选择器样式 */
.folder-selector {
    text-align: center;
    padding: 60px 20px;
}

.selector-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.folder-selector h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.folder-selector p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.select-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.select-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.tips {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: left;
}

.tips p {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.tips strong {
    color: #333;
}

.folder-info {
    text-align: center;
    margin-bottom: 20px;
}

.change-folder-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 20px;
    background: white;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.change-folder-btn:active {
    background: #667eea;
    color: white;
}
