:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1f2329;
  --ink-2: #5b6573;
  --ink-3: #9aa3af;
  --line: #eceef1;
  --accent: #ff2e4d;
  --accent-soft: #fff0f2;
  --accent-ink: #d81e3c;
  --brand: #ff2e4d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(31, 35, 41, 0.06);
  --shadow-lg: 0 12px 40px rgba(31, 35, 41, 0.12);
}

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

/* 关键修复：确保 hidden 属性始终隐藏元素（作者样式的 display 会覆盖浏览器默认的 [hidden]{display:none}，
   此前 .modal-mask{display:flex} 导致遮罩层一直盖住整个页面、且详情关不掉、全页点不动） */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ===== 上导航 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 11px; color: var(--ink-3); }

.tabs { display: flex; gap: 6px; margin-left: 8px; }
.tab {
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; color: var(--ink-2);
  padding: 8px 16px; border-radius: 999px;
  transition: all .18s ease;
}
.tab:hover { background: var(--line); }
.tab.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.model-indicator {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-2);
  background: var(--line); padding: 6px 12px; border-radius: 999px;
}
.model-indicator .dot { width: 8px; height: 8px; border-radius: 50%; background: #2bb673; }
.topbar-download {
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
  font-size: 13px; font-weight: 600; color: #d11; background: #fff1f3;
  border: 1px solid #ffd5db; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  transition: all .15s ease;
}
.topbar-download:hover { background: #ffe3e8; border-color: #ffb3c0; }

/* ===== 主舞台 ===== */
.stage { max-width: 1180px; margin: 0 auto; padding: 22px; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ===== 首页布局 ===== */
.home-grid { display: grid; grid-template-columns: 240px 1fr 1fr; gap: 20px; align-items: start; }
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.lbl { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 9px; font-weight: 600; }

.model-select { display: flex; flex-wrap: wrap; gap: 8px; }
.model-chip {
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 13px; color: var(--ink-2); padding: 8px 14px; border-radius: 999px;
  transition: all .15s ease;
}
.model-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.model-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.need-input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 14px; resize: vertical; font-family: inherit;
  background: #fafbfc; color: var(--ink); line-height: 1.6;
}
.need-input:focus { outline: none; border-color: var(--accent); background: #fff; }

.param-panel { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: #fafbfc; }
.param-panel summary { cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 600; user-select: none; }
.params { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.param-row { display: flex; align-items: flex-start; gap: 12px; }
.param-name { flex: 0 0 64px; font-size: 13px; color: var(--ink-2); padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); padding: 6px 12px; border-radius: 999px;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* 图片角度（合并数量）：三个角度各带 0–18 数字下拉，三者之和 ≤ 18 */
.angle-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.angle-item { display: inline-flex; align-items: center; gap: 6px; }
.angle-label { font-size: 13px; color: var(--ink-2); }
.angle-num {
  width: 60px; padding: 5px 8px; font-size: 13px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-1); cursor: pointer;
}
.angle-num:hover { border-color: var(--accent); }
.angle-hint { flex-basis: 100%; font-size: 12px; color: var(--ink-3); padding-top: 2px; }
.angle-hint.err { color: #d33; font-weight: 600; }

.btn-primary {
  width: 100%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
  padding: 14px; border-radius: var(--radius-sm); margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s ease, transform .05s ease;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .65; cursor: default; }

.hint { font-size: 12px; color: var(--ink-3); margin-top: 10px; text-align: center; }

/* ===== 结果区 ===== */
.result { min-height: 420px; }
.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 420px; color: var(--ink-3); text-align: center; gap: 14px; }
.empty-emoji { font-size: 46px; }

.compliance {
  font-size: 12.5px; padding: 10px 12px; border-radius: var(--radius-sm);
  margin-bottom: 14px; line-height: 1.5;
}
.compliance.ok { background: #eafaf1; color: #1f8a4c; }
.compliance.warn { background: #fff7e6; color: #b8770a; }

.copy-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; background: #fff; margin-bottom: 16px; }
.copy-title { font-size: 18px; line-height: 1.4; margin-bottom: 10px; color: var(--ink); }
.copy-body { font-size: 14px; line-height: 1.85; color: var(--ink); white-space: pre-wrap; }
.copy-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.copy-tags span { font-size: 12.5px; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.img-grid img, .img-grid video { width: 100%; border-radius: var(--radius-sm); display: block; border: 1px solid var(--line); }
.img-grid .live-img { animation: kenburns 6s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.07); } }

.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-ghost {
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 13px; color: var(--ink-2); padding: 9px 14px; border-radius: var(--radius-sm);
  transition: all .15s ease;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-danger-ghost { border: 1px solid #ffd9de; background: #fff; cursor: pointer; font-size: 13px; color: var(--accent-ink); padding: 9px 14px; border-radius: var(--radius-sm); }
.btn-danger-ghost:hover { background: var(--accent-soft); }
.btn-danger-ghost:disabled { opacity: .4; cursor: default; }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 内容库 ===== */
.library-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.lib-search { flex: 1 1 240px; min-width: 200px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; font-size: 14px; background: #fff; }
.lib-search:focus { outline: none; border-color: var(--accent); }
.cat-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-chip { border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 7px 13px; border-radius: 999px; }
.cat-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.lib-actions { display: flex; gap: 8px; margin-left: auto; }

.lib-empty { text-align: center; color: var(--ink-3); padding: 60px 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.note-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
}
.note-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.note-card.sel { outline: 2px solid var(--accent); }
.note-thumb { width: 100%; aspect-ratio: 9/10; object-fit: cover; background: #f0f1f3; display: block; }
.note-meta { padding: 12px 14px; }
.note-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.note-tags span { font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; }
.note-date { font-size: 11px; color: var(--ink-3); }
.note-check { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.9); border: 1px solid var(--line); display: none; align-items: center; justify-content: center; font-size: 13px; color: var(--accent); }
.note-card.sel .note-check { display: flex; }
.select-mode .note-card .note-check { display: flex; }
.lib-count { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 18px; }

/* ===== 设置 ===== */
.settings-stack { display: flex; flex-direction: column; gap: 16px; max-width: 720px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; margin-bottom: 6px; }
.card-desc { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.6; }
.card.danger { border-color: #ffd9de; }
.select, .input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; background: #fafbfc; color: var(--ink); font-family: inherit; }
.select:focus, .input:focus { outline: none; border-color: var(--accent); background: #fff; }
.set-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.set-row label { flex: 0 0 84px; font-size: 13px; color: var(--ink-2); }
.set-row .select, .set-row .input { flex: 1; }
.api-msg { font-size: 12.5px; margin-left: 8px; }
.api-msg.ok { color: #1f8a4c; }
.api-msg.err { color: var(--accent-ink); }
.set-row-inline { align-items: center; }
.set-row-inline .chk { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.set-row-inline .chk input { width: auto; }
.set-row label small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.prov-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: rgba(128,128,128,0.07); }
.prov-card .prov-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.prov-card .prov-head .select { flex: 1; }
.prov-card .prov-del { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.prov-card .set-row { margin-bottom: 8px; }
.prov-card .set-row label { flex: 0 0 74px; }
.prov-tip { font-size: 12px; color: var(--ink-3); background: rgba(255,170,0,0.08); border: 1px solid rgba(255,170,0,0.28); border-radius: 10px; padding: 9px 12px; margin: 2px 0 12px; line-height: 1.6; }
.prov-tip code { background: rgba(128,128,128,0.16); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }
#providersList:empty::after { content: '尚未添加任何服务商'; display: block; color: var(--ink-3); font-size: 13px; margin-bottom: 10px; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
#arkBox textarea.input { min-height: 64px; resize: vertical; line-height: 1.5; }
.guide { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.guide-item { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(31,35,41,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.modal-close { border: none; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink-3); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-body label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 6px; font-weight: 600; }
.modal-body input, .modal-body textarea, .modal-body select { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fafbfc; }
.modal-body textarea { resize: vertical; line-height: 1.7; }
.modal-body input:focus, .modal-body textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.img-preview-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 8px; }
.img-preview-row img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 13px; padding: 11px 20px; border-radius: 999px; z-index: 200; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; } }

/* ===== 参考素材面板 ===== */
.ref-panel { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.ref-head { font-size: 12.5px; color: var(--accent-ink); font-weight: 600; margin-bottom: 8px; }
.ref-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-bottom: 8px; }
.ref-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.ref-txts { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.ref-txts li { margin-bottom: 2px; }

/* ===== 灯箱（图片放大） ===== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 20px; }
.lb-close { position: absolute; top: 18px; right: 22px; width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 18px; cursor: pointer; }
.lb-close:hover { background: rgba(255,255,255,.3); }
.lb-stage { display: flex; align-items: center; justify-content: center; }

/* ===== 内容库 · 素材库上传模块 ===== */
.lib-assets { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; box-shadow: var(--shadow); }
.asset-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.asset-title { font-size: 15px; }
.upload-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.asset-cat-sel { width: auto; min-width: 96px; }
.asset-file { font-size: 13px; max-width: 240px; }
.asset-tip { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin: 10px 0 14px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.asset-empty { grid-column: 1 / -1; text-align: center; color: var(--ink-3); padding: 26px 0; font-size: 13px; }
.asset-card { background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.asset-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; cursor: zoom-in; }
.asset-thumb.link-thumb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #eef4ff; color: #2b6cb0; text-decoration: none; cursor: pointer; }
.asset-thumb.link-thumb .link-icon { font-size: 26px; }
.asset-thumb.link-thumb .link-host { font-size: 11px; color: #2b6cb0; word-break: break-all; padding: 0 8px; text-align: center; }
.asset-tag.link { background: #2b6cb0; }
.asset-text { padding: 12px; font-size: 12px; color: var(--ink-2); line-height: 1.6; height: 100%; min-height: 96px; cursor: zoom-in; background: #fff; }
.asset-meta { display: flex; align-items: center; justify-content: space-between; padding: 7px 9px; border-top: 1px solid var(--line); }
.asset-cat { font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.asset-del { border: none; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 13px; }
.asset-del:hover { color: var(--accent-ink); }
.asset-name { font-size: 11px; color: var(--ink-3); padding: 0 9px 9px; word-break: break-all; }
.asset-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; color: #fff; background: rgba(31,35,41,.7); padding: 2px 7px; border-radius: 999px; }
.asset-tag.file { background: var(--accent-ink); }
.asset-snip { font-size: 11px; line-height: 1.4; color: var(--muted); padding: 0 9px 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
/* 创作需求旁：上传参考文件 */
.need-attach { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.attach-btn { font-size: 13px; }
.hidden-file { display: none; }
.attach-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
/* 参考权重滑块 */
.weight-ctrl { display: flex; align-items: center; gap: 12px; flex: 1; }
.weight-range { flex: 1; accent-color: var(--accent-ink); height: 4px; cursor: pointer; }
.weight-val { font-size: 13px; font-weight: 700; color: var(--accent-ink); min-width: 42px; text-align: right; }
/* 文档类素材卡片：文件图标 + 扩展名徽标 */
.file-thumb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: #eef1f5; cursor: pointer; }
.file-icon { font-size: 38px; line-height: 1; }
.file-ext { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; letter-spacing: .5px; }

/* ===== 保存路径弹窗 ===== */
.path-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.path-list li { font-size: 13px; color: var(--ink); background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ===== 左侧竖栏：项目 ===== */
.rail {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 100px); overflow: hidden;
}
.rail-head { display: flex; align-items: center; justify-content: space-between; }
.rail-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.rail-add { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; width: 30px; height: 30px; border-radius: 9px; font-size: 18px; line-height: 1; transition: filter .15s ease; }
.rail-add:hover { filter: brightness(.97); }
.proj-name-wrap { margin: 0; }
.proj-name-input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; background: #fafbfc; font-family: inherit; }
.proj-name-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.proj-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; padding-right: 2px; }
.proj-empty { font-size: 12px; color: var(--ink-3); line-height: 1.6; background: #fafbfc; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px; }
.proj-card {
  position: relative; background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.proj-card:hover { border-color: var(--accent); }
.proj-card.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.proj-del { position: absolute; top: 6px; right: 6px; border: none; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.proj-del:hover { color: var(--accent-ink); background: #fff; }
.proj-name { font-size: 13.5px; font-weight: 700; color: var(--ink); padding-right: 18px; margin-bottom: 4px; }
.proj-need { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin-bottom: 4px; }
.proj-meta { font-size: 11px; color: var(--ink-3); }
.proj-status { margin-top: 6px; font-size: 11px; font-weight: 600; }
.proj-status.running { color: var(--accent-ink); }
.proj-status.done { color: #1f8a4c; }
.proj-status.error { color: var(--accent-ink); }
.rail-gen { font-size: 14px; padding: 11px; margin-top: 2px; }
.rail-hint { font-size: 11px; color: var(--ink-3); line-height: 1.6; margin: 0; }

/* 创作需求旁：需求文件清单 */
.need-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.need-url-hint { margin-top: 8px; font-size: 12px; color: #1f6f9c; background: #eaf5fb; border: 1px solid #cfe6f3; border-radius: 8px; padding: 7px 10px; line-height: 1.5; }
.nf-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); border: 1px solid #ffd9de; border-radius: 999px; padding: 4px 8px 4px 10px; font-size: 12px; color: var(--accent-ink); max-width: 100%; }
.nf-chip .nf-ico { font-size: 13px; }
.nf-chip .nf-name { color: var(--accent-ink); text-decoration: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-chip .nf-name:hover { text-decoration: underline; }
.nf-chip .nf-tag { font-size: 10px; background: #fff; border: 1px solid #ffd9de; border-radius: 999px; padding: 1px 6px; color: var(--accent-ink); }
.nf-chip .nf-del { border: none; background: transparent; color: var(--accent-ink); cursor: pointer; font-size: 12px; line-height: 1; padding: 0 2px; }
.nf-chip .nf-del:hover { color: #fff; background: var(--accent); border-radius: 50%; }
.nf-chip.static { cursor: pointer; }
.nf-chip .nf-tag.ocr { color: #1f7a4d; border-color: #bfe6d2; }
.nf-chip .nf-tag.pending { color: var(--accent); border-color: #ffd9de; opacity: .85; }
.nf-chip .nf-ocr { border: 1px solid var(--accent); background: #fff; color: var(--accent-ink); border-radius: 999px; padding: 1px 8px; font-size: 10px; cursor: pointer; line-height: 1.4; }
.nf-chip .nf-ocr:hover { background: var(--accent); color: #fff; }
.nf-chip { flex-wrap: wrap; }
.nf-snip { flex-basis: 100%; width: 100%; font-size: 11px; color: var(--ink-3); background: #fff; border: 1px dashed #ffd9de; border-radius: 6px; padding: 3px 7px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 内容库子板块切换 ===== */
.lib-subtabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.lib-subtab { border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13.5px; color: var(--ink-2); padding: 9px 16px; border-radius: 999px; transition: all .15s ease; }
.lib-subtab:hover { border-color: var(--accent); color: var(--accent-ink); }
.lib-subtab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ===== 创作历史 ===== */
.hist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hist-head h3 { font-size: 15px; }
.hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.hist-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.hist-card:hover { box-shadow: var(--shadow-lg); }
.hist-thumb { width: 100%; aspect-ratio: 16/7; background: #f0f1f3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hist-noimg { font-size: 30px; }
.hist-body { padding: 12px 14px; flex: 1; }
.hist-title { font-size: 14.5px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; color: var(--ink); }
.hist-need { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin-bottom: 6px; }
.hist-tag.url { display: inline-block; margin-left: 6px; padding: 1px 7px; font-size: 11px; font-weight: 600; color: #1f6f9c; background: #eaf5fb; border: 1px solid #cfe6f3; border-radius: 999px; vertical-align: middle; }
.hist-params { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.hist-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ink-3); }
.hist-proj { color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.hist-actions { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.btn-ghost.sm, .btn-danger-ghost.sm { font-size: 12px; padding: 6px 11px; }
.hist-needfiles { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.kv { font-size: 13px; color: var(--ink); line-height: 1.7; background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }

/* ===== 响应式：移动端 ===== */
@media (max-width: 820px) {
  .home-grid { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tab { flex: 1; }
  .model-indicator { margin-left: 0; }
  .stage { padding: 14px; }
  .param-name { flex-basis: 56px; }
  .lib-actions { margin-left: 0; width: 100%; }
  .asset-toolbar { flex-direction: column; align-items: flex-start; }
}

/* 顶栏用户框 */
.user-box { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.ub-name { font-size: 13px; color: var(--ink-2); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-logout { border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 12px; padding: 5px 10px; border-radius: 999px; transition: all .15s ease; }
.ub-logout:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.ub-import { border: 1px dashed var(--line); background: #fff; color: var(--accent-ink); cursor: pointer; font-size: 12px; padding: 5px 10px; border-radius: 999px; transition: all .15s ease; }
.ub-import:hover { border-color: var(--accent); background: var(--accent-soft); }

/* 登录 / 注册 遮罩 */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,46,77,.10), rgba(255,142,160,.18)), rgba(20,22,28,.55);
  backdrop-filter: blur(4px); padding: 20px;
}
.auth-card {
  width: 360px; max-width: 92vw;
  background: #fff; border-radius: 18px; padding: 28px 26px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  display: flex; flex-direction: column; gap: 12px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.auth-brand strong { font-size: 16px; color: var(--ink); }
.auth-sub { margin: -4px 0 4px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.auth-tabs { display: flex; gap: 6px; background: #f3f4f6; border-radius: 999px; padding: 4px; }
.auth-tab { flex: 1; border: none; background: transparent; cursor: pointer; font-size: 13.5px; color: var(--ink-2); padding: 8px 0; border-radius: 999px; transition: all .15s ease; }
.auth-tab.active { background: #fff; color: var(--accent-ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.auth-input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fafbfc; }
.auth-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.auth-submit { margin-top: 4px; padding: 12px; font-size: 15px; }
.auth-err { margin: 0; font-size: 12.5px; color: #d33; min-height: 16px; text-align: center; }
.auth-wechat { border: 1px dashed var(--line); background: #fafbfc; color: var(--ink-3); cursor: not-allowed; font-size: 13px; padding: 10px; border-radius: 10px; }
.auth-wechat:not(:disabled) { cursor: pointer; color: #07c160; border-color: #bfe9cd; }
.auth-download {
  display: block; text-align: center; margin-top: 4px; font-size: 13px;
  color: #d11; text-decoration: none; padding: 6px 0;
}
.auth-download:hover { text-decoration: underline; }
.auth-code-row { display: flex; gap: 8px; align-items: stretch; }
.auth-code-row .auth-input { flex: 1; }
.auth-code-btn { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); border-radius: 10px; padding: 0 12px; font-size: 13px; cursor: pointer; white-space: nowrap; transition: all .15s ease; }
.auth-code-btn:hover:not(:disabled) { background: #ffe6ef; }
.auth-code-btn:disabled { opacity: .6; cursor: not-allowed; }
.link-box { margin-top: 6px; }
.asset-link { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; background: #fafbfc; }
.asset-link:focus { outline: none; border-color: var(--accent); background: #fff; }
