/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1E293B;
    background: #F8FAFC;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #2563EB;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #1E293B;
    margin-bottom: 8px;
    font-weight: 700;
}

header h1 i {
    color: #2563EB;
    margin-right: 12px;
}

.subtitle {
    color: #64748B;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 输入区域 */
.input-section {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

#todoInput {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.15s ease;
    outline: none;
}

#todoInput:focus {
    border-color: #2563EB;
}

#todoInput::placeholder {
    color: #94A3B8;
}

.btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #2563EB;
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background: #1D4ED8;
}

.btn-primary:active {
    background: #1E40AF;
}

/* 过滤区域 */
.filter-section {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #CBD5E1;
    background: white;
    border-radius: 6px;
    color: #64748B;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: #2563EB;
    color: #2563EB;
}

.filter-btn.active {
    background: #2563EB;
    border-color: #2563EB;
    color: white;
}

/* 统计区域 */
.stats-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 16px;
    background: #F1F5F9;
    border-radius: 8px;
}

#remainingCount {
    font-weight: 600;
    color: #1E293B;
}

.btn-link {
    background: transparent;
    color: #ef4444;
    font-weight: 600;
    padding: 8px 16px;
}

.btn-link:hover {
    background: #fee;
    border-radius: 8px;
}

/* 待办事项列表 */
.todo-list {
    list-style: none;
    margin-bottom: 30px;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: white;
    border: 2px solid #F1F5F9;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.15s ease;
    animation: fadeIn 0.5s ease;
}

.todo-item:hover {
    border-color: #2563EB;
}

.todo-item.completed {
    background: #F8FAFC;
    opacity: 0.8;
}

.todo-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 2px solid #CBD5E1;
    margin-right: 16px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.todo-checkbox:hover {
    border-color: #2563EB;
}

.todo-checkbox.checked {
    background: #2563EB;
    border-color: #2563EB;
}

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

.todo-text {
    flex: 1;
    font-size: 1.1rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #94a3b8;
}

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

.todo-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-action-btn:hover {
    background: #e2e8f0;
    color: #2c3e50;
}

.todo-action-btn.delete:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.todo-time {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    display: none;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #cbd5e1;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.empty-state .hint {
    font-size: 1rem;
    color: #a0aec0;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        border-radius: 12px;
    }

    header h1 {
        font-size: 2rem;
    }

    .input-section {
        flex-direction: column;
    }

    .filter-section {
        flex-wrap: wrap;
    }

    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .todo-actions {
        align-self: flex-end;
    }

    .stats-section {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 16px;
    }

    .btn {
        padding: 14px 20px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 时间状态样式 */
.time-unscheduled {
    color: #94a3b8;
}

.time-normal {
    color: #3b82f6;
}

.time-upcoming {
    color: #f59e0b;
    font-weight: 600;
}

.time-ongoing {
    color: #10b981;
    font-weight: 600;
}

.time-overdue {
    color: #ef4444;
    font-weight: 600;
}

.time-completed {
    color: #10b981;
    text-decoration: line-through;
}

/* 时间显示区域样式 */
.schedule-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
}

.schedule-icon {
    font-size: 0.8rem;
}

.time-label {
    font-size: 0.85rem;
    font-weight: 500;
}

.created-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* 时间编辑按钮样式 */
.todo-action-btn.time-edit:hover {
    background: #e0f2fe;
    color: #0ea5e9;
}

/* 时间编辑界面样式 */
.time-edit-container {
    flex: 1;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 2px solid #2563EB;
}

.time-edit-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.time-edit-container input[type="datetime-local"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.time-edit-container input[type="datetime-local"]:focus {
    border-color: #2563EB;
}

/* 响应式调整时间显示 */
@media (max-width: 768px) {
    .schedule-time {
        display: block;
        margin-bottom: 4px;
    }

    .time-label {
        font-size: 0.8rem;
    }
}

/* 欢迎模态样式 */
.welcome-modal {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    border: 1px solid #3b82f6;
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.5s ease-out;
}

.welcome-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #60a5fa, #3b82f6, #1d4ed8);
}

.welcome-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-icon {
    font-size: 3.5rem;
    color: white;
    opacity: 0.9;
    align-self: center;
}

.welcome-text h2 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.welcome-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.welcome-features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0;
    padding: 0;
}

.welcome-features li {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-features i {
    color: #60a5fa;
    font-size: 1rem;
}

.welcome-close-btn {
    align-self: flex-end;
    background: white;
    color: #2563EB;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: none;
}

.welcome-close-btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.welcome-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.welcome-hide-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
}

.welcome-hide-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #60a5fa;
}

/* 模态动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.welcome-modal.hiding {
    animation: slideUp 0.3s ease forwards;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .welcome-modal {
        padding: 20px;
    }

    .welcome-text h2 {
        font-size: 1.5rem;
    }

    .welcome-text p {
        font-size: 1rem;
    }

    .welcome-features {
        grid-template-columns: 1fr;
    }

    .welcome-close-btn {
        width: 100%;
        justify-content: center;
    }

    .welcome-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .welcome-modal {
        padding: 16px;
    }

    .welcome-text h2 {
        font-size: 1.3rem;
    }

    .welcome-icon {
        font-size: 2.5rem;
    }
}

/* 应用导航 */
.app-nav {
    margin-bottom: 16px;
    text-align: right;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
}

.app-nav-link:hover {
    color: #e89040;
    border-color: #e89040;
    background: rgba(232, 144, 64, 0.05);
}