:root {
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-2: #fcfcfc;
  --text: #252e69;
  --text-muted: #5b638f;
  --primary: #5940f1;
  --primary-soft: #ece8ff;
  --primary-shadow: 0 8px 24px rgba(89, 64, 241, 0.28);
  --accent: #129fea;
  --border: #dddddd;
  --danger: #c0364a;
  --ok: #1f8a5b;
  --overlay: rgba(12, 14, 32, 0.55);
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow: 0 10px 30px rgba(37, 46, 105, 0.08);
  --font: "Poppins", "Inter", system-ui, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --header-h: 64px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10121c;
  --surface: #1a1e2e;
  --surface-2: #151827;
  --text: #e8eaf8;
  --text-muted: #9aa3c7;
  --primary: #7b68f7;
  --primary-soft: #2a2550;
  --primary-shadow: 0 8px 24px rgba(123, 104, 247, 0.35);
  --accent: #3bb4f0;
  --border: #2e3358;
  --overlay: rgba(6, 8, 18, 0.62);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, [role="button"] { cursor: pointer; font-family: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.6; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.brand-name { font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.brand-tag { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.02em; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a { color: var(--text); font-size: 14px; font-weight: 500; padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.nav a:hover { background: var(--primary-soft); text-decoration: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: grid; place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; }

.hero {
  position: relative; isolation: isolate;
  min-height: 420px;
  display: grid; place-items: center;
  padding: 48px 0 80px;
  overflow: hidden;
}
.hero-video, .hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.hero-overlay { position: absolute; inset: 0; background: var(--overlay); z-index: -1; }
.hero-copy { text-align: center; color: #fff; max-width: 820px; margin: 0 auto 28px; }
.hero-copy h1 {
  margin: 0 0 12px; font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.2; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance;
}
.hero-copy p { margin: 0; font-size: 1rem; opacity: 0.92; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.14); font-size: 13px; font-weight: 600;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  width: min(720px, 100%);
  margin: 0 auto;
}
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 8px; padding: 10px 8px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.tab.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.tab[data-p="tiktok"] .dot { background: #111; box-shadow: 0 0 0 2px #25f4ee, 0 0 0 4px #fe2c55; }
.tab[data-p="youtube"] .dot { background: #ff0000; }
.tab[data-p="instagram"] .dot { background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7); background: #ee2a7b; }

.row { display: flex; gap: 8px; }
.row input, .row textarea {
  flex: 1; min-width: 0; height: 48px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0 14px; font: inherit; color: var(--text); background: var(--surface);
}
.row textarea { height: 110px; padding: 12px 14px; resize: vertical; }
.btn {
  height: 48px; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--primary-shadow); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--border); border-radius: 2px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-block { width: 100%; margin-top: 12px; height: 52px; font-size: 16px; }
.hint { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }
.mode-toggle { display: flex; justify-content: flex-end; margin: 8px 0 0; }
.linkish { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; padding: 0; }

.status { margin-top: 12px; font-size: 14px; color: var(--text-muted); }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

.preview {
  display: none; margin-top: 16px; gap: 16px; align-items: start;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.preview.show { display: grid; grid-template-columns: 160px 1fr; }
.thumb-wrap {
  background: #0b0d18; border-radius: 8px; overflow: hidden;
  width: 100%;
}
.thumb-wrap img { width: 100%; height: auto; display: block; }
.meta h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.3; }
.meta p { margin: 0; font-size: 13px; color: var(--text-muted); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.choices label, .quality-wrap label {
  font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px;
}
select {
  width: 100%; height: 40px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; padding: 0 10px;
}
.progress {
  display: none; margin-top: 12px; height: 8px; background: var(--primary-soft);
  border-radius: 999px; overflow: hidden;
}
.progress.show { display: block; }
.progress > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width 200ms ease; }
.progress-label { display: none; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.progress-label.show { display: block; }

.batch-list { margin-top: 12px; display: grid; gap: 8px; }
.batch-item {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.batch-item .st { font-weight: 600; }
.st.wait { color: var(--text-muted); }
.st.run { color: var(--accent); }
.st.done { color: var(--ok); }
.st.fail { color: var(--danger); }

.section { padding: 56px 0; scroll-margin-top: 80px; }
.section h2 { margin: 0 0 24px; font-size: 1.5rem; letter-spacing: -0.02em; text-align: center; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; box-shadow: var(--shadow);
}
.feature .ic {
  width: 40px; height: 40px; border-radius: 8px; background: var(--primary-soft);
  color: var(--primary); display: grid; place-items: center; margin-bottom: 12px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--text-muted); font-size: 14px; }

.steps { counter-reset: step; display: grid; gap: 12px; max-width: 720px; margin: 0 auto; }
.step {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}

.faq { max-width: 720px; margin: 0 auto; display: grid; gap: 8px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px 16px;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 0 0 14px; color: var(--text-muted); font-size: 14px; }

.history {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: min(360px, calc(100% - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); display: none; max-height: 50vh; overflow: auto;
}
.history.open { display: block; }
.history header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.history ul { list-style: none; margin: 0; padding: 8px; }
.history li { padding: 8px; border-radius: 8px; font-size: 13px; }
.history li:hover { background: var(--primary-soft); }
.history .muted { color: var(--text-muted); font-size: 12px; }

.legal { padding: 48px 0 80px; max-width: 760px; }
.legal h1 { margin-top: 0; }
.legal h2 { text-align: left; margin: 28px 0 8px; font-size: 1.15rem; }
.legal p, .legal li { color: var(--text-muted); }

.site-footer {
  background: var(--surface); border-top: 1px solid var(--border); padding: 32px 0 20px; margin-top: 24px;
}
.foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.foot-brand img { width: 32px; height: 32px; border-radius: 8px; }
.disclaimer { font-size: 13px; color: var(--text-muted); max-width: 640px; }
.foot-links { display: flex; gap: 16px; margin: 16px 0; font-size: 14px; }
.copy { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

@media (max-width: 720px) {
  .nav a.desk { display: none; }
  .preview.show { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .hero { min-height: 360px; padding: 32px 0 64px; }
  .choices { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .btn-secondary { border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
