/* 通用隐藏类：多处 JS 用 classList.add/remove('hidden')，必须保留 */
.hidden { display: none !important; }

:root {
  --bg: #13151d;
  --panel: #1d202d;
  --panel-2: #282b38;
  --panel-3: #34394a;
  --line: #3d4356;
  --text: #f1f3f7;
  --muted: #a9afbf;
  --brand: #6d5efc;
  --brand-2: #22d3ee;
  --danger: #ff6b6b;
  --success: #4ade80;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #11131a;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

/* ---- 左侧边栏 ---- */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: 240px;
  background: linear-gradient(180deg, #181b26 0%, #151821 100%);
  border-right: 1px solid #2c3140;
  display: flex; flex-direction: column; padding: 20px 16px;
  z-index: 20;
  box-shadow: 4px 0 24px rgba(0,0,0,.25);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-size: 18px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.brand h1 { font-size: 16px; margin: 0; }
.brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
/* 模块多了会超出窗口高度：列表占满剩余空间并内部滚动，底部按钮区常驻不被挤出 */
.modules { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.module-btn {
  display: flex; align-items: center; gap: 10px;
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-radius: 12px; padding: 8px 12px; font-size: 14px; cursor: pointer; text-align: left;
  text-decoration: none;
  transition: .15s;
}
.module-btn:hover { background: var(--panel-2); color: var(--text); }
/* 侧边栏分组标题 */
.mod-group {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  color: var(--muted); opacity: .65; padding: 0 12px; margin-top: 16px;
}
.mod-group:first-of-type { margin-top: 0; }
/* 侧栏 emoji 定宽：图标宽度不一导致文字对不齐；360 等老浏览器缺字形时用常见 emoji 替代 */
.modules .mi, .sidebar-foot .mi { display: inline-block; width: 22px; text-align: center; flex-shrink: 0; }
.module-btn.active { background: var(--panel-2); color: var(--text); border-color: var(--line); box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-foot { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.settings-btn {
  display: block; width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; cursor: pointer;
  text-align: left; text-decoration: none; line-height: 1.4;
}
.settings-btn:hover { border-color: var(--brand); }

/* ---- 主内容区 ---- */
.app {
  margin-left: 240px;
  min-height: 100vh;
  padding: 28px 32px;
  display: flex; flex-direction: column; /* 内容不足一屏时让页脚沉底 */
  background: linear-gradient(180deg, #131520 0%, #161823 100%);
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.state-badge {
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: 12px;
}
.state-badge.live { background: rgba(74,222,128,.12); color: var(--success); border-color: rgba(74,222,128,.25); }

/* ---- 模块切换 ---- */
.module { display: none; }
.module.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- 卡片布局 ---- */
.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 24px;
  align-items: start;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px;
  box-shadow: 0 10px 32px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.06);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: .6;
}
.card h3 { font-size: 14px; margin: 0 0 16px; color: var(--text); font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.recharge-pill { background: rgba(245,196,81,.12); border-color: rgba(245,196,81,.45); color: #ffd97a; }
.recharge-pill:hover { background: rgba(245,196,81,.2); border-color: rgba(245,196,81,.7); color: #fff; }
.prompt-card { grid-column: 1; grid-row: 1 / 3; }
.options-card { grid-column: 1; grid-row: 3; }
.gallery-card { grid-column: 2; grid-row: 1 / 4; min-height: 420px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field.row { display: flex; gap: 12px; }
.field.row > div { flex: 1; }
textarea, input, select {
  width: 100%; background: #141621; color: var(--text);
  border: 1px solid #3d4356; border-radius: 12px; padding: 12px 14px;
  font-size: 14px; font-family: inherit; outline: none; transition: .15s;
}
textarea { resize: vertical; min-height: 100px; }
textarea:focus, input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,94,252,.18); background: #171925; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #181b26; color: var(--text); border: 1px solid #3d4356;
  border-radius: 999px; padding: 8px 14px; font-size: 12px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--brand); background: #202436; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- 创作场景 tab ---- */
.scene-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.scene-tab {
  background: #181b26; color: var(--muted); border: 1px solid #3d4356;
  border-radius: 10px; padding: 7px 12px; font-size: 12px; cursor: pointer; transition: .15s;
}
.scene-tab:hover { border-color: var(--brand); color: var(--text); }
.scene-tab.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }

.primary {
  width: 100%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border: 0; border-radius: 12px; padding: 12px; font-size: 15px;
  font-weight: 600; cursor: pointer; transition: .15s;
}
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: .6; cursor: not-allowed; }
.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.ghost:hover { color: var(--text); border-color: var(--brand); }
.status { font-size: 12px; color: var(--muted); min-height: 18px; margin: 10px 0 0; }
.status.err { color: var(--danger); }

/* ---- 画廊 ---- */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.empty { grid-column: 1/-1; color: var(--muted); font-size: 13px; text-align: center; padding: 60px 0; }
.result-card {
  position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #141621;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.result-card img,
.result-card.video-card video { width: 100%; display: block; aspect-ratio: 1/1; object-fit: cover; background: #000; }
.result-card .meta {
  font-size: 11px; color: var(--muted); padding: 9px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-all;
  height: 65px; /* 3 行文字 + 内边距，固定高度保证卡片等高 */
}
.result-card .dl {
  position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff;
  border: 0; border-radius: 8px; padding: 6px 8px; font-size: 11px; cursor: pointer;
  opacity: 0; transition: .15s;
}
.result-card:hover .dl { opacity: 1; }
.result-card .badge {
  position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff;
  border-radius: 6px; padding: 3px 7px; font-size: 10px;
}

/* ---- 占位模块 ---- */
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50vh; color: var(--muted); text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 10px 32px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.06);
}
.placeholder::before { display: none; }
.placeholder-icon { font-size: 56px; margin-bottom: 16px; }
.placeholder h3 { font-size: 18px; color: var(--text); margin: 0 0 8px; }
.placeholder p { margin: 0; font-size: 13px; }

/* ---- 短剧模块（预留入口 · 内测中） ---- */
.drama-hero {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  box-shadow: 0 10px 32px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.06);
}
.drama-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: #ffd27a; background: rgba(255,193,94,.14); border: 1px solid rgba(255,193,94,.42);
  border-radius: 999px; padding: 3px 10px;
}
/* 已正式开放（绿）vs 内测中（橙） */
.drama-badge.online {
  color: #7ee2a8; background: rgba(74,222,128,.14); border-color: rgba(74,222,128,.42);
}
.drama-hero h3 { font-size: 21px; color: var(--text); margin: 12px 0 8px; }
.drama-hero p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.75; }
.drama-flow {
  list-style: none; display: grid; gap: 12px; margin: 16px 0 0; padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.drama-flow li { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.drama-flow b {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(109,94,252,.2); color: #c7c0ff; font-size: 12px; margin-bottom: 8px;
}
.drama-flow span { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.drama-flow em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.55; }
.drama-cta {
  margin-top: 16px; background: var(--panel); border: 1px dashed var(--line);
  border-radius: 16px; padding: 18px; text-align: center;
}
.drama-cta-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.drama-cta-btns .primary, .drama-cta-btns .ghost { width: auto; padding: 11px 26px; }
.drama-cta-btns a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.drama-cta .hint { margin: 6px 0 0; }
/* 短剧创作向导 */
.drama-studio { margin-top: 16px; }
.drama-studio .badge-soft { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.drama-studio textarea { width: 100%; margin-top: 10px; }
.drama-topic-row { display: flex; gap: 10px; margin-top: 12px; }
.drama-topic-row input {
  flex: 1; min-width: 0; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px;
}
.drama-topic-row .ghost { width: auto; flex: none; padding: 9px 14px; white-space: nowrap; }
.drama-topic-row select {
  flex: none; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; font-size: 13px; max-width: 190px;
}
.drama-cfg-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.drama-cfg-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.drama-cfg-row select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; font-size: 12px;
}
.drama-cfg-row .hint { margin: 0; font-size: 12px; }
.drama-saved-hint { font-size: 12px; color: var(--muted); opacity: .45; transition: opacity .3s; }
.product.highlight {
  border-color: var(--brand); box-shadow: 0 0 0 2px rgba(109,94,252,.25);
}
.drama-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.drama-actions .ghost, .drama-actions .primary { width: auto; padding: 9px 18px; }
.drama-actions select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 13px;
}
.drama-shots { display: grid; gap: 8px; margin-top: 14px; }
.drama-shot {
  display: flex; gap: 12px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.drama-shot-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(109,94,252,.2); color: #c7c0ff; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.drama-thumb { flex: none; width: 84px; height: 48px; object-fit: cover; border-radius: 8px; background: #000; }
.drama-thumb-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: var(--panel); }
.drama-shot-info { flex: 1; min-width: 0; }
.drama-shot-prompt { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drama-shot-line { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 角色定妆照 */
.drama-cast { margin: 10px 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(127,127,127,.04); }
.drama-cast-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.drama-cast-title { font-weight: 600; font-size: 14px; }
.drama-cast-head .hint { flex: 1 1 260px; }
.drama-cast-list { display: grid; gap: 10px; }
.drama-cast-empty { margin: 2px 0; }
.drama-cast-card { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); }
.drama-cast-img { width: 92px; height: 92px; flex: none; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: rgba(127,127,127,.12); }
.drama-cast-img-empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); text-align: center; cursor: default; }
.drama-cast-fields { flex: 1; display: grid; gap: 6px; min-width: 0; }
.drama-cast-name { font-weight: 600; }
.drama-cast-look { font-size: 12px; resize: vertical; }
.drama-cast-voice-row { display: flex; align-items: center; gap: 8px; }
.drama-cast-voice-label { font-size: 11px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: rgba(109,94,252,.16); color: var(--brand); border: 1px solid rgba(109,94,252,.45); }
.drama-cast-voice-row .drama-cast-voice { flex: 0 1 auto; width: auto; max-width: 240px; min-width: 0; font-size: 12px; }
.drama-cast-ops { display: flex; gap: 6px; align-items: center; }
/* 每镜角色关联 */
.drama-shot-cast { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.drama-shot-castsel { font-size: 12px; padding: 2px 6px; max-width: 120px; }
.drama-cast-ok { color: #16a34a; font-size: 11px; }
.drama-cast-warn { color: #d97706; font-size: 11px; }
.drama-shot-voice { margin-top: 4px; }
.drama-voice-audio { width: 100%; max-width: 220px; height: 28px; }
.drama-shot-status { flex: none; font-size: 12px; color: var(--muted); max-width: 150px; text-align: right; }
.drama-shot-ops { flex: none; display: grid; gap: 6px; justify-items: stretch; }
.drama-shot-ops .ghost.small, .drama-cast-ops .ghost.small { width: auto; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.drama-shot-ops .ghost.small.danger, .drama-cast-ops .ghost.small.danger { color: var(--danger); border-color: rgba(255,107,107,.45); }
.drama-shot-ops .ghost.small.danger:hover, .drama-cast-ops .ghost.small.danger:hover { background: rgba(255,107,107,.12); border-color: var(--danger); }
.drama-shot-ops .ghost.small:disabled { opacity: .55; cursor: not-allowed; }
/* 轻提示（删除结果反馈） */
.app-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: rgba(20,20,24,.92); color: #fff; font-size: 13px; line-height: 1.5;
  padding: 9px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; transition: .2s; z-index: 999; max-width: 82vw;
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-toast.err { background: rgba(153,27,27,.94); }
.drama-thumb[data-i] { cursor: zoom-in; }
.drama-lightbox {
  position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.86);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.drama-lightbox.hidden { display: none; }
.drama-lightbox img, .drama-lightbox video {
  max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
@media (max-width: 860px) {
  .drama-shot { flex-wrap: wrap; }
  .drama-shot-ops { flex-direction: row; }
  /* 触摸设备没有 hover：下载/删除/复用按钮常驻可见，否则手机上等于没有入口 */
  .result-card .dl, .result-card .del, .result-card .reuse { opacity: 1; }
}
.drama-final { margin-top: 16px; }
.drama-final h4 { margin: 0 0 10px; font-size: 15px; color: var(--text); }
.drama-final .hint a { color: var(--brand); }
/* 成片展位：限宽限高居中，保持原始比例（竖版成片不再被撑满全屏） */
.drama-final video { display: block; width: auto; height: auto; max-width: min(100%, 640px); max-height: 60vh; margin: 0 auto; border-radius: 12px; background: #000; }
.drama-modal-card { width: min(560px, 94vw); }
.drama-video {
  width: 100%; aspect-ratio: 1120 / 832; display: block; border-radius: 12px;
  background: #000; margin-bottom: 12px;
}
.field .req { color: #ff7b7b; font-style: normal; }

/* ---- 弹窗 ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(420px, 92vw); }
.modal-card h3 { margin: 0 0 18px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-actions .primary { width: auto; padding: 10px 22px; }

/* ---- 头部胶囊：状态 + 额度 ---- */
.header-pills { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.quota-pill {
  background: rgba(109,94,252,.14); color: #c7c0ff; border: 1px solid rgba(109,94,252,.4);
  border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; user-select: none; transition: filter .15s ease, border-color .15s ease;
}
.quota-pill:hover { filter: brightness(1.15); border-color: rgba(109,94,252,.7); }
.quota-pill.member:hover { border-color: rgba(245,196,81,.75); }
.quota-pill.empty {
  background: rgba(255,107,107,.14); color: #ff9b9b; border-color: rgba(255,107,107,.4);
}
.state-badge {
  background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 12px;
}
.state-badge.live { color: #8ef0c0; border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.1); }

/* ---- 广告位骨架 ---- */
.ad-slot {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  background: repeating-linear-gradient(45deg, #161922, #161922 12px, #191c27 12px, #191c27 24px);
  border: 1px dashed #3d4356; border-radius: 12px; padding: 12px 14px; color: var(--muted);
}
.ad-tag {
  background: #3d4356; color: #cfd4e0; font-size: 10px; border-radius: 4px; padding: 2px 6px;
}
.ad-text { font-size: 12px; }

/* ---- 激励视频按钮 ---- */
.reward-btn {
  width: 100%; margin-top: 10px; background: rgba(34,211,238,.12); color: #7fe7f5;
  border: 1px solid rgba(34,211,238,.4); border-radius: 12px; padding: 11px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
}
.reward-btn:hover { background: rgba(34,211,238,.2); }

/* ---- 关于 / 状态 ---- */
.about-status { font-size: 14px; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.mock { background: #ffb454; }
.dot.live { background: #4ade80; }

/* ---- 激励视频弹窗 ---- */
.reward-card { width: min(420px, 92vw); }
.reward-stage {
  height: 180px; border-radius: 12px; overflow: hidden; margin-bottom: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2a2350, #16384a);
  border: 1px solid var(--line);
}
.reward-fake { text-align: center; color: #dfe3ee; font-size: 15px; line-height: 1.6; }
.reward-fake span { font-size: 30px; font-weight: 700; color: #fff; }
.reward-done { color: #8ef0c0; font-size: 18px; font-weight: 600; }

/* ---- 会员徽标 / 会员按钮 ---- */
.member-badge {
  background: linear-gradient(135deg, #f5c451, #e08e2b); color: #2a1c00;
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700;
}
.member-badge.hidden { display: none; }
.quota-pill.member {
  background: rgba(245,196,81,.16); color: #ffd97a; border-color: rgba(245,196,81,.5);
}
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; }

/* ---- 会员中心 ---- */
.member-info { font-size: 14px; margin-bottom: 16px; }
.member-active {
  background: rgba(245,196,81,.14); border: 1px solid rgba(245,196,81,.45); color: #ffd97a;
  border-radius: 12px; padding: 14px; text-align: center; font-weight: 600;
}
.member-normal { display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.member-normal .tip { font-size: 12px; color: var(--muted); margin-top: 4px; }
.product-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.product {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.product-meta { flex: 1; display: flex; flex-direction: column; }
.product-meta b { font-size: 14px; }
.product-meta span { font-size: 12px; color: var(--muted); }
.product-price { font-size: 18px; font-weight: 700; color: #ffd97a; }
.primary.small { width: auto; padding: 8px 18px; font-size: 13px; }

/* ---- 支付弹窗 ---- */
.pay-card { width: min(360px, 92vw); text-align: center; }
.pay-product { font-size: 14px; color: var(--text); margin-bottom: 14px; }
.pay-qr {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.pay-qr img { width: 220px; height: 220px; display: block; }
.pay-fallback { font-size: 11px; color: #555; word-break: break-all; }
.pay-mock { margin-bottom: 12px; }
.pay-mock-box {
  background: rgba(34,211,238,.12); border: 1px dashed rgba(34,211,238,.5); color: #7fe7f5;
  border-radius: 12px; padding: 22px; margin-bottom: 14px; font-size: 14px;
}

/* ---- 同意条款弹窗 ---- */
.consent-card { max-width: 440px; }
.consent-text { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0 0 12px; }
.consent-text a { color: var(--brand); text-decoration: none; }
.consent-text a:hover { text-decoration: underline; }
.consent-list { margin: 0 0 16px; padding-left: 18px; }
.consent-list li { font-size: 13px; color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
.consent-check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; margin-bottom: 18px; user-select: none; }
.consent-check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---- 参考图上传（图生图） ---- */
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.upload-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px dashed var(--line);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; transition: .15s;
}
.upload-btn:hover { border-color: var(--brand); color: #fff; }
.ref-preview { position: relative; margin-top: 10px; display: none; }
.ref-preview.show { display: block; }
.ref-preview img { max-width: 100%; max-height: 160px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.ref-preview .ref-tag { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.ghost.small { padding: 6px 10px; font-size: 12px; }

/* ---- 响应式 ---- */
@media (max-width: 960px) {
  .sidebar { position: relative; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 14px 16px; background: #181b26; box-shadow: none; border-bottom: 1px solid #2c3140; border-right: 0; }
  /* 手机端模块较多：导航条内部横向滚动，避免整页出现横向滚动条 */
  .modules { flex-direction: row; margin: 0 0 0 auto; flex-wrap: nowrap; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sidebar-foot { margin: 0 0 0 12px; padding: 0; border: 0; }
  .brand h1 { font-size: 15px; }
  .app { margin-left: 0; padding: 18px; background: #11131a; }
  .grid { grid-template-columns: 1fr; grid-template-rows: auto; gap: 18px; }
  .prompt-card, .options-card, .gallery-card { grid-column: auto; grid-row: auto; }
  .gallery-card { min-height: 280px; }
  .module-btn { padding: 9px 12px; font-size: 13px; white-space: nowrap; }
  .mod-group { display: none; }
}

/* 站点页脚（备案信息）：margin-top:auto 在内容不足一屏时把页脚推到窗口底部 */
.site-foot {
  margin-top: auto;
  padding: 46px 4px 8px;
  border-top: 1px solid var(--line);
  text-align: center;
}
/* 页脚前的区块保留 28px 间距（原由 .site-foot 的 margin-top 提供，flex 下沉后挪到此处） */
.app > :not(.site-foot) { margin-bottom: 28px; }
.site-foot p { margin: 4px 0; font-size: 12px; color: var(--muted); }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--brand-2); }
.foot-dot { margin: 0 6px; opacity: .5; }
.foot-icp { font-size: 12px; color: var(--muted); }
.foot-icp a { color: var(--muted); text-decoration: none; }
.foot-corp { opacity: .65; }
.foot-report { opacity: .65; }
.foot-report a { color: var(--muted); text-decoration: none; }
.foot-report a:hover { color: var(--brand-2); }
.foot-gongan { font-size: 12px; color: var(--muted); }
.foot-gongan a { color: var(--muted); text-decoration: none; }
.foot-gongan a:hover { color: var(--brand-2); text-decoration: underline; }
.foot-beian { font-size: 13px; color: var(--muted); opacity: .8; }
.foot-beian a { color: var(--muted); text-decoration: none; }
  .foot-beian a:hover { color: var(--brand-2); }

/* ================= 内容文档页（changelog / legal / support 等通用） ================= */
.legal { max-width: 880px; margin: 0 auto; padding: 48px 24px 56px; }
.legal .back {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 22px;
  color: var(--brand); text-decoration: none; font-size: 14px;
}
.legal .back:hover { color: var(--brand-2); }
.legal h1 { font-size: 27px; line-height: 1.3; margin: 0 0 8px; color: var(--text); font-weight: 700; }
.legal .meta { color: var(--muted); font-size: 13px; margin-bottom: 28px; line-height: 1.6; }
.legal h2 {
  font-size: 18px; margin: 34px 0 12px; color: var(--text); font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.legal h2::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.legal h3 { font-size: 15px; margin: 20px 0 6px; color: var(--text); font-weight: 600; }
.legal p, .legal li { color: var(--text); font-size: 14px; line-height: 1.85; }
.legal ul { padding-left: 22px; margin: 8px 0; }
.legal a { color: var(--brand); text-decoration: none; }
.legal a:hover { color: var(--brand-2); }
.legal .card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 22px; margin: 18px 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.legal .card p { margin: 0; }
.legal .card p + p { margin-top: 10px; }
.legal .foot-beian { font-size: 13px; color: var(--muted); opacity: .85; }
.legal .foot-beian a { color: var(--muted); }
@media (max-width: 680px) {
  .legal { padding: 30px 16px 48px; }
  .legal h1 { font-size: 23px; }
  .legal h2 { font-size: 17px; }
}

/* ================= 视觉升级 v2 ================= */
.hero-text { min-width: 0; }
.hero-title {
  margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.5px;
  background: linear-gradient(92deg, var(--text) 8%, var(--brand-2) 55%, var(--brand) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 960px) { .hero-title { font-size: 21px; } }

/* 快捷 prompt */
/* 灵感精选（提示词直接展示在卡片上：图 + 对应提示词，点击填入） */
.inspo { margin: 0 0 16px; }
.inspo-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.inspo-head h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.inspo-head .tag { font-size: 11px; color: var(--muted); }
.inspo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.inspo-item {
  position: relative; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); transition: .18s;
}
.inspo-img { position: relative; aspect-ratio: 1/1; overflow: hidden; }
.inspo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inspo-item:hover { transform: translateY(-3px); border-color: var(--brand-2); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.inspo-img .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 8px;
  font-size: 12px; color: #fff; text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
}
.inspo-item .go {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(109,94,252,.75); color: #fff; font-size: 12px; opacity: 0; transition: .18s;
}
.inspo-item:hover .go { opacity: 1; }
/* 无配图案例：纯文字灵感卡（标题 + 提示词），不做空图片占位块 */
.inspo-item.noimg { background: linear-gradient(150deg, rgba(109,94,252,.20), rgba(109,94,252,.05)); border-color: rgba(109,94,252,.28); }
.inspo-only { flex: 1; min-height: 110px; display: flex; flex-direction: column; justify-content: center; gap: 9px; padding: 16px 14px; }
.inspo-only .cap-text { font-size: 14px; font-weight: 600; letter-spacing: .5px; color: var(--brand-2); }
.inspo-only .p-text { font-size: 12px; line-height: 1.6; color: var(--text); opacity: .82; }
.inspo-p {
  padding: 8px 10px 10px; font-size: 12px; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* 结果卡增强 */
.result-card { transition: .18s; }
.result-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0,0,0,.4); border-color: var(--brand); }
.result-card img { cursor: zoom-in; }
/* 「再来一张」放左上角徽章下方：早期与 .del(top:8/right:44) 完全重叠，
   且 ensureReuse 是后追加的 DOM，会把删除按钮盖住导致点删除没反应 */
.result-card .reuse {
  position: absolute; top: 34px; left: 8px; background: rgba(0,0,0,.55); color: #fff;
  border: 0; border-radius: 8px; padding: 6px 8px; font-size: 11px; cursor: pointer;
  opacity: 0; transition: .15s;
}
.result-card:hover .reuse { opacity: 1; }
.result-card .reuse:hover { background: var(--brand); }

/* 配音模块：字数计数、音色选择器、音频结果卡 */
.tts-count { font-size: 11px; color: var(--muted); text-align: right; margin: -6px 0 10px; }
.tts-count.over { color: #f87171; }
.voice-picker { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.voice-age-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.age-chip {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: #181b26; color: var(--muted); border: 1px solid #3d4356; cursor: pointer; transition: .15s;
}
.age-chip:hover { border-color: var(--brand); color: var(--text); }
.age-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.voice-current { font-size: 11px; color: var(--muted); }
.voice-group-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.voice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-chip {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: #181b26; color: var(--text); border: 1px solid #3d4356;
  border-radius: 10px; padding: 8px 12px; cursor: pointer; transition: .15s; text-align: left;
}
.voice-chip b { font-size: 13px; font-weight: 600; }
.voice-chip span { font-size: 10px; color: var(--muted); }
.voice-chip:hover { border-color: var(--brand); background: #202436; }
.voice-chip.active { background: var(--brand); border-color: var(--brand); }
.voice-chip.active b, .voice-chip.active span { color: #fff; }
.result-card.tts-card audio { width: 100%; display: block; padding: 10px; }

/* 会员中心（独立模块页，样式自 member.html 搬迁） */
.member-wrap { max-width: 880px; margin: 0 auto; }
.mc-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.mc-card h2 { font-size: 15px; margin: 0 0 14px; color: var(--text); }
.mc-status { display: flex; flex-direction: column; gap: 8px; }
.mc-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; width: fit-content; }
.mc-tag.member { background: rgba(245,193,94,.16); color: #f5c15e; border: 1px solid rgba(245,193,94,.4); }
.mc-tag.normal { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.mc-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.mc-row:last-child { border-bottom: none; }
.mc-row b { color: var(--brand); }
.mc-tip { font-size: 12.5px; line-height: 1.7; color: #aab2c5; margin-top: 10px; }
.mc-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.mc-plan { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.mc-plan.member { border-color: rgba(245,193,94,.5); box-shadow: 0 0 0 1px rgba(245,193,94,.25) inset; }
.mc-plan.highlight { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(109,94,252,.35); }
.mc-plan .pname { font-weight: 600; font-size: 15px; }
.mc-plan .pdesc { font-size: 12.5px; color: #aab2c5; line-height: 1.6; min-height: 34px; }
.mc-plan .pprice { font-size: 22px; font-weight: 700; color: var(--brand); }
.mc-plan .pprice small { font-size: 12px; color: #aab2c5; font-weight: 400; }
.mc-cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mc-cmp th, .mc-cmp td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.mc-cmp th { color: #aab2c5; font-weight: 500; }
.mc-cmp td.yes { color: #5fd08a; }
.mc-cmp td.no { color: #8b93a7; }
.mc-orders { display: flex; flex-direction: column; gap: 10px; }
.mc-order { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.mc-order .o-meta { display: flex; flex-direction: column; gap: 3px; }
.mc-order .o-name { font-weight: 600; }
.mc-order .o-time { color: #8b93a7; font-size: 12px; }
.mc-order .o-amt { font-weight: 600; }
.mc-badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.mc-badge.paid { background: rgba(95,208,138,.16); color: #5fd08a; }
.mc-badge.pending { background: rgba(245,193,94,.16); color: #f5c15e; }
.mc-badge.other { background: var(--panel-2); color: #aab2c5; }
.mc-empty { color: #8b93a7; font-size: 13px; text-align: center; padding: 18px; }
.mc-faq { font-size: 13.5px; line-height: 1.7; color: #c7cde0; }
.mc-faq details { padding: 10px 0; border-bottom: 1px solid var(--line); }
.mc-faq summary { cursor: pointer; color: var(--text); font-weight: 500; }

/* 骨架屏 */
.sk-card { border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); overflow: hidden; }
.sk-img { min-height: 150px; position: relative; overflow: hidden; background: #23262f; }
.sk-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  animation: skmove 1.2s infinite;
}
@keyframes skmove { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.sk-bar { height: 9px; margin: 10px; border-radius: 6px; background: #2b2f3a; }

/* 生成按钮成本提示 */
.cost { opacity: .72; font-weight: 400; font-size: 12px; margin-left: 6px; }

/* 大图预览 */
.lightbox-card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; width: min(760px, 92vw); max-height: 90vh;
  display: flex; flex-direction: column; gap: 12px; overflow: auto;
}
.lightbox-card img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; background: #0d0f15; }
.lb-close {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; font-size: 15px; cursor: pointer;
}
.lb-meta { font-size: 12px; color: var(--muted); word-break: break-all; line-height: 1.5; }
.lb-actions { display: flex; gap: 10px; justify-content: flex-end; }
.lb-actions .primary { width: auto; padding: 10px 20px; }
.lb-actions .ghost { width: auto; padding: 10px 16px; }

/* 我的作品：删除按钮 / 视频卡 / 筛选行 */
.result-card .del {
  position: absolute; top: 8px; right: 44px; background: rgba(0,0,0,.55); color: #fff;
  border: 0; border-radius: 8px; padding: 6px 8px; font-size: 11px; cursor: pointer;
  opacity: 0; transition: .15s;
}
.result-card:hover .del { opacity: 1; }
.result-card .del:hover { background: rgba(220,38,38,.85); }
/* 作品卡：文件已失效占位（不自动删记录，留给用户确认） */
.result-card .asset-gone {
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  padding: 18px; text-align: center; font-size: 12px; color: var(--muted);
  background: rgba(255,255,255,.03);
}
/* 视频缩略图统一由上方 .result-card.video-card video 规则控制（1:1 cover） */
#assetFilters { margin: 6px 0 12px; flex-wrap: wrap; }
#assetsRetention { font-size: 12px; color: var(--muted); }


/* ---- 顶栏账户区（即梦风格） ---- */
.acct-pill { display: flex; gap: 8px; align-items: center; }
.member-cta {
  background: linear-gradient(135deg, #f5c451, #e08e2b); color: #2a1c00;
  border: none; border-radius: 999px; padding: 6px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.member-cta:hover { filter: brightness(1.1); }
.member-cta.hidden { display: none; }
.quota-pill { display: inline-flex; align-items: center; gap: 4px; }

.account-wrap { position: relative; }
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid rgba(109,94,252,.55);
  background: linear-gradient(135deg, #6d5efc33, #22d3ee33);
  color: var(--text, #e8e8f0); font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, border-color .15s ease;
}
.avatar-btn:hover { transform: translateY(-1px); border-color: #6d5efc; }

.account-menu {
  position: absolute; right: 0; top: 44px; z-index: 60;
  width: 250px; padding: 14px;
  background: rgba(24,24,34,.96); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.account-menu.hidden { display: none; }
.am-head { display: flex; gap: 10px; align-items: center; }
.am-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #6d5efc, #22d3ee);
  color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.am-id { min-width: 0; }
.am-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.am-name button { background: none; border: none; cursor: pointer; opacity: .55; font-size: 12px; padding: 0; }
.am-name button:hover { opacity: 1; }
.am-uid { font-size: 11px; color: var(--muted); margin-top: 2px; }

.am-stats { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.am-tag {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line);
}
.am-tag.member { background: rgba(245,196,81,.14); color: #ffd97a; border-color: rgba(245,196,81,.45); }

.am-links { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 8px; }
.am-links button {
  background: none; border: none; text-align: left; cursor: pointer;
  color: var(--text, #e8e8f0); font-size: 13px; padding: 9px 8px; border-radius: 10px;
}
.am-links button:hover { background: rgba(255,255,255,.06); }

.quota-note { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 示例图加载失败：品牌渐变底 + 居中提示（onerror 时 img-fail 落在 .inspo-img 上） */
.inspo-img.img-fail {
  background: linear-gradient(135deg, #6d5efc 0%, #22d3ee 100%);
}
.inspo-img.img-fail::after {
  content: '示例图加载失败';
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgba(255,255,255,.85);
}

/* ---------- 登录弹窗 / 登录态 ---------- */
.am-login {
  width: 100%; margin: 4px 0 8px; padding: 10px; border: none; cursor: pointer;
  border-radius: 10px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, #6d5efc 0%, #22d3ee 100%); color: #fff;
}
.login-card { max-width: 360px; }
.login-sub { margin: -6px 0 14px; font-size: 12px; color: var(--muted); }
.login-card .code-row { display: flex; gap: 8px; }
.login-card .code-row input { flex: 1; }
.code-btn { white-space: nowrap; min-width: 108px; }
.code-btn:disabled { opacity: .5; cursor: not-allowed; }
.agree-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); margin: 10px 0 14px; }
.agree-row input { margin-top: 2px; }
.agree-row a { color: #7aa2ff; text-decoration: none; }
.login-btn { width: 100%; padding: 11px; font-size: 14px; }
.login-tip { margin-top: 10px; font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- 登录弹窗（短信验证码登录） ---------- */
.login-shell {
  position: relative; display: flex; width: 640px; max-width: 94vw;
  background: var(--panel, #1a1a22); border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  max-height: 92vh;
}
.login-x {
  position: absolute; top: 10px; right: 12px; z-index: 5;
  background: none; border: none; color: #999; font-size: 18px; cursor: pointer; padding: 4px;
}
.login-x:hover { color: #fff; }
.login-promo {
  flex: 0 0 44%; padding: 34px 24px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(160deg, #2b2440 0%, #1d2a44 55%, #14324a 100%);
  position: relative;
}
.login-promo h2 { margin: 0 0 8px; font-size: 22px; color: #fff; letter-spacing: 1px; }
.lp-slogan { margin: 0 0 22px; font-size: 13px; color: rgba(255,255,255,.65); }
.lp-cards { display: flex; flex-direction: column; gap: 10px; }
.lp-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; font-size: 12px; color: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
}
.lp-ico { font-size: 18px; }
.lp-bubble {
  align-self: center; margin-top: 26px;
  background: linear-gradient(135deg, #e8c46a 0%, #d4a53c 100%); color: #3a2c05;
  font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 10px 10px 2px 10px;
  box-shadow: 0 4px 14px rgba(212,165,60,.4);
}
.login-main { flex: 1; padding: 30px 26px 22px; overflow-y: auto; }
.tabpane .field { margin-bottom: 14px; }
.tabpane .code-row { display: flex; gap: 8px; }
.tabpane .code-row input { flex: 1; min-width: 0; }
.code-btn { white-space: nowrap; min-width: 104px; }
.code-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.login-agree-line { margin-top: 12px; font-size: 11px; color: #7c7c8c; text-align: center; }
.login-agree-line a { color: #7aa2ff; text-decoration: none; }
.login-tip { margin-top: 8px; font-size: 11px; color: #63636f; text-align: center; }
@media (max-width: 560px) {
  .login-promo { display: none; }
}

/* ================= 钱包明细（ledger） ================= */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ledger-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ledger-list {
  max-height: 560px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel);
}
.ledger-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s;
}
.ledger-item:last-child { border-bottom: 0; }
.ledger-item:hover { background: var(--panel-2); }
.ledger-item.selected { background: rgba(109,94,252,.16); box-shadow: inset 3px 0 0 var(--brand); }
.ledger-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.ledger-icon {
  width: 32px; height: 32px; flex: none; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; font-size: 15px;
  background: var(--panel-3);
}
.ledger-info { min-width: 0; }
.ledger-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ledger-tag {
  font-size: 10px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; flex: none;
}
.ledger-desc {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ledger-balance { font-size: 11px; color: #7b8296; margin-top: 3px; }
.ledger-side { text-align: right; flex: none; }
.ledger-points { font-size: 15px; font-weight: 700; }
.ledger-points.minus { color: var(--text); }
.ledger-points.plus { color: var(--success); }
.ledger-points.zero { color: var(--muted); }
.ledger-time { font-size: 11px; color: #7b8296; margin-top: 4px; }
.ledger-detail {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 16px; position: sticky; top: 12px;
}
.ledger-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.ledger-detail-head .close {
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
}
.ledger-detail-head .close:hover { color: var(--text); }
.ledger-detail-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12px;
}
.ledger-detail-row:last-child { border-bottom: 0; }
.ledger-detail-row > span:first-child { color: var(--muted); flex: none; }
.ledger-detail-row > span:last-child { text-align: right; word-break: break-all; }
@media (max-width: 860px) {
  .ledger-wrap { grid-template-columns: 1fr; }
  .ledger-detail { position: static; }
  .ledger-list { max-height: none; }
}

/* ============================================================
   窄屏（≤960px）导航折叠
   ------------------------------------------------------------
   背景：≤960px 时 .sidebar 被折成顶部横排，同一行要塞下「品牌区 + 9 个模块
   按钮 + 4 个底部按钮」。380px 宽容器（高 DPI 屏 CSS 视口约 304px）里每个
   按钮被 flex 压到 39~43px，而中文的 min-content 只有一个字宽 → 汉字被逐字
   竖排，整页还被撑出 579px 横向滚动（实测 scrollWidth 579 vs client 380）。

   方案（≤960px 生效，彻底接管原 960px 媒体查询在窄屏下把导航折成横排导致的汉字竖排/溢出问题；桌面端 >960px 一个像素都不变）：
   1) .sidebar 由横排改回纵排，导航折成「品牌行 / 模块网格 / 底部网格」三行；
   2) 模块按钮改用 auto-fit 网格 + white-space:nowrap：每列最少 100px（实测
      「💃 写真/封面」等最长标签的自然宽 93~100px），中文永远单行显示；
   3) 底部 4 个按钮同样网格化（最长「🔑 开放平台 / API Key」约 146px，独占
      一列时放得下，窄到 320px 时自动降为单列）；
   4) 顺手收紧窄屏内边距，避免导航挤占内容区。
   ============================================================ */
@media (max-width: 960px) {
  .sidebar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px 12px;
  }
  .brand { gap: 8px; }
  .logo { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
  .brand h1 { font-size: 14px; }
  .brand p { margin-top: 1px; font-size: 10px; }

  .modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 6px;
    margin: 0;
  }
  .module-btn {
    padding: 8px 9px;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    border-radius: 10px;
  }

  .sidebar-foot {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
    gap: 6px;
    margin: 0;
    padding: 8px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
  }
  .settings-btn {
    padding: 7px 9px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
  }

  .app { padding: 14px 12px 20px; }
  .page-header { flex-wrap: wrap; gap: 10px; }
}


/* ================= 品牌 Logo 模块 ================= */
.logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.logo-card {
  position: relative; background: #fff; border: 2px solid transparent; border-radius: 14px;
  padding: 10px; cursor: pointer; transition: .15s; overflow: hidden;
}
.logo-card:hover { border-color: rgba(109, 94, 252, .55); }
.logo-card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 94, 252, .22); }
.logo-card img { width: 100%; max-width: 260px; aspect-ratio: 1 / 1; object-fit: contain; display: block; margin: 0 auto; border-radius: 9px; background: #fff; }
.logo-card .lk {
  position: absolute; top: 8px; left: 8px; font-size: 11px; line-height: 1;
  background: rgba(17, 19, 28, .82); color: #fff; padding: 5px 8px; border-radius: 999px;
}
.logo-card.sel .lk { background: var(--brand); }

.logo-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.logo-mockup, .logo-history { margin-top: 18px; }
.mockup-body { display: flex; justify-content: center; padding: 4px 0 10px; }
#logoMockupCanvas { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.logo-hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.logo-hist-item { border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; cursor: pointer; transition: .15s; background: var(--panel); }
.logo-hist-item:hover { border-color: var(--brand); }
.logo-hist-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; border-radius: 8px; display: block; }
.logo-hist-item .hh-name { margin-top: 6px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-hist-item .hh-ts { font-size: 11px; color: var(--muted); margin-top: 2px; }
.logo-hist-item .hh-ops { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.logo-hist-item .hh-ops button { padding: 3px 8px; font-size: 12px; }
.logo-steps .ls { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); transition: .15s; }
.logo-steps .ls i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: #3d4356; color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.logo-steps .ls.active { border-color: var(--brand); color: var(--text); box-shadow: 0 0 0 2px rgba(109, 94, 252, .18); }
.logo-steps .ls.active i { background: var(--brand); }
.logo-steps .ls.done { color: var(--text); }
.logo-steps .ls.done i { background: #16a34a; }
.logo-steps .ls-arrow { color: var(--muted); }

.logo-flow { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.logo-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.logo-info-grid .span2 { grid-column: 1 / -1; }
.hd-card-body { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.hd-preview { flex: 0 0 220px; }
.hd-preview img { width: 220px; height: 220px; object-fit: contain; display: block; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.hd-side { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hd-side .primary { min-width: 240px; }
.hd-side a { color: var(--brand); text-decoration: none; }
.hd-side a:hover { text-decoration: underline; }
.studio-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 24px; align-items: start; }
.studio-preview { background: #0b0d14; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
#logoCanvas { width: 100%; height: auto; display: block; border-radius: 9px; background: #fff; }
.studio-controls { display: flex; flex-direction: column; gap: 14px; }
.studio-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.studio-actions button { flex: 1 1 46%; }
.swatches .chip { display: inline-flex; align-items: center; gap: 8px; }
.swatches .chip i { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255, 255, 255, .45); }
.studio-controls input[type="range"] { width: 100%; accent-color: var(--brand); }

@media (max-width: 1100px) {
  .studio-body { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .logo-info-grid { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .logo-card { padding: 6px; border-radius: 10px; }
  .hd-preview, .hd-preview img { flex: 0 0 auto; width: 160px; height: 160px; }
  .studio-actions button { flex: 1 1 100%; }
}

/* 我的作品 · 批量管理 */
.assets-batch-bar { margin: 10px 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assets-batch-bar button:disabled { opacity: .45; cursor: not-allowed; }
.sel-check { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .4); display: none; z-index: 4; }
.gallery.batch-on .sel-check { display: block; }
.gallery.batch-on .result-card { cursor: pointer; }
.result-card.sel { outline: 2px solid var(--brand); outline-offset: 2px; }
.result-card.sel .sel-check { background: var(--brand); }
.result-card.sel .sel-check::after { content: '✓'; color: #fff; font-size: 15px; line-height: 20px; display: block; text-align: center; font-weight: 700; }
button.ghost.danger { color: var(--danger); border-color: rgba(255, 107, 107, .45); }
button.ghost.danger:hover:not(:disabled) { background: rgba(255, 107, 107, .12); }

/* 截图美化模块 */
.shot-upload { border: 2px dashed rgba(109, 94, 252, .4); border-radius: 14px; padding: 34px 16px; text-align: center; cursor: pointer; color: var(--muted, #667); transition: border-color .15s, background .15s; }
.shot-upload:hover, .shot-upload.drag { border-color: var(--brand); background: rgba(109, 94, 252, .06); }
.shot-upload b { color: var(--brand); }
.shot-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 14px; }
.shot-controls label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #667); }
.shot-controls select, .shot-controls input[type="range"] { max-width: 170px; }
.shot-chk { white-space: nowrap; }
.shot-preview { margin-top: 14px; text-align: center; }
.shot-preview canvas { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 14px rgba(15, 23, 42, .12); background: conic-gradient(#eee 0 25%, #fff 0 50%, #eee 0 75%, #fff 0) 0 0/20px 20px; }
.shot-preview .studio-actions { justify-content: center; margin-top: 12px; }
/* 证件照：输出为规格像素（295×413 等），预览放大显示、白底细描边 */
.shot-preview canvas.id-canvas { max-height: 420px; width: auto; background: #fff; box-shadow: 0 2px 14px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .08); }
/* 在线截屏：微信式框选覆盖层 */
.shot-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(6, 8, 18, .82); display: flex; align-items: center; justify-content: center; }
.shot-overlay.hidden { display: none; }
.shot-overlay canvas { cursor: crosshair; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); box-shadow: 0 8px 40px rgba(0, 0, 0, .5); }
.shot-ov-tip { position: absolute; z-index: 2; background: #6d5efc; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 4px; pointer-events: none; }
.shot-ov-bar { position: absolute; z-index: 3; display: flex; align-items: center; gap: 2px; background: rgba(18, 20, 34, .96); border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; padding: 4px 8px; box-shadow: 0 4px 18px rgba(0, 0, 0, .4); }
.shot-ov-bar .ov-colors { display: flex; gap: 4px; align-items: center; }
.shot-ov-bar .ov-c { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; display: inline-block; border: 2px solid transparent; box-sizing: border-box; }
.shot-ov-bar .ov-c.active { border-color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.shot-ov-bar .ov-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, .18); margin: 0 5px; }
.shot-ov-bar .ov-t { background: transparent; border: none; color: rgba(255, 255, 255, .85); font-size: 15px; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; line-height: 1; }
.shot-ov-bar .ov-t:hover { background: rgba(255, 255, 255, .12); }
.shot-ov-bar .ov-t.active { color: #8f7dff; background: rgba(109, 94, 252, .18); }
.shot-ov-bar .ov-ok { color: #fff; background: #6d5efc; }
.shot-ov-bar .ov-ok:hover { background: #7f70ff; }
.shot-ov-text { position: absolute; z-index: 3; background: rgba(18, 20, 34, .96); border: 1px solid #6d5efc; color: #fff; font-size: 16px; padding: 4px 8px; border-radius: 6px; min-width: 160px; }
.shot-ov-text.hidden { display: none; }
.shot-ov-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); color: rgba(255, 255, 255, .75); font-size: 13px; pointer-events: none; }

/* 图片压缩：文件列表 */
.comp-panel { flex-direction: column; align-items: stretch; gap: 6px; }
.comp-panel .shot-controls { flex-wrap: wrap; row-gap: 6px; }
.comp-panel input[type="number"] { width: 76px; }
.comp-panel input[type="color"] { width: 36px; height: 28px; padding: 0 2px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: transparent; cursor: pointer; }
.comp-panel input[type="checkbox"] { accent-color: #6d5efc; width: 16px; height: 16px; cursor: pointer; }
.comp-panel input[type="text"] { padding: 6px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.06); color: #fff; font-size: 13px; }
/* 图片处理工具：左文件表格 + 右功能面板（参考批量处理工具布局） */
.comp-layout { display: flex; gap: 16px; align-items: flex-start; }
.comp-main { flex: 1; min-width: 0; }
.comp-side { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.comp-fn { background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .09); border-radius: 10px; padding: 10px 12px; text-align: left; }
.comp-fn-head { display: block; position: relative; padding-right: 26px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; text-align: left; line-height: 20px; }
.comp-fn-title { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.comp-fn-head input[type="checkbox"] { position: absolute; right: 0; top: 3px; margin: 0; }
.comp-fn-body { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
.comp-fn-body label, .comp-fn-body > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted, #89a); text-align: left; }
.comp-fn-body select, .comp-fn-body input[type="number"], .comp-fn-body input[type="text"] { flex: 0 0 auto; width: 150px; max-width: 150px; margin: 0; }
/* 目标大小行：文字居左，输入框+单位框与上方下拉框同宽右对齐（72+8+70=150px） */
#compKbWrap > em { flex: 0 0 auto; font-style: normal; color: var(--muted, #89a); white-space: nowrap; }
#compKb { flex: 0 0 72px; min-width: 0; width: 72px; max-width: 72px; margin-left: auto; }
#compKbUnit { flex: 0 0 70px; width: 70px; max-width: 70px; }
#compWmCommon { display: flex; flex-direction: column; gap: 8px; }
#compWmCommon label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comp-fn:has(.comp-fn-head input:not(:checked)) .comp-fn-body { opacity: .45; }
@media (max-width: 1100px) { .comp-layout { flex-direction: column; } .comp-side { width: 100%; flex-direction: row; flex-wrap: wrap; } .comp-fn { flex: 1 1 260px; } }
/* 文件表格 */
#compDrop { cursor: default; }
#compDrop.has-items { padding: 14px 16px 12px; }
#compDrop #compEmpty { margin: 4px 0 0; font-size: 13px; color: rgba(255, 255, 255, .6); }
#compList { text-align: left; background: rgba(124, 108, 255, .10); border: 1px solid rgba(124, 108, 255, .25); border-radius: 10px; overflow: hidden; max-height: 460px; overflow-y: auto; }
#compList::-webkit-scrollbar { width: 8px; }
#compList::-webkit-scrollbar-thumb { background: rgba(124, 108, 255, .45); border-radius: 4px; }
#compList::-webkit-scrollbar-track { background: transparent; }
#compList:empty { display: none; }
.comp-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 150px 82px 30px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid rgba(124, 108, 255, .14); font-size: 13px; }
.comp-row:last-child { border-bottom: none; }
.comp-row.comp-thead { font-size: 12px; color: rgba(255, 255, 255, .45); background: #2a2b4b; padding: 6px 12px; position: sticky; top: 0; z-index: 1; }
.comp-row .comp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, .88); }
.comp-row .comp-dim { color: rgba(255, 255, 255, .55); white-space: nowrap; }
.comp-row .comp-sizes { color: rgba(255, 255, 255, .55); white-space: nowrap; }
.comp-row .comp-status { color: rgba(255, 255, 255, .5); white-space: nowrap; }
.comp-row.ok .comp-status { color: #4ade80; }
.comp-row.err .comp-status { color: #f87171; }
.comp-row .comp-del { width: auto; padding: 2px 9px; font-size: 12px; line-height: 1.5; }
.comp-row .mini { min-width: 0; }

/* 图片处理工具：操作区两行布局 + 进度条 */
.comp-run-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: center; width: 100%; }
#compActions { margin-top: 18px; }
.comp-run-row > button { width: 100%; margin: 0; white-space: nowrap; }
.comp-progress { grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; min-width: 0; }
.comp-progress-bar { flex: 1 1 0; min-width: 0; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.comp-progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6d5efc, #38bdf8); border-radius: 5px; transition: width .25s; }
#compSummary { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-save-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.comp-save-row button { flex: 1; margin: 0; }
