        :root { --primary: #007bff; --primary-hover: #0056b3; --bg: #f4f7f6; --card: #fff; --text: #333; --border: #e2e8f0; }
        body { font-family: system-ui, -apple-system, sans-serif; margin: 0; padding: 0; background: var(--bg); color: var(--text); }
        .container { max-width: 900px; margin: 0 auto; padding: 20px; }
        
        /* --- 登录视图 --- */
        #login-view { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 80vh; }
        .login-box { background: var(--card); padding: 40px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: center; }
        .login-box input { width: 250px; padding: 12px 15px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; outline: none; transition: 0.2s; box-sizing: border-box; }
        .login-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,123,255,0.1); }
        .btn { padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 500; transition: 0.2s; }
        .btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

        /* --- 主界面布局 --- */
        #app-view { display: none; }
        .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
        .header h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 22px; }
        
        /* 上传区 */
        .upload-card { background: var(--card); border-radius: 16px; padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); margin-bottom: 20px; }
        .upload-area { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.3s ease; background: #f8fafc; position: relative; overflow: hidden; }
        .upload-area:hover, .upload-area.dragover { border-color: var(--primary); background: #f0f8ff; }
        .upload-text { margin: 0; font-size: 16px; color: #64748b; line-height: 1.6; }
        
        /* 设置策略区 */
        .settings-row { margin-top: 15px; text-align: center; display: flex; justify-content: center; }
        .checkbox-wrapper { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; background: #f8fafc; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); transition: all 0.2s ease; }
        .checkbox-wrapper:hover { border-color: var(--primary); background: #f0f8ff; }
        .checkbox-wrapper input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 2px solid #cbd5e1; border-radius: 4px; background-color: white; cursor: pointer; position: relative; transition: all 0.2s ease; margin: 0; flex-shrink: 0; }
        .checkbox-wrapper input[type="checkbox"]:focus { outline: none; border-color: var(--primary); }
        .checkbox-wrapper input[type="checkbox"]:checked { background-color: var(--primary); border-color: var(--primary); }
        .checkbox-wrapper input[type="checkbox"]:checked::after { content: ''; position: absolute; top: 1px; left: 5px; width: 4px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
        .checkbox-text { font-size: 14px; color: #475569; font-weight: 500; }

        /* 进度条与任务面板 */
        .progress-wrapper { width: 100%; height: 6px; background: #e2e8f0; border-radius: 6px; margin-top: 15px; overflow: hidden; display: none; }
        .progress-bar { height: 100%; width: 0%; background: var(--primary); transition: width 0.2s ease, background-color 0.3s; }
        .task-board { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 14px; display: none; background: #f8fafc; padding: 10px 15px; border-radius: 8px; }
        .task-status { color: #64748b; font-weight: 500; }
        .task-actions { display: flex; gap: 8px; }
        .task-btn { padding: 6px 12px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; transition: 0.2s; color: white; }
        .btn-cancel { background: #ef4444; } .btn-cancel:hover { background: #dc2626; }
        .btn-retry { background: #10b981; } .btn-retry:hover { background: #059669; }

        /* --- 画廊与工具栏 --- */
        .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; position: sticky; top: 10px; z-index: 100; }
        .filter-group { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px); padding: 6px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid rgba(255,255,255,0.5); flex-wrap: wrap;}
        
        .filter-btn { height: 36px; padding: 0 14px; background: transparent; border: none; border-radius: 6px; cursor: pointer; color: #64748b; font-weight: 500; font-size: 14px; transition: 0.2s; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
        .filter-btn.active { background: #f1f5f9; color: var(--primary); }
        .filter-btn.star.active { color: #eab308; background: #fefce8; }
        
        .month-select { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; outline: none; color: #333; font-family: inherit; background: #fff; cursor: pointer; font-size: 14px; min-width: 120px; transition: 0.2s; box-sizing: border-box; }
        .month-select:focus { border-color: var(--primary); }
        
        .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; min-height: 100px; }
        .empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #94a3b8; font-size: 15px; background: var(--card); border-radius: 12px; border: 2px dashed var(--border); line-height: 1.8;}
        
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
        
        .img-card { 
            position: relative; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.04); aspect-ratio: 1; transition: transform 0.2s; cursor: pointer;
            background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 400% 100%; animation: fadeIn 0.4s ease forwards, shimmer 1.5s infinite linear;
        }
        .img-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
        .img-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; opacity: 0; transition: opacity 0.4s ease-in-out; }
        .img-card img.loaded { opacity: 1; }
        .img-card:has(img.loaded) {
            animation: none;
            /* 经典的灰白棋盘格背景 */
            background-color: #fff;
            background-image: 
                linear-gradient(45deg, #f4f7f6 25%, transparent 25%, transparent 75%, #f4f7f6 75%, #f4f7f6), 
                linear-gradient(45deg, #f4f7f6 25%, transparent 25%, transparent 75%, #f4f7f6 75%, #f4f7f6);
            background-size: 20px 20px;
            background-position: 0 0, 10px 10px;
        }
        
        /* 🌟 星标 UI 组件 */
        .star-badge { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; background: rgba(0,0,0,0.4); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; opacity: 0; transition: all 0.2s ease; backdrop-filter: blur(4px); z-index: 10; border: 1px solid rgba(255,255,255,0.2); }
        .star-badge:hover { transform: scale(1.15); background: rgba(0,0,0,0.6); }
        .star-badge.active { opacity: 1; background: rgba(250, 204, 21, 0.9); border-color: #facc15; box-shadow: 0 2px 8px rgba(250, 204, 21, 0.4); }
        @media (hover: hover) { .img-card:hover .star-badge { opacity: 1; } }
        .img-card.touch-active .star-badge { opacity: 1; }

        /* 🏷️ 格式提示标签 (左下角) */
        .format-badge { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 4px; backdrop-filter: blur(4px); z-index: 5; pointer-events: none; letter-spacing: 0.5px; border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: opacity 0.2s; }
        
        /* 📦 尺寸提示标签 (右下角) */
        .size-badge { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; font-weight: 500; padding: 3px 6px; border-radius: 4px; backdrop-filter: blur(4px); z-index: 5; pointer-events: none; letter-spacing: 0.5px; border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: opacity 0.2s; }

        .img-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.75); display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; gap: 12px; backdrop-filter: blur(2px); z-index: 8; }
        @media (hover: hover) { .img-card:hover .img-overlay { opacity: 1; pointer-events: auto; } }
        .img-card.touch-active .img-overlay { opacity: 1; pointer-events: auto; }
        
        .action-row { display: flex; gap: 8px; justify-content: center; width: 100%; flex-wrap: wrap; padding: 0 10px; box-sizing: border-box;}
        .icon-btn { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; transition: 0.2s; }
        .icon-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }
        .icon-btn.primary { background: var(--primary); border-color: var(--primary); }
        .icon-btn.primary:hover { background: var(--primary-hover); }
        .icon-btn.del { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
        .icon-btn.del:hover { background: #ef4444; color: white; border-color: #ef4444; }
        
        #load-more { width: 100%; margin-top: 24px; padding: 14px; background: var(--card); color: var(--primary); border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; display: none; font-size: 16px; font-weight: bold; transition: 0.2s; }
        #load-more:hover { background: #f8fafc; border-color: var(--primary); }

        /* --- 📱 移动端专项优化 --- */
        @media (max-width: 600px) {
            .container { padding: 15px; }
            .header h2 { font-size: 18px; }
            .upload-area { padding: 30px 15px; }
            .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .action-row { gap: 6px; padding: 0 5px; }
            .icon-btn { font-size: 12px; padding: 5px 8px; }
            .checkbox-text { font-size: 12px; }
            .filter-group { width: 100%; justify-content: space-between; }
        }

        /* --- 全局 Toast --- */
        #global-toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(100px); background: rgba(30, 41, 59, 0.95); color: #fff; padding: 12px 24px; border-radius: 30px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 100000; font-size: 14px; pointer-events: none; text-align: center; backdrop-filter: blur(8px); white-space: nowrap;}
        #global-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

        /* --- 原生手势灯箱 --- */
        #lightbox { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); z-index: 9999; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; backdrop-filter: blur(5px); overflow: hidden; touch-action: none; }
        #lightbox.show { opacity: 1; }
        #lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); object-fit: contain; cursor: grab; user-select: none; -webkit-user-drag: none; opacity: 0; transition: opacity 0.3s, transform 0.2s; }
        #lightbox img.loaded { opacity: 1; }
        #lightbox img:active { cursor: grabbing; }
        .close-lb { position: fixed; top: 20px; right: 30px; color: rgba(255,255,255,0.7); font-size: 40px; cursor: pointer; user-select: none; transition: 0.2s; z-index: 10000; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
        .close-lb:hover { color: #fff; transform: scale(1.1); }