* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-image: linear-gradient(to right, #d02b88, #bf379b, #a944ab, #8f4fb8, #6e59c1, #576cd0, #397ddc, #008de3, #00abf2, #00c8f7, #00e2f6, #5ffbf1);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    max-width: 550px;
    padding: 30px;
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right, #ffffff, #f0f8ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 32px;
    letter-spacing: 1px;
}

.todo-input {
    display: flex;
    margin-bottom: 20px;
}

.todo-input input {
    flex: 1;
    padding: 15px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    backdrop-filter: blur(5px);
}

.todo-input input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.todo-input button {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.todo-input button:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.filters {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.filter {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

.filter:hover, .filter.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.task-list {
    list-style: none;
    margin-bottom: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    border-radius: 6px;
    transition: transform 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.task-item:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.15);
}

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

.task-checkbox {
    margin-right: 15px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: rgba(255, 255, 255, 0.8);
    position: relative;
    appearance: none;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.task-checkbox:checked {
    background-color: rgba(255, 255, 255, 0.8);
}

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

.task-text {
    flex: 1;
    font-size: 16px;
    color: white;
    transition: color 0.3s, text-decoration 0.3s;
    word-break: break-word;
    padding-right: 10px;
}

.task-item.completed .task-text {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
}

.delete-btn {
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.delete-btn:hover {
    opacity: 1;
    color: #ff6b6b;
}

.info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#clearCompleted {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

#clearCompleted:hover {
    opacity: 1;
    text-decoration: underline;
}

.empty-tasks {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 10px 0;
}

.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 20px;
}

.todo-input input:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.edit-mode .task-text {
    display: none;
}

.task-edit-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    color: white;
    outline: none;
}

.datetime {
    text-align: center;
    color: white;
    margin-bottom: 15px;
    font-size: 14px;
    opacity: 0.8;
}

.loading {
    text-align: center;
    padding: 20px;
    color: white;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.priority-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.priority-high {
    background-color: #ff6b6b;
}

.priority-medium {
    background-color: #ffbb33;
}

.priority-low {
    background-color: #33cc66;
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .filters {
        flex-wrap: wrap;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .todo-input input {
        font-size: 14px;
    }
    
    .task-text {
        font-size: 14px;
    }
}

/* 提示框样式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.toast.success {
    background-color: rgba(51, 204, 102, 0.8);
    border-left: 4px solid #33cc66;
}

.toast.info {
    background-color: rgba(0, 140, 255, 0.8);
    border-left: 4px solid #008de3;
}

/* 专注模式计时器 */
.focus-timer {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    display: none; /* 默认隐藏，通过JS控制显示 */
}

.timer-display {
    font-size: 28px;
    color: white;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.timer-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.timer-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.timer-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 语音输入按钮 */
#voiceInput {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#voiceInput:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

#voiceInput.listening {
    background-color: #ff6b6b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 快速任务模板 */
.quick-templates {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-templates span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.template-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* 智能建议区 */
.smart-suggestions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border-left: 3px solid #008de3;
}

.smart-suggestions h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.smart-suggestions h3 i {
    margin-right: 8px;
    color: #ffbb33;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.suggestion-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.suggestion-action {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.suggestion-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 统计按钮 */
.stats-btn {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    margin: 15px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.stats-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.95);
    margin: 10% auto;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalIn 0.4s ease-out;
}

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

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #333;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #6e59c1;
}

.stat-label {
    font-size: 14px;
    color: #777;
}

.productivity-chart {
    margin-top: 30px;
}

.productivity-chart h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #555;
}

.chart-container {
    height: 200px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.chart-bar {
    width: 12%;
    background: linear-gradient(to top, #6e59c1, #397ddc);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 1s ease;
}

.chart-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #555;
}

.chart-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #777;
}

/* 今日重点任务样式 */
.task-item.today-focus {
    background-color: rgba(255, 165, 0, 0.15);
    border-left: 3px solid orange;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .filters {
        flex-wrap: wrap;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .todo-input input {
        font-size: 14px;
    }
    
    .task-text {
        font-size: 14px;
    }
    
    .quick-templates {
        justify-content: center;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 15px;
    }
}

/* 日期选择器样式 */
.date-selector {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    border-left: 3px solid #5ffbf1;
}

.date-selector-header {
    display: flex;
    align-items: center;
}

.date-selector-header span {
    color: white;
    font-size: 14px;
    margin-right: 10px;
}

.date-selector-header input[type="date"] {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    color: white;
    flex: 1;
}

.date-selector-header button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.8;
}

.date-selector-header button:hover {
    opacity: 1;
}

.date-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* 未来任务样式 */
.task-item.future-task {
    background-color: rgba(95, 251, 241, 0.1);
    border-left: 3px solid #5ffbf1;
}

.task-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(95, 251, 241, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

.task-date i {
    margin-right: 3px;
}

/* 未来任务提示样式 */
.future-tasks-indicator {
    text-align: center;
    background: rgba(95, 251, 241, 0.2);
    color: white;
    padding: 8px;
    border-radius: 6px;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.future-tasks-indicator:hover {
    background: rgba(95, 251, 241, 0.3);
}

.future-tasks-indicator i {
    margin-right: 5px;
}

/* 添加标题和黑夜模式按钮的容器 */
.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 25px;
}

/* 黑夜模式切换按钮 */
.dark-mode-toggle {
    background-color: #444141;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    font-size: 16px;
    border: none;
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    background-image: linear-gradient(90deg, #53cbef 0%, #dcc66c 50%, #ffa3b6 75%, #53cbef 100%);
    animation: slidernbw 5s linear infinite;
    color: #000;
}

@keyframes slidernbw {
    to {
        background-position: 20vw;
    }
}

/* 黑夜模式样式 */
body.dark-mode {
    background-image: linear-gradient(to right, #121212, #1f1f1f, #242424, #292929, #323232);
}

body.dark-mode .container {
    background-color: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(50, 50, 50, 0.5);
}

body.dark-mode h1 {
    background: linear-gradient(to right, #aaaaaa, #cccccc);
    -webkit-background-clip: text;
    background-clip: text;
}

body.dark-mode .todo-input input {
    background-color: rgba(50, 50, 50, 0.5);
}

body.dark-mode .todo-input button {
    background-color: rgba(50, 50, 50, 0.5);
}

body.dark-mode .task-item {
    background-color: rgba(40, 40, 40, 0.5);
}

body.dark-mode .empty-tasks {
    background-color: rgba(40, 40, 40, 0.3);
}

body.dark-mode .filter {
    background: rgba(40, 40, 40, 0.5);
}

body.dark-mode .filter:hover, 
body.dark-mode .filter.active {
    background-color: rgba(60, 60, 60, 0.7);
}

body.dark-mode .smart-suggestions {
    background-color: rgba(40, 40, 40, 0.5);
}

body.dark-mode .stats-btn {
    background: rgba(40, 40, 40, 0.5);
}

body.dark-mode .focus-timer {
    background: rgba(40, 40, 40, 0.5);
}

body.dark-mode .date-selector {
    background: rgba(40, 40, 40, 0.5);
}

body.dark-mode .dark-mode-toggle {
    background-color: #f0f0f0;
    color: #121212;
}

body.dark-mode .dark-mode-toggle i {
    content: "\f185"; /* 太阳图标 */
}

/* 黑夜模式下特殊任务样式 */
body.dark-mode .task-item.today-focus {
    background-color: rgba(150, 100, 0, 0.2);
}

body.dark-mode .task-item.future-task {
    background-color: rgba(0, 150, 150, 0.15);
}
