* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #a8c0ff 0%, #b8a4ff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.container {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 600px;
    padding: 40px 35px;
}

.header {
    text-align: center;
    margin-bottom: 35px;
}

.header h1 {
    color: #667eea;
    font-size: 32px;
    margin-bottom: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #888;
    font-size: 14px;
}

.stat-value {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    min-width: 24px;
    text-align: center;
}

.input-section {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    margin-bottom: 35px;
    align-items: center;
}

.task-input {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    background: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.task-input::placeholder {
    color: #8898aa;
    font-size: 15px;
}

.task-input:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.priority-select {
    padding: 18px 20px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    background: #f8f9fa;
    color: #666;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 36px;
    height: auto;
}

.priority-select:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.priority-select option {
    background: white;
    color: #333;
    padding: 12px;
}

.add-btn {
    padding: 18px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.5px;
    height: auto;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

.task-list {
    list-style: none;
    max-height: 450px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    margin-bottom: 14px;
    background: #f8f9fa;
    border-radius: 14px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
    border-left: 4px solid #667eea;
}

.task-item.priority-high {
    border-left-color: #ff6b6b;
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.1) 0%, #f8f9fa 100%);
}

.task-item.priority-medium {
    border-left-color: #ffa726;
    background: linear-gradient(90deg, rgba(255, 167, 38, 0.1) 0%, #f8f9fa 100%);
}

.task-item.priority-low {
    border-left-color: #66bb6a;
    background: linear-gradient(90deg, rgba(102, 187, 106, 0.1) 0%, #f8f9fa 100%);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.task-item.completed {
    background: #e8f5e9;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #888;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #667eea;
}

.priority-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 8px;
}

.priority-badge.high {
    background: #ff6b6b;
    color: white;
}

.priority-badge.medium {
    background: #ffa726;
    color: white;
}

.priority-badge.low {
    background: #66bb6a;
    color: white;
}

.task-text {
    flex: 1;
    font-size: 16px;
    color: #333;
    word-break: break-all;
    transition: all 0.3s ease;
}

.task-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.edit-btn {
    padding: 6px 12px;
    background: #42a5f5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #1e88e5;
    transform: scale(1.05);
}

.delete-btn {
    padding: 6px 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #ee5a5a;
    transform: scale(1.05);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 16px;
}

.empty-tip {
    font-size: 14px;
    color: #999;
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 20px 15px;
    }

    .container {
        padding: 20px;
        border-radius: 15px;
    }

    .header h1 {
        font-size: 24px;
    }

    .stats {
        gap: 20px;
    }

    .input-section {
        flex-direction: column;
        gap: 10px;
    }

    .add-btn {
        width: 100%;
    }

.task-item {
    padding: 12px;
    flex-wrap: wrap;
}

.delete-btn {
    opacity: 1;
}

.task-actions {
    opacity: 1;
}

.priority-select {
    flex: none;
}

.task-list {
    max-height: 300px;
}
}

/* 滚动条样式 */
.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.task-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.task-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.clear-completed-btn {
    flex: 1;
    padding: 12px;
    margin-top: 0;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.3);
}

.clear-completed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
}

.clear-completed-btn:active {
    transform: translateY(0);
}

.clear-completed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.clear-all-btn {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.clear-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.clear-all-btn:active {
    transform: translateY(0);
}

.clear-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
