/* ===== 岭南 AI 助手 — Design System ===== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-lighter: #eff6ff;
  --accent: #8b5cf6;
  --accent-light: #ede9fe;
  --surface: #ffffff;
  --surface-secondary: #f8fafc;
  --surface-elevated: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --success: #10b981;
  --success-bg: #d1fae5;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --hero-gradient: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 25%, #faf5ff 50%, #fdf4ff 75%, #fff1f2 100%);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e3a5f;
  --primary-lighter: #172554;
  --accent: #a78bfa;
  --accent-light: #2e1065;
  --surface: #0f172a;
  --surface-secondary: #1e293b;
  --surface-elevated: #1e293b;
  --border: #334155;
  --border-light: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --success: #34d399;
  --success-bg: #064e3b;
  --error: #f87171;
  --error-bg: #7f1d1d;
  --warning: #fbbf24;
  --warning-bg: #78350f;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.3);
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}

/* ---------- Base ---------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.code-block, .code-block pre, .code-block code,
pre code, code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code',
               'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

/* ---------- Hero Section ---------- */
.hero-gradient {
  background: var(--hero-gradient);
}

.dark .hero-gradient {
  background: var(--hero-gradient);
}

/* ---------- Header ---------- */
.app-header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dark .app-header {
  background: rgba(15,23,42,0.85);
}

.nav-link {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-lighter);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.dark .nav-link.active {
  background: var(--primary-light);
}

/* ---------- Code blocks ---------- */
.code-block {
  position: relative;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1rem;
  padding-right: 3rem;
  margin: 0.75rem 0;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  border: 1px solid #334155;
}

.code-block pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.dark .code-block {
  background: #020617;
  border-color: #1e293b;
}

/* ---------- Copy button ---------- */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* Copy all button */
.copy-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-all-btn:hover {
  background: var(--border);
}

.copy-all-btn.copied {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

/* ---------- Trust badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}

.badge-battle-tested {
  background: #dcfce7;
  color: #166534;
}

.badge-experience-derived {
  background: #dbeafe;
  color: #1e40af;
}

.badge-ai-reference {
  background: #f1f5f9;
  color: #475569;
}

.dark .badge-battle-tested {
  background: #064e3b;
  color: #6ee7b7;
}

.dark .badge-experience-derived {
  background: #1e3a5f;
  color: #93c5fd;
}

.dark .badge-ai-reference {
  background: #1e293b;
  color: #94a3b8;
}

/* ---------- Skeleton animation ---------- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ---------- Loading spinner ---------- */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- Sources list ---------- */
.source-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.source-item:hover {
  background: var(--primary-lighter);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.source-item .score {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-full);
}

/* ---------- Markdown prose ---------- */
.prose-answer {
  font-size: 0.875rem;
}

.prose-answer h1, .prose-answer h2, .prose-answer h3 {
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.prose-answer h1 { font-size: 1.5rem; }
.prose-answer h2 { font-size: 1.25rem; }
.prose-answer h3 { font-size: 1.125rem; }

.prose-answer p {
  margin: 0.5rem 0;
  line-height: 1.75;
  color: var(--text-secondary);
}

.prose-answer ul, .prose-answer ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.prose-answer li {
  margin: 0.375rem 0;
  line-height: 1.7;
  color: var(--text-secondary);
}

.prose-answer a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose-answer code {
  background: var(--surface-secondary);
  color: var(--text-primary);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  border: 1px solid var(--border);
}

.prose-answer pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ---------- Input focus glow ---------- */
.input-glow:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  border-color: var(--primary) !important;
}

/* ---------- Page transition ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: fadeIn 0.25s ease-out;
}

/* ---------- Guided step transitions ---------- */
@keyframes guidedSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes guidedFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.guided-step-enter {
  animation: guidedSlideIn 0.3s ease-out;
}

.guided-card-stagger > * {
  opacity: 0;
  animation: guidedSlideIn 0.3s ease-out forwards;
}

.guided-card-stagger > *:nth-child(1) { animation-delay: 0ms; }
.guided-card-stagger > *:nth-child(2) { animation-delay: 40ms; }
.guided-card-stagger > *:nth-child(3) { animation-delay: 80ms; }
.guided-card-stagger > *:nth-child(4) { animation-delay: 120ms; }
.guided-card-stagger > *:nth-child(5) { animation-delay: 160ms; }
.guided-card-stagger > *:nth-child(6) { animation-delay: 200ms; }
.guided-card-stagger > *:nth-child(7) { animation-delay: 240ms; }
.guided-card-stagger > *:nth-child(8) { animation-delay: 280ms; }

.guided-bubble-enter {
  animation: guidedBubbleIn 0.3s ease-out;
}

/* ---------- Wiki card ---------- */
.wiki-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.wiki-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.dark .wiki-card {
  background: var(--surface-elevated);
}

/* ---------- Category card ---------- */
.category-card {
  padding: 0.875rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-card:hover {
  border-color: var(--primary);
  background: var(--primary-lighter);
}

.category-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dark .category-card {
  background: var(--surface-elevated);
}

/* ---------- Pagination ---------- */
.pagination-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
}

/* ---------- Search highlight ---------- */
mark {
  background: #fef08a;
  color: #854d0e;
  border-radius: 2px;
  padding: 0 2px;
}

.dark mark {
  background: #854d0e;
  color: #fef08a;
}

/* ---------- TOC ---------- */
.toc-link {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}

.toc-link:hover {
  color: var(--primary);
  background: var(--primary-lighter);
}

.toc-link.active,
.toc-link.text-blue-600 {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-lighter);
  font-weight: 500;
}

/* ---------- Guided input ---------- */
.guided-category-card {
  padding: 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: left;
  position: relative;
}

.guided-category-card:hover {
  border-color: var(--primary);
  background: var(--primary-lighter);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.guided-category-card:active {
  transform: translateY(0);
}

.dark .guided-category-card {
  background: var(--surface-elevated);
}

.dark .guided-category-card:hover {
  background: var(--primary-lighter);
}

/* Guided scenario card */
.guided-scenario-card {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.guided-scenario-card:hover {
  border-color: var(--primary);
  background: var(--primary-lighter);
  transform: translateX(4px);
}

.dark .guided-scenario-card {
  background: var(--surface-elevated);
}

.dark .guided-scenario-card:hover {
  background: var(--primary-lighter);
}

/* Guided option buttons (AI chat) */
.guided-option-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.guided-option-btn:hover {
  border-color: #8b5cf6;
  background: #f5f3ff;
  color: #7c3aed;
}

.dark .guided-option-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
  color: #a78bfa;
}

.guided-option-btn:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Guided form input */
.guided-field-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  outline: none;
}

.guided-field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--surface);
}

.guided-field-input::placeholder {
  color: var(--text-muted);
}

/* ---------- Guided CTA Link ---------- */
.guided-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  transition: all var(--transition-normal);
}

.guided-cta-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.04);
}

.guided-cta-link i {
  color: var(--primary);
  opacity: 0.7;
}

.guided-cta-link:hover i {
  opacity: 1;
}

/* ---------- Guided Overlay ---------- */
.guided-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  padding: 1rem;
  animation: guidedFadeIn 0.2s ease-out;
}

.dark .guided-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.guided-overlay-content {
  width: 100%;
  max-width: 40rem;
  max-height: 85vh;
  overflow-y: auto;
}

/* ---------- Version badge ---------- */
.version-badge {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* ---------- Mobile responsive ---------- */
@media (max-width: 640px) {
  .code-block {
    font-size: 0.75rem;
    padding: 0.75rem;
    padding-right: 2.5rem;
    border-radius: var(--radius-md);
  }

  .code-block pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Stack form: input on top, mic+submit below side by side */
  #ask-form {
    flex-wrap: wrap;
  }

  #ask-form input[type="text"] {
    width: 100%;
    flex: 1 1 100%;
  }

  #ask-form .mic-btn {
    flex-shrink: 0;
  }

  #ask-form button[type="submit"] {
    flex: 1;
  }

  /* Smaller hero text on mobile */
  .hero-gradient h2 {
    font-size: 1.75rem !important;
  }

  /* Reduce padding on mobile */
  .wiki-card {
    padding: 1rem;
  }

  .category-card {
    padding: 0.75rem;
  }

  /* Long titles: break words */
  h1, h2, h3 {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Guided input mobile tweaks */
  .guided-overlay {
    padding: 0.5rem;
  }

  .guided-overlay-content {
    max-height: 90vh;
  }

  .guided-category-card {
    padding: 0.75rem;
  }

  .guided-category-card .w-10 {
    width: 2rem;
    height: 2rem;
  }

  .guided-scenario-card {
    padding: 0.75rem;
  }

  .guided-option-btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
  }

  #guided-chat-messages {
    max-height: 60vh;
  }

  /* Larger touch targets on mobile */
  button, .wiki-card, .category-card,
  .guided-category-card, .guided-scenario-card, .pagination-btn,
  .mobile-nav-item, [role="button"] {
    min-height: 2.5rem;
  }

  .pagination-btn {
    min-width: 2.5rem;
    height: 2.5rem;
  }

  /* Wiki detail header actions stack */
  #wiki-detail-content header .flex.items-center.gap-2.mt-3 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Form inputs full-width on mobile */
  input[type="text"], input[type="password"], input[type="email"],
  textarea, select {
    font-size: 16px; /* Prevent iOS zoom on focus */
  }

  /* Toast position on mobile */
  #toast-container {
    top: auto !important;
    bottom: 4.5rem;
    left: 1rem;
    right: 1rem;
  }

  /* Category grid tighter on mobile */
  .grid.grid-cols-2 {
    gap: 0.5rem;
  }

  /* Example cards single column on very small */
  .grid.grid-cols-1.sm\\:grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

}

/* Guided buttons stack on very small screens */
@media (max-width: 420px) {
  .guided-step-enter .flex.gap-2:last-child {
    flex-direction: column;
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
  .category-card {
    padding: 0.75rem;
  }

  /* Hero gradient padding adjustment */
  .hero-gradient .max-w-6xl {
    padding-top: 2rem;
    padding-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

}

/* Safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(37, 99, 235, 0.2);
  color: inherit;
}

/* ---------- Accessibility: Focus visible ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Interactive cards: keyboard focus */
.wiki-card:focus-visible,
.category-card:focus-visible,
.guided-category-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

/* ---------- Reduced motion ---------- */
@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;
  }

  .page-enter {
    animation: none;
  }

  .spinner {
    animation: spin 1.5s linear infinite;
  }
}

/* ---------- Long content overflow ---------- */
.prose-answer {
  overflow-wrap: break-word;
  word-break: break-word;
}

.prose-answer pre {
  overflow-x: auto;
}

.prose-answer img {
  max-width: 100%;
  height: auto;
}

.prose-answer table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* ---------- Code block scroll hint ---------- */
.code-block {
  position: relative;
}

.code-block::after {
  content: '';
  position: absolute;
  top: 0;
  right: 2.5rem;
  bottom: 0;
  width: 1.5rem;
  background: linear-gradient(to right, transparent, #1e293b);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.code-block:hover::after {
  opacity: 0;
}

/* ---------- Pagination responsive ---------- */
@media (max-width: 480px) {
  .pagination-btn {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }
}

/* ---------- Upload zone ---------- */
.upload-zone {
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.upload-zone.drag-over {
  border-color: var(--primary) !important;
  background-color: rgba(59, 130, 246, 0.05);
}

.dark .upload-zone.drag-over {
  background-color: rgba(59, 130, 246, 0.1);
}

/* ---------- Mobile bottom nav ---------- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 0.375rem 0;
  padding-bottom: max(0.375rem, env(safe-area-inset-bottom));
}

.dark .mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.92);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  min-width: 3rem;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary);
}

/* ==========================================
   Text truncation utilities
   (explicit fallback for Tailwind CDN
   not generating these for dynamic content)
   ========================================== */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Trending page — hide chevron on very narrow screens */
@media (max-width: 400px) {
  .trending-chevron {
    display: none;
  }
}

/* Moderation tab bar — reduce padding on narrow screens */
@media (max-width: 420px) {
  .mod-tab {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.75rem;
  }
}

