* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    margin-top: 40px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2d3748;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    color: #718096;
    font-size: 0.95rem;
}

.input-section {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
}

.priority-select {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 80px;
    color: #4a5568;
    font-weight: 500;
}

.priority-select option[value="low"] {
    background: #d1fae5;
    color: #047857;
}

.priority-select option[value="medium"] {
    background: #fef3c7;
    color: #d97706;
}

.priority-select option[value="high"] {
    background: #fee2e2;
    color: #dc2626;
}

.priority-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.priority-select:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.time-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 12px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-bottom: 0;
}

.time-icon-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: scale(1.05);
}

.time-icon-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.clock-icon {
    width: 22px;
    height: 22px;
}

/* 时间选择弹窗 */
.time-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.time-modal.show {
    display: flex;
}

.time-modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.time-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.time-modal-header h3 {
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #a0aec0;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    line-height: 1;
}

.close-modal:hover {
    background: #f7fafc;
    color: #667eea;
}

.time-inputs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-input-group label {
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

.time-input-group input[type="datetime-local"] {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: white;
    cursor: pointer;
}

.time-input-group input[type="datetime-local"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.datetime-picker {
    display: flex;
    gap: 8px;
}

.datetime-picker input[type="date"],
.datetime-picker input[type="time"] {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: white;
    cursor: pointer;
}

.datetime-picker input[type="date"]:focus,
.datetime-picker input[type="time"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.time-modal-footer {
    display: flex;
    gap: 12px;
}

.btn-clear {
    flex: 1;
    padding: 12px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #cbd5e0;
}

.btn-confirm {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 编辑任务弹窗样式 */
.edit-modal-content {
    max-width: 450px;
}

.edit-inputs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.edit-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-input-group label {
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

.edit-text-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: white;
}

.edit-text-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.edit-priority-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    color: #4a5568;
    font-weight: 500;
}

.edit-priority-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.edit-priority-select option[value="low"] {
    background: #d1fae5;
    color: #047857;
}

.edit-priority-select option[value="medium"] {
    background: #fef3c7;
    color: #d97706;
}

.edit-priority-select option[value="high"] {
    background: #fee2e2;
    color: #dc2626;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #cbd5e0;
}

.task-text {
    flex: 1;
    color: #2d3748;
    font-size: 1rem;
    word-break: break-word;
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-text:hover {
    color: #667eea;
    text-decoration: underline;
}

.filter-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    background: #f7fafc;
    padding: 6px;
    border-radius: 12px;
}

.filter-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: rgba(102, 126, 234, 0.1);
}

.filter-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.filter-tab:not(.active) .tab-count {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* 日历视图 */
.calendar-view {
    display: none;
    margin-bottom: 20px;
}

.calendar-view.show {
    display: block;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header h3 {
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 700;
}

.calendar-nav {
    background: #e2e8f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #4a5568;
    transition: all 0.3s ease;
}

.calendar-nav:hover {
    background: #cbd5e0;
    color: #667eea;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.calendar-day-header {
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    min-height: 60px;
    padding: 8px;
    border-radius: 10px;
    background: #f7fafc;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-day:hover {
    background: #edf2f7;
    border-color: #667eea;
}

.calendar-day.today {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.calendar-day.has-task {
    border-left-width: 4px;
}

.calendar-day.priority-low {
    border-left-color: #047857;
}

.calendar-day.priority-medium {
    border-left-color: #d97706;
}

.calendar-day.priority-high {
    border-left-color: #dc2626;
}

.calendar-day-number {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.calendar-day.completed-only .calendar-day-number {
    color: #a0aec0;
}

.calendar-day-icon {
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    background: transparent;
    border-color: transparent;
}

/* 日期详情弹窗 */
.date-detail-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.date-detail-tasks {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.date-detail-task-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.date-detail-task-item:hover {
    background: #edf2f7;
}

.date-detail-task-item.priority-low {
    background: #d1fae5;
    border-left: 3px solid #047857;
}

.date-detail-task-item.priority-medium {
    background: #fef3c7;
    border-left: 3px solid #d97706;
}

.date-detail-task-item.priority-high {
    background: #fee2e2;
    border-left: 3px solid #dc2626;
}

.date-detail-task-content {
    flex: 1;
    margin-left: 12px;
}

.date-detail-task-text {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.date-detail-task-item.completed .date-detail-task-text {
    text-decoration: line-through;
    color: #a0aec0;
}

.date-detail-task-time {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 4px;
}

.btn-add {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    white-space: nowrap;
}

#taskInput {
    flex: 2;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

#taskInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

#taskInput::placeholder {
    color: #a0aec0;
}

.btn-add {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-add:active {
    transform: translateY(0);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-size: 0.9rem;
}

.stat-number {
    font-weight: 700;
    color: #667eea;
    font-size: 1.2rem;
}

.empty-state-pending {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state-completed {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.task-list {
    list-style: none;
    min-height: 100px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-time {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: #718096;
}

.task-time span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-priority {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-label {
    font-weight: 600;
}

.priority-low {
    background: #d1fae5;
    color: #047857;
}

.priority-medium {
    background: #fef3c7;
    color: #d97706;
}

.priority-high {
    background: #fee2e2;
    color: #dc2626;
}

/* 任务项优先级底色样式 */
.task-item.priority-low-item {
    background: #d1fae5;
    border-left: 4px solid #047857;
}

.task-item.priority-medium-item {
    background: #fef3c7;
    border-left: 4px solid #d97706;
}

.task-item.priority-high-item {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
}

.task-item.priority-low-item:hover,
.task-item.priority-medium-item:hover,
.task-item.priority-high-item:hover {
    opacity: 0.9;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-item:hover {
    background: #edf2f7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.task-item.completed {
    opacity: 0.6;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 15px;
    appearance: none;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.task-checkbox:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.task-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.task-text {
    flex: 1;
    color: #2d3748;
    font-size: 1rem;
    word-break: break-word;
    transition: all 0.3s ease;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #a0aec0;
    cursor: not-allowed;
}

.task-item.completed .task-text:hover {
    color: #a0aec0;
    text-decoration: line-through;
}

.btn-delete {
    padding: 8px 16px;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-delete:hover {
    background: #f56565;
    transform: scale(1.05);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.1rem;
    color: #718096;
}

.empty-state-pending {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state-completed {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

/* 响应式设计 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        margin-top: 20px;
        padding: 20px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .input-section {
        flex-direction: column;
        gap: 10px;
    }

    .btn-add {
        width: 100%;
        padding: 12px;
    }

    .input-section {
        flex-direction: column;
        gap: 10px;
    }

    .time-icon-btn {
        width: 100%;
    }

    .priority-select {
        width: 100%;
    }

    .filter-tabs {
        gap: 8px;
        padding: 4px;
    }

    .filter-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .stats {
        gap: 20px;
        flex-direction: row;
    }

    .task-item {
        padding: 14px 16px;
    }

    .btn-delete {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .stats {
        flex-direction: column;
        gap: 8px;
    }

    .task-checkbox {
        width: 20px;
        height: 20px;
    }
}
