:root {
  --bg: #0f0e0d;
  --panel: #161513;
  --raised: #1e1c1a;
  --line: #2b2825;
  --line-strong: #3a3632;
  --text: #f3efe8;
  --muted: #a29b91;
  --faint: #6f6962;
  --accent: #e2683a;
  --accent-2: #f0a35e;
  --accent-ink: #1a0f0a;
  --accent-soft: rgba(226, 104, 58, 0.14);
  --good: #6cc08d;
  --warn: #f0b45a;
  --radius: 16px;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.service-notice { margin: 0 0 24px; padding: 14px 18px; border: 1px solid #72532a; border-radius: 10px; background: #251e14; color: #f4d5a1; font-size: 14px; line-height: 1.6; }
.main > .service-notice { margin: 24px auto 0; max-width: 900px; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
h3 { margin: 0; font-size: 16px; font-weight: 600; }
.eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 14px; text-decoration: none; transition: transform .12s, background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn-small { padding: 7px 13px; font-size: 13px; }
.btn-large { padding: 14px 26px; font-size: 15px; }
.cost { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: rgba(0, 0, 0, 0.18); }
.btn-ghost .cost { background: var(--raised); color: var(--muted); }
.cost::before { content: ""; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: currentColor; opacity: .7; }
.cost.plain::before { content: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 13px; color: var(--muted); }
.pill:hover { border-color: var(--line-strong); color: var(--text); }
.pill b { color: var(--text); font-weight: 600; }
.spark { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.credits.bump b { animation: bump .5s ease; }
@keyframes bump { 40% { color: var(--accent-2); } }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.logo-mark { width: 24px; height: 24px; flex: none; }

/* Sign in：和官网一致，中性黑底、系统字体、不用渐变 */
.login {
  min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  background: #0b0b0b; color: #f2f2f0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.login-media { position: relative; margin: 0; background: #000; overflow: hidden; }
.login-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-media figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 28px 24px; font-size: 13px; color: rgba(242, 242, 240, 0.8);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}
.login-panel { display: flex; flex-direction: column; padding: 28px 48px; border-left: 1px solid #262624; }
.login-logo { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }
.login-card { margin: auto 0; width: 100%; max-width: 380px; }
.login-card h1 { font-family: inherit; font-size: 36px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 10px; }
.login-card .muted { color: #8d8d88; margin: 0; }
.login-form { display: grid; gap: 10px; margin-top: 28px; }
.login-form input { padding: 12px 14px; border-radius: 8px; border: 1px solid #2e2e2b; background: #141414; color: #f2f2f0; }
.login-form input::placeholder { color: #6b6b67; }
.login-form input:focus { outline: 2px solid #8d8d88; outline-offset: 1px; }
.login-alt { margin: 14px 0 0; }
.link-btn { padding: 0; border: 0; background: none; color: #8d8d88; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: #f2f2f0; }
.password-form { display: grid; gap: 10px; margin-top: 16px; }
.password-form input { padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line, #333); background: transparent; color: inherit; font: inherit; }
.composer textarea:focus, .refine input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-btn { padding: 12px 20px; border-radius: 8px; border: 0; background: #f2f2f0; color: #0b0b0b; font-weight: 600; cursor: pointer; }
.login-btn:hover:not(:disabled) { opacity: 0.88; }
.login-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.login-spots { display: flex; align-items: center; gap: 10px; margin: 20px 0 0; font-size: 14px; color: #f2f2f0; }
.login-spots::before, .free-spots::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #4cc276; }
.login-spots.full::before, .free-spots.full::before { background: #e0a23a; }
.free-spots { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.login-msg { min-height: 1.5em; margin: 16px 0 0; font-size: 14px; color: #8d8d88; word-break: break-word; }
.login-msg a { color: #f2f2f0; }
.login-switch { margin: 20px 0 0; font-size: 14px; color: #8d8d88; }
.login-switch a { color: #f2f2f0; text-underline-offset: 3px; }
.login-legal { margin: 0; font-size: 12px; color: #6b6b67; }
.login-legal a { color: #8d8d88; }
@media (max-width: 820px) {
  /* 手机：作品缩成顶部一条，登录表单在下面 */
  .login { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .login-media figcaption { display: none; }
  .login-panel { padding: 20px 20px 24px; border-left: 0; }
  .login-card { margin: 28px 0; }
  .login-card h1 { font-size: 30px; }
}

/* Layout */
.app { min-height: 100%; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 20px;
  background: rgba(15, 14, 13, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--raised); cursor: pointer; font-weight: 600; text-transform: uppercase; }
.menu { position: absolute; right: 0; top: 44px; width: 240px; padding: 8px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line-strong); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45); }
.menu-email { margin: 6px 10px 0; font-weight: 600; word-break: break-all; }
.menu-plan { margin: 2px 10px 8px; color: var(--muted); font-size: 13px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-decoration: none; font-size: 14px; }
.menu-item:hover { background: var(--panel); }
.shell { flex: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 0; }

/* History */
.history { border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; height: calc(100vh - 60px); position: sticky; top: 60px; }
.btn-new { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-strong); background: transparent; cursor: pointer; font-weight: 600; }
.btn-new:hover { border-color: var(--accent); color: var(--accent-2); }
.history-title { margin: 20px 6px 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.history-list button { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; width: 100%; padding: 8px; border-radius: 10px; border: 0; background: none; cursor: pointer; text-align: left; }
.history-list button:hover, .history-list button.active { background: var(--raised); }
.history-list .thumb { width: 40px; height: 52px; border-radius: 7px; overflow: hidden; background: var(--raised); }
.history-list .thumb img, .history-list .thumb svg { width: 100%; height: 100%; object-fit: cover; }
.history-list .h-text { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-list .h-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }
.history-empty { color: var(--faint); font-size: 13px; padding: 6px; }

/* Main */
.main { padding: 40px 32px 120px; min-width: 0; }
.start { max-width: 760px; margin: 8vh auto 0; text-align: center; }
.start h1 { font-size: clamp(40px, 5vw, 60px); }
.start .sub { color: var(--muted); margin: 10px 0 28px; }
.composer { text-align: left; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 20px; padding: 14px; box-shadow: 0 30px 80px -40px rgba(226, 104, 58, 0.35); }
.composer textarea { width: 100%; resize: none; border: 0; background: transparent; padding: 6px 8px; font-size: 18px; line-height: 1.5; }
.composer textarea::placeholder, .refine input::placeholder { color: var(--faint); }
.composer textarea:focus { outline: none; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--raised); color: var(--text); }
.composer-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.asset-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.asset-chip:hover { color: var(--text); border-color: var(--muted); }
.asset-chip svg { width: 16px; height: 16px; }
.asset-chip.on { border-style: solid; border-color: var(--accent); color: var(--text); background: var(--accent-soft); padding: 3px 6px 3px 3px; }
.asset-chip .mini-thumb { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.asset-chip .x { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--muted); }
.asset-chip .x:hover { background: var(--raised); color: var(--text); }
.pro-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.work-asset { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--raised); font-size: 13px; color: var(--muted); }
.work-asset img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.work-asset b { color: var(--text); font-weight: 600; }
.dialog-wide { width: min(620px, calc(100% - 32px)); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin: 18px 0; }
.asset-card { position: relative; padding: 0; border: 2px solid transparent; border-radius: 14px; overflow: hidden; background: var(--raised); cursor: pointer; text-align: left; }
.asset-card:hover { border-color: var(--line-strong); }
.asset-card.selected { border-color: var(--accent); }
.asset-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.asset-card .meta { display: block; padding: 8px 10px; }
.asset-card .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card .meta span { font-size: 11px; color: var(--faint); }
.asset-card .del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; display: grid; place-items: center; }
.asset-card .del svg { width: 14px; height: 14px; }
.upload { display: grid; gap: 12px; padding: 16px; border-radius: 16px; border: 1px dashed var(--line-strong); }
.upload-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.upload input[type="text"] { flex: 1 1 200px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); }
.drop { display: grid; place-items: center; gap: 4px; min-height: 96px; padding: 14px; border-radius: 12px; background: var(--bg); color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; }
.drop.over { outline: 2px solid var(--accent); }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.upsell { padding: 18px; border-radius: 16px; background: var(--raised); margin-top: 18px; }
.upsell p { margin: 0 0 14px; color: var(--muted); }

.templates { margin-top: 30px; text-align: left; }
.templates-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--faint); font-size: 13px; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tpl { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.tpl:hover { border-color: var(--line-strong); background: var(--panel); }
.tpl-thumb { flex: none; width: 46px; height: 58px; border-radius: 9px; overflow: hidden; background: linear-gradient(150deg, var(--accent-soft), var(--raised)); display: grid; place-items: center; color: var(--accent-2); }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-thumb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tpl b { display: block; font-size: 14px; font-weight: 600; }
.tpl span.t-line { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.tpl .pro-badge { margin-left: 6px; vertical-align: 1px; }
.asset-chip.nudge { animation: nudge .9s ease 2; }
@keyframes nudge { 30% { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); } }
.animate-group { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.video-opt { padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font-size: 13px; }
.video-sound { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.video-sound.off { color: var(--faint); cursor: not-allowed; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.consent input { margin-top: 3px; accent-color: var(--accent); }
.round-sub-progress { color: var(--accent-2); }

/* Work */
.work { max-width: 1040px; margin: 0 auto; }
.work-head { margin-bottom: 18px; }
.work-head h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; }
.past { display: grid; gap: 10px; margin-bottom: 18px; }
.past-row { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.past-row .mini { display: flex; gap: 4px; }
.past-row .mini span { width: 28px; height: 40px; border-radius: 5px; overflow: hidden; background: var(--raised); opacity: .55; }
.past-row .mini span.chosen { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }
.past-row .mini img, .past-row .mini svg { width: 100%; height: 100%; object-fit: cover; }
.round-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.round-head .muted { font-size: 13px; }
.frames { display: grid; grid-template-columns: repeat(var(--preview-count, 4), 1fr); gap: 14px; }
.frame { position: relative; padding: 0; border: 2px solid transparent; border-radius: var(--radius); overflow: hidden; background: var(--raised); cursor: pointer; transition: transform .15s, border-color .15s; }
.frame:hover:not(:disabled) { transform: translateY(-2px); }
.frame.selected { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.frame img, .frame svg.preview { width: 100%; height: 100%; object-fit: cover; }
.frame .media { aspect-ratio: var(--aspect, 9 / 16); }
.frame .media > svg { width: 100%; height: 100%; }
.frame .tags { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(8px); }
.tag.rec { background: rgba(108, 192, 141, 0.9); color: #0b1a10; }
.tag.warn { background: rgba(240, 180, 90, 0.92); color: #241503; cursor: help; }
.frame .check { position: absolute; right: 10px; bottom: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); opacity: 0; transform: scale(.8); transition: .15s; }
.frame.selected .check { opacity: 1; transform: none; }
.frame .check svg { width: 16px; height: 16px; stroke-width: 2.6; }
.frame.failed { cursor: default; display: grid; place-items: center; }
.frame.failed .media { display: grid; place-items: center; padding: 16px; text-align: center; color: var(--faint); font-size: 13px; }
.frame.skeleton { cursor: default; }
.frame.skeleton .media { background: linear-gradient(100deg, var(--raised) 30%, #2a2724 50%, var(--raised) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .frame.skeleton .media { animation: none; } }
.pick-reason { margin: 14px 2px 0; font-size: 14px; color: var(--muted); }
.pick-reason b { color: var(--good); font-weight: 600; }

/* Actions */
.actions { display: flex; align-items: flex-start; gap: 14px; margin-top: 22px; padding: 14px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
/* 选好图后“改一改 / 做成视频”一直贴在底部，矮屏幕上不用往下翻找 */
@media (min-width: 901px) { .actions { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 -8px 32px rgba(0, 0, 0, .35); } }
.refine { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.refine input { flex: 1 1 240px; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 11px; font-size: 13px; color: var(--muted); cursor: pointer; }
.quick button:hover { color: var(--text); border-color: var(--line-strong); }

/* Video */
.video-card { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 28px; align-items: center; margin-top: 22px; padding: 18px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.video-stage { position: relative; aspect-ratio: var(--aspect, 9 / 16); border-radius: 14px; overflow: hidden; background: var(--raised); }
.video-stage img, .video-stage video, .video-stage svg { width: 100%; height: 100%; object-fit: cover; }
.video-stage .veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 14, 13, 0.55); backdrop-filter: blur(2px); }
.ring { width: 52px; height: 52px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent-2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.video-info h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin-bottom: 6px; }
.video-info p { margin: 0 0 18px; color: var(--muted); }
.video-info .row { display: flex; gap: 10px; flex-wrap: wrap; }
.video-info .note { color: var(--warn); }

/* Your style panel */
.panel { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(380px, 100%); padding: 22px; overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--line-strong); box-shadow: -30px 0 60px rgba(0, 0, 0, 0.4); animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.panel-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.panel h2, .dialog h2 { font-size: 30px; }
.traits { display: grid; gap: 12px; margin: 20px 0; }
.trait { display: grid; grid-template-columns: 1fr 90px; align-items: center; gap: 12px; font-size: 14px; }
.trait .meter { height: 6px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.trait .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rules-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); margin: 22px 0 8px; font-weight: 600; }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; border: 0; background: var(--line-strong); cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 19px; }
.style-meta { color: var(--faint); font-size: 13px; margin: 18px 0; }
.empty-note { padding: 16px; border-radius: 14px; background: var(--raised); color: var(--muted); font-size: 14px; margin: 20px 0; }

/* Dialogs */
.dialog { width: min(440px, calc(100% - 32px)); padding: 24px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; font-size: 14px; }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 6px; border-left: 2px solid var(--accent-2); border-bottom: 2px solid var(--accent-2); transform: rotate(-45deg); }
.big-balance { font-family: var(--serif); font-size: 64px; line-height: 1; margin: 10px 0 2px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 18px 0; font-size: 14px; }
.kv span:nth-child(odd) { color: var(--muted); }
.ledger { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line); }
.ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ledger .plus { color: var(--good); }
.ledger time { color: var(--faint); margin-left: 8px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-strong); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); font-size: 14px; }
.scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, 0.55); }

.only-mobile { display: none; }

@media (max-width: 1100px) {
  .frames { grid-template-columns: repeat(2, 1fr); max-width: 560px; }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-grid; }
  .only-desktop { display: none; }
  .menu .only-mobile { display: block; }
  .shell { grid-template-columns: 1fr; }
  .history { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: 280px; height: 100%; background: var(--panel); transform: translateX(-100%); transition: transform .2s; }
  .history.open { transform: none; }
  .top { padding: 0 12px; }
  .main { padding: 24px 16px 80px; }
  .start { margin-top: 4vh; }
  .composer textarea { font-size: 16px; }
  .composer-bar .btn { width: 100%; }
  .frames { gap: 10px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn-large { width: 100%; }
  .tpl-grid { grid-template-columns: 1fr; }
  .templates-head { flex-wrap: wrap; }
  .video-card { grid-template-columns: 1fr; }
  .video-stage { max-width: 320px; margin: 0 auto; width: 100%; }
}

.plan-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.plan-choice button { display: grid; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; text-align: left; color: var(--text); }
.plan-choice button:hover { border-color: var(--accent); }
.plan-choice.one { grid-template-columns: 1fr; }
.plan-choice b { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.plan-choice span { font-size: 12px; color: var(--muted); }
.plan-choice .save { color: var(--accent-2); font-weight: 600; }
.mor-note { margin: 12px 0 0; font-size: 12px; color: var(--faint); }
.pack-buy { width: 100%; margin-top: 10px; }

#photo-text { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; resize: vertical; }
#photo-preview img { width: auto; height: 160px; object-fit: contain; }

/* Story mode */
.story { max-width: 920px; margin: 4vh auto 0; }
.story-new { max-width: 720px; margin: 0 auto; display: grid; gap: 14px; }
.story-new textarea, .story-edit textarea, .story-edit input:not([type=checkbox]):not([type=file]), .story-opts select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: inherit; font: inherit; }
.story-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.story-opts label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.story-estimate { margin: 0; font-size: 13px; }
.story-go { display: flex; justify-content: flex-start; }
.story-list { display: grid; gap: 6px; margin-top: 18px; }
.story-list button { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.story-list button:hover { background: var(--raised); }
.story-list .thumb { width: 40px; height: 52px; border-radius: 6px; overflow: hidden; background: var(--raised); }
.story-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-top { display: grid; gap: 8px; margin-bottom: 18px; }
.story-title { font-size: 24px !important; font-weight: 600; background: transparent !important; border-color: transparent !important; padding-left: 0 !important; }
.story-title:hover, .story-title:focus { border-color: var(--line) !important; padding-left: 12px !important; }
.story-look { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.shots { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.shot { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.shot-media { aspect-ratio: var(--aspect, 9 / 16); border-radius: 10px; overflow: hidden; background: var(--raised); display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; padding: 0; }
.shot-media img, .shot-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-media .busy { padding: 8px; }
.shot-text { display: grid; gap: 8px; align-content: start; }
.shot-head { display: flex; align-items: center; gap: 6px; }
.shot-head b { margin-right: auto; }
.shot-head button, .shot-actions button { padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.shot-head button:hover, .shot-actions button:hover { color: var(--text); border-color: var(--muted); }
.shot-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.shot-status { font-size: 12px; color: var(--muted); }
.shot-status.bad { color: #e0806a; }
.story-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 28px; }
.story-final { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.dialogue-revision { border-block: 1px solid var(--line); padding: 18px 0; overflow-wrap: anywhere; }
.dialogue-revision h3, .dialogue-revision p { margin: 0 0 8px; }
.dialogue-revision h4 { margin: 18px 0 8px; }
.dialogue-revision ol { list-style: none; margin: 0; padding: 0; }
.dialogue-revision li, .revision-target { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 12px; align-items: baseline; line-height: 1.65; }
.dialogue-revision li + li { margin-top: 8px; }
.revision-target button { color: inherit; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); cursor: pointer; }
.story-music { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.story-result video { width: min(360px, 100%); border-radius: 12px; display: block; margin-top: 6px; }
.story-result a { display: inline-block; margin-top: 10px; }
@media (max-width: 640px) { .shot { grid-template-columns: 96px 1fr; gap: 10px; } }
.story-lead { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; align-items: start; }
.story-lead .lead-pic { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--raised); display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; padding: 0; }
.story-lead .lead-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-lead .lead-text { display: grid; gap: 8px; }
.story-lead .lead-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.story-lead .lead-row input { flex: 1; min-width: 140px; }
.story-lead .lead-row button { padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.shot-lead { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }

/* 分享 / 邀请：链接 + 复制 */
.copy-row { display: flex; gap: 8px; margin-top: 16px; }
.copy-row input { flex: 1; min-width: 0; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: inherit; font: inherit; font-size: 14px; }
#invite-stats { margin-top: 14px; font-size: 14px; }
#story-result .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.export-select { font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.export-select:hover { border-color: var(--muted); }
.story-result .export-select { padding: 6px 12px; font-size: 13px; }
.brand-form { display: grid; gap: 14px; }
.brand-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.brand-form input:not([type]), .brand-form input[maxlength] { font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; }
.brand-form .consent { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.brand-colors { display: flex; gap: 16px; }
.brand-colors input { width: 64px; height: 34px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: none; }
.brand-logo { display: flex; gap: 14px; align-items: center; }
.brand-logo label.btn { display: inline-flex; color: var(--text); }
.brand-pic { width: 84px; height: 84px; border-radius: 12px; display: grid; place-items: center; font-size: 12px;
  color: var(--faint); border: 1px solid var(--line-strong); overflow: hidden; flex: none; }
.brand-pic img { max-width: 80%; max-height: 80%; }
.small { font-size: 12px; margin: 6px 0 0; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.batch-grid.big { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 18px 0; }
.batch-item { position: relative; display: grid; gap: 6px; font-size: 12px; }
.batch-item img, .batch-item video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: var(--raised); }
.batch-grid:not(.big) .batch-item img { aspect-ratio: 1; }
.batch-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-item .bad { color: var(--warn); white-space: normal; }
.batch-item .row { display: flex; gap: 6px; flex-wrap: wrap; }
.batch-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; line-height: 1; }
.batch-pick { justify-self: start; }
.story-opts label.video-sound { display: inline-flex; align-self: end; padding-bottom: 10px; color: var(--text); }
.story-opts label.video-sound.off { color: var(--faint); }
.video-sound .hint { color: var(--faint); font-size: 12px; }
