/* 一键广告视频 · 商家前台样式。先写手机（320–430px），末尾 @media (min-width: 1024px) 切电脑版。 */
:root {
  --bg: #f6f5f2; --card: #fff; --fg: #1d1d1f; --sub: #6e6e73; --line: #e6e4df;
  --accent: #fe2c55; --accent-soft: #ffe8ed; --ok: #16a34a; --warn: #b45309; --radius: 14px;
  --t-ai: #6366f1; --t-card: #f59e0b; --t-talk: #10b981; --t-compare: #0ea5e9; --t-footage: #8b5cf6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--accent); }
.bar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(246,245,242,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none; white-space: nowrap; }
.aigc { font-size: 12px; color: var(--sub); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.me { margin-left: auto; font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 手机：导航是页头下面一条 4 格标签 */
.nav { position: sticky; top: calc(49px + env(safe-area-inset-top)); z-index: 5; display: flex; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 2px 5px;
  font-size: 12px; color: var(--sub); text-decoration: none; border-bottom: 2px solid transparent; }
.nav a i { font-style: normal; font-size: 14px; line-height: 18px; }
.nav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.nav-foot { display: none; }

main { max-width: 560px; margin: 0 auto; padding: 14px 16px calc(110px + env(safe-area-inset-bottom)); }
h2 { font-size: 20px; margin: 8px 0 4px; }
h3 { font-size: 16px; }
.hint { color: var(--sub); font-size: 13px; margin: 0 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.card > b:first-child { display: block; margin-bottom: 4px; }

/* 步骤条：5 步，带字 */
.steps { display: flex; gap: 4px; margin-bottom: 10px; }
.steps span { flex: 1; font-size: 11px; color: var(--sub); text-align: center; white-space: nowrap; }
.steps span::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 3px; }
.steps span.on { color: var(--accent); }
.steps span.on::before { background: var(--accent); }

label { display: block; font-size: 13px; color: var(--sub); margin: 10px 0 4px; }
/* 16px：iOS 输入框小于 16px 会自动放大页面 */
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 16px; background: #fff; color: var(--fg); }
input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
.check { display: flex; gap: 8px; align-items: center; color: var(--fg); font-size: 13px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 9px 4px; font: inherit; color: var(--sub); cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 13px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff; margin-top: 14px; text-align: center; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--fg); border: 1px solid var(--line); }
.btn.sm { display: inline-block; width: auto; padding: 7px 12px; font-size: 13px; margin: 0; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; gap: 10px; } .btns .btn { flex: 1; }
.footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
.footer .inner { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; }
.footer .btn { margin-top: 0; flex: 1; }
.footer .btn.ghost { flex: 0 0 auto; width: auto; }

/* 上传：拖拽区 + 缩略图 */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  border: 1.5px dashed #d4d1ca; border-radius: 12px; padding: 16px 10px; background: #fbfaf8; color: var(--sub); cursor: pointer; }
.drop b { color: var(--fg); font-size: 15px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { font-size: 26px; line-height: 1; color: var(--accent); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eee; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; font-size: 11px; background: rgba(0,0,0,.65); color: #fff; border-radius: 6px; padding: 0 5px; }
.thumb .x { position: absolute; right: 4px; top: 4px; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
  border-radius: 99px; width: 24px; height: 24px; line-height: 22px; padding: 0; font-size: 15px; }
.thumb .prog { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45);
  color: #fff; font-size: 13px; font-weight: 600; }
.thumb .bar2 { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.thumb.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.thumb .ck { position: absolute; left: 6px; top: 6px; }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbtn { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; padding: 0; cursor: pointer; }

/* 选风格 / 选脚本卡片 */
.pick { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pick h3 { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.badge.gray { color: var(--sub); background: #f0efeb; }
.badge.ok { color: var(--ok); background: #e9f8ef; }
.badge.warn { color: var(--warn); background: #fff7ed; }
.reason { font-size: 13px; color: var(--fg); margin: 6px 0 0; }
.muted { color: var(--sub); font-size: 13px; }
.locked { opacity: .6; }
.unlock { font-size: 13px; color: var(--warn); background: #fff7ed; border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.shots { margin: 8px 0 0; padding: 0; list-style: none; }
.shots li { display: flex; gap: 8px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.shots li:first-child { border-top: 0; }
.shots .t { flex: none; width: 40px; color: var(--sub); }
.k { flex: none; font-size: 11px; color: var(--sub); border: 1px solid var(--line); border-radius: 6px; padding: 0 4px; height: 18px; line-height: 16px; white-space: nowrap; }
.mix { display: flex; height: 6px; border-radius: 6px; overflow: hidden; margin: 8px 0 2px; background: var(--line); }
.mix i { display: block; height: 100%; }
.ty-ai { background: var(--t-ai); } .ty-card { background: var(--t-card); } .ty-talk { background: var(--t-talk); }
.ty-compare { background: var(--t-compare); } .ty-footage { background: var(--t-footage); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--sub); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 3px; }

/* 播放器 / 竖版预览框 */
.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 9/16;
  max-height: 68vh; max-width: calc(68vh * 9 / 16); margin: 0 auto; }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; }
.ai-mark { position: absolute; right: 10px; top: 10px; font-size: 12px; color: #fff; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 8px; pointer-events: none; z-index: 2; }
.frame { position: relative; aspect-ratio: 9/16; border-radius: 14px; overflow: hidden; background: #222 center/cover no-repeat; color: #fff; }
.frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.15), transparent 30%, transparent 55%, rgba(0,0,0,.65)); }
.frame .fcap { position: absolute; left: 8%; right: 8%; bottom: 14%; z-index: 1; text-align: center; font-weight: 700; font-size: 18px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.frame .fcap.bold { font-size: 24px; bottom: 40%; }
.frame .fcap.sticker { display: inline-block; background: #ffe14d; color: #222; border-radius: 8px; padding: 2px 10px; text-shadow: none; left: 50%; right: auto; transform: translateX(-50%) rotate(-3deg); white-space: nowrap; }
.frame .fkind { position: absolute; left: 10px; top: 10px; z-index: 1; font-size: 11px; background: rgba(0,0,0,.5); border-radius: 6px; padding: 1px 6px; }
.frame .fvoice { position: absolute; left: 8%; right: 8%; bottom: 5%; z-index: 1; font-size: 12px; text-align: center; opacity: .9; }
.frame .fbar { position: absolute; left: 0; right: 0; top: 0; z-index: 1; display: flex; gap: 2px; padding: 4px; }
.frame .fbar i { flex: 1; height: 2px; background: rgba(255,255,255,.35); border-radius: 2px; }
.frame .fbar i.on { background: #fff; }

/* 逐镜重做 */
.redo li { align-items: center; }
.redo .kf { width: 40px; height: 64px; object-fit: cover; border-radius: 6px; background: #eee; flex: none; }
.redo .kph { width: 40px; height: 64px; border-radius: 6px; background: #f0efeb; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--sub); }
.redo .body { flex: 1; min-width: 0; }
.redo input[type=text] { padding: 6px 8px; font-size: 16px; margin-top: 4px; }
.redo li.sel { background: var(--accent-soft); border-radius: 8px; }
.covers { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.covers img { width: 72px; height: 128px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; flex: none; cursor: pointer; }
.covers img.on { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips span { font-size: 12px; background: #f0efeb; border-radius: 99px; padding: 1px 8px; }
.chips span.ai { background: var(--accent-soft); color: var(--accent); }

.wait { text-align: center; padding: 40px 10px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: #b91c1c; background: #fef2f2; border-radius: 10px; padding: 10px; font-size: 13px; }

/* 列表：成片 / 素材 / 发布记录 */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 6px 0 10px; }
.tabs button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; color: var(--sub); cursor: pointer; }
.tabs button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.oc { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.oc .pic { position: relative; aspect-ratio: 3/4; background: #f0efeb center/cover no-repeat; display: block; }
.oc .pic .st { position: absolute; left: 6px; bottom: 6px; }
.oc .meta { padding: 8px 10px 10px; font-size: 13px; }
.oc .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.oc .ck { position: absolute; right: 8px; top: 8px; z-index: 2; }
.lib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.selbar { position: sticky; top: calc(96px + env(safe-area-inset-top)); z-index: 3; display: flex; align-items: center; gap: 10px;
  background: #1d1d1f; color: #fff; border-radius: 12px; padding: 8px 10px 8px 14px; margin-bottom: 10px; font-size: 13px; }
.selbar .grow { flex: 1; }
.selbar .btn { background: var(--accent); }
.selbar .btn.ghost { background: transparent; color: #fff; border-color: #555; }
.rec { display: flex; gap: 10px; align-items: flex-start; }
.rec img, .rec .ph { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; background: #f0efeb; flex: none; }
.rec .grow { flex: 1; min-width: 0; }
.rec .grow b { display: block; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; color: var(--sub); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t img { width: 45px; height: 80px; object-fit: cover; border-radius: 6px; display: block; background: #f0efeb; }
.empty { text-align: center; color: var(--sub); padding: 40px 10px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(0,0,0,.82); color: #fff;
  padding: 8px 14px; border-radius: 10px; font-size: 14px; z-index: 30; max-width: 86vw; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 20; }
.modal .sheet { background: #fff; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 18px 18px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.modal ol { padding-left: 20px; margin: 8px 0; }
.copy { background: #f6f5f2; border-radius: 10px; padding: 10px; font-size: 13px; word-break: break-all; }
.qr { display: block; width: 220px; height: 220px; margin: 8px auto; image-rendering: pixelated; }
.qrbox { text-align: center; }
.share-hero { display: flex; gap: 12px; align-items: center; }
.share-hero .player { width: 110px; max-height: none; flex: none; margin: 0; }
.desk-only { display: none !important; }

/* 登录 */
.login-intro { display: none; }

@media (max-width: 359px) {
  main { padding-left: 12px; padding-right: 12px; }
  .logo { font-size: 16px; } .bar { gap: 6px; }
  .aigc { font-size: 11px; padding: 0 6px; }   /* 窄屏也要一直标着 AI 生成 */
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .seg button { font-size: 14px; }
}

/* ======================= 电脑版（≥ 1024px）======================= */
@media (min-width: 1024px) {
  .desk-only { display: revert !important; }
  .mob-only { display: none !important; }
  .bar { padding: 12px 24px; }
  .me { font-size: 13px; }
  .shell { display: flex; align-items: flex-start; min-height: calc(100vh - 53px); }
  .nav { position: sticky; top: 53px; flex: 0 0 208px; flex-direction: column; height: calc(100vh - 53px);
    border-bottom: 0; border-right: 1px solid var(--line); padding: 14px 10px; background: #fff; }
  .nav a { flex: none; flex-direction: row; gap: 10px; padding: 10px 12px; font-size: 15px; color: var(--fg);
    border-bottom: 0; border-radius: 10px; margin-bottom: 2px; }
  .nav a i { width: 20px; text-align: center; color: var(--sub); }
  .nav a:hover { background: var(--bg); }
  .nav a.on { background: var(--accent-soft); color: var(--accent); }
  .nav a.on i { color: var(--accent); }
  .nav-foot { display: block; margin-top: auto; font-size: 12px; color: var(--sub); padding: 10px 12px; border-top: 1px solid var(--line); }
  main { flex: 1; min-width: 0; max-width: 1320px; margin: 0; padding: 20px 32px 48px; }
  .shell.bare main { max-width: 980px; margin: 0 auto; }
  h2 { font-size: 22px; }
  .steps { max-width: 640px; }
  .footer { position: static; background: none; border: 0; padding: 0; margin-top: 18px; }
  .footer .inner { max-width: none; justify-content: flex-end; }
  .footer .btn { flex: 0 0 auto; width: auto; padding: 12px 28px; }
  .btn.inline { display: inline-block; width: auto; padding: 11px 24px; }
  #toast { bottom: 40px; }

  .split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .split > .card, .split > div > .card:first-child { margin-top: 0; }
  .split.pv { grid-template-columns: minmax(0, 1fr) 340px; }
  .split.rv { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 28px; }
  .sticky { position: sticky; top: 73px; }
  .drop { padding: 34px 16px; min-height: 180px; }
  .drop .big { font-size: 34px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .stylegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stylegrid .card { margin: 0; }
  .cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .cols3 .card { margin: 0; }
  .pvpanel .frame { width: 100%; max-width: 230px; margin: 0 auto; }
  textarea { min-height: 112px; }
  .board { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
  .board .shots li { font-size: 14px; padding: 9px 4px; cursor: pointer; border-radius: 6px; }
  .board .shots li.cur { background: var(--accent-soft); }
  .player { max-height: calc(100vh - 140px); max-width: none; width: 100%; }
  .rv .player { max-height: calc(100vh - 120px); width: min(100%, calc((100vh - 120px) * 9 / 16)); }
  .redo .kf, .redo .kph { width: 54px; height: 96px; }
  .redo li { padding: 10px 6px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
  .lib { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .selbar { top: 65px; }
  .modal { align-items: center; }
  .modal .sheet { border-radius: 18px; max-width: 760px; padding: 24px 28px; }
  .modal .sheet.narrow { max-width: 460px; }
  .qrwrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
  .qr { width: 240px; height: 240px; }
  .login-wrap { display: grid; grid-template-columns: 1fr 400px; gap: 48px; align-items: center; min-height: 70vh; max-width: 980px; margin: 0 auto; }
  .login-intro { display: block; }
  .login-intro h1 { font-size: 34px; margin: 0 0 12px; }
  .login-intro li { margin: 6px 0; color: var(--sub); }
}
