/* TikTok 视频工作台 —— 清新浅色主题 */
:root {
  --bg: #f4f9f8;
  --bg-2: #eef6f5;
  --surface: #ffffff;
  --line: #e2ece9;
  --line-2: #d3e3df;
  --text: #1c2b29;
  --text-2: #4f625e;
  --muted: #8a9c98;
  --primary: #0fae9b;
  --primary-ink: #0b8a7b;
  --primary-soft: #e3f6f2;
  --sky: #3d9df5;
  --sky-soft: #e8f3fe;
  --grad: linear-gradient(115deg, #13c2a6 0%, #3d9df5 100%);
  --grad-soft: linear-gradient(115deg, #e6f8f4 0%, #e9f3fe 100%);
  --ok: #18a058; --ok-soft: #e6f6ec;
  --run: #3d8bf5; --run-soft: #e8f1fe;
  --wait: #e0901a; --wait-soft: #fdf3e2;
  --plan: #8b6cf0; --plan-soft: #f1edfe;
  --bad: #e5484d; --bad-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 60, 55, .04), 0 8px 24px rgba(20, 60, 55, .06);
  --shadow-lg: 0 12px 40px rgba(20, 60, 55, .14);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-ink); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 84px; flex: none; background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: #fff; margin-bottom: 18px; box-shadow: 0 6px 16px rgba(19,194,166,.35); }
.logo svg.i { width: 22px; height: 22px; }
.nav { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 10px; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-radius: 12px;
  color: var(--text-2); font-size: 12px; transition: background .15s, color .15s;
}
.nav a svg.i { width: 20px; height: 20px; }
.nav a:hover { background: var(--bg-2); color: var(--text); }
.nav a.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.side-foot a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); color: var(--text-2); font-size: 11px; font-weight: 700; background: #fff; }
.side-foot a:hover { color: var(--primary-ink); border-color: var(--primary); }

.main { flex: 1; min-width: 0; }
.view { max-width: 1120px; margin: 0 auto; padding: 32px 32px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- 通用组件 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { border-color: var(--primary); color: var(--primary-ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(19,194,166,.32); font-weight: 600; }
.btn.primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(19,194,166,.42); }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.icon-btn { width: 32px; height: 32px; padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--primary); }
.chip.on, .chip[aria-expanded="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.chip .caret { width: 14px; height: 14px; color: var(--muted); }
.chip .flag { font-size: 16px; line-height: 1; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-2); font-size: 13px; }
.tab:hover { background: #fff; border-color: var(--line); }
.tab.on { background: #fff; border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.tab .n { margin-left: 4px; color: var(--muted); font-weight: 400; font-size: 12px; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,174,155,.14); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.switch { position: relative; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d5e0dd; border-radius: 999px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-succeeded { background: var(--ok-soft); color: var(--ok); }
.st-running, .st-submitting { background: var(--run-soft); color: var(--run); }
.st-running::before, .st-submitting::before { animation: blink 1.2s infinite; }
.st-queued { background: var(--wait-soft); color: var(--wait); }
.st-scheduled { background: var(--plan-soft); color: var(--plan); }
.st-failed { background: var(--bad-soft); color: var(--bad); }
.st-cancelled { background: #eef1f0; color: var(--muted); }
@keyframes blink { 50% { opacity: .25; } }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--bg-2); color: var(--text-2); font-size: 12px; white-space: nowrap; }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty svg.i { width: 36px; height: 36px; color: var(--line-2); margin-bottom: 8px; }

/* ---------- 创作页 ---------- */
.hero-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--grad-soft); color: var(--primary-ink); font-size: 13px; font-weight: 600; }
.hero h1 { font-size: 38px; line-height: 1.2; margin: 14px 0 22px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.market-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px dashed var(--line); background: linear-gradient(180deg, #fbfefd, #fff); border-radius: var(--radius) var(--radius) 0 0; }
.market-bar .lbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.loc-toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--text-2); }
.loc-toggle svg.i { color: var(--primary); }

.composer { position: relative; }
.composer textarea.prompt { width: 100%; border: 0; outline: none; resize: none; min-height: 132px; padding: 16px 18px 8px; font-size: 15px; line-height: 1.7; background: transparent; }
.composer textarea.prompt::placeholder { color: #a9b8b4; }
.counter { position: absolute; right: 18px; top: 8px; font-size: 12px; color: var(--muted); }
.refs { padding: 4px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.ref-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ref-group > .glabel { font-size: 12px; color: var(--muted); width: 100%; }
.slot {
  width: 84px; height: 84px; border-radius: 12px; border: 1.5px dashed var(--line-2); background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  color: var(--muted); font-size: 12px; position: relative; overflow: hidden; transition: border-color .15s, color .15s;
}
.slot:hover { border-color: var(--primary); color: var(--primary-ink); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; z-index: 2; padding: 0; }
.slot .x svg.i { width: 12px; height: 12px; }
.slot .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; text-align: center; z-index: 1; }
.url-item { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: 8px; background: var(--bg-2); font-size: 12px; max-width: 320px; }
.url-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-item button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px; display: grid; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.composer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 16px 16px; flex-wrap: wrap; }
.est { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.5; }
.est b { color: var(--text); font-weight: 600; }

.loc-panel { margin-top: 16px; padding: 18px; border-radius: var(--radius); background: var(--grad-soft); border: 1px solid #d7eee9; }
.loc-panel h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.loc-panel .grid2 { gap: 12px; }
.loc-box { background: rgba(255,255,255,.85); border-radius: 12px; padding: 10px 12px; border: 1px solid #e0efeb; }
.loc-box .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.loc-box .v { white-space: pre-wrap; word-break: break-word; }
.loc-box textarea { border: 0; padding: 0; min-height: 96px; background: transparent; box-shadow: none !important; }
.hashtags { display: flex; flex-wrap: wrap; gap: 6px; }
.hashtags span { color: var(--sky); background: var(--sky-soft); border-radius: 6px; padding: 1px 7px; font-size: 12.5px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 14px; gap: 12px; flex-wrap: wrap; }
.section-title h2 { font-size: 19px; margin: 0; }
.section-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.banners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.banner { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; display: flex; gap: 12px; align-items: flex-start; }
.banner .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.banner b { display: block; margin-bottom: 2px; }
.banner span { font-size: 12.5px; color: var(--muted); }

/* 弹出层 */
.pop {
  position: fixed; z-index: 100; min-width: 220px; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 70vh; overflow: auto;
  animation: popin .12s ease-out;
}
@keyframes popin { from { opacity: 0; transform: translateY(-4px); } }
.pop .opt { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.pop .opt:hover { background: var(--bg); }
.pop .opt.on { background: var(--primary-soft); }
.pop .opt b { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pop .opt small { color: var(--muted); font-size: 12px; }
.pop .group { font-size: 11.5px; color: var(--muted); padding: 8px 12px 4px; font-weight: 600; letter-spacing: .02em; }
.pop .pad { padding: 8px 10px; }
.pop .foot { border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 10px 4px; display: flex; justify-content: space-between; font-size: 12.5px; }
.seg { display: grid; gap: 6px; }
.seg button { height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 12.5px; }
.seg button:hover { border-color: var(--primary); }
.seg button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.ratio-btn { height: 58px !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ratio-btn i { display: block; border: 1.6px solid currentColor; border-radius: 3px; }
input[type=range] { width: 100%; accent-color: var(--primary); }
.pop .sub { font-size: 12px; color: var(--muted); margin: 10px 0 6px; }

/* ---------- 任务 / 资产 卡片 ---------- */
.task-grid, .asset-grid, .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.vcard { overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.vcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.thumb { position: relative; aspect-ratio: 9/12; background: var(--grad-soft); display: grid; place-items: center; overflow: hidden; }
.thumb video, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { color: var(--primary); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; }
.thumb .ph svg.i { width: 28px; height: 28px; }
.thumb .ph.bad { color: var(--bad); }
.thumb .tl { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.thumb .tr { position: absolute; right: 10px; top: 10px; }
.thumb .glass { background: rgba(255,255,255,.88); backdrop-filter: blur(4px); }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(15,174,155,.18); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.vbody .p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; min-height: 40px; }
.vbody .meta { display: flex; gap: 6px; flex-wrap: wrap; }

.list { display: flex; flex-direction: column; gap: 10px; }
.trow { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 12px; align-items: center; }
.trow .mini { width: 72px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--grad-soft); display: grid; place-items: center; color: var(--primary); cursor: pointer; }
.trow .mini video { width: 100%; height: 100%; object-fit: cover; }
.trow .mid { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.trow .mid .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; cursor: pointer; }
.trow .mid .err { color: var(--bad); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .acts { display: flex; gap: 6px; align-items: center; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters .select, .filters .input { width: auto; min-width: 140px; height: 34px; }
.search { position: relative; }
.search svg.i { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search .input { padding-left: 32px; width: 220px; }

/* 抽屉 */
.mask { position: fixed; inset: 0; background: rgba(28, 43, 41, .28); z-index: 90; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--bg); z-index: 95; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-body { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.detail-top { display: grid; grid-template-columns: 240px 1fr; gap: 16px; }
.detail-top .player { border-radius: 14px; overflow: hidden; background: #0d1b19; aspect-ratio: 9/16; display: grid; place-items: center; color: #9fb; }
.detail-top .player video { width: 100%; height: 100%; object-fit: contain; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px 10px; font-size: 13px; align-content: start; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.block { padding: 14px 16px; }
.block h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; }
.block .v { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }

/* 模板 */
.tpl-card { overflow: hidden; display: flex; flex-direction: column; }
.tpl-cover { aspect-ratio: 16/10; background: var(--grad-soft); position: relative; display: flex; align-items: flex-end; padding: 14px; }
.tpl-cover .big { position: absolute; right: 12px; top: 10px; font-size: 40px; opacity: .9; }
.tpl-cover b { font-size: 15px; position: relative; }
.tpl-card .vbody .row { justify-content: space-between; }

/* 设置 */
.set-nav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.set-sec { padding: 20px 22px; margin-bottom: 16px; }
.set-sec > h3 { margin: 0 0 4px; font-size: 16px; }
.set-sec > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.prov { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.prov + .prov { margin-top: 10px; }
.prov .av { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; }
.prov .nm { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prov .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detect { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-size: 13px; }
.detect.warn { background: var(--wait-soft); color: #9a6410; }
.code { background: #f2f7f6; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow: auto; white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #2d4844; }
.skill-item, .site-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.skill-item + .skill-item, .site-item + .site-item { margin-top: 8px; }
.skill-item .c { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 弹窗 */
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 96; width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: popin .15s; }
.modal h3 { margin: 0 0 16px; font-size: 17px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
details.adv summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
details.adv[open] summary { margin-bottom: 10px; }

/* 提示 */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 10px 16px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-size: 13.5px; display: flex; gap: 8px; align-items: center; max-width: 560px; animation: popin .15s; }
.toast.ok svg.i { color: var(--ok); }
.toast.err { border-color: #f6cfd0; }
.toast.err svg.i { color: var(--bad); }

@media (max-width: 860px) {
  .banners { grid-template-columns: 1fr; }
  .detail-top { grid-template-columns: 1fr; }
  .detail-top .player { max-width: 280px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; flex-direction: row; position: sticky; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo { margin: 0 8px 0 0; width: 34px; height: 34px; }
  .nav { flex-direction: row; padding: 0; overflow-x: auto; }
  .nav a { padding: 6px 10px; }
  .side-foot { display: none; }
  .view { padding: 20px 16px 60px; }
  .hero h1 { font-size: 28px; }
  .trow { grid-template-columns: 56px 1fr; }
  .trow .mini { width: 56px; height: 74px; }
  .trow .acts { grid-column: 1 / -1; }
  .search .input { width: 100%; }
}

/* ---------- 登录 ---------- */
body.authing .app { display: none; }
#authBox:empty { display: none; }
#authBox { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 0%, #dff6f1 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #e3f0fe 0%, transparent 60%), var(--bg); }
.auth-card { width: min(380px, 100%); padding: 32px 28px; text-align: center; }
.auth-card h2 { margin: 0 0 4px; font-size: 20px; }
.auth-card p { margin: 0 0 20px; font-size: 13px; }
.auth-card .stack { text-align: left; }
.me-btn { background: var(--grad) !important; color: #fff !important; border: 0 !important; font-size: 15px !important; }

/* ---------- 脚本推理 ---------- */
.view:has(.sc-layout) { max-width: 1320px; }
.sc-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.sc-form { padding: 18px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.sc-h { font-size: 14px; margin: 6px 0 0; display: flex; align-items: center; gap: 6px; color: var(--text); }
.sc-h svg.i { color: var(--primary); }
.sc-form .sc-h:first-child { margin-top: 0; }
#scResult { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sc-sec { padding: 16px 18px; }
.sc-sec > .sc-h { margin: 0 0 12px; }
.sc-empty { padding: 90px 24px; }
.sc-empty .small { margin-top: 6px; line-height: 1.8; }
.sc-title { font-size: 18px; font-weight: 700; height: 42px; border-color: transparent; padding-left: 4px; flex: 1; }
.sc-title:hover { border-color: var(--line-2); }
.ce { outline: none; border-bottom: 1px dashed var(--line-2); }
.shots { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.shot { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; }
.shot-n { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shot-n b { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 14px; }
.shot-n span { font-size: 11.5px; color: var(--muted); text-align: center; }
.shot-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.shot-grid .textarea { min-height: 64px; }
.shot-grid .field > label, .sc-sec .field > label { font-size: 12px; color: var(--muted); }
.sc-thumb { width: 76px; height: 96px; border-radius: 10px; overflow: hidden; position: relative; cursor: pointer; border: 2px solid transparent; background: var(--bg-2); flex: none; }
.sc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-thumb .ck { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.9); border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; }
.sc-thumb .ck svg.i { width: 12px; height: 12px; stroke-width: 3; }
.sc-thumb.on { border-color: var(--primary); }
.sc-thumb.on .ck { background: var(--primary); border-color: var(--primary); color: #fff; }
.sc-thumb .src { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.5); color: #fff; }
.sc-bar { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
@media (max-width: 1000px) {
  .sc-layout { grid-template-columns: 1fr; }
  .sc-form { position: static; max-height: none; }
}
@media (max-width: 640px) { .shot-grid { grid-template-columns: 1fr; } .shot { grid-template-columns: 1fr; } .shot-n { flex-direction: row; } }
