* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f4f5f7; --card: #ffffff; --line: #ececec;
  --gold: #b98a2f; --gold-2: #d4a94e;
  --fire: linear-gradient(135deg, #e8542f, #d13c1e);
  --brown: linear-gradient(135deg, #b0703a, #8a4d22);
  --text: #2b2b2b; --muted: #9a9a9a;
}
body { font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

.layout { display: flex; min-height: 100vh; }

/* ===== 侧边导航 ===== */
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 18px; font-weight: 700; padding: 4px 10px 16px; }
.brand span { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.nav-group { font-size: 12px; color: var(--muted); padding: 14px 10px 6px; }
.nav-item { display: block; padding: 9px 12px; border-radius: 8px; color: #444; text-decoration: none; cursor: pointer; margin-bottom: 2px; }
.nav-item:hover { background: #f6f2e8; }
.nav-item.active { background: linear-gradient(135deg, #f3e3bb, #ead096); color: #6b4f14; font-weight: 600; }
.sidebar-foot { margin-top: auto; font-size: 11px; color: var(--muted); padding: 10px; }

/* ===== 主区 ===== */
.main { flex: 1; padding: 0 26px 60px; min-width: 0; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 0; }
.search { width: 300px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 20px; outline: none; background: #fff; }
.user-chip { padding: 7px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; cursor: pointer; }
.user-chip:hover { border-color: var(--gold-2); }

.page { display: none; }
.page.active { display: block; }
.page-title { font-size: 20px; font-weight: 700; margin: 18px 0 16px; }
.page-title .muted { font-size: 13px; font-weight: 400; margin-left: 10px; }

/* 工具切换标签（复刻参考图的金色 pill） */
.tool-tabs { display: flex; justify-content: center; gap: 4px; margin: 10px 0 18px; }
.tool-tab { border: none; background: transparent; padding: 8px 22px; border-radius: 18px; cursor: pointer; font-size: 14px; color: #666; }
.tool-tab.active { background: linear-gradient(135deg, #e8c877, #cfa13d); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(190, 150, 60, .35); }

.card { background: var(--card); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card h3 { font-size: 15px; margin-bottom: 12px; }

/* ===== 对话生图 ===== */
.chat-card { padding: 16px; }
.chat-input-row { display: flex; gap: 12px; align-items: flex-start; }
.chat-textarea { flex: 1; min-height: 130px; border: none; outline: none; resize: vertical; font-size: 15px; font-family: inherit; padding-top: 8px; }
.send-btn { width: 44px; height: 44px; border-radius: 12px; border: none; background: linear-gradient(135deg, #e8c877, #cfa13d); color: #fff; font-size: 20px; cursor: pointer; align-self: flex-end; flex-shrink: 0; }
.send-btn:disabled { opacity: .7; cursor: not-allowed; }

.mini-uploader { width: 64px; height: 64px; border: 1.5px dashed #d9c08a; border-radius: 12px; background: #fdf9ef; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; color: #b98a2f; flex-shrink: 0; position: relative; }
.mini-uploader:hover { background: #f7efdb; }
.mini-uploader-plus { font-size: 18px; line-height: 1; }
.mini-uploader-text { font-size: 11px; margin-top: 3px; }
.chat-thumbs { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; }
.chat-thumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.opt-card .opt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.opt-row.wrap { flex-wrap: wrap; }
.opt-row label { color: #888; font-size: 13px; }
.opt-row label.ml { margin-left: 12px; }
.select { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; outline: none; min-width: 150px; }
.select.narrow { min-width: 70px; }
.select.full { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fafafa; padding: 6px 14px; border-radius: 16px; cursor: pointer; font-size: 13px; color: #555; }
.chip:hover { border-color: var(--gold-2); }
.chip.active { background: linear-gradient(135deg, #f3e3bb, #e6c887); border-color: #d4b05e; color: #6b4f14; font-weight: 600; }

.fold-row { background: #f7f7f8; border-radius: 10px; padding: 12px 16px; color: #888; cursor: pointer; margin-top: 10px; font-size: 13px; }
.fold-row::before { content: "▸ "; }
.fold-body { padding: 12px 4px 0; display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }

.input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; font-size: 14px; margin-bottom: 10px; }
.input:focus { border-color: var(--gold-2); }

.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.result-head h3 { margin-bottom: 0; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.result-grid.empty { display: block; color: var(--muted); text-align: center; padding: 50px 0; }
.result-grid.five { grid-template-columns: repeat(5, 1fr); }
.result-grid.detail { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.result-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fafafa; }
.result-item img { width: 100%; display: block; }
.result-item .ri-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 12px; color: #777; }
.result-item .ri-bar a { color: var(--gold); text-decoration: none; cursor: pointer; }
.result-slot { border: 1.5px dashed #ddd; border-radius: 12px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: #bbb; background: #fafafa; }

/* ===== 按钮 ===== */
.btn { border: none; border-radius: 10px; padding: 10px 22px; cursor: pointer; font-size: 14px; }
.btn.gold { background: linear-gradient(135deg, #e2bd6a, #c09030); color: #fff; font-weight: 600; }
.btn.fire { background: var(--fire); color: #fff; font-weight: 600; padding: 10px 30px; box-shadow: 0 3px 10px rgba(220, 70, 30, .3); }
.btn.brown { background: var(--brown); color: #fff; font-weight: 600; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: #666; }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.btn.full { width: 100%; margin-top: 6px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 生成中：转圈 + 禁用 */
.loading { position: relative; pointer-events: none; opacity: .75; }
.loading::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
.btn.ghost.loading::after { border-color: rgba(150,120,50,.3); border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== banner（图二/图三头部） ===== */
.banner { background: linear-gradient(135deg, #fdf6e7, #f8ecd4); border-radius: 14px; padding: 22px 28px; margin-bottom: 16px; position: relative; }
.banner.warm { background: linear-gradient(135deg, #fdf8ec, #f5e9d0); }
.banner-kicker { color: #b98a2f; font-size: 13px; margin-bottom: 6px; }
.banner-title { font-weight: 700; font-size: 17px; }
.banner-title.big { font-size: 24px; }
.banner-sub { color: #99885e; margin-top: 6px; }
.banner-tag { position: absolute; right: 22px; top: 22px; background: #fff; border: 1px solid #eadfc4; color: #8a7434; padding: 5px 12px; border-radius: 14px; font-size: 12px; }

/* ===== 模板库 ===== */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tpl-card { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; }
.tpl-card.sel { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(212,169,78,.25); }
.tpl-thumb { height: 100px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; }
.tpl-thumb i { border-radius: 6px; display: block; }
.tpl-name { padding: 8px 10px 2px; font-size: 13px; font-weight: 600; }
.tpl-meta { padding: 0 10px 8px; font-size: 12px; color: var(--muted); }

/* ===== 上传组件 ===== */
.up-zone { border: 1.5px dashed #e0d5bd; border-radius: 12px; background: #fdfcf7; padding: 18px; cursor: pointer; margin-bottom: 16px; }
.up-zone:hover { background: #faf5e8; }
.up-zone.tall { min-height: 120px; }
.up-placeholder { text-align: center; color: #b7a06a; padding: 14px 0; }
.up-placeholder small { color: #c9bda0; }
.up-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.up-item { position: relative; width: 72px; height: 72px; }
.up-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.up-item .del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; background: #d13c1e; color: #fff; border-radius: 50%; font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; }

/* ===== 多角度 ===== */
.two-col { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: start; }
.two-col.narrow { grid-template-columns: 1fr 1fr; max-width: 980px; }
.step-head { font-weight: 600; margin: 6px 0 12px; }
.step-no { display: inline-block; background: #f3e3bb; color: #8a6a1d; border-radius: 6px; padding: 2px 8px; font-size: 12px; margin-right: 8px; }
.step-head .right { float: right; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin: 14px 0; }
.form-grid label { font-size: 13px; color: #888; }
.angle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.angle-card { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; background: #fafafa; }
.angle-card b { display: block; font-size: 14px; }
.angle-card span { font-size: 12px; color: var(--muted); }
.angle-card.sel { border-color: var(--gold-2); background: #fdf6e3; }
.tip { background: #fdf6e7; border-radius: 10px; padding: 10px 14px; font-size: 12px; color: #99885e; margin-top: 14px; }
.angle-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.angle-result-grid.empty { display: block; color: var(--muted); text-align: center; padding: 60px 0; }
.ar-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fafafa; }
.ar-item img { width: 100%; display: block; }
.ar-bar { padding: 8px 10px; }
.ar-bar .ar-name { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; }
.ar-badge { font-size: 11px; color: #3aa981; background: #e5f6ef; border-radius: 8px; padding: 1px 8px; font-weight: 400; }
.ar-ops { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ar-ops a { font-size: 12px; color: #777; background: #f1f1f2; padding: 3px 10px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.ar-ops a:hover { background: #eee4cd; color: #8a6a1d; }
.merge-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 14px; background: #faf6ec; border-radius: 12px; font-size: 13px; color: #77683e; }

/* ===== 素材区 ===== */
.mat-list .mat-folder { background: #fff; border-radius: 14px; padding: 16px 20px; margin-bottom: 14px; }
.mat-folder .mf-head { display: flex; justify-content: space-between; align-items: center; }
.mat-folder .mf-name { font-weight: 700; font-size: 15px; }
.mat-folder .mf-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.mat-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mat-thumbs img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.synced-badge { color: #3aa981; background: #e5f6ef; border-radius: 10px; padding: 3px 10px; font-size: 12px; }
.empty-tip { color: var(--muted); text-align: center; padding: 80px 0; background: #fff; border-radius: 14px; }

/* ===== 配置区 ===== */
.fld { display: block; font-size: 13px; color: #888; margin-bottom: 4px; }
.row-btns { display: flex; gap: 10px; }
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 16px 0; border-top: 1px solid var(--line); padding-top: 14px; }
.me-line { margin-bottom: 8px; }
.badge { background: #f3e3bb; color: #8a6a1d; border-radius: 8px; padding: 2px 8px; font-size: 11px; }
.model-list .model-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.model-item .mi-name { font-weight: 600; }
.model-item .mi-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.model-item.active-model { border-color: var(--gold-2); background: #fdf9ef; }
.mi-ops { display: flex; gap: 8px; }
.mi-ops button { font-size: 12px; padding: 4px 12px; }
.code { background: #2b2b2b; color: #d6e6c8; border-radius: 10px; padding: 14px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow-y: auto; }
.code.tall { max-height: 320px; }
code.inline { background: #f5f2e9; border: 1px solid #ece2c8; border-radius: 6px; padding: 4px 10px; font-size: 12px; color: #7a6428; font-family: "SF Mono", Menlo, monospace; }

.prompt-card { background: #fdfaf3; border: 1px solid #f0e4c6; border-radius: 12px; padding: 14px 16px; margin-top: 14px; }
.prompt-card textarea.input { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; }
.prompt-card textarea.input { background: #fff; }

.note { color: #99885e; font-size: 12px; margin-top: 10px; }
.muted { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; }
.result-foot { margin-top: 14px; text-align: right; }

@media (max-width: 1100px) {
  .two-col, .two-col.narrow { grid-template-columns: 1fr; }
  .result-grid.five { grid-template-columns: repeat(3, 1fr); }
}
