:root {
    --primary-color: #0f6cbd;
    --primary-hover: #0c5fa6;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #242424;
    --text-secondary: #616161;
    --border-color: #e1dfdd;
    --success-color: #107c10;
    --delete-color: #d13438;
    --focus-ring: rgba(15, 108, 189, 0.2);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.main-container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Header */
.app-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border-color);
}

.date-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    gap: 10px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.progress-container {
    margin-top: 10px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-bar {
    height: 6px;
    background-color: #edebe9;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.4s ease;
}

/* Input Section */
.input-section {
    padding: 20px 32px;
    display: flex;
    gap: 12px;
    background-color: var(--card-bg);
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--primary-color);
    font-size: 0.9rem;
}

#todo-input {
    width: 100%;
    padding: 12px 12px 12px 36px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

#todo-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

#add-btn {
    padding: 0 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
}

#add-btn:hover {
    background-color: var(--primary-hover);
}

/* Filters */
.filters {
    padding: 0 32px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.filter-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-btn:hover {
    background-color: #f3f2f1;
    color: var(--text-primary);
}

.filter-btn.active {
    background-color: #eff6fc;
    color: var(--primary-color);
    font-weight: 600;
}

/* List */
.todo-list {
    list-style: none;
    overflow-y: auto;
    padding: 0;
    flex: 1;
}

.todo-item {
    padding: 16px 32px;
    border-bottom: 1px solid #f3f2f1;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s;
    animation: slideIn 0.3s ease;
}

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

.todo-item:hover {
    background-color: #faf9f8;
}

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

.checkbox-container {
    position: relative;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.checkbox-container input {
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.todo-text {
    flex: 1;
    font-size: 1rem;
    transition: color 0.2s;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.delete-btn {
    background: none;
    border: none;
    color: #a19f9d;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.2s;
    padding: 4px;
}

.delete-btn:hover {
    color: var(--delete-color);
    background-color: #fce8e8;
    border-radius: 4px;
}

.todo-item:hover .delete-btn {
    opacity: 1;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #c8c6c4;
    display: none;
}

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

.empty-state p {
    font-size: 1rem;
}

/* Footer */
.app-footer {
    padding: 16px 32px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#clear-completed {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}

#clear-completed:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

/* Scrollbar */
.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: transparent;
}

.todo-list::-webkit-scrollbar-thumb {
    background-color: #e1dfdd;
    border-radius: 3px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
    background-color: #c8c6c4;
}
