/* ===== Plan Page ===== */
.plan-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    margin-top: 24px;
}

.plan-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.sidebar-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sidebar-card-header h3 {
    margin-bottom: 0;
}

.add-plan-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px dashed #CBD5E1;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.add-plan-btn:hover {
    border-color: #6366F1;
    background: rgba(99,102,241,0.05);
}

.today-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ts-item {
    text-align: center;
    flex: 1;
}

.ts-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ts-done {
    color: #10B981;
}

.ts-progress {
    color: #6366F1;
}

.ts-label {
    font-size: 12px;
    color: #64748B;
    font-weight: 500;
}

.today-progress-bar {
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366F1, #8B5CF6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.plan-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #F8FAFC;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.plan-item:hover {
    background: #F1F5F9;
    transform: translateX(4px);
}

.plan-item.active {
    border-color: #6366F1;
    background: rgba(99,102,241,0.05);
}

.plan-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.plan-info {
    flex: 1;
    min-width: 0;
}

.plan-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plan-info p {
    font-size: 12px;
    color: #64748B;
}

.plan-dates {
    font-size: 11px;
    color: #94A3B8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #F8FAFC;
    border-radius: var(--radius-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-plans {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
}

.stat-icon-tasks {
    background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(34,197,94,0.1));
}

.stat-icon-completed {
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(251,146,60,0.1));
}

.stat-icon-streak {
    background: linear-gradient(135deg, rgba(236,72,153,0.1), rgba(244,114,182,0.1));
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #1E293B;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: #64748B;
}

.plan-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.plan-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(226,232,240,0.5);
}

.view-tabs {
    display: flex;
    gap: 8px;
}

.view-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
    transition: all 0.3s;
}

.view-tab:hover {
    background: #F1F5F9;
}

.view-tab.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    color: #6366F1;
    font-weight: 600;
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.date-nav-btn:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
}

.current-month {
    font-size: 16px;
    font-weight: 700;
    color: #1E293B;
    min-width: 120px;
    text-align: center;
}

.view-content {
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(226,232,240,0.5);
    padding: 24px;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-header {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    border: 2px solid transparent;
}

.calendar-day:hover {
    background: var(--bg-card-hover);
}

.calendar-day.today {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
}

.calendar-day.selected {
    border-color: #6366F1;
    background: rgba(99,102,241,0.08);
}

.calendar-day.other-month {
    color: var(--text-muted);
}

.calendar-day .day-number {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.calendar-day.today .day-number {
    font-weight: 700;
    color: #6366F1;
}

.day-tasks {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.day-task-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.day-task-dot.high {
    background: #EF4444;
}

.day-task-dot.medium {
    background: #F59E0B;
}

.day-task-dot.low {
    background: #10B981;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selected-date-tasks {
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(226,232,240,0.5);
    padding: 24px;
}

.sd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sd-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1E293B;
}

.add-task-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.add-task-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.3);
}

.sd-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.task-card:hover {
    background: var(--bg-card-hover);
}

.task-card.completed {
    opacity: 0.6;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-top: 2px;
}

.task-checkbox:hover {
    border-color: #6366F1;
}

.task-checkbox.checked {
    background: #6366F1;
    border-color: #6366F1;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.task-priority {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.task-priority.high {
    background: rgba(239,68,68,0.1);
    color: #EF4444;
}

.task-priority.medium {
    background: rgba(245,158,11,0.1);
    color: #F59E0B;
}

.task-priority.low {
    background: rgba(16,185,129,0.1);
    color: #10B981;
}

.task-plan {
    font-size: 11px;
    color: #64748B;
    padding: 3px 8px;
    background: #F1F5F9;
    border-radius: 6px;
}

.task-date {
    font-size: 11px;
    color: #94A3B8;
}

.task-note {
    font-size: 13px;
    color: #64748B;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #E2E8F0;
}

.task-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.task-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
}

.task-card:hover .task-action-btn {
    opacity: 1;
}

.task-action-btn:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
}

.task-action-btn.delete:hover {
    border-color: #EF4444;
    background: rgba(239,68,68,0.05);
}

/* Form Styles */
.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s;
    background: var(--bg-input);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.color-picker {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: #1E293B;
    transform: scale(1.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #E2E8F0;
    background: #F8FAFC;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

.btn-primary {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.3);
}

.empty-state button {
    margin-top: 16px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.empty-state button:hover {
    transform: translateY(-2px);
}

/* ===== 每日打卡卡片 ===== */
.checkin-card {
    background: linear-gradient(135deg, var(--bg-card), color-mix(in srgb, #6366F1 8%, var(--bg-card)));
    border: 1px solid color-mix(in srgb, #6366F1 30%, var(--border-color));
}

.checkin-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkin-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.checkin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.checkin-btn:active {
    transform: translateY(0);
}

.checkin-btn.checked {
    background: linear-gradient(135deg, #10B981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.checkin-btn.checked:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.checkin-stats {
    display: flex;
    gap: 12px;
}

.checkin-stat {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.checkin-stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #6366F1;
    line-height: 1.2;
}

.checkin-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== 日历打卡高亮 ===== */
.calendar-day.day-checked {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    border-color: rgba(16, 185, 129, 0.3);
}

.calendar-day.day-checked.day-checked .day-number {
    color: #10B981;
    font-weight: 600;
}

.day-checkin-mark {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.day-checked.today .day-checkin-mark {
    background: #10B981;
}


@media (max-width: 1024px) {
    .plan-container {
        grid-template-columns: 1fr;
    }
    
    .plan-sidebar {
        position: static;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .plan-view-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .today-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .ts-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}

.shortcuts-modal {
    max-width: 500px;
}

.shortcuts-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.shortcuts-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcuts-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.shortcut-item:hover {
    background: var(--bg-card-hover);
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.shortcut-desc {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: right;
}

@media (max-width: 568px) {
    .shortcuts-content {
        grid-template-columns: 1fr;
    }

    .shortcut-desc {
        text-align: left;
        flex: 1;
        margin-left: 12px;
    }
}

