:root {
    /* Light mode variables */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --accent-primary: #007bff;
    --accent-secondary: #28a745;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 2px 8px var(--shadow-color);
    --progress-bg: #e9ecef;
    --success-bg: #d4edda;
    --success-border: #c3e6cb;
    --option-bg: #f8f9fa;
    --option-active: #e3f2fd;
    --badge-bg: #007bff;
    --size-badge: #e9ecef;
    --error: #dc3545;
    --privacy-btn: #6c757d;
}

[data-theme="dark"] {
    /* Dark mode variables */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-primary: #0d6efd;
    --accent-secondary: #198754;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --progress-bg: #404040;
    --success-bg: #1e4d2b;
    --success-border: #2d5a3a;
    --option-bg: #2d2d2d;
    --option-active: #1e3a5f;
    --badge-bg: #0d6efd;
    --size-badge: #2d2d2d;
    --error: #dc3545;
    --privacy-btn: #b0b0b0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Disable text selection everywhere except explicit inputs */
body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input, textarea, .rename-input, .allow-select {
    -webkit-user-select: text;
    user-select: text;
}

.rename-input {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--accent-primary) !important;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 13px;
    width: 100%;
    outline: none;
}

.rename-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

body {
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    overflow: hidden;
}

/* Windows-style header */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    box-shadow: 0 1px 3px var(--shadow-color);
}

.app-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transform: translateY(1px);
}

.header-controls {
    display: flex;
    gap: 8px;
}

.header-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
    min-width: 60px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: var(--option-bg);
    color: var(--text-primary);
}

/* Main application layout - Three columns */
.app-container {
    display: flex;
    height: calc(100vh - 48px);
}

/* Left panel - Image selection */
.left-panel {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Center panel - 仅受左侧/右侧外线影响，内部中间两条线调节不改变最右侧面板 */
.center-panel {
    flex: 1;
    min-width: 0;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Bottom resizer for center panel */
.bottom-resizer {
    height: 6px;
    background: transparent;
    cursor: row-resize;
    transition: background-color 0.2s;
}

.bottom-resizer:hover {
    background: var(--accent-primary);
    opacity: 0.3;
}

.bottom-resizer.active {
    background: var(--accent-primary);
    opacity: 0.5;
}

.bottom-resizer::after {
    content: '';
    display: block;
    margin: 0 auto;
    width: 40px;
    height: 2px;
    background: var(--border-color);
    border-radius: 1px;
    transform: translateY(2px);
}

.bottom-resizer:hover::after {
    background: var(--accent-primary);
}

/* Right panel - 仅由「底部与最右之间」的竖线（right-resizer）调节，中间两条线不带动 */
.right-panel {
    width: 280px;
    flex-shrink: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Resizable dividers */
.resizer {
    position: absolute;
    right: -3px;
    top: 0;
    width: 6px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    z-index: 100;
    transition: background-color 0.2s;
}

.resizer:hover {
    background: var(--accent-primary);
    opacity: 0.3;
}

.resizer.active {
    background: var(--accent-primary);
    opacity: 0.5;
}

.resizer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: var(--border-color);
    border-radius: 1px;
}

.resizer:hover::after {
    background: var(--accent-primary);
}

/* Right panel resizer */
.right-resizer {
    position: absolute;
    left: -3px;
    top: 0;
    width: 6px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    z-index: 100;
    transition: background-color 0.2s;
}

.right-resizer:hover {
    background: var(--accent-primary);
    opacity: 0.3;
}

.right-resizer.active {
    background: var(--accent-primary);
    opacity: 0.5;
}

.right-resizer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: var(--border-color);
    border-radius: 1px;
}

.right-resizer:hover::after {
    background: var(--accent-primary);
}

/* Panel headers */
.panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Add images button */
.add-images-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.add-images-btn:hover {
    background: #0056b3;
}

.add-images-btn svg {
    width: 16px;
    height: 16px;
}

/* Compress all button in left panel */
.compress-all-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 8px;
}

.compress-all-btn:hover {
    background: #1e7e34;
}

.compress-all-btn svg {
    width: 16px;
    height: 16px;
}



/* Image list */
.image-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.image-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.image-item:hover {
    background: var(--option-bg);
    border-color: var(--accent-primary);
}

.image-item.selected {
    background: var(--option-active);
    border-color: var(--accent-primary);
}

.image-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 12px;
}

.image-info {
    flex: 1;
    min-width: 0;
}

.image-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.image-status {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--progress-bg);
    margin-left: 8px;
}

.image-status.compressing {
    background: var(--accent-primary);
    animation: pulse 1.5s infinite;
}

.image-status.completed {
    background: var(--accent-secondary);
}

.image-status.failed {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Center panel content */
.center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* Card stack container */
.card-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    perspective-origin: center center;
}

/* Individual card */
.card {
    position: absolute;
    width: min(80%, 900px);
    height: min(70%, 600px);
    left: 50%;
    top: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 32px var(--shadow-color);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    overflow: hidden;
    transform: translate(-50%, -50%) translateY(0px) scale(1) rotateX(0deg);
}

.card:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-color);
    z-index: 10;
}

.card.active { 
    z-index: 20; 
    box-shadow: 0 24px 48px var(--shadow-color);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg-tertiary);
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 12px;
}

/* Bottom area - 中间两条竖线只在此区域内部分配宽度，不影响最右侧面板 */
.bottom-area {
    min-height: 120px;
    height: 140px;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 12px;
}

/* 桌面端底部：双槽位 + 中间可左右调节分割线（仅左右分配，不撑开整体、不带动最右侧面板） */
.desktop-slots-wrapper {
    display: flex;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.desktop-slot {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
}
.desktop-slot-inner {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden; /* 防止分界线拖过头时左右卡片重叠 */
}
.desktop-slot-left {
    flex-shrink: 0;
    width: 220px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 8px;
    overflow: hidden;
}
.desktop-slot-right {
    flex: 1;
    min-width: 356px; /* 与 MIN_SLOT_LIST_WIDTH_PX 一致，左+4+右可放入槽位最小宽 */
    overflow: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.desktop-slot-resizer {
    width: 6px;
    flex-shrink: 0;
    cursor: col-resize;
    background: var(--border-color);
}
.desktop-slot-resizer:hover,
.desktop-slot-resizer.active { background: var(--accent-primary); }
.desktop-slot-resizer-inner {
    width: 4px;
    flex-shrink: 0;
    cursor: col-resize;
    background: transparent;
}
.desktop-slot-resizer-inner:hover,
.desktop-slot-resizer-inner.active { background: var(--accent-primary); }
.desktop-clear-all-btn {
    margin-top: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}
.desktop-clear-all-btn:hover {
    background: var(--option-bg);
    color: var(--text-primary);
}
.desktop-max-slots-toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 10020;
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.desktop-max-slots-toast.show {
    opacity: 1;
}
.desktop-slot-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 桌面端底部配置区：左侧参数 + 右侧队列列表（兼容旧类名） */
.desktop-bottom-config {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 16px;
    margin-bottom: 8px;
}
.desktop-bottom-left {
    flex-shrink: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: flex-start;
}
.desktop-bottom-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.desktop-bottom-label span {
    color: var(--text-primary);
    font-weight: 500;
}
.desktop-range {
    width: 100%;
    margin: 0 0 4px 0;
}
.desktop-unified-label {
    font-size: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    cursor: pointer;
}
.desktop-unified-label input {
    cursor: pointer;
}
.desktop-start-compress-btn {
    margin-top: 8px;
    padding: 8px 14px;
    background: var(--accent-secondary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.desktop-start-compress-btn:hover {
    background: #1e7e34;
}
.desktop-start-compress-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.desktop-bottom-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.desktop-bottom-progress-bar {
    height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}
.desktop-bottom-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.2s ease;
}
.desktop-bottom-progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.desktop-bottom-right {
    flex: 1;
    min-width: 0;
    overflow: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.desktop-queue-list {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.desktop-queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-size: 12px;
    border: 2px solid transparent;
}
.desktop-queue-item:hover {
    border-color: var(--border-color);
    background: var(--option-bg);
}
.desktop-queue-item.selected {
    border-color: var(--accent-primary);
    background: var(--option-active);
}
.desktop-queue-item.selected:hover {
    border-color: var(--accent-primary);
}
.desktop-queue-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--border-color);
}
.desktop-queue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.desktop-queue-item .desktop-queue-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    color: var(--text-primary);
}
.desktop-queue-name-input {
    width: 100%;
    min-width: 80px;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    padding: 2px 6px;
    outline: none;
}
.desktop-queue-item .desktop-queue-size {
    font-size: 11px;
    color: var(--text-secondary);
}
.desktop-queue-item .desktop-queue-params {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 11px;
    text-align: right;
}
.desktop-queue-item .desktop-queue-check {
    color: var(--accent-secondary);
}

/* 底部队列区域右键自定义菜单 */
.desktop-context-menu {
    position: fixed;
    left: 0;
    top: 0;
    min-width: 120px;
    padding: 4px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 10001;
    display: none;
}
.desktop-context-menu.show {
    display: block;
}
.desktop-context-item {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    margin: 2px 6px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.desktop-context-item:hover {
    background: var(--option-bg);
    border-color: var(--border-color);
}

/* 桌面端：查看图片大弹窗 */
.desktop-view-image-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
}
.desktop-view-image-overlay.show {
    display: flex;
}
.desktop-view-image-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}
.desktop-view-image-box {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}
.desktop-view-image-name {
    align-self: flex-start;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    max-width: 60vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.desktop-view-image-name:hover {
    border-color: var(--border-color);
    background: var(--option-bg);
}
.desktop-view-image-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.desktop-view-image-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

/* 桌面端：修改重命名圆角弹窗（查看图片时右键名称），z-index 高于查看图片弹窗才能点住 */
.desktop-rename-dialog {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
.desktop-rename-dialog.show {
    display: flex;
    pointer-events: auto;
}
.desktop-rename-dialog-content {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    min-width: 320px;
    box-shadow: 0 10px 30px var(--shadow-color);
    pointer-events: auto;
}
.desktop-rename-dialog-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.desktop-rename-dialog-tip {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.desktop-rename-dialog-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.desktop-rename-dialog-input:focus {
    border-color: var(--accent-primary);
}
.desktop-rename-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}
.desktop-rename-dialog-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    background: var(--option-bg);
    color: var(--text-primary);
}
.desktop-rename-dialog-btn.primary {
    background: var(--accent-primary);
    color: #fff;
}

/* 桌面端单张图片参数弹窗 */
.desktop-per-image-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.desktop-per-image-dialog.show {
    display: flex;
}
.desktop-per-image-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    min-width: 280px;
    box-shadow: 0 10px 30px var(--shadow-color);
}
.desktop-per-image-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.desktop-per-image-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}
.desktop-per-image-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    background: var(--option-bg);
    color: var(--text-primary);
}
.desktop-per-image-btn.primary {
    background: var(--accent-primary);
    color: #fff;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    align-items: flex-start;
}
.download-options-folder {
    padding: 4px 10px;
    font-size: 12px;
    color: var(--accent-primary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}
.download-options-folder:hover {
    border-color: var(--accent-primary);
    background: var(--option-bg);
}
.download-options-checkbox-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.download-options-checkbox-label input {
    cursor: pointer;
}
.bottom-download-row {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 16px;
    margin-top: 8px;
    width: 100%;
}
.desktop-download-left {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}
.desktop-download-right {
    flex: 1;
    min-width: 0;
    overflow: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.desktop-download-list {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.desktop-download-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    font-size: 12px;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.desktop-download-list-item:hover {
    border-color: var(--border-color);
    background: var(--option-bg);
}
.desktop-download-list-item.download-selected {
    border-color: var(--accent-primary);
    background: var(--option-active);
}
.desktop-download-list-item.cursor-pointer {
    cursor: pointer;
}
.desktop-download-list-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--border-color);
}
.desktop-download-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.desktop-download-list-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.desktop-download-list-size {
    font-size: 11px;
    color: var(--text-secondary);
}
.download-all-btn {
    margin-top: 4px;
    padding: 10px 18px;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.download-all-btn:hover { background: #0056b3; }

.drop-zone {
    width: 100%;
    max-width: 500px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: var(--bg-tertiary);
    transition: all 0.2s;
    cursor: pointer;
}

.drop-zone.active {
    border-color: var(--accent-primary);
    background: var(--option-active);
}
.drop-zone.drop-forbidden {
    cursor: not-allowed;
    border-color: var(--error);
    background: rgba(220, 53, 69, 0.08);
}

.drop-zone-icon {
    width: 80px;
    height: 80px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.drop-zone-text {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-zone-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

.drop-zone-instruction {
    font-size: 12px;
    color: var(--accent-primary);
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

.compress-all-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--accent-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.compress-all-btn:hover {
    background: #1e7e34;
}

.compress-all-btn svg {
    width: 16px;
    height: 16px;
}

/* Compression results grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    overflow-y: auto;
}

.result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.result-item:hover {
    box-shadow: var(--card-shadow);
}

.result-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.result-info {
    padding: 12px;
}

.result-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-size {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn {
    background: var(--accent-primary);
    color: white;
}

.download-btn:hover {
    background: #0056b3;
}

.remove-btn {
    background: var(--error);
    color: white;
}

.remove-btn:hover {
    background: #c82333;
}

.retry-btn {
    background: var(--accent-secondary);
    color: white;
}

.retry-btn:hover {
    background: #1e7e34;
}

/* Right panel status */
.status-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.status-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
}

.status-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.status-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-icon.ready {
    background: var(--progress-bg);
}

.status-icon.compressing {
    background: var(--accent-primary);
    animation: pulse 1.5s infinite;
}

.status-icon.completed {
    background: var(--accent-secondary);
}

.status-icon.failed {
    background: var(--error);
}

.status-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.status-name:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.status-name.editing {
    background-color: rgba(255, 255, 255, 0.2);
    outline: 2px solid var(--accent-primary);
    white-space: normal;
    word-break: break-all;
}

.status-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.status-error {
    font-size: 12px;
    color: var(--error);
    margin-bottom: 8px;
}

.status-actions {
    display: flex;
    gap: 8px;
}

.status-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-btn.retry {
    background: var(--accent-secondary);
    color: white;
}

.status-btn.retry:hover {
    background: #1e7e34;
}

/* Progress bar */
.progress-container {
    padding: 16px;
    background: transparent;
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    height: 6px;
    background: var(--progress-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* File input */
.file-input {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
        height: 200px;
    }
    
    .center-panel {
        height: calc(100vh - 496px);
    }
}

/* 状态面板选中效果 */
.status-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-item:hover {
    background: var(--bg-tertiary);
}

.status-item.selected {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
}
.status-item.download-selected {
    border: 2px solid var(--accent-primary);
    background: var(--option-active);
}

/* 预览卡片样式 */
.preview-card {
    transition: all 0.3s ease;
}

.preview-card img {
    transition: all 0.3s ease;
}

/* Fullscreen styles */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: none;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.fullscreen-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 10001;
}

.fullscreen-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fullscreen-download {
    background: #4CAF50;
    color: white;
}

.fullscreen-download:hover {
    background: #45a049;
    transform: scale(1.1);
}

.fullscreen-delete {
    background: #f44336;
    color: white;
}

.fullscreen-delete:hover {
    background: #da190b;
    transform: scale(1.1);
}

.fullscreen-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 10001;
}

.fullscreen-navigation-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.8);
    padding: 16px 24px;
    border-radius: 12px;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.fullscreen-navigation-hint.show {
    opacity: 1;
} 

/* ======= 手机端简易 UI 样式，仅在 mobile 模式使用 ======= */
.mobile-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 12px;
}

.mobile-header {
    padding: 12px 4px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.mobile-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px var(--shadow-color);
}

.mobile-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 6px;
}

.mobile-label span {
    font-size: 12px;
    color: var(--text-secondary);
}

.mobile-btn-primary,
.mobile-btn-secondary {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.mobile-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-btn-secondary {
    background: var(--accent-secondary);
    color: #fff;
}

.mobile-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.mobile-results {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-result-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px var(--shadow-color);
}

.mobile-result-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-all;
}

.mobile-result-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.mobile-result-download {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 12px;
    text-decoration: none;
}

.mobile-result-download:active {
    transform: scale(0.97);
}

.mobile-error {
    color: var(--error);
}

/* 手机端底部“更多功能”链接 */
.mobile-footer-link {
    margin-top: 8px;
    padding: 8px 4px 4px;
    text-align: center;
    font-size: 12px;
}

.mobile-footer-link a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.mobile-footer-link a:active {
    opacity: 0.7;
}

/* 重命名弹窗 */
.mobile-rename-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.mobile-rename-content {
    width: 90%;
    max-width: 380px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    padding: 14px 16px 12px;
}

.mobile-rename-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.mobile-rename-tip {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.mobile-rename-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.mobile-rename-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
}

.mobile-rename-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.mobile-rename-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    background: var(--option-bg);
    color: var(--text-primary);
}

.mobile-rename-btn.primary {
    background: var(--accent-primary);
    color: #fff;
}
/* 选择图片的正方形方框 */
.mobile-select-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-select-box:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.mobile-select-box.has-file {
    border-style: solid;
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.mobile-select-box span {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 当前图片名称显示区域，支持自动省略号 */
.mobile-filename-display {
    margin: 6px 0 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 压缩结果里的图片与按钮布局 */
.mobile-result-display-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-result-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 8px;
    object-fit: cover;
    max-height: 260px;
}

.mobile-result-actions {
    display: flex;
    gap: 8px;
}

.mobile-action-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    background: var(--option-bg);
    color: var(--text-primary);
}

.mobile-action-btn.primary {
    background: var(--accent-primary);
    color: #fff;
}