/* ==========================================================================
   PanSou Hub - Apple Glassmorphism / iOS 18 Design System
   Unified Web & Mobile App Shell Design Tokens
   ========================================================================== */

:root {
  --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --apple-blue: #007AFF;
  --apple-blue-hover: #0062E3;
  --apple-blue-rgb: 0, 122, 255;
  --apple-teal: #30B0C7;
  --apple-green: #34C759;
  --apple-green-rgb: 52, 199, 89;
  --apple-indigo: #5856D6;
  --apple-orange: #FF9500;
  --apple-red: #FF3B30;
  --apple-purple: #AF52DE;
  
  --apple-bg: #F2F2F7;
  --apple-bg-secondary: #E5E5EA;
  --apple-surface: #FFFFFF;
  --apple-glass-bg: rgba(255, 255, 255, 0.82);
  --apple-glass-bg-hover: rgba(255, 255, 255, 0.94);
  --apple-glass-border: rgba(255, 255, 255, 0.85);
  --apple-glass-border-subtle: rgba(0, 0, 0, 0.06);
  --apple-specular: rgba(255, 255, 255, 0.95);
  
  --apple-text: #1C1C1E;
  --apple-text-secondary: #48484A;
  --apple-text-muted: #8E8E93;
  --apple-text-tertiary: #C7C7CC;
  
  --apple-radius-sm: 8px;
  --apple-radius-md: 14px;
  --apple-radius-card: 18px;
  --apple-radius-lg: 22px;
  --apple-radius-capsule: 9999px;
  --apple-radius-tabbar: 32px;
  
  --apple-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --apple-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --apple-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --apple-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
  --apple-shadow-tabbar: 0 10px 30px rgba(0, 0, 0, 0.12);
  
  --apple-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --apple-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ==========================================================================
   1. Strict Viewport & Anti-Zoom / Anti-Pinch Lock
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: var(--apple-font);
  background: var(--apple-bg);
  color: var(--apple-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Strict touch & zoom prevention */
  touch-action: pan-x pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

/* Allow text selection inside inputs and textareas */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: auto !important;
  user-select: auto !important;
  touch-action: auto !important;
  font-family: inherit;
}

/* Apple Fluid Aurora Ambient Glow Layer */
.bg-decorative {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -10;
  pointer-events: none;
  opacity: 0.95;
  background-image: 
    radial-gradient(circle at 10% 12%, rgba(0, 199, 190, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(0, 122, 255, 0.16) 0%, transparent 48%),
    radial-gradient(circle at 50% 45%, rgba(88, 86, 214, 0.08) 0%, transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(255, 149, 0, 0.10) 0%, transparent 42%),
    radial-gradient(circle at 15% 85%, rgba(52, 199, 89, 0.10) 0%, transparent 45%);
  background-size: 100% 100%;
  filter: blur(48px);
  animation: appleAuroraFlow 24s ease-in-out infinite alternate;
}

@keyframes appleAuroraFlow {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.04) translate(-1%, -1%); }
  100% { transform: scale(1) translate(1%, 0.5%); }
}

/* Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
}

/* App Root Container */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
}

/* Container Limit */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   2. Top Navigation Bar (Safari Frosted Glass Header)
   ========================================================================== */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: var(--apple-glass-bg);
  border-bottom: 1px solid var(--apple-glass-border);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.03), inset 0 -1px 0 rgba(0, 0, 0, 0.02);
  transition: all 0.3s var(--apple-spring);
}

.nav-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 16px;
  max-width: 960px;
  margin: 0 auto;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.brand-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 122, 255, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.brand-icon-wrapper svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--apple-text);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--apple-text-muted);
}

.header-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.28);
  border-radius: var(--apple-radius-capsule);
  font-size: 12px;
  font-weight: 600;
  color: #248A3D;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.8);
  animation: pulseGreen 2.2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ==========================================================================
   3. Floating Bottom TabBar (Web / Standalone Browser Fallback)
   ========================================================================== */
.web-tab-bar {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 440px;
  height: 64px;
  border-radius: var(--apple-radius-tabbar);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--apple-shadow-tabbar), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 6px;
  transition: transform 0.3s var(--apple-spring), opacity 0.3s ease;
}

/* Top Specular Sheen line for Apple Glass */
.web-tab-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  pointer-events: none;
}

/* When inside App Shell, hide Web Tab Bar (Native Shell provides the TabBar) */
.in-app-shell .web-tab-bar {
  display: none !important;
}

.web-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-decoration: none;
  color: var(--apple-text-muted);
  font-size: 11px;
  font-weight: 500;
  border-radius: 24px;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s var(--apple-spring);
  position: relative;
}

.web-tab-item:active {
  transform: scale(0.92);
}

.web-tab-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--apple-spring);
}

.web-tab-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.web-tab-item.active {
  color: var(--apple-blue);
  font-weight: 600;
}

.web-tab-item.active .web-tab-icon {
  transform: translateY(-1px) scale(1.08);
}

.web-tab-active-pill {
  position: absolute;
  inset: 4px;
  background: rgba(0, 122, 255, 0.10);
  border-radius: 20px;
  z-index: -1;
}

/* ==========================================================================
   4. Route Views Container & Animations
   ========================================================================== */
.route-view {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s var(--apple-spring);
}

.route-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   5. ROUTE 1: 盘搜影视 (PanSou Search)
   ========================================================================== */
.hero-search-section {
  padding-top: 24px;
  padding-bottom: 16px;
  text-align: center;
}

.hero-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--apple-radius-capsule);
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.16);
  color: var(--apple-blue);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-main-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--apple-text);
  margin: 0 0 8px 0;
}

.hero-main-desc {
  font-size: 14px;
  color: var(--apple-text-secondary);
  margin: 0 0 20px 0;
}

/* Capsule Search Bar */
.search-bar-wrapper {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--apple-radius-capsule);
  padding: 6px 8px 6px 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transition: all 0.25s var(--apple-spring);
}

.search-input-box:focus-within {
  border-color: var(--apple-blue);
  box-shadow: 0 6px 30px rgba(0, 122, 255, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.search-icon-left {
  width: 20px;
  height: 20px;
  color: var(--apple-text-muted);
  margin-right: 10px;
  flex-shrink: 0;
}

.search-icon-left svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.search-input-field {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--apple-text);
  outline: none;
  min-width: 0;
}

.search-input-field::placeholder {
  color: var(--apple-text-muted);
  font-weight: 400;
}

.clear-search-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: var(--apple-text-muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 8px;
  padding: 0;
  transition: all 0.2s;
}

.clear-search-btn.show {
  display: flex;
}

.clear-search-btn:hover {
  background: rgba(0, 0, 0, 0.16);
  color: var(--apple-text);
}

.submit-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--apple-radius-capsule);
  background: linear-gradient(135deg, #007AFF 0%, #0056B3 100%);
  color: #FFFFFF;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 122, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.2s var(--apple-spring);
  flex-shrink: 0;
}

.submit-search-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.25);
}

.submit-search-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Recommendations & Trending Pills */
.recommend-pills-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 0 8px;
}

.recommend-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rec-pill {
  padding: 5px 12px;
  border-radius: var(--apple-radius-capsule);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--apple-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--apple-spring);
  backdrop-filter: blur(10px);
}

.rec-pill:hover {
  background: #FFFFFF;
  color: var(--apple-blue);
  border-color: rgba(0, 122, 255, 0.3);
  transform: translateY(-1px);
}

.rec-pill:active {
  transform: scale(0.94);
}

/* Drive Filter Pills Bar */
.filter-pills-container {
  margin: 18px 0 14px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-pills-container::-webkit-scrollbar {
  display: none;
}

.filter-pills-list {
  display: inline-flex;
  gap: 8px;
  padding: 2px 4px;
}

.filter-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--apple-radius-capsule);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--apple-text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--apple-spring);
  box-shadow: var(--apple-shadow-xs);
}

.filter-pill-item:hover {
  background: #FFFFFF;
  border-color: rgba(0, 122, 255, 0.3);
  transform: translateY(-1px);
}

.filter-pill-item.active {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  color: #FFFFFF;
  box-shadow: 0 3px 12px rgba(0, 122, 255, 0.35);
}

.filter-pill-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-pill-icon img, .filter-pill-icon svg {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.filter-pill-badge {
  padding: 1px 7px;
  border-radius: var(--apple-radius-capsule);
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: var(--apple-text-secondary);
}

.filter-pill-item.active .filter-pill-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}

/* Results Header Bar */
.results-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
  font-size: 13px;
  color: var(--apple-text-secondary);
}

.results-summary-count {
  font-weight: 700;
  color: var(--apple-blue);
}

/* Skeleton Loading Cards */
.skeleton-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--apple-radius-card);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--apple-shadow-xs);
  overflow: hidden;
  position: relative;
}

.skeleton-poster {
  width: 80px;
  height: 106px;
  border-radius: 12px;
  background: #E5E5EA;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.skeleton-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.skeleton-line {
  height: 16px;
  border-radius: 6px;
  background: #E5E5EA;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.full { width: 95%; }

.skeleton-pills {
  display: flex;
  gap: 6px;
}

.skeleton-pill {
  width: 60px;
  height: 22px;
  border-radius: var(--apple-radius-capsule);
  background: #E5E5EA;
  position: relative;
  overflow: hidden;
}

/* Shimmer Animation */
.shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Media Cards Stream */
.media-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.media-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--apple-radius-card);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.25s var(--apple-spring);
  position: relative;
}

.media-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
}

.media-poster-wrap {
  width: 84px;
  height: 116px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 100%);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

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

.media-card:hover .media-poster-img {
  transform: scale(1.05);
}

.media-poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  padding: 6px;
  text-align: center;
}

.media-poster-fallback svg {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  fill: currentColor;
}

.media-poster-fallback span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.media-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.media-title-row {
  margin-bottom: 6px;
}

.media-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--apple-text);
  line-height: 1.35;
  margin: 0 0 6px 0;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

/* Apple HIG Quality & Attribute Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-4k {
  background: rgba(175, 82, 222, 0.14);
  color: #8944AB;
  border: 1px solid rgba(175, 82, 222, 0.28);
}

.badge-dv {
  background: rgba(0, 122, 255, 0.14);
  color: #0062E3;
  border: 1px solid rgba(0, 122, 255, 0.28);
}

.badge-hdr {
  background: rgba(255, 149, 0, 0.14);
  color: #D47B00;
  border: 1px solid rgba(255, 149, 0, 0.28);
}

.badge-1080p {
  background: rgba(52, 199, 89, 0.14);
  color: #248A3D;
  border: 1px solid rgba(52, 199, 89, 0.28);
}

.badge-remux {
  background: rgba(88, 86, 214, 0.14);
  color: #4B49B8;
  border: 1px solid rgba(88, 86, 214, 0.28);
}

.badge-bluray {
  background: rgba(48, 176, 199, 0.14);
  color: #1F8D9F;
  border: 1px solid rgba(48, 176, 199, 0.28);
}

.badge-audio {
  background: rgba(255, 45, 85, 0.12);
  color: #D81E48;
  border: 1px solid rgba(255, 45, 85, 0.24);
}

.badge-complete {
  background: rgba(0, 0, 0, 0.06);
  color: var(--apple-text-secondary);
}

/* Meta Information & Drive Row */
.media-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--apple-text-muted);
}

.media-drive-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--apple-text);
}

.media-drive-tag img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.media-date-tag {
  font-size: 11px;
}

/* Actions & Password Row */
.media-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.media-password-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--apple-radius-sm);
  background: rgba(255, 149, 0, 0.12);
  border: 1px solid rgba(255, 149, 0, 0.24);
  color: #C76B00;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.media-password-box:hover {
  background: rgba(255, 149, 0, 0.20);
}

.media-password-box code {
  font-family: Menlo, Monaco, monospace;
  font-weight: 700;
  letter-spacing: 1px;
}

.media-buttons-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.btn-card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--apple-radius-capsule);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s var(--apple-spring);
}

.btn-card-action:active {
  transform: scale(0.94);
}

.btn-card-direct {
  background: var(--apple-blue);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.28);
}

.btn-card-direct:hover {
  background: var(--apple-blue-hover);
}

.btn-card-secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--apple-text-secondary);
}

.btn-card-secondary:hover {
  background: rgba(0, 0, 0, 0.10);
  color: var(--apple-text);
}

/* Empty State */
.empty-state-view {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--apple-text-muted);
  margin-bottom: 14px;
}

.empty-icon-wrap svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--apple-text-secondary);
  max-width: 320px;
  margin: 0 auto;
}

/* ==========================================================================
   6. ROUTE 2: 本地云转 (Cloud Transcode)
   ========================================================================== */
.transcode-page-wrapper {
  padding-top: 16px;
}

.m4-banner-card {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(88, 86, 214, 0.12) 0%, rgba(0, 122, 255, 0.12) 100%);
  border: 1px solid rgba(88, 86, 214, 0.25);
  border-radius: var(--apple-radius-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m4-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.m4-chip-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5856D6 0%, #AF52DE 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(88, 86, 214, 0.35);
}

.m4-chip-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.m4-banner-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 4px;
}

.m4-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.m4-tag-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.75);
  color: var(--apple-indigo);
  border: 1px solid rgba(88, 86, 214, 0.18);
}

.m4-power-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--apple-radius-capsule);
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.25);
  font-size: 12px;
  font-weight: 700;
  color: #248A3D;
}

/* Transcode Section Cards */
.section-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--apple-radius-card);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--apple-shadow-sm);
  margin-bottom: 16px;
}

.section-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* File Queue Grid */
.file-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.file-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--apple-radius-md);
  background: rgba(0, 0, 0, 0.025);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--apple-spring);
}

.file-queue-item:hover {
  background: rgba(0, 122, 255, 0.04);
  border-color: rgba(0, 122, 255, 0.2);
}

.file-queue-item.selected {
  background: rgba(0, 122, 255, 0.08);
  border-color: var(--apple-blue);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
}

.file-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: #E5E5EA;
  color: var(--apple-text);
}

.file-queue-item.selected .file-icon-box {
  background: var(--apple-blue);
  color: #fff;
}

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

.file-name-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta-text {
  font-size: 11px;
  color: var(--apple-text-muted);
  margin-top: 2px;
}

/* Format Category Matrix */
.format-category-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.fmt-cat-tab {
  padding: 6px 14px;
  border-radius: var(--apple-radius-capsule);
  background: rgba(0, 0, 0, 0.05);
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.fmt-cat-tab.active {
  background: var(--apple-blue);
  color: #FFFFFF;
}

.formats-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.fmt-pill {
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text);
  cursor: pointer;
  transition: all 0.2s var(--apple-spring);
}

.fmt-pill.active {
  background: var(--apple-indigo);
  border-color: var(--apple-indigo);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(88, 86, 214, 0.3);
}

/* Parameters Row */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.option-box {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.option-box label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-text-muted);
  margin-bottom: 4px;
}

.option-box select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text);
  outline: none;
}

/* Transcode Progress & Terminal */
.start-transcode-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--apple-radius-card);
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  color: #FFFFFF;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.35);
  transition: all 0.2s var(--apple-spring);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.start-transcode-btn:active {
  transform: scale(0.98);
}

.progress-container {
  margin-top: 16px;
  display: none;
}

.progress-container.show {
  display: block;
}

.progress-bar-bg {
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #007AFF, #5856D6);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-text-secondary);
}

.terminal-logs-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #1C1C1E;
  color: #34C759;
  font-family: Menlo, Monaco, monospace;
  font-size: 11px;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
}

/* ==========================================================================
   7. ROUTE 3: 主机监控 (Host Monitor)
   ========================================================================== */
.monitor-page-wrapper {
  padding-top: 16px;
}

.host-overview-card {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--apple-radius-card);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--apple-shadow-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.host-name-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--apple-text);
  margin-bottom: 4px;
}

.host-specs-line {
  font-size: 12px;
  color: var(--apple-text-secondary);
}

.refresh-spin-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--apple-text);
  transition: all 0.3s ease;
}

.refresh-spin-btn:hover {
  background: rgba(0, 0, 0, 0.10);
}

.refresh-spin-btn.spinning {
  animation: spin 0.8s linear infinite;
}

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

/* System Metric Cards Grid */
.metrics-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--apple-radius-card);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--apple-shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.metric-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-text-muted);
}

.metric-icon-small {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.metric-main-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--apple-text);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.metric-sub-label {
  font-size: 11px;
  color: var(--apple-text-secondary);
}

.metric-bar-bg {
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 8px;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Docker Services List */
.service-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.service-status-row:last-child {
  border-bottom: none;
}

.service-info-col {
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.6);
}

.service-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--apple-text);
}

.service-desc {
  font-size: 11px;
  color: var(--apple-text-muted);
}

.service-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(52, 199, 89, 0.12);
  color: #248A3D;
}

/* Quick Actions Grid */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.quick-action-btn {
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s var(--apple-spring);
}

.quick-action-btn:hover {
  background: rgba(0, 122, 255, 0.1);
  color: var(--apple-blue);
}

.quick-action-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   8. Apple Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.apple-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--apple-radius-capsule);
  background: rgba(28, 28, 30, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: toastPop 0.3s var(--apple-spring);
}

@keyframes toastPop {
  0% { transform: translateY(-10px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .hero-main-title { font-size: 24px; }
  .media-card { padding: 12px; gap: 10px; }
  .media-poster-wrap { width: 72px; height: 100px; }
  .media-title { font-size: 15px; }
  .metrics-grid-2x2 { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Apple Glassmorphism UI Polish & SVG Reset
   ========================================================================== */

/* 1. 彻底强制限制所有 SVG 尺寸，根除巨大失控图标 */
svg {
  max-width: 100% !important;
}
.apple-open-link-btn svg,
.media-actions-row svg,
.search-icon-left svg,
.brand-icon-wrapper svg {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
  fill: currentColor !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

/* 2. 打开网盘蓝色胶囊按钮 */
.media-actions-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 14px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.apple-open-link-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  background: linear-gradient(135deg, #007AFF 0%, #0062E3 100%) !important;
  color: #FFFFFF !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 3px 12px rgba(0, 122, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}
.apple-open-link-btn:hover {
  background: linear-gradient(135deg, #0A84FF 0%, #0070F3 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 5px 16px rgba(0, 122, 255, 0.45) !important;
}
.apple-open-link-btn:active {
  transform: scale(0.96) !important;
}

/* 3. 提取码复制胶囊小药丸 */
.apple-pwd-capsule {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 16px !important;
  border-radius: 9999px !important;
  background: rgba(0, 122, 255, 0.08) !important;
  border: 1px solid rgba(0, 122, 255, 0.22) !important;
  color: #007AFF !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  backdrop-filter: blur(10px) !important;
}
.apple-pwd-capsule:hover {
  background: rgba(0, 122, 255, 0.16) !important;
  border-color: rgba(0, 122, 255, 0.38) !important;
  transform: scale(1.03) !important;
}
.apple-pwd-capsule:active {
  transform: scale(0.96) !important;
}
.apple-pwd-capsule.copied {
  background: rgba(52, 199, 89, 0.16) !important;
  border-color: rgba(52, 199, 89, 0.4) !important;
  color: #248A3D !important;
}
.pwd-action {
  background: rgba(0, 122, 255, 0.15) !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
}
.apple-pwd-capsule.copied .pwd-action {
  background: rgba(52, 199, 89, 0.25) !important;
}

/* 4. 网盘筛选药丸全毛玻璃化 (Pill Shape) */
.filter-pills-container {
  max-width: 960px !important;
  margin: 16px auto !important;
  padding: 0 16px !important;
}
.filter-pills-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: flex-start !important;
}
.filter-pill-item {
  display: inline-flex !important;
  align-items: center !important;
  padding: 7px 16px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(0, 0, 0, 0.07) !important;
  color: #48484A !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.filter-pill-item:hover {
  background: #FFFFFF !important;
  color: #007AFF !important;
  border-color: rgba(0, 122, 255, 0.3) !important;
  transform: translateY(-1px) !important;
}
.filter-pill-item.active {
  background: linear-gradient(135deg, #007AFF 0%, #00C7BE 100%) !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35) !important;
  transform: scale(1.02) !important;
}

/* 5. 影视卡片流毛玻璃与独立徽章 */
.media-cards-grid {
  max-width: 960px !important;
  margin: 0 auto !important;
  padding: 0 16px 100px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}
.media-card {
  display: flex !important;
  align-items: flex-start !important;
  gap: 16px !important;
  padding: 16px 18px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.95) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.media-card:hover {
  transform: translateY(-2px) !important;
  background: #FFFFFF !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07), inset 0 1px 1px rgba(255, 255, 255, 1) !important;
}
.media-poster-wrap {
  width: 86px !important;
  height: 120px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}
.media-poster-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* 徽章 Badge 独立高亮 */
.media-badges-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
}
.badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
.badge-dv {
  background: rgba(0, 122, 255, 0.12) !important;
  color: #007AFF !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
}
.badge-4k {
  background: rgba(175, 82, 222, 0.14) !important;
  color: #8944AB !important;
  border: 1px solid rgba(175, 82, 222, 0.28) !important;
}
.badge-complete {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #636366 !important;
}

.media-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1C1C1E !important;
  line-height: 1.45 !important;
  margin: 0 !important;
  letter-spacing: -0.2px !important;
}

.stats-pill-bar {
  max-width: 960px !important;
  margin: 10px auto 14px auto !important;
  padding: 0 16px !important;
  display: flex !important;
}
.stats-info-text {
  display: inline-flex !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  font-size: 12px !important;
  color: #636366 !important;
  font-weight: 500 !important;
  backdrop-filter: blur(10px) !important;
}
