/* add-text-to-photo.css - Mobile Fullscreen Editor & Desktop Dual-column Workspace */

/* Global accent-color for all range sliders and checkboxes (Site Brand Color) */
input[type="range"],
input[type="checkbox"],
.addtext-slider,
.addtext-switch-label input,
.addtext-checkbox-label input {
  accent-color: var(--coral) !important;
}

/* Upload Card (Inherits standard site .tool-card) */
.addtext-upload-dropzone {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  border: 2px dashed var(--warm-border);
  border-radius: var(--radius-surface);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-align: center;
  outline: none;
}

.addtext-upload-dropzone:hover,
.addtext-upload-dropzone:focus-visible {
  border-color: var(--coral);
  background: #fffaf5;
}

.addtext-upload-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--butter-pale);
  color: var(--coral);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.addtext-upload-title {
  font-size: 17px;
  font-weight: 780;
  color: var(--ink);
  margin-bottom: 4px;
}

.addtext-choose-button {
  margin: 12px auto 8px;
  width: 168px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--coral);
  color: #ffffff;
  font-weight: 780;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.addtext-choose-button:hover {
  background: var(--coral-dark);
}

.addtext-upload-subtitle {
  font-size: 13px;
  color: var(--body);
}

.addtext-upload-privacy {
  margin-top: 14px;
  font-size: 12px;
  color: #706b64;
  text-align: center;
}

/* Error Banner */
.addtext-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin-bottom: 16px;
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: var(--radius-compact);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}

.addtext-error-banner button {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

/* Info Banner */
.addtext-info-banner {
  margin-top: 16px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: var(--radius-compact);
  color: #92400e;
  font-size: 13px;
  text-align: center;
}

/* Base Canvas & Stage Elements */
.addtext-canvas-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #141519;
  border-radius: var(--radius-surface);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

.addtext-canvas-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
  touch-action: pan-y;
  user-select: none;
}

.addtext-canvas-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

/* Floating Text Blocks */
.addtext-block-item {
  position: absolute;
  cursor: move;
  touch-action: none;
  user-select: none;
  border: 2px dashed transparent;
  padding: 4px;
  border-radius: 4px;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
  z-index: 10;
}

.addtext-block-item.is-selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

.addtext-block-text {
  pointer-events: none;
  word-break: break-word;
  white-space: pre-wrap;
}

.addtext-block-actions {
  position: absolute;
  top: -36px;
  right: 0;
  display: flex;
  gap: 4px;
  background: #111827;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.addtext-block-actions button {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.addtext-block-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Mobile Fullscreen Mode (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  .product-photo-hero.is-editing-mode {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    min-height: auto !important;
  }

  .addtext-editor-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #121316;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  /* 顶部栏 (固定) */
  .addtext-mobile-top-bar {
    height: 52px;
    background: #1c1d22;
    border-bottom: 1px solid #2e3038;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
    z-index: 20;
  }

  .addtext-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
  }

  .addtext-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .addtext-top-actions-center {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .addtext-icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #282a32;
    border: 1px solid #363944;
    border-radius: 6px;
    color: #e5e7eb;
    cursor: pointer;
  }

  .addtext-icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }

  .addtext-download-trigger-btn {
    background: var(--coral);
    color: #ffffff;
    font-weight: 780;
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(201, 54, 31, 0.35);
  }

  .addtext-desktop-top-bar {
    display: none;
  }

  .addtext-desktop-sidebar {
    display: none;
  }

  /* 中间画布容器 */
  .addtext-main-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .addtext-canvas-wrapper {
    flex: 1;
    min-height: 0;
    height: 100%;
    border-radius: 0;
    padding: 8px;
  }

  .addtext-canvas-stage {
    max-width: 100%;
    max-height: 100%;
  }

  .addtext-canvas-image {
    max-width: 100%;
    max-height: 100%;
  }

  /* 底部面板 (固定，高度不超过屏幕 35%) */
  .addtext-mobile-bottom-panel {
    background: #1c1d22;
    border-top: 1px solid #2e3038;
    display: flex;
    flex-direction: column;
    color: #f3f4f6;
    max-height: 35dvh;
    flex-shrink: 0;
    z-index: 20;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
  }

  /* 未选中文字框时 */
  .addtext-mobile-empty-state {
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .addtext-empty-hint {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
  }

  .addtext-big-add-btn {
    background: var(--coral);
    color: #ffffff;
    width: min(260px, 80%);
    height: 44px;
    border-radius: 999px;
    font-weight: 780;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(201, 54, 31, 0.4);
  }

  .addtext-big-add-btn:active {
    transform: scale(0.98);
  }

  /* 选中文字框时 5 标签栏 */
  .addtext-mobile-active-controls {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .addtext-mobile-tabs-bar {
    display: flex;
    border-bottom: 1px solid #2e3038;
    background: #16171b;
    flex-shrink: 0;
  }

  .addtext-tab-item {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .addtext-tab-item.is-active {
    color: #ffffff;
    border-bottom-color: var(--coral);
    font-weight: 780;
  }

  .addtext-mobile-tab-content {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }

  .addtext-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .addtext-mobile-textarea {
    width: 100%;
    background: #282a32;
    border: 1px solid #3a3d48;
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 14px;
    resize: none;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
  }

  .addtext-mobile-textarea:focus {
    border-color: var(--coral);
  }

  .addtext-tab-actions-row {
    display: flex;
    gap: 10px;
  }

  .addtext-tab-btn {
    flex: 1;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #282a32;
    border: 1px solid #3a3d48;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .addtext-tab-btn.addtext-btn-danger {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
  }

  /* 字体横向滑动 */
  .addtext-font-scroll-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .addtext-font-pill {
    padding: 7px 14px;
    border-radius: 999px;
    background: #282a32;
    border: 1px solid #3a3d48;
    color: #e5e7eb;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .addtext-font-pill.is-active {
    background: var(--coral);
    border-color: var(--coral);
    color: #ffffff;
    font-weight: 700;
  }

  .addtext-font-weight-toggle {
    display: flex;
    gap: 8px;
    margin-top: 4px;
  }

  .addtext-tab-toggle {
    flex: 1;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #282a32;
    border: 1px solid #3a3d48;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
  }

  .addtext-tab-toggle.is-active {
    background: #374151;
    border-color: #4b5563;
    color: #ffffff;
    font-weight: 700;
  }

  /* 颜色行 */
  .addtext-color-palette-row {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0;
  }

  .addtext-color-picker-round {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #4b5563;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
  }

  .addtext-color-chip {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease;
  }

  .addtext-color-chip.is-active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--coral);
    transform: scale(1.1);
  }

  /* Style 标签 */
  .addtext-style-pane {
    gap: 10px;
  }

  .addtext-style-card {
    background: #282a32;
    border: 1px solid #3a3d48;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .addtext-style-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .addtext-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
    cursor: pointer;
  }

  .addtext-switch-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--coral) !important;
  }

  .addtext-color-picker-mini {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #4b5563;
    border-radius: 4px;
    background: none;
    cursor: pointer;
  }

  .addtext-style-slider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: #9ca3af;
  }

  .addtext-style-slider-row input[type="range"] {
    flex: 1;
    accent-color: var(--coral) !important;
  }

  /* Adjust 标签 */
  .addtext-adjust-pane {
    gap: 12px;
  }

  .addtext-slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .addtext-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
  }

  .addtext-slider-with-btn {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .addtext-slider-with-btn input[type="range"] {
    flex: 1;
    accent-color: var(--coral) !important;
  }

  .addtext-reset-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 4px;
    color: #e5e7eb;
    cursor: pointer;
  }

  .addtext-align-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
  }
}

/* ==========================================================================
   Desktop Mode (≥ 768px): Dual Column Layout (No Fullscreen)
   ========================================================================== */
@media (min-width: 768px) {
  .addtext-mobile-top-bar {
    display: none;
  }

  .addtext-mobile-bottom-panel {
    display: none;
  }

  .product-photo-hero.is-editing-mode {
    display: block;
    min-height: auto;
    padding-top: 16px;
  }

  .product-photo-hero.is-editing-mode .product-photo-hero-copy {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .product-photo-hero.is-editing-mode .product-photo-hero-copy h1 {
    font-size: clamp(32px, 3.5vw, 44px);
    margin: 8px 0 10px;
  }

  .product-photo-hero.is-editing-mode .product-photo-capabilities {
    display: none;
  }

  .addtext-workspace-card {
    background: rgba(255, 253, 252, 0.95);
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-panel);
    padding: 20px;
    box-shadow: 0 16px 36px rgba(16, 35, 61, 0.06);
  }

  .addtext-desktop-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--warm-border);
  }

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

  .addtext-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-control);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .addtext-btn-primary {
    background: var(--coral);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    box-shadow: 0 2px 8px rgba(201, 54, 31, 0.25);
  }

  .addtext-btn-primary:hover {
    background: var(--coral-dark);
  }

  .addtext-btn-icon {
    width: 36px;
    height: 36px;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--warm-border);
    color: var(--ink);
  }

  .addtext-btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .addtext-desktop-top-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .addtext-desktop-download-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
  }

  .addtext-btn-ghost {
    background: transparent;
    border: 1px solid var(--warm-border);
    color: var(--body);
    font-size: 13px;
    padding: 8px 16px;
  }

  .addtext-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ink);
  }

  /* 双栏布局：左画布（约 2/3），右面板（约 1/3），左右严格等高 */
  .addtext-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(360px, 1.2fr);
    gap: 24px;
    align-items: stretch;
    height: calc(100vh - 180px);
    min-height: 480px;
    max-height: calc(100vh - 180px);
  }

  .addtext-canvas-wrapper {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding: 16px;
    background: #111216;
    border-radius: var(--radius-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .addtext-canvas-stage {
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
    line-height: 0;
    position: relative;
  }

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

  .addtext-desktop-sidebar {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-surface);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  }

  .addtext-desktop-tab-bar {
    display: flex;
    background: #f4efe6;
    border-bottom: 1px solid var(--warm-border);
    padding: 6px;
    gap: 4px;
    flex-shrink: 0;
  }

  .addtext-desktop-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--body);
    background: transparent;
    border: none;
    border-radius: var(--radius-compact);
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .addtext-desktop-tab-btn:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.6);
  }

  .addtext-desktop-tab-btn.is-active {
    color: var(--coral-dark);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  .addtext-desktop-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
  }

  .addtext-desktop-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .addtext-desktop-empty-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px;
    text-align: center;
  }

  .addtext-properties-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-surface);
    padding: 18px;
  }

  .addtext-tab-actions-row {
    display: flex;
    gap: 10px;
  }

  .addtext-tab-btn {
    flex: 1;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-compact);
    font-size: 13px;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid var(--warm-border);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .addtext-tab-btn:hover {
    background: #faf7f2;
    border-color: #d1c7b7;
  }

  .addtext-tab-btn.addtext-btn-danger {
    background: #fff5f5;
    border-color: #fecaca;
    color: #dc2626;
  }

  .addtext-tab-btn.addtext-btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
  }

  .addtext-desktop-empty-card {
    padding: 32px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed var(--warm-border);
    border-radius: var(--radius-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--body);
  }

  .addtext-desktop-download-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .addtext-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 780;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .addtext-download-primary {
    background: var(--coral);
    color: #ffffff;
  }

  .addtext-download-primary:hover:not(:disabled) {
    background: var(--coral-dark);
  }

  .addtext-download-secondary {
    background: #ffffff;
    color: var(--ink);
    border-color: var(--warm-border);
  }

  .addtext-download-secondary:hover:not(:disabled) {
    background: #faf7f0;
  }

  .addtext-prop-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .addtext-prop-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
  }

  .addtext-current-font-name {
    font-size: 13px;
    color: var(--coral-dark);
    font-weight: 700;
  }

  .addtext-prop-val {
    font-size: 12px;
    color: var(--body);
    font-weight: 400;
  }

  /* 桌面端 10 种字体网格卡片（平铺全部显示，不单独加滚动条） */
  .addtext-desktop-font-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: none;
    overflow: visible;
    padding: 2px;
  }

  .addtext-preset-palette-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0;
  }

  .addtext-color-hex {
    font-size: 13px;
    font-weight: 600;
    color: var(--body);
    font-family: monospace;
    margin-left: 8px;
  }

  .addtext-desktop-font-card {
    height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-compact);
    color: var(--ink);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .addtext-desktop-font-card:hover {
    border-color: #d1c7b7;
    background: #faf7f2;
  }

  .addtext-desktop-font-card.is-active {
    background: #fff5f3;
    border-color: var(--coral);
    color: var(--coral-dark);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--coral);
  }

  .addtext-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-compact);
    padding: 8px 12px;
    font-size: 14px;
    color: var(--ink);
    box-sizing: border-box;
    font-family: inherit;
  }

  .addtext-prop-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .addtext-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .addtext-color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-compact);
    cursor: pointer;
    background: none;
    flex-shrink: 0;
  }

  .addtext-preset-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .addtext-preset-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
  }

  .addtext-preset-dot.is-active {
    box-shadow: 0 0 0 2px var(--coral);
  }

  .addtext-format-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-compact);
    padding: 4px;
  }

  .addtext-format-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: var(--ink);
    cursor: pointer;
  }

  .addtext-format-btn.is-active {
    background: var(--butter-pale);
    color: var(--coral-dark);
  }

  .addtext-format-divider {
    width: 1px;
    height: 18px;
    background: var(--warm-border);
    margin: 0 4px;
  }

  .addtext-prop-card {
    background: #ffffff;
    border: 1px solid var(--warm-border);
    border-radius: var(--radius-compact);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .addtext-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .addtext-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
  }

  .addtext-sub-slider {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--body);
  }
}

/* ==========================================================================
   Common Dialog & Modal Styles
   ========================================================================== */
.addtext-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(16, 20, 28, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
}

/* 确认离开对话框 */
.addtext-confirm-card {
  background: #22242a;
  color: #ffffff;
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  border: 1px solid #363944;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.addtext-confirm-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 780;
}

.addtext-confirm-card p {
  margin: 0 0 20px;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.5;
}

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

.addtext-confirm-btn {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.addtext-confirm-btn:hover {
  opacity: 0.9;
}

.addtext-confirm-btn.addtext-btn-secondary {
  background: #374151;
  color: #ffffff;
}

.addtext-confirm-btn.addtext-btn-danger {
  background: #ef4444;
  color: #ffffff;
}

/* 下载选择模态框 */
.addtext-download-modal-card {
  background: #22242a;
  color: #ffffff;
  border-radius: 16px;
  padding: 20px;
  max-width: 320px;
  width: 100%;
  border: 1px solid #363944;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.addtext-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.addtext-modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 780;
}

.addtext-modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.addtext-download-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.addtext-download-opt-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #2e313b;
  border: 1px solid #3e4250;
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.addtext-download-opt-btn:hover {
  background: #373b47;
  border-color: var(--coral);
}

.addtext-opt-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.addtext-opt-text strong {
  font-size: 15px;
  font-weight: 780;
}

.addtext-opt-text span {
  font-size: 12px;
  color: #9ca3af;
}

.addtext-opt-icon {
  color: var(--coral);
}

/* 5-step workflow grid: 5 columns on desktop (>=1024px), 3 columns on tablet (761px-1023px), 1 column on mobile (<=760px) */
.add-text-page .product-photo-process .tool-workflow-steps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.add-text-page .product-photo-process li {
  padding: 24px 20px;
}

.add-text-page .product-photo-process h3 {
  margin: 36px 0 10px;
  font-size: 18px;
}

@media (max-width: 1023px) {
  .add-text-page .product-photo-process .tool-workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .add-text-page .product-photo-process .tool-workflow-steps {
    grid-template-columns: 1fr;
  }
  .add-text-page .product-photo-process li {
    padding: 24px;
  }
  .add-text-page .product-photo-process h3 {
    margin: 36px 0 10px;
    font-size: 19px;
  }
}

/* Add Text Showcase Cases: 3 columns on desktop (>=1024px), 1 column on mobile/tablet (<1024px) */
.add-text-showcase-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 36px;
}

@media (max-width: 1023px) {
  .add-text-showcase-list {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.add-text-case-comparison {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--warm-border);
  border-radius: 8px;
  background: var(--card);
  overflow: hidden;
}

.add-text-case-comparison .product-photo-comparison-stage {
  width: 100%;
}

.add-text-case-comparison figcaption {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  padding: 20px;
  border-top: 1px solid var(--warm-border);
}

.add-text-case-comparison .product-photo-comparison-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.add-text-case-comparison .product-photo-comparison-copy span {
  font-size: 11px;
  font-weight: 800;
  color: #746d66;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.add-text-case-comparison .product-photo-comparison-copy strong {
  font-size: 16px;
  font-weight: 780;
  line-height: 1.3;
  color: var(--ink);
}

.add-text-case-comparison .product-photo-comparison-copy p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--body);
  margin: 0 0 16px;
}

.add-text-case-comparison .product-photo-sample-action {
  margin-top: auto;
}

.add-text-showcase .product-photo-comparison-label.original {
  left: 10px;
  right: auto;
  padding: 4px 8px;
  font-size: 10px;
  background: rgba(16, 35, 61, 0.88);
}

.add-text-showcase .product-photo-comparison-label.edited {
  right: 10px;
  left: auto;
  padding: 4px 8px;
  font-size: 10px;
  background: var(--coral-dark);
}

.add-text-showcase .product-photo-sample-button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  width: 100%;
  justify-content: center;
}


