/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0a1628; color: #e0e0e0; min-height: 100vh; }

.app { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

.header { text-align: center; margin-bottom: 24px; }
.header h1 { font-size: 28px; font-weight: 700; color: #fff; }
.header .subtitle { color: #888; margin-top: 6px; font-size: 14px; }

/* 模式 Tab */
.mode-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.mode-tab { padding: 8px 24px; border: 1px solid #1e3355; border-radius: 8px; background: transparent; color: #aaa; font-size: 14px; cursor: pointer; }
.mode-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* 主布局 */
.main { display: flex; gap: 24px; align-items: flex-start; }
.input-panel { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.result-panel { flex: 1; min-height: 400px; background: #111f38; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* 表单 */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: #aaa; font-weight: 500; }
textarea { width: 100%; height: 100px; background: #111f38; border: 1px solid #1e3355; border-radius: 8px; padding: 12px; color: #e0e0e0; font-size: 14px; resize: vertical; outline: none; }
textarea:focus { border-color: #2563eb; }

/* 上传区 */
.upload-area { background: #111f38; border: 2px dashed #1e3355; border-radius: 8px; padding: 16px; cursor: pointer; min-height: 80px; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #666; font-size: 13px; }
.upload-icon { font-size: 28px; }
.preview-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.preview-item { position: relative; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove-btn { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(0,0,0,0.7); color: #fff; border: none; border-radius: 50%; font-size: 11px; cursor: pointer; }

/* 比例 */
.ratio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ratio-btn { padding: 10px 0; background: #111f38; border: 1px solid #1e3355; border-radius: 6px; color: #ccc; font-size: 14px; cursor: pointer; text-align: center; }
.ratio-btn.active { background: #1e3a6e; border-color: #2563eb; color: #60a5fa; }

/* 数量 */
.count-selector, .duration-selector { display: flex; gap: 6px; }
.count-btn, .duration-btn { flex: 1; padding: 8px; background: #111f38; border: 1px solid #1e3355; border-radius: 6px; color: #ccc; font-size: 13px; cursor: pointer; }
.count-btn.active, .duration-btn.active { background: #1e3a6e; border-color: #2563eb; color: #fff; }

/* 按钮 */
.generate-btn { width: 100%; padding: 12px; background: #2563eb; border: none; border-radius: 8px; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.generate-btn:disabled { background: #333; color: #666; cursor: not-allowed; }

/* 状态 */
.status { font-size: 13px; min-height: 20px; text-align: center; }
.status.loading { color: #60a5fa; }
.status.error { color: #f87171; }
.status.success { color: #4ade80; }

/* 结果 */
.result-placeholder { color: #555; font-size: 14px; }
.result-grid { display: none; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 16px; width: 100%; }
.result-grid.show { display: grid; }
.result-card { background: #1a2d4f; border-radius: 8px; overflow: hidden; position: relative; }
.result-card img, .result-card video { width: 100%; display: block; }
.result-card .card-actions { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 6px; }
.result-card .download-btn, .result-card .open-btn { padding: 6px 10px; background: rgba(0,0,0,0.7); border: none; border-radius: 6px; color: #fff; font-size: 12px; cursor: pointer; }
.result-card .open-btn { background: rgba(0,0,0,0.5); }
.result-card.error-card { display: flex; align-items: center; justify-content: center; color: #f87171; font-size: 13px; padding: 16px; min-height: 120px; }

@media (max-width: 800px) {
  .main { flex-direction: column; }
  .input-panel { width: 100%; }
}
