/* ============================================
   PanSou Hub - Design System
   Dark theme with glass morphism
   ============================================ */

/* CSS Variables */
:root {
  /* Colors - Dark Theme */
  --bg-primary: #06060f;
  --bg-secondary: #0c0c1d;
  --bg-card: rgba(15, 15, 35, 0.7);
  --bg-card-hover: rgba(20, 20, 50, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);

  /* Accent Gradient */
  --accent-1: #a78bfa;
  --accent-2: #6366f1;
  --accent-3: #818cf8;
  --accent-4: #06b6d4;
  --accent-gradient: linear-gradient(
    135deg,
    var(--accent-1),
    var(--accent-2),
    var(--accent-4)
  );
  --accent-glow: rgba(99, 102, 241, 0.3);

  /* Text */
  --text-primary: #f0f0ff;
  --text-secondary: rgba(240, 240, 255, 0.6);
  --text-tertiary: rgba(240, 240, 255, 0.35);
  --text-accent: var(--accent-1);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(99, 102, 241, 0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Cloud type colors */
  --color-baidu: #2196f3;
  --color-aliyun: #ff6a00;
  --color-quark: #7c5cfc;
  --color-tianyi: #1fb0e6;
  --color-uc: #ffb800;
  --color-115: #ff4444;
  --color-xunlei: #0094e7;
  --color-123: #ff3d00;
  --color-pikpak: #00c853;
  --color-mobile: #43a047;
  --color-magnet: #9e9e9e;
  --color-ed2k: #795548;
  --color-unknown: #607d8b;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Selection */
::selection {
  background: var(--accent-2);
  color: white;
}

/* ============================================
   Background Effects
   ============================================ */
.bg-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-2);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-4);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.bg-orb-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-1);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* ============================================
   Header
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 6, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg-glass);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  /* 整组导航的最小占位宽度；与 logo/status 同一行放不下时自动换到下一行 */
  flex: 1 1 280px;
  justify-content: flex-end;
  box-sizing: border-box;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.nav-btn.active {
  color: var(--text-primary);
  background: var(--accent-2);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  transition: background var(--transition-normal);
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ============================================
   Main
   ============================================ */
.main {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
  min-height: calc(100vh - 60px);
}

/* Views */
.view {
  display: none;
}
.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   Search Hero
   ============================================ */
.search-hero {
  text-align: center;
  padding: 60px 0 40px;
  transition: padding var(--transition-slow);
}

.search-hero.compact {
  padding: 20px 0 16px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
  transition: all var(--transition-slow);
}

.search-hero.compact .hero-title {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.hero-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 32px;
  transition: all var(--transition-slow);
}

.search-hero.compact .hero-subtitle {
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* Search Box */
.search-box {
  max-width: 700px;
  margin: 0 auto;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 4px 4px 4px 20px;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-2);
  box-shadow:
    var(--shadow-glow),
    0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  padding: 14px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  background: var(--accent-gradient);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition:
    transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow var(--transition-normal),
    opacity var(--transition-fast);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.search-btn:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-glow), 0 0 20px rgba(99, 102, 241, 0.4);
}

.search-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

.search-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Ripple effect */
.btn-ripple-container {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
}

.btn-ripple {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: rippleAnim 0.55s ease-out forwards;
  margin-left: -4px;
  margin-top: -4px;
}

@keyframes rippleAnim {
  to {
    transform: scale(30);
    opacity: 0;
  }
}

/* Advanced Options */
.advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.advanced-toggle:hover {
  color: var(--text-primary);
}

.toggle-arrow {
  transition: transform var(--transition-normal);
}

.advanced-toggle.expanded .toggle-arrow {
  transform: rotate(180deg);
}

.advanced-panel {
  max-width: 700px;
  margin: 0 auto;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height var(--transition-slow),
    opacity var(--transition-normal);
  opacity: 0;
}

.advanced-panel.expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: 16px;
}

.advanced-grid {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-group {
  text-align: left;
}

.filter-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-tertiary);
  text-transform: none;
  letter-spacing: 0;
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill,
.check-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.radio-pill input,
.check-pill input {
  display: none;
}

.radio-pill:hover,
.check-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: var(--bg-glass-hover);
}

.radio-pill.active,
.check-pill.active {
  color: white;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.filter-inputs {
  display: flex;
  gap: 12px;
}

.filter-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 12px;
}

.filter-input-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.filter-input {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.filter-input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
   Loading
   ============================================ */
.loading-section {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  position: relative;
}

.spinner-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: spinnerRotate 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
  width: 50px;
  height: 50px;
  border-top-color: var(--accent-1);
  animation-duration: 1.2s;
}

.spinner-ring:nth-child(2) {
  width: 38px;
  height: 38px;
  border-right-color: var(--accent-2);
  animation-duration: 1.6s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  width: 26px;
  height: 26px;
  border-bottom-color: var(--accent-4);
  animation-duration: 2s;
}

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

.loading-text {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.loading-subtext {
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

/* Auto-check progress (inline in results header) */
.auto-check-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auto-check-progress {
  width: 80px;
  height: 4px;
  background: var(--bg-glass);
  border-radius: 2px;
  overflow: hidden;
}

.auto-check-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.auto-check-text {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.auto-check-text.done {
  color: #22c55e;
}

.loading-dots::after {
  content: "";
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

/* ============================================
   Results Header
   ============================================ */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.results-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.results-count {
  font-weight: 700;
  font-size: 1.2rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-keyword {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.results-keyword::before {
  content: "·";
  margin: 0 6px;
}

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

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: var(--bg-glass-hover);
}

.view-mode-toggle {
  display: flex;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-mode-btn:hover {
  color: var(--text-primary);
}

.view-mode-btn.active {
  background: var(--accent-2);
  color: white;
}

/* ============================================
   Type Tabs
   ============================================ */
.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.type-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.type-tab:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.type-tab.active {
  color: white;
  border-color: transparent;
}

.type-tab .tab-count {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.type-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.2);
}

/* Type-specific colors */
.type-tab[data-type="baidu"].active {
  background: var(--color-baidu);
}
.type-tab[data-type="aliyun"].active {
  background: var(--color-aliyun);
}
.type-tab[data-type="quark"].active {
  background: var(--color-quark);
}
.type-tab[data-type="tianyi"].active {
  background: var(--color-tianyi);
}
.type-tab[data-type="uc"].active {
  background: var(--color-uc);
}
.type-tab[data-type="115"].active {
  background: var(--color-115);
}
.type-tab[data-type="xunlei"].active {
  background: var(--color-xunlei);
}
.type-tab[data-type="123"].active {
  background: var(--color-123);
}
.type-tab[data-type="pikpak"].active {
  background: var(--color-pikpak);
}
.type-tab[data-type="mobile"].active {
  background: var(--color-mobile);
}
.type-tab[data-type="magnet"].active {
  background: var(--color-magnet);
}
.type-tab[data-type="ed2k"].active {
  background: var(--color-ed2k);
}

/* ============================================
   Results Grid
   ============================================ */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.results-grid.list-mode {
  grid-template-columns: 1fr;
}

/* Result Card */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  animation: cardIn 0.3s ease forwards;
  opacity: 0;
}

.result-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.card-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.card-action-btn.favorited {
  color: #fbbf24;
}

.card-action-btn.check-valid {
  color: #22c55e;
}

.card-action-btn.check-invalid {
  color: #ef4444;
}

.card-note {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-url {
  font-size: 0.78rem;
  color: var(--accent-4);
  word-break: break-all;
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background var(--transition-fast);
  display: block;
  text-decoration: none;
  max-height: 60px;
  overflow: hidden;
}

.card-url:hover {
  background: rgba(6, 182, 212, 0.1);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.card-password {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.card-password:hover {
  background: rgba(251, 191, 36, 0.2);
}

.card-source {
  color: var(--text-tertiary);
}

.card-date {
  color: var(--text-tertiary);
}

/* Status indicators on cards */
.card-check-status {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 8px;
}

.card-check-status.visible {
  display: inline-flex;
}

.card-check-status.valid {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.card-check-status.invalid {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.card-check-status.checking {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state p {
  margin-top: 16px;
  font-size: 0.95rem;
}

.empty-hint {
  font-size: 0.85rem !important;
  margin-top: 8px !important;
  opacity: 0.6;
}

/* ============================================
   Favorites View
   ============================================ */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.view-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
}

.view-count {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.view-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clear-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.favorites-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* Favorite card */
.fav-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition-normal);
  animation: cardIn 0.3s ease forwards;
  opacity: 0;
}

.fav-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.fav-card.fav-card-movie {
  cursor: pointer;
}

.fav-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fav-card-type {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.fav-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.fav-remove-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.fav-card-note {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.fav-card-url {
  font-size: 0.78rem;
  color: var(--accent-4);
  word-break: break-all;
  padding: 6px 8px;
  background: rgba(6, 182, 212, 0.05);
  border-radius: var(--radius-sm);
  display: block;
  text-decoration: none;
  margin-bottom: 8px;
}

.fav-card-date {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ============================================
   History View
   ============================================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  animation: cardIn 0.2s ease forwards;
  opacity: 0;
}

.history-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-accent);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-keyword {
  font-size: 0.9rem;
  font-weight: 500;
}

.history-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-glass);
  padding: 2px 8px;
  border-radius: 10px;
}

.history-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.history-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
  opacity: 0;
}

.history-item:hover .history-delete-btn {
  opacity: 1;
}

.history-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.check-progress {
  height: 4px;
  background: var(--bg-glass);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.check-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  width: 0%;
  transition: width var(--transition-normal);
}

.check-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.check-stat {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
}

.check-stat.valid {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.check-stat.invalid {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.check-stat.pending {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.check-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.check-stat.valid .check-stat-num {
  color: #22c55e;
}
.check-stat.invalid .check-stat-num {
  color: #ef4444;
}
.check-stat.pending .check-stat-num {
  color: #fbbf24;
}

.check-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.check-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.check-result-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.check-result-url {
  flex: 1;
  color: var(--text-secondary);
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   Toast
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  color: var(--text-primary);
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(20px);
}

.toast.success {
  border-left: 3px solid #22c55e;
}
.toast.error {
  border-left: 3px solid #ef4444;
}
.toast.info {
  border-left: 3px solid var(--accent-4);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  /* 头部适配 */
  .header-inner {
    padding: 8px 16px;
    min-height: 52px;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .header-nav {
    gap: 2px;
    padding: 3px;
    flex-basis: 240px;
    justify-content: center;
  }

  .nav-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .nav-btn svg {
    width: 16px;
    height: 16px;
    margin-right: 2px;
  }

  /* 隐藏文字，只留图标以节省空间（在非常窄的屏幕上），或者缩小文字的字号甚至保留文字但优化大小 */
  @media (max-width: 380px) {
    .nav-btn span,
    .nav-btn {
      font-size: 0;
    }
    .nav-btn svg {
      margin-right: 0;
    }
  }

  .header-status {
    display: none;
  }

  /* 整体主体适配 */
  .main {
    padding: 0 16px 40px;
  }

  /* 搜索区适配 */
  .hero-title {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    padding: 0 10px;
  }

  .search-hero {
    padding: 32px 0 24px;
  }

  .search-btn span {
    display: none;
  }

  .search-btn {
    padding: 10px 14px;
  }

  .search-input {
    padding: 12px 8px;
  }

  .search-input-wrapper {
    padding: 4px 4px 4px 12px;
  }

  /* 高级选项面板适配 */
  .advanced-grid {
    padding: 16px;
    gap: 12px;
  }

  .filter-group {
    width: 100%;
  }

  .radio-group,
  .checkbox-group {
    gap: 6px;
  }

  .radio-pill,
  .check-pill {
    padding: 5px 12px;
    font-size: 0.75rem;
  }

  .filter-inputs {
    flex-direction: column;
    gap: 8px;
  }

  /* 结果头部和统计适配 */
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .results-actions {
    width: 100%;
    justify-content: space-between;
  }

  .auto-check-status {
    flex: 1;
    flex-wrap: wrap;
    gap: 6px;
  }

  .auto-check-text {
    white-space: normal;
    word-break: break-word;
    font-size: 0.72rem;
    line-height: 1.4;
  }

  .type-tabs {
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .type-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  /* 卡片网格适配 */
  .results-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .favorites-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .history-item {
    padding: 10px 12px;
  }

  /* 悬浮检测层面板适配 (Modal) */
  .modal {
    width: 95%;
    margin: 0 auto;
    max-height: 85vh;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .check-stats {
    gap: 8px;
    flex-wrap: wrap; /* 允许在非常小的屏幕上换行 */
  }

  .check-stat {
    padding: 8px;
  }

  .check-stat-num {
    font-size: 1.2rem;
  }

  /* Toast适配 */
  .toast-container {
    bottom: 16px;
    left: 16px;
    right: 16px;
    align-items: center;
  }

  .toast {
    width: 100%;
    max-width: 320px; /* 或者保持原始宽度但允许居中 */
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .search-input {
    font-size: 0.9rem;
  }

  .results-count {
    font-size: 1.1rem;
  }

  /* card-meta 移动端多行排列 */
  .card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ============================================
   Password Gate
   ============================================ */
.password-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-primary);
  overflow: hidden;
}

.password-gate-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.gate-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: orbFloat 15s ease-in-out infinite;
}

.gate-orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-2);
  top: -150px;
  right: -100px;
}

.gate-orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-4);
  bottom: -120px;
  left: -80px;
  animation-delay: -7s;
}

.password-gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.08);
  animation: gateCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

@keyframes gateCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.gate-logo-icon {
  animation: logoPulse 3s ease-in-out infinite;
}

.gate-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.gate-logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gate-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.gate-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.gate-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 4px 4px 16px;
  margin-bottom: 12px;
  transition: all var(--transition-normal);
}

.gate-input-wrap:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), var(--shadow-glow);
}

.gate-input-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.gate-input {
  flex: 1;
  padding: 12px 10px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  letter-spacing: 0.05em;
}

.gate-input::placeholder {
  color: var(--text-tertiary);
  letter-spacing: 0;
}

.gate-eye-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.gate-eye-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.gate-error {
  min-height: 20px;
  font-size: 0.82rem;
  color: #ef4444;
  margin-bottom: 16px;
  text-align: left;
  padding: 0 4px;
  animation: fadeIn 0.2s ease;
}

.gate-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  background: var(--accent-gradient);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow var(--transition-normal);
  -webkit-tap-highlight-color: transparent;
}

.gate-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow), 0 4px 20px rgba(99, 102, 241, 0.4);
}

.gate-submit-btn:active {
  transform: scale(0.97) translateY(0);
}

.gate-submit-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

@keyframes shakeInput {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

@media (max-width: 480px) {
  .password-gate-card {
    padding: 32px 24px;
  }
}

/* ============================================
   Movies View
   ============================================ */
.movies-filters {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-row .filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-bottom: 0;
  min-width: 40px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.filter-pill.active {
  color: var(--accent-1);
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.3);
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.movie-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  aspect-ratio: 2 / 3;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 15px rgba(99, 102, 241, 0.2);
}

.movie-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.movie-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px 12px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.movie-card-title {
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.movie-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.movie-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fbbf24;
  font-weight: 600;
}

.movie-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}

.movies-load-more {
  display: inline-block;
  padding: 10px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}
.movies-load-more:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-2);
}

@media (max-width: 768px) {
  .movies-filters {
    padding: 12px;
    gap: 14px;
  }
  .filter-row {
    flex-wrap: nowrap;
  }
  .filter-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
    /* Webkit-mask-image is needed for safari */
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
  }
  .filter-options::-webkit-scrollbar {
    display: none;
  }
  .filter-options {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }
  .filter-pill {
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .movies-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .movies-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Hide number input spin buttons */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type="number"] { 
  -moz-appearance: textfield; 
}

/* Movie Detail Modal */
.movie-modal {
  width: 95vw;
  max-width: 1100px;
  height: 90vh;
  border-radius: 16px;
  padding: 0;
  background: var(--bg-secondary);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 防止内部内容横向撑出弹窗 */
}

.movie-modal .modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.movie-modal .modal-header h3 {
  font-size: 1.2rem;
  opacity: 0.8;
}

.movie-modal .modal-body {
  padding: 40px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* 防止横向滚动条 */
}

.movie-detail-content {
  display: flex;
  gap: 40px;
  margin-bottom: 30px;
  min-width: 0; /* 防止 flex 子元素撑破父容器 */
}

.movie-detail-left {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
}

.movie-detail-left img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.3);
  margin-bottom: 24px;
}

.movie-fav-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.movie-fav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.movie-fav-btn.favorited {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}
.movie-fav-btn.favorited svg {
  fill: #fbbf24;
}

.movie-detail-right {
  flex: 1;
  min-width: 0; /* 允许文字内容正常截断，不撑开宽度 */
  overflow: hidden;
}

.movie-detail-right h2 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
  word-break: break-word; /* 超长标题自动换行 */
}

.movie-modal-original-name {
  color: var(--text-tertiary);
  font-size: 18px;
  margin-bottom: 24px;
  font-style: italic;
}

.movie-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  align-items: center;
}

.movie-modal-meta .badge {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.movie-modal-meta .badge.rating {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-size: 16px;
}

.movie-modal-meta .movie-genres {
  color: var(--primary-light);
  font-size: 15px;
}

.movie-modal-meta .badge.episodes {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.movie-modal-section {
  margin-bottom: 32px;
}

.movie-modal-section h4 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.movie-modal-section h4::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 50%;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.movie-modal-section p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.movie-cast-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* 缩小最小宽度，防止移动端溢出 */
  gap: 20px;
}

.cast-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 12px;
  transition: background 0.3s ease;
  min-width: 0; /* 防止 flex 子元素横向溢出 */
  overflow: hidden;
}

.cast-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cast-item img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.cast-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0; /* 允许文字截断 */
  overflow: hidden;
}

.cast-name {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-character {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-modal-actions {
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 10px;
  margin-top: 20px;
  pointer-events: none;
}

.movie-search-btn {
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 99px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 20px rgba(99, 102, 241, 0.3);
}

.movie-search-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

@media (max-width: 768px) {
  .movie-modal {
    width: 100vw;
    max-width: 100vw; /* 严格限制不超出视口 */
    height: 100vh;
    max-height: none;
    border-radius: 0;
    overflow: hidden;
  }
  .movie-modal .modal-body {
    padding: 16px;
    overflow-x: hidden; /* 明确禁止横向滚动 */
  }
  .movie-detail-content {
    flex-direction: column;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
  }
  .movie-detail-left {
    flex: 0 0 auto;
    width: 180px;
    margin: 0 auto;
  }
  .movie-detail-right {
    width: 100%;
    overflow: hidden;
  }
  .movie-detail-right h2 {
    font-size: 24px;
    text-align: center;
    word-break: break-word;
  }
  .movie-modal-original-name {
    text-align: center;
    word-break: break-word;
  }
  .movie-modal-meta {
    justify-content: center;
  }
  .movie-cast-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .movie-cast-list::-webkit-scrollbar {
    height: 6px;
  }
  .cast-item {
    flex: 0 0 210px;
    min-width: 210px;
  }
  .cast-name,
  .cast-character {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }
  .movie-modal-section p {
    font-size: 14px;
    word-break: break-word;
  }
}


body.modal-open { overflow: hidden; }
.movie-modal .modal-body, .modal-body { overscroll-behavior: contain; }