: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 - Compression area */
.center-panel {
    flex: 1;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 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 - Status panel */
.right-panel {
    width: 280px;
    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 for progress */
.bottom-area {
    height: 120px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.download-all-btn {
    margin-top: 8px;
    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-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);
}

/* 预览卡片样式 */
.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;
} 