:root {
  --bg: #f6f5f2;
  --bg-elevated: #ffffff;
  --ink: #111111;
  --ink-soft: #3a3a3a;
  --muted: #7a7a7a;
  --line: rgba(17, 17, 17, 0.08);
  --line-strong: rgba(17, 17, 17, 0.14);
  --accent: #111111;
  --accent-invert: #ffffff;
  --accent-soft: rgba(17, 17, 17, 0.05);
  --brand: #e8ff47;
  --brand-ink: #111111;
  --ok: #1a9f6a;
  --warn: #e8a11a;
  --danger: #e5484d;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 12px 32px rgba(17,17,17,.06);
  --shadow-hover: 0 8px 28px rgba(17,17,17,.12);
  --font: "Plus Jakarta Sans", "Noto Sans SC", system-ui, sans-serif;
  --display: "Syne", "Plus Jakarta Sans", "Noto Sans SC", sans-serif;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(17,17,17,.08) 1px, transparent 0);
  background-size: 22px 22px;
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
select { font: inherit; color: var(--ink, #111111); }

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(246, 245, 242, 0.78);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav a {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
}

.nav a:hover,
.nav a.active {
  background: var(--accent-soft);
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover {
  background: #000;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.btn-secondary {
  background: rgba(255,255,255,.7);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-secondary:hover {
  background: #fff;
  border-color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--ink); background: var(--accent-soft); }

.btn-warm,
.btn-brand {
  background: var(--brand);
  color: var(--brand-ink);
}
.btn-warm:hover,
.btn-brand:hover {
  filter: brightness(0.97);
  box-shadow: 0 10px 24px rgba(232, 255, 71, .35);
}

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* ===== Hero ===== */
.hero {
  padding: clamp(48px, 10vw, 96px) 0 clamp(36px, 6vw, 56px);
  text-align: center;
}

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.65);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 22px;
}

.hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}

.hero-brand {
  margin: 0 auto 16px;
  max-width: 14ch;
  font-family: var(--display);
  font-size: clamp(40px, 7.2vw, 72px);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.hero-lead {
  margin: 0 auto 28px;
  max-width: 38em;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.hero-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.hero-visual { display: none; }

/* ===== Sections ===== */
.section { padding: clamp(28px, 5vw, 56px) 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== Template cards ===== */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tpl-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  animation: rise .6s var(--ease) both;
}

.tpl-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.tpl-cover {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(145deg, #eceae4, #d9d6ce 45%, #cfcbc2);
  position: relative;
  overflow: hidden;
}

.tpl-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(232,255,71,.28), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(17,17,17,.08), transparent 40%);
  pointer-events: none;
}

.tpl-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.tpl-cover .badges {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  background: rgba(17,17,17,.78);
  color: #fff;
  backdrop-filter: blur(8px);
}

.badge.hot { background: #111; color: var(--brand); }
.badge.vip { background: #fff; color: #111; }
.badge.new { background: var(--brand); color: #111; }

.tpl-body { padding: 16px 16px 18px; }

.tpl-body h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tpl-desc {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  min-height: 0;
}

.tpl-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 0;
}

.tpl-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: grid;
  place-items: center;
}
.tpl-play::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #111;
  margin-left: 3px;
}

.preview-pane--media {
  padding: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  background: #111;
}

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

.demo-video,
.demo-video-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.demo-video--detail,
.demo-video-frame iframe,
.demo-video-frame .demo-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: inherit;
}

.demo-video-frame {
  position: absolute;
  inset: 0;
}

.demo-video--admin {
  width: 100%;
  max-height: 180px;
  border-radius: 12px;
  background: #000;
}

.demo-video-frame .demo-video--admin,
iframe.demo-video--admin {
  width: 100%;
  height: 180px;
  border-radius: 12px;
}

.tpl-intro__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.tpl-intro__body {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.tpl-intro__body--empty {
  color: var(--muted);
}

.tpl-actions { display: flex; gap: 8px; }
.tpl-actions .btn { flex: 1; }

/* ===== VIP ===== */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .22s var(--ease), border-color .22s var(--ease);
}

.plan-card:hover { transform: translateY(-3px); }

.plan-card.featured {
  background: #111;
  color: #fff;
  border-color: #111;
}

.plan-card.featured .plan-price { color: var(--brand); }
.plan-card.featured .plan-features li {
  color: rgba(255,255,255,.72);
  border-bottom-color: rgba(255,255,255,.1);
}
.plan-card.featured .plan-price small,
.plan-card.featured .plan-days { color: rgba(255,255,255,.45); }

.plan-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.plan-price {
  margin: 14px 0 4px;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.plan-price small {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: line-through;
  margin-left: 6px;
}

.plan-days {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 12px 0 18px;
  flex: 1;
}

.plan-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ===== Forms ===== */
.form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 32px);
  max-width: 420px;
  margin: 48px auto;
  box-shadow: var(--shadow);
}

.form-group { margin-bottom: 0; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 10px 14px;
  background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.form-control:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(17,17,17,.06);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

/* ===== Alerts / chips / tables ===== */
.alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 14px;
}
.alert-success { background: #e8f8ef; color: var(--ok); }
.alert-error { background: #ffe8e8; color: var(--danger); }
.alert-info { background: #f0f0f0; color: var(--ink-soft); }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-box .label { color: var(--muted); font-size: 12px; }
.stat-box .value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.04em;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th { color: var(--muted); font-weight: 600; }

.progress {
  height: 8px;
  background: rgba(17,17,17,.06);
  border-radius: 99px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: #111;
  border-radius: inherit;
  transition: width .35s var(--ease);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.7);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all .18s var(--ease);
}

.chip:hover {
  border-color: #111;
  color: #111;
}

.chip.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

/* ===== Create ===== */
.create-layout {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  padding: 28px 0 48px;
}

.preview-pane {
  min-height: 360px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 20%, rgba(232,255,71,.25), transparent 40%),
    linear-gradient(160deg, #eceae4, #d8d4cb);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.status-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(17,17,17,.12);
  border-top-color: #111;
  animation: spin .8s linear infinite;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 48px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.45);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--ink); }

/* ===== Motion ===== */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

.stagger > *:nth-child(1) { animation-delay: 40ms; }
.stagger > *:nth-child(2) { animation-delay: 80ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 160ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 240ms; }
.stagger > *:nth-child(7) { animation-delay: 280ms; }
.stagger > *:nth-child(8) { animation-delay: 320ms; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-layout { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(var(--header-h) + 8px);
    flex-direction: column;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-hover);
  }
  .mobile-nav-toggle { display: inline-grid; place-items: center; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 28px, 1120px); }
  .tpl-grid,
  .plan-grid,
  .stats-row { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero-cta .btn { width: 100%; }
  .header-actions .btn-ghost { display: none; }
  .tpl-actions { flex-direction: column; }
}

/* ===== Create Studio (PPT / create form) ===== */
.create-studio {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.18fr);
  gap: 22px;
  padding: 28px 0 64px;
  align-items: start;
}
.cs-aside { position: sticky; top: calc(var(--header-h) + 16px); }
.cs-preview {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 12%, rgba(232,255,71,.28), transparent 42%),
    linear-gradient(165deg, #1a1c18 0%, #2c3228 48%, #121410 100%);
  min-height: 320px;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.72);
}
.cs-cover { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.cs-preview-empty { text-align: center; padding: 36px 24px; }
.cs-preview-mark {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 16px; display: grid; place-items: center;
  background: var(--brand); color: #111;
  font-family: var(--display); font-weight: 800; font-size: 22px;
}
.cs-preview-empty h2 {
  margin: 0 0 8px; color: #fff;
  font-family: var(--display); font-size: 26px; letter-spacing: -.03em;
}
.cs-preview-empty p { margin: 0; font-size: 13px; opacity: .75; }
.cs-steps {
  list-style: none; margin: 14px 0 0; padding: 14px 16px;
  background: rgba(255,255,255,.72); border: 1px solid var(--line);
  border-radius: 18px; display: grid; gap: 10px;
}
.cs-steps li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-soft); font-weight: 550;
}
.cs-steps span {
  width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  background: #111; color: var(--brand);
  font-size: 12px; font-weight: 700;
}
.cs-main {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}
.cs-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.cs-kicker {
  margin: 0 0 4px; font-size: 12px; font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.cs-head h1 {
  margin: 0; font-family: var(--display);
  font-size: clamp(24px, 3vw, 30px); letter-spacing: -.03em; line-height: 1.15;
}
.cs-quota {
  flex-shrink: 0; min-width: 76px; text-align: center;
  padding: 10px 12px; border-radius: 16px;
  background: #111; color: #fff;
}
.cs-quota em {
  display: block; font-style: normal;
  font-family: var(--display); font-size: 22px; font-weight: 700;
  color: var(--brand); letter-spacing: -.03em;
}
.cs-quota span { font-size: 11px; opacity: .7; }
.cs-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fff, #fafaf8);
  animation: rise .55s var(--ease) both;
}
.cs-card--hero {
  background:
    radial-gradient(circle at 100% 0%, rgba(232,255,71,.18), transparent 42%),
    linear-gradient(180deg, #fff, #f7f7f3);
  border-color: rgba(17,17,17,.12);
}
.cs-card-h {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.cs-card-h h3 {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
}
.cs-card-h span { font-size: 12px; color: var(--muted); }
.cs-input-lg { font-size: 16px; font-weight: 550; }
.cs-script {
  min-height: 220px !important;
  font-size: 15px; line-height: 1.7;
  border-radius: 16px !important;
  background: #fffef9 !important;
}
.cs-script-meta {
  margin-top: 8px; font-size: 12px; color: var(--muted); text-align: right;
}
.cs-swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cs-swatch {
  appearance: none; border: 1px solid var(--line-strong);
  background: #fff; border-radius: 14px; padding: 8px;
  cursor: pointer; text-align: left;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.cs-swatch:hover { transform: translateY(-2px); border-color: #111; }
.cs-swatch.is-on {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17,17,17,.08), 0 8px 20px rgba(17,17,17,.08);
}
.cs-swatch-face {
  display: block; height: 52px; border-radius: 10px;
  border: 1px solid rgba(0,0,0,.06);
  background-size: cover !important;
}
.cs-swatch-name {
  display: block; margin-top: 8px;
  font-size: 12px; font-weight: 650; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-custom-bg {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}
.cs-upload-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.cs-dropzone {
  display: grid; place-items: center; gap: 4px;
  min-height: 112px; padding: 16px;
  border: 1.5px dashed rgba(17,17,17,.22);
  border-radius: 16px; background: rgba(17,17,17,.02);
  cursor: pointer; text-align: center;
  transition: border-color .18s var(--ease), background .18s var(--ease);
  position: relative;
}
.cs-dropzone:hover { border-color: #111; background: rgba(232,255,71,.12); }
.cs-dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.cs-drop-title { font-size: 13px; font-weight: 650; }
.cs-drop-hint { font-size: 11px; color: var(--muted); }
.cs-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.cs-row2 {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px;
}
.cs-seg {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cs-seg-btn {
  appearance: none; border: 1px solid var(--line-strong);
  background: #fff; border-radius: 999px;
  height: 36px; padding: 0 12px;
  font-size: 12px; font-weight: 650; color: var(--ink-soft);
  cursor: pointer; transition: all .15s var(--ease);
}
.cs-seg-btn:hover { border-color: #111; color: #111; }
.cs-seg-btn.is-on { background: #111; border-color: #111; color: #fff; }
.cs-ratio { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs-ratio-btn {
  appearance: none; border: 1px solid var(--line-strong);
  background: #fff; border-radius: 14px;
  min-height: 56px; padding: 10px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 650; cursor: pointer;
  transition: all .15s var(--ease);
}
.cs-ratio-btn.is-on { border-color: #111; background: #111; color: #fff; }
.cs-ratio-icon {
  width: 22px; height: 16px; border-radius: 3px;
  border: 2px solid currentColor; flex-shrink: 0; opacity: .85;
}
.cs-ratio-icon--tall { width: 14px; height: 22px; }
.cs-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-top: 8px; position: sticky; bottom: 12px;
  background: linear-gradient(180deg, transparent, #fff 28%);
  padding-bottom: 4px;
}
.cs-submit {
  flex: 1; min-width: 200px; min-height: 48px;
  font-size: 15px; font-weight: 700;
  background: #111 !important; color: var(--brand) !important;
  border: none !important;
}
.cs-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.cs-field .local-preview { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 980px) {
  .create-studio { grid-template-columns: 1fr; }
  .cs-aside { position: static; }
  .cs-swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-upload-grid, .cs-row2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cs-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-main { padding: 16px; border-radius: 20px; }
}

/* === video modal + video covers === */
.tpl-cover--video {
  cursor: pointer;
}
.tpl-cover-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  display: block;
  background: #111;
}
.tpl-cover--video:hover .tpl-play,
.tpl-cover--video:focus-visible .tpl-play {
  transform: translate(-50%, -50%) scale(1.06);
  background: #fff;
}
.tpl-play {
  transition: transform .2s ease, background .2s ease;
}
.tpl-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.tpl-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 40px;
}
.tpl-miniview--video {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #161616;
  color: #fff;
  position: relative;
  z-index: 1;
}
.video-modal[hidden] { display: none !important; }
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, .72);
  backdrop-filter: blur(6px);
}
.video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  background: #0b0d12;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
  overflow: hidden;
}
.video-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.video-modal__head strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-modal__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.video-modal__close:hover { background: rgba(255,255,255,.18); }
.video-modal__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-modal__player video,
.video-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
body.video-modal-open { overflow: hidden; }
/* === end video modal */

/* === tpl card link + mobile make button === */
a.tpl-body--link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a.tpl-body--link:hover h3,
a.tpl-body--link:focus-visible h3 {
  color: var(--ink);
}
.tpl-make-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  pointer-events: none; /* 整块 body 可点，按钮仅视觉 */
}
.tpl-actions {
  display: block;
  width: 100%;
}
.tpl-actions .btn {
  width: 100%;
  max-width: 100%;
  flex: none;
}
@media (max-width: 720px) {
  .tpl-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .tpl-card {
    border-radius: 18px;
  }
  .tpl-body {
    padding: 14px 14px 16px;
  }
  .tpl-body h3 {
    font-size: 17px;
    line-height: 1.35;
  }
  .tpl-desc {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0;
  }
  .tpl-make-btn,
  .tpl-actions .btn-primary {
    width: 100%;
    min-height: 46px;
    font-size: 15px;
    border-radius: 14px;
    padding: 0 16px;
  }
}
/* === end tpl card link */


.logo-img{display:block;height:36px;width:auto;max-width:160px;object-fit:contain;}
@media (max-width:720px){.logo-img{height:30px;max-width:130px;}}

/* Fixed toasts — do not push page layout */
.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(520px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 560;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
  border: 1px solid transparent;
  backdrop-filter: blur(10px);
  animation: toast-in .28s ease both;
}
.toast.is-leaving {
  animation: toast-out .22s ease both;
}
.toast-success {
  background: rgba(232, 248, 239, 0.96);
  color: #147a45;
  border-color: rgba(20, 122, 69, 0.18);
}
.toast-error {
  background: rgba(255, 236, 236, 0.97);
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.16);
}
.toast-info {
  background: rgba(245, 245, 247, 0.97);
  color: #344054;
  border-color: rgba(16, 24, 40, 0.08);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.98); }
}
