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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 10px;
    background: #6c757d;
    padding: 10px 15px;
}

.back-btn:hover {
    background: #5a6268;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

#taskInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

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

button {
    padding: 15px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.task-list {
    margin-bottom: 30px;
}

.task-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
    cursor: pointer;
}

.task-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.task-card.completed {
    opacity: 0.6;
    border-left-color: #28a745;
    order: 1; /* 已完成任务排在最后 */
}

.task-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-title {
    font-size: 1.2em;
    font-weight: bold;
    flex: 1;
    margin-right: 15px;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: #666;
}

.task-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.task-priority {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.priority-high {
    background: #dc3545;
    color: white;
}

.priority-medium {
    background: #ffc107;
    color: #000;
}

.priority-low {
    background: #28a745;
    color: white;
}

.due-date {
    color: #666;
}

.due-date.overdue {
    color: #dc3545;
    font-weight: bold;
}

.task-steps {
    margin-top: 10px;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.step-item:last-child {
    border-bottom: none;
}

.step-checkbox {
    margin-right: 10px;
    transform: scale(1.1);
}

.step-text {
    flex: 1;
    font-size: 0.95em;
}

.step-item.completed .step-text {
    text-decoration: line-through;
    color: #666;
}

.step-progress {
    margin-top: 10px;
    background: #e9ecef;
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.step-progress-bar {
    height: 100%;
    background: #28a745;
    transition: width 0.3s;
}

/* 任务详情页样式 */
.task-detail-section {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

.steps-container {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

.steps-list {
    margin-bottom: 15px;
}

.step-input-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.step-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.remove-step {
    background: #dc3545;
    padding: 8px 12px;
    font-size: 14px;
}

.add-step-btn {
    background: #28a745;
    width: 100%;
}

.add-step-btn:hover {
    background: #218838;
}

.priority-section {
    margin-bottom: 25px;
}

.priority-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.priority-btn {
    flex: 1;
    padding: 12px;
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.priority-btn.active {
    border-color: #667eea;
}

.priority-btn.low.active {
    background: #28a745;
    color: white;
}

.priority-btn.medium.active {
    background: #ffc107;
    color: #000;
}

.priority-btn.high.active {
    background: #dc3545;
    color: white;
}

.save-btn {
    background: #28a745;
    width: 100%;
    margin-bottom: 10px;
}

.save-btn:hover {
    background: #218838;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.secondary-btn {
    background: #6c757d;
}

.secondary-btn:hover {
    background: #5a6268;
}

.danger-btn {
    background: #dc3545;
}

.danger-btn:hover {
    background: #c82333;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .task-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 5px;
    }
}