/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ffeef0 0%, #ffffff 50%, #fdf2f8 100%);
    min-height: 100vh;
    color: #4a5568;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 300;
    opacity: 0.8;
}

/* 主容器 */
.todo-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 192, 203, 0.2);
}

/* 添加任务区域 */
.add-todo-section {
    margin-bottom: 2rem;
}

.input-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.todo-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 248, 250, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.todo-input:focus {
    border-color: #ff69b4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.todo-input::placeholder {
    color: #a0aec0;
}

.add-btn {
    padding: 1rem;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 105, 180, 0.3);
}

.add-btn:active {
    transform: translateY(0);
}

/* 统计区域 */
.stats-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.stat-item {
    background: linear-gradient(135deg, #fff0f3, #ffffff);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    border: 1px solid rgba(255, 182, 193, 0.2);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ff69b4;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

/* 过滤器 */
.filter-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255, 182, 193, 0.3);
    background: rgba(255, 248, 250, 0.8);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #4a5568;
}

.filter-btn:hover {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border-color: #ff69b4;
}

/* 任务列表 */
.todo-list {
    space-y: 0.75rem;
}

.todo-item {
    background: rgba(255, 248, 250, 0.8);
    border: 1px solid rgba(255, 182, 193, 0.2);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(255, 105, 180, 0.1);
}

.todo-item.completed {
    background: rgba(240, 253, 244, 0.8);
    border-color: rgba(72, 187, 120, 0.3);
    opacity: 0.8;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ff69b4;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.todo-checkbox.checked {
    background: #ff69b4;
    border-color: #ff69b4;
}

.todo-checkbox.checked::after {
    content: "✓";
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

.todo-text {
    flex: 1;
    font-size: 1rem;
    color: #2d3748;
    transition: all 0.3s ease;
}

.todo-text.completed {
    text-decoration: line-through;
    color: #a0aec0;
}

.todo-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.todo-item:hover .todo-actions {
    opacity: 1;
}

.action-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn {
    background: rgba(66, 153, 225, 0.1);
    color: #4299e1;
}

.edit-btn:hover {
    background: #4299e1;
    color: white;
}

.delete-btn {
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
}

.delete-btn:hover {
    background: #f56565;
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #a0aec0;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #ff69b4;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.8;
}

.empty-state.hidden {
    display: none;
}

/* 批量操作 */
.batch-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.batch-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid rgba(255, 182, 193, 0.3);
    background: rgba(255, 248, 250, 0.8);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.batch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.batch-btn.delete-all {
    border-color: rgba(245, 101, 101, 0.3);
}

.batch-btn.delete-all:hover {
    background: #f56565;
    color: white;
    border-color: #f56565;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 182, 193, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #fff0f3, #ffffff);
}

.modal-header h3 {
    color: #2d3748;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #a0aec0;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #f56565;
    background: rgba(245, 101, 101, 0.1);
}

.modal-body {
    padding: 1.5rem;
}

.edit-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 248, 250, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.edit-input:focus {
    border-color: #ff69b4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.modal-footer {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: rgba(248, 250, 252, 0.8);
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: rgba(160, 174, 192, 0.2);
    color: #4a5568;
}

.cancel-btn:hover {
    background: #a0aec0;
    color: white;
}

.save-btn {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem;
    }
    
    .todo-container {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .stats-section {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-section {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
    }
    
    .batch-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .batch-btn {
        width: 100%;
        justify-content: center;
    }
    
    .todo-actions {
        opacity: 1;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .input-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .add-btn {
        width: 100%;
        height: 50px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
.todo-item {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 182, 193, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 105, 180, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 105, 180, 0.5);
}

/* 焦点和无障碍样式 */
button:focus,
input:focus {
    outline: 2px solid #ff69b4;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
