@charset "UTF-8";

/* ==========================================================================
   捕影 BUYING · CYBER NEON PRISM & GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* --- Cyber Neon Prismatic Core Tokens --- */
  --neon-purple: #8b5cf6;
  --neon-pink: #ec4899;
  --neon-cyan: #06b6d4;
  --neon-blue: #3b82f6;
  --neon-green: #10b981;
  --neon-amber: #f59e0b;

  /* --- Light Theme: Holographic Prismatic Porcelain --- */
  --canvas: #f6f8fd;
  --canvas-subtle: #edf2f9;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-glass: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --surface: rgba(241, 245, 253, 0.85);
  --surface-hover: rgba(230, 238, 250, 0.95);
  --surface-active: #cbdcf7;

  --text: #0b1124;
  --text-secondary: #273449;
  --muted: #5d6f8a;
  --subtle: #8da0ba;
  --line: rgba(139, 92, 246, 0.16);
  --line-strong: rgba(236, 72, 153, 0.32);

  /* Cyber Tri-Color Prism Accent */
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-active: #5b21b6;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #db2777 52%, #0284c7 100%);
  --accent-gradient-hover: linear-gradient(135deg, #6d28d9 0%, #be185d 52%, #0369a1 100%);
  --accent-gradient-text: linear-gradient(135deg, #1e1b4b 0%, #7c3aed 45%, #db2777 80%, #0284c7 100%);
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-soft-hover: rgba(124, 58, 237, 0.18);
  --accent-glow: 0 4px 22px rgba(124, 58, 237, 0.38), 0 0 12px rgba(219, 39, 119, 0.2);

  /* Status Colors */
  --green: #059669;
  --green-hover: #047857;
  --green-soft: rgba(5, 150, 105, 0.12);
  --green-glow: 0 4px 16px rgba(5, 150, 105, 0.3);

  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);

  --danger: #e11d48;
  --danger-hover: #be123c;
  --danger-soft: rgba(225, 29, 72, 0.12);

  /* Elevation & Glass Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(11, 17, 36, 0.05);
  --shadow-sm: 0 2px 6px 0 rgba(11, 17, 36, 0.06);
  --shadow: 0 6px 24px -2px rgba(11, 17, 36, 0.08), 0 2px 6px -1px rgba(11, 17, 36, 0.04);
  --shadow-lg: 0 16px 44px -4px rgba(11, 17, 36, 0.12), 0 4px 16px -2px rgba(11, 17, 36, 0.06);
  --shadow-xl: 0 24px 60px -6px rgba(11, 17, 36, 0.16);
  --card-shadow: 0 8px 30px rgba(11, 17, 36, 0.07), inset 0 1px 1px rgba(255, 255, 255, 0.9);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-fast: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-normal: 0.24s cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light;
}

/* ==========================================================================
   DARK THEME: Deep Galactic Obsidian, Electric Neon & Frosted Glass
   ========================================================================== */
body.dark {
  --canvas: #050713;
  --canvas-subtle: #090e24;
  --panel: rgba(14, 18, 38, 0.74);
  --panel-glass: rgba(14, 18, 38, 0.86);
  --panel-solid: #0d1226;
  --surface: rgba(22, 29, 60, 0.65);
  --surface-hover: rgba(33, 44, 90, 0.85);
  --surface-active: rgba(45, 60, 120, 0.95);

  --text: #f3ede3;
  --text-secondary: #d1d9e6;
  --muted: #91a0b8;
  --subtle: #61718d;
  --line: rgba(139, 92, 246, 0.22);
  --line-strong: rgba(236, 72, 153, 0.42);

  /* Electric Neon Prism */
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-active: #c4b5fd;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 52%, #06b6d4 100%);
  --accent-gradient-hover: linear-gradient(135deg, #a78bfa 0%, #f472b6 52%, #22d3ee 100%);
  --accent-gradient-text: linear-gradient(135deg, #ffffff 10%, #e9d5ff 45%, #f472b6 80%, #67e8f9 100%);
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-soft-hover: rgba(139, 92, 246, 0.26);
  --accent-glow: 0 0 28px rgba(139, 92, 246, 0.55), 0 0 54px rgba(236, 72, 153, 0.28);

  /* Neon Status Colors */
  --green: #10b981;
  --green-hover: #34d399;
  --green-soft: rgba(16, 185, 129, 0.18);
  --green-glow: 0 0 20px rgba(16, 185, 129, 0.45);

  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.18);

  --danger: #f43f5e;
  --danger-hover: #fb7185;
  --danger-soft: rgba(244, 63, 94, 0.18);

  /* Glowing Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 3px 8px 0 rgba(0, 0, 0, 0.55);
  --shadow: 0 8px 30px -3px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(139, 92, 246, 0.15);
  --shadow-lg: 0 18px 48px -4px rgba(0, 0, 0, 0.75), 0 0 2px 1px rgba(139, 92, 246, 0.25);
  --shadow-xl: 0 28px 64px -6px rgba(0, 0, 0, 0.85), 0 0 3px 1px rgba(236, 72, 153, 0.3);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.58), inset 0 1px 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(139, 92, 246, 0.12);

  color-scheme: dark;
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--canvas);
  background-image: 
    radial-gradient(ellipse 900px 500px at 15% -60px, rgba(139, 92, 246, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 800px 450px at 85% -40px, rgba(236, 72, 153, 0.06) 0%, transparent 68%),
    radial-gradient(circle 600px at 50% 380px, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  min-width: 320px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.dark {
  background-color: var(--canvas);
  background-image: 
    radial-gradient(ellipse 900px 500px at 15% -60px, rgba(139, 92, 246, 0.28) 0%, transparent 70%),
    radial-gradient(ellipse 800px 450px at 85% -40px, rgba(236, 72, 153, 0.22) 0%, transparent 68%),
    radial-gradient(circle 600px at 50% 380px, rgba(6, 182, 212, 0.12) 0%, transparent 70%),
    radial-gradient(circle 700px at 90% 90%, rgba(139, 92, 246, 0.16) 0%, transparent 70%),
    radial-gradient(circle 500px at 10% 80%, rgba(236, 72, 153, 0.14) 0%, transparent 70%);
  background-attachment: fixed;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button, a, input, textarea, summary {
  outline-offset: 3px;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .drop-zone:focus-within {
  outline: 2.5px solid var(--accent);
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--trans-fast);
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, p, figure {
  margin: 0;
}

h1, h2, h3 {
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--text);
}

h1 {
  font-size: 30px;
  font-weight: 750;
}

h2 {
  font-size: 19px;
  font-weight: 650;
}

h3 {
  font-size: 16px;
  font-weight: 600;
}

p {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
  border-radius: 4px;
}

.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
  transition: transform var(--trans-fast);
}

.full {
  width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ==========================================================================
   HEADER & NAVIGATION BAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel-glass);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: background-color var(--trans-fast), border-color var(--trans-fast);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  min-height: 72px;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Logo */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none !important;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: 11px;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6), 0 0 40px rgba(236, 72, 153, 0.3);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.brand:hover .brand-mark {
  transform: scale(1.05);
  box-shadow: 0 0 28px rgba(236, 72, 153, 0.7), 0 0 50px rgba(6, 182, 212, 0.4);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.01em;
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.35));
}

/* Main Navigation Capsule Dock */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

.main-nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  min-height: 38px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 550;
  white-space: nowrap;
  transition: all var(--trans-fast);
}

.main-nav button:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(139, 92, 246, 0.15);
}

body.dark .main-nav button:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(139, 92, 246, 0.22);
}

.main-nav button.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.32), rgba(236, 72, 153, 0.24));
  border: 1px solid rgba(236, 72, 153, 0.5);
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}

body.dark .main-nav button.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.38), rgba(236, 72, 153, 0.28));
  border: 1px solid rgba(236, 72, 153, 0.55);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.45);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: all var(--trans-fast);
}

.icon-button:hover:not(:disabled) {
  background: var(--surface-hover);
  color: #ffffff;
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.language-button {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
}

/* ==========================================================================
   APP MAIN & VIEW PANELS
   ========================================================================== */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 32px 72px;
  min-height: calc(100vh - 146px);
}

.view-panel {
  animation: viewFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   PAGE HEADING & BADGES
   ========================================================================== */
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading .eyebrow {
  margin-bottom: 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c4b5fd;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(236, 72, 153, 0.18));
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(139, 92, 246, 0.42);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.25);
}

body.dark .eyebrow {
  border-color: rgba(236, 72, 153, 0.45);
  color: #fdf2f8;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.3);
}

.page-heading h1 {
  font-size: 32px;
  font-weight: 850;
  letter-spacing: -0.02em;
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.4));
}

.page-heading p {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 680px;
}

.local-tag, .engine-badge, .session-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.local-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.engine-badge.ready {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.25);
  background: var(--green-soft);
}

.engine-badge.unavailable {
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.25);
  background: var(--danger-soft);
}

/* ==========================================================================
   WORKFLOW STEPPER (ELEGANT FLOATING PILL STEPPER)
   ========================================================================== */
.workflow {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;
  margin: 0 0 24px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.workflow li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  transition: all var(--trans-fast);
}

.workflow li + li::before {
  display: none;
}

.step-number {
  display: grid;
  place-items: center;
  border-radius: 50%;
  height: 22px;
  width: 22px;
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all var(--trans-fast);
  flex-shrink: 0;
}

.workflow li.active, .workflow li.is-current {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(236, 72, 153, 0.2));
  border-color: #8b5cf6;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.45), inset 0 0 10px rgba(139, 92, 246, 0.2);
}

.workflow li.active .step-number, .workflow li.is-current .step-number {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.7);
}

.workflow li.complete, .workflow li.done, .workflow li.is-complete {
  border-color: var(--green);
  color: var(--green);
  background: var(--panel);
}

.workflow li.complete .step-number, .workflow li.done .step-number, .workflow li.is-complete .step-number {
  background: var(--green);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--green-glow);
}

.flow-status {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin: -12px 4px 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   PANELS & WORKSPACE LAYOUT
   ========================================================================== */
.panel {
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}

body.dark .panel {
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}

.panel:hover {
  border-color: rgba(236, 72, 153, 0.38);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(139, 92, 246, 0.22);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.workspace-card {
  padding: 28px;
}

.composer-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.composer-label label {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.detected {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--trans-fast);
}

.detected:not(:empty) {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(139, 92, 246, 0.35);
}

textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 136px;
  max-height: 320px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.65;
  font-size: 14.5px;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

textarea:focus {
  background: var(--panel-solid);
  border-color: #8b5cf6;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3), 0 0 24px rgba(139, 92, 246, 0.25);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.shortcut {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: auto;
  white-space: nowrap;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none !important;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all var(--trans-fast);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button.primary {
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.55), 0 4px 14px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.button.primary:hover:not(:disabled) {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(236, 72, 153, 0.75), 0 6px 20px rgba(0, 0, 0, 0.5);
}

body.dark .button.primary {
  color: #ffffff;
}

.button.secondary {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}

.button.secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: rgba(236, 72, 153, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  transition: all var(--trans-fast);
}

.text-button:hover:not(:disabled) {
  background: var(--accent-soft);
  text-decoration: none;
}

.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.composer-foot .text-button {
  flex-shrink: 0;
  font-size: 12px;
}

/* ==========================================================================
   GUIDE SIDEBAR CARD & PLATFORM PILLS
   ========================================================================== */
.guide-card {
  padding: 24px;
}

.guide-icon {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.guide-card h2 {
  font-size: 16px;
}

.guide-card p {
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.7;
}

.guide-path {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 16px 0 20px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}

.guide-path span {
  padding: 3px 8px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.guide-path .icon {
  width: 13px;
  height: 13px;
  color: var(--line-strong);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.platforms span {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all var(--trans-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.platforms span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* Specific Platform Accents & Neon Glow */
.platforms span:nth-child(1)::before { background: #fe2c55; box-shadow: 0 0 8px #fe2c55; } /* 抖音 */
.platforms span:nth-child(2)::before { background: #ff2442; box-shadow: 0 0 8px #ff2442; } /* 小红书 */
.platforms span:nth-child(3)::before { background: #ff5000; box-shadow: 0 0 8px #ff5000; } /* 快手 */
.platforms span:nth-child(4)::before { background: #00f2fe; box-shadow: 0 0 8px #00f2fe; } /* TikTok */
.platforms span:nth-child(5)::before { background: #e1306c; box-shadow: 0 0 8px #e1306c; } /* Instagram */
.platforms span:nth-child(6)::before { background: #1d9bf0; box-shadow: 0 0 8px #1d9bf0; } /* X */
.platforms span:nth-child(7)::before { background: #ff4500; box-shadow: 0 0 8px #ff4500; } /* Reddit */
.platforms span:nth-child(8)::before { background: #00aeec; box-shadow: 0 0 8px #00aeec; } /* 哔哩哔哩 */
.platforms span:nth-child(9)::before { background: #ff2a4b; box-shadow: 0 0 8px #ff2a4b; } /* 微博 */

.platforms span:hover {
  border-color: rgba(236, 72, 153, 0.45);
  color: #ffffff;
  background: var(--surface-hover);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.dragging {
  outline: 2.5px solid var(--accent) !important;
  background: var(--accent-soft) !important;
}

/* Recent Links */
.recent-links {
  padding: 14px 4px 0;
}

.recent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.recent-link {
  display: block;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  max-width: 100%;
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  transition: all var(--trans-fast);
}

.recent-link:hover {
  color: var(--accent);
  background: var(--surface);
}

.recent-links > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}

/* ==========================================================================
   RESULTS, NOTICES & TASKS
   ========================================================================== */
.workspace-results {
  margin-top: 24px;
  scroll-margin-top: 96px;
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #8b5cf6 0%, #ec4899 50%, #06b6d4 100%);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.7);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.2));
  color: #e9d5ff;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.35);
  flex-shrink: 0;
}

.empty-icon .icon {
  width: 26px;
  height: 26px;
}

.empty-state h2 {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--text);
}

.empty-state p {
  font-size: 13px;
  margin-top: 4px;
  color: var(--muted);
}

.queue-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.2);
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--accent);
}

.notice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--warning);
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}

.notice > div:first-child {
  flex: 1;
}

.notice p {
  color: inherit;
  margin-top: 2px;
}

.notice.error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.notice.error .button {
  color: var(--text);
}

.task-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
  margin-bottom: 24px;
}

.task-copy {
  flex: 1;
  min-width: 0;
}

.task-copy strong {
  font-size: 15px;
  color: var(--text);
}

.task-copy p {
  font-size: 13px;
  margin: 4px 0 12px;
  overflow-wrap: anywhere;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  flex-shrink: 0;
}

progress {
  display: block;
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: var(--radius-full);
  overflow: hidden;
  accent-color: var(--accent);
  background: var(--line);
}

progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: var(--radius-full);
}

progress::-webkit-progress-value {
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   RESULT PANEL & MEDIA GRID
   ========================================================================== */
.result-panel {
  padding: 28px;
}

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.section-top > div {
  min-width: 0;
}

.section-top .eyebrow {
  margin-bottom: 6px;
}

.section-top h2 {
  overflow-wrap: anywhere;
  font-size: 20px;
}

.section-top p {
  font-size: 13.5px;
  margin-top: 6px;
}

.section-top > button {
  flex-shrink: 0;
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
}

.meta a {
  font-size: 12.5px;
  font-weight: 550;
}

.copy-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.copy-tools .text-button {
  padding: 4px 10px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.copy-tools .text-button:hover {
  background: var(--accent-soft);
}

.selection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  margin-bottom: 12px;
}

.selection-buttons {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  font-weight: 550;
}

.selection-buttons label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.selection-buttons > span {
  color: var(--muted);
  font-size: 12px;
}

/* Segmented Buttons Control */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-radius: var(--radius-sm);
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  width: fit-content;
}

.segmented button {
  padding: 6px 14px;
  min-height: 34px;
  font-size: 13px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 550;
  white-space: nowrap;
  transition: all var(--trans-fast);
}

.segmented button.active, .segmented button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--accent);
  font-weight: 650;
  box-shadow: var(--shadow-xs);
}

.segmented button:hover:not(.active):not([aria-pressed="true"]) {
  color: var(--text);
}

/* Media Grid & Cards */
.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.media-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.media-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.card-select {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 10px;
  padding: 6px;
  background: var(--panel-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.card-kind {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 8px;
  color: #ffffff;
  background: rgba(12, 11, 10, 0.78);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.card-thumb {
  width: 100%;
  height: 195px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card-thumb:hover img {
  transform: scale(1.04);
}

.media-placeholder {
  font-size: 32px;
  color: var(--muted);
  opacity: 0.6;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  padding: 11px 14px;
  font-size: 12.5px;
  font-weight: 550;
  border-top: 1px solid var(--line);
}

.card-bottom span + span {
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--font-mono);
}

/* Download Options & Switch */
.download-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  font-size: 13px;
  color: var(--muted);
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
}

.switch-label input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch {
  position: relative;
  width: 36px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--line-strong);
  flex-shrink: 0;
  transition: background var(--trans-fast);
}

.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--trans-fast);
}

.switch-label input:checked + .switch {
  background: var(--accent);
}

.switch-label input:checked + .switch::after {
  transform: translateX(14px);
}

.switch-label input:focus-visible + .switch {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

.switch-label input:disabled ~ * {
  opacity: 0.48;
}

/* Download Toolbar */
.download-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
}

.download-toolbar strong {
  font-size: 15px;
  color: var(--text);
}

.download-toolbar p {
  font-size: 12.5px;
  margin-top: 4px;
}

.download-actions {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   FILES & SESSIONS LIST
   ========================================================================== */
.files-section {
  padding: 26px;
  margin-top: 24px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.file-symbol {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 20px;
}

.file-copy {
  flex: 1;
  min-width: 0;
}

.file-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.file-copy small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: block;
}

.file-row .button {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

.file-row .button:hover {
  background: var(--accent-hover);
}

body.dark .file-row .button {
  color: #ffffff;
}

.file-row .button.secondary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #ffffff;
  border-color: transparent;
}

body.dark .file-row .button.secondary:hover:not(:disabled) {
  color: #ffffff;
}

.file-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==========================================================================
   WATERMARK REPAIR PANEL (去除水印)
   ========================================================================== */
.watermark-modes {
  width: max-content;
  max-width: 100%;
  margin: -4px 0 24px;
}

.watermark-mode {
  min-width: 124px;
}

.repair-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.repair-controls {
  padding: 26px;
}

.repair-controls h2 {
  font-size: 16px;
  margin-bottom: 18px;
}

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  padding: 26px 20px;
  background: var(--surface);
  border: 1.8px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all var(--trans-fast);
}

.drop-zone:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.upload-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans-fast);
}

.drop-zone:hover .upload-symbol {
  transform: translateY(-2px);
}

.upload-symbol .icon {
  width: 24px;
  height: 24px;
}

.drop-zone strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
  max-width: 100%;
}

.drop-zone small {
  font-size: 12px;
  color: var(--muted);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.repair-options {
  margin: 20px 0;
  font-size: 13px;
}

.repair-options summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 550;
  min-height: 36px;
  padding: 7px 0;
}

.repair-options summary:hover {
  color: var(--accent);
}

.repair-options label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0 7px;
}

.repair-options input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.repair-options small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}

.local-processing-note {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 14px;
  color: var(--muted);
}

.repair-preview {
  padding: 26px;
  min-height: 440px;
}

.comparison-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.comparison-head strong {
  font-size: 15px;
}

.comparison-head > span {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.compare-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: 30px 20px;
}

.comparison-illustration {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  margin-bottom: 24px;
}

.comparison-illustration > .icon:first-child,
.comparison-illustration > .icon:last-child {
  width: 56px;
  height: 56px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--accent);
}

.compare-empty p {
  font-size: 13px;
  color: var(--muted);
}

.comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
}

.comparison figcaption {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.comparison figure > div {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.comparison img, .comparison video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.comparison figure p {
  padding: 15px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.repair-result-message {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.repair-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.repair-note {
  font-size: 12px;
}

.repair-foot .text-button {
  flex-shrink: 0;
}

#upload-progress {
  margin-top: 14px;
}

/* ==========================================================================
   TRENDING SECTION (热门发现)
   ========================================================================== */
.trending-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
}

.trending-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 2px;
  font-size: 12px;
  color: var(--muted);
}

.source-details {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 2px 20px;
}

.source-details > summary {
  cursor: pointer;
  width: fit-content;
  padding: 5px 0;
  font-weight: 550;
}

.source-details > summary:hover {
  color: var(--accent);
}

.source-details[open] > summary {
  margin-bottom: 12px;
}

.trending-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trending-sources:empty {
  display: none;
}

.trending-source {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  background: var(--panel);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  flex: 1;
  min-width: 250px;
}

.trending-source p {
  flex-basis: 100%;
  font-size: 11.5px;
  line-height: 1.6;
}

.trending-source small {
  flex-basis: 100%;
}

.source-status {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
}

.trending-source a {
  margin-left: auto;
}

.trending-source[data-state="error"] {
  border-color: rgba(244, 63, 94, 0.3);
}

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

.trending-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast), border-color var(--trans-fast);
}

.trending-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

.trending-thumbnail, .trending-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  position: relative;
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}

.trending-thumbnail img, .trending-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.trending-card:hover .trending-thumbnail img,
.trending-card:hover .trending-cover img {
  transform: scale(1.04);
}

.trending-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(12, 11, 10, 0.78);
  color: #ffffff;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  backdrop-filter: blur(4px);
}

.trending-card-body, .trending-copy {
  padding: 18px;
}

.trending-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.trending-card-meta .platform-label, .platform-badge {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 650;
  font-size: 11px;
}

.source-rank {
  color: var(--muted);
  font-family: var(--font-mono);
}

.trending-card h2, .trending-card h3 {
  font-size: 15.5px;
  line-height: 1.5;
  margin: 10px 0;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 46px;
}

.trending-card .trending-author {
  font-size: 12.5px;
  color: var(--muted);
  min-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.trending-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.trending-card-actions .button {
  min-height: 38px;
  font-size: 12.5px;
  padding: 8px 12px;
}

.trending-card-actions > .button:first-child {
  flex: 1;
}

.trending-thumbnail.unavailable {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.trending-group-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.trending-grid > .trending-group-heading:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.trending-group-heading h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trending-group-heading p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.creative-heading {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.creative-controls {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px;
}

.creative-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.creative-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-secondary);
}

.creative-field span {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.creative-field select,
.creative-field input {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all var(--trans-fast);
}

.creative-field select {
  padding-right: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
}

.creative-field select:hover,
.creative-field input:hover {
  border-color: var(--line-strong);
}

.creative-field select:focus,
.creative-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.creative-search input {
  min-width: 200px;
}

.creative-note {
  font-size: 12px;
  color: var(--subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.trending-empty, .trending-loading, .creative-empty, .x-empty {
  grid-column: 1 / -1;
  padding: 56px 24px;
  text-align: center;
  background: var(--panel);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.creative-empty h3, .x-empty h2 {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 8px;
}

.creative-empty p, .x-empty p {
  font-size: 13px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.6;
  margin: 0 auto 16px;
}

.trending-skeleton {
  height: 330px;
  background: linear-gradient(90deg, var(--panel), var(--surface), var(--panel));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.trending-player-content {
  background: var(--surface);
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
}

.trending-player-content iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: 0;
}

.trending-player-content video {
  width: 100%;
  max-height: 65vh;
  display: block;
}

.trending-player-content > img {
  max-height: 50vh;
  max-width: 100%;
  object-fit: contain;
}

.trending-player-content .trending-player-note {
  padding: 16px 22px;
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   FOOTER & MODALS
   ========================================================================== */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 32px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.footer-separator {
  margin: 0 8px;
  color: var(--line-strong);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  max-width: min(920px, calc(100vw - 32px));
  width: 920px;
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-xl);
}

dialog::backdrop {
  background: rgba(12, 11, 10, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

dialog > header strong {
  font-size: 17px;
  font-weight: 650;
}

dialog > header p {
  font-size: 13px;
  margin-top: 4px;
}

dialog form {
  margin: 0;
}

#preview-counter {
  font-size: 12px;
  color: var(--muted);
  margin-left: 12px;
  font-family: var(--font-mono);
}

.preview-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  background: var(--surface);
  padding: 24px 60px;
}

#preview-content {
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preview-content img, #preview-content video {
  max-width: 100%;
  max-height: 66vh;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

#preview-content audio {
  width: 100%;
}

.preview-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 48px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 28px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  transition: all var(--trans-fast);
}

.preview-arrow:hover:not(:disabled) {
  background: var(--surface);
  transform: translateY(-50%) scale(1.05);
}

#preview-prev { left: 12px; }
#preview-next { right: 12px; }

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* Help Dialog */
.help-dialog {
  width: 780px;
}

.help-body {
  padding: 28px;
}

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

.help-steps article > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.help-steps h3 {
  font-size: 15px;
}

.help-steps p {
  font-size: 13px;
  line-height: 1.7;
  margin-top: 8px;
}

.faq-list details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.faq-list summary {
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: color var(--trans-fast);
}

.faq-list summary:hover {
  color: var(--accent);
}

.faq-list p {
  font-size: 13px;
  line-height: 1.8;
  margin-top: 10px;
  padding-right: 15px;
}

/* Toast */
.toast {
  position: fixed;
  z-index: 1000;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 24px;
  background: rgba(12, 11, 10, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  font-size: 13.5px;
  font-weight: 550;
  backdrop-filter: blur(16px);
  animation: toastPop 0.22s ease-out;
}

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.media-error {
  padding: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (min-width: 1450px) {
  .app-main { padding-top: 40px; }
  .page-heading { margin-bottom: 28px; }
  .workspace-card { padding: 32px; }
  textarea { min-height: 148px; }
  .guide-card { padding: 28px; }
}

@media (max-width: 1050px) {
  .header-inner { padding: 10px 24px; gap: 16px; }
  .main-nav button { padding: 8px 12px; }
  .app-main { padding: 28px 24px 48px; }
  .workspace-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
  .workspace-card { padding: 22px; }
  .guide-card { padding: 20px; }
  .shortcut { display: none; }
  .composer-actions #parse { margin-left: auto; }
  .composer-foot { align-items: flex-start; flex-direction: column; gap: 6px; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .repair-layout { grid-template-columns: 290px minmax(0, 1fr); gap: 20px; }
  .repair-controls, .repair-preview { padding: 22px; }
  .trending-grid { gap: 18px; }
}

@media (max-width: 790px) {
  .header-inner { padding: 12px 18px; flex-wrap: wrap; gap: 12px; }
  .brand { order: 0; }
  .header-actions { order: 1; margin-left: auto; }
  .main-nav { order: 2; width: 100%; justify-content: center; }
  .main-nav button { flex: 1; justify-content: center; padding: 8px 10px; }
  .app-main { padding: 24px 18px 40px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 26px; }
  .local-tag { display: none; }
  .workspace-layout { display: block; }
  .guide-card { margin-top: 18px; padding: 20px; }
  .guide-card .guide-icon { display: none; }
  .guide-card h2 { font-size: 15px; }
  .guide-path { display: none; }
  .platforms { border: 0; padding: 0; margin-top: 12px; gap: 6px; }
  .composer-foot { flex-direction: row; align-items: center; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .card-thumb { height: 165px; }
  .download-toolbar, .download-options { align-items: flex-start; flex-direction: column; gap: 14px; }
  .download-actions { width: 100%; justify-content: flex-end; }
  .repair-layout { grid-template-columns: 1fr; }
  .repair-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
  .repair-controls h2 { grid-column: 1 / -1; margin-bottom: 0; }
  .drop-zone { grid-row: 2 / 5; min-height: 185px; }
  .repair-options { margin: 0; align-self: start; }
  .repair-controls > .button { align-self: start; }
  .local-processing-note { margin: 0; }
  .repair-preview { min-height: 360px; }
  .compare-empty { min-height: 260px; }
  .repair-foot { align-items: flex-start; flex-direction: column; gap: 8px; }
  .trending-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trending-controls { flex-wrap: wrap; }
  .trending-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .trending-player-content iframe { height: 400px; }
}

@media (max-width: 510px) {
  html { scroll-padding-top: 140px; }
  .header-inner { padding: 10px 14px; gap: 10px; }
  .brand strong { font-size: 19px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .main-nav { gap: 2px; padding: 2px; }
  .main-nav button { font-size: 11.5px; gap: 4px; padding: 7px 4px; min-height: 38px; }
  .main-nav .icon { width: 16px; height: 16px; }
  .icon-button { width: 34px; height: 34px; }
  .app-main { padding: 20px 14px 36px; }
  .page-heading { margin-bottom: 18px; gap: 10px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 13px; }
  .page-heading .eyebrow { font-size: 10.5px; }
  .workflow { margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
  .workflow li { min-height: 40px; gap: 6px; font-size: 11px; padding: 6px 12px; }
  .step-number { width: 20px; height: 20px; font-size: 10.5px; }
  .workspace-card { padding: 18px; }
  .composer-label { margin-bottom: 10px; }
  .composer-actions { gap: 6px; }
  .composer-actions .button { padding: 8px 12px; }
  textarea { min-height: 130px; padding: 13px; font-size: 14px; }
  .guide-card { padding: 16px; border-radius: 12px; }
  .empty-state { padding: 20px 16px; gap: 12px; }
  .empty-icon { width: 40px; height: 40px; }
  .result-panel, .files-section { padding: 18px; }
  .section-top h2 { font-size: 18px; }
  .selection-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .selection-buttons { justify-content: space-between; }
  .segmented button { font-size: 12px; padding: 6px 10px; min-height: 32px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-thumb { height: 150px; }
  .card-bottom { display: block; padding: 8px 10px; }
  .card-bottom span { display: block; }
  .card-bottom span + span { margin-top: 2px; }
  .download-actions .button { flex: 1; padding: 9px 12px; font-size: 12.5px; }
  .file-row { flex-wrap: wrap; gap: 10px; }
  .file-copy { flex-basis: calc(100% - 65px); }
  .file-row > .button, .file-actions { margin-left: 54px; flex: 1; }
  .file-actions .button { flex: 1; }
  .task-card { padding: 16px; gap: 12px; }
  .notice { padding: 12px; gap: 10px; }
  .repair-controls { display: block; padding: 18px; }
  .drop-zone { min-height: 170px; }
  .repair-preview { padding: 18px; }
  .comparison figure > div { height: 220px; }
  .trending-controls { padding: 12px; gap: 10px; }
  .trending-grid { grid-template-columns: 1fr; }
  .site-footer { margin: 0 14px; font-size: 10.5px; gap: 8px; padding: 16px 0; }
  dialog { max-width: calc(100vw - 20px); border-radius: 16px; }
  .preview-stage { padding: 14px 36px; min-height: 240px; }
  .preview-arrow { width: 28px; height: 36px; font-size: 22px; }
  .help-body { padding: 18px; }
  .help-steps { grid-template-columns: 1fr; gap: 16px; }
  .toast { bottom: 16px; font-size: 12.5px; }
}

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