* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #e0f2fe, #dcfce7);
    color: #111827;
}

.page {
    min-height: 100vh;
    padding: 40px 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.card {
    width: 100%;
    max-width: 860px;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 26px;
}

.header h1 {
    margin: 0;
    font-size: 32px;
    color: #111827;
}

.header p {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 15px;
}

.tag {
    padding: 8px 14px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-box {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 16px;
    padding: 18px;
    text-align: center;
}

.stat-box strong {
    display: block;
    font-size: 30px;
    color: #16a34a;
}

.stat-box span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.add-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.add-form input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    outline: none;
    font-size: 15px;
}

.add-form input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.add-form button {
    width: 96px;
    border: none;
    border-radius: 14px;
    background: #16a34a;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.add-form button:hover {
    background: #15803d;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px;
    background: #ffffff;
}

.todo-item:hover {
    border-color: #bbf7d0;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.08);
}

.todo-item.done {
    background: #f9fafb;
}

.todo-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.check-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

.todo-info {
    min-width: 0;
}

.todo-info h2 {
    margin: 0;
    font-size: 16px;
    color: #111827;
    word-break: break-word;
}

.todo-info p {
    margin: 5px 0 0;
    color: #9ca3af;
    font-size: 12px;
}

.todo-item.done .todo-info h2 {
    color: #9ca3af;
    text-decoration: line-through;
}

.delete-btn {
    border: none;
    border-radius: 12px;
    background: #fee2e2;
    color: #dc2626;
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.delete-btn:hover {
    background: #fecaca;
}

.empty {
    text-align: center;
    padding: 50px 20px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 20px;
}

.empty-icon {
    font-size: 42px;
}

.empty h2 {
    margin: 12px 0 8px;
    color: #374151;
}

.empty p {
    margin: 0;
    color: #9ca3af;
}

.clear-form {
    margin-top: 20px;
    text-align: right;
}

.clear-form button {
    border: none;
    border-radius: 12px;
    background: #f3f4f6;
    color: #6b7280;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.clear-form button:hover {
    background: #e5e7eb;
}

.footer {
    margin-top: 28px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

@media (max-width: 640px) {
    .card {
        padding: 22px;
    }

    .header {
        flex-direction: column;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .add-form {
        flex-direction: column;
    }

    .add-form button {
        width: 100%;
        height: 46px;
    }

    .todo-item {
        align-items: stretch;
        flex-direction: column;
    }

    .delete-btn {
        width: 100%;
    }
}
