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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: #f7f6f3;
    min-height: 100vh;
    padding: 40px 20px;
    color: #37352f;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(55, 53, 47, 0.09);
}

header {
    background: #ffffff;
    padding: 32px 32px 24px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: #6b46c1;
    display: flex;
    align-items: center;
    gap: 12px;
}

header i {
    font-size: 1.8rem;
    color: #6b7280;
}

.todo-input-section {
    padding: 0 32px 24px;
    background: white;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

#todoInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(55, 53, 47, 0.16);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
    background: #ffffff;
    font-family: inherit;
}

#todoInput:focus {
    border-color: #6b46c1;
    box-shadow: 0 0 0 1px #6b46c1;
}

#todoInput::placeholder {
    color: rgba(55, 53, 47, 0.65);
}

.add-btn {
    padding: 12px 16px;
    border: none;
    background: #6b46c1;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.add-btn:hover {
    background: #553c9a;
}

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

.filter-section {
    padding: 0 32px 24px;
    background: white;
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid rgba(55, 53, 47, 0.16);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.15s ease;
    color: rgba(55, 53, 47, 0.65);
    font-family: inherit;
}

.filter-btn.active {
    background: rgba(107, 70, 193, 0.1);
    color: #6b46c1;
    border-color: rgba(107, 70, 193, 0.3);
}

.filter-btn:hover:not(.active) {
    background: rgba(55, 53, 47, 0.06);
    color: #37352f;
}

.todo-list-section {
    padding: 0 32px 32px;
    background: white;
    min-height: 200px;
}

.todo-list {
    list-style: none;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(55, 53, 47, 0.09);
    animation: slideIn 0.2s ease;
    gap: 12px;
}

.todo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}



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

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

.todo-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(55, 53, 47, 0.35);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    background: white;
}

.todo-checkbox:hover {
    border-color: #6b46c1;
}

.todo-checkbox.checked {
    background: #6b46c1;
    border-color: #6b46c1;
}

.todo-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.todo-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    transition: all 0.15s ease;
    color: #37352f;
    padding: 1px 0;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: rgba(55, 53, 47, 0.45);
}

.todo-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
    margin-top: 1px;
}

.todo-item:hover .todo-actions {
    opacity: 1;
}

.action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(55, 53, 47, 0.08);
    color: rgba(55, 53, 47, 0.65);
}

.action-btn:hover {
    background: rgba(55, 53, 47, 0.16);
    color: #37352f;
}

.edit-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    color: #b8860b;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: rgba(55, 53, 47, 0.45);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(55, 53, 47, 0.65);
}

.empty-state span {
    font-size: 14px;
    opacity: 0.8;
}

.stats-section {
    padding: 16px 32px;
    background: rgba(55, 53, 47, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(55, 53, 47, 0.09);
}

.stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(55, 53, 47, 0.65);
}

.clear-btn {
    padding: 6px 12px;
    border: 1px solid rgba(107, 70, 193, 0.3);
    background: white;
    color: #6b46c1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    transition: all 0.15s ease;
    font-family: inherit;
}

.clear-btn:hover:not(:disabled) {
    background: rgba(107, 70, 193, 0.1);
    border-color: rgba(107, 70, 193, 0.5);
}

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

.edit-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #6b46c1;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background: white;
    box-shadow: 0 0 0 1px #6b46c1;
}

.hidden {
    display: none !important;
}

/* 响应式设计 */
/* 平板设备适配 */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        max-width: 600px;
    }
    
    .input-container {
        gap: 16px;
    }
    
    .todo-item {
        padding: 14px 16px;
    }
    
    .todo-actions {
        opacity: 1;
    }
    
    .filter-btn {
        padding: 8px 16px;
        min-height: 40px;
    }
}

/* 中等屏幕设备适配 */
@media (max-width: 768px) {
    body {
        padding: 20px 16px;
    }
    
    .container {
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    header {
        padding: 24px 24px 20px;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .todo-input-section {
        padding: 0 24px 20px;
    }
    
    .input-container {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    #todoInput {
        width: 100%;
        font-size: 16px;
        padding: 14px 16px;
        min-height: 48px;
    }
    
    .add-btn {
        width: 100%;
        padding: 14px 16px;
        min-height: 48px;
        font-size: 16px;
    }
    
    .todo-list-section {
        padding: 0 24px 24px;
    }
    
    .todo-item {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .todo-content {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .todo-actions {
        opacity: 1;
        gap: 12px;
    }
    
    .todo-actions button {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
    }
    
    .filter-section {
        padding: 0 24px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
        flex: 1;
        min-width: 80px;
    }
    
    .stats-section {
        padding: 16px 24px;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .stats {
        justify-content: center;
        gap: 16px;
        flex-wrap: wrap;
    }
    
    .clear-btn {
        width: 100%;
        padding: 12px 16px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px 8px;
    }
    
    .container {
        border-radius: 4px;
        margin: 0;
    }
    
    header {
        padding: 20px 16px 16px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    header i {
        font-size: 1.5rem;
    }
    
    .todo-input-section {
        padding: 0 16px 16px;
    }
    
    .input-container {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    #todoInput {
        width: 100%;
        font-size: 16px;
        padding: 16px;
        min-height: 52px;
        border-radius: 8px;
    }
    
    .add-btn {
        width: 100%;
        padding: 16px;
        min-height: 52px;
        font-size: 16px;
        border-radius: 8px;
        font-weight: 600;
    }
    
    .todo-list-section {
        padding: 0 16px 16px;
    }
    
    .todo-item {
        padding: 16px;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    
    .todo-content {
        font-size: 16px;
        line-height: 1.5;
        margin-right: 12px;
    }
    
    .todo-actions {
        opacity: 1;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .todo-actions button {
        min-width: 40px;
        min-height: 40px;
        padding: 10px;
        border-radius: 6px;
    }
    
    .filter-section {
        padding: 0 16px 16px;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
        flex: 1;
        border-radius: 6px;
    }
    
    .stats-section {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .stats {
        justify-content: space-between;
        gap: 8px;
        font-size: 14px;
    }
    
    .clear-btn {
        width: 100%;
        padding: 12px 16px;
        min-height: 48px;
        border-radius: 6px;
    }
    
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state p {
        font-size: 18px;
    }
    
    .empty-state span {
        font-size: 14px;
    }
    

}