/* ============================================================
   智能待办 todo.s1.css
   蓝紫渐变主题 + 玻璃拟态，移动端自适应
   ============================================================ */

.todo-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.96), rgba(239,246,255,0.92));
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.10);
    padding: 22px;
    position: relative;
    overflow: hidden;
}
.todo-card::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.10), transparent 70%);
    pointer-events: none;
}
.todo-card::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(59,130,246,0.08), transparent 70%);
    pointer-events: none;
}
.todo-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%) !important;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
    animation: todo-breath 3s ease-in-out infinite;
}
@keyframes todo-breath {
    0%, 100% { box-shadow: 0 6px 18px rgba(59,130,246,0.35); }
    50% { box-shadow: 0 6px 26px rgba(99,102,241,0.55); }
}

/* ---------- 登录引导 ---------- */
.todo-login-guide { text-align: center; padding: 34px 16px 26px; position: relative; z-index: 1; }
.todo-login-guide i { font-size: 40px; background: linear-gradient(135deg,#3b82f6,#6366f1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.todo-login-guide h3 { margin: 12px 0 6px; font-size: 1.05rem; color: #1e293b; }
.todo-login-guide p { margin: 0 0 18px; font-size: 0.85rem; color: #64748b; }
.todo-login-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.todo-login-btns a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 26px; border-radius: 999px; text-decoration: none;
    font-size: 0.9rem; font-weight: 600; transition: all .25s ease;
}
.todo-login-btns a.main { background: linear-gradient(135deg,#3b82f6,#6366f1); color: #fff; box-shadow: 0 6px 16px rgba(59,130,246,0.35); }
.todo-login-btns a.main:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(99,102,241,0.45); }
.todo-login-btns a.ghost { border: 1.5px solid rgba(59,130,246,0.45); color: #2563eb; background: rgba(255,255,255,0.7); }
.todo-login-btns a.ghost:hover { background: rgba(59,130,246,0.08); }

/* ---------- Tabs ---------- */
.todo-tabs {
    display: flex; gap: 5px; margin: 6px 0 16px;
    background: rgba(219,234,254,0.55); border: 1px solid rgba(59,130,246,0.28);
    padding: 5px; border-radius: 14px;
    position: relative; z-index: 1;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.todo-tabs::-webkit-scrollbar { display: none; }
.todo-tab {
    flex: 1 0 auto; border: none; background: transparent; cursor: pointer;
    padding: 9px 12px; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
    color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    transition: all .22s ease; white-space: nowrap;
}
.todo-tab i { font-size: 0.8rem; }
.todo-tab:hover { color: #2563eb; }
.todo-tab.active {
    background: linear-gradient(135deg,#3b82f6,#6366f1); color: #fff;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
}
.todo-pane { display: none; animation: todo-slide-in .3s ease; position: relative; z-index: 1; }
.todo-pane.active { display: block; }
@keyframes todo-slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 统计概览卡 ---------- */
.todo-overview-card {
    display: flex; align-items: center; justify-content: space-around; gap: 10px;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-radius: 16px; padding: 18px 20px;
    border: 1px solid rgba(59,130,246,0.4);
    box-shadow: 0 6px 20px rgba(59,130,246,0.10);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.todo-overview-item { text-align: center; flex: 1; min-width: 80px; }
.todo-ov-num { font-size: 1.6rem; font-weight: 800; color: #1e40af; line-height: 1; }
.todo-ov-label { font-size: 0.78rem; color: #1e3a8a; font-weight: 600; margin-top: 5px; }
.todo-overview-divider { width: 1px; height: 36px; background: rgba(59,130,246,0.25); }

/* ---------- 表单 ---------- */
.todo-form-card {
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(59,130,246,0.22);
    border-radius: 16px; padding: 18px;
    margin-bottom: 16px;
}
.todo-form-title { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; color: #1e3a8a; margin-bottom: 16px; }
.todo-form-title i { color: #3b82f6; }

.todo-field-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.todo-field { flex: 1; min-width: 130px; margin-bottom: 14px; }
.todo-field label { display: block; font-size: 0.82rem; font-weight: 600; color: #475569; margin-bottom: 7px; }
.todo-field label i { color: #3b82f6; margin-right: 4px; }
.todo-field input[type="text"], .todo-field input[type="date"] {
    width: 100%; padding: 10px 12px; border: 1.5px solid rgba(59,130,246,0.25);
    border-radius: 10px; font-size: 0.88rem; color: #1e293b;
    background: #fff; box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.todo-field input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }

.todo-desc-input {
    width: 100%; box-sizing: border-box;
    padding: 11px 12px; border: 1.5px solid rgba(59,130,246,0.25);
    border-radius: 10px; font-size: 0.88rem; color: #1e293b;
    background: #fff; resize: vertical; min-height: 70px; font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.todo-desc-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }

/* 优先级选择 */
.todo-priority-grid { display: flex; gap: 10px; }
.todo-priority-item {
    flex: 1; text-align: center; padding: 12px 6px;
    border: 1.5px solid rgba(59,130,246,0.25); border-radius: 12px;
    cursor: pointer; transition: all .2s; background: #fff;
}
.todo-priority-item .todo-pri-ico { font-size: 1.1rem; margin-bottom: 4px; }
.todo-priority-item .todo-pri-name { font-size: 0.78rem; color: #64748b; font-weight: 500; }
.todo-priority-item.active { border-color: #3b82f6; background: rgba(59,130,246,0.06); box-shadow: 0 4px 12px rgba(59,130,246,0.15); }
.todo-priority-item.active .todo-pri-name { color: #1e3a8a; font-weight: 700; }

/* 保存按钮 */
.todo-save-row { display: flex; gap: 10px; margin-top: 6px; }
.todo-save-btn {
    flex: 1; border: none; cursor: pointer;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600; color: #fff;
    background: linear-gradient(135deg,#3b82f6,#6366f1);
    box-shadow: 0 6px 16px rgba(59,130,246,0.35);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .25s ease;
}
.todo-save-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(99,102,241,0.45); }
.todo-cancel-btn {
    border: 1.5px solid rgba(59,130,246,0.4); cursor: pointer;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600; color: #2563eb; background: rgba(255,255,255,0.7);
    transition: all .2s;
}
.todo-cancel-btn:hover { background: rgba(59,130,246,0.08); }

/* ---------- 列表 ---------- */
.todo-list-section { position: relative; z-index: 1; }
.todo-section-title { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 700; color: #1e3a8a; margin: 18px 0 12px; }
.todo-section-title i { color: #3b82f6; }

.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-item {
    display: flex; align-items: flex-start; gap: 12px;
    background: rgba(255,255,255,0.85); border: 1px solid rgba(59,130,246,0.18);
    border-radius: 12px; padding: 12px 14px;
    transition: all .2s;
}
.todo-item:hover { box-shadow: 0 4px 14px rgba(59,130,246,0.12); transform: translateY(-1px); }
.todo-check {
    width: 22px; height: 22px; border-radius: 6px;
    border: 2px solid #cbd5e1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 1px;
    transition: all .2s; background: #fff;
}
.todo-check:hover { border-color: #3b82f6; }
.todo-check.checked {
    background: linear-gradient(135deg,#3b82f6,#6366f1); border-color: #3b82f6; color: #fff;
}
.todo-check.checked i { font-size: 0.75rem; }
.todo-info { flex: 1; min-width: 0; }
.todo-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-item-title { font-size: 0.88rem; font-weight: 600; color: #1e293b; word-break: break-word; }
.todo-item.done .todo-item-title { text-decoration: line-through; color: #94a3b8; }
.todo-pri-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; font-weight: 600;
}
.todo-pri-badge.high { background: rgba(239,68,68,0.12); color: #dc2626; }
.todo-pri-badge.mid { background: rgba(245,158,11,0.12); color: #d97706; }
.todo-pri-badge.low { background: rgba(16,185,129,0.12); color: #059669; }
.todo-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.75rem; color: #94a3b8; margin-top: 5px; }
.todo-meta span { display: inline-flex; align-items: center; gap: 4px; }
.todo-meta .due-overdue { color: #dc2626; font-weight: 600; }
.todo-meta .due-today { color: #d97706; font-weight: 600; }
.todo-item-desc { font-size: 0.8rem; color: #64748b; margin-top: 6px; line-height: 1.5; }
.todo-actions { display: flex; gap: 6px; flex-shrink: 0; }
.todo-action-btn { border: none; background: rgba(59,130,246,0.08); color: #2563eb; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; transition: all .2s; }
.todo-action-btn:hover { background: rgba(59,130,246,0.18); }
.todo-action-btn.del { color: #ef4444; background: rgba(239,68,68,0.08); }
.todo-action-btn.del:hover { background: rgba(239,68,68,0.18); }

/* 分页 */
.todo-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.todo-page-btn {
    min-width: 32px; height: 32px; padding: 0 10px;
    border: 1px solid rgba(59,130,246,0.25); background: #fff;
    border-radius: 8px; cursor: pointer; font-size: 0.82rem; color: #475569;
    transition: all .2s;
}
.todo-page-btn:hover:not(:disabled) { border-color: #3b82f6; color: #2563eb; }
.todo-page-btn.active { background: linear-gradient(135deg,#3b82f6,#6366f1); color: #fff; border-color: #3b82f6; }
.todo-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 统计页 ---------- */
.todo-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.todo-stat-card {
    background: rgba(255,255,255,0.8); border-radius: 14px; padding: 14px;
    border: 1px solid rgba(59,130,246,0.18);
}
.todo-stat-card.c1 { background: linear-gradient(135deg, #dbeafe, #fff); }
.todo-stat-card.c2 { background: linear-gradient(135deg, #dcfce7, #fff); }
.todo-stat-card.c3 { background: linear-gradient(135deg, #fef3c7, #fff); }
.todo-stat-card.c4 { background: linear-gradient(135deg, #e0e7ff, #fff); }
.todo-stat-label { font-size: 0.78rem; color: #64748b; margin-bottom: 6px; }
.todo-stat-label i { margin-right: 4px; }
.todo-stat-value { font-size: 1.5rem; font-weight: 800; color: #1e293b; }
.todo-stat-value small { font-size: 0.8rem; font-weight: 500; color: #64748b; }

.todo-top-title { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; color: #1e3a8a; margin: 18px 0 12px; }
.todo-top-title i { color: #3b82f6; }

.todo-high-list { display: flex; flex-direction: column; gap: 8px; }
.todo-high-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(254,242,242,0.7); border: 1px solid rgba(239,68,68,0.2);
    border-radius: 10px; padding: 10px 12px;
}
.todo-high-item .todo-hi-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
.todo-high-item .todo-hi-title { flex: 1; font-size: 0.84rem; color: #1e293b; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-high-item .todo-hi-due { font-size: 0.75rem; color: #dc2626; font-weight: 600; flex-shrink: 0; }

.todo-history-list { display: flex; flex-direction: column; gap: 10px; }
.todo-history-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.8); border: 1px solid rgba(59,130,246,0.18);
    border-radius: 12px; padding: 12px 14px;
}
.todo-hist-check { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg,#3b82f6,#6366f1); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.7rem; flex-shrink: 0; }
.todo-hist-info { flex: 1; min-width: 0; }
.todo-hist-title { font-size: 0.85rem; color: #1e293b; text-decoration: line-through; color: #94a3b8; }
.todo-hist-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }
.todo-hist-actions { display: flex; gap: 6px; }
.todo-hist-btn { border: none; background: rgba(59,130,246,0.08); color: #2563eb; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; transition: all .2s; }
.todo-hist-btn:hover { background: rgba(59,130,246,0.18); }
.todo-hist-btn.del { color: #ef4444; background: rgba(239,68,68,0.08); }
.todo-hist-btn.del:hover { background: rgba(239,68,68,0.18); }

.todo-empty { text-align: center; padding: 28px 16px; color: #94a3b8; }
.todo-empty i { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }
.todo-empty div { font-size: 0.85rem; }

/* ---------- Toast ---------- */
.todo-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #fff; padding: 12px 20px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 10px;
    font-size: 0.88rem; font-weight: 500; z-index: 999999;
    border-left: 4px solid #3b82f6;
    animation: todo-toast-in .3s ease;
    max-width: 90vw;
}
.todo-toast.success { border-left-color: #10b981; }
.todo-toast.error { border-left-color: #ef4444; }
.todo-toast.warning { border-left-color: #f59e0b; }
.todo-toast.info { border-left-color: #3b82f6; }
.todo-toast i { font-size: 1rem; }
.todo-toast.success i { color: #10b981; }
.todo-toast.error i { color: #ef4444; }
.todo-toast.warning i { color: #f59e0b; }
.todo-toast.info i { color: #3b82f6; }
@keyframes todo-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-15px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- 弹窗 ---------- */
.todo-modal-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,0.45);
    z-index: 999998; display: flex; align-items: center; justify-content: center;
    padding: 16px; animation: todo-fade .2s ease;
}
@keyframes todo-fade { from { opacity: 0; } to { opacity: 1; } }
.todo-modal {
    background: #fff; border-radius: 18px; max-width: 420px; width: 100%;
    padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: todo-pop .25s ease;
    max-height: 85vh; overflow-y: auto;
}
@keyframes todo-pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.todo-modal-title { font-size: 1.05rem; font-weight: 700; color: #1e3a8a; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.todo-modal-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; gap: 10px; }
.todo-modal-row:last-child { border-bottom: none; }
.todo-modal-row .todo-mr-label { color: #64748b; flex-shrink: 0; }
.todo-modal-row .todo-mr-val { font-weight: 600; color: #1e293b; text-align: right; word-break: break-word; }
.todo-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.todo-modal-btn {
    flex: 1; border: none; cursor: pointer; padding: 10px; border-radius: 10px;
    font-size: 0.88rem; font-weight: 600; transition: all .2s;
}
.todo-modal-btn.primary { background: linear-gradient(135deg,#3b82f6,#6366f1); color: #fff; }
.todo-modal-btn.primary:hover { transform: translateY(-1px); }
.todo-modal-btn.ghost { background: rgba(59,130,246,0.08); color: #2563eb; }
.todo-modal-btn.danger { background: rgba(239,68,68,0.1); color: #dc2626; }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .todo-card { padding: 14px; border-radius: 16px; }
    .todo-tab { padding: 8px 10px; font-size: 0.78rem; }
    .todo-tab i { display: none; }
    .todo-overview-card { padding: 14px; }
    .todo-ov-num { font-size: 1.3rem; }
    .todo-form-card { padding: 14px; }
    .todo-field-row { gap: 8px; }
    .todo-priority-grid { gap: 6px; }
    .todo-stat-grid { gap: 8px; }
    .todo-stat-card { padding: 12px; }
    .todo-stat-value { font-size: 1.25rem; }
    .todo-item { padding: 10px 12px; }
    .todo-meta { font-size: 0.7rem; }
}
