/* AI Matting (抠图) Modern Design System */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-dashed: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -5px rgba(37, 99, 235, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 30px -10px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Header & Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 28px;
  max-width: 820px;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
  margin-bottom: 14px;
  line-height: 1.25;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

/* Model Selector Pills */
.model-tabs {
  display: inline-flex;
  gap: 8px;
  background: #edf2f7;
  padding: 4px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.tab-btn:hover:not(.active) {
  color: var(--text-main);
}

/* Main Card Container with Dashed Outline */
.main-upload-card {
  width: 100%;
  background: var(--bg-card);
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: var(--transition);
}

.main-upload-card.drag-active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  transform: scale(1.008);
}

/* Global Drag-and-Drop Semi-Transparent Translucent Overlay */
body.global-drag-active::after {
  content: "释放鼠标以添加图片到列表";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  pointer-events: none;
  outline: 3px dashed #60a5fa;
  outline-offset: -24px;
  border-radius: 20px;
  box-shadow: inset 0 0 40px rgba(59, 130, 246, 0.2);
}

/* Update Notice Banner */
.notice-bar {
  text-align: center;
  font-size: 0.85rem;
  color: #2563eb;
  background: #eff6ff;
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  margin: 0 auto 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  width: 100%;
}

.notice-tag {
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-right: 6px;
}

.notice-link {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 6px;
}

/* Upload Grid Layout (Left Preview + Right Dropzone) */
.upload-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
}

/* Left Showcase Preview */
.showcase-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
  background-color: #f1f5f9;
  background-image: 
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%), 
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.showcase-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Right Dropzone Area */
.dropzone-action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 10px;
}

.upload-btn-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: var(--transition);
}

.upload-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.upload-btn-large svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.prompt-text {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.prompt-highlight {
  color: var(--primary-color);
  font-weight: 600;
}

.history-btn {
  margin-top: 18px;
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.history-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* Sample Photos Bar (Try these photos) */
.samples-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 14px 0;
}

.samples-divider::before,
.samples-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.samples-title {
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
}

.samples-grid {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sample-item {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.sample-item:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--primary-color);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.sample-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sample-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.65rem;
  text-align: center;
  padding: 2px 0;
}

.samples-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 8px;
}

/* Workspace / Batch Processed List View */
.workspace-container {
  width: 100%;
  margin-top: 32px;
  display: none;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.workspace-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.workspace-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: #e2e8f0;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border: none;
  outline: none;
}

.btn-success {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

.btn-success:hover {
  background: var(--primary-hover);
  border: none;
  outline: none;
  transform: translateY(-1px);
}

.btn-danger {
  background: #fef2f2;
  color: #ef4444;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-danger:hover {
  background: #fee2e2;
  border: none;
  outline: none;
}

.btn-danger:disabled,
.btn-primary:disabled,
.btn-success:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Sticky Bottom Action Bar */
.sticky-bottom-bar {
  position: sticky;
  bottom: 16px;
  z-index: 100;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
}

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

.export-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.export-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-select {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.export-select:hover, .export-select:focus {
  border-color: var(--primary-color);
}

.bottom-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Image Cards Grid in Workspace (5 Cards Per Row) */
.batch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.image-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
}

.image-card.add-card {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  cursor: pointer;
  min-height: 245px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.image-card.add-card:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: translateY(-3px);
}

.add-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--primary-color);
  padding: 16px;
}

.add-card-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-color);
}

.image-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card-preview-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  background-color: #f1f5f9;
  background-image: 
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%), 
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

/* Card Meta Row: Bottom Left Dimension & Bottom Right Status/Actions */
.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.card-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.done-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.card-btn-action {
  border: none;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: var(--transition);
}

.card-btn-action:hover {
  background: #f1f5f9;
  border: none;
  outline: none;
}

.card-btn-action.download-btn {
  background: #eff6ff;
  color: #2563eb;
  border: none;
}

.card-btn-action.download-btn:hover {
  background: #dbeafe;
  border: none;
  outline: none;
}

.card-btn-action.redo-btn {
  background: #f8fafc;
  color: #64748b;
  border: none;
}

.card-btn-action.redo-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
  border: none;
  outline: none;
}

.img-dim {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
}

.status-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Status Progression Styles */
.status-badge.pending {
  color: #64748b;
  background: #f1f5f9;
}

.status-badge.uploading {
  color: #0284c7;
  background: #e0f2fe;
}

.status-badge.processing {
  color: #2563eb;
  background: #eff6ff;
}

.status-badge.done {
  color: #16a34a;
  background: #f0fdf4;
}

/* Modal / Editor Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.editor-modal {
  background: #ffffff;
  width: 100%;
  max-width: 900px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Image Preview Container (Modal) */
.image-preview-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  background-color: #ffffff;
  background-image: 
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%), 
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.image-preview-container canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Background Color Picker Swatches */
.bg-options-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bg-options-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.swatch-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #e2e8f0;
  transition: var(--transition);
  position: relative;
}

.swatch.active {
  border-color: var(--primary-color);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.swatch.transparent-bg {
  background-color: #ffffff;
  background-image: 
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%), 
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 10px 10px;
}

.swatch.white-bg { background-color: #ffffff; }
.swatch.red-bg { background-color: #e11d48; } /* ID photo red */
.swatch.blue-bg { background-color: #2563eb; } /* ID photo blue */
.swatch.green-bg { background-color: #16a34a; }
.swatch.yellow-bg { background-color: #eab308; }

.swatch.custom-color-swatch {
  position: relative;
  overflow: hidden;
  background: conic-gradient(from 180deg at 50% 50%, #ff0000 0deg, #ffff00 60deg, #00ff00 120deg, #00ffff 180deg, #0000ff 240deg, #ff00ff 300deg, #ff0000 360deg);
  border: 2px solid #e2e8f0;
  padding: 0;
}

.custom-color-input {
  position: absolute;
  inset: -10px;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  opacity: 0;
  cursor: pointer;
}

/* History Side Drawer / Modal */
.history-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  z-index: 120;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.history-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafafa;
}

.history-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background-color: #e2e8f0;
  background-image: 
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%), 
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 10px 10px;
  flex-shrink: 0;
}

.history-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-item-info {
  flex: 1;
  overflow: hidden;
}

.history-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-time {
  font-size: 0.72rem;
  color: var(--text-light);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 110;
  display: none;
}

.drawer-backdrop.active {
  display: block;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Mobile Responsive Adaptations */
@media (max-width: 1024px) {
  .batch-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 14px 10px;
  }

  .container {
    padding: 0;
  }

  .hero-title {
    font-size: 1.45rem;
    line-height: 1.35;
  }

  .hero-desc {
    font-size: 0.86rem;
  }

  .upload-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .showcase-wrapper {
    max-width: 240px;
    margin: 0 auto;
  }

  .upload-btn-large {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 1.02rem;
  }

  /* Workspace Header Mobile Responsiveness */
  .workspace-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .workspace-title {
    font-size: 1.05rem;
  }

  .batch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Mobile Action Panel Layout: Vertical Document Flow (No Sticky Bottom) */
  .sticky-bottom-bar {
    position: static;
    margin-top: 16px;
    width: 100%;
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 1;
  }

  .bottom-bar-left {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .export-label {
    font-size: 0.8rem;
    margin-left: 0 !important;
  }

  .export-select-group {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .export-select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.85rem;
    height: 38px;
  }

  .bottom-bar-right {
    display: flex;
    gap: 10px;
    width: 100%;
  }

  .bottom-bar-right button {
    flex: 1;
    height: 42px;
    justify-content: center;
    font-size: 0.92rem;
  }

  /* Editor Modal Mobile Adaptations */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .editor-modal {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
    padding: 16px 14px;
    overflow-y: auto;
  }

  .modal-header {
    margin-bottom: 12px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .image-preview-container {
    height: 240px;
    margin-bottom: 14px;
  }

  .bg-options-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .swatch-group {
    justify-content: space-between;
    width: 100%;
  }

  .swatch {
    width: 34px;
    height: 34px;
  }

  #saveSingleBtn {
    width: 100%;
    height: 42px;
    justify-content: center;
    font-size: 0.95rem;
    margin-left: 0 !important;
  }
}

@media (max-width: 480px) {
  .batch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card-body {
    padding: 8px 10px;
  }

  .file-name {
    font-size: 0.78rem;
  }

  .card-btn-action {
    font-size: 0.68rem;
    padding: 3px 6px;
  }
}
