:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #ec4899;
  --success: #059669;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.14);
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans", "Yu Gothic", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Shared Header & Marketing Layout ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

.nav-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-link img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}

.lang-switch button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.lang-switch button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-dark {
  background: #0f172a;
  color: #ffffff;
}
.btn-dark:hover {
  background: #1e293b;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--surface-2);
}

.btn-pro {
  background: linear-gradient(135deg, #4f46e5, #9333ea 55%, #ec4899);
  color: #ffffff;
}
.btn-pro:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ---------- Landing Page ---------- */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(circle at 82% 10%, rgba(99, 102, 241, 0.12), transparent 45%),
    radial-gradient(circle at 12% 30%, rgba(236, 72, 153, 0.08), transparent 42%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 16px 0 18px;
}

.hero p.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 26px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.hero-preview-shell {
  background: #0f172a;
  padding: 18px;
  border-radius: 24px;
  box-shadow: 0 28px 60px -18px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}

.hero-preview-canvas-wrap {
  display: flex;
  justify-content: center;
  background: #1e293b;
  border-radius: 16px;
  padding: 14px;
}

.hero-preview-canvas-wrap canvas {
  max-width: 100%;
  max-height: 440px;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.hero-preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hero-preview-tabs button {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.hero-preview-tabs button.active {
  background: #6366f1;
  border-color: #818cf8;
  color: #ffffff;
}

.section {
  padding: 68px 0;
}

.section-white {
  background: #ffffff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.025em;
  margin: 8px 0 10px;
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.tool-link-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-link-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 12px 26px -10px rgba(79, 70, 229, 0.22);
}

.tool-link-card h3 {
  margin: 0;
  font-size: 15.5px;
}

.tool-link-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.tool-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--primary);
  width: fit-content;
}

/* Pricing Cards */
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pricing-card.featured {
  border: 2px solid var(--primary);
  box-shadow: 0 20px 44px -14px rgba(79, 70, 229, 0.28);
}

.price-num {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.price-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
  color: var(--muted);
}

.price-list li::before {
  content: "✓ ";
  color: var(--success);
  font-weight: 800;
}

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: #ffffff;
  font-size: 13.5px;
  color: var(--muted);
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

/* ---------- Legal / Prose Pages ---------- */
.prose {
  max-width: 780px;
  margin: 48px auto 72px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
}

.prose h1 { margin-top: 0; }
.prose h2 { margin-top: 28px; font-size: 19px; }
.prose p, .prose li { color: var(--muted); line-height: 1.75; font-size: 15px; }

/* ---------- STUDIO APP WORKSPACE ---------- */
body.studio-body {
  background: #0f172a;
  color: #e2e8f0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.studio-topbar {
  height: 58px;
  background: #0b1120;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.studio-topbar .brand-link {
  color: #f8fafc;
  font-size: 16px;
}

.studio-topbar .lang-switch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.studio-topbar .lang-switch button {
  color: #94a3b8;
}
.studio-topbar .lang-switch button.active {
  background: #4f46e5;
  color: #ffffff;
}

.status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.status-badge.free {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.status-badge.pro {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.studio-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 375px 1fr;
}

.studio-sidebar {
  background: #111827;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.studio-input, .studio-select, .studio-textarea {
  width: 100%;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.studio-input:focus, .studio-select:focus, .studio-textarea:focus {
  border-color: #818cf8;
}

.studio-textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.45;
}

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

.theme-chip {
  position: relative;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: #0b1120;
  border-radius: 9px;
  padding: 7px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.theme-chip.active {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.18);
  color: #ffffff;
}

.swatch-row {
  display: flex;
  gap: 3px;
}
.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pro-tag {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #ffffff;
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.layout-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b1120;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.layout-btn.active {
  background: #4f46e5;
  border-color: #818cf8;
  color: #ffffff;
}

.studio-stage-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(99, 102, 241, 0.12), transparent 55%),
    #090d16;
}

.canvas-viewport {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

#mainCanvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

.filmstrip {
  height: 112px;
  flex-shrink: 0;
  background: #0b1120;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
}

.slide-thumb {
  flex-shrink: 0;
  min-width: 122px;
  max-width: 155px;
  height: 82px;
  background: #162033;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #cbd5e1;
}

.slide-thumb.active {
  border-color: #818cf8;
  background: rgba(79, 70, 229, 0.24);
  color: #ffffff;
}

.slide-thumb-title {
  font-size: 11.5px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.slide-thumb-meta {
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: #cbd5e1;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.modal-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin: 16px 0;
}

.modal-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.modal-tabs button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .hero-grid, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  body.studio-body {
    height: auto;
    overflow: auto;
  }
  .studio-main {
    grid-template-columns: 1fr;
  }
  .studio-stage-wrap {
    order: -1;
    min-height: 460px;
  }
  .nav-links {
    display: none;
  }
}
