:root {
  --bg: #0b0e14;
  --bg-2: #11151f;
  --panel: #151a25;
  --panel-2: #1b2130;
  --line: #262d3d;
  --line-2: #323b4f;
  --text: #e8ecf4;
  --text-2: #9aa5b8;
  --text-3: #6b7688;
  --primary: #4f8cff;
  --primary-2: #3a75e8;
  --accent: #7b61ff;
  --ok: #2fbf71;
  --warn: #ff9f43;
  --danger: #ff5c68;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .38);
  --topbar-h: 62px;
  --tabbar-h: 62px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  overflow: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
code { background: var(--bg-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: #a8b6cf; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-2); }
.spacer { flex: 1; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(180deg, #141926, #0f131c);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 26px; line-height: 1; }
.brand h1 { font-size: 16px; letter-spacing: .2px; }
.brand p { margin: 0; font-size: 11.5px; color: var(--text-3); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.engine-badge {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(79, 140, 255, .12);
  color: var(--primary);
  border: 1px solid rgba(79, 140, 255, .28);
}
.engine-badge.llm {
  background: rgba(123, 97, 255, .14);
  color: #a894ff;
  border-color: rgba(123, 97, 255, .32);
}

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: #232a3b; border-color: #3d4761; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: rgba(255, 92, 104, .3); background: rgba(255, 92, 104, .08); }
.btn-danger:hover { background: rgba(255, 92, 104, .16); }

/* ---------- 页面与 Tab ---------- */
.pages {
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h));
  position: relative;
  overflow: hidden;
}
.page {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
}
.page.active { display: block; }
.page::-webkit-scrollbar { width: 9px; }
.page::-webkit-scrollbar-thumb { background: #2b3346; border-radius: 5px; }
.page::-webkit-scrollbar-thumb:hover { background: #3a445c; }

.page-inner { padding: 18px 22px 30px; max-width: 1240px; margin: 0 auto; }
.page-inner.narrow { max-width: 760px; }

/* 首页保持三栏，不滚动外层 */
#page-home { overflow: hidden; }
#page-home .layout {
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) 380px;
  gap: 14px;
  padding: 14px;
  height: 100%;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(15, 19, 28, .96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 60;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  font-size: 11.5px;
  transition: .16s;
  position: relative;
  padding: 0;
}
.tab:hover { color: var(--text-2); }
.tab .tab-ico {
  font-size: 21px;
  line-height: 1;
  transition: .16s;
  filter: grayscale(1) opacity(.55);
}
.tab .tab-txt { letter-spacing: .3px; }
.tab.active { color: var(--primary); }
.tab.active .tab-ico { filter: none; transform: translateY(-2px) scale(1.1); }
.tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ---------- 面板（首页） ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.panel-head h2 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.head-actions { display: flex; gap: 6px; }
.count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-2);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 400;
}
.panel-tools { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }

.scroll { overflow-y: auto; flex: 1; min-height: 0; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: #2b3346; border-radius: 4px; }
.scroll::-webkit-scrollbar-thumb:hover { background: #3a445c; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- 表单 ---------- */
.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 140, 255, .13); }
.textarea { resize: vertical; line-height: 1.7; font-family: inherit; }
select.input, .select {
  cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 28px;
}
.color { width: 100%; height: 34px; padding: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.range { width: 100%; accent-color: var(--primary); cursor: pointer; }
.field-label { display: block; font-size: 12px; color: var(--text-2); margin: 10px 0 5px; }
.hint { color: var(--text-3); font-size: 11px; font-weight: 400; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-inline { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.meta-line { font-size: 11.5px; color: var(--text-3); }

/* ---------- 文案列表（首页左侧） ---------- */
.list { padding: 10px 12px; display: flex; flex-direction: column; gap: 9px; }
.copy-item {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  cursor: pointer;
  transition: .15s;
  position: relative;
}
.copy-item:hover { border-color: var(--line-2); background: #1f2536; }
.copy-item.active { border-color: var(--primary); background: rgba(79, 140, 255, .09); }
.copy-item.active::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.copy-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.copy-preview {
  font-size: 11.5px; color: var(--text-3); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.copy-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag {
  font-size: 10.5px; padding: 1.5px 7px; border-radius: 9px;
  background: var(--bg-2); color: var(--text-2); border: 1px solid var(--line);
}
.tag.cat { background: rgba(79, 140, 255, .12); color: #7fb0ff; border-color: rgba(79, 140, 255, .25); }
.copy-actions { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: .15s; }
.copy-item:hover .copy-actions { opacity: 1; }
.icon-btn {
  border: none; background: transparent; color: var(--text-3); cursor: pointer;
  font-size: 13px; padding: 2px 5px; border-radius: 5px; line-height: 1;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn.del:hover { color: var(--danger); }

.empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 34px 16px; line-height: 1.9; }

/* ---------- 分镜（首页中部） ---------- */
.editor-block { padding: 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.shots-head { padding: 12px 12px 6px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.shots-head .field-label { margin: 0; }
.total-badge { font-size: 11.5px; color: var(--primary); background: rgba(79, 140, 255, .1); padding: 3px 9px; border-radius: 11px; white-space: nowrap; }
.shots { padding: 6px 12px 14px; display: flex; flex-direction: column; gap: 9px; }

.shot {
  display: grid;
  grid-template-columns: 26px 54px 1fr;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: .15s;
}
.shot:hover { border-color: var(--line-2); }
.shot.dragging { opacity: .4; }
.shot.drop-target { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79, 140, 255, .18); }
.shot-handle {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-3); cursor: grab; font-size: 13px; padding-top: 2px;
}
.shot-handle:active { cursor: grabbing; }
.shot-idx { font-size: 11px; font-weight: 600; color: var(--text-3); }

.shot-thumb {
  width: 54px; height: 96px; border-radius: 6px; cursor: pointer;
  background: linear-gradient(160deg, #1d2438, #131826);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; overflow: hidden; position: relative;
  transition: .15s;
}
.shot-thumb:hover { border-color: var(--primary); }
.shot-thumb video, .shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 9px; text-align: center; padding: 2px 1px;
  background: rgba(0, 0, 0, .68); color: #dfe5f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.shot-text {
  font-size: 12.5px; line-height: 1.6; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px;
  max-height: 62px; overflow-y: auto; outline: none;
}
.shot-text:focus { border-color: var(--primary); }
.shot-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.shot-controls label { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--text-3); }
.shot-controls select, .shot-controls input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 5px; padding: 4px 6px; font-size: 11.5px; font-family: inherit; outline: none;
  width: 100%;
}
.shot-controls select:focus, .shot-controls input:focus { border-color: var(--primary); }
.shot-foot { display: flex; justify-content: flex-end; }

/* ---------- 预览（首页右侧） ---------- */
.phone-wrap { display: flex; justify-content: center; padding: 14px 12px 6px; flex-shrink: 0; }
.phone {
  width: 152px; height: 270px; border-radius: 18px;
  border: 3px solid #2a3244; background: #05070c;
  padding: 4px; box-shadow: var(--shadow); flex-shrink: 0;
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 14px; overflow: hidden;
  position: relative; background: #0a0d14;
  display: flex; align-items: flex-end; justify-content: center;
}
.preview-bg { position: absolute; inset: 0; transition: background .5s; }
.preview-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #3f4a5e; font-size: 11px; text-align: center; padding: 10px;
}
.preview-caption {
  position: absolute; left: 8px; right: 8px; bottom: 16%;
  text-align: center; font-size: 11.5px; font-weight: 600;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 6px rgba(0, 0, 0, .7);
  line-height: 1.5; transition: .2s;
}

.settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
  padding: 6px 12px 10px; flex-shrink: 0;
}
.settings-grid label { font-size: 11px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.settings-grid .input, .settings-grid .range, .settings-grid .color { font-size: 12px; padding: 5px 8px; }

.btn-render {
  margin: 0 12px 10px;
  padding: 13px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: #fff;
  box-shadow: 0 5px 18px rgba(79, 140, 255, .3);
  flex-shrink: 0;
}
.btn-render:hover:not(:disabled) { filter: brightness(1.09); }
.btn-render:disabled { filter: grayscale(.55); box-shadow: none; }

.render-status { padding: 0 12px 10px; flex-shrink: 0; }
.progress-bar { height: 6px; background: var(--bg-2); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .4s; border-radius: 4px; }
.progress-text { font-size: 11.5px; color: var(--text-2); }
.progress-text.err { color: var(--danger); }
.progress-text.ok { color: var(--ok); }

.videos-head { padding: 8px 12px 6px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); flex-shrink: 0; }
.videos-head .field-label { margin: 0; }
.videos { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.video-item {
  display: flex; gap: 10px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px;
}
.video-item:hover { border-color: var(--line-2); }
.video-thumb {
  width: 42px; height: 74px; border-radius: 5px; object-fit: cover;
  background: #0c1017; flex-shrink: 0; cursor: pointer; border: 1px solid var(--line);
}
.video-info { flex: 1; min-width: 0; }
.video-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-meta { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.video-actions { display: flex; flex-direction: column; gap: 5px; }
.video-actions .btn { padding: 4px 9px; font-size: 11.5px; }

.asset-upload { display: flex; align-items: center; gap: 10px; margin: 12px 0; }

/* ---------- 通用工具条 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { max-width: 240px; }
.toolbar .select { width: auto; min-width: 130px; }
.toolbar-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* ---------- 文案库页 ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat-num { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.3; }
.stat-lbl { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lib-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: .16s;
}
.lib-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.lib-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lib-card-title { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.lib-card-body {
  font-size: 12.5px; color: var(--text-2); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lib-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.lib-card-foot .lib-use { flex: 1; }
.lib-card-foot .icon-btn { flex-shrink: 0; }
.lib-card-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib-card-tags .hint { margin-left: auto; }

/* ---------- 文案库会员锁 ---------- */
.lib-lock {
  background: var(--panel); border: 1px dashed var(--line-2);
  border-radius: var(--radius); padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.lib-lock-ico {
  width: 52px; height: 52px; border-radius: 50%; font-size: 24px;
  background: rgba(123, 97, 255, .15); display: flex; align-items: center; justify-content: center;
}
.lib-lock b { font-size: 15.5px; color: var(--text); }
.lib-lock span { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.lib-lock .btn { margin-top: 6px; padding: 10px 26px; border-radius: 22px;
  background: linear-gradient(90deg, #6a4bff, #a855f7); border: none; font-weight: 700; }

/* ---------- 作品页 ---------- */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.work-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: .16s;
}
.work-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.work-video { width: 100%; aspect-ratio: 9 / 16; background: #05070c; object-fit: cover; display: block; }
.work-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.work-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.work-meta { font-size: 11px; color: var(--text-3); line-height: 1.65; }
.work-actions { display: flex; gap: 8px; margin-top: auto; }
.work-actions .btn { flex: 1; text-align: center; padding: 6px; font-size: 12px; text-decoration: none; }

/* ---------- 我的页 ---------- */
.profile {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #1a2032, #151a25);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px;
}
.avatar {
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}
.profile-name { font-size: 16px; font-weight: 600; }
.profile-sub { margin-top: 3px; }

.me-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.me-stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; text-align: center;
}
.me-section { margin-bottom: 20px; }
.me-title { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; padding-left: 2px; }
.me-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 14px; }
.me-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.me-row:last-of-type { border-bottom: none; }
.me-btn { width: 100%; margin-top: 10px; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(4, 6, 11, .76);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px; backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 20px; width: 100%; max-width: 460px;
  box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto;
}
.modal-wide { max-width: 760px; }
.modal-card h3 { font-size: 15px; margin-bottom: 4px; }
.modal-desc { font-size: 12px; color: var(--text-3); margin: 0 0 12px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 6px; }
.style-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px; cursor: pointer; transition: .15s;
}
.style-card:hover { border-color: var(--line-2); background: #1f2536; }
.style-card.active { border-color: var(--primary); background: rgba(79, 140, 255, .1); }
.style-card .ico { font-size: 17px; }
.style-card .nm { font-size: 12.5px; font-weight: 600; margin: 4px 0 2px; }
.style-card .ds { font-size: 10.5px; color: var(--text-3); line-height: 1.5; }

.rewrite-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.compare-box {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px;
  font-size: 12.5px; line-height: 1.75; color: var(--text-2);
  height: 190px; overflow-y: auto; white-space: pre-wrap;
}
.compare-box.result { color: var(--text); border-color: rgba(79, 140, 255, .3); }
.compare-box.loading { color: var(--text-3); }

.asset-groups { max-height: 54vh; }
.asset-group { margin-bottom: 14px; }
.asset-group-title { font-size: 12px; color: var(--text-2); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.asset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.asset-chip {
  border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
  cursor: pointer; background: var(--panel-2); transition: .15s;
}
.asset-chip:hover { border-color: var(--primary); transform: translateY(-2px); }
.asset-chip.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79, 140, 255, .25); }
.asset-chip .bar { height: 84px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.asset-chip .nm { font-size: 10.5px; text-align: center; padding: 4px 2px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 74px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-2);
  border-left: 3px solid var(--primary);
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 12.5px; box-shadow: var(--shadow); max-width: 320px;
  animation: slideIn .22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1400px) {
  #page-home .layout { grid-template-columns: 280px minmax(380px, 1fr) 340px; }
}
@media (max-width: 1150px) {
  #page-home { overflow-y: auto; }
  #page-home .layout { grid-template-columns: 1fr; height: auto; }
  .panel { max-height: 640px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .brand p { display: none; }
  .page-inner { padding: 14px; }
  .toolbar .input, .toolbar .select { max-width: none; flex: 1; min-width: 120px; }
  .cards, .work-grid { grid-template-columns: 1fr 1fr; }
  .rewrite-compare, .style-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ================= 首页信息流框架（参考 App 框架，保持暗色风格） ================= */
.page-inner.wide { max-width: 1200px; }

.hero-banner { padding: 18px 8px 22px; }
.hero-title { font-size: 34px; font-weight: 800; margin: 0 0 10px; letter-spacing: 1px; }
.hero-sub { margin: 0; color: var(--txt-dim, #9aa5b8); font-size: 14px; }
.grad-text {
  background: linear-gradient(90deg, #7b61ff, #4f8cff 55%, #37e0c8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.entry-grid {
  display: grid; gap: 14px;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto;
  margin-bottom: 26px;
}
.entry-card {
  border-radius: 18px; padding: 18px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  color: #fff; position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(79,140,255,.25); }
.entry-card b { font-size: 16px; }
.entry-card > span:not(.entry-plus):not(.entry-ico) { font-size: 12px; opacity: .85; line-height: 1.6; }
.entry-ico { font-size: 26px; }
.entry-plus {
  font-size: 30px; font-weight: 700; line-height: 1;
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.entry-plus.small { width: 36px; height: 36px; font-size: 22px; }

.entry-big {
  grid-row: 1 / 3; justify-content: space-between;
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(150deg, #6a4bff, #8b5cf6 60%, #a855f7);
  min-height: 220px;
}
.entry-big-txt { display: flex; flex-direction: column; gap: 6px; }
.entry-big-txt b { font-size: 20px; }
.entry-teal { background: linear-gradient(140deg, #0d9488, #14b8a6); }
.entry-blue { background: linear-gradient(140deg, #2563eb, #3b82f6); }
.entry-violet {
  grid-column: 2 / 4; flex-direction: row; align-items: center; gap: 14px;
  background: linear-gradient(140deg, #4f46e5, #7c3aed);
}
.entry-violet b { font-size: 17px; }

.feed-tabs {
  display: flex; align-items: center; gap: 26px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.feed-tab {
  background: none; border: none; cursor: pointer;
  color: #9aa5b8; font-size: 16px; font-weight: 600;
  padding: 12px 2px; position: relative;
}
.feed-tab.active { color: #e8ecf4; }
.feed-tab.active::after {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: -1px;
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #4f8cff, #7b61ff);
}
.feed-badge {
  margin-left: auto; font-size: 11px; color: #ffd08a;
  background: rgba(255,170,60,.12); border: 1px solid rgba(255,170,60,.35);
  padding: 3px 10px; border-radius: 12px;
}

.feed-group { padding-bottom: 20px; }
.feed-author {
  display: flex; align-items: center; gap: 12px; padding: 16px 4px 12px;
}
.feed-author .fa-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(135deg, rgba(79,140,255,.3), rgba(123,97,255,.3));
  border: 1px solid rgba(79,140,255,.4);
}
.feed-author .fa-name { font-size: 15px; font-weight: 700; }
.feed-author .fa-meta { font-size: 12px; color: #9aa5b8; margin-top: 2px; }
.feed-author .fa-arrow { margin-left: auto; color: #6b7688; }

.feed-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.feed-card {
  border-radius: 14px; overflow: hidden; cursor: pointer;
  background: #151a25; border: 1px solid rgba(255,255,255,.06);
  transition: transform .15s ease;
}
.feed-card:hover { transform: translateY(-3px); }
.feed-card video, .feed-card .fc-cover {
  width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; background: #0d1017;
}
.fc-body { padding: 10px 12px 12px; display: flex; align-items: center; gap: 6px; }
.fc-ico { color: #ff6b81; font-size: 13px; }
.fc-likes { font-size: 12px; color: #c6cede; }

@media (max-width: 900px) {
  .entry-grid { grid-template-columns: 1fr 1fr; }
  .entry-big { grid-row: auto; grid-column: 1 / 3; min-height: 170px; }
  .entry-violet { grid-column: 1 / 3; }
  .hero-title { font-size: 26px; }
}
.studio-back { margin: 4px 0 12px; }

/* ================= 创作页（三步流程框架，保持暗色风格） ================= */
.studio-top { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.studio-title { font-size: 17px; font-weight: 700; }
.studio-top .spacer { flex: 1; }

.steps-bar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px;
  background: rgba(79,140,255,.06); border: 1px solid rgba(79,140,255,.15);
  border-radius: 14px;
}
.step { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #c6cede; }
.step-no {
  width: 20px; height: 20px; border-radius: 50%; font-style: normal;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4f8cff, #7b61ff);
  display: flex; align-items: center; justify-content: center;
}

.create-card {
  background: #151a25; border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.create-card .textarea { min-height: 150px; font-size: 15px; line-height: 1.8; background: #11151f; }
.cc-foot { margin-top: 12px; justify-content: space-between; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cc-head b { font-size: 16px; }

.style-pick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px;
}
.pick-card {
  border-radius: 12px; padding: 6px 6px 10px; cursor: pointer; text-align: center;
  background: #11151f; border: 2px solid transparent;
  transition: border-color .15s ease, transform .15s ease;
}
.pick-card:hover { transform: translateY(-2px); }
.pick-card.picked { border-color: #2fbf71; box-shadow: 0 0 0 3px rgba(47,191,113,.15); }
.pick-thumb {
  aspect-ratio: 4 / 3; border-radius: 9px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  position: relative;
}
.pick-card.picked .pick-thumb::after {
  content: '✓'; position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; border-radius: 50%; font-size: 12px;
  background: #2fbf71; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.pick-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.pick-meta { font-size: 11px; }

.create-adv { margin-bottom: 16px; }
.create-adv summary {
  cursor: pointer; font-size: 14px; font-weight: 600; color: #c6cede;
  background: #151a25; border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px; padding: 13px 16px; list-style: none;
}
.create-adv summary::-webkit-details-marker { display: none; }
.create-adv[open] summary { border-radius: 12px 12px 0 0; }
.adv-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px;
  background: #12151d; border: 1px solid rgba(255,255,255,.07);
  border-top: none; border-radius: 0 0 12px 12px; padding: 14px;
}
.adv-grid .panel { background: #151a25; }
.adv-grid .shots { max-height: 340px; }

.start-wrap { text-align: center; padding: 10px 0 40px; }
.btn-start {
  width: 100%; max-width: 560px; padding: 16px;
  font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6a4bff, #7c3aed 60%, #a855f7);
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(124,58,237,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(124,58,237,.45); }
.btn-start:disabled { opacity: .6; cursor: wait; transform: none; }
.start-meta { margin-top: 12px; font-size: 13px; }

@media (max-width: 1000px) {
  .adv-grid { grid-template-columns: 1fr; }
}

/* 创作页：步骤条状态 + 结果页 */
.step.active { color: #e8ecf4; font-weight: 600; }
.step.done { color: #7fb0ff; }
.step.done .step-no { background: linear-gradient(135deg, #2fbf71, #22a05c); }
.step.done .step-no::before { content: '✓'; }
.step.done .step-no { font-size: 0; }
.step.done .step-no::before { font-size: 12px; }

.adv-jump {
  display: block; width: 100%; margin: 4px 0 40px;
  padding: 12px; font-size: 14px; color: #9aa5b8; cursor: pointer;
  background: transparent; border: 1px dashed rgba(255,255,255,.15);
  border-radius: 12px; transition: color .15s, border-color .15s;
}
.adv-jump:hover { color: #7fb0ff; border-color: rgba(79,140,255,.5); }

.result-progress { padding: 16px 18px; }
.result-progress:empty, .result-progress .render-status:empty { display: none; }

/* ================= 我的页（参考 App 框架，暗色风格） ================= */
.me-hero {
  display: flex; align-items: center; gap: 16px; padding: 22px 8px 18px;
}
.me-avatar {
  position: relative; width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(123,97,255,.35), rgba(79,140,255,.3));
  border: 2px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.me-avatar-ico { font-size: 32px; }
.me-avatar-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px;
  background: #23262e; border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
}
.me-hero-info { flex: 1; min-width: 0; }
.me-name { font-size: 20px; font-weight: 800; }
.me-uid { font-size: 12px; color: #9aa5b8; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.uid-copy {
  background: none; border: none; color: #6b7688; cursor: pointer; font-size: 13px;
}
.uid-copy:hover { color: #7fb0ff; }
.me-credit {
  padding: 6px 14px; border-radius: 20px; font-size: 13px; color: #ffd08a;
  background: rgba(255,170,60,.12); border: 1px solid rgba(255,170,60,.35);
}

.me-vip-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 16px; padding: 14px 18px; margin-bottom: 16px;
  color: #fff;
}
.vip-ico { font-size: 22px; }
.vip-txt { flex: 1; display: flex; flex-direction: column; }
.vip-txt b { font-size: 15px; }
.vip-txt span { font-size: 12px; opacity: .85; }
.vip-btn {
  background: #fff; color: #6a4bff; border: none; border-radius: 20px;
  padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.vip-btn:active { transform: scale(.97); }

.me-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.duo-card {
  border-radius: 14px; padding: 16px; cursor: pointer; color: #fff;
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .15s ease;
}
.duo-card:hover { transform: translateY(-2px); }
.duo-card b { font-size: 15px; }
.duo-card span { font-size: 12px; opacity: .8; }
.duo-teal { background: linear-gradient(135deg, rgba(20,184,166,.25), rgba(13,148,136,.12)); border-color: rgba(20,184,166,.35); }
.duo-violet { background: linear-gradient(135deg, rgba(168,85,247,.28), rgba(124,58,237,.12)); border-color: rgba(168,85,247,.35); }

.me-group {
  background: #151a25; border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px; margin-bottom: 14px; overflow: hidden;
}
.me-row-link {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.me-row-link:last-child { border-bottom: none; }
.me-row-link:hover { background: rgba(255,255,255,.03); }
.rl-ico { font-size: 19px; flex-shrink: 0; }
.rl-title { font-size: 15px; font-weight: 600; }
.rl-val { margin-left: auto; font-size: 13px; color: #9aa5b8; }
.rl-arrow { color: #6b7688; font-size: 18px; }
.rl-admin-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rl-admin-body .rl-title { font-size: 16px; }
.rl-desc { font-size: 12px; color: #9aa5b8; }
.admin-row { background: rgba(79,140,255,.06); }
.admin-row:hover { background: rgba(79,140,255,.12); }
.me-footer { text-align: center; padding: 26px 0 40px; }

/* ================= 后台管理 ================= */
.admin-env { font-size: 12px; color: #9aa5b8; }
.admin-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.admin-tab {
  background: #151a25; border: 1px solid rgba(255,255,255,.08);
  color: #9aa5b8; font-size: 13px; padding: 9px 16px;
  border-radius: 20px; cursor: pointer;
}
.admin-tab.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #4f8cff, #7b61ff);
}
.admin-pane { display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }
.admin-pane[hidden] { display: none; }
.admin-card {
  background: #151a25; border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px; padding: 18px;
}
.ac-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.ac-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ac-head b { font-size: 15px; }
.ac-state { margin-top: 10px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.admin-stats .stat-card { padding: 16px 0; }
.admin-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.admin-item {
  display: flex; align-items: center; gap: 12px;
  background: #11151f; border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
}
.admin-item .ai-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .ai-meta { color: #6b7688; font-size: 12px; flex-shrink: 0; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.af-label { display: block; font-size: 13px; color: #9aa5b8; margin: 12px 0 6px; }
.af-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.af-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #9aa5b8; }
.af-inline { display: flex; gap: 10px; }
.af-inline .input { flex: 1; }
.mini-pages { display: flex; flex-direction: column; gap: 10px; }
.mini-page {
  display: flex; align-items: center; gap: 12px; font-size: 13px;
  background: #11151f; border-radius: 10px; padding: 10px 14px;
}
.mini-page b { flex-shrink: 0; }
.mini-page span { color: #9aa5b8; }
.check-list { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: #c6cede; }
.check-list label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
@media (max-width: 700px) { .admin-stats { grid-template-columns: 1fr 1fr; } .af-grid { grid-template-columns: 1fr; } }

/* ================= 会员中心 ================= */
.vip-credit-chip {
  background: rgba(123, 97, 255, .15); color: #b7a6ff;
  border: 1px solid rgba(123, 97, 255, .4);
  border-radius: 20px; padding: 5px 14px; font-size: 12px; font-weight: 700;
}
.vip-hero {
  background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #a855f7);
  border-radius: 18px; padding: 22px 20px; margin-bottom: 16px; color: #fff;
}
.vip-hero-title { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
.vip-hero-title em { font-style: normal; font-size: 13px; font-weight: 500; opacity: .9; margin-left: 8px; }
.vip-hero-user { display: flex; align-items: center; gap: 12px; }
.vip-hero-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.vip-hero-user b { display: block; font-size: 15px; }
.vip-hero-user span { font-size: 12px; opacity: .85; }

.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pkg-card {
  position: relative; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 16px 8px 14px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.pkg-card:hover { transform: translateY(-2px); }
.pkg-card.picked {
  border-color: #7b61ff; background: linear-gradient(180deg, rgba(123,97,255,.16), rgba(123,97,255,.05));
}
.pkg-tag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, #ff5c8a, #ff8a5c); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 8px; padding: 2px 8px; white-space: nowrap;
}
.pkg-name { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 8px; }
.pkg-price { color: var(--text); }
.pkg-price em { font-style: normal; font-size: 13px; font-weight: 700; }
.pkg-price b { font-size: 24px; font-weight: 800; }
.pkg-origin { font-size: 11px; color: var(--text-3); text-decoration: line-through; margin: 4px 0 8px; }
.pkg-credits { font-size: 11px; color: #b7a6ff; font-weight: 700; }

.vip-benefits {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.vb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 15px; }
.vb-bar { width: 4px; height: 16px; border-radius: 2px; background: #7b61ff; }
.vb-row { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.vb-row + .vb-row { border-top: 1px solid var(--line); }
.vb-ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(123, 97, 255, .14); display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.vb-row b { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 2px; }
.vb-row span { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.vb-cost-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 2px; font-size: 13.5px; color: var(--text-2);
}
.vb-cost-row + .vb-cost-row { border-top: 1px solid var(--line); }
.vb-cost-row b { color: #b7a6ff; }
.vb-note { font-size: 12px; color: var(--text-3); margin-top: 10px; line-height: 1.6; }

.vip-notice { font-size: 12px; color: var(--text-3); line-height: 1.8; margin-bottom: 80px; }
.vip-notice b { color: var(--text-2); display: block; margin-bottom: 4px; }
.vip-notice p { margin: 0 0 4px; }
.vip-agree { display: flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; margin-top: 10px; }

.vip-bottombar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 50;
  display: flex; gap: 10px; padding: 12px 16px;
  background: rgba(13, 17, 26, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.vip-redeem-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; color: var(--text-2); font-size: 11px; cursor: pointer;
}
.vip-redeem-btn span { font-size: 20px; }
.vip-buy-btn {
  flex: 1; border: none; border-radius: 26px; cursor: pointer;
  background: linear-gradient(90deg, #6a4bff, #a855f7); color: #fff;
  font-size: 16px; font-weight: 800; padding: 13px; letter-spacing: 2px;
}
.vip-buy-btn:active { opacity: .85; }
.page-inner { padding-bottom: 30px; }
#page-vip .page-inner { padding-bottom: 80px; }

@media (max-width: 700px) { .pkg-grid { gap: 8px; } .pkg-price b { font-size: 20px; } }

/* ================= 积分消耗提示 ================= */
.cost-tag {
  font-style: normal; display: inline-block; margin-left: 6px;
  background: rgba(255, 255, 255, .22); color: inherit;
  border-radius: 8px; padding: 1px 7px; font-size: 11px; font-weight: 600;
  vertical-align: middle; letter-spacing: 0;
}
.btn-render .cost-tag, .btn-start .cost-tag { background: rgba(255, 255, 255, .3); }
.cost-tag.low { background: rgba(255, 92, 104, .85); color: #fff; }

/* ================= 移动端视口与底部遮挡修复 ================= */
/* 100vh 在移动端含地址栏/安全区，改用动态视口高度；旧浏览器回退 */
@supports (height: 100dvh) {
  .pages {
    height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - env(safe-area-inset-bottom));
  }
}
/* 页面内容底部留出足够空间，保证最后一条（最近成品）完整露出 */
.page-inner { padding-bottom: 56px; }
#page-vip .page-inner { padding-bottom: 96px; }
/* 最近成品列表自身限高可滚，外层页面一定能滚到底 */
.videos.scroll { max-height: 460px; }

/* ================= 头像昵称 / 登录 ================= */
.me-avatar { cursor: pointer; }
.avatar-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px;
}
.avatar-cell {
  aspect-ratio: 1; border-radius: 12px; font-size: 22px; cursor: pointer;
  background: var(--panel-2); border: 1.5px solid transparent;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.avatar-cell:hover { background: #232a3a; }
.avatar-cell.picked { border-color: #7b61ff; background: rgba(123,97,255,.16); }
.login-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.login-opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; cursor: pointer;
  text-align: left; color: inherit; transition: border-color .15s, transform .15s;
}
.login-opt:hover { border-color: var(--line-2); transform: translateY(-1px); }
.lo-ico {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.lo-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lo-txt b { font-size: 14px; color: var(--text); }
.lo-txt span { font-size: 12px; color: var(--text-2); }
.lo-arrow { color: var(--text-3); font-size: 16px; }

/* ================= 邀请好友 ================= */
.inv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.inv-stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 3px;
}
.inv-stat b { font-size: 18px; color: #7fb0ff; font-family: var(--mono, monospace); }
.inv-stat span { font-size: 11px; color: var(--text-3); }

/* 海报 */
.inv-poster {
  position: relative; border-radius: 18px; overflow: hidden;
  background: linear-gradient(150deg, #131c2e 0%, #1c2946 55%, #0d1420 100%);
  border: 1px solid var(--line-2); padding: 18px 16px 14px; margin-bottom: 16px;
}
.ip-bg {
  position: absolute; inset: -40% -30% auto -30%; height: 320px;
  background: radial-gradient(circle at 50% 50%, rgba(127,176,255,.34), transparent 68%);
  pointer-events: none;
}
.ip-body { position: relative; text-align: center; }
.ip-title { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.ip-sub { font-size: 12.5px; color: #9fb4d8; margin-top: 6px; }
.ip-sub em { color: #ffd66b; font-style: normal; font-weight: 700; font-size: 15px; }
.ip-avatar {
  width: 62px; height: 62px; border-radius: 50%; margin: 14px auto 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.ip-nick { font-size: 14px; color: #e8edf7; font-weight: 600; }
.ip-qr { margin: 14px 0 10px; }
.ip-qr-box {
  width: 138px; height: 138px; margin: 0 auto; background: #fff;
  border-radius: 12px; padding: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.45);
}
.ip-qr-box canvas { width: 100%; height: 100%; display: block; border-radius: 6px; }
.ip-qr-tip { font-size: 11px; color: #9fb4d8; margin-top: 7px; }
.ip-code-label { font-size: 11.5px; color: #9fb4d8; margin-top: 10px; }
.ip-code {
  font-family: var(--mono, monospace); font-size: 30px; font-weight: 800;
  letter-spacing: 10px; color: #7fb0ff; margin: 4px 0 2px; text-indent: 10px;
}
.ip-actions { position: relative; display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.ip-actions .btn { flex: 1; }

/* 绑定口令 */
.inv-bind {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 16px;
}
.ib-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.ib-body { display: flex; gap: 8px; }
.ib-input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; color: var(--text); font-size: 15px; letter-spacing: 3px;
  text-transform: uppercase; outline: none; font-family: var(--mono, monospace);
}
.ib-input:focus { border-color: #7fb0ff; }
.ib-note { font-size: 11.5px; color: var(--text-3); margin-top: 9px; line-height: 1.7; }
.ib-done { font-size: 13px; color: #3ecf8e; }

/* 邀请记录 */
.vb-count { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; }
.inv-list { max-height: 300px; overflow-y: auto; }
.inv-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}
.inv-item:last-child { border-bottom: none; }
.ii-ava {
  width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.ii-body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ii-body b { font-size: 13px; color: var(--text); }
.ii-body span { font-size: 11px; color: var(--text-3); }
.ii-reward { font-size: 14px; font-weight: 700; color: #ffd66b; font-family: var(--mono, monospace); }

/* 底部渠道导航 */
.inv-bottombar {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar-h, 0);
  display: flex; gap: 2px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(15,19,28,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); z-index: 50;
}
.inv-nav {
  flex: 1; background: transparent; border: none; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; cursor: pointer; padding: 2px 0; border-radius: 8px;
  transition: background .15s, color .15s;
}
.inv-nav:hover { background: rgba(127,176,255,.1); color: #7fb0ff; }
.in-nav-ico, .in-ico { font-size: 19px; line-height: 1; }

/* 渠道弹窗 */
.ch-card { max-width: 420px; }
.ch-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-close {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 1;
}
.modal-close:hover { border-color: var(--line-2); color: var(--text); }
.ch-body { text-align: center; }
.ch-hero {
  width: 62px; height: 62px; margin: 4px auto 12px; border-radius: 18px; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(127,176,255,.12); border: 1px solid rgba(127,176,255,.24);
}
.ch-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.8; text-align: left; margin-bottom: 14px; }
.ch-qr-wrap { margin-bottom: 14px; }
.ch-qr-wrap canvas { width: 150px; height: 150px; background: #fff; border-radius: 10px; padding: 7px; }
.ch-qr-tip { font-size: 11.5px; color: var(--text-3); margin-top: 7px; }
.ch-code-row {
  display: flex; align-items: center; gap: 8px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 10px;
}
.ch-code-label { font-size: 12px; color: var(--text-3); }
.ch-code { margin-left: auto; font-size: 19px; letter-spacing: 3px; color: #7fb0ff; }
.ch-link-row { display: flex; gap: 8px; }
.ch-link {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; color: var(--text-2); font-size: 11.5px; outline: none; min-width: 0;
}

/* ================= 邀请页 v2（参考截图框架） ================= */
.inv-poster {
  position: relative; border-radius: 20px; overflow: hidden;
  background: linear-gradient(165deg, #6f4bd8 0%, #5636b8 38%, #3c238f 72%, #2a1866 100%);
  border: 1px solid rgba(150,120,255,.35);
  padding: 22px 16px 18px; margin-bottom: 14px;
  box-shadow: 0 14px 40px rgba(90,60,200,.35);
}
.inv-poster .ip-bg {
  position: absolute; inset: -30% -20% auto -20%; height: 300px;
  background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.22), transparent 62%);
  pointer-events: none;
}
.ip-logo {
  width: 40px; height: 40px; border-radius: 12px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #8f6bff, #6a3df0);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.ip-title {
  position: relative; text-align: center; color: #fff;
  font-size: 25px; font-weight: 900; line-height: 1.32; letter-spacing: 1px;
}
.ip-title em {
  font-style: normal;
  background: linear-gradient(180deg, #ffe86b, #ffb62e);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ip-en {
  display: inline-block; vertical-align: top; margin-left: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,.55);
  -webkit-text-fill-color: rgba(255,255,255,.55);
}
.ip-sub {
  position: relative; text-align: center; color: rgba(255,255,255,.85);
  font-size: 12.5px; letter-spacing: 2px; margin: 10px 0 16px;
}
.ip-feats { position: relative; display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.ip-feat {
  display: flex; align-items: center; gap: 11px;
  background: rgba(24,14,60,.55); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 11px 13px; text-align: left;
}
.ipf-ico {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #8f6bff, #5f35e0);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ipf-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ipf-txt b { color: #fff; font-size: 13.5px; }
.ipf-txt span { color: rgba(255,255,255,.62); font-size: 10.5px; }
.ip-scan {
  position: relative; background: #fff; border-radius: 16px;
  padding: 13px 14px; display: flex; align-items: center; gap: 12px;
}
.ips-txt { flex: 1; min-width: 0; text-align: left; }
.ips-txt > b { color: #1a1440; font-size: 13px; }
.ips-txt > b em { color: #7b4dff; font-style: normal; padding: 0 2px; }
.ips-arrow { color: #7b4dff; font-weight: 900; }
.ips-brand { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.ips-logo {
  width: 26px; height: 26px; border-radius: 8px; font-size: 13px;
  background: linear-gradient(135deg, #8f6bff, #6a3df0);
  display: flex; align-items: center; justify-content: center;
}
.ips-brand b { display: block; color: #1a1440; font-size: 12.5px; line-height: 1.2; }
.ips-brand > div > span { color: #9a92c0; font-size: 9.5px; }
.ips-user {
  margin-top: 8px; color: #6b6390; font-size: 10.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ips-user em { color: #f5a623; font-style: normal; font-weight: 700; }
.ip-qr-box {
  width: 92px; height: 92px; flex-shrink: 0; background: #f4f1ff;
  border-radius: 12px; padding: 6px;
}
.ip-qr-box canvas { width: 100%; height: 100%; display: block; border-radius: 7px; }

/* 保存海报大按钮 */
.inv-save-btn {
  width: 100%; border: none; cursor: pointer;
  background: linear-gradient(90deg, #7b4dff, #6234e8);
  color: #fff; font-size: 15.5px; font-weight: 700; letter-spacing: 2px;
  border-radius: 14px; padding: 13px; margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(110,70,230,.4);
  transition: transform .15s, box-shadow .15s;
}
.inv-save-btn:active { transform: scale(.98); }

/* 邀请口令胶囊 */
.inv-code-pill {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 40px;
  padding: 10px 18px; margin: 0 auto 18px; width: fit-content; max-width: 100%;
}
.icp-label { font-size: 12.5px; color: var(--text-2); }
.icp-code { font-size: 21px; font-weight: 800; letter-spacing: 6px; color: #a78bff; }
.icp-copy {
  background: transparent; border: 1px solid var(--line-2); color: var(--text-2);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.icp-copy:hover { border-color: #7b4dff; color: #a78bff; }

/* 底部渠道图标：圆形彩色（参考截图） */
.inv-bottombar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.inv-nav { gap: 6px; font-size: 11px; color: var(--text-2); }
.in-ico {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; background: var(--panel-2); border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
}
.inv-nav:hover .in-ico { transform: translateY(-2px); }
.in-wx { background: #e8f8ee; border-color: #2aae67; }
.in-mo { background: linear-gradient(135deg, #ffe9f2, #e8ecff); border-color: #f35b9b; }
.in-gz { background: #e7f0ff; border-color: #4a7de0; }
.in-mi { background: #e6f7ef; border-color: #1fbf8f; }
.in-lk { background: #f1ecff; border-color: #7b4dff; }

/* 文案库：一行一条，不显示标题 */
#libCards { grid-template-columns: 1fr; }
.lib-card-row {
  flex-direction: row; align-items: center; gap: 14px;
  padding: 13px 14px; border-radius: 12px;
}
.lib-card-row:hover { transform: none; }
.lib-card-row .lib-card-body {
  flex: 1; min-width: 0; margin: 0;
  -webkit-line-clamp: 2; font-size: 13px; line-height: 1.65; color: var(--text);
}
.lib-card-row .lib-card-foot {
  margin: 0; padding: 0; border: none; flex-shrink: 0; gap: 6px;
}
.lib-card-row .lib-card-foot .lib-use { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 480px) {
  .lib-card-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .lib-card-row .lib-card-foot { justify-content: flex-end; }
  .lib-card-row .lib-card-foot .lib-use { flex: 1; }
}

/* 文案卡：正文最多 10 行 + 风格标签 */
.lib-card-row .lib-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lib-card-row .lib-card-body {
  -webkit-line-clamp: 10;
  font-size: 13.5px; line-height: 1.8; color: var(--text);
}
.lib-card-row .lib-card-tags { margin: 0; }
.lib-card-row .tag.style {
  background: rgba(123,77,255,.16); color: #b39aff; border-color: transparent;
}
.lib-card-row .lib-card-tags .hint { margin-left: auto; font-size: 11px; }
@media (max-width: 480px) {
  .lib-card-row { flex-direction: column; }
  .lib-card-row .lib-card-foot { flex-direction: row; }
}
