/* 证件照工具 - 全部样式（桌面端 + 移动端） */
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: linear-gradient(180deg, #f6f4fd 0%, #eef1f8 100%); color: #333; min-height: 100vh; }
  header { padding: 16px 28px; display: flex; align-items: center; gap: 12px; }
  .logo { border-radius: 12px; box-shadow: 0 4px 12px rgba(124,108,240,.35); flex-shrink: 0; }
  header h1 { font-size: 20px; color: #2d2a4a; }
  header p { font-size: 12px; color: #8a87a8; margin-top: 2px; }
  .container { display: flex; gap: 18px; padding: 0 24px 24px; max-width: 1440px; margin: 0 auto; }
  .panel { background: #fff; border-radius: 16px; box-shadow: 0 2px 16px rgba(90,80,160,.08); padding: 18px; }
  .controls { width: 370px; flex-shrink: 0; max-height: calc(100vh - 110px); overflow-y: auto; }
  .controls::-webkit-scrollbar { width: 6px; }
  .controls::-webkit-scrollbar-thumb { background: #d8d4ee; border-radius: 3px; }
  .preview { flex: 1; display: flex; flex-direction: column; }
  .step { border: 1px solid #eceaf6; border-radius: 12px; padding: 14px; margin-bottom: 14px; background: #fbfbfe; }
  .step-title { font-size: 14px; font-weight: bold; color: #4c4569; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
  .step-title .num { background: linear-gradient(135deg, #8b7cf6, #6a5ae0); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
  /* 上传拖拽区 */
  .dropzone { border: 2px dashed #c9c3ea; border-radius: 12px; padding: 26px 12px; text-align: center; cursor: pointer; background: #f8f7fd; transition: all .2s; }
  .dropzone:hover, .dropzone.dragover { border-color: #8b7cf6; background: #f1eefe; }
  .dropzone .dz-icon { font-size: 28px; margin-bottom: 6px; }
  .dropzone .dz-main { font-size: 14px; color: #4c4569; font-weight: bold; }
  .dropzone .dz-sub { font-size: 11px; color: #9b97b5; margin-top: 5px; }
  /* 规格卡片 */
  .spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
  .spec-grid::-webkit-scrollbar { width: 5px; }
  .spec-grid::-webkit-scrollbar-thumb { background: #d8d4ee; border-radius: 3px; }
  .spec-card { border: 1.5px solid #e4e1f3; border-radius: 10px; padding: 8px 10px; cursor: pointer; background: #fff; transition: all .15s; }
  .spec-card:hover { border-color: #b3a9ec; }
  .spec-card.active { border-color: #7c6cf0; background: #f1eefe; box-shadow: 0 0 0 2px rgba(124,108,240,.15); }
  .spec-card .spec-name { font-size: 13px; font-weight: bold; color: #3a3555; display: flex; align-items: center; gap: 5px; }
  .spec-card .spec-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
  .spec-card .spec-size { font-size: 10px; color: #9b97b5; margin-top: 3px; }
  .spec-card .spec-desc { font-size: 10px; color: #7c76a0; margin-top: 2px; }
  select, input[type="number"], input[type="text"] { width: 100%; padding: 7px 9px; border: 1px solid #ddd9ee; border-radius: 8px; font-size: 13px; background: #fff; }
  select:focus, input:focus { outline: none; border-color: #7c6cf0; }
  .row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
  .row label { font-size: 13px; white-space: nowrap; min-width: 56px; }
  .mm-info { font-size: 12px; color: #8a87a8; margin-top: 8px; background: #f3f1fb; border-radius: 8px; padding: 7px 10px; }
  /* 底色 */
  .swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
  .swatch { width: 36px; height: 36px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
  .swatch.active { border-color: #7c6cf0; box-shadow: 0 0 0 3px rgba(124,108,240,.2); }
  .swatch span { position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); font-size: 10px; color: #8a87a8; white-space: nowrap; }
  .swatch-wrap { margin-bottom: 24px; }
  .hex-row { display: flex; gap: 8px; align-items: center; }
  .hex-row input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid #ddd9ee; border-radius: 8px; cursor: pointer; background: #fff; }
  .hex-row input[type="text"] { font-family: Consolas, monospace; }
  button { background: linear-gradient(135deg, #8b7cf6, #6a5ae0); color: #fff; border: none; border-radius: 10px; padding: 10px 14px; font-size: 14px; cursor: pointer; width: 100%; transition: opacity .15s; }
  button:hover { opacity: .9; }
  button:disabled { background: #c5c1d8; cursor: not-allowed; }
  button.secondary { background: #fff; color: #7c6cf0; border: 1.5px solid #b3a9ec; }
  button.secondary:hover { background: #f6f4fe; opacity: 1; }
  button.green { background: linear-gradient(135deg, #34d399, #10b981); }
  .slider-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .slider-row label { font-size: 12px; min-width: 56px; color: #4c4569; }
  .slider-row input[type="range"] { flex: 1; accent-color: #7c6cf0; }
  .slider-row .val { font-size: 12px; min-width: 40px; text-align: right; color: #8a87a8; }
  .status { font-size: 12px; color: #6f6b8c; background: #f3f1fb; border-radius: 8px; padding: 9px 10px; margin-top: 10px; min-height: 34px; line-height: 1.5; white-space: pre-wrap; }
  .status.err { color: #dc2626; background: #fef2f2; }
  /* 标签页 */
  .tabs { display: flex; gap: 6px; margin-bottom: 14px; }
  .tab { padding: 9px 22px; border-radius: 999px; background: #fff; cursor: pointer; font-size: 14px; border: 1.5px solid #e4e1f3; width: auto; color: #4c4569; }
  .tab.active { background: linear-gradient(135deg, #8b7cf6, #6a5ae0); color: #fff; border-color: transparent; font-weight: bold; }
  .tab-body { background: #fff; border-radius: 16px; box-shadow: 0 2px 16px rgba(90,80,160,.08); padding: 22px; flex: 1; display: none; flex-direction: column; align-items: center; }
  .tab-body.active { display: flex; }
  .canvas-holder { background: repeating-conic-gradient(#eceaf6 0% 25%, #fff 0% 50%) 0 0/20px 20px; border: 1px solid #e4e1f3; border-radius: 12px; display: inline-block; line-height: 0; max-width: 100%; }
  canvas { max-width: 100%; max-height: calc(100vh - 300px); height: auto; border-radius: 10px; }
  .print-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; width: 100%; }
  .print-controls .field { display: flex; flex-direction: column; gap: 4px; }
  .print-controls .field label { font-size: 12px; color: #8a87a8; }
  .print-controls select { width: auto; min-width: 110px; }
  .print-controls button { width: auto; }
  .print-info { font-size: 13px; color: #4c4569; margin-bottom: 12px; width: 100%; background: #f8f7fd; border-radius: 8px; padding: 8px 12px; }
  .hint { font-size: 12px; color: #9b97b5; margin-top: 8px; line-height: 1.5; }
  /* 修复前后对比 */
  .seg-row { display: flex; gap: 6px; margin-bottom: 12px; justify-content: center; flex-wrap: wrap; }
  .seg-btn { background: #fff; color: #4c4569; border: 1.5px solid #e4e1f3; border-radius: 999px; padding: 6px 16px; font-size: 12px; cursor: pointer; transition: all .15s; width: auto; }
  .seg-btn:hover { border-color: #b3a9ec; }
  .seg-btn.active { background: linear-gradient(135deg, #8b7cf6, #6a5ae0); color: #fff; border-color: transparent; font-weight: bold; }
  .ba-wrap { position: relative; display: inline-block; line-height: 0; border-radius: 12px; overflow: hidden; user-select: none; touch-action: none; box-shadow: 0 2px 16px rgba(90,80,160,.12); }
  .ba-wrap canvas { display: block; border-radius: 10px; max-width: 100%; }
  .ba-before, .ba-after { position: absolute; inset: 0; }
  .ba-after { clip-path: inset(0 0 0 50%); }
  .ba-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.45); transform: translateX(-50%); cursor: ew-resize; z-index: 3; }
  .ba-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #8b7cf6, #6a5ae0); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: ew-resize; z-index: 4; box-shadow: 0 2px 8px rgba(124,108,240,.5); }
  .ba-tag { position: absolute; top: 8px; font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.5); color: #fff; z-index: 2; }
  .ba-tag.left { left: 8px; } .ba-tag.right { right: 8px; }
  /* 美化开关 */
  .toggle-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; color: #4c4569; }
  .toggle-row input[type="checkbox"] { accent-color: #7c6cf0; width: 16px; height: 16px; }
  /* 批量导出 */
  .batch-pick { margin-bottom: 8px; }
  .batch-pick .lbl { font-size: 12px; color: #8a87a8; margin: 8px 0 6px; }
  .batch-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip { border: 1.5px solid #e4e1f3; border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; background: #fff; color: #4c4569; transition: all .15s; }
  .chip:hover { border-color: #b3a9ec; }
  .chip.active { background: linear-gradient(135deg, #8b7cf6, #6a5ae0); color: #fff; border-color: transparent; font-weight: bold; }
  .batch-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 8px; }
  .batch-preview .bp { background: #f8f7fd; border-radius: 8px; padding: 4px; text-align: center; }
  .batch-preview canvas { width: 100%; height: auto; border-radius: 6px; display: block; }
  .batch-preview .bp-label { font-size: 10px; color: #8a87a8; margin-top: 3px; line-height: 1.3; word-break: break-all; }
  .batch-sum { font-size: 12px; color: #6f6b8c; background: #f3f1fb; border-radius: 8px; padding: 7px 10px; margin-top: 8px; line-height: 1.5; }
  /* 页脚品牌 */
  footer { text-align: center; padding: 22px 16px 34px; color: #8a87a8; font-size: 12px; line-height: 1.9; }
  footer .brand { font-size: 16px; font-weight: bold; color: #4c4569; }
  footer .brand span { background: linear-gradient(135deg, #8b7cf6, #6a5ae0); -webkit-background-clip: text; background-clip: text; color: transparent; }
  footer .desc { margin-top: 4px; }
  footer .contact { margin-top: 6px; }
  footer .contact strong { color: #7c6cf0; }
  footer .tag { display: inline-block; margin-top: 12px; background: #f1eefe; color: #7c6cf0; padding: 6px 16px; border-radius: 999px; font-size: 12px; }
  .hidden { display: none !important; }
  .desktop-only { display: block; }
  .mobile-only { display: none !important; }

/* ========== 移动端向导式布局 ========== */
@media (max-width: 768px) {
  body { background: #f5f4fa; }
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .mobile-app { display: flex; flex-direction: column; height: 100dvh; width: 100%; max-width: 100vw; overflow: hidden; }
  .mobile-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; border-bottom: 1px solid #eceaf6; flex-shrink: 0; }
  .mobile-head .mh-back { width: 32px; height: 32px; border: none; background: none; font-size: 20px; cursor: pointer; color: #4c4569; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
  .mobile-head .mh-back:active { background: #f3f1fb; }
  .mobile-head .mh-title { font-size: 16px; font-weight: 600; color: #2d2a4a; }
  .mobile-head .mh-step { font-size: 12px; color: #8a87a8; }
  .mobile-body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
  .mobile-body::-webkit-scrollbar { width: 4px; }
  .mobile-body::-webkit-scrollbar-thumb { background: #d8d4ee; border-radius: 2px; }
  .mobile-step-view { display: none; }
  .mobile-step-view.active { display: block; animation: fadeIn .2s ease; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .mobile-section-title { font-size: 15px; font-weight: 600; color: #2d2a4a; margin-bottom: 12px; }
  .mobile-section-desc { font-size: 12px; color: #8a87a8; margin-bottom: 16px; line-height: 1.5; }

  /* 上传区域 */
  .mobile-dropzone { border: 2px dashed #c9c3ea; border-radius: 16px; padding: 48px 20px; text-align: center; cursor: pointer; background: #f8f7fd; transition: all .2s; margin-top: 24px; }
  .mobile-dropzone:active { border-color: #8b7cf6; background: #f1eefe; }
  .mobile-dropzone .mdz-icon { font-size: 48px; margin-bottom: 12px; }
  .mobile-dropzone .mdz-main { font-size: 16px; color: #4c4569; font-weight: 600; }
  .mobile-dropzone .mdz-sub { font-size: 12px; color: #9b97b5; margin-top: 8px; }
  .mobile-dropzone .mdz-loaded { font-size: 11px; color: #8a87a8; margin-top: 8px; background: #f0edfe; border-radius: 8px; padding: 6px 10px; display: inline-block; }

  /* 规格选择 */
  .mobile-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-spec-card { border: 1.5px solid #e4e1f3; border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fff; transition: all .15s; }
  .mobile-spec-card:active { border-color: #b3a9ec; }
  .mobile-spec-card.active { border-color: #7c6cf0; background: #f1eefe; box-shadow: 0 0 0 2px rgba(124,108,240,.15); }
  .mobile-spec-card .msc-name { font-size: 13px; font-weight: 600; color: #3a3555; display: flex; align-items: center; gap: 5px; }
  .mobile-spec-card .msc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
  .mobile-spec-card .msc-size { font-size: 10px; color: #9b97b5; margin-top: 3px; }
  .mobile-spec-card .msc-desc { font-size: 10px; color: #7c76a0; margin-top: 2px; }
  .mobile-spec-custom { display: flex; gap: 8px; margin-top: 10px; }
  .mobile-spec-custom input { flex: 1; padding: 8px 10px; border: 1px solid #ddd9ee; border-radius: 8px; font-size: 13px; background: #fff; }
  .mobile-mminfo { font-size: 12px; color: #8a87a8; margin-top: 10px; background: #f3f1fb; border-radius: 8px; padding: 8px 10px; }

  /* 底色选择 */
  .mobile-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
  .mobile-swatch { width: 44px; height: 44px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
  .mobile-swatch.active { border-color: #7c6cf0; box-shadow: 0 0 0 3px rgba(124,108,240,.2); }
  .mobile-swatch span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: #8a87a8; white-space: nowrap; }
  .mobile-swatch-wrap { margin-bottom: 24px; }
  .mobile-hex-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
  .mobile-hex-row input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid #ddd9ee; border-radius: 8px; cursor: pointer; background: #fff; }
  .mobile-hex-row input[type="text"] { flex: 1; padding: 7px 9px; border: 1px solid #ddd9ee; border-radius: 8px; font-size: 13px; font-family: Consolas, monospace; background: #fff; }
  .mobile-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4c4569; cursor: pointer; }
  .mobile-checkbox input { width: 18px; height: 18px; accent-color: #7c6cf0; }

  /* AI 步骤 */
  .mobile-btn { width: 100%; padding: 12px 14px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s; margin-bottom: 8px; }
  .mobile-btn:active { opacity: .8; }
  .mobile-btn.primary { background: linear-gradient(135deg, #8b7cf6, #6a5ae0); color: #fff; }
  .mobile-btn.primary:disabled { background: #c5c1d8; cursor: not-allowed; }
  .mobile-btn.secondary { background: #fff; color: #7c6cf0; border: 1.5px solid #b3a9ec; }
  .mobile-btn.green { background: linear-gradient(135deg, #34d399, #10b981); }
  .mobile-btn.small { width: auto; padding: 8px 16px; font-size: 13px; }
  .mobile-status { font-size: 12px; color: #6f6b8c; background: #f3f1fb; border-radius: 8px; padding: 10px; margin-top: 10px; min-height: 36px; line-height: 1.5; white-space: pre-wrap; }
  .mobile-status.err { color: #dc2626; background: #fef2f2; }

  /* 微调 */
  .mobile-canvas-wrap { background: repeating-conic-gradient(#eceaf6 0% 25%, #fff 0% 50%) 0 0/20px 20px; border: 1px solid #e4e1f3; border-radius: 12px; overflow: hidden; margin-bottom: 12px; width: 100%; }
  .mobile-canvas-wrap canvas { display: block; max-width: 100%; max-height: 40vh; width: auto; height: auto; margin: 0 auto; }
  .mobile-sliders { margin-bottom: 8px; }
  .mobile-slider-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .mobile-slider-row label { font-size: 12px; min-width: 40px; color: #4c4569; flex-shrink: 0; }
  .mobile-slider-row input[type="range"] { flex: 1; height: 20px; accent-color: #7c6cf0; }
  .mobile-slider-row .msv { font-size: 12px; min-width: 42px; text-align: right; color: #8a87a8; flex-shrink: 0; }

  /* 导出 */
  .mobile-export-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .mobile-export-row label { font-size: 13px; min-width: 60px; color: #4c4569; flex-shrink: 0; }
  .mobile-export-row select { flex: 2; min-width: 80px; padding: 8px 10px; border: 1px solid #ddd9ee; border-radius: 8px; font-size: 13px; background: #fff; }
  .mobile-export-row input { flex: 1; padding: 8px 10px; border: 1px solid #ddd9ee; border-radius: 8px; font-size: 13px; background: #fff; }
  .mobile-export-row span { font-size: 12px; color: #8a87a8; flex-shrink: 0; }
  .mobile-export-info { font-size: 12px; color: #4c4569; margin-top: 10px; background: #f3f1fb; border-radius: 8px; padding: 8px 10px; }

  /* 底部导航 */
  .mobile-foot { background: #fff; border-top: 1px solid #eceaf6; padding: 10px 16px 16px; flex-shrink: 0; }
  .mobile-foot .mf-indicators { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
  .mobile-foot .mf-dot { width: 8px; height: 8px; border-radius: 50%; background: #ddd9ee; transition: all .2s; }
  .mobile-foot .mf-dot.active { background: #7c6cf0; width: 20px; border-radius: 4px; }
  .mobile-foot .mf-dot.done { background: #b3a9ec; }
  .mobile-foot .mf-buttons { display: flex; gap: 10px; }
  .mobile-foot .mf-buttons .mobile-btn { margin-bottom: 0; }
  .mobile-foot .mf-buttons .mobile-btn.half { flex: 1; }
  .mobile-foot .mf-buttons .mobile-btn.full { flex: 1; }

  /* 相纸排版页面（额外页面） */
  .mobile-print-section { display: none; }
  .mobile-print-section.active { display: block; }
  .mobile-print-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
  .mobile-print-row .mpr-field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 100px; }
  .mobile-print-row .mpr-field label { font-size: 11px; color: #8a87a8; }
  .mobile-print-row .mpr-field select { padding: 8px; border: 1px solid #ddd9ee; border-radius: 8px; font-size: 13px; background: #fff; }
  .mobile-print-info { font-size: 12px; color: #4c4569; background: #f3f1fb; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
  .mobile-print-canvas-wrap { background: repeating-conic-gradient(#eceaf6 0% 25%, #fff 0% 50%) 0 0/20px 20px; border: 1px solid #e4e1f3; border-radius: 12px; overflow: hidden; width: 100%; }
  .mobile-print-canvas-wrap canvas { display: block; max-width: 100%; width: auto; height: auto; margin: 0 auto; }

  /* 移动端成品/原图切换 */
  .mobile-seg-row { display: flex; gap: 6px; margin-bottom: 10px; justify-content: center; }
  .mobile-seg-row .seg-btn { padding: 7px 18px; font-size: 13px; }
  /* 移动端美化开关 */
  .mobile-toggle-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 13px; color: #4c4569; }
  .mobile-toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #7c6cf0; }
  /* 移动端批量导出 */
  .mobile-batch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .mobile-batch-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 8px; }
  .mobile-batch-preview .bp { background: #f8f7fd; border-radius: 8px; padding: 4px; text-align: center; }
  .mobile-batch-preview canvas { width: 100%; height: auto; border-radius: 6px; display: block; }
  .mobile-batch-preview .bp-label { font-size: 10px; color: #8a87a8; margin-top: 3px; line-height: 1.3; word-break: break-all; }
  .mobile-batch-sum { font-size: 12px; color: #6f6b8c; background: #f3f1fb; border-radius: 8px; padding: 8px 10px; margin-top: 8px; line-height: 1.5; }
}
