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

:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --secondary: #a29bfe;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #dfe6e9;
  --danger: #e17055;
  --success: #00b894;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ===== 欢迎页（毛玻璃高级质感） ===== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #000000; /* 加载期间黑色底 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

/* 开屏加载转圈 + 说明（首次进入等待开屏图时显示，图加载好后由 JS 隐藏） */
.splash-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 0 16px;
  text-align: center;
  z-index: 2;
}
.splash-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: #a29bfe;
  border-radius: 50%;
  animation: splashSpin 0.8s linear infinite;
}
@keyframes splashSpin {
  to { transform: rotate(360deg); }
}
.splash-tip {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.5px;
}

/* 开屏图加载出来后：显示背景图 + 半透明深色遮罩（保证白字清晰） */
.welcome-overlay.bg-loaded {
  background:
    linear-gradient(rgba(25, 10, 30, 0.45), rgba(25, 10, 30, 0.55)),
    url('welcome-bg.jpg') center / cover no-repeat,
    #000000;
}

/* 欢迎卡片：开屏图加载完成（.ready）后才淡入 */
.welcome-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  padding: 56px 64px;
  text-align: center;
  color: #fff;
  max-width: 92%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0;
  visibility: hidden;   /* 加载中：不显示、不响应点击 */
  pointer-events: none;
  transform: translateY(16px);
}
.welcome-overlay.ready .welcome-card {
  opacity: 1;
  visibility: visible;  /* 开屏图加载完：显示并可点击 */
  pointer-events: auto;
  transform: translateY(0);
  animation: welcomeIn 0.7s ease-out;
}

@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-logo {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.welcome-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 12px;
  background: linear-gradient(120deg, #fff 0%, #dcd6ff 60%, #a29bfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-slogan {
  font-size: 17px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 36px;
  white-space: pre-line;
}

.btn-welcome {
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 50px;
  background: linear-gradient(120deg, #6c5ce7, #a29bfe);
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.45);
}

.btn-welcome:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(108, 92, 231, 0.6);
}

.welcome-arrow {
  font-size: 22px;
  transition: transform 0.25s;
}

.btn-welcome:hover .welcome-arrow { transform: translateX(6px); }

.welcome-hint {
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 768px) {
  .welcome-card { padding: 40px 24px; border-radius: 20px; }
  .welcome-title { font-size: 28px; }
  .welcome-logo { font-size: 48px; }
  .welcome-slogan { font-size: 15px; }
  .btn-welcome { padding: 14px 36px; font-size: 16px; }
}

/* Header */
.header {
  background: var(--card);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-item {
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  transition: all 0.2s;
}

.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary); color: #fff; }

/* Main */
.main { padding: 24px; max-width: 1600px; margin: 0 auto; }

/* Upload Area */
.upload-area {
  background: var(--card);
  border-radius: 16px;
  padding: 80px 20px;
  text-align: center;
  border: 2px dashed var(--border);
  transition: all 0.3s;
}

.upload-area.dragover {
  border-color: var(--primary);
  background: #f0efff;
}

.upload-icon { font-size: 64px; margin-bottom: 16px; }

.upload-area h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.upload-area p {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e8e8ed; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d63031; }

.btn-block { width: 100%; margin-top: 8px; }
/* 下一步按钮组：原图下一步 / 换图下一步 并排 */
.next-step-btns { display: flex; gap: 8px; margin-top: 8px; }
.next-step-btns .btn { flex: 1; }
.btn-large { padding: 14px 24px; font-size: 16px; }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 10px; width: 42px; height: 42px; font-size: 18px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Workspace — 电脑端三栏：左编辑模块 | 中间预览 | 右导出模块，高度对齐 */
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: stretch;
}

/* 左栏：编辑模块（尺寸/旋转） */
.edit-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 1;
  grid-row: 1;
}

/* 裁剪模块（独立块：桌面放左栏第二格，手机放画布上方） */
.crop-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 1;
  grid-row: 2;
}

/* 中间预览区占整列 */
.preview-area {
  grid-column: 2;
  grid-row: 1 / span 3;
}

/* 导出模块（独立块：桌面放右栏第一格） */
.export-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 3;
  grid-row: 1;
}

/* 右栏：信息/历史 */
.export-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 3;
  grid-row: 2 / span 2;
}

.tool-section {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.tool-section h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
}

.form-row {
  margin-bottom: 10px;
}

.form-row label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.form-row input[type="number"],
.form-row input[type="text"],
.form-row select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.checkbox-label input { width: auto; }

/* Sliders */
.slider-row {
  margin-bottom: 12px;
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.slider-row input[type="range"] {
  width: 100%;
  cursor: pointer;
}

/* Preview Area */
.preview-area {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.preview-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-light);
}

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

.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 50% / 20px 20px;
  position: relative;
  overflow: auto;
}

#mainCanvas {
  max-width: 100%;
  max-height: 40vh;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border-radius: 4px;
}

/* Crop Overlay */
.crop-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  cursor: crosshair;
  touch-action: none;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 50%;
  touch-action: none;
}

.crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }

/* UI 下拉展开列表 */
.ui-select {
  position: relative;
  margin-bottom: 12px;
}
.ui-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.ui-select-btn:hover, .ui-select-btn.open { border-color: var(--primary); }
.ui-btn-name { flex: 1; text-align: left; font-weight: 600; }
.ui-btn-type, .ui-select-type {
  font-size: 11px;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 1.6;
}
.type-crop { background: var(--primary); }
.type-blur { background: #f59e0b; }
.ui-btn-arrow { color: var(--muted); transition: transform .15s; }
.ui-select-btn.open .ui-btn-arrow { transform: rotate(180deg); }
.ui-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 280px;
  overflow-y: auto;
}
.ui-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
  font-size: 14px;
}
.ui-select-item:last-child { border-bottom: none; }
.ui-select-item:hover { background: #f5f6ff; }
.ui-select-item.active { background: #eef0ff; }
.ui-select-name { flex: 1; text-align: left; color: var(--text); }
.ui-select-ratio { font-size: 11px; color: var(--muted); margin-right: 4px; }
.ui-count { font-size: 10px; color: var(--muted); margin-left: 4px; }

/* 裁剪区模板小图预览 */
.crop-tpl-preview {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  text-align: center;
}
.crop-tpl-label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.crop-tpl-img {
  max-width: 100%;
  max-height: 100px;
  border-radius: 4px;
  display: inline-block;
}
.crop-tpl-none {
  font-size: 11px;
  color: var(--text-light);
  padding: 12px 0;
}

/* 合成预览（右侧大图） */
.composite-section {
  margin-top: 16px;
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.composite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.composite-header h3 {
  font-size: 14px;
  margin: 0;
}
.composite-status {
  font-size: 11px;
  color: var(--text-light);
}
.composite-canvas-wrap {
  text-align: center;
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  min-height: 80px;
}
#compositeCanvas {
  max-width: 100%;
  max-height: 30vh;
  height: auto;
  border-radius: 4px;
  display: inline-block;
}

/* 模板合成 */
.tpl-preview-wrap {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  text-align: center;
}
.tpl-preview-label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.tpl-preview-img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 4px;
  display: inline-block;
}
.tpl-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.5;
}

/* Info List */
.info-list { display: flex; flex-direction: column; gap: 8px; }

.info-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.info-item span:first-child { color: var(--text-light); }
.info-item span:last-child { font-weight: 600; }

/* History */
.history-list {
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.history-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  padding: 16px 0;
}

.history-item {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
  margin-bottom: 2px;
  background: var(--bg);
}

/* Tutorial Panel */
.tutorial-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.tutorial-content {
  max-width: 860px;
  margin: 0 auto;
}

.tutorial-content h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--text);
}

.tut-block {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfbfd;
}

.tut-block h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--primary);
}

.tut-block p {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 12px;
}

.tut-img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  margin-top: 10px;
}

.tut-img-placeholder {
  border: 2px dashed var(--secondary);
  border-radius: 8px;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.7;
  margin-top: 10px;
  background: var(--bg);
}

/* 表盘下载地址板块 */
.dl-block {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfbfd;
}

.dl-block h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--primary);
}

.dl-block p {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 16px;
}

.dl-btn {
  text-decoration: none;
  display: inline-flex;
}

/* Compress & Convert Panels（合并栏目） */
.tools-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}
.tools-col {
  background: var(--bg);
  border-radius: 12px;
  padding: 28px;
}
.tools-col .compress-content, .tools-col .convert-content {
  max-width: none;
}

/* 压缩/转换专用上传区（独立于编辑页） */
.tools-upload {
  border: 2px dashed var(--border, #ccc);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  margin-bottom: 20px;
  cursor: pointer;
  background: var(--card);
  transition: background 0.2s;
}
.tools-upload:hover, .tools-upload.dragover {
  background: rgba(255, 255, 255, 0.6);
}
.tools-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.tools-upload p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 12px;
}
.tools-file-name {
  margin-top: 10px;
  font-size: 13px;
  color: #28a745;
  min-height: 18px;
  word-break: break-all;
}

/* 个人主页 */
.profile-mod {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.profile-mod h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--text);
}
.profile-mod p {
  color: var(--text-light);
  margin-bottom: 8px;
}
.profile-qr {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin: 12px auto 0;
  display: block;
  border-radius: 8px;
  background: #fff;
}
.profile-qr-placeholder {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px 16px;
  margin: 12px auto 0;
  max-width: 320px;
  color: #999;
  font-size: 13px;
  line-height: 1.6;
}

/* 个人主页 · 访问统计 */
.visit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.visit-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 8px;
  text-align: center;
}
.visit-label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.visit-num {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.visit-unit {
  font-size: 13px;
  color: var(--text-light);
  margin-left: 2px;
}
.visit-sub {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}
@media (max-width: 768px) {
  .visit-stats { gap: 8px; }
  .visit-item { padding: 12px 6px; }
  .visit-num { font-size: 22px; }
  .visit-label { font-size: 12px; }
  .visit-sub { font-size: 11px; }
}

/* 手机端：压缩/转换两栏改一栏，个人主页二维码缩小 */
@media (max-width: 768px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tools-panel { padding: 20px 14px; }
  .tools-col { padding: 20px 14px; }
  .profile-qr { width: 160px; height: 160px; }
}

.compress-panel, .convert-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.compress-content, .convert-content {
  max-width: 500px;
  margin: 0 auto;
}

.compress-content h2, .convert-content h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.compress-content p, .convert-content p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.compress-settings, .convert-settings {
  text-align: left;
  margin-bottom: 24px;
}

.compress-result, .convert-result {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg);
  border-radius: 12px;
}

.compress-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-item span { font-size: 12px; color: var(--text-light); }
.stat-item strong { font-size: 20px; color: var(--primary); }

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 13px;
}

/* Responsive */
/* 中屏：预览区占整行放最上，左右两栏并排 */
@media (max-width: 1400px) {
  .workspace { grid-template-columns: 1fr 1fr; }
  .preview-area { grid-column: 1 / -1; grid-row: auto; order: -1; }
  .edit-panel, .crop-tools-panel, .export-tools-panel, .export-panel {
    grid-column: auto; grid-row: auto;
  }
}

/* 手机：两列横排网格（裁剪+导出 / 编辑区+合成 / 尺寸+旋转 / 信息+历史），裁剪+导出在最上 */
@media (max-width: 768px) {
  .workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .edit-panel, .crop-tools-panel, .export-tools-panel, .export-panel {
    grid-column: auto; grid-row: auto;
    flex-direction: column;
  }
  /* 第1行：裁剪 + 导出 横排 */
  .crop-tools-panel { grid-column: 1; grid-row: 1; }
  .export-tools-panel { grid-column: 2; grid-row: 1; }
  /* 第2行：编辑区 + 合成预览 横排（等宽等高） */
  .preview-area {
    grid-column: 1 / -1; grid-row: 2;
    min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: stretch;
  }
  /* 第3行：尺寸调整 + 旋转翻转 横排（等宽等高） */
  .edit-panel { grid-column: 1 / -1; grid-row: 3; flex-direction: row; align-items: stretch; }
  /* 第4行：图片信息 + 操作历史 横排（等宽等高） */
  .export-panel { grid-column: 1 / -1; grid-row: 4; flex-direction: row; align-items: stretch; }
  .edit-panel .tool-section, .export-panel .tool-section { flex: 1 1 0; min-width: 0; }
  /* 编辑区与合成预览各占一行一半（等宽），容器等高 */
  .preview-header { flex: 1 1 100%; flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .preview-actions { flex-wrap: wrap; }
  .canvas-container { flex: 1 1 45%; min-width: 0; padding: 8px; align-self: stretch; display: flex; flex-direction: column; }
  .composite-section { flex: 1 1 45%; min-width: 0; margin-top: 0; padding: 10px; align-self: stretch; display: flex; flex-direction: column; }
  /* 第1行：裁剪 + 导出 横排（等宽等高） */
  .crop-tools-panel, .export-tools-panel { align-self: stretch; }
  .crop-tools-panel .tool-section, .export-tools-panel .tool-section { flex: 1; }
  /* 手机端所有模块缩小 */
  .tool-section { padding: 10px; }
  .tool-section h3 { font-size: 13px; margin-bottom: 8px; }
  .composite-canvas-wrap { padding: 8px; min-height: 60px; }
  #mainCanvas { max-height: 32vh; }
  #compositeCanvas { max-height: 32vh; }
  .header { padding: 0 12px; }
  .nav { gap: 4px; flex-wrap: wrap; }
  .nav-item { padding: 6px 12px; font-size: 12px; }
  .main { padding: 12px; }
  .upload-area { padding: 40px 16px; }
}

/* 教程图片双击放大 */
.img-viewer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.img-viewer img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  border-radius: 8px;
}
