/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #08080f;
  --bg2: #0f0f1a;
  --surface: #13131e;
  --surface2: #1c1c2d;
  --surface3: #242436;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --text: #f0f0f8;
  --text-muted: #8888aa;
  --text-faint: #55556a;
  --accent: #ff0033;
  --accent-glow: rgba(255, 0, 51, 0.25);
  --accent2: #ff6b35;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 8, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 28px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}
.logo-name { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
.logo-tagline { font-size: 11px; color: var(--text-muted); line-height: 1; margin-top: 1px; }

.header-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 7px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface2); }
.btn-outline {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border2); color: var(--text-muted);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: all 0.2s; background: transparent;
}
.btn-outline:hover { border-color: var(--accent); color: var(--text); background: var(--surface2); }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; padding: 90px 28px 80px; text-align: center; overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,0,51,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid rgba(255,0,51,0.3); background: rgba(255,0,51,0.08);
  font-size: 12px; font-weight: 600; color: #ff6b6b; letter-spacing: 0.05em;
  margin-bottom: 24px;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-size: clamp(40px, 6vw, 68px); font-weight: 900; line-height: 1.08;
  letter-spacing: -2px; color: var(--text); margin-bottom: 22px;
}
.hero-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent2), #ff6bff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 17px; color: var(--text-muted); line-height: 1.75; margin-bottom: 32px;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border2);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: all 0.2s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }

/* ─── Builder Layout ─────────────────────────────────────────────────────────── */
.builder-layout {
  max-width: 1400px; margin: 0 auto;
  padding: 0 28px 60px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  align-items: start;
}

/* ─── Config Panel ───────────────────────────────────────────────────────────── */
.config-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.panel-header { margin-bottom: 24px; }
.panel-title { font-size: 16px; font-weight: 700; }
.panel-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── Form Fields ────────────────────────────────────────────────────────────── */
.field-group { margin-bottom: 20px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); display: block; margin-bottom: 6px; }
.field-label-row .field-label { margin-bottom: 0; }
.required { color: var(--accent); }
.field-help { font-size: 12px; color: var(--accent); text-decoration: none; opacity: 0.8; }
.field-help:hover { opacity: 1; }
.field-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; line-height: 1.5; }
.field-hint code {
  background: var(--surface3); padding: 1px 5px; border-radius: 4px;
  font-size: 11px; color: #80d0ff;
}
.field-label-sub { font-size: 11px; color: var(--text-faint); font-weight: 400; margin-left: 4px; }

.recommended-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(39,201,63,0.15); color: #27c93f;
  border: 1px solid rgba(39,201,63,0.3); border-radius: 4px;
  padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}

.field-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 16px; color: var(--text-faint); font-size: 11px;
  transition: opacity 0.3s;
}
.field-divider::before, .field-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.btn-use-template {
  background: var(--surface3); border: 1px solid var(--border2);
  color: #80d0ff; font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.btn-use-template:hover {
  background: var(--border2); color: #fff;
}

.proxy-hint strong { color: #27c93f; }

.field-input {
  width: 100%; padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 13px; font-family: var(--font);
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field-input::placeholder { color: var(--text-faint); }
.field-input.shake { animation: shake 0.4s ease; border-color: #ff4444; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ─── Type Grid ──────────────────────────────────────────────────────────────── */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
  cursor: pointer; transition: all 0.2s; color: var(--text-muted);
  text-align: center;
}
.type-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface3); }
.type-btn.active { border-color: var(--accent); background: rgba(255,0,51,0.1); color: var(--text); }
.type-icon { font-size: 20px; }
.type-name { font-size: 12px; font-weight: 700; }
.type-desc { font-size: 11px; color: var(--text-faint); }
.type-btn.active .type-desc { color: var(--text-muted); }

/* ─── Toggle Group ───────────────────────────────────────────────────────────── */
.toggle-group {
  display: flex; gap: 6px;
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 4px; border: 1px solid var(--border);
}
.toggle-btn {
  flex: 1; padding: 8px; border-radius: 6px;
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: all 0.2s;
}
.toggle-btn:hover { color: var(--text); }
.toggle-btn.active { background: var(--surface3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* ─── Color Picker ───────────────────────────────────────────────────────────── */
.color-row { display: flex; align-items: center; gap: 12px; }
.color-picker {
  width: 46px; height: 36px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; padding: 2px; background: transparent;
}
.color-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset-color, .preset-btn-text {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.2s, border-color 0.2s;
}
.preset-color:hover, .preset-btn-text:hover { transform: scale(1.15); }
.preset-color.active, .preset-btn-text.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

.subfield-group {
  margin-top: 8px; padding: 10px 12px;
  background: var(--surface2); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.subfield-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  display: block; margin-bottom: 6px;
}

/* ─── Range Slider ───────────────────────────────────────────────────────────── */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 8px;
  background: var(--accent); border-radius: 99px;
  font-size: 12px; font-weight: 700; color: #fff; margin-left: 8px;
}
.range-input {
  width: 100%; appearance: none; height: 4px;
  background: var(--surface3); border-radius: 99px; outline: none; cursor: pointer;
  margin-top: 4px;
}
.range-input::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform 0.15s;
}
.range-input::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* ─── Toggle Switch ──────────────────────────────────────────────────────────── */
.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track {
  width: 42px; height: 24px; background: var(--surface3);
  border-radius: 99px; position: relative;
  border: 1px solid var(--border2); transition: background 0.25s;
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-label { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ─── Preview Button ─────────────────────────────────────────────────────────── */
.btn-preview {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.25s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px var(--accent-glow);
  margin-top: 8px;
}
.btn-preview:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px var(--accent-glow); }
.btn-preview:active:not(:disabled) { transform: translateY(0); }
.btn-preview:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Preview Area ───────────────────────────────────────────────────────────── */
.preview-area { display: flex; flex-direction: column; gap: 20px; }
.preview-topbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 12px 16px;
  border-bottom: none;
}
.preview-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-right: auto; }
.browser-dots { display: flex; gap: 6px; order: -1; }
.bdot { width: 12px; height: 12px; border-radius: 50%; }
.bdot.red { background: #ff5f56; }
.bdot.yellow { background: #ffbd2e; }
.bdot.green { background: #27c93f; }
.preview-url-bar {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 12px; font-size: 12px; color: var(--text-faint);
  flex: 1; max-width: 260px; text-align: center;
}
.preview-frame {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px; min-height: 400px;
}

/* ─── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; min-height: 380px;
}
.empty-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,0,51,0.15), rgba(255,107,53,0.1));
  border: 2px dashed rgba(255,0,51,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--accent); margin-bottom: 20px;
}
.empty-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.empty-steps { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.step { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface3); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}

/* ─── Embed Section ──────────────────────────────────────────────────────────── */
.embed-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.embed-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.embed-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700;
}
.btn-copy {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-copy:hover { background: var(--surface2); border-color: var(--accent); }
.btn-copy.copied { background: rgba(39,201,63,0.15); border-color: #27c93f; color: #27c93f; }
.embed-code {
  padding: 18px; font-family: 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
  font-size: 13px; line-height: 1.8; color: #a8d8a8;
  background: rgba(0,0,0,0.3); white-space: pre-wrap; word-break: break-all;
  max-height: 280px; overflow-y: auto;
}
.embed-instructions {
  padding: 14px 18px; font-size: 13px; color: var(--text-muted);
  background: var(--surface2); border-top: 1px solid var(--border); line-height: 1.6;
}
.embed-instructions strong { color: var(--text); }
.embed-instructions code {
  background: var(--surface3); padding: 1px 6px; border-radius: 4px;
  font-size: 12px; color: #80d0ff;
}

/* ─── How It Works ───────────────────────────────────────────────────────────── */
.how-section {
  padding: 80px 28px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(255,0,51,0.03) 50%, transparent);
}
.how-inner { max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 36px; font-weight: 800; letter-spacing: -1px; text-align: center; margin-bottom: 10px; }
.section-sub { text-align: center; color: var(--text-muted); font-size: 15px; margin-bottom: 50px; }
.steps-row {
  display: flex; align-items: flex-start; gap: 0; justify-content: center;
  flex-wrap: wrap;
}
.how-step {
  flex: 1; min-width: 180px; max-width: 220px;
  text-align: center; padding: 0 16px;
}
.how-arrow { font-size: 24px; color: var(--text-faint); padding-top: 48px; flex-shrink: 0; }
.how-num { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.15em; margin-bottom: 14px; }
.how-icon {
  font-size: 36px; margin-bottom: 14px;
  width: 70px; height: 70px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
  transition: transform 0.25s;
}
.how-step:hover .how-icon { transform: scale(1.08) rotate(-3deg); }
.how-step h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.how-step p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ─── Features ───────────────────────────────────────────────────────────────── */
.features-section { padding: 60px 28px 100px; border-top: 1px solid var(--border); }
.features-inner { max-width: 1100px; margin: 0 auto; }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-top: 0;
}
.feat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: border-color 0.25s, transform 0.25s;
}
.feat-card:hover { border-color: var(--border2); transform: translateY(-3px); }
.feat-icon { font-size: 30px; margin-bottom: 14px; display: block; }
.feat-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feat-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: 32px 28px;
  text-align: center; background: var(--bg);
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 10px;
}
.footer-note { font-size: 13px; color: var(--text-muted); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .builder-layout { grid-template-columns: 1fr; }
  .config-panel { position: static; max-height: none; }
  .how-arrow { display: none; }
  .how-step { min-width: 140px; }
}
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; }
  .hero { padding: 60px 16px 50px; }
  .builder-layout { padding: 0 16px 50px; }
  .hero-sub br { display: none; }
  .btn-outline span { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .steps-row { flex-direction: column; align-items: center; }
  .how-step { max-width: 100%; padding: 0; }
}
