* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #667eea;
    font-size: 28px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-success {
    background: #48bb78;
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 统计面板 */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
}

.stat-unit {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 任务容器 */
.tasks-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.task-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.task-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

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

.task-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.task-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.task-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
}

.task-actions {
    display: flex;
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #c6f6d5;
    color: #22543d;
}

.status-completed {
    background: #bee3f8;
    color: #2c5282;
}

/* 子任务列表 */
.subtasks-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.subtask-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.subtask-header h3 {
    font-size: 16px;
    color: #555;
}

.subtask-item {
    background: #f7fafc;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #e0e0e0;
}

.subtask-item.pending {
    border-left-color: #a0aec0;
}

.subtask-item.in_progress {
    border-left-color: #f6ad55;
    background: #fffaf0;
}

.subtask-item.completed {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.subtask-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.subtask-info {
    flex: 1;
}

.subtask-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.subtask-details {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.subtask-actions {
    display: flex;
    gap: 8px;
}

.error-info {
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.error-positive {
    background: #fed7d7;
    color: #c53030;
}

.error-negative {
    background: #c6f6d5;
    color: #22543d;
}

.feedback-text {
    margin-top: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    font-style: italic;
    border-left: 3px solid #667eea;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

.completion-info {
    background: #f7fafc;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.completion-info p {
    margin-bottom: 8px;
    font-size: 14px;
}

.completion-info p:last-child {
    margin-bottom: 0;
}

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

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    h1 {
        font-size: 24px;
    }

    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .task-header {
        flex-direction: column;
        gap: 10px;
    }

    .subtask-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .subtask-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
