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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.todo-app {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.5s ease;
}

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 25px;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header h1 i {
    font-size: 1.8rem;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.input-container {
    display: flex;
    padding: 20px;
    gap: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

#todoInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

#todoInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#todoInput::placeholder {
    color: #adb5bd;
}

.add-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.add-btn:active {
    transform: scale(0.95);
}

.filter-container {
    display: flex;
    padding: 15px 20px;
    gap: 10px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.filter-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.todo-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.todo-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #e9ecef;
    animation: fadeIn 0.3s ease;
    transition: all 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.todo-item:hover {
    background: #f8f9fa;
}

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

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    margin-right: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox:hover {
    border-color: #667eea;
}

.todo-item.completed .checkbox {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.checkbox i {
    color: white;
    font-size: 0.7rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.todo-item.completed .checkbox i {
    opacity: 1;
}

.todo-text {
    flex: 1;
    font-size: 0.95rem;
    color: #495057;
    word-break: break-word;
}

.todo-date {
    font-size: 0.7rem;
    color: #adb5bd;
    margin-right: 15px;
}

.delete-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #dee2e6;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.todo-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: #fff5f5;
    color: #e74c3c;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

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

.footer {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.clear-btn {
    padding: 12px 25px;
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.clear-btn:hover {
    background: #e74c3c;
    color: white;
}

.clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-btn:disabled:hover {
    background: transparent;
    color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header h1 i {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .input-container {
        padding: 15px;
    }

    #todoInput {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .add-btn {
        width: 45px;
        height: 45px;
    }

    .filter-btn {
        padding: 8px;
        font-size: 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .todo-item {
        padding: 15px;
    }

    .todo-text {
        font-size: 0.85rem;
    }

    .todo-date {
        display: none;
    }

    .delete-btn {
        opacity: 1;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .todo-app {
        background: #0f0f23;
    }

    .input-container {
        background: #1a1a2e;
        border-bottom-color: #2d2d44;
    }

    #todoInput {
        background: #1a1a2e;
        border-color: #2d2d44;
        color: #e9ecef;
    }

    #todoInput:focus {
        border-color: #667eea;
    }

    .filter-container {
        background: #0f0f23;
        border-bottom-color: #2d2d44;
    }

    .filter-btn {
        background: #1a1a2e;
        border-color: #2d2d44;
        color: #adb5bd;
    }

    .stats-container {
        background: #1a1a2e;
        border-bottom-color: #2d2d44;
    }

    .todo-item {
        border-bottom-color: #2d2d44;
    }

    .todo-item:hover {
        background: #1a1a2e;
    }

    .todo-text {
        color: #e9ecef;
    }

    .todo-item.completed .todo-text {
        color: #6c757d;
    }

    .footer {
        background: #1a1a2e;
        border-top-color: #2d2d44;
    }

    .empty-state {
        color: #6c757d;
    }
}
