/* ClipMuse 界面：主风格「暗黑高级科技」（深色底、细线描边、微弱高光、几何无衬线、单一强调色、Bento 卡片）
   + 辅助风格「大字报」（首屏大字标题制造冲击和情绪）。单一强调色：紫 #8B7CFF。间距 4/8/12/16/24。 */
:root {
  color-scheme: dark;
  accent-color: #8B7CFF;
  --bg: #0B0B10;
  --card: #14141B;
  --card-2: #1B1B24;
  --text: #EDEDF2;
  --muted: #8A8A9A;
  --line: #262632;
  --line-strong: #34344A;
  --primary: #8B7CFF;
  --primary-hi: #A99DFF;
  --primary-ink: #0B0B10;
  --primary-weak: rgba(139,124,255,.14);
  --danger: #FF6B6B;
  --danger-weak: rgba(255,107,107,.12);
  --ok: #3DDC97;
  --ok-weak: rgba(61,220,151,.12);
  --warn: #FFC15A;
  --warn-weak: rgba(255,193,90,.12);
  --radius: 16px;
  --tabbar-h: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
[hidden] { display: none !important; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 600; letter-spacing: .2px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 13px; }
.center { text-align: center; }
.hint { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(11,11,16,.82); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: .4px; }
#siteName { background: linear-gradient(90deg, #fff, var(--primary-hi)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.service-warn { margin: 12px auto 0; max-width: 640px; padding: 10px 16px; background: var(--warn-weak);
  color: var(--warn); font-size: 13px; border-radius: var(--radius); }

main { max-width: 640px; margin: 0 auto; padding: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.notice { background: var(--primary-weak); color: var(--primary); border-radius: var(--radius);
  padding: 10px 16px; font-size: 13px; margin-bottom: 12px; }

.field { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.field > input, .field > select, .field > textarea, .field > .row { margin-top: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #0F0F15;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
::placeholder { color: #5C5C6E; }
select option { background: var(--card); color: var(--text); }
select.compact { width: auto; min-height: 36px; padding: 4px 8px; }
input[type=range] { padding: 0; border: none; min-height: 32px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent; user-select: none; white-space: nowrap;
}
a.btn { text-decoration: none; }
.btn:hover { border-color: var(--line-strong); }
.btn:active { background: #22222D; transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 24px -8px rgba(139,124,255,.6); }
.btn.primary:hover { background: var(--primary-hi); border-color: var(--primary-hi); }
.btn.primary:active { background: #7A6AF0; }
.btn.danger { color: var(--danger); border-color: rgba(255,107,107,.35); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary-hi); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 17px; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.badge { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-weak); color: var(--ok); }
.badge.danger { background: var(--danger-weak); color: var(--danger); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.primary { background: var(--primary-weak); color: var(--primary); }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #101017; }
.item.clickable { cursor: pointer; }
.item.clickable:hover { border-color: var(--line-strong); }
.item.clickable:active { background: #191922; }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.item-text { margin-top: 4px; white-space: pre-wrap; word-break: break-all; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.media-item { display: flex; gap: 12px; align-items: center; }
.thumb { width: 54px; height: 96px; border-radius: 8px; object-fit: cover; background: #1F1F29; flex: none; }

.empty, .loading, .error-box { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 8px; }
.error-box { color: var(--danger); }
.error-box .btn { margin-top: 8px; }

.upload-box { margin-top: 12px; }
.upload-box > summary { list-style: none; margin-top: 0; }
.upload-box > summary::-webkit-details-marker { display: none; }
.upload-box[open] > summary { color: var(--muted); }
.consent { background: #101017; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; font-size: 13px; }
.consent h3 { font-size: 15px; margin: 0 0 8px; }
.consent ol { margin: 0 0 8px; padding-left: 20px; }
.consent li { margin: 2px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; color: var(--text); font-size: 14px; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; }
.file-pick { display: flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); cursor: pointer; padding: 8px; text-align: center; word-break: break-all; }
.file-pick input { display: none; }

.progress { position: relative; height: 22px; background: #1F1F29; border-radius: 11px; margin-top: 12px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, #6E5CFF, var(--primary-hi)); transition: width .3s; }
.progress .ptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text); }

.stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.stats b { color: var(--text); font-weight: 600; }
.stats .over { color: var(--danger); }

.panel { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.panel h3 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.hit { border-left: 3px solid var(--danger); background: var(--danger-weak); border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.hit.warn { border-left-color: var(--warn); background: var(--warn-weak); }
.hit .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.hit .lbl { color: var(--muted); font-size: 12px; margin-right: 4px; }
.suggest { background: var(--primary-weak); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; font-size: 14px; }
.disclaimer { color: var(--muted); font-size: 12px; margin-top: 8px; }
.copy-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.copy-row:last-child { border-bottom: none; }
.copy-row span { word-break: break-all; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.seg { display: flex; background: #0F0F15; border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; min-height: 38px; border: none; background: transparent; border-radius: 8px; font: inherit; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card-2); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); border-radius: 19px; font: inherit; cursor: pointer; }
.chip.on { border-color: var(--primary); color: var(--primary-hi); background: var(--primary-weak); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 4px; }
.pick { border: 2px solid transparent; border-radius: 10px; padding: 4px; background: #101017; cursor: pointer; text-align: center; font-size: 12px; color: var(--muted); }
.pick.on { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); }
.pick img, .pick .ph { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; background: #1F1F29; display: block; }
.warn-box { background: var(--warn-weak); color: var(--warn); border-radius: 10px; padding: 12px; font-size: 14px; margin-bottom: 8px; }
.warn-box .check { color: var(--warn); margin-top: 8px; }
.ok-box { background: var(--ok-weak); color: var(--ok); border-radius: 10px; padding: 12px; font-size: 14px; margin-bottom: 8px; }

.job-progress { margin: 16px 0; }
.job-step { font-size: 15px; margin-bottom: 8px; }
.job-error { background: var(--danger-weak); color: var(--danger); border-radius: 10px; padding: 12px; font-size: 14px; word-break: break-all; }
video.player { width: 100%; max-height: 70vh; background: #000; border-radius: 14px; border: 1px solid var(--line); display: block; }
img.cover { width: 100%; border-radius: 10px; display: block; }
.kv { font-size: 13px; }
.kv div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv div:last-child { border-bottom: none; }
.kv span:first-child { color: var(--muted); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: rgba(11,11,16,.86); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); border-top: 1px solid var(--line);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button { flex: 1; border: none; background: none; font: inherit; font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.tabbar button .ico { width: 22px; height: 22px; display: block; }
.tabbar button .ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--primary-hi); font-weight: 600; }

.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel { width: 100%; max-width: 640px; background: var(--card); border: 1px solid var(--line); border-bottom: none; border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 85vh; overflow: auto; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 40; max-width: calc(100% - 32px); width: max-content; background: rgba(30,30,40,.96); color: var(--text); border: 1px solid var(--line-strong);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; white-space: pre-wrap; word-break: break-all; }
.toast.error { background: rgba(120,30,40,.96); border-color: rgba(255,107,107,.4); }
.toast.ok { background: rgba(20,80,55,.96); border-color: rgba(61,220,151,.4); }

@media (min-width: 720px) {
  main { padding-top: 20px; }
  .btn-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------- 网站公开版新增 ---------------- */
.topbar-right { display: flex; align-items: center; gap: 8px; }
a.badge { text-decoration: none; }
a { color: var(--primary-hi); }
.btn { text-decoration: none; }
.announce { margin: 12px auto 0; max-width: 640px; padding: 10px 16px; background: var(--primary-weak);
  color: var(--primary); font-size: 13px; border-radius: var(--radius); white-space: pre-wrap; }
.balance-row { display: flex; gap: 24px; margin: 4px 0 8px; }
.big-num { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.danger-text { color: var(--danger); }
.auth-card { margin-top: 24px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; }
.auth-links a { color: var(--primary-hi); text-decoration: none; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.pkg { border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; background: #101017; }
.pkg.on { border-color: var(--primary); background: var(--primary-weak); }
.pkg .price { font-size: 20px; font-weight: 600; color: var(--text); }
.pkg .sec { font-size: 13px; color: var(--muted); }
.pkg .note { font-size: 12px; color: var(--warn); margin-top: 4px; }
.qr { display: block; max-width: 240px; width: 100%; margin: 12px auto; border-radius: 12px; border: 6px solid #fff; background: #fff; }
.legal h1 { font-size: 20px; margin: 0 0 12px; }
.legal-body { font-size: 14px; line-height: 1.8; word-break: break-word; }
.legal-body h2 { font-size: 17px; margin: 20px 0 8px; }
.legal-body h3, .legal-body h4 { font-size: 15px; margin: 16px 0 6px; }
.legal-body ul, .legal-body ol { padding-left: 20px; }
.legal-body blockquote { margin: 8px 0; padding: 8px 12px; background: var(--bg); border-left: 3px solid var(--line); color: var(--muted); }
.legal-body code { background: var(--bg); padding: 0 4px; border-radius: 4px; }
.table-wrap { overflow-x: auto; margin: 8px 0; }
.legal-body table { border-collapse: collapse; width: 100%; font-size: 13px; }
.legal-body th, .legal-body td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.legal-body th { background: var(--bg); }
.site-footer { text-align: center; font-size: 12px; color: var(--muted); padding: 16px 8px 8px; line-height: 1.9; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
.footer-links a, .site-footer a { color: var(--muted); }
.ledger-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.ledger-row .plus { color: var(--ok); font-weight: 600; }
.ledger-row .minus { color: var(--danger); font-weight: 600; }
.queue-box { background: var(--primary-weak); color: var(--primary); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.del-btn { margin-left: auto; }
body.auth-mode .tabbar { display: none; }
body.auth-mode { padding-bottom: 16px; }
.captcha { width: 140px; height: 48px; flex: none; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }

/* ---------------- 文案库卡片、配图、背景音乐、调色预览、发布衔接 ---------------- */
.seg-small button { min-height: 32px; font-size: 13px; }
.hot-card .item-title { font-weight: 600; margin-top: 6px; word-break: break-all; }
.hot-card .meta-line { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.clamp5 { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
details.struct { margin-top: 8px; font-size: 13px; background: #101017; border-radius: 8px; padding: 6px 10px; }
details.struct summary { cursor: pointer; color: var(--primary-hi); }
details.struct dl { margin: 6px 0 0; display: grid; grid-template-columns: 5em 1fr; gap: 4px 8px; }
details.struct dt { color: var(--muted); }
details.struct dd { margin: 0; word-break: break-all; }
.look-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.look { border: 2px solid transparent; border-radius: 12px; padding: 3px; background: #101017; cursor: pointer; text-align: center; font-size: 12px; color: var(--muted); }
.look.on { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.look img, .look .ph { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; display: block; background: #1F1F29; }
.pip-item { display: flex; gap: 10px; align-items: flex-start; }
.pip-item .pthumb { width: 72px; flex: none; aspect-ratio: 9/16; border-radius: 8px; background: #1F1F29; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); text-align: center; }
.pip-item .pbody { flex: 1; min-width: 0; }
.pip-item .ptime { font-size: 12px; color: var(--primary-hi); font-weight: 600; }
.pip-item .psent { font-size: 14px; word-break: break-all; }
.pip-item .pdesc { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.pip-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pip-actions .btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
.asset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 50vh; overflow: auto; }
.asset-grid img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; cursor: pointer; background: #1F1F29; }
.rec-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rec-row:last-child { border-bottom: none; }
.publish-tip { font-size: 13px; color: var(--muted); }

/* ---------------- ClipMuse 首屏（大字报辅助风格）与 Bento 工具格 ---------------- */
body::before { content: ""; position: fixed; inset: -20% -10% auto; height: 60vh; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 0%, rgba(139,124,255,.18), transparent 70%); }
.hero { padding: 20px 4px 8px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary-hi);
  border: 1px solid rgba(139,124,255,.35); background: var(--primary-weak); border-radius: 999px; padding: 3px 10px; }
.hero-title { font-size: clamp(34px, 10vw, 52px); line-height: 1.08; font-weight: 800; letter-spacing: -1.5px; margin: 14px 0 10px; }
.hero-title em { font-style: normal; background: linear-gradient(90deg, var(--primary-hi), #C9BFFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.hero-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.hero-step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.hero-step b { display: block; font-size: 22px; font-weight: 800; color: var(--primary-hi); line-height: 1; }
.hero-step span { font-size: 12px; color: var(--muted); }
.hero-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-bottom: 12px; }
.hero-cta .btn { margin: 0; min-height: 50px; }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 14px; }
.bento a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 12px; transition: border-color .15s, transform .1s; }
.bento a:hover { border-color: var(--line-strong); }
.bento a:active { transform: scale(.97); }
.bento svg { width: 22px; height: 22px; stroke: var(--primary-hi); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-label { font-size: 12px; color: var(--muted); margin: 6px 4px 8px; letter-spacing: .5px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
