.container { max-width: 1100px; margin: 0 auto; padding: 16px 20px; display: flex; gap: 24px; align-items: flex-start; }
h1 { white-space: nowrap; }
.page-header { max-width: 1100px; }

/* 模式 Tab */
.mode-tabs { display: flex; gap: 0; margin-bottom: 16px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.mode-tab { flex: 1; padding: 10px 8px; border: none; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: center; }
.mode-tab:hover { background: var(--bg-hover); }
.mode-tab.active { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }

/* 模式字段可见性 */
.mode-field { transition: opacity 0.2s; }

/* 双上传布局 */
.dual-upload { display: flex; gap: 12px; }
.dual-upload > div { flex: 1; }
.dual-upload label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; display: block; }
.dual-upload .upload-area img { max-width: 256px; max-height: 256px; object-fit: contain; border-radius: 8px; }
.target-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.target-thumb { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; }
.target-thumb img { width: 100%; height: 100%; object-fit: cover; }
.target-thumb .del-btn { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; border: none; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; line-height: 1; }
.target-thumb .del-btn:hover { background: rgba(231,76,60,0.9); }
.target-add { width: 80px; height: 80px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 24px; color: var(--text-dim); transition: border-color 0.2s; }
.target-add:hover { border-color: var(--accent); color: var(--accent); }

/* 左侧 LoRA 面板 */
.lora-panel { width: 200px; flex-shrink: 0; background: var(--bg-card); border-radius: 16px; padding: 16px 12px; position: sticky; top: 20px; }
.lora-panel-title { font-size: 14px; color: var(--text-dim); padding: 0 8px 12px; border-bottom: 1px solid var(--divider); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.random-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 4px; border-radius: 6px; transition: transform 0.2s, background 0.2s; flex: none; width: auto; }
.random-btn:hover { transform: rotate(90deg); background: var(--bg-nested); }
.lora-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 10px; border-bottom: 1px solid var(--divider); margin-bottom: 8px; }
.lora-tag { padding: 4px 12px; border-radius: 14px; font-size: 12px; line-height: 1.4; color: var(--text-muted); background: var(--bg-nested); cursor: pointer; transition: all 0.2s; border: none; white-space: nowrap; }
.lora-tag:hover { color: var(--accent); background: var(--bg-hover); }
.lora-tag.active { background: var(--accent); color: #fff; }
.lora-card { padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: all 0.2s; margin-bottom: 4px; border-left: 3px solid transparent; }
.lora-card:hover { background: var(--bg-hover); }
.lora-card.active { background: var(--bg-nested); border-left-color: var(--accent); }
.lora-card-header { display: flex; align-items: center; justify-content: space-between; }
.lora-card-name { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.lora-card.active .lora-card-name { color: var(--accent); }
.lora-card-check { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); transition: all 0.2s; }
.lora-card.active .lora-card-check { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--active-check-inset); }
.lora-desc { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.lora-sample { margin-top: 6px; border-radius: 6px; overflow: hidden; aspect-ratio: 3/4; background: var(--bg-page); }
.lora-sample img { width: 100%; height: 100%; object-fit: cover; }
.lora-detail { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.lora-card.active .lora-detail { max-height: 400px; }
.lora-card-thumb { width: 32px; height: 32px; border-radius: 6px; overflow: hidden; flex-shrink: 0; display: block; }
.lora-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lora-card.active .lora-card-thumb { display: none; }

/* 右侧主内容 */
.main-content { flex: 1; min-width: 0; }
.input-section { background: var(--bg-card); border-radius: 16px; padding: 24px; margin-bottom: 32px; }

/* 图片上传区 */
.upload-area { padding: 24px; margin-bottom: 16px; position: relative; overflow: hidden; }
#uploadPlaceholder { color: var(--text-dim); }
#uploadPlaceholder p { margin-top: 8px; font-size: 14px; color: var(--text-muted); }
#uploadPlaceholder span { font-size: 12px; color: var(--text-faint); }
#uploadPreview { position: relative; }
#uploadPreview img { max-height: 200px; max-width: 100%; border-radius: 8px; object-fit: contain; }
.preview-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; border-radius: 8px; }
#uploadPreview:hover .preview-overlay { opacity: 1; }
.preview-overlay span { color: #fff; font-size: 14px; }

/* 预设样图网格（主内容区） */
.preset-section { margin-bottom: 16px; }
.preset-section-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.preset-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.preset-row::-webkit-scrollbar { height: 4px; }
.preset-row::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }
.preset-card { flex-shrink: 0; width: 100px; background: var(--bg-nested); border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.preset-card:hover { border-color: var(--border-hover); }
.preset-card.active { border-color: var(--accent); }
.preset-card-thumb { width: 100%; aspect-ratio: 3/4; background: var(--bg-page); display: flex; align-items: center; justify-content: center; color: var(--text-placeholder); font-size: 10px; overflow: hidden; }
.preset-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 参数配置 */
.params-toggle { display: flex; align-items: center; gap: 6px; margin-top: 16px; padding: 8px 0; cursor: pointer; font-size: 13px; color: var(--text-dim); user-select: none; transition: color 0.2s; }
.params-toggle:hover { color: var(--text-muted); }
.params-toggle svg { transition: transform 0.2s; }
.params-toggle.open svg { transform: rotate(180deg); }
.params-wrap { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.params-wrap.open { max-height: 600px; }
.params-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding: 4px 0 8px; }
.param-group { background: var(--bg-nested); border-radius: 10px; padding: 12px 14px; }
.param-group label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.param-value { color: #e74c3c; font-weight: 600; font-size: 14px; }
.param-group input[type="range"] { width: 100%; -webkit-appearance: none; height: 4px; background: var(--border); border-radius: 2px; outline: none; }
.param-group input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: var(--accent); border-radius: 50%; cursor: pointer; }
.param-group input[type="number"], .param-group input[type="text"], .param-group select { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); padding: 6px 10px; font-size: 14px; outline: none; }
.param-group input[type="number"]:focus, .param-group input[type="text"]:focus, .param-group select:focus { border-color: var(--accent); }
textarea { width: 100%; min-height: 60px; background: var(--bg-nested); border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary); padding: 12px; font-size: 14px; resize: vertical; outline: none; transition: border-color 0.2s; }
textarea:focus { border-color: var(--accent); }
.prompt-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.btn-ai { padding: 5px 12px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 8px; font-size: 12px; cursor: pointer; transition: opacity 0.2s; }
.btn-ai:hover { opacity: 0.85; }
.btn-ai:disabled { opacity: 0.5; cursor: not-allowed; }
textarea::placeholder { color: var(--text-dim); }
.btn-row { display: flex; gap: 12px; margin-top: 16px; align-items: center; }
button { flex: 1; padding: 12px 0; border: none; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; transform: none; }

/* 进度区 */
.progress-section { background: var(--bg-card); border-radius: 16px; padding: 24px; margin-bottom: 32px; display: none; }
.progress-section.active { display: block; }
.progress-bar-wrap { height: 6px; background: var(--bg-nested); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.progress-bar { height: 100%; width: 30%; background: linear-gradient(90deg, #667eea, #764ba2); border-radius: 3px; }
.progress-bar.running { animation: progressSlide 2s ease-in-out infinite; }
@keyframes progressSlide { 0% { width: 15%; margin-left: 0; } 50% { width: 40%; margin-left: 30%; } 100% { width: 15%; margin-left: 85%; } }
.progress-bar.running { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.status-text { font-size: 14px; color: var(--text-muted); margin-top: 8px; }

/* 个人记录区 */
.history-section { background: var(--bg-card); border-radius: 16px; padding: 24px; margin-bottom: 32px; }

/* 错误提示 */
.error-toast { display: none; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #e74c3c; color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 14px; z-index: 999; }
.error-toast.active { display: block; }

/* 导航 */
.nav-bar { display: flex; align-items: center; gap: 16px; }
.nav-bar a { color: var(--text-dim); font-size: 13px; text-decoration: none; transition: color 0.2s; }
.nav-bar a:hover { color: var(--accent); }

/* 移动端 LoRA 横向选择 */
.lora-mobile { display: none; margin-bottom: 16px; }
.lora-mobile-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.lora-mobile-scroll::-webkit-scrollbar { height: 3px; }
.lora-mobile-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }
.lora-mobile-chip { flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--bg-card); border-radius: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; border: 1px solid transparent; transition: all 0.2s; white-space: nowrap; }
.lora-mobile-chip.active { border-color: var(--accent); color: var(--accent); }
.lora-mobile-chip img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }
.lora-mobile-tags { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.lora-mobile-tags::-webkit-scrollbar { display: none; }
.lora-mobile-tags .lora-tag { flex-shrink: 0; }
.lora-mobile-desc { font-size: 12px; color: var(--text-dim); padding: 4px 4px 0; line-height: 1.4; max-height: 0; overflow: hidden; transition: max-height 0.2s; }
.lora-mobile-desc.show { max-height: 60px; }
.lora-mobile-scroll { margin-top: 4px; }

/* 并发限制密码弹窗 */
.concurrent-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; justify-content: center; align-items: center; }
.concurrent-modal.active { display: flex; }
.concurrent-box { background: var(--bg-card); border-radius: 16px; padding: 32px; width: 320px; text-align: center; }
.concurrent-box p { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.concurrent-box input { width: 100%; padding: 10px 14px; background: var(--bg-nested); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 14px; outline: none; margin-bottom: 12px; }
.concurrent-box input:focus { border-color: var(--accent); }
.concurrent-box .btn-row-modal { display: flex; gap: 8px; }
.concurrent-box button { flex: 1; padding: 10px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.concurrent-box .btn-cancel { background: var(--btn-cancel-bg); color: var(--btn-cancel-text); }
.concurrent-box .btn-confirm { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }

/* 新手引导 */
.tour-overlay { display: none; position: fixed; inset: 0; z-index: 9000; }
.tour-overlay.active { display: block; }
.tour-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.tour-highlight { position: relative; z-index: 9001 !important; }
.tour-highlight::after { content: ''; position: absolute; inset: -4px; border-radius: 12px; border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(102,126,234,0.4); pointer-events: none; }
.tour-tooltip { position: fixed; z-index: 9002; background: var(--bg-card); border-radius: 14px; padding: 20px; max-width: 300px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); animation: tourFadeIn 0.3s ease; }
@keyframes tourFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.tour-tooltip-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.tour-tooltip-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }
.tour-tooltip-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tour-tooltip-actions button { flex: none; padding: 8px 18px; border-radius: 8px; font-size: 13px; cursor: pointer; border: none; }
.tour-btn-skip { background: var(--btn-cancel-bg); color: var(--btn-cancel-text); }
.tour-btn-next { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.tour-step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.tour-dot.active { background: var(--accent); width: 18px; border-radius: 3px; }

/* 移动端响应 */
@media (max-width: 768px) {
  .page-header { padding: 10px 16px; }
  h1 { font-size: 15px; }
  .container { flex-direction: column; padding: 12px 16px; gap: 0; }
  .lora-panel { display: none; }
  .lora-mobile { display: block; }
  .main-content { width: 100%; }
  .params-grid { grid-template-columns: 1fr 1fr; }
  .mode-tabs { overflow-x: auto; scrollbar-width: none; }
  .mode-tabs::-webkit-scrollbar { display: none; }
  .mode-tab { flex: none; padding: 8px 14px; white-space: nowrap; font-size: 12px; }
  .dual-upload { flex-direction: column; gap: 10px; }
}
@media (max-width: 480px) {
  .params-grid { grid-template-columns: 1fr; }
}
