/* ============================================================
   AeroFetch · Aero Design System
   暗黑渐变 + 极光微光 + 毛玻璃 + 霓虹渐变点缀
   ============================================================ */

:root {
  --bg-from: #0f172a;
  --bg-to: #1e1b4b;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-strong: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-violet: #a855f7;
  --accent-blue: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
  --danger: #f87171;
  --success: #34d399;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 24px 60px -12px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(160deg, var(--bg-from) 0%, #131233 55%, var(--bg-to) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(168, 85, 247, 0.4); }

svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }

/* ---------------- 极光氛围背景 ---------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  filter: blur(90px) saturate(130%);
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.45;
  animation: aurora-drift 18s ease-in-out infinite alternate;
}

.aurora-blob--violet {
  width: 46vw; height: 46vw;
  top: -12vw; left: -8vw;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
}

.aurora-blob--blue {
  width: 40vw; height: 40vw;
  bottom: -10vw; right: -6vw;
  background: radial-gradient(circle, #2563eb 0%, transparent 70%);
  animation-delay: -6s;
}

.aurora-blob--pink {
  width: 30vw; height: 30vw;
  top: 35%; left: 55%;
  background: radial-gradient(circle, #db2777 0%, transparent 70%);
  opacity: 0.25;
  animation-delay: -12s;
}

@keyframes aurora-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 4vh, 0) scale(1.15); }
}

/* ---------------- 布局骨架 ---------------- */
.container {
  width: min(880px, 100% - 40px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 48px;
}

.site-header {
  width: min(880px, 100% - 40px);
  margin: 0 auto;
  padding: 26px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name em {
  font-style: normal;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-footer {
  padding: 28px 20px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--text-primary);
  transform: scale(1.05);
  text-shadow: 0 0 18px rgba(168, 85, 247, 0.6);
}

.footer-links svg { width: 1.05em; height: 1.05em; }

/* ---------------- Hero ---------------- */
.hero { text-align: center; padding: 8px 0 12px; }

.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

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

.hero-subtitle {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
}

/* ---------------- 毛玻璃卡片 ---------------- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-card);
  padding: 26px;
}

.hidden { display: none !important; }

/* ---------------- 输入解析区 ---------------- */
.input-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

#share-url-input {
  width: 100%;
  height: 58px;
  padding: 0 96px 0 50px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.98rem;
  transition: var(--transition);
}

#share-url-input::placeholder { color: var(--text-muted); }

#share-url-input:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.65);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
}

.chip-btn {
  position: absolute;
  right: 10px;
  padding: 7px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-bg-strong);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  color: var(--text-primary);
  border-color: rgba(168, 85, 247, 0.6);
  transform: scale(1.02);
}

.chip-btn--danger { position: static; }
.chip-btn--danger:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.5); }

.input-hint {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------------- 支持平台栏 ---------------- */
.platform-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.platform-bar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 2px;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: default;
}

.platform-chip:hover {
  transform: scale(1.05);
  color: var(--text-primary);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.25);
}

.platform-chip svg { width: 1.05em; height: 1.05em; }

.platform-chip--douyin svg { color: #25f4ee; filter: drop-shadow(1px 1px 0 #fe2c55); }
.platform-chip--tiktok svg { color: #fe2c55; filter: drop-shadow(-1px -1px 0 #25f4ee); }
.platform-chip--x svg { color: #ffffff; }
.platform-chip--soon { opacity: 0.5; }
.platform-chip--soon svg { color: #ff0000; }

/* ---------------- 按钮体系 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 26px;
  height: 58px;
  border: none;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-gradient);
  box-shadow: 0 10px 30px -6px rgba(124, 58, 237, 0.55);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 14px 42px -4px rgba(124, 58, 237, 0.8),
              0 0 24px rgba(59, 130, 246, 0.35);
}

.btn-ghost {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-ghost:hover {
  transform: scale(1.02);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.25);
}

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

.btn[aria-disabled="true"], .btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn-block { width: 100%; height: 52px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  transform: scale(1.05) rotate(12deg);
  border-color: rgba(168, 85, 247, 0.6);
}

/* 解析中的旋转指示 */
.btn .spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------------- 错误提示 ---------------- */
.error-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.94rem;
}

/* ---------------- 骨架屏 ---------------- */
.skeleton-card { display: flex; flex-direction: column; gap: 16px; }

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.09),
    rgba(168, 85, 247, 0.12),
    transparent);
  animation: shimmer 1.6s ease-in-out infinite;
}

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

.skeleton-author { display: flex; align-items: center; gap: 14px; }
.skeleton-avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; }
.skeleton-author-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line { height: 14px; }
.skeleton-media { height: 320px; border-radius: var(--radius-md); }
.skeleton-actions { display: flex; gap: 12px; }
.skeleton-btn { height: 52px; flex: 1; border-radius: var(--radius-md); }

.w-24 { width: 24%; } .w-40 { width: 40%; }
.w-70 { width: 70%; } .w-90 { width: 90%; }

/* ---------------- 结果卡片 ---------------- */
.result-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.author-info { display: flex; align-items: center; gap: 14px; min-width: 0; }

.author-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  background: var(--accent-gradient) border-box;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}

.author-meta { display: flex; flex-direction: column; min-width: 0; }

.author-nickname {
  font-weight: 700;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-uid { color: var(--text-muted); font-size: 0.84rem; }

.platform-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
}

.platform-badge--tiktok {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.platform-badge--twitter {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #e2e8f0;
}

.video-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.stats-row {
  display: flex;
  gap: 26px;
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.stat-item { display: flex; align-items: center; gap: 7px; }
.stat-item svg { color: var(--accent-violet); }

/* ---------------- 媒体预览 ---------------- */
.media-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
}

#video-player {
  display: block;
  width: 100%;
  max-height: 540px;
  background: #000;
}

/* ---------------- 图集轮播 ---------------- */
.carousel { position: relative; }

.carousel-viewport { overflow: hidden; }

.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-slide {
  position: relative;
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  background: #000;
}

.carousel-slide img {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: contain;
}

.slide-open-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.slide-open-btn:hover {
  transform: scale(1.05);
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  z-index: 2;
}

.carousel-arrow:hover {
  transform: translateY(-50%) scale(1.08);
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.45);
}

.carousel-arrow--prev { left: 14px; }
.carousel-arrow--next { right: 14px; }

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.carousel-dot {
  width: 8px; height: 8px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.carousel-dot.active {
  width: 22px;
  border-radius: 999px;
  background: var(--accent-gradient);
}

/* ---------------- 下载操作区 ---------------- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.action-grid .btn { height: 54px; padding: 0 18px; font-size: 0.92rem; }

/* ---------------- 解析历史 ---------------- */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title { font-size: 1.05rem; font-weight: 700; }

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.history-item:hover {
  background: var(--glass-bg-strong);
  border-color: rgba(168, 85, 247, 0.4);
  transform: scale(1.01);
}

.history-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.history-meta { flex: 1; min-width: 0; }

.history-desc {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-time { font-size: 0.78rem; color: var(--text-muted); }

.history-arrow { color: var(--text-muted); }

/* ---------------- 配置抽屉 ---------------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
  animation: fade-in 0.25s ease;
}

@keyframes fade-in { from { opacity: 0; } }

.settings-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100dvh;
  width: min(380px, 92vw);
  z-index: 50;
  padding: 26px;
  background: rgba(15, 23, 42, 0.85);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(105%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body { display: flex; flex-direction: column; gap: 14px; }

.field-label { font-size: 0.88rem; font-weight: 700; color: var(--text-secondary); }

.text-field {
  height: 50px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(2, 6, 23, 0.5);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  transition: var(--transition);
}

.text-field:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.65);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
}

.field-hint { font-size: 0.8rem; color: var(--text-muted); }

.field-hint code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

/* ---------------- Toast ---------------- */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 60;
  pointer-events: none;
}

.toast {
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast--success { border-color: rgba(52, 211, 153, 0.5); color: var(--success); }
.toast--error { border-color: rgba(248, 113, 113, 0.5); color: var(--danger); }

.toast.leaving { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .glass-card { padding: 20px; border-radius: 20px; }

  .input-row { flex-direction: column; }

  #parse-btn { width: 100%; }

  .stats-row { gap: 18px; flex-wrap: wrap; }

  .skeleton-media { height: 220px; }

  .action-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
