/* AI 创作工具公共样式 */
.ai-tool-wrap { padding-top: 40px; padding-bottom: 48px; }
.ai-tool-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.ai-tool-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: var(--color-brand-gradient, linear-gradient(135deg,#2563eb,#3b82f6));
  border-radius: var(--border-radius-md, 10px); color: #fff; font-size: 18px; flex: none;
}
.ai-tool-header h1 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--color-gray-900, #111827); }
.ai-tool-header p { margin: 0; font-size: 0.875rem; color: var(--color-gray-500, #6b7280); }

/* 蒙版绘制区 */
.mask-stage { position: relative; display: inline-block; max-width: 100%; border-radius: 12px; overflow: hidden; background: #0f172a; }
.mask-stage img { display: block; max-width: 100%; max-height: 62vh; user-select: none; -webkit-user-drag: none; }
.mask-stage canvas { position: absolute; left: 0; top: 0; cursor: crosshair; }

/* 参数面板 */
.ai-options { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.ai-options .opt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.ai-options label { font-size: 14px; color: #334155; font-weight: 500; min-width: 72px; }
.ai-options input[type=range] { flex: 1; min-width: 160px; }
.ai-options select, .ai-options input[type=text] {
  padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #fff; color: #1e293b;
}
.seg-group { display: inline-flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.seg-group button {
  padding: 8px 16px; border: none; background: #fff; color: #475569; font-size: 13px; cursor: pointer;
}
.seg-group button.active { background: #2563eb; color: #fff; }
.seg-group button + button { border-left: 1px solid #e2e8f0; }

/* 色板 */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.swatch.active { border-color: #2563eb; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb; }

/* 结果 */
.ai-result { margin-top: 24px; text-align: center; }
.ai-result img { max-width: 100%; max-height: 62vh; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.ai-result-actions { margin-top: 18px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 提示条 */
.ai-tip {
  margin-top: 14px; padding: 12px 16px; background: #eff6ff; border-left: 3px solid #2563eb;
  border-radius: 8px; font-size: 13px; color: #475569; line-height: 1.7;
}

/* SEO 内容区（复用现有工具页样式） */
.ai-seo { margin-top: 48px; padding-top: 32px; border-top: 1px solid #e5e7eb; }
.ai-seo h2 { font-size: 1.2rem; font-weight: 700; color: #111827; margin: 20px 0 12px; }
.ai-seo h2:first-child { margin-top: 0; }
.ai-seo p { color: #4b5563; line-height: 1.8; margin-bottom: 12px; }
.ai-seo h3 { font-size: 0.95rem; font-weight: 600; color: #111827; margin: 14px 0 6px; }

/* 拼图页 */
.collage-canvas-wrap { background: #f1f5f9; border-radius: 12px; padding: 16px; text-align: center; }
#collageCanvas { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.08); background:#fff; }
.slot-picker { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.slot-btn { padding: 8px 14px; border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; font-size: 13px; color:#475569; cursor: pointer; }
.slot-btn.active { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.slot-btn:disabled { opacity: .4; cursor: not-allowed; }

/* 模板中心 */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tpl-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; transition: all .2s; }
.tpl-card:hover { border-color: #2563eb; box-shadow: 0 4px 16px rgba(37,99,235,.12); transform: translateY(-2px); }
.tpl-card.active { border-color: #2563eb; background: #eff6ff; }
.tpl-preview { height: 150px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.tpl-card h4 { margin: 0 0 4px; font-size: 14px; color: #1e293b; }
.tpl-card p { margin: 0; font-size: 12px; color: #94a3b8; }

/* 作品库 */
.creation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.creation-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.creation-card img { width: 100%; height: 180px; object-fit: cover; display: block; background: #f1f5f9; }
.creation-info { padding: 12px; }
.creation-info .t { font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creation-info .m { font-size: 12px; color: #94a3b8; display: flex; justify-content: space-between; align-items: center; }

/* 文生图画廊 */
.t2i-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.t2i-item { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.08); cursor: pointer; }
.t2i-item img { width: 100%; display: block; }
