/* ============================================================
   Echo SaaS — 统一样式
   浅色主题 · 蓝色强调 #2563EB · 科技感
   ============================================================ */

:root {
  --blue: #2563EB;
  --blue-light: #3B82F6;
  --blue-dark: #1D4ED8;
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --green: #10B981;
  --red: #EF4444;
  --yellow: #F59E0B;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.1);
  --transition: .2s ease;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--gray-800);
  background: #fff;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; border: none; cursor: pointer; transition: all var(--transition);
  line-height: 1.4;
}
.btn-primary {
  background: var(--blue); color: #fff;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-secondary {
  background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 36px; font-size: 17px; border-radius: var(--radius); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; margin-bottom: 6px; font-size: 14px;
  font-weight: 600; color: var(--gray-700);
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); font-size: 15px; transition: border var(--transition);
  background: #fff; color: var(--gray-800);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* --- Card --- */
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card-header { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--gray-900); }

/* --- Badge --- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-pending { background: var(--gray-100); color: var(--gray-600); }
.badge-processing { background: var(--blue-50); color: var(--blue); }
.badge-done { background: #D1FAE5; color: #065F46; }
.badge-failed { background: #FEE2E2; color: #991B1B; }

/* --- Table --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; background: var(--gray-50); color: var(--gray-500); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--gray-200); }
td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
tr:hover td { background: var(--gray-50); }

/* --- Toast --- */
.toast {
  position: fixed; top: 24px; right: 24px; z-index: 9999;
  padding: 14px 24px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: #fff;
  transform: translateX(120%); transition: transform .3s ease;
  max-width: 400px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

/* --- Upload Zone --- */
.upload-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--gray-50);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--blue); background: var(--blue-50);
}
.upload-zone-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone-text { color: var(--gray-500); font-size: 15px; }
.upload-zone-hint { color: var(--gray-400); font-size: 13px; margin-top: 4px; }

/* --- Progress --- */
.progress-bar { width: 100%; height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width .3s; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.landing-nav-logo {
  font-size: 20px; font-weight: 800; color: var(--gray-900);
  letter-spacing: -.5px;
}
.landing-nav-logo span { color: var(--blue); }
.landing-nav-actions { display: flex; gap: 12px; align-items: center; }

.landing-hero {
  padding: 140px 24px 80px;
  text-align: center; max-width: 800px; margin: 0 auto;
}
.landing-badge {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: var(--blue-50); color: var(--blue); font-size: 14px;
  font-weight: 600; margin-bottom: 24px;
}
.landing-hero h1 {
  font-size: clamp(32px, 5vw, 56px); font-weight: 900;
  line-height: 1.15; color: var(--gray-900); margin-bottom: 20px;
  letter-spacing: -1px;
}
.landing-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--blue), #7C3AED);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-hero p {
  font-size: clamp(16px, 2.5vw, 20px); color: var(--gray-500);
  max-width: 560px; margin: 0 auto 36px; line-height: 1.7;
}
.landing-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.landing-section {
  padding: 80px 24px; max-width: 1100px; margin: 0 auto;
}
.landing-section-title {
  text-align: center; font-size: 32px; font-weight: 800;
  color: var(--gray-900); margin-bottom: 12px; letter-spacing: -.5px;
}
.landing-section-sub {
  text-align: center; color: var(--gray-500); font-size: 17px;
  margin-bottom: 48px; max-width: 520px; margin-left: auto; margin-right: auto;
}

/* Features grid */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 32px; border-radius: var(--radius); border: 1px solid var(--gray-200);
  transition: all var(--transition);
}
.feature-card:hover { border-color: var(--blue-100); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature-icon { font-size: 36px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--gray-900); }
.feature-card p { color: var(--gray-500); font-size: 14px; line-height: 1.7; }

/* Samples */
.samples-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.sample-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-200); transition: all var(--transition); }
.sample-card:hover { box-shadow: var(--shadow-xl); transform: translateY(-4px); }
.sample-card img { width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover; }
.sample-card-label {
  padding: 16px; text-align: center; font-weight: 600; color: var(--gray-700);
  background: var(--gray-50);
}

/* Pricing */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 960px; margin: 0 auto;
}
.pricing-card {
  padding: 36px; border-radius: var(--radius); border: 1px solid var(--gray-200);
  text-align: center; position: relative; transition: all var(--transition);
}
.pricing-card.featured { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.pricing-card.featured::before {
  content: '当前方案'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--blue); color: #fff; padding: 4px 16px; border-radius: 12px;
  font-size: 12px; font-weight: 700;
}
.pricing-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--gray-900); }
.pricing-price { font-size: 40px; font-weight: 900; color: var(--gray-900); margin-bottom: 4px; }
.pricing-price span { font-size: 16px; font-weight: 400; color: var(--gray-400); }
.pricing-desc { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 28px; }
.pricing-features li { padding: 8px 0; font-size: 14px; color: var(--gray-600); display: flex; align-items: center; gap: 8px; }
.pricing-features li::before { content: '✓'; color: var(--green); font-weight: 700; }

/* Footer */
.landing-footer {
  text-align: center; padding: 40px 24px; border-top: 1px solid var(--gray-100);
  color: var(--gray-400); font-size: 13px;
}

/* ============================================================
   APP LAYOUT (login / register / dashboard / brand / admin)
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 240px; background: var(--gray-900); color: #fff;
  padding: 24px 0; flex-shrink: 0; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
}
.app-sidebar-logo {
  padding: 0 24px 24px; font-size: 18px; font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px;
}
.app-sidebar-logo span { color: var(--blue-light); }
.app-sidebar-nav { flex: 1; }
.app-sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; color: var(--gray-400); font-size: 14px;
  font-weight: 500; transition: all var(--transition);
}
.app-sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.app-sidebar-nav a.active { color: #fff; background: rgba(37,99,235,.3); border-right: 3px solid var(--blue-light); }
.app-sidebar-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.1); }
.app-sidebar-user { font-size: 13px; color: var(--gray-400); margin-bottom: 8px; }
.app-sidebar-footer .btn { width: 100%; }

.app-main {
  flex: 1; margin-left: 240px; padding: 32px; background: var(--gray-50); min-height: 100vh;
}
.app-main-header {
  margin-bottom: 28px;
}
.app-main-header h1 { font-size: 24px; font-weight: 800; color: var(--gray-900); }
.app-main-header p { color: var(--gray-500); font-size: 14px; margin-top: 4px; }

/* --- Auth pages --- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); padding: 24px;
}
.auth-box {
  width: 100%; max-width: 400px; background: #fff; border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow-lg);
}
.auth-box h1 {
  font-size: 24px; font-weight: 800; margin-bottom: 8px; color: var(--gray-900);
}
.auth-box .subtitle { color: var(--gray-500); font-size: 14px; margin-bottom: 28px; }
.auth-box .auth-logo {
  text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 32px;
  color: var(--gray-900);
}
.auth-box .auth-logo span { color: var(--blue); }
.auth-box .btn { width: 100%; margin-top: 8px; }
.auth-box .auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--gray-500); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .app-sidebar { display: none; }
  .app-main { margin-left: 0; }
  .landing-hero { padding: 120px 20px 60px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .samples-grid { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
}

/* Mobile nav toggle */
.mobile-nav-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 60;
  background: var(--gray-900); color: #fff; border: none; border-radius: 8px;
  width: 40px; height: 40px; font-size: 20px; cursor: pointer;
}
@media (max-width: 768px) {
  .mobile-nav-toggle { display: flex; align-items: center; justify-content: center; }
  .app-sidebar.open { display: flex; }
}

/* --- Color Picker --- */
input[type="color"] {
  -webkit-appearance: none; border: 1px solid var(--gray-300); border-radius: 6px;
  width: 48px; height: 36px; padding: 2px; cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--gray-400);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; }

/* --- Stats --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--gray-900); }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* Action row */
.action-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Select dropdown for admin */
.status-select {
  padding: 4px 8px; border: 1px solid var(--gray-300); border-radius: 6px;
  font-size: 13px; background: #fff;
}

/* ============================================================
   MOBILE RESPONSIVE — @media (max-width: 768px)
   Comprehensive mobile adaptation for all pages
   ============================================================ */

/* --- Remove the old sparse mobile block, override with comprehensive rules --- */

@media (max-width: 768px) {

  /* === 1. LANDING PAGE === */

  /* Nav: hide login link, keep logo + register CTA */
  .landing-nav { padding: 0 16px; height: 56px; }
  .landing-nav-actions .btn-secondary { display: none; }
  .landing-nav-actions .btn-primary { font-size: 13px; padding: 8px 16px; }

  /* Hero: smaller title, tighter spacing */
  .landing-hero {
    padding: 100px 16px 48px;
  }
  .landing-hero h1 {
    font-size: 28px !important; letter-spacing: -.5px; line-height: 1.25;
  }
  .landing-hero p { font-size: 15px !important; margin-bottom: 24px; }
  .landing-hero-actions { flex-direction: column; gap: 10px; }
  .landing-hero-actions .btn { width: 100%; }
  .landing-badge { font-size: 12px; padding: 5px 12px; }

  /* Sections: tighter padding */
  .landing-section { padding: 48px 16px; }
  .landing-section-title { font-size: 24px; }
  .landing-section-sub { font-size: 15px; margin-bottom: 32px; }

  /* Features grid: single column */
  .features-grid { grid-template-columns: 1fr; gap: 16px; }
  .feature-card { padding: 24px; }

  /* Testimonial cards: mobile */
  .testi-card { width: 250px; padding: 20px; }

  /* Pricing: single column, full width */
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card { padding: 28px 20px; }

  /* Samples: single column */
  .samples-grid { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }

  /* FAQ: full width, touch-friendly */
  .faq-list { max-width: 100%; }
  .faq-question { padding: 16px; font-size: 15px; }
  .faq-answer-inner { padding: 0 16px 16px; font-size: 14px; }

  /* Footer */
  .landing-footer { padding: 32px 16px; font-size: 12px; }


  /* === 2. AUTH PAGES (login / register) === */

  .auth-page { padding: 16px; }
  .auth-box { padding: 28px 20px; max-width: 100%; }
  .auth-box h1 { font-size: 22px; }
  .auth-box .btn {
    min-height: 48px; font-size: 16px;
  }
  .form-input, .form-textarea, .form-select {
    min-height: 48px; font-size: 16px; padding: 12px 14px;
  }


  /* === 3. APP LAYOUT (dashboard / brand / admin) === */

  /* Sidebar: fixed overlay, hidden by default, shown with .open */
  .app-sidebar {
    display: none;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .app-sidebar.open { display: flex; }

  /* Hamburger menu button */
  .mobile-nav-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; left: 12px; z-index: 210;
    width: 44px; height: 44px; font-size: 22px;
    background: var(--gray-900); color: #fff; border: none; border-radius: 8px;
    cursor: pointer;
  }

  /* Sidebar overlay backdrop */
  .sidebar-backdrop {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.4); z-index: 190;
  }
  .sidebar-backdrop.show { display: block; }

  /* Main content: no left margin */
  .app-main {
    margin-left: 0; padding: 20px 16px;
    padding-top: 64px; /* room for hamburger */
  }
  .app-main-header h1 { font-size: 20px; }

  /* Upload zone: full width, bigger target */
  .upload-zone { padding: 32px 16px; }
  .upload-zone-icon { font-size: 36px; }
  .upload-zone-text { font-size: 14px; }

  /* Task card: video compare stacks vertically */
  .compare-view { grid-template-columns: 1fr; }

  /* Task card: meta wraps better */
  .task-card-header { padding: 12px 16px; }
  .task-card-body { padding: 16px; }
  .task-card-filename { font-size: 14px; }

  /* Download/artifacts row */
  .download-row { gap: 6px; }
  .download-row .btn { font-size: 12px; padding: 6px 10px; min-height: 40px; }
  .artifacts-row { gap: 10px; }

  /* Brand config form: single column */
  #page-brand .card { max-width: 100%; }
  #page-brand form > div[style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important; flex-direction: column; gap: 0;
  }
  /* Color pickers row */
  #page-brand div[style*="display:flex; gap: 16px; align-items: flex-end"] {
    flex-direction: column;
  }

  /* Buttons: touch-friendly minimum height */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .btn-lg { min-height: 52px; font-size: 16px; }

  /* Stats grid: 2 columns on mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }

  /* Admin tables: horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 600px; }
  th, td { padding: 10px 12px; font-size: 13px; }

  /* Action row */
  .action-row { flex-direction: column; }


  /* === 4. FEEDBACK MODAL — full screen on mobile === */

  .feedback-modal-overlay {
    align-items: flex-end; /* slide from bottom */
  }
  .feedback-modal {
    max-width: 100%; width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 20px 32px;
    max-height: 90vh; overflow-y: auto;
  }
  .feedback-modal h3 { font-size: 17px; }
  .feedback-type-row { flex-wrap: wrap; }
  .feedback-type-btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
  .feedback-modal-actions { flex-direction: column; gap: 8px; }
  .feedback-modal-actions .btn { width: 100%; min-height: 48px; }

  /* Feedback FAB: slightly smaller, lower */
  .feedback-fab { width: 48px; height: 48px; font-size: 20px; bottom: 20px; right: 16px; }

  /* Toast: full width on mobile */
  .toast { left: 16px; right: 16px; max-width: none; top: 16px; }

  /* Card padding reduction */
  .card { padding: 16px; }
  .card-header { font-size: 16px; }

  /* Publish text box */
  .publish-text-box { font-size: 12px; max-height: 160px; }
}
