/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

main {
    flex: 1;
    padding: 1rem;
}

/* 按钮样式 */
.btn {
    background-color: #4a6cf7;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: #3a5be8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn i {
    margin-right: 0.5rem;
}

/* Toggle Button 样式 */
.toggle-btn {
    background-color: #5a9bd5; /* 使用柔和的蓝色 */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem; /* 添加下边距 */
}

.toggle-btn:hover {
    background-color: #4a8ac4; /* 更深的蓝色 */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 内容选择区域 */
.content-selection {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.selection-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

/* 分类和内容项样式 */
.categories-container, .items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.category-card, .item-card {
    background-color: #f0e68c; /* 使用柔和的卡其色 */
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.category-card h4, .item-card h4 {
    font-size: 1rem;
    font-weight: 500;
    color: #333; /* 更深的灰色以增加对比 */
}
.btn {
    background-color: #5a9bd5; /* 使用柔和的蓝色 */
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.btn:hover {
    background-color: #4a8ac4; /* 更深的蓝色 */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.category-card:hover, .item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.category-card i, .item-card i {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #4a6cf7;
}
.category-card h4, .item-card h4 {
    font-size: 1rem;
    font-weight: 500;
    color: #444;
}
.back-btn {
    margin-bottom: 1rem;
    background-color: #f1f3f5;
    color: #495057;
}
.back-btn:hover {
    background-color: #e9ecef;
}
#category-title, #content-title {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}
.subcategory-title {
    margin: 15px 0 10px;
    padding-left: 10px;
    border-left: 3px solid #4CAF50;
    font-size: 16px;
    color: #333;
}
.empty-message {
    text-align: center;
    color: #999;
    font-style: italic;
    margin: 15px 0;
}
/* 背诵区域样式 */
.recitation-area {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}
.control-panel {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}
.proficiency-indicator {
    display: flex;
    align-items: center;
    margin-top: 0.8rem;
}
.stars {
    display: flex;
    margin-left: 0.5rem;
}
.stars i {
    color: #ffc107;
    font-size: 1.2rem;
    margin-right: 0.3rem;
    cursor: pointer;
}
/* 文本控制区域 */
.text-controls, .keyword-strategy, .preset-modes {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.control-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}
.control-group:last-child {
    margin-bottom: 0;
}
.control-group label {
    min-width: 80px;
    font-size: 0.9rem;
    color: #495057;
}
.control-group input[type="range"] {
    flex: 1;
    margin: 0 0.8rem;
}
.control-group input[type="number"] {
    width: 50px;
    text-align: center;
    padding: 0.3rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin: 0 0.5rem;
}
.value-display {
    min-width: 50px;
    text-align: right;
    font-size: 0.9rem;
    color: #495057;
}
/* 开关样式 */
.toggle {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
}
.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ced4da;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-right: 0.8rem;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}
.toggle input:checked + .toggle-slider {
    background-color: #4a6cf7;
}
.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}
.toggle input {
    display: none;
}
.toggle-label {
    font-size: 0.9rem;
    color: #495057;
}
/* 预设模式按钮 */
.mode-buttons {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.mode-btn {
    flex: 1;
    min-width: 80px;
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    background-color: #e9ecef;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}
.mode-btn:hover, .mode-btn.active {
    background-color: #4a6cf7;
    color: white;
}
/* 背诵内容区域 */
.recitation-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    min-height: 200px;
    border: 1px solid #e9ecef;
    line-height: 1.8;
    font-size: 18px;
    letter-spacing: 4px; /* 设置字间距 */
}
.recitation-content .keyword {
    color: #4a6cf7;
    font-weight: 600;
}
.recitation-content .hidden-char {
    color: transparent;
    border-bottom: 1px solid #ced4da;
}
/* 自定义内容模态框 */
.custom-content-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    z-index: 1000;
}
.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}
.modal-content input, .modal-content textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
}
.modal-content textarea {
    min-height: 200px;
    resize: vertical;
}
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}
.cancel-btn {
    background-color: #f1f3f5;
    color: #495057;
}
.save-btn {
    background-color: #4a6cf7;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
/* 工具类 */
.hidden {
    display: none;
}
.hidden-section {
    display: none;
}
/* 响应式调整 */
@media (max-width: 768px) {
    .categories-container, .items-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .selection-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .selection-header button {
        margin-top: 1rem;
    }
    .mode-buttons {
        flex-direction: column;
    }
    .mode-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}
@media (max-width: 480px) {
    .categories-container, .items-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .control-group {
        flex-wrap: wrap;
    }
    .control-group label {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    .stars i {
        font-size: 1rem;
    }
}