/* ============================================================
   365Lab Ad Code Generator - Main Stylesheet
   Domain: adcode.365lab.top
   Version: 2.0.0 - Deep UI Refactor
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors - Emerald Green */
  --brand-50:  #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-300: #6ee7b7;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;

  /* Semantic */
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;

  /* Accent - Warm Amber (for CTAs) */
  --accent-400: #fbbf24;
  --accent-600: #d97706;

  /* Neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Surfaces */
  --bg-page:    #f8fafc;
  --bg-card:    #ffffff;
  --bg-overlay: rgba(15, 23, 42, 0.5);
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-tertiary:  #64748b;
  --text-inverse:   #ffffff;

  /* Shadows - 5级 elevation (克制使用) */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg: 0 8px 24px rgba(15,23,42,0.08);
  --shadow-xl: 0 16px 48px rgba(15,23,42,0.1);

  /* NO glow-brand, NO glass variables */

  /* Radii */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'DM Sans', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-lg:   1.125rem;
  --font-size-xl:   1.25rem;
  --font-size-2xl:  1.5rem;
  --font-size-3xl:  1.875rem;
  --font-size-4xl:  2.25rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --header-height:  68px;

  /* Transitions - all smooth cubic-bezier */
  --transition-fast: 150ms cubic-bezier(0.4,0,0.2,1);
  --transition-base: 250ms cubic-bezier(0.4,0,0.2,1);

  /* Z-index */
  --z-sticky:   200;
  --z-modal:    10000;
  --z-toast:    10100;
  --z-tooltip:  10200;

  /* Misc */
  --white: #ffffff;
  --danger-600: #dc2626;
  --danger-300: #fca5a5;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--brand-700); }

img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: var(--brand-300); }
* { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.28;
  font-weight: 700;
  color: var(--text-primary);
}
h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }

/* ============================================================
   Container
   ============================================================ */
.container {
  width: 100%;
  max-width: 1390px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

/* ============================================================
   Header / Navigation
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}
/* 支持 backdrop-filter 的浏览器使用更通透的背景 */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .header {
    background: rgba(255,255,255,0.82);
  }
}


.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1390px;
  margin: 0 auto;
  padding: 0 var(--space-8);
  gap: var(--space-4);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}


.logo-img {
  height: 38px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  border-radius: var(--radius-md);
}

.logo-text {
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.logo-text-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--brand-500);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.22s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--brand-600);
  background: var(--brand-50);
}
.nav-link.active {
  color: var(--brand-600);
  background: var(--brand-50);
  font-weight: 600;
}

/* Language Switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-left: var(--space-2);
  transition: background 0.2s;
}
.lang-switch:hover { background: var(--gray-200); }
.lang-switch span {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  transition: all 0.22s ease;
  color: var(--gray-500);
}
.lang-switch span.active {
  background: white;
  color: var(--brand-600);
  box-shadow: var(--shadow-xs);
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.menu-toggle:hover { background: var(--gray-100); }
.menu-toggle svg { width: 22px; height: 22px; }

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3.5rem, 6vw, 5.5rem);
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(16, 185, 129, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(20, 184, 166, 0.06) 0%, transparent 50%),
    var(--bg-page);
  text-align: center;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--space-6);
  border: 1px solid var(--brand-100);
  letter-spacing: 0.01em;
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,0.08); }
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-5);
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--brand-800) 60%, var(--brand-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.hero h1 .highlight {
  color: var(--brand-600);
  position: relative;
}
.hero h1 .highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-400);
  border-radius: 2px;
  opacity: 0.45;
}

.hero-desc {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--space-10);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* Hero Stats Bar */

/* ============================================================
   Section Title
   ============================================================ */
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.section-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  max-width: 600px;
  margin: 0 auto var(--space-12);
  line-height: 1.65;
}

/* ============================================================
   Features Section
   ============================================================ */
.features, .how-it-works, .faq {
  padding: var(--space-16) 0;
}

.features {
  background: white;
  position: relative;
}
.features::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-100), transparent);
}

.how-it-works {
  background: var(--bg-page);
  position: relative;
}

.faq {
  background: white;
  position: relative;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: stretch;
}

.feature-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px -2px rgba(15,23,42,0.04), 0 12px 28px -6px rgba(15,23,42,0.08);
  border-color: var(--brand-200);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto var(--space-5);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-base);
}
.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(-3deg);
}

.feature-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}
.feature-card p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.7;
}

/* ============================================================
   How It Works / Steps
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: stretch;
}

.step-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px -2px rgba(15,23,42,0.04), 0 12px 28px -6px rgba(15,23,42,0.08);
  border-color: var(--brand-200);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%);
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 50%;
  margin: 0 auto var(--space-5);
  transition: transform var(--transition-base);
  box-shadow: 0 4px 10px -2px rgba(5, 150, 105, 0.35);
}
.step-card:hover .step-number {
  transform: scale(1.1);
}

.step-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}
.step-card p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.7;
}


/* ============================================================
   Generator Layout
   ============================================================ */
.generator-section {
  padding: var(--space-4) 0 var(--space-12);
}

/* --- Ad Types inside Preview Panel --- */
.preview-ad-types {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.preview-ad-types .sidebar-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* Scroll wrapper: handles horizontal scroll, does NOT set overflow-y so buttons can translateY */
.ad-type-scroll-wrap {
  overflow-x: visible;
  padding-bottom: 8px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}

.preview-ad-types .ad-type-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: var(--space-1);
  padding: 4px 0;
}

/* --- Templates inside Preview Panel --- */


/* Scroll wrapper for templates */


/* --- Action Buttons inside Preview Panel --- */

/* --- 2-Column: Editor (left) + Preview (right) --- */
.generator-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(500px, 2fr);
  gap: var(--space-5);
  max-width: 1390px;
  margin: 0 auto;
  padding: 0 var(--space-8);
  align-items: start;
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

/* ============================================================
   Sidebar
   ============================================================ */


.sidebar-title {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-tertiary);
  font-weight: 700;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ad-type-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: var(--space-2);
}

.ad-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px var(--space-2);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}
.ad-type-btn:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  box-shadow: var(--shadow-sm);
  color: var(--brand-700);
}
.ad-type-btn.active {
  border-color: var(--brand-500);
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
  color: var(--brand-800);
  font-weight: 600;
  box-shadow: 0 2px 6px -1px rgba(5,150,105,0.18), inset 0 1px 0 rgba(255,255,255,0.5);
}
.ad-type-btn .icon { font-size: 1.3rem; }

/* Template List */
#templateList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}


/* ============================================================
   Editor Panel
   ============================================================ */
.editor-panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, box-shadow 0.25s;
  min-width: 0;
  overflow-x: hidden;
}
.editor-panel:focus-within {
  border-color: var(--brand-200);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.06), var(--shadow-md);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1.5px solid var(--border-light);
  flex-wrap: wrap;
  gap: var(--space-3);
}
.editor-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

/* Form Styles */
.form-section {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-light);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand-400);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  position: relative; /* fallback for :has() - ensures emoji picker dropdown positions correctly */
}

.form-group.toggle-row,
.form-group.toggle-row.full-width { flex-direction: row; align-items: center; }
.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--gray-50);
  transition: all 0.25s ease;
}
.form-input:hover, .form-select:hover { border-color: var(--brand-300); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  background: white;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' d='M8 10.5L3 5.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

/* ============================================================
   Emoji Picker
   ============================================================ */
.emoji-picker {
  animation: emojiSlideDown 0.2s ease-out;
}
@keyframes emojiSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.emoji-cat-btn {
  transition: all 0.18s ease;
}
.emoji-cat-btn:hover {
  background: var(--brand-100);
  border-color: var(--brand-300);
  transform: scale(1.1);
}

.emoji-item:hover {
  background: var(--brand-50);
  transform: scale(1.2);
}

/* ============================================================
   Gradient Editor
   ============================================================ */


/* ============================================================
   Font Preview
   ============================================================ */

/* ============================================================
   Color Input Group Enhancement
   ============================================================ */

input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: white;
  flex-shrink: 0;
  transition: all 0.22s ease;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
input[type="color"]:hover {
  border-color: var(--brand-300);
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(16,185,129,0.18);
}

/* ============================================================
   Link Settings Section
   ============================================================ */

/* ============================================================
   btn-xs extra small button
   ============================================================ */

/* Ad Size Preset Buttons */
.ad-size-device-btn {
  transition: all 0.2s ease;
}
.ad-size-device-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  transform: translateY(-1px);
}
.ad-size-device-btn.active {
  background: var(--brand-50);
  border-color: var(--brand-400);
  color: var(--brand-700);
  font-weight: 600;
}


/* Range */
input[type="range"] {
  flex: 1;
  accent-color: var(--brand-500);
  height: 5px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  user-select: none;
}
.toggle-switch {
  position: relative;
  width: 42px;
  height: 23px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}
.toggle-switch.active {
  background: var(--brand-500);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.toggle-switch.active::after {
  left: 21px;
  transform: scale(1.05);
}

/* ============================================================
   Preview Panel
   ============================================================ */
.preview-panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow-x: hidden;
}
.preview-panel:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
}

.preview-inner { padding: var(--space-5); }

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}
.preview-toolbar h2, .preview-toolbar h3 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.preview-toolbar h2::before, .preview-toolbar h3::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(16,185,129,0.4);
  animation: pulse-dot 2s ease-in-out infinite;
}

.device-buttons {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  padding: 3px;
  border-radius: var(--radius-sm);
}
.device-btn {
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.device-btn:hover { color: var(--brand-600); }
.device-btn.active {
  background: white;
  color: var(--brand-600);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

.preview-frame {
  background: var(--gray-50);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  position: relative;
}
.preview-frame:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
}
.preview-frame.desktop {
  max-width: 100%;
  min-height: 0;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  display: block;
}
/* .preview-frame.desktop::before 装饰条在第 2015 行"界面美化增强"章节定义 */
.preview-frame.tablet {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 18px;
  padding: 24px 18px;
  border: 3px solid var(--gray-700);
  background: var(--white);
  box-shadow: 0 0 0 2px var(--gray-800), 0 8px 32px rgba(0,0,0,0.12);
  min-height: 0;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}
.preview-frame.tablet::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
  z-index: 1;
}
.preview-frame.mobile {
  max-width: 375px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 28px;
  padding: 36px 10px 24px;
  border: 3px solid var(--gray-700);
  background: var(--white);
  box-shadow: 0 0 0 2px var(--gray-800), 0 12px 40px rgba(0,0,0,0.15);
  min-height: 0;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Code Panel */


/* Demo ad slot (image ad placeholder) — match code panel width */
.demo-ad-slot {
  width: 100%;
  margin: 0 0 var(--space-4) 0;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.demo-ad-link {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.demo-ad-link img {
  width: 100%;
  height: auto;
  display: block;
}

.code-panel {
  background: var(--gray-900);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.06);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.code-tabs { display: flex; gap: 2px; }

.code-tab {
  padding: 4px 13px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-mono);
}
.code-tab:hover { color: var(--gray-300); background: rgba(255,255,255,0.05); }
.code-tab.active {
  background: rgba(16,185,129,0.18);
  color: var(--brand-200);
  box-shadow: var(--shadow-xs);
}

.code-actions { display: flex; gap: var(--space-2); }

.code-body {
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.85;
  color: var(--gray-200);
  overflow-x: auto;
  max-height: 280px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.32) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s, transform 0s;
  pointer-events: none;
}
.btn:active::before {
  opacity: 1;
  transform: scale(2.5);
  transition: opacity 0s, transform 0.5s cubic-bezier(0,0,0.2,1);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
  color: white;
  border: 1px solid rgba(4, 120, 87, 0.4);
  box-shadow:
    0 1px 2px rgba(5, 150, 105, 0.18),
    0 4px 10px -2px rgba(5, 150, 105, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-800) 100%);
  color: white;
  box-shadow:
    0 2px 4px rgba(5, 150, 105, 0.25),
    0 8px 18px -4px rgba(5, 150, 105, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:active {
  background: var(--brand-800);
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.15);
}


.btn-outline {
  background: white;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
  background: var(--brand-50);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}


.btn-sm { padding: 6px 14px; font-size: var(--font-size-xs); }
.btn-lg { padding: 13px 30px; font-size: var(--font-size-base); border-radius: var(--radius-md); }
.btn-group { display: flex; gap: var(--space-2); flex-wrap: wrap; }
/* 编辑器头部按钮组：紧凑布局，空间不足时自动换行（适配英文模式长文本） */
.editor-header .btn-group { flex-wrap: wrap; gap: 4px; }
.editor-header .btn-group .btn-sm { padding: 5px 8px; font-size: 0.72rem; white-space: nowrap; }
.editor-header .btn-group .btn-sm svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Ad type badge */

/* ============================================================
   Toast
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  background: var(--gray-900);
  color: white;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(0,0,0,0.12);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transform: translateX(120%) scale(0.9);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid rgba(255,255,255,0.08);
  pointer-events: all;
  max-width: 340px;
}
.toast.show { transform: translateX(0) scale(1); opacity: 1; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--info); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
}
.modal-overlay.open { pointer-events: auto; opacity: 1; visibility: visible; }
.modal-overlay.ad-preview .modal {
  max-width: 92vw;
  width: auto;
  min-width: 320px;
  padding: 48px;
  overflow: hidden;
  scrollbar-width: none;
}
.modal-overlay.ad-preview .modal::-webkit-scrollbar { display: none; }

.modal {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: var(--space-8);
  max-width: 520px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-6); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: var(--space-16) 0 var(--space-8);
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--brand-700);
  opacity: 0.5;
}

.footer-inner {
  max-width: 1390px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-brand {
  font-size: var(--font-size-xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  color: var(--brand-300);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.footer-desc {
  font-size: var(--font-size-sm);
  line-height: 1.75;
  color: var(--gray-400);
  margin-bottom: var(--space-5);
}

.footer-contact {
  font-size: var(--font-size-sm);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.footer-contact a {
  color: var(--brand-400);
  transition: color 0.2s;
}
.footer-contact a:hover { color: var(--brand-300); }

.footer h4 {
  color: var(--gray-300);
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: var(--space-5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: var(--space-3);
}
.footer h4::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 22px;
  height: 2px;
  background: var(--brand-500);
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: var(--gray-400);
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.22s ease;
}
.footer-links a::before {
  content: '›';
  color: var(--brand-500);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.22s ease;
  font-weight: 700;
}
.footer-links a:hover {
  color: var(--gray-200);
  transform: translateX(4px);
}
.footer-links a:hover::before { opacity: 1; transform: translateX(0); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--gray-400);
}

/* ============================================================
   Utility Classes
   ============================================================ */
.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;
}
.hidden  { display: none !important; }

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--brand-600);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: var(--z-tooltip);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}
/* .skip-link:focus 完整定义见 style-enhancement.css 第 1438 行（避免 top 值冲突） */

/* ============================================================
   Entry Animations
   ============================================================ */


/* ============================================================
   Cookie Notice
   ============================================================ */

/* ============================================================
   Print
   ============================================================ */
@media print {
  body { background: white; color: black; }
  .header, .breadcrumb, .footer, .nav-links, .menu-toggle,
  .btn, .faq-question, .lang-switch, .help-sidebar,
  .demo-ad-slot, .text-ads-row, .hero-actions,
  .scroll-top-btn, .modal-overlay, .security-warning,
  #floatingFeedback, .ad-type-selector, .preview-toolbar,
  .editor-panel, .code-panel, .preview-ad-types, .preview-size-note,
  .btn-group, .device-buttons, .ad-type-grid, .ad-type-scroll-wrap,
  .code-tabs, .code-actions, .preview-inner .code-panel,
  .faq-categories, .faq-search-wrap, .faq-more {
    display: none !important;
  }
  .container, .header-inner { max-width: 100% !important; padding: 0 !important; }
  main { padding: 0 !important; }
  a { color: black; text-decoration: underline; }
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #555;
  }
  a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; }
  h1, h2, h3 { page-break-after: avoid; }
  .feature-card, .team-value-card, .faq-item, .help-section {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  /* Expand faq answers for print */
  .faq-answer { max-height: none !important; overflow: visible !important; }
  .faq-item { border: 1px solid #ccc !important; margin-bottom: 8px !important; }
}

/* ============================================================
   Responsive - 1390px
   ============================================================ */
@media (max-width: 1390px) {
  .generator-layout {
    grid-template-columns: minmax(260px, 1fr) minmax(400px, 1.5fr);
    gap: var(--space-4);
  }
}

/* ============================================================
   Responsive - 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .container { padding: 0 var(--space-6); }
  .header-inner { padding: 0 var(--space-6); }

  .generator-layout {
    grid-template-columns: 1fr;
    padding: 0 var(--space-4);
    max-width: 100%;
  }
  .preview-ad-types .ad-type-grid { gap: var(--space-1); }

  .ad-type-grid { grid-template-columns: repeat(6, 1fr); }
  #templateList { grid-template-columns: repeat(3, 1fr); }

  .preview-panel {
    position: static;
    max-height: none;
  }
  .editor-panel { max-height: none; }

  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Responsive - 768px
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .container { padding: 0 var(--space-4); }
  .header-inner { padding: 0 var(--space-4); }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4);
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
    gap: 4px;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links .nav-link {
    padding: 12px 16px;
    min-height: 44px;
    font-size: var(--font-size-base);
    border-radius: var(--radius-md);
  }
  /* WCAG 2.5.5: Touch targets ≥ 44×44px on mobile */
  .lang-switch { min-height: 44px; padding: 6px; }
  .lang-switch span { padding: 10px 16px; min-height: 32px; display: inline-flex; align-items: center; }
  .device-btn { padding: 10px 14px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .code-tab { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; }
  .faq-question { min-height: 44px; }
  .menu-toggle { display: flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .btn, .btn-sm, .btn-page-preview { min-height: 44px; min-width: 44px; }
  /* iOS: prevent auto-zoom on input focus (font-size must be ≥16px) */
  .form-input, .form-select, .form-textarea, .form-label { font-size: 16px; }
  .emoji-cat-btn { min-height: 44px; }
  .ad-type-btn { min-height: 44px; }

  .hero::after { display: none; }
  .hero h1 { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .hero-desc { font-size: var(--font-size-base); }

  .ad-type-grid { grid-template-columns: repeat(4, 1fr); }
  #templateList { grid-template-columns: repeat(3, 1fr); }

  .features-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .feature-card { padding: var(--space-6); }
  .feature-card:hover { transform: translateY(-3px); }
  .steps-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .faq-list .faq-item { padding: var(--space-4) var(--space-5); }

  .footer-inner { padding: 0 var(--space-4); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-bottom { flex-direction: column; text-align: center; }

  .section-title p { font-size: var(--font-size-base); }

  .page-content { padding: var(--space-8) var(--space-4); }
  .toast-container { right: var(--space-4); bottom: var(--space-4); left: var(--space-4); }
  .toast { max-width: 100%; }

  .preview-frame.desktop::before { display: none; }
  .preview-frame.desktop {
    border-radius: 8px;
    padding: 12px;
    min-height: 150px;
    border: 1px solid var(--border-color);
    box-shadow: none;
    background: var(--gray-50);
  }
  .preview-frame.tablet {
    max-width: 100%;
    border-radius: 12px;
    padding: 16px 12px;
    min-height: 300px;
    border: 2px dashed var(--gray-300);
    box-shadow: none;
    background: var(--gray-50);
  }
  .preview-frame.tablet::before,
  .preview-frame.tablet::after { display: none; }
  .preview-frame.mobile {
    max-width: 100%;
    border-radius: 12px;
    padding: 16px 12px;
    min-height: 300px;
    border: 2px dashed var(--gray-300);
    box-shadow: none;
    background: var(--gray-50);
  }
  .preview-frame.mobile::before { display: none; }

  .form-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; justify-content: center; }
  /* 编辑器头部按钮组保持单行，避免按钮换行 */
  .editor-header .btn-group { flex-direction: row; flex-wrap: nowrap; }
  .editor-header .btn-group .btn { width: auto; justify-content: center; flex: 1; }
}

/* ============================================================
   Responsive - 480px
   ============================================================ */
@media (max-width: 480px) {
  .ad-type-grid { grid-template-columns: repeat(3, 1fr); }
  #templateList { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; }
  .device-buttons { width: 100%; justify-content: center; }
  .code-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Generator Page Enhancements
   ============================================================ */

/* Code panel scrollbar styling */
.code-body::-webkit-scrollbar { width: 6px; height: 6px; }
.code-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
.code-body::-webkit-scrollbar-thumb {
  background: rgba(16,185,129,0.3);
  border-radius: 3px;
}
.code-body::-webkit-scrollbar-thumb:hover { background: rgba(16,185,129,0.5); }

/* Editor panel scrollbar */
.editor-panel::-webkit-scrollbar { width: 6px; }
.editor-panel::-webkit-scrollbar-track { background: transparent; }
.editor-panel::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 3px;
}
.editor-panel::-webkit-scrollbar-thumb:hover { background: var(--brand-300); }

/* Form section smooth expand */
.form-section {
  animation: fadeInUp 0.3s ease-out;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ad type buttons hover micro-interaction */
.ad-type-btn {
  position: relative;
}
.ad-type-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.ad-type-btn:hover::after { opacity: 1; }

/* preview-frame transition 已在基础定义中设置，此处不再重复 */

/* Button focus accessibility — 见第 2263 行"Focus 可见性增强"章节（更完整定义） */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   界面美化增强 - 2026-07-05
   Modern SaaS Style Enhancement
   ============================================================ */

/* === 1. 增强卡片样式 === */
.editor-panel,
.preview-panel {
  border-radius: var(--radius-xl);
  box-shadow: 
    0 1px 3px rgba(0,0,0,0.04),
    0 4px 12px rgba(0,0,0,0.03),
    0 12px 24px rgba(0,0,0,0.02);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.editor-panel:hover,
.preview-panel:hover {
  box-shadow: 
    0 2px 8px rgba(16,185,129,0.08),
    0 8px 24px rgba(0,0,0,0.06),
    0 24px 48px rgba(0,0,0,0.04);
  transform: translateY(-2px);
}

/* === 2. 表单区块美化 === */
.form-section {
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.form-section:hover {
  border-color: rgba(16,185,129,0.15);
  box-shadow: 0 4px 12px rgba(16,185,129,0.04);
}

.form-section-title {
  background: var(--brand-50);
  border-left: 4px solid var(--brand-500);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 700;
  color: var(--brand-700);
  letter-spacing: 0.01em;
}

/* === 3. 输入框增强 === */
.form-input,
.form-select,
.form-textarea {
  border-radius: var(--radius-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--brand-300);
  box-shadow: 0 2px 8px rgba(16,185,129,0.06);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 
    0 0 0 3px rgba(16,185,129,0.12),
    0 4px 12px rgba(16,185,129,0.08);
  background: white;
}

/* === 4. 广告类型按钮增强 === */
.ad-type-btn {
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}

.ad-type-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand-400);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ad-type-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 8px 20px rgba(16,185,129,0.15),
    0 0 0 3px rgba(16,185,129,0.1);
  border-color: var(--brand-400);
}

.ad-type-btn:hover .icon {
  transform: scale(1.15);
  transition: transform 0.3s ease;
}

.ad-type-btn.active {
  background: var(--brand-100);
  border-color: var(--brand-500);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.8);
}

.ad-type-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: var(--brand-500);
  border-radius: 2px 2px 0 0;
}

/* === 5. 按钮美化 === */
/* .btn-primary visual styles are defined in style-enhancement.css to avoid conflicts */

.btn-outline {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline:hover {
  background: var(--brand-50);
  border-color: var(--brand-400);
  color: var(--brand-700);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16,185,129,0.12);
}


/* === 6. 设备按钮增强 === */
.device-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-sm);
}

.device-btn:hover {
  background: rgba(16,185,129,0.08);
  color: var(--brand-600);
}

.device-btn.active {
  background: white;
  color: var(--brand-600);
  box-shadow: 
    0 2px 8px rgba(0,0,0,0.08),
    0 0 0 1px var(--brand-200);
  font-weight: 600;
}

/* === 7. 预览框架增强 === */
.preview-frame {
  border-radius: var(--radius-lg);
}

.preview-frame:hover {
  border-color: var(--brand-300);
  box-shadow: 
    0 8px 24px rgba(16,185,129,0.08),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

/* 桌面预览 - 增强显示器效果 */
.preview-frame.desktop {
  position: relative;
  background: white;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.preview-frame.desktop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-400);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0.6;
}

/* 平板预览 - 增强设备框架 */
.preview-frame.tablet {
  background: linear-gradient(180deg, var(--gray-800) 0%, var(--gray-900) 100%);
  border: 4px solid var(--gray-700);
  box-shadow: 
    0 0 0 1px var(--gray-800),
    0 12px 40px rgba(0,0,0,0.2),
    inset 0 0 20px rgba(0,0,0,0.1);
}

.preview-frame.tablet::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--gray-600);
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

/* 手机预览 - 增强刘海屏效果 */
.preview-frame.mobile {
  background: linear-gradient(180deg, var(--gray-800) 0%, var(--gray-900) 100%);
  border: 4px solid var(--gray-700);
  box-shadow: 
    0 0 0 1px var(--gray-800),
    0 16px 48px rgba(0,0,0,0.25),
    inset 0 0 30px rgba(0,0,0,0.15);
}

.preview-frame.mobile::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 6px;
  background: var(--gray-800);
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

/* === 8. 代码面板增强 === */

/* .form-group 已在基础样式中设置 position: relative，:has() 选择器不再需要 */

/* Emoji picker z-index override */
.emoji-picker-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  z-index: 9999 !important;
  background: white !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
  min-width: 280px;
  max-width: 360px;
  max-height: 280px;
  overflow-y: auto;
  padding: var(--space-2);
  margin: 0 !important;
}
.code-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 
    0 4px 16px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.code-header {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.code-tab {
  border-radius: var(--radius-xs);
  transition: all 0.25s ease;
}

.code-tab:hover {
  background: rgba(16,185,129,0.12);
  color: var(--brand-200);
}

.code-tab.active {
  background: rgba(16,185,129,0.18);
  color: var(--brand-300);
  box-shadow: 0 1px 4px rgba(16,185,129,0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* 代码语法高亮模拟 */
.code-body {
  background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-900) 100%);
  line-height: 1.9;
  letter-spacing: 0.01em;
}

/* === 9. Toast 通知增强 === */
.toast {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.05);
}

.toast.success {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
  border-left: 4px solid var(--brand-500);
}

.toast.error {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-600) 100%);
  border-left: 4px solid var(--danger-300);
}

/* toast 动画统一在 style-enhancement.css 中定义，避免重复 */

/* === 10. 模态框增强 === */
/* (modal 动画与 modalBounceIn 已在 style-enhancement.css 第 1300-1307 行定义，此处删除重复) */

/* === 11. Toggle 开关增强 === */
.toggle-switch {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-switch.active {
  background: var(--brand-500);
}

.toggle-switch::after {
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.2),
    0 0 0 1px rgba(0,0,0,0.05);
}

.toggle-switch.active::after {
  box-shadow: 
    0 2px 8px rgba(0,0,0,0.2),
    0 0 12px rgba(255,255,255,0.3);
}

/* === 12. 颜色选择器增强 === */
input[type="color"] {
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

input[type="color"]:hover {
  transform: scale(1.1);
  box-shadow: 
    0 4px 12px rgba(16,185,129,0.25),
    0 0 0 3px rgba(16,185,129,0.1);
}

/* === 13. 复制按钮动画 === */


/* === 14. 编辑器头部增强 === */
.editor-header {
  border-bottom: 2px solid var(--brand-100);
  padding-bottom: var(--space-5);
}

/* === 15. 渐变预设按钮增强 === */


/* === 16. Emoji 选择器增强 === */
.emoji-item {
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.emoji-item:hover {
  transform: scale(1.25);
  background: var(--brand-100);
}

.emoji-cat-btn {
  border-radius: var(--radius-full);
  transition: all 0.25s ease;
}

.emoji-cat-btn:hover {
  transform: scale(1.05);
  background: var(--brand-100);
}

/* === 17. 滚动条美化 === */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-300), var(--brand-400));
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--brand-400), var(--brand-500));
}

/* === 18. 响应式增强 === */
@media (max-width: 768px) {
  .form-section {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }
  
  .form-section-title {
    padding: 8px 12px;
    font-size: var(--font-size-sm);
  }
  
  .ad-type-btn {
    padding: 8px 6px;
  }
  
  .ad-type-btn .icon {
    font-size: 1.1rem;
  }
  
  .btn {
    padding: 8px 16px;
  }
}

/* === 19. 加载动画 === */
/* === 20. Focus 可见性增强 === */
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.ad-type-btn:focus-visible,
.device-btn:focus-visible,
.code-tab:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
}

/* === 21. 页面辅助类 === */
.text-secondary { color: var(--text-secondary); }
.feature-list { list-style: none; padding: 0; margin: 16px 0; }
.feature-list li { padding: 8px 0; color: var(--text-secondary); line-height: 1.7; }
.feature-list li::before { content: '✓ '; color: var(--brand-500); font-weight: 700; }

.about-cta, .help-cta {
  text-align: center;
  padding: 48px var(--space-8);
  margin-top: var(--space-16);
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-50) 50%, var(--brand-100) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--brand-100);
}
.about-cta h3, .help-cta h3 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}
.about-cta p, .help-cta p {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.about-features h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin: var(--space-4) 0 var(--space-6);
}

/* === 22. 导航栏滚动阴影 === */

/* === 23. 面包屑增强 === */
.breadcrumb {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 0;
  font-size: 13px;
  margin-bottom: 8px;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  line-height: 1.5;
  list-style: none !important;
  list-style-type: none !important;
}

.breadcrumb li::before {
  content: none !important;
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin: 0 8px;
  color: var(--gray-400);
  font-size: 13px;
  font-weight: 400;
  user-select: none;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.breadcrumb a::before {
  content: '⌂';
  font-size: 14px;
  opacity: 0;
  width: 0;
  transition: all 0.2s ease;
  overflow: hidden;
}

.breadcrumb li:first-child a::before {
  opacity: 0.7;
  width: auto;
}

.breadcrumb a:hover {
  color: var(--brand-600);
  background: rgba(16, 185, 129, 0.1);
}

.breadcrumb li[aria-current="page"] span {
  color: var(--brand-700);
  font-weight: 600;
  padding: 5px 10px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* 响应式：小屏下面包屑紧凑显示 */
@media (max-width: 640px) {
  .breadcrumb {
    padding: 10px 0;
    font-size: 12px;
  }
  .breadcrumb ol {
    gap: 2px;
  }
  .breadcrumb li:not(:last-child)::after {
    margin: 0 4px;
  }
  .breadcrumb a,
  .breadcrumb li[aria-current="page"] span {
    padding: 4px 6px;
  }
}

/* === 24. 帮助页侧边栏增强 === */
.help-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
}
.help-sidebar a.active {
  background: var(--brand-50);
  color: var(--brand-600);
  font-weight: 600;
}

/* ============================================================
   Section 33: Refined Page Styles
   ============================================================ */

/* (breadcrumb redesigned in Section 23) */

/* Page Hero Minimal Design */
.page-hero {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(20, 184, 166, 0.05) 0%, transparent 50%),
    var(--bg-card);
  padding: 64px 0 44px;
  text-align: center;
  border-bottom: 1px solid var(--brand-100);
  position: relative;
  overflow: hidden;
}

.page-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.625rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.025em;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--brand-800) 60%, var(--brand-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-hero-desc {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Section Styling */
.section {
  padding: 50px 0;
  background: var(--bg-card);
}

.section:nth-child(even) {
  background: var(--gray-50);
}

/* About Page Specific */
.about-intro {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.about-intro h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.about-intro .lead {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-intro p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Feature Grid Layout (about/help pages) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

/* 3列布局（≥901px）：最后一张卡片单独成行时居中显示在第2列 */
@media (min-width: 901px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .feature-grid > .feature-card:last-child:nth-child(3n+1) {
    grid-column: 2;
  }
}

/* 2列布局（769px-900px）：最后一张卡片单独成行时居中跨整行 */
@media (min-width: 769px) and (max-width: 900px) {
  .feature-grid > .feature-card:last-child:nth-child(2n+1) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 12px);
  }
}


/* Feature card in about/help pages inherits main .feature-card styles */
.feature-grid .feature-card {
  padding: 32px 24px;
}
.feature-grid .feature-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.feature-grid .feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
  .feature-grid .feature-card .feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--brand-50);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4); }
  .feature-grid .feature-card h3 { font-size: 18px;
  margin-bottom: 8px; }
  .feature-grid .feature-card p { font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary); }


/* Stats Bar */


/* Team Section */
.about-team {
  max-width: 960px;
  margin: var(--space-12) auto 0;
  padding: 0 24px;
  text-align: center;
}

.about-team h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.about-team .lead {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 680px;
  margin: 0 auto 40px;
}

.team-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

.team-value-card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.25s ease;
}

.team-value-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-400);
}

.team-value-icon {
  font-size: 36px;
  margin-bottom: 16px;
  line-height: 1;
}

.team-value-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.team-value-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.team-cta {
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  margin-top: 20px;
}

.team-cta-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.team-cta .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}


.team-cta .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .team-values {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Contact Page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-10);
  align-items: start;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: var(--space-8) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.contact-card:hover {
  border-color: var(--brand-200);
  box-shadow: 0 4px 12px -2px rgba(15,23,42,0.06), 0 8px 20px -6px rgba(15,23,42,0.08);
  transform: translateY(-2px);
}

.contact-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.contact-card h2, .contact-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.contact-card p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.contact-card .btn {
  width: 100%;
  padding: 10px 20px;
  font-size: 14px;
}

.contact-info-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: var(--space-8) var(--space-6);
}

.contact-info-panel h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.contact-reasons {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-reasons li {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
}

.contact-reasons li:last-child {
  border-bottom: none;
}

.reason-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.contact-reasons strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.contact-reasons p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

/* FAQ Page */
.faq-search {
  max-width: 560px;
  margin: 0 auto 40px;
  display: flex;
  gap: 12px;
}

.faq-search input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg-card);
}

.faq-search input:focus {
  outline: none;
  border-color: var(--brand-500);
}

.faq-search button {
  padding: 14px 24px;
  background: var(--gray-800);
  color: var(--text-inverse);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.faq-categories {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-10);
}

.faq-cat-btn {
  padding: 8px 20px;
  border: 1px solid var(--gray-200);
  background: var(--bg-card);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.faq-cat-btn:hover,
.faq-cat-btn.active {
  background: var(--gray-800);
  color: var(--text-inverse);
  border-color: var(--gray-800);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

.faq-item:hover {
  border-color: var(--brand-200);
  box-shadow: 0 4px 12px -2px rgba(15,23,42,0.06), 0 2px 4px -1px rgba(15,23,42,0.04);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.faq-question:hover {
  background: var(--gray-50);
}

.faq-icon {
  font-size: 20px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
  color: var(--brand-600);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-question[aria-expanded="true"] + .faq-answer,
.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-list .faq-item h3 {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

.faq-answer p {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.faq-more {
  text-align: center;
  margin-top: var(--space-12);
  padding: var(--space-10);
  background: var(--gray-50);
  border-radius: 16px;
}

.faq-more h2, .faq-more h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.faq-more p {
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

/* Help Page */
.help-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-10);
}

/* (help-sidebar redesigned in Section 24) */

.help-section {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--gray-200);
}

.help-section:last-of-type {
  border-bottom: none;
}

.help-section h2 {
  font-size: clamp(1.375rem, 2.8vw, 1.75rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-8);
}




.step {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
  padding-bottom: var(--space-2);
}
  .step-content { flex: 1;
  min-width: 0; }

.step-number {
  width: 44px;
  height: 44px;
  background: var(--gray-800);
  color: var(--text-inverse);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.step-content p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 14px;
}

/* Help page ad-type cards grid — uses separate class prefix */
.help-ad-type-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.help-ad-type-grid .ad-type-card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.help-ad-type-grid .ad-type-card:hover {
  border-color: var(--brand-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.help-ad-type-grid .ad-type-icon { font-size: 32px; margin-bottom: 12px; }
.help-ad-type-grid .ad-type-card h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.help-ad-type-grid .ad-type-card p { font-size: 12px; color: var(--text-tertiary); margin: 0; }

/* Legal Pages */
.page-content {
  max-width: 720px;
  margin: 0 auto;
}

.last-updated {
  display: inline-block;
  padding: 8px 16px;
  background: var(--gray-100);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-8);
}

.legal-section {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--gray-200);
}

.legal-section:last-child {
  border-bottom: none;
}

.legal-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.legal-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal-section ul {
  margin: 16px 0;
  padding-left: 24px;
}

.legal-section li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.legal-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-cards {
    grid-template-columns: 1fr;
  }
  
  .help-layout {
    grid-template-columns: 1fr;
  }
  
  .help-sidebar {
    position: static;
  }
  
  .help-ad-type-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .page-hero-title {
    font-size: 32px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  
  
  .help-ad-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Preview overflow fix: constrain ad content widths within mobile/tablet frames */
.preview-frame.mobile #adPreview > * {
  max-width: 100% !important;
  overflow-x: hidden;
}
.preview-frame.tablet #adPreview > * {
  max-width: 100% !important;
}
.preview-frame.mobile #adPreview table {
  max-width: 100% !important;
  table-layout: fixed;
  word-break: break-word;
}
.preview-frame.tablet #adPreview table {
  max-width: 100% !important;
}
/* Fix comparison table border-radius: overflow:hidden on container clips the table corners */
#adComparison {
  overflow: hidden !important;
}



/* Preview area: match code panel width */
.preview-content {
  width: 100%;
}

.preview-content #adPreview {
  width: 100%;
}

.preview-content #adPreview > * {
  max-width: 100% !important;
  width: 100%;
}

/* SideFloat 面板展开时需要溢出可见，避免被 preview-frame 裁剪 */
.preview-content #adPreview .sf-panel {
  max-width: none !important;
  width: auto !important;
}

/* Emoji picker position fix for simple text ad */
.emoji-picker-wrapper {
  position: relative;
}

.emoji-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  max-height: 280px;
  overflow-y: auto;
}
/* ============================================================
   文字广告位样式 - Text Ads Row (彩色卡片版)
   ============================================================ */
.text-ads-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  width: 100%;
  flex-basis: 100%;
  box-sizing: border-box;
}

.text-ad-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  height: 56px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.text-ad-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* 橙色 - 广告位1 */
.ad-color-1 {
  background: linear-gradient(135deg, var(--accent-600) 0%, var(--warning) 100%);
}
.ad-color-1:hover {
  background: linear-gradient(135deg, var(--warning) 0%, var(--accent-400) 100%);
}

/* 青色 - 广告位2 */
.ad-color-2 {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}
.ad-color-2:hover {
  background: linear-gradient(135deg, #14b8a6 0%, #2dd4bf 100%);
}

/* 粉色 - 广告位3 */
.ad-color-3 {
  background: linear-gradient(135deg, #be123c 0%, #e11d48 100%);
}
.ad-color-3:hover {
  background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%);
}

/* 蓝色 - 广告位4 */
.ad-color-4 {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}
.ad-color-4:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.text-ad-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.2px;
}

/* 响应式：平板显示2列 */
@media (max-width: 1024px) {
  .text-ads-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 16px;
  }

  .text-ad-item {
    padding: 14px 12px;
    height: 56px;
  }
}

/* 响应式：手机显示1列 */
@media (max-width: 640px) {
  .text-ads-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .text-ad-item {
    padding: 12px 16px;
    height: 50px;
  }

  .text-ad-title {
    font-size: 12px;
  }
}

/* ============================================================
   Responsive - Mobile Landscape (height ≤ 500px)
   优化横屏短高度场景：减小header、hero、modal 占用的垂直空间
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --header-height: 50px;
  }
  .header { padding: 0; }
  .logo-img { height: 28px; }
  .logo-subtitle { display: none; }
  .menu-toggle svg { width: 18px; height: 18px; }

  .hero {
    padding: 1.5rem 0 1.25rem;
  }
  .hero h1 { font-size: clamp(1.4rem, 4vw, 1.8rem); margin-bottom: 0.5rem; }
  .hero-desc { font-size: var(--font-size-base); margin-bottom: 1rem; }
  .hero-badge { margin-bottom: 0.5rem; padding: 4px 12px; }

  .features, .how-it-works, .faq { padding: 1.5rem 0; }

  /* Generator page: 紧凑布局 */
  .generator-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
  .editor-panel { max-height: calc(100vh - var(--header-height) - 80px); }
  .preview-frame { min-height: 200px; }

  /* Modal: 适配短高度 */
  .modal-overlay { padding: 10px; }
  .modal { max-height: 90vh; }
  .modal-header { padding: 10px 16px; }
  .modal-body { padding: 12px 16px; }

  /* Footer 紧凑 */
  .footer { padding: 1rem 0; }
  .footer-grid { gap: var(--space-4); }
  .footer-bottom { margin-top: var(--space-3); padding-top: var(--space-3); }
}

/* ============================================================
   触摸设备 hover 隔离：防止点击后 hover 状态"粘住"
   仅在支持 hover 的设备上启用装饰性 hover 效果
   ============================================================ */
@media (hover: none) {
  .feature-card:hover,
  .btn:hover,
  .btn-primary:hover,
  .btn-outline:hover,
  .btn-ghost:hover,
  .ad-type-btn:hover,
  .nav-link:hover,
  .faq-item:hover,
  .contact-card:hover,
  .team-value-card:hover,
  .lang-switch:hover,
  .editor-panel:hover,
  .preview-panel:hover,
  .code-tab:hover,
  .device-btn:hover,
  .form-input:hover,
  .form-select:hover,
  .form-textarea:hover,
  .emoji-cat-btn:hover,
  .emoji-item:hover,
  .demo-ad-link:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--border-color) !important;
    background: var(--bg-card) !important;
  }
  /* 保留 :active 作为触摸反馈 */
  .btn:active, .ad-type-btn:active, .nav-link:active {
    transform: scale(0.98);
    opacity: 0.85;
  }
}
