:root {
    /* 字体大小变量 - 参考原文件 */
    --section-title-size: 18px;
    --section-title-weight: 600;
    --page-title-size: 24px;
    --page-title-weight: 600;
    --subtitle-size: 14px;
    --nav-item-size: 14px;
    --nav-item-weight: 500;
    
    /* 动画变量 */
    --animate-duration: 0.3s;
    --animate-delay: 0s;
    
    /* 浅色模式颜色变量 */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --container-bg: #fff;
    --card-bg: #fff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e1e5e9;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover-bg: #f0f8ff;
    --input-bg: #fff;
    --time-card-bg: #f8f9ff;
    --stats-bg: #f8f9ff;
    --developer-bg: #f8f9ff;
}

/* 深色模式颜色变量 */
body.dark-mode {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --container-bg: #1e1e1e;
    --card-bg: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #3d3d3d;
    --shadow: rgba(0, 0, 0, 0.3);
    --hover-bg: #383838;
    --input-bg: #2d2d2d;
    --time-card-bg: #2d2d2d;
    --stats-bg: #2d2d2d;
    --developer-bg: #2d2d2d;
}

/* 深色模式快捷按钮适配 */
body.dark-mode .quick-date-btn {
    background: var(--card-bg);
    border-color: #4facfe;
    color: #4facfe;
}

body.dark-mode .quick-date-btn:hover {
    background: #4facfe;
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    width: 414px;
    max-width: 414px;
    min-width: 320px; /* 最小宽度保护 */
    margin: 0 auto;
    background: var(--container-bg);
    min-height: calc(100vh - 40px);
    box-shadow: 0 0 20px var(--shadow);
    border-radius: 12px;
    overflow: hidden;
    transition: background 0.3s ease;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: var(--page-title-size);
    font-weight: var(--page-title-weight);
    margin-bottom: 5px;
}

.header .subtitle {
    font-size: var(--subtitle-size);
    opacity: 0.9;
}

/* 主题切换按钮 */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

body.dark-mode .theme-icon {
    transform: rotate(180deg);
}

.current-time {
    background: var(--time-card-bg);
    border-radius: 12px;
    padding: 15px;
    margin: 20px;
    text-align: center;
    border-left: 4px solid #4facfe;
    transition: background 0.3s ease;
}

.current-time .time {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.current-time .date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* 今日任务进度条 */
.today-progress-container {
    margin: 0 20px 20px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 10px;
    transition: width 0.5s ease, background 0.3s ease;
}

.progress-bar-fill[data-progress="low"] {
    background: linear-gradient(90deg, #ff6b6b 0%, #ee5a6f 100%);
}

.progress-bar-fill[data-progress="medium"] {
    background: linear-gradient(90deg, #ffa726 0%, #fb8c00 100%);
}

.progress-bar-fill[data-progress="high"] {
    background: linear-gradient(90deg, #66bb6a 0%, #43a047 100%);
}

/* 圆形进度环 */
.progress-ring-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    transition: stroke 0.3s ease;
}

body.dark-mode .progress-ring-bg {
    stroke: #3d3d3d;
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
    stroke-linecap: round;
}

.progress-ring-text {
    position: absolute;
    text-align: center;
}

.progress-percentage {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.progress-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 导航栏样式 */
.tab-navigation {
    background: var(--card-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow);
    gap: 8px;
    transition: background 0.3s ease;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
    font-weight: var(--nav-item-weight);
    font-size: var(--nav-item-size);
    border: none;
    background: transparent;
}

.tab-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: var(--hover-bg);
    color: #4facfe;
}

/* 滑动容器样式 */
.swipe-container {
    display: flex;
    overflow: hidden;
    position: relative;
    width: 414px;
    max-width: 100%;
    transition: transform 0.3s ease-out;
}

.page {
    width: 414px;
    min-width: 320px;
    max-width: 414px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page:not(.active) {
    display: none;
}

.page.active {
    display: flex;
}

.main-content {
    padding: 20px;
    width: 100%;
    max-width: 414px;
    box-sizing: border-box;
    overflow: hidden;
}

/* 最近任务区域样式 */
.recent-tasks-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background 0.3s ease;
}

.recent-tasks-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: var(--section-title-size);
    font-weight: var(--section-title-weight);
}

/* 移动端滑动优化 */
.container {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

@media (hover: none) and (pointer: coarse) {
    /* 移动端特定样式 */
    .tab-btn {
        padding: 14px 8px;
        font-size: 13px;
    }
    
    .container {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .task-text {
        user-select: text;
        -webkit-user-select: text;
    }
}

/* 任务输入区域 */
.task-input-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background 0.3s ease;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 16px;
}

.task-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.task-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px; /* 防止 iOS 自动缩放 */
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-primary);
    /* 移动端触摸优化 */
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px; /* iOS 推荐最小触摸区域 */
    /* Webkit 样式优化 */
    color-scheme: light dark;
}

.date-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* Webkit 日历选择器图标样式优化 */
.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: opacity(0.7);
    transition: filter 0.2s ease;
    width: 20px;
    height: 20px;
}

.date-input::-webkit-calendar-picker-indicator:hover {
    filter: opacity(1);
}

/* 深色模式下的日历选择器图标优化 */
body.dark-mode .date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.7);
}

body.dark-mode .date-input::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) opacity(1);
}

/* 快捷日期按钮组 */
.quick-date-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.quick-date-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: var(--hover-bg);
    color: #4facfe;
    border: 1px solid #4facfe;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-date-btn:hover {
    background: #4facfe;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.quick-date-btn:active {
    transform: translateY(0);
}

.weekday-display {
    margin-top: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: none;
    display: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    animation: fadeIn 0.3s ease;
}

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

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 筛选按钮 */
.filter-section {
    background: var(--card-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow);
    margin-bottom: 20px;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.filter-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
    font-weight: var(--nav-item-weight);
    font-size: var(--nav-item-size);
    border: none;
    background: transparent;
}

.filter-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: var(--hover-bg);
    color: #4facfe;
}

/* 任务列表 */
.tasks-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.tasks-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: var(--section-title-size);
    font-weight: var(--section-title-weight);
}

.task-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--animate-duration);
    opacity: 1;
    transform: translateX(0);
    width: 100%;
    max-width: 374px; /* 414px - 40px padding */
    min-height: 60px;
    overflow: visible;
    position: relative;
}

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

.task-item.removing {
    opacity: 0;
    transform: translateX(100%);
}

.task-item.adding {
    animation: slideInDown var(--animate-duration) ease-out;
}

/* 任务滑动操作背景 */
.task-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-item.swiping-left::before {
    content: '🗑️ 删除';
    background: linear-gradient(90deg, transparent 0%, #ff4444 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    font-weight: 600;
    opacity: 1;
}

.task-item.swiping-right::before {
    content: '✓ 完成';
    background: linear-gradient(90deg, #4caf50 0%, transparent 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 20px;
    font-weight: 600;
    opacity: 1;
}

.task-item-wrapper {
    position: relative;
    background: var(--card-bg);
    z-index: 1;
    transition: transform 0.3s ease;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #4facfe;
    margin-right: 12px;
    margin-top: 2px; /* 与文本对齐 */
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
}

.task-checkbox.checked {
    background: #4facfe;
    border-color: #4facfe;
}

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

.task-content {
    flex: 1;
    margin-right: 12px;
    min-width: 0;
    overflow: hidden;
    max-width: 280px; /* 固定最大宽度，确保不会撑开容器 */
    width: calc(100% - 100px);
}

.task-text {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: all 0.3s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
    display: block;
}

.task-text.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.7;
}

.task-text.editing {
    background: var(--hover-bg);
    border: 1px solid #4facfe;
    border-radius: 4px;
    padding: 4px 8px;
    outline: none;
}

.task-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    overflow: hidden;
    align-items: center;
}

.task-deadline {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-deadline.today {
    background: #ffebee;
    color: #d32f2f;
    border-left: 3px solid #d32f2f;
}

.task-deadline.tomorrow {
    background: #fff3e0;
    color: #f57c00;
    border-left: 3px solid #f57c00;
}

.task-deadline.future {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 3px solid #2e7d32;
}

.task-deadline.overdue {
    background: #ffcdd2;
    color: #b71c1c;
    border-left: 3px solid #b71c1c;
}

.task-deadline.normal {
    background: #f5f5f5;
    color: #757575;
}

.task-recurrence {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #e3f2fd;
    color: #1976d2;
}

.task-weekday {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #f3e5f5;
    color: #7b1fa2;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-deadline.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.task-deadline.clickable:hover {
    background-color: rgba(79, 172, 254, 0.1);
    transform: scale(1.02);
}

.deadline-input.editing {
    background: var(--input-bg);
    border: 2px solid #4facfe;
    border-radius: 8px;
    padding: 12px 16px;
    outline: none;
    font-size: 16px; /* 防止 iOS 自动缩放 */
    font-weight: 500;
    color: var(--text-primary);
    width: 100%;
    /* 移动端触摸优化 */
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px; /* iOS 推荐最小触摸区域 */
    /* Webkit 样式优化 */
    color-scheme: light dark;
    transition: all 0.3s ease;
}

.deadline-input.editing:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* Webkit 日历选择器图标样式优化 - 编辑模式 */
.deadline-input.editing::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: opacity(0.7);
    transition: filter 0.2s ease;
    width: 20px;
    height: 20px;
}

.deadline-input.editing::-webkit-calendar-picker-indicator:hover {
    filter: opacity(1);
}

/* 深色模式下的日历选择器图标优化 - 编辑模式 */
body.dark-mode .deadline-input.editing::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.7);
}

body.dark-mode .deadline-input.editing::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) opacity(1);
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    background: transparent;
}

.delete-btn {
    color: #ff4444;
}

.delete-btn:hover {
    background: #ffe6e6;
}

/* 统计信息 */
.stats-section {
    background: var(--stats-bg);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #4facfe;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.stats-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.clear-completed-btn {
    padding: 8px 16px;
    background: transparent;
    color: #ff4444;
    border: 1px solid #ff4444;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-completed-btn:hover {
    background: #ff4444;
    color: white;
}

.clear-completed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state .message {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state .submessage {
    font-size: 14px;
    opacity: 0.8;
}

/* 动画定义 */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* 庆祝动画Canvas */
.celebration-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .container {
        width: 100vw;
        max-width: 100vw;
        min-width: 320px;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .swipe-container {
        width: 100vw;
        max-width: 100vw;
    }
    
    .page {
        width: 100vw;
        max-width: 100vw;
        min-width: 320px;
    }
    
    .main-content {
        max-width: 100vw;
    }
    
    body {
        padding: 0;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .filter-section {
        margin-bottom: 20px;
    }
    
    .filter-btn {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .tab-navigation {
        padding: 10px 15px;
    }
    
    .tab-btn {
        padding: 8px;
        font-size: calc(var(--nav-item-size) - 2px);
    }
    
    .task-meta {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: flex-start;
    }
    
    .task-text {
        font-size: 15px;
        max-width: calc(100vw - 120px); /* 更精确的宽度计算 */
    }
    
    .task-content {
        max-width: calc(100vw - 100px); /* 小屏幕下为操作按钮留更少空间 */
        width: calc(100vw - 100px);
    }
    
    .task-item {
        max-width: calc(100vw - 30px); /* 小屏幕下任务项宽度限制 */
    }
    
    .weekday-display {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .quick-date-buttons {
        gap: 6px;
    }
    
    .quick-date-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (hover: none) and (pointer: coarse) {
    /* 移动端特定样式 */
    .container {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .task-text {
        user-select: text;
        -webkit-user-select: text;
    }
}

/* 无障碍和可访问性 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 开发者信息 */
.developer-info {
    background: var(--developer-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid #4facfe;
    transition: background 0.3s ease;
}

.developer-info .title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.developer-info .contact {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.developer-info .wechat {
    background: #e8f4ff;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    display: inline-block;
    font-weight: 500;
    color: #1976d2;
}

/* 自定义模态框 */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.custom-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.3s ease;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.modal-btn-cancel {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-btn-cancel:hover {
    background: var(--border-color);
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.modal-btn-confirm:active {
    transform: translateY(0);
}

/* 数据导入/导出页面样式 */
.data-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background 0.3s ease;
}

.data-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: var(--section-title-size);
    font-weight: var(--section-title-weight);
}

.section-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    padding: 12px 16px;
    background: var(--hover-bg);
    border-radius: 8px;
    border-left: 3px solid #4facfe;
}

.export-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.export-btn:hover {
    transform: translateY(-2px);
}

.export-btn:active {
    transform: translateY(0);
}

.export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    width: 100%;
    padding: 14px;
    background: var(--hover-bg);
    color: #4facfe;
    border: 2px solid #4facfe;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    margin-bottom: 15px;
}

.secondary-btn:hover {
    background: #4facfe;
    color: white;
    transform: translateY(-2px);
}

.secondary-btn:active {
    transform: translateY(0);
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.import-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-info {
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #2e7d32;
    animation: slideInDown 0.3s ease-out;
}

.file-name {
    display: block;
    font-weight: 500;
    color: #2e7d32;
    margin-bottom: 10px;
    font-size: 14px;
    word-break: break-all;
}

.file-name::before {
    content: "📄 ";
}

.tips-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background 0.3s ease;
}

.tips-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: var(--section-title-size);
    font-weight: var(--section-title-weight);
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    padding-left: 20px;
}

.tips-list li::before {
    content: "•";
    color: #4facfe;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 导航栏适配三个按钮 */
@media (max-width: 375px) {
    .tab-btn {
        padding: 8px 2px;
        font-size: calc(var(--nav-item-size) - 3px);
        min-width: 0;
        flex: 1;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    
    .tab-navigation {
        padding: 10px 5px;
        gap: 2px;
    }
    
    /* 数据页面移动端优化 */
    .data-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .section-description {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .export-btn, .secondary-btn {
        padding: 12px;
        font-size: 15px;
    }
}

/* 文件输入样式优化 */
.file-input {
    display: none;
}

/* 额外的文本溢出保护 */
.task-text, .task-deadline, .task-recurrence, .task-weekday {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 确保编辑输入框也有正确的宽度限制 */
.task-text.editing {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 更大屏幕的额外优化 */
@media (min-width: 376px) and (max-width: 414px) {
    .task-content {
        max-width: 280px;
        width: calc(100% - 110px);
    }
    
    .task-item {
        max-width: 374px;
    }
}

/* 超大屏幕优化 */
@media (min-width: 415px) {
    .container, .swipe-container, .page {
        width: 414px;
        max-width: 414px;
    }
    
    .task-content {
        max-width: 280px;
        width: calc(100% - 120px);
    }
    
    .task-item {
        max-width: 374px;
    }
}