/* === compress.css - 压缩图像页面（深色主题） === */

.tool-content {
  padding: var(--space-lg) 20px;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tool-header { text-align: center; margin-bottom: var(--space-md); width: 100%; }
.tool-header h1 { font-size: 32px; margin-bottom: var(--space-xs); color: var(--color-text-primary); }
.tool-header p { font-size: 16px; color: var(--color-text-secondary); }

/* --- 上传区域 --- */
.upload-container {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 20px;
  width: 100%;
  max-width: 700px;
  border: 1px solid var(--color-border);
}

.upload-zone {
  padding: 50px 30px;
  text-align: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.3s;
  border: 2px dashed var(--color-border);
  margin: 15px;
  border-radius: var(--radius-sm);
}

.upload-zone:hover { border-color: var(--color-accent); background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }

.upload-icon { font-size: 48px; margin-bottom: var(--space-sm); }
.upload-zone h3 { font-size: 20px; margin-bottom: var(--space-xs); }
.upload-zone p { font-size: 13px; color: var(--color-text-secondary); }

/* --- 选项区域 --- */
.options-section {
  background: var(--color-bg-tertiary);
  padding: var(--space-sm) 20px;
  border-top: 1px solid var(--color-border);
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.option-row:last-child { margin-bottom: 0; }

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle-switch input[type="checkbox"] { display: none; }

.toggle-slider {
  width: 48px;
  height: 24px;
  background: var(--color-bg-primary);
  border-radius: 12px;
  position: relative;
  transition: all 0.3s;
  border: 1px solid var(--color-border);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: var(--color-text-secondary);
  border-radius: 50%;
  top: 1px; left: 1px;
  transition: all 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-accent); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
  background: #fff;
}
.toggle-label { font-size: 14px; color: var(--color-text-primary); }

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

.format-btn {
  padding: 8px 20px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.format-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.format-btn.active { background: var(--color-accent); border-color: var(--color-accent); color: var(--text-on-accent); }

.format-divider { width: 1px; background: var(--color-border); margin: 0 5px; }

/* --- 进度提示 --- */
.progress-area {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 700px;
}

.progress-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-sm);
}
.progress-header h3 { font-size: 16px; color: var(--color-accent); margin: 0; }

.progress-percentage {
  font-size: 28px; font-weight: 700;
  color: var(--color-accent);
  background: rgba(59, 130, 246, 0.1);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  min-width: 80px;
  text-align: center;
}

.progress-text { font-size: 13px; color: var(--color-text-secondary); margin: 4px 0 0; }

.progress-bar-container {
  width: 100%; height: 8px;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  width: 0%;
  transition: width 0.3s;
}

/* --- 文件列表 --- */
.file-list { margin-top: 10px; width: 100%; max-width: 700px; }

.file-item {
  display: flex; align-items: center;
  padding: var(--space-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  transition: border-color 0.2s;
}
.file-item:hover { border-color: var(--color-accent); }

.file-item-left { display: flex; align-items: center; flex: 1; min-width: 0; }

.file-thumb {
  width: 56px; height: 56px;
  object-fit: cover; border-radius: var(--radius-sm);
  margin-right: var(--space-sm);
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.file-format {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
}
.file-size { color: var(--color-text-secondary); }

.file-item-right { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }

.file-compression { text-align: right; }
.compression-ratio { font-size: 18px; font-weight: 700; color: var(--color-success); margin-bottom: 2px; }
.compressed-size { font-size: 13px; color: var(--color-text-secondary); }

.btn-download-single {
  padding: 8px 16px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-download-single:hover { background: var(--color-accent); color: var(--text-on-accent); }

.file-status { color: var(--color-text-secondary); font-size: 13px; margin-left: var(--space-sm); }

.file-progress { width: 100%; height: 4px; background: var(--color-bg-tertiary); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.file-progress-fill { height: 100%; background: var(--color-accent); width: 0%; transition: width 0.3s; }

/* --- 下载全部按钮 --- */
.download-all-container { margin-top: 20px; text-align: center; width: 100%; max-width: 700px; }

.download-all-btn {
  padding: 14px 40px;
  background: var(--color-accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}
.download-all-btn:hover { background: var(--color-accent-hover); transform: translateY(-2px); }
.download-all-btn:disabled { background: var(--color-bg-tertiary); color: var(--color-text-secondary); cursor: not-allowed; transform: none; }
.download-icon { font-size: 18px; }

/* --- 响应式 --- */
@media (max-width: 768px) {
  .progress-area, .upload-container, .file-list, .download-all-container { max-width: 100%; }
  .progress-header { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
  .progress-percentage { align-self: flex-end; }
  .file-item { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
  .file-item-left, .file-item-right { width: 100%; }
  .file-item-right { justify-content: space-between; }
  .file-thumb { width: 48px; height: 48px; }
  .file-name { font-size: 13px; }
  .compression-ratio { font-size: 16px; }
  .btn-download-single { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
  .upload-zone { padding: 30px 20px; }
  .upload-icon { font-size: 40px; }
  .upload-zone h3 { font-size: 17px; }
  .file-thumb { width: 40px; height: 40px; }
}