/* Lumark 内容生产工作台 · 共享样式
 * 覆盖：工作台 / 基于方案生成 / 生成结果 / 历史 / 模板中心 / 素材库 / 二次编辑
 * 浅色令牌 + 三栏布局 + 内容卡 + 真机预览（抖音深色 / 小红书白底）
 */

:root {
  --bg: #f4f6fb;
  --card: #fff;
  --border: #e5e9f2;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
  --soft: #eef2ff;
  --radius-card: 14px;
  --radius-ctl: 8px;
  --shadow: 0 18px 40px -30px rgba(30, 41, 59, 0.5);
  --font: "Sora", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body.studio-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ 布局 */

.studio-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 18px auto 48px;
}

.studio-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 6px 2px 12px;
}

.studio-page-head h1 {
  margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
}

.studio-page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.studio-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 三栏 / 两栏 / 单栏 */
.studio-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.studio-layout--two { grid-template-columns: minmax(0, 1fr) 340px; }
.studio-layout--wide { grid-template-columns: minmax(0, 1fr); }

.studio-rail { display: grid; gap: 14px; align-content: start; }

.studio-rail--sticky { position: sticky; top: 16px; }

/* 卡片 */
.studio-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 16px; box-shadow: var(--shadow);
}

.studio-card--flush { padding: 0; overflow: hidden; }
.studio-card--canvas { min-height: 460px; display: flex; flex-direction: column; }

.studio-card__title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 12px; font-size: 14px; font-weight: 800;
}

.studio-card__title small { color: var(--muted); font-weight: 500; font-size: 12px; }

.studio-section { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.studio-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

.studio-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: #334155;
}

.studio-label small { color: var(--muted); font-weight: 500; }

.studio-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

/* ------------------------------------------------------------------ 控件 */

.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 16px; border: 1px solid transparent;
  border-radius: var(--radius-ctl); background: #fff; color: var(--text);
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.btn--primary {
  color: #fff; background: var(--accent);
  box-shadow: 0 10px 24px -16px rgba(79, 70, 229, 0.95);
}

.btn--primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }

.btn--ghost { color: var(--accent); background: #fff; border-color: #c7d2fe; }
.btn--ghost:hover:not(:disabled) { background: var(--soft); }

.btn--subtle { color: var(--muted); background: #f8fafc; border-color: var(--border); }
.btn--subtle:hover:not(:disabled) { color: var(--text); background: #eef2f7; }

.btn--danger { color: var(--danger); background: #fff; border-color: #fecaca; }
.btn--danger:hover:not(:disabled) { background: #fef2f2; }

.btn--sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn--block { width: 100%; }

.btn__spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff;
  animation: studio-spin 0.7s linear infinite;
}

.btn--ghost .btn__spinner, .btn--subtle .btn__spinner {
  border-color: rgba(79, 70, 229, 0.25); border-top-color: var(--accent);
}

.field { display: grid; gap: 6px; }

.field > span { font-size: 12.5px; font-weight: 700; color: #334155; }

.input, .textarea, .select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-ctl); background: #fff; color: var(--text);
  font-size: 13px; line-height: 1.5; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.textarea { resize: vertical; min-height: 88px; }

.input:focus, .textarea:focus, .select:focus {
  border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.input::placeholder, .textarea::placeholder { color: #94a3b8; }

/* 分段选择 */
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }

.segmented button {
  flex: 1; appearance: none; border: 0; background: transparent; padding: 8px 10px;
  border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.segmented button[aria-pressed="true"] {
  color: var(--accent); background: #fff;
  box-shadow: 0 4px 12px -8px rgba(30, 41, 59, 0.6), inset 0 0 0 1px #e0e7ff;
}

/* 单选卡 */
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }

.choice {
  appearance: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.choice:hover { color: var(--text); border-color: #cbd5e1; }

.choice[aria-pressed="true"] {
  color: var(--accent); background: var(--soft); border-color: #c7d2fe; font-weight: 700;
}

/* 数量 / 时长 */
.stepper { display: flex; align-items: center; gap: 6px; }

.stepper button {
  width: 32px; height: 32px; appearance: none; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--muted); font-size: 16px;
  font-weight: 700; line-height: 1; cursor: pointer;
}

.stepper button:hover:not(:disabled) { color: var(--accent); border-color: #c7d2fe; background: var(--soft); }
.stepper button:disabled { opacity: 0.45; cursor: not-allowed; }

.stepper output {
  min-width: 44px; text-align: center; font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 14px; font-weight: 700;
}

.range-row { display: flex; align-items: center; gap: 12px; }

.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }

.range-row input[type="number"] { width: 74px; text-align: center; }

/* pill / chip / badge */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; background: #eef2f7; color: var(--muted);
  font-size: 11.5px; font-weight: 700; line-height: 1.6; white-space: nowrap;
}

.pill--accent { background: var(--soft); color: var(--accent); }
.pill--success { background: #ecfdf5; color: var(--success); }
.pill--warn { background: #fffbeb; color: var(--warn); }
.pill--danger { background: #fef2f2; color: var(--danger); }

.pill--running { background: var(--soft); color: var(--accent); }

.pill--running::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; animation: studio-pulse 1.2s ease-in-out infinite;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.01em;
}

.badge--douyin { background: #111827; color: #fff; }
.badge--xiaohongshu { background: #fee2e2; color: #b91c1c; }
.badge--general { background: #eef2f7; color: #475569; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 999px; background: #f1f5f9; color: #475569;
  font-size: 11.5px; font-weight: 600; line-height: 1.7;
}

.chip--accent { background: var(--soft); color: var(--accent); }

.chip-list { display: flex; gap: 6px; flex-wrap: wrap; }

/* 进度条 */
.progress-track {
  position: relative; height: 8px; border-radius: 999px;
  background: #eef2f7; overflow: hidden;
}

.progress-bar {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transition: width 0.35s ease;
}

.progress-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------------ 模板卡 / 上传 */

.template-list { display: grid; gap: 8px; max-height: 340px; overflow: auto; padding-right: 2px; }

.template-card {
  position: relative; width: 100%; text-align: left; appearance: none; cursor: pointer;
  display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.template-card:hover { border-color: #cbd5e1; background: #fbfcff; }

.template-card[aria-pressed="true"] {
  border-color: #a5b4fc; background: var(--soft);
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

.template-card strong { font-size: 13px; font-weight: 700; }
.template-card span { color: var(--muted); font-size: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.template-card__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

.uploader {
  display: grid; gap: 8px; padding: 12px; border: 1px dashed #cbd5e1;
  border-radius: 10px; background: #f8fafc; text-align: center;
  transition: border-color 0.18s, background 0.18s;
}

.uploader:hover, .uploader.is-drag { border-color: #a5b4fc; background: var(--soft); }

.uploader input[type="file"] { display: none; }

.uploader__icon {
  width: 30px; height: 30px; margin: 0 auto; border-radius: 9px;
  display: grid; place-items: center; background: #fff; color: var(--accent);
  border: 1px solid #e0e7ff; font-size: 16px; font-weight: 800;
}

.uploader__text { font-size: 12.5px; font-weight: 600; }
.uploader__hint { font-size: 11.5px; color: var(--muted); }

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.upload-thumb {
  position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--border); background: #eef2f7;
}

.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.upload-thumb button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  appearance: none; border: 0; border-radius: 50%; background: rgba(15, 23, 42, 0.72);
  color: #fff; font-size: 12px; line-height: 1; cursor: pointer;
}

/* ------------------------------------------------------------------ 画布 / 参数摘要 */

.canvas-empty {
  flex: 1; display: grid; place-items: center; gap: 10px; text-align: center;
  color: var(--muted); padding: 40px 20px;
}

.canvas-empty__mark {
  width: 54px; height: 54px; border-radius: 16px;
  background: conic-gradient(from 140deg, #22d3ee, #8b5cf6, #f472b6, #22d3ee);
  opacity: 0.85;
}

.canvas-summary { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 16px 0; }
.canvas-body { flex: 1; padding: 14px 16px; }

.prompt-box { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: #fcfdff; }

.prompt-box .textarea { min-height: 74px; border: 0; background: transparent; padding: 0; }
.prompt-box .textarea:focus { box-shadow: none; }

.prompt-box__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }

.prompt-box__keys { color: var(--muted); font-size: 11.5px; }
.prompt-box__keys kbd {
  padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; background: #fff; font-family: "JetBrains Mono", Consolas, monospace; font-size: 10.5px;
}

/* ------------------------------------------------------------------ 结果页 */

.result-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 14px;
}

.result-head__main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.result-head h1 { margin: 0; font-size: 20px; font-weight: 800; }

.result-progress { width: min(320px, 100%); }

.result-grid { display: grid; gap: 20px; }

.group-section { display: grid; gap: 12px; }

.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.group-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }

.group-head small { color: var(--muted); font-weight: 500; font-size: 12px; }

.item-cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.item-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
}

.item-card__media { position: relative; background: #eef2f7; }

.item-card__body { display: grid; gap: 8px; padding: 12px 14px 14px; }

.item-card__title { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.45; }

.item-card__text {
  margin: 0; color: #475569; font-size: 13px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.item-card__text.is-expanded { display: block; -webkit-line-clamp: unset; }

.item-card__text.is-expandable { cursor: pointer; }

.item-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; padding-top: 4px;
}

.item-card__foot-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-card__foot-right { display: flex; align-items: center; gap: 6px; }

.item-card__error {
  padding: 8px 10px; border-radius: 8px; background: #fef2f2;
  color: #b91c1c; font-size: 12px;
}

/* 图文图片区 */
.media-frame { position: relative; overflow: hidden; background: #eef2f7; }

.media-frame--4x3 { aspect-ratio: 3 / 4; }
.media-frame--16x9 { aspect-ratio: 9 / 16; }
.media-frame--square { aspect-ratio: 1; }

.media-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity 0.4s ease;
}

.media-frame img.is-loaded { opacity: 1; }

/* 图文轮播（结果卡片） */
.carousel { position: relative; background: #eef2f7; }

.carousel__viewport { position: relative; overflow: hidden; aspect-ratio: 3 / 4; }

.carousel--16x9 .carousel__viewport { aspect-ratio: 9 / 16; }

.carousel__track {
  display: flex; height: 100%; width: 100%;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform;
}

.carousel__slide { position: relative; flex: 0 0 100%; height: 100%; background: #f1f5f9; }

.carousel__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.carousel__state {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center;
  gap: 8px; padding: 12px; text-align: center;
  color: var(--muted); font-size: 12px; background: rgba(248, 250, 252, 0.92);
}

.carousel__state strong { font-size: 12.5px; font-weight: 700; }

.carousel__state--error { color: var(--danger); }

.carousel__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; padding: 0 0 2px;
  background: rgba(15, 23, 42, 0.45); color: #fff; font-size: 17px; line-height: 1;
  opacity: 0; transition: opacity 0.18s ease, background 0.18s ease;
}

.carousel:hover .carousel__nav,
.carousel:focus-within .carousel__nav { opacity: 1; }

.carousel__nav:hover { background: rgba(15, 23, 42, 0.7); }

.carousel__nav--prev { left: 8px; }
.carousel__nav--next { right: 8px; }

.carousel__count {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  padding: 1px 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.55);
  color: #fff; font-size: 10px; font-family: "JetBrains Mono", Consolas, monospace;
}

.carousel__dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}

.carousel__dot {
  width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
  transition: width 0.2s ease, background 0.2s ease;
}

.carousel__dot.is-active { width: 16px; border-radius: 3px; background: #fff; }

/* 卡片内生成过程 */
.gen-live {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px; border: 1px dashed rgba(79, 70, 229, 0.3);
  border-radius: 10px; background: #f5f7ff;
}

.gen-live[hidden] { display: none; }

.gen-live .spinner { flex: 0 0 auto; margin-top: 1px; }

.gen-live__body { display: grid; gap: 3px; min-width: 0; }

.gen-live__stage { font-size: 12.5px; font-weight: 700; color: #4338ca; }

.gen-live__log { display: grid; gap: 2px; }

.gen-live__line {
  color: #64748b; font-size: 11.5px; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.gen-live__line:last-child { color: #475569; }

/* 骨架 / 加载圈 */
.skeleton {
  position: relative; overflow: hidden; background: #eef2f7;
}

.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: translateX(-100%); animation: studio-shimmer 1.4s infinite;
}

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(79, 70, 229, 0.18); border-top-color: var(--accent);
  animation: studio-spin 0.8s linear infinite;
}

.spinner--dark { border-color: rgba(255, 255, 255, 0.22); border-top-color: #fff; }

.spinner--sm { width: 14px; height: 14px; border-width: 2px; }

.loading-state {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px;
  align-content: center; color: var(--muted); font-size: 12px; text-align: center;
  background: rgba(248, 250, 252, 0.92);
}

.loading-state--dark { background: rgba(15, 23, 42, 0.9); color: #cbd5e1; }

.loading-state strong { font-size: 12.5px; font-weight: 700; }

/* 打字机 */
.typewriter-caret::after {
  content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px;
  background: var(--accent); vertical-align: -0.12em; animation: studio-caret 0.9s steps(1) infinite;
}

.typewriter-caret--dark::after { background: #e2e8f0; }

@keyframes studio-caret { 50% { opacity: 0; } }

/* 标签淡入 */
.chip--enter { animation: studio-chip-in 0.28s ease both; }

@keyframes studio-chip-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 视频卡 */
.video-wrap {
  position: relative; aspect-ratio: 9 / 16; background: #0f172a; overflow: hidden;
}

.video-wrap--wide { aspect-ratio: 16 / 9; }

.video-wrap video {
  width: 100%; height: 100%; object-fit: cover; display: block; background: #0f172a;
}

.video-wrap__poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

.video-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 10px;
  align-content: center; text-align: center; padding: 18px; color: #cbd5e1;
  background: radial-gradient(circle at 50% 30%, #1e293b, #0f172a 70%);
}

.video-placeholder strong { font-size: 13px; font-weight: 700; color: #e2e8f0; }
.video-placeholder span { font-size: 12px; color: #94a3b8; }

.shot-strip { display: flex; gap: 5px; margin-top: 4px; }

.shot-strip span {
  width: 34px; height: 44px; border-radius: 5px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.08);
  display: grid; place-items: center; font-size: 9px; color: #94a3b8;
}

.shot-strip img { width: 100%; height: 100%; object-fit: cover; }

.video-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 8px; padding: 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.15) 45%, rgba(15, 23, 42, 0.88) 100%);
  color: #e2e8f0; opacity: 0; transition: opacity 0.2s ease;
}

.item-card:hover .video-overlay,
.item-card:focus-within .video-overlay,
.video-overlay.is-open { opacity: 1; }

.video-overlay__top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; }

.video-overlay__play {
  position: absolute; inset: 0; margin: auto; width: 48px; height: 48px;
  appearance: none; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: #0f172a;
  font-size: 16px; box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.8);
  transition: transform 0.18s, background 0.18s;
}

.video-overlay__play:hover { transform: scale(1.06); background: #fff; }

.video-overlay__copy { display: grid; gap: 5px; position: relative; z-index: 1; }

.video-overlay__copy h3 { margin: 0; font-size: 14px; font-weight: 800; color: #fff; line-height: 1.45; }

.video-overlay__copy p {
  margin: 0; color: #cbd5e1; font-size: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.video-overlay__tags { display: flex; gap: 5px; flex-wrap: wrap; }

.video-overlay__tags .chip { background: rgba(255, 255, 255, 0.14); color: #e2e8f0; }

.video-overlay__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }

.video-overlay__foot .badge { background: rgba(255, 255, 255, 0.16); color: #fff; }

.video-overlay .btn--preview {
  color: #0f172a; background: #fff; border-color: transparent; padding: 5px 11px; font-size: 11.5px;
}

.video-progress {
  display: flex; align-items: center; gap: 8px;
  font-family: "JetBrains Mono", Consolas, monospace; font-size: 10.5px; color: #cbd5e1;
}

.video-progress input[type="range"] {
  flex: 1; height: 3px; accent-color: #fff; cursor: pointer;
}

.video-unmute {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.5); color: #fff; font-size: 10.5px; cursor: pointer;
}

.video-error {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px;
  align-content: center; padding: 18px; text-align: center;
  background: #0f172a; color: #cbd5e1; font-size: 12px;
}

/* 生成中卡片 */
.item-card--loading .item-card__body { opacity: 0.92; }

.copy-line { height: 12px; border-radius: 6px; }

/* 事件面板 */
.timeline { border: 1px solid var(--border); border-radius: var(--radius-card); background: #fff; overflow: hidden; }

.timeline > summary {
  cursor: pointer; padding: 12px 16px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  list-style: none;
}

.timeline > summary::-webkit-details-marker { display: none; }

.timeline > summary small { color: var(--muted); font-weight: 500; }

.timeline__body { max-height: 240px; overflow: auto; padding: 0 16px 14px; }

.timeline__row {
  display: grid; grid-template-columns: 68px 1fr; gap: 10px;
  padding: 5px 0; border-top: 1px dashed #eef2f7; font-size: 12px; color: #475569;
}

.timeline__row time { color: #94a3b8; font-family: "JetBrains Mono", Consolas, monospace; font-size: 11px; }

.timeline__row.is-error { color: var(--danger); }
.timeline__row.is-warn { color: var(--warn); }

/* 简单列表（历史） */
.history-list { display: grid; gap: 10px; }

.history-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px;
  align-items: center; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: #fff; transition: border-color 0.18s, box-shadow 0.18s;
}

.history-row:hover { border-color: #c7d2fe; box-shadow: var(--shadow); }

.history-row__cover {
  width: 56px; height: 74px; border-radius: 8px; overflow: hidden;
  background: #eef2f7; display: grid; place-items: center; color: #94a3b8; font-size: 10px;
}

.history-row__cover img { width: 100%; height: 100%; object-fit: cover; }

.history-row__main { display: grid; gap: 4px; min-width: 0; }

.history-row__title {
  font-size: 14px; font-weight: 800; color: inherit; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.history-row__meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 11.5px; }

.history-row__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* 筛选条 */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; margin-bottom: 14px;
}

.filter-bar .input, .filter-bar .select { width: auto; min-width: 128px; }
.filter-bar .input--grow { flex: 1; min-width: 180px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 12.5px; }

/* 空态 */
.empty-state {
  display: grid; place-items: center; gap: 8px; padding: 44px 20px;
  text-align: center; color: var(--muted); border: 1px dashed #dbe2ee;
  border-radius: var(--radius-card); background: #fff;
}

.empty-state strong { color: var(--text); font-size: 14px; }

.empty-state p { margin: 0; font-size: 12.5px; max-width: 42ch; }

/* ------------------------------------------------------------------ 方案选择 */

.plan-list { display: grid; gap: 10px; }

.plan-card {
  appearance: none; width: 100%; text-align: left; cursor: pointer;
  display: grid; gap: 6px; padding: 13px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: #fff; transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.plan-card:hover { border-color: #cbd5e1; background: #fbfcff; }

.plan-card[aria-pressed="true"] {
  border-color: #a5b4fc; background: var(--soft); box-shadow: inset 0 0 0 1px #c7d2fe;
}

.plan-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.plan-card strong { font-size: 13.5px; font-weight: 800; }

.plan-card p {
  margin: 0; color: #475569; font-size: 12.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.plan-card__meta { display: flex; gap: 6px; flex-wrap: wrap; }

.alloc-preview {
  display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px;
  background: #f8fafc; border: 1px solid var(--border);
}

.alloc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: #475569; }

.alloc-row b { font-family: "JetBrains Mono", Consolas, monospace; color: var(--text); }

/* ------------------------------------------------------------------ 模板中心 / 素材库 */

.card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.tpl-card {
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: #fff; box-shadow: var(--shadow); transition: transform 0.18s, border-color 0.18s;
}

.tpl-card:hover { transform: translateY(-2px); border-color: #c7d2fe; }

.tpl-card__cover {
  aspect-ratio: 16 / 9; display: grid; place-items: end start; padding: 12px;
  color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -0.01em;
}

.tpl-card__cover--product { background: linear-gradient(135deg, #6366f1, #22d3ee); }
.tpl-card__cover--scene { background: linear-gradient(135deg, #f59e0b, #f472b6); }
.tpl-card__cover--review { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.tpl-card__cover--list { background: linear-gradient(135deg, #10b981, #22d3ee); }
.tpl-card__cover--hook { background: linear-gradient(135deg, #ef4444, #f97316); }
.tpl-card__cover--unbox { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.tpl-card__cover--tutorial { background: linear-gradient(135deg, #0f766e, #22d3ee); }
.tpl-card__cover--brand { background: linear-gradient(135deg, #1e293b, #4f46e5); }

.tpl-card__body { display: grid; gap: 6px; padding: 12px 14px 14px; }

.tpl-card__body h3 { margin: 0; font-size: 14px; font-weight: 800; }

.tpl-card__body p {
  margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.tpl-card__meta { display: flex; gap: 5px; flex-wrap: wrap; }

.tab-bar { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

.tab-bar button {
  appearance: none; border: 0; background: transparent; padding: 7px 12px;
  border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}

.tab-bar button[aria-pressed="true"] { color: var(--accent); background: var(--soft); font-weight: 700; }

.asset-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.asset-card {
  position: relative; overflow: hidden; cursor: pointer; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  transition: transform 0.18s, border-color 0.18s;
}

.asset-card:hover { transform: translateY(-2px); border-color: #c7d2fe; }

/* 素材库选择态（发布用） */
.asset-card.is-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }

.asset-card__pick {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.92);
  display: grid; place-items: center; cursor: pointer;
}

.asset-card__pick input { margin: 0; cursor: pointer; width: 14px; height: 14px; }

.publish-row {
  display: grid; grid-template-columns: 1fr 120px 90px;
  gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
}

.publish-row:last-child { border-bottom: 0; }

.publish-row__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.asset-card__media { position: relative; aspect-ratio: 3 / 4; background: #eef2f7; overflow: hidden; }

.asset-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.asset-card__play {
  position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.9);
  color: #0f172a; font-size: 14px;
}

.asset-card__dur {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 5px;
  background: rgba(15, 23, 42, 0.72); color: #fff; font-size: 10px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.asset-card__body { display: grid; gap: 4px; padding: 9px 10px 11px; }

.asset-card__body strong { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.asset-card__body small { color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------------ 编辑页 */

.edit-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 360px; gap: 16px; align-items: start; }

.item-picker { display: grid; gap: 6px; max-height: calc(100vh - 220px); overflow: auto; }

.item-picker button {
  appearance: none; text-align: left; cursor: pointer; display: grid; gap: 3px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; transition: border-color 0.18s, background 0.18s;
}

.item-picker button:hover { border-color: #cbd5e1; }

.item-picker button[aria-pressed="true"] {
  border-color: #a5b4fc; background: var(--soft);
}

.item-picker strong { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item-picker small { color: var(--muted); font-size: 11px; }

.picker-group-title {
  margin: 10px 0 2px; color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
}

.counter { color: var(--muted); font-size: 11px; font-family: "JetBrains Mono", Consolas, monospace; }
.counter.is-over { color: var(--danger); font-weight: 700; }

.tag-editor {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: #fff;
}

.tag-editor .chip button {
  appearance: none; border: 0; background: transparent; color: inherit;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0 0 0 2px;
}

.tag-editor input {
  flex: 1; min-width: 100px; border: 0; outline: none; background: transparent; font-size: 12.5px;
}

.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.slot-card { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #f8fafc; }

.slot-card .media-frame { border-radius: 0; }

.slot-card__bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 8px; }

.slot-card__bar span { color: var(--muted); font-size: 11px; }

.slot-card__loading {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 6px;
  align-content: center; background: rgba(248, 250, 252, 0.9); color: var(--muted); font-size: 11.5px;
}

.edit-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.inline-note {
  padding: 9px 12px; border-radius: 9px; background: #f8fafc;
  border: 1px solid var(--border); color: var(--muted); font-size: 12px;
}

.inline-note--error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

.inline-note--warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }

/* ------------------------------------------------------------------ 弹窗 / 抽屉 / Toast */

.modal {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}

.modal[hidden] { display: none; }

.modal__card {
  width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: #fff; border-radius: 16px; padding: 18px 20px 20px;
  box-shadow: 0 40px 90px -40px rgba(15, 23, 42, 0.7);
}

.modal__card--wide { width: min(760px, 100%); }

.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.modal__head h2 { margin: 0; font-size: 16px; font-weight: 800; }

.modal__close {
  appearance: none; width: 30px; height: 30px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--muted); font-size: 16px; cursor: pointer;
}

.modal__close:hover { color: var(--text); background: #f8fafc; }

.modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.modal__body { display: grid; gap: 12px; }

.confirm-text { margin: 0; color: #475569; font-size: 13.5px; line-height: 1.65; }

/* 抽屉（事件面板用） */
.drawer {
  position: fixed; z-index: 140; right: 0; top: 0; bottom: 0; width: min(420px, 100%);
  background: #fff; border-left: 1px solid var(--border); box-shadow: -30px 0 60px -40px rgba(15, 23, 42, 0.6);
  display: flex; flex-direction: column; transform: translateX(0);
}

.drawer[hidden] { display: none; }

.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }

.drawer__body { flex: 1; overflow: auto; padding: 12px 16px; }

/* Toast */
.studio-toast-host {
  position: fixed; z-index: 200; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none;
}

.toast {
  padding: 10px 14px; border-radius: 10px; background: rgba(15, 23, 42, 0.92);
  color: #f8fafc; font-size: 13px; font-weight: 600; text-align: center;
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.9);
  animation: studio-toast-in 0.22s ease both; pointer-events: auto;
}

.toast--error { background: #b91c1c; }
.toast--success { background: #15803d; }

@keyframes studio-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ 真机预览：390 × 844 */

.phone-stage { display: grid; justify-items: center; gap: 10px; }

.phone {
  --phone-w: 390px;
  --phone-h: 844px;
  width: min(var(--phone-w), calc(100vw - 72px));
  height: min(var(--phone-h), calc(100vh - 160px));
  min-height: 520px;
  position: relative; overflow: hidden; border-radius: 38px;
  border: 9px solid #0f172a; background: #000;
  box-shadow: 0 40px 90px -40px rgba(15, 23, 42, 0.8);
}

.phone__screen {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.phone__notch {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 22px; border-radius: 999px; background: #0f172a; z-index: 6;
}

.phone__status {
  position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}

.phone__meta { color: var(--muted); font-size: 12px; text-align: center; }

/* 真机图文轮播 */
.phone__carousel { position: absolute; inset: 0; overflow: hidden; }

.phone__track {
  display: flex; height: 100%; width: 100%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform;
}

.phone__slide { flex: 0 0 100%; height: 100%; }

.phone__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.phone__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 26px; height: 26px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; padding: 0 0 1px; line-height: 1;
  background: rgba(15, 23, 42, 0.42); color: #fff; font-size: 15px;
  opacity: 0.72; transition: opacity 0.18s ease, background 0.18s ease;
}

.phone__nav:hover { opacity: 1; background: rgba(15, 23, 42, 0.65); }

.phone__nav--prev { left: 8px; }
.phone__nav--next { right: 8px; }

.phone__dots {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 4;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}

.phone__dot {
  width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
  transition: width 0.2s ease, background 0.2s ease;
}

.phone__dot.is-active { width: 16px; border-radius: 3px; background: #fff; }

.phone__counter {
  position: absolute; right: 10px; top: 10px; z-index: 4;
  padding: 1px 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.5);
  color: #fff; font-size: 10px; font-family: "JetBrains Mono", Consolas, monospace;
}

/* 抖音皮肤（深色） */
.phone--douyin { border-color: #111827; background: #000; }

.phone--douyin .phone__screen { background: #000; color: #f8fafc; }

.phone--douyin .phone__status { color: #f8fafc; }

.phone--douyin .phone__tabs {
  display: flex; justify-content: center; gap: 22px; padding: 6px 0 10px;
  font-size: 14px; font-weight: 700; color: rgba(248, 250, 252, 0.62);
}

.phone--douyin .phone__tabs .is-active { color: #fff; position: relative; }

.phone--douyin .phone__tabs .is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  width: 18px; height: 2px; border-radius: 2px; background: #fff;
}

.phone--douyin .phone__media {
  position: relative; flex: 1; min-height: 0; background: #111827; overflow: hidden;
}

.phone--douyin .phone__media img,
.phone--douyin .phone__media video { width: 100%; height: 100%; object-fit: cover; display: block; }

.phone--douyin .phone__side {
  position: absolute; right: 12px; bottom: 128px; display: grid; gap: 14px; justify-items: center;
  color: #fff; font-size: 9px; text-align: center; z-index: 3;
}

.phone--douyin .phone__side b {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); font-size: 13px; font-weight: 700;
}

.phone--douyin .phone__caption {
  position: absolute; left: 14px; right: 64px; bottom: 18px; z-index: 3;
  display: grid; gap: 6px; color: #f8fafc;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
}

.phone--douyin .phone__caption h4 { margin: 0; font-size: 13.5px; font-weight: 800; line-height: 1.45; }

.phone--douyin .phone__caption p {
  margin: 0; font-size: 11.5px; color: rgba(248, 250, 252, 0.86); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.phone--douyin .phone__tags { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: #93c5fd; }

.phone--douyin .phone__account {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px 14px;
  background: #000; position: relative; z-index: 4;
}

.phone--douyin .phone__avatar {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #fff;
  background: linear-gradient(135deg, #6366f1, #ec4899); display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff;
}

.phone--douyin .phone__account strong { font-size: 12px; font-weight: 700; }

.phone--douyin .phone__bottom {
  display: flex; justify-content: space-around; padding: 8px 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08); color: rgba(248, 250, 252, 0.6); font-size: 10px;
}

.phone--douyin .phone__bottom span.is-active { color: #fff; font-weight: 700; }

/* 小红书皮肤（白底） */
.phone--xiaohongshu { border-color: #e2e8f0; background: #fff; }

.phone--xiaohongshu .phone__screen { background: #f7f8fa; color: #1e293b; }

.phone--xiaohongshu .phone__status { color: #1e293b; }

.phone--xiaohongshu .phone__top {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 10px;
  background: #fff;
}

.phone--xiaohongshu .phone__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #fb923c); display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 800;
}

.phone--xiaohongshu .phone__top strong { font-size: 12.5px; font-weight: 700; flex: 1; }

.phone--xiaohongshu .phone__follow {
  padding: 3px 12px; border-radius: 999px; border: 1px solid #f43f5e; color: #f43f5e;
  font-size: 11px; font-weight: 700; background: #fff;
}

.phone--xiaohongshu .phone__scroll { flex: 1; overflow: auto; padding: 0 12px 20px; }

.phone--xiaohongshu .phone__card {
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 24px -18px rgba(15, 23, 42, 0.5);
}

.phone--xiaohongshu .phone__media {
  position: relative; aspect-ratio: 3 / 4; background: #eef2f7; overflow: hidden;
}

.phone--xiaohongshu .phone__media img,
.phone--xiaohongshu .phone__media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 抖音底部有文案，圆点放到顶部 */
.phone--douyin .phone__dots { top: 12px; bottom: auto; }

/* 小红书浅色皮肤下提高圆点对比度 */
.phone--xiaohongshu .phone__dot { background: rgba(15, 23, 42, 0.3); box-shadow: none; }
.phone--xiaohongshu .phone__dot.is-active { background: #1e293b; }

.phone--xiaohongshu .phone__copy { display: grid; gap: 6px; padding: 11px 12px 12px; }

.phone--xiaohongshu .phone__copy h4 { margin: 0; font-size: 13.5px; font-weight: 800; line-height: 1.45; }

.phone--xiaohongshu .phone__copy p {
  margin: 0; font-size: 11.5px; color: #475569; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.phone--xiaohongshu .phone__tags { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: #2563eb; }

/* ------------------------------------------------------------------ 素材库预存浮窗 */

.stage-dock {
  position: fixed; right: 24px; bottom: 24px; z-index: 120;
  display: grid; justify-items: end; gap: 12px;
  font-family: var(--font);
}

.stage-dock__fab {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 20px 40px -18px rgba(79, 70, 229, 0.7);
  transition: transform 0.16s ease, background 0.16s ease;
}

.stage-dock__fab:hover { background: var(--accent-hover); transform: translateY(-2px); }

.stage-dock__fab-count {
  display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.22); font-size: 11.5px; font-weight: 800;
}

.stage-dock__panel {
  width: min(380px, calc(100vw - 48px)); max-height: min(540px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.55);
  animation: stage-dock-in 0.18s ease both;
}

.stage-dock__panel[hidden] { display: none; }

@keyframes stage-dock-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.stage-dock__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}

.stage-dock__head strong { display: block; font-size: 14px; font-weight: 800; color: var(--text); }

.stage-dock__head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

.stage-dock__close {
  border: none; background: transparent; color: var(--muted); font-size: 20px; line-height: 1;
  cursor: pointer; padding: 2px 4px; border-radius: 6px;
}

.stage-dock__close:hover { color: var(--text); background: #f1f5f9; }

.stage-dock__list {
  flex: 1; overflow: auto; padding: 10px 12px; display: grid; gap: 8px;
}

.stage-dock__item {
  display: grid; grid-template-columns: auto 56px 1fr; gap: 10px; align-items: center;
  padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff;
  cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stage-dock__item:hover { border-color: #c7d2fe; box-shadow: 0 10px 24px -20px rgba(79, 70, 229, 0.8); }

.stage-dock__item.is-locked { opacity: 0.62; }

.stage-dock__check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #cbd5e1;
  display: grid; place-items: center; background: #fff; flex: none;
}

.stage-dock__item.is-checked .stage-dock__check {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.stage-dock__item.is-checked .stage-dock__check::after { content: "✓"; font-size: 12px; font-weight: 800; }

.stage-dock__thumb {
  width: 56px; height: 56px; border-radius: 9px; overflow: hidden; background: #eef2f7;
  display: grid; place-items: center; color: var(--muted); font-size: 16px;
}

.stage-dock__thumb img, .stage-dock__thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }

.stage-dock__meta { min-width: 0; display: grid; gap: 3px; }

.stage-dock__meta strong {
  font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.stage-dock__meta small { font-size: 11px; color: var(--muted); }

.stage-dock__meta em {
  font-style: normal; font-size: 11px; font-weight: 700; color: var(--warn);
}

.stage-dock__meta em.is-saved { color: var(--success); }

.stage-dock__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border); background: #fbfdff;
}

.stage-dock__foot-note { font-size: 11px; color: var(--muted); line-height: 1.4; }

.stage-dock__foot-note b { color: var(--text); }

/* 预存详情弹窗内的大图预览：固定高度、等比完整显示 */
.modal__card--wide .carousel__viewport { aspect-ratio: auto; height: min(52vh, 460px); background: #0f172a; }

.modal__card--wide .carousel__slide img { object-fit: contain; }


.phone--xiaohongshu .phone__actions {
  display: flex; align-items: center; gap: 14px; padding-top: 4px;
  color: #64748b; font-size: 10.5px;
}

.phone--xiaohongshu .phone__actions span { display: inline-flex; align-items: center; gap: 3px; }

.phone--xiaohongshu .phone__bottom {
  display: flex; justify-content: space-around; padding: 8px 0 12px;
  border-top: 1px solid #e5e9f2; background: #fff; color: #94a3b8; font-size: 10px;
}

.phone--xiaohongshu .phone__bottom span.is-active { color: #f43f5e; font-weight: 700; }

/* 真机内的占位 */
.phone__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px;
  align-content: center; text-align: center; padding: 20px;
  background: #1e293b; color: #cbd5e1; font-size: 12px;
}

.phone--xiaohongshu .phone__placeholder { background: #eef2f7; color: #64748b; }

/* ------------------------------------------------------------------ 动画 */

@keyframes studio-spin { to { transform: rotate(360deg); } }

@keyframes studio-shimmer { to { transform: translateX(100%); } }

@keyframes studio-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.86); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ 响应式 */

@media (max-width: 1080px) {
  .studio-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .studio-layout > .studio-rail:last-child { grid-column: 1 / -1; }
  .studio-rail--sticky { position: static; }
  .edit-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .edit-layout > .studio-rail:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .studio-layout--two { grid-template-columns: minmax(0, 1fr); }
  .history-row { grid-template-columns: 48px minmax(0, 1fr); }
  .history-row__cover { width: 48px; height: 64px; }
  .history-row__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 720px) {
  .studio-shell { width: calc(100% - 20px); margin-top: 12px; }
  .studio-layout, .studio-layout--two, .edit-layout { grid-template-columns: minmax(0, 1fr); }
  .studio-page-head h1 { font-size: 19px; }
  .item-cards { grid-template-columns: minmax(0, 1fr); }
  .slot-grid, .upload-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .select, .filter-bar .input { width: 100%; }
  .phone { width: min(340px, calc(100vw - 40px)); height: min(734px, calc(100vh - 150px)); }
}
