:root {
    --primary-color: #007AFF;
    --bg-color: rgba(255, 255, 255, 0.75);
    --text-color: #1D1D1F;
    --input-bg: rgba(255, 255, 255, 0.7);
    --task-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-light: rgba(255, 255, 255, 0.8);
    --shadow-dark: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f2ff 50%, #f5f8ff 100%);
    display: flex;
    color: var(--text-color);
    transition: 0.3s all;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/bj1.jpg') center/cover no-repeat;
    filter: blur(2px);
    z-index: -1;
}

.container {
    width: 100%;
    padding: 20px 20px 0 20px; /* 移除底部padding，保留其他三边的padding */
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* 头部区域 */
.header {
    margin-bottom: 0;
    padding: 20px;
    background: var(--task-bg);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 var(--shadow-light);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 20px;
    pointer-events: none;
}

.completed-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--task-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    z-index: 2;
}

.completed-btn:active {
    transform: scale(0.95);
    border-radius: 50%;
}

.completed-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.completed-btn::after {
    content: '✓';
    font-size: 14px;
    color: var(--primary-color);
    font-weight: bold;
}

h1 {
    font-weight: 600;
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

h1:active {
    transform: scale(0.98);
}

.date {
    font-size: 14px;
    opacity: 0.8;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.date:active {
    transform: scale(0.98);
}

/* 壁纸显示模式 */
body.wallpaper-mode .container > *:not(.header) {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.wallpaper-mode .header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.5s ease;
}

body.wallpaper-mode .header h1,
body.wallpaper-mode .header .date,
body.wallpaper-mode .completed-btn {
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

/* 壁纸模式下关闭背景虚化 */
body.wallpaper-mode::before {
    filter: blur(0px);
    transition: filter 0.5s ease;
}

/* 退出壁纸模式时的过渡状态 */
body.exiting-wallpaper-mode .container > *:not(.header) {
    opacity: 0;
    pointer-events: none;
}

/* 确认模态框 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 20px;
}

.confirm-content {
    background: var(--task-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 20px;
    line-height: 1.4;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.confirm-btn.confirm {
    background: #FF3B30;
    color: white;
}

.confirm-btn:active {
    transform: scale(0.95);
}

/* 首次使用提示模态框 */
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.welcome-content {
    background: var(--task-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 360px;
    width: 100%;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 20px 80px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 var(--shadow-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.welcome-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%);
    border-radius: 24px;
    pointer-events: none;
}

.welcome-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.welcome-message {
    font-size: 16px;
    color: var(--text-color);
    opacity: 0.85;
    margin-bottom: 28px;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.welcome-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 1.6);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    background: var(--primary-color);
    color: white;
    box-shadow: 
        0 8px 24px rgba(0, 122, 255, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.welcome-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
    border-radius: 16px;
    pointer-events: none;
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 32px rgba(0, 122, 255, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.15);
}

.welcome-btn:active {
    transform: translateY(0) scale(0.98);
}

/* 任务列表容器 */
.scroll-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 10px 0 90px 0; /* 底部内边距90px，超过加号按钮顶部(76px)，避免内容被遮挡 */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    position: relative;
}

.scroll-wrapper::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* 任务项样式 */
.todo-list {
    list-style: none;
    padding: 0 20px;
}

.todo-item {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--task-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 1.6);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 var(--shadow-light);
    overflow: hidden;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    min-height: 56px;
}

.todo-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.todo-item.drag-over {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 拖放目标位置指示线 */
.drop-indicator {
    height: 3px;
    background: #FF3B30;
    margin: 2px 0;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.5);
}

.drop-indicator.active {
    opacity: 1;
}

.todo-item:active {
    transform: scale(0.98);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
}

.todo-item-content {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 2;
}

.todo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 16px;
    pointer-events: none;
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 var(--shadow-light);
}

.todo-item.swiping {
    transition: transform 0.1s ease-out;
}

.todo-item .task-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
    width: 100%;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: -120px;
    height: 100%;
    display: flex;
    transition: right 0.3s ease;
    z-index: 10;
}

.swipe-action {
    width: 60px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.swipe-action:active {
    filter: brightness(0.9);
    transform: scale(0.95);
}

.swipe-action.complete {
    background: #34C759;
}

.swipe-action.delete {
    background: #FF3B30;
}

.swipe-action:hover {
    filter: brightness(1.1);
}

/* 颜色标记系统 */
.color-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-palette {
    display: none;
    position: fixed;
    background: var(--task-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    z-index: 1000;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 圆形加号按钮样式 */
.add-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #FF6B35;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 1.6);
    box-shadow: 
        0 8px 32px rgba(255, 107, 53, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    z-index: 100;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
}

.add-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    border-radius: 50%;
    pointer-events: none;
}

.add-button:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 
        0 12px 40px rgba(255, 107, 53, 0.5),
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.add-button:active {
    transform: translateX(-50%) scale(0.95);
}

.add-button.hidden {
    opacity: 0;
    transform: translateX(-50%) scale(0.8);
    pointer-events: none;
}

.plus-icon {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    line-height: 1;
    position: relative;
    z-index: 2;
}

/* 输入框样式 - 从左到右展开动画 */
.input-box {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 56px;
    background: var(--input-bg);
    border-radius: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 var(--shadow-light);
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
    z-index: 101;
    transition: all 0.3s ease;
    
    /* 默认隐藏状态 - 从左边开始，宽度为0 */
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.input-box.show {
    width: calc(100vw - 40px);
    opacity: 1;
    pointer-events: all;
    transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 1.6), 
                opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 1.6),
                height 0.3s ease;
}

.input-box textarea {
    flex: 1;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-color);
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    resize: none;
    line-height: 1.5;
    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.input-box textarea::placeholder {
    color: rgba(29, 29, 31, 0.6);
}

/* 取消按钮 */
.cancel-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-color);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.8);
    align-self: flex-start;
    margin-top: -4px;
}

.input-box.show .cancel-button {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.3s;
}

.cancel-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cancel-button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* 壁纸模式下隐藏加号按钮和输入框 */
body.wallpaper-mode .add-button,
body.wallpaper-mode .input-box {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* 技术支持标签样式 */
.tech-support {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tech-support:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.tech-support:active {
    transform: translateX(-50%) scale(0.95);
}

/* 壁纸模式下显示技术支持标签 */
body.wallpaper-mode .tech-support {
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.5s ease 0.3s; /* 延迟0.3s显示 */
}

/* 数据同步模态框样式 */
.sync-modal {
    z-index: 1300;
}

.sync-content {
    padding: 8px 0;
}

.auto-sync-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auto-sync-options {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.radio-option:active {
    transform: scale(0.98);
}

.radio-option input[type="radio"] {
    margin: 0;
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.radio-option .radio-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: var(--primary-color);
}

/* 添加提示文本 */
.auto-sync-section::after {
    content: "提示：再次点击已选中的选项可以取消自动同步";
    display: block;
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.6;
    text-align: center;
    margin-top: 8px;
}

.phone-input-section {
    margin-bottom: 24px;
}

.phone-input-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

.phone-input-section input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 16px;
    color: var(--text-color);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-align: center;
}

.phone-input-section input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.phone-input-section input::placeholder {
    color: rgba(29, 29, 31, 0.6);
}

.sync-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.sync-btn {
    flex: 1;
    padding: 16px 12px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.sync-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 16px;
    pointer-events: none;
}

.sync-btn .sync-icon {
    font-size: 20px;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.sync-btn span:last-child {
    position: relative;
    z-index: 2;
}

.upload-btn {
    background: #34C759;
    color: white;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

.download-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.sync-btn:hover {
    transform: translateY(-2px);
}

.sync-btn:active {
    transform: translateY(0) scale(0.98);
}

.sync-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sync-status {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.status-label {
    color: var(--text-color);
    opacity: 0.8;
}

.status-time {
    color: var(--primary-color);
    font-weight: 500;
}

.sync-progress {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
    transition: color 0.3s ease;
}

/* 结果状态样式 */
.sync-progress.result-success .progress-text {
    color: #34C759;
    font-weight: 500;
}

.sync-progress.result-error .progress-text {
    color: #FF3B30;
    font-weight: 500;
}

.sync-progress.result-info .progress-text {
    color: var(--primary-color);
    font-weight: 500;
}

/* 壁纸模式下隐藏同步模态框 */
body.wallpaper-mode .sync-modal {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.task-detail {
    z-index: 1200;
}

.modal-content {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    width: calc(100% - 40px);
    max-width: 500px;
    max-height: 80%;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.modal-header-left {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.edit-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.3);
    color: #007AFF;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.edit-btn:active {
    background: rgba(0, 122, 255, 0.2);
    transform: scale(0.95);
}

.edit-btn:hover {
    background: rgba(0, 122, 255, 0.15);
}

.modal-edit {
    margin-top: 16px;
}

.modal-edit textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.modal-edit textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.modal-edit textarea::placeholder {
    color: rgba(29, 29, 31, 0.6);
}

.edit-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.edit-btn-action {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.edit-btn-action.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.edit-btn-action.save {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.edit-btn-action:active {
    transform: scale(0.95);
}

.edit-btn-action.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.edit-btn-action.save:hover {
    background: #0056CC;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.clear-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #FF3B30;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.clear-btn:active {
    background: rgba(255, 59, 48, 0.2);
    transform: scale(0.95);
}

.clear-btn::after {
    content: '🗑️';
}

.close-btn {
    position: absolute;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-color);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.close-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
    border-radius: 50%;
}

.modal-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    word-wrap: break-word;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.modal-text:hover {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.01);
}

.modal-text:active {
    background: rgba(0, 122, 255, 0.2);
    transform: scale(0.99);
}

.completed-list {
    list-style: none;
    padding: 0 24px;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.completed-list::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.completed-item {
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.completed-item:active {
    transform: scale(0.98);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
}

.completed-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border-radius: 16px;
    pointer-events: none;
}

.completed-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.completed-item.swiping {
    transition: transform 0.1s ease-out;
}

.completed-item .task-text {
    flex: 1;
    text-decoration: line-through;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    line-height: 1.4;
    position: relative;
    z-index: 1;
    width: 100%;
}

.completed-item .color-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    opacity: 0.7;
}

.completed-item .swipe-actions {
    position: absolute;
    top: 0;
    right: -60px;
    height: 100%;
    display: flex;
    transition: right 0.3s ease;
    z-index: 10;
}

.completed-item .swipe-action.restore {
    background: #007AFF;
    width: 60px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.completed-item .swipe-action.restore:active {
    filter: brightness(0.9);
    transform: scale(0.95);
}