/* ===== CSS 变量：清新活力风配色 ===== */
:root {
    /* 主色调 - 清新渐变 */
    --primary: #7C5CFC;
    --primary-light: #9B82FF;
    --gradient-primary: linear-gradient(135deg, #7C5CFC 0%, #9B82FF 100%);
    --gradient-warm: linear-gradient(135deg, #FF9A8B 0%, #FF6B9D 100%);
    --gradient-sun: linear-gradient(135deg, #FFD89B 0%, #FFB347 100%);
    --gradient-ocean: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-mint: linear-gradient(135deg, #A8EDEA 0%, #6FE3D5 100%);
    --gradient-peach: linear-gradient(135deg, #FFECD2 0%, #FCB69F 100%);
    
    /* 统计卡片渐变 */
    --stat-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --stat-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --stat-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --stat-gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    
    /* 图标背景色 */
    --icon-purple: linear-gradient(135deg, #C5A8FF 0%, #7C5CFC 100%);
    --icon-pink: linear-gradient(135deg, #FFB3D1 0%, #FF6B9D 100%);
    --icon-green: linear-gradient(135deg, #A8F0CE 0%, #36D399 100%);
    --icon-orange: linear-gradient(135deg, #FFD89B 0%, #FF9B57 100%);
    --icon-blue: linear-gradient(135deg, #A0D8FF 0%, #5B9CF6 100%);
    --icon-cyan: linear-gradient(135deg, #A8EDEA 0%, #22D3EE 100%);
    --icon-red: linear-gradient(135deg, #FFB3B3 0%, #FF6B6B 100%);
    --icon-gray: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%);
    
    /* 优先级颜色 */
    --priority-high: #FF6B6B;
    --priority-medium: #FFB347;
    --priority-low: #36D399;
    
    /* 中性色 */
    --bg-primary: #F7F8FC;
    --bg-card: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --border: #E2E8F0;
    --shadow-sm: 0 2px 8px rgba(124, 92, 252, 0.08);
    --shadow-md: 0 4px 16px rgba(124, 92, 252, 0.12);
    --shadow-lg: 0 8px 32px rgba(124, 92, 252, 0.16);
    
    /* 尺寸 */
    --header-height: 80px;
    --nav-height: 70px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

input {
    font-family: inherit;
    outline: none;
    border: none;
}

svg {
    width: 100%;
    height: 100%;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== 状态栏占位 ===== */
.status-bar {
    height: env(safe-area-inset-top, 0px);
    background: transparent;
}

/* ===== 主容器 ===== */
.app-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - env(safe-area-inset-top, 0px));
    max-width: 768px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-primary);
}

/* ===== 顶部头部 ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    background: var(--bg-primary);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.greeting {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.sub-greeting {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all 0.2s ease;
}

.icon-btn:active {
    transform: scale(0.92);
    box-shadow: none;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #FF6B6B;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== 可滚动内容区 ===== */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 0;
}

.content-area::-webkit-scrollbar {
    width: 0;
    display: none;
}

/* ===== 通用 Section ===== */
.section {
    padding: 16px 20px 8px;
}

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

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--gradient-primary);
}

.more-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.more-btn svg {
    width: 16px;
    height: 16px;
}

.more-btn:active {
    background: rgba(124, 92, 252, 0.08);
    color: var(--primary);
}

/* ===== 快捷入口网格 ===== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 4px;
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    border-radius: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.quick-item:active {
    transform: scale(0.95);
    background: rgba(124, 92, 252, 0.06);
}

/* ===== 编辑模式 ===== */
.quick-grid.editing .quick-item {
    animation: jiggle 0.4s ease-in-out infinite alternate;
    animation-delay: calc(var(--i, 0) * 0.08s);
}

.quick-grid.editing .quick-item:active {
    animation: none;
}

@keyframes jiggle {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(2deg); }
}

/* 删除徽标 */
.quick-delete-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FF6B6B;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    z-index: 2;
    border: 2px solid #fff;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.quick-grid.editing .quick-delete-badge {
    opacity: 1;
    transform: scale(1);
}

.quick-delete-badge svg {
    width: 10px;
    height: 10px;
    color: #fff;
    stroke-width: 3;
}

.quick-item {
    position: relative;
}

/* 添加入口按钮 */
.quick-add-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
}

.quick-grid.editing .quick-add-tile {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

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

.quick-add-tile:active {
    transform: scale(0.95);
}

.quick-add-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 2px dashed var(--primary-light);
    background: rgba(124, 92, 252, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-add-icon svg {
    width: 26px;
    height: 26px;
    color: var(--primary-light);
}

.quick-add-tile span {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-light);
}

/* 编辑按钮激活态 */
#editQuickBtn.editing .edit-label {
    color: var(--primary);
    font-weight: 700;
}

.quick-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.quick-item:active .quick-icon {
    box-shadow: none;
}

.quick-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.icon-purple { background: var(--icon-purple); }
.icon-pink { background: var(--icon-pink); }
.icon-green { background: var(--icon-green); }
.icon-orange { background: var(--icon-orange); }
.icon-blue { background: var(--icon-blue); }
.icon-cyan { background: var(--icon-cyan); }
.icon-red { background: var(--icon-red); }
.icon-gray { background: var(--icon-gray); }

.quick-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    padding: 16px;
    border-radius: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.stat-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.stat-card-gradient-1 { background: var(--stat-gradient-1); }
.stat-card-gradient-2 { background: var(--stat-gradient-2); }
.stat-card-gradient-3 { background: var(--stat-gradient-3); }
.stat-card-gradient-4 { background: var(--stat-gradient-4); }

.stat-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
}

.stat-icon-wrap svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

.stat-trend {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-trend.up {
    background: rgba(255, 255, 255, 0.25);
}

.stat-trend.down {
    background: rgba(255, 255, 255, 0.2);
    opacity: 0.9;
}

/* ===== 图表卡片 ===== */
.chart-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 160px;
    gap: 8px;
    padding-bottom: 8px;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar-wrapper {
    width: 100%;
    max-width: 28px;
    height: 120px;
    background: rgba(124, 92, 252, 0.08);
    border-radius: 14px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    background: var(--gradient-primary);
    border-radius: 14px;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: barGrow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes barGrow {
    from { height: 0 !important; }
}

.chart-bar-item.today .bar-fill {
    background: var(--gradient-warm);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.chart-bar-item.today .bar-label {
    color: var(--primary);
    font-weight: 700;
}

.bar-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient-primary);
}

.chart-legend span:last-child {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== 待办列表 ===== */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.todo-item:active {
    transform: scale(0.98);
}

.todo-item.completed {
    opacity: 0.7;
}

.todo-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: #fff;
}

.todo-item.completed .todo-checkbox {
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.4);
}

.todo-checkbox svg {
    width: 14px;
    height: 14px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.todo-item.completed .todo-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.todo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.todo-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-all;
    transition: all 0.2s ease;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.todo-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.todo-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.todo-date svg {
    width: 12px;
    height: 12px;
}

.priority-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.priority-tag.high {
    background: rgba(255, 107, 107, 0.12);
    color: var(--priority-high);
}

.priority-tag.medium {
    background: rgba(255, 179, 71, 0.15);
    color: var(--priority-medium);
}

.priority-tag.low {
    background: rgba(54, 211, 153, 0.15);
    color: var(--priority-low);
}

.priority-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.priority-tag.high::before { background: var(--priority-high); }
.priority-tag.medium::before { background: var(--priority-medium); }
.priority-tag.low::before { background: var(--priority-low); }

.todo-delete {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateX(8px);
}

.todo-item:hover .todo-delete,
.todo-item:active .todo-delete {
    opacity: 1;
    transform: translateX(0);
}

.todo-delete:active {
    background: rgba(255, 107, 107, 0.1);
    color: var(--priority-high);
}

.todo-delete svg {
    width: 18px;
    height: 18px;
}

/* ===== 空状态 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: rgba(124, 92, 252, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--primary-light);
}

.empty-state p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state span {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ===== 底部安全距离 ===== */
.bottom-safe {
    height: calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

/* ===== 底部导航栏 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 768px;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.06);
    z-index: 50;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 0;
    color: var(--text-tertiary);
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    transition: all 0.25s ease;
}

.nav-item span {
    font-size: 11px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    transform: scale(1.1);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.nav-add-btn {
    flex: 0 0 20%;
    position: relative;
}

.add-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
    margin-top: -24px;
    transition: all 0.25s ease;
}

.add-circle svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.nav-add-btn:active .add-circle {
    transform: scale(0.9);
    box-shadow: 0 3px 12px rgba(255, 107, 157, 0.4);
}

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 768px;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding-bottom: var(--safe-bottom);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.modal-close:active {
    background: rgba(124, 92, 252, 0.08);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    background: var(--bg-primary);
    font-size: 15px;
    color: var(--text-primary);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.form-group input[type="text"]::placeholder {
    color: var(--text-tertiary);
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus {
    border-color: var(--primary-light);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.1);
}

.priority-options {
    display: flex;
    gap: 10px;
}

.priority-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.priority-option span:last-child {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.priority-option:active {
    transform: scale(0.97);
}

.priority-option.active {
    background: var(--bg-card);
}

.priority-option[data-priority="high"].active {
    border-color: var(--priority-high);
    background: rgba(255, 107, 107, 0.08);
}

.priority-option[data-priority="high"].active span:last-child {
    color: var(--priority-high);
}

.priority-option[data-priority="medium"].active {
    border-color: var(--priority-medium);
    background: rgba(255, 179, 71, 0.08);
}

.priority-option[data-priority="medium"].active span:last-child {
    color: var(--priority-medium);
}

.priority-option[data-priority="low"].active {
    border-color: var(--priority-low);
    background: rgba(54, 211, 153, 0.08);
}

.priority-option[data-priority="low"].active span:last-child {
    color: var(--priority-low);
}

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.priority-dot.priority-high { background: var(--priority-high); }
.priority-dot.priority-medium { background: var(--priority-medium); }
.priority-dot.priority-low { background: var(--priority-low); }

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border);
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s ease;
}

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

.btn-cancel:active {
    transform: scale(0.97);
    background: var(--border);
}

.btn-confirm {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-confirm:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

/* ===== 应用选择弹窗 ===== */
.modal-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    font-weight: 500;
}

.app-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 8px;
}

.app-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.app-picker-item:active {
    transform: scale(0.95);
    background: rgba(124, 92, 252, 0.06);
}

.app-picker-item.added {
    opacity: 0.4;
    pointer-events: none;
}

.app-picker-item.added::after {
    content: '已添加';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.app-picker-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.app-picker-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.app-picker-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== 安装到桌面提示条 ===== */
.install-prompt {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    width: calc(100% - 32px);
    max-width: 736px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 60;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.install-prompt.show {
    transform: translateX(-50%) translateY(0);
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 14px 16px;
}

.install-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.install-text {
    flex: 1;
    min-width: 0;
}

.install-text p {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.install-text span {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.install-btn {
    padding: 8px 18px;
    border-radius: 10px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.install-btn:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-sm);
}

.install-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.install-close:active {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.install-close svg {
    width: 16px;
    height: 16px;
}

/* iOS Safari 手动添加引导 */
.ios-install-guide {
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    z-index: 150;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ios-install-guide.show {
    opacity: 1;
    visibility: visible;
}

.ios-install-content {
    margin-top: 40px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px 20px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: slideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.ios-install-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.ios-install-steps {
    text-align: left;
    margin-bottom: 20px;
}

.ios-install-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ios-install-step:last-child {
    margin-bottom: 0;
}

.ios-install-step .step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-install-step .step-text {
    flex: 1;
}

.ios-install-step .step-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.ios-install-close {
    padding: 12px 32px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.92);
    color: #fff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== 动画 ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.todo-item {
    animation: slideIn 0.3s ease;
}

/* ===== 响应式 - 更大屏幕适配 ===== */
@media (min-width: 480px) {
    .quick-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px 8px;
    }
    
    .quick-icon {
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .section {
        padding: 16px 24px 8px;
    }
    
    .app-header {
        padding: 16px 24px 12px;
    }
}
