/* ─── WORKSPACE ─── */
.workspace {
  width: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 57px);
  overflow: hidden;
}

/* ─── LEFT PANEL ─── */
.left-panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  height: 100%;
  min-height: 0; /* 防止被内部滚动内容撑破 */
  overflow: hidden;
}

/* ─── CAMERA MODULE ─── */
.camera-module {
  position: relative;
  background: #000;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.camera-module video, .camera-module canvas {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-module canvas { display: none; position: absolute; inset: 0; }

/* Corner brackets */
.cam-corner {
  position: absolute;
  width: 24px; height: 24px;
  z-index: 10;
  pointer-events: none;
}
.cam-corner.tl { top: 14px; left: 14px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.cam-corner.tr { top: 14px; right: 14px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.cam-corner.bl { bottom: 14px; left: 14px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.cam-corner.br { bottom: 14px; right: 14px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.rec-badge {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 20;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}

.rec-badge.live { opacity: 1; }
.rec-dot { width: 7px; height: 7px; background: var(--red); border-radius: 50%; }
.rec-badge.live .rec-dot { animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* Camera overlay controls */
.cam-controls {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.cam-btn {
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
  font-size: 16px;
}

.cam-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
.cam-btn svg { width: 17px; height: 17px; fill: currentColor; }

.cam-info-row {
  position: absolute;
  bottom: 14px; left: 14px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.cam-badge {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.6);
  padding: 3px 7px;
}

.countdown-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 140px;
  color: #fff;
  text-shadow: 0 0 40px rgba(232,197,71,0.6);
  z-index: 30;
  display: none;
  pointer-events: none;
}

/* Webcambooth logo centered in camera */
.cam-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s;
}
.cam-logo svg { width: 100%; height: 100%; }
.cam-logo.live { opacity: 0.07; }

.no-cam {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  border: 1px dashed var(--border);
  margin: 16px;
}
.no-cam svg { width: 32px; height: 32px; fill: var(--text-faint); }

/* ─── CONTROLS PANEL ─── */
.controls-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.section-num {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
}

/* Shoot count selector */
.count-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.count-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
  transition: all 0.1s;
  text-align: center;
}

.count-btn:hover { border-color: var(--border-hi); color: var(--text); }
.count-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* Timer selector */
.timer-row {
  display: flex;
  gap: 6px;
}

.timer-btn {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.1s;
  text-align: center;
}

.timer-btn:hover { border-color: var(--border-hi); color: var(--text); }
.timer-btn.active { background: var(--surface-3); color: var(--accent); border-color: var(--accent); }

/* Filter buttons */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.filter-swatch {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.filter-swatch.active { border-color: var(--accent); }
.filter-swatch.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  pointer-events: none;
}

.filter-swatch .swatch-img {
  width: 100%; height: 100%;
  background: #666;
  display: flex; align-items: center; justify-content: center;
}

.swatch-bw { filter: grayscale(100%) contrast(1.2); }
.swatch-sepia { filter: sepia(100%) contrast(1.1); }
.swatch-vivid { filter: saturate(1.8) contrast(1.1); }
.swatch-fade { filter: contrast(0.85) saturate(0.6) brightness(1.1); }
.swatch-chrome { filter: saturate(1.3) hue-rotate(-10deg) contrast(1.15); }
.swatch-noir { filter: grayscale(100%) contrast(1.5) brightness(0.85); }
.swatch-warm { filter: sepia(40%) saturate(1.2) hue-rotate(-10deg); }
.swatch-cool { filter: saturate(0.8) hue-rotate(20deg) brightness(1.05); }

.filter-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.75);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-align: center;
  color: #fff;
  padding: 3px;
}

/* Paper colors */
.paper-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.paper-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  outline: 2px solid transparent;
  transition: all 0.15s;
}

.paper-swatch:hover { transform: scale(1.1); }
.paper-swatch.active { border-color: var(--bg); outline-color: var(--accent); outline-offset: 2px; }

.p-cream { background: #f4f1ea; }
.p-white { background: #ffffff; border-color: #ddd !important; }
.p-black { background: #111; }
.p-kraft { background: #dcb488; }
.p-rose { background: #ead1dc; }
.p-azure { background: #d0e0e3; }
.p-mint { background: #d4d8c6; }
.p-zinc { background: #d9d9d9; }
.p-midnight { background: #1a1a2e; }
.p-sage { background: #b2c5b2; }
/* New paper colors */
.p-peach    { background: #f5d5b8; }
.p-lavender { background: #dcd0f0; }
.p-lemon    { background: #f5f0b0; }
.p-slate    { background: #4a5568; }
.p-sand     { background: #e8d8b0; }
.p-blush    { background: #f7c5c5; }
.p-forest   { background: #2d4a2d; }
.p-navy     { background: #0f2040; }
.p-copper   { background: #b87040; }
.p-lilac    { background: #c8a8d8; }

/* Brightness/Contrast sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  width: 60px;
  flex-shrink: 0;
}

.slider-track {
  flex: 1;
  appearance: none;
  height: 3px;
  background: var(--border-hi);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent);
}

.slider-val {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  width: 28px;
  text-align: right;
}

/* Decoration / Sticker toggle */
.deco-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.deco-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 18px;
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 2px;
  position: relative;
}

.deco-btn:hover { border-color: var(--border-hi); transform: scale(1.05); }
.deco-btn.active { border-color: var(--accent); background: rgba(232,197,71,0.08); }
.deco-btn .check { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; display: none; }
.deco-btn.active .check { display: block; }

/* Border style */
.border-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.border-opt {
  padding: 10px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-align: center;
  transition: all 0.1s;
}

.border-opt:hover { border-color: var(--border-hi); color: var(--text); }
.border-opt.active { border-color: var(--accent); color: var(--accent); background: rgba(232,197,71,0.06); }

/* ─── ACTION BUTTONS ─── */
.action-area {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-shoot {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 3px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
  overflow: hidden;
}

.btn-shoot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.15s;
}

.btn-shoot:hover::before { background: rgba(0,0,0,0.1); }
.btn-shoot:active { transform: scale(0.98); }
.btn-shoot:disabled { background: var(--surface-3); color: var(--text-faint); cursor: not-allowed; }

.btn-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-sec {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.1s;
}

.btn-sec:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface-3); }
.btn-sec svg { width: 14px; height: 14px; fill: currentColor; }

/* ─── RIGHT PANEL / GALLERY ─── */
.gallery-panel {
  background: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 防止子元素内容撑破 Grid 布局 */
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.gallery-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.gallery-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}

.gallery-actions {
  display: flex;
  gap: 6px;
}

.gallery-act-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.1s;
}

.gallery-act-btn:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface-2); }

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 52px;
  padding: 28px 32px;
  align-content: flex-start;
  flex: 1;
}

.empty-state {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0.12;
}

.empty-text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ─── PHOTO STRIP ─── */
.strip-wrapper {
  position: relative;
  transition: transform 0.3s;
  display: inline-block;
}

.strip-wrapper:hover { transform: translateY(-4px); }

/* Toolbar floats to the RIGHT of strip, flush against it */
.strip-toolbar {
  position: absolute;
  top: 0;
  left: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border-hi);
  border-left: none;
  box-shadow: 3px 3px 12px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  /* fade out slowly (400ms delay) so mouse has time to reach toolbar */
  transition: opacity 0.15s ease 0.4s;
  z-index: 200;
}

.strip-wrapper:hover .strip-toolbar,
.strip-toolbar:hover {
  opacity: 1;
  pointer-events: auto;
  /* appear instantly */
  transition: opacity 0.1s ease 0s;
}

.strip-tool {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-dim);
  flex-shrink: 0;
}

.strip-tool:hover { background: var(--surface-3); color: var(--text); }
.strip-tool.del:hover { background: var(--red); color: #fff; }
.strip-tool svg { width: 16px; height: 16px; fill: currentColor; }

.photo-strip {
  width: 168px;
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
  animation: strip-in 0.6s cubic-bezier(0.2, 1, 0.3, 1) forwards;
  overflow: visible;
  position: relative;
}

/* Scanline texture overlay on paper */
.photo-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.09) 3px,
    rgba(0,0,0,0.09) 4px
  );
}

/* Photos and text sit above the scanline overlay */
.photo-strip > * {
  position: relative;
  z-index: 2;
}

/* ─── EDIT DRAWER ─── */
.edit-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 300px;
  height: 100vh;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
}

.edit-drawer.open { transform: translateX(0); }

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

.edit-drawer-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.edit-drawer-close {
  width: 28px; height: 28px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s;
}
.edit-drawer-close:hover { background: var(--red); border-color: var(--red); color: #fff; }
.edit-drawer-close svg { width: 13px; height: 13px; fill: currentColor; }

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

.edit-drawer-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.edit-apply-btn {
  flex: 1;
  background: var(--accent);
  color: #000;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 10px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.edit-apply-btn:hover { opacity: 0.85; }

.edit-cancel-btn {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.edit-cancel-btn:hover { border-color: var(--border-hi); color: var(--text); }

/* Highlight selected strip for editing */
.strip-wrapper.editing .photo-strip {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

/* edit tool button accent */
.strip-tool.edit-active { background: rgba(232,197,71,0.2); border-color: var(--accent); color: var(--accent); }

@keyframes strip-in {
  from { opacity: 0; transform: translateY(-30px) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

.strip-header-text {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: border-color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strip-header-text:hover { border-bottom-color: rgba(0,0,0,0.15); }
.strip-header-text[contenteditable="true"] { border-bottom-color: rgba(0,0,0,0.3); outline: none; cursor: text; }

.strip-img-slot {
  width: 100%;
  aspect-ratio: 4/3; /* 设置为4:3宽幅比例 */
  background: rgba(0,0,0,0.08);
  overflow: visible;
  position: relative;
}

/* 强制上方的插槽层级高于下方的插槽，防止贴纸被挡住 */
.strip-img-slot:nth-of-type(1) { z-index: 10; }
.strip-img-slot:nth-of-type(2) { z-index: 9; }
.strip-img-slot:nth-of-type(3) { z-index: 8; }
.strip-img-slot:nth-of-type(4) { z-index: 7; }

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

/* Sticker overlays on strip images */
.strip-sticker {
  position: absolute;
  cursor: grab;
  user-select: none;
  touch-action: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
  transform-origin: center center;
}

.strip-sticker:active { cursor: grabbing; }

.strip-sticker.selected {
  outline: 1px dashed rgba(232,197,71,0.8);
  outline-offset: 3px;
}

.sticker-delete-btn {
  position: absolute;
  top: -10px; right: -10px;
  width: 18px; height: 18px;
  background: #e05555;
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.strip-sticker.selected .sticker-delete-btn { display: flex; }

.sticker-scale-hint {
  position: absolute;
  bottom: -16px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 7px;
  color: rgba(232,197,71,0.7);
  white-space: nowrap;
  pointer-events: none;
  display: none;
}

.strip-sticker.selected .sticker-scale-hint { display: block; }

/* Edit mode indicator on slot */
.strip-img-slot.edit-mode {
  outline: 1px dashed rgba(232,197,71,0.4);
  cursor: crosshair;
}

.strip-divider {
  width: 100%;
  height: 1px;
  background: rgba(0,0,0,0.08);
}

.strip-footer {
  text-align: center;
  width: 100%;
  padding-top: 2px;
}

.strip-brand {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.6;
}

.strip-date {
  font-family: var(--mono);
  font-size: 7px;
  opacity: 0.35;
  margin-top: 2px;
}

/* ─── FLASH ─── */
.flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: hard-light;
}

/* ─── PERMISSION MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 8000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal-box {
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  padding: 48px 40px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}

.modal-icon { display:flex; justify-content:center; margin-bottom: 20px; opacity: 0.6; }
.modal-title { font-family: var(--display); font-size: 28px; letter-spacing: 2px; margin-bottom: 10px; }
.modal-body { font-size: 13px; color: var(--text-dim); margin-bottom: 28px; line-height: 1.6; }
.modal-btn {
  background: var(--accent);
  color: #000;
  border: none;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 2px;
  padding: 14px 36px;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s;
}
.modal-btn:hover { opacity: 0.85; }

/* ─── UPLOAD PREVIEW AREA ─── */
.upload-drop {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px dashed var(--border-hi);
  margin: 16px;
  padding: 30px 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-dim);
}

.upload-drop.visible { display: flex; }
.upload-drop:hover { border-color: var(--accent); color: var(--accent); }
.upload-drop svg { width: 28px; height: 28px; fill: currentColor; opacity: 0.5; }
.upload-drop span { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; }

/* ─── PROGRESS BAR ─── */
.progress-bar-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  z-index: 40;
  display: none;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
}

/* Divider */
.ctrl-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -20px;
}


/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  /* 移动端改为自然流布局，允许整页滚动 */
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .left-panel {
    position: static;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .controls-panel {
    overflow-y: visible;
    max-height: none;
  }
  .gallery-panel {
    min-height: 0;
    overflow-y: visible;
  }
  /* edit-drawer 用 dvh 确保 footer 在浏览器地址栏下方仍可见 */
  .edit-drawer {
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }
}

@media (max-width: 480px) {
  .controls-panel { padding: 14px; gap: 16px; }
  .gallery-grid { padding: 20px; gap: 20px; }
  .btn-shoot { font-size: 18px; }
  .edit-drawer { width: 100%; }
}
