/* ========== index-chapters.css ========== */
/* 章节管理页面（chapters）的CSS样式 */
/* 从 public/index.php $page==='chapters' 区域提取 */

/* ========== 项目选择列表（复用setup样式模式） ========== */
.chapters-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.chapters-project-card {
    text-decoration: none;
    display: block;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s;
}

.chapters-project-card-title {
    color: #333;
    margin-bottom: 8px;
}

.chapters-project-card-meta {
    color: #666;
    font-size: 13px;
}

/* ========== 章节列表头部 ========== */
.chapters-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.chapters-header-title {
    margin: 0;
}

.chapters-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chapters-import-btn {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.chapters-export-btn {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.chapters-total-words {
    color: #666;
    margin-bottom: 16px;
}

.chapters-word-count {
    color: #888;
    font-size: 13px;
    margin-left: 10px;
}

.chapters-continue-link {
    text-decoration: none;
}

/* ========== 导入/导出弹窗 ========== */
.chapters-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.chapters-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.chapters-modal-content-sm {
    max-width: 400px;
}

.chapters-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chapters-modal-title {
    margin: 0;
}

.chapters-modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

/* 导入区块 */
.chapters-import-section {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.chapters-import-section-mb {
    margin-bottom: 24px;
}

.chapters-import-section-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

.chapters-import-section-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.chapters-import-file-input {
    margin-bottom: 12px;
    font-size: 13px;
}

.chapters-import-submit-btn {
    background: #1d4ed8;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* 导出按钮 */
.chapters-export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chapters-export-option {
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.chapters-export-option-single {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.chapters-export-option-multi {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.chapters-export-option-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.chapters-export-option-desc {
    font-size: 12px;
    color: #666;
}

/* ========== 深色模式适配 ========== */
body.dark-mode .chapters-project-card { background: #1a1a3e; border-color: #2a2a4a; }
body.dark-mode .chapters-project-card-title { color: #e0e0e0; }
body.dark-mode .chapters-project-card-meta { color: #aaa; }

body.dark-mode .chapters-header-title { color: #e0e0e0; }
body.dark-mode .chapters-import-btn { background: #0a1a2e; border-color: #1e40af; color: #93c5fd; }
body.dark-mode .chapters-export-btn { background: #0a2e1a; border-color: #166534; color: #6ee7b7; }
body.dark-mode .chapters-total-words { color: #aaa; }
body.dark-mode .chapters-word-count { color: #888; }

body.dark-mode .chapters-modal-content { background: #16213e; }
body.dark-mode .chapters-modal-title { color: #e0e0e0; }
body.dark-mode .chapters-modal-close-btn { color: #aaa; }
body.dark-mode .chapters-import-section { background: #1a1a3e; }
body.dark-mode .chapters-import-section-title { color: #e0e0e0; }
body.dark-mode .chapters-import-section-desc { color: #aaa; }

body.dark-mode .chapters-export-option-single { background: #0a2e1a; border-color: #166534; color: #6ee7b7; }
body.dark-mode .chapters-export-option-multi { background: #0a1a2e; border-color: #1e40af; color: #93c5fd; }
body.dark-mode .chapters-export-option-desc { color: #888; }


/* ========== 响应式适配 ========== */
@media (max-width: 768px) {
    .chapters-project-grid {
        grid-template-columns: 1fr;
    }
    .chapters-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .chapters-header-actions {
        width: 100%;
    }
    .chapters-modal-content {
        width: 95%;
        padding: 16px;
    }
    .chapters-export-options {
        gap: 8px;
    }
}
