/* ============ 设计令牌 ============ */
:root {
  --bg: #0a0c12;
  --bg-soft: #10131c;
  --surface: #141926;
  --surface-2: #1a2030;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eaeef7;
  --muted: #8b95ad;
  --muted-2: #5d6678;
  --accent-1: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #6366f1;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --yt: #ff3b3b;
  --tk: #2ee6dc;
  --ok: #34d399;
  --err: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============ 背景装饰 ============ */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(600px 300px at 15% -5%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(700px 350px at 90% 0%, rgba(236, 72, 153, 0.14), transparent 60%),
    radial-gradient(500px 300px at 50% 110%, rgba(99, 102, 241, 0.12), transparent 60%);
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* ============ 头部 ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(20px, calc((100vw - 1040px) / 2));
  background: rgba(10, 12, 18, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.brand-name em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; gap: 6px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 13px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ============ Hero ============ */
.hero {
  text-align: center;
  padding: 64px 20px 40px;
  max-width: 820px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}
.hero h1 {
  font-size: clamp(30px, 5.5vw, 46px);
  line-height: 1.2;
  margin: 22px 0 14px;
  letter-spacing: 0.3px;
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}
.hero-platforms {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
}
.chip-youtube { background: rgba(255, 59, 59, 0.12); color: #ff9b9b; border-color: rgba(255, 59, 59, 0.35); }
.chip-tiktok { background: rgba(46, 230, 220, 0.1); color: #7bf3ec; border-color: rgba(46, 230, 220, 0.3); }

/* ============ 工具卡片 ============ */
.tool { max-width: 720px; margin: 0 auto; padding: 10px 20px 30px; }
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.tool-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
textarea {
  width: 100%;
  min-height: 92px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.6;
  padding: 14px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea::placeholder { color: var(--muted-2); }
textarea:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }

.tool-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.detect {
  flex: 1;
  font-size: 13px;
  color: var(--muted-2);
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.detect.is-youtube { color: #ff9b9b; }
.detect.is-tiktok { color: #7bf3ec; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 110px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.35);
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 26px rgba(139, 92, 246, 0.45); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; filter: saturate(0.6); }

.spinner {
  width: 17px; height: 17px;
  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); } }

.status { margin: 12px 2px 0; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.status.error { color: var(--err); }
.status.ok { color: var(--ok); }

/* ============ 结果 ============ */
.result {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: rise 0.4s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.result-head {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.thumb {
  position: relative;
  flex-shrink: 0;
  width: 128px;
  height: 76px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: none; }
.badge {
  position: absolute;
  left: 6px; bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(4px);
}
.badge.youtube { color: #ff9b9b; }
.badge.tiktok { color: #7bf3ec; }

.result-info { flex: 1; min-width: 0; }
.result-info h2 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.muted { color: var(--muted); margin: 0; font-size: 13.5px; }

.actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn-accent {
  background: var(--grad);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}
.btn-accent:hover { background: var(--grad); filter: brightness(1.1); }

.player-wrap { background: #000; }
.player-wrap video {
  width: 100%;
  max-height: 480px;
  display: block;
}
.player-empty {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted-2);
}
.player-empty p { margin: 0; font-size: 13px; }

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}
.image-list a { display: block; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.image-list img { width: 100%; display: block; aspect-ratio: 3/4; object-fit: cover; transition: transform 0.25s; }
.image-list a:hover img { transform: scale(1.04); }

/* ============ 通用区块 ============ */
.section { max-width: 1040px; margin: 0 auto; padding: 56px 20px; }
.section-title {
  text-align: center;
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 34px;
  letter-spacing: 0.3px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.feature-ico {
  display: inline-grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.ico-1 { background: rgba(139, 92, 246, 0.14); color: #a78bfa; }
.ico-2 { background: rgba(236, 72, 153, 0.12); color: #f9a8d4; }
.ico-3 { background: rgba(46, 230, 220, 0.1); color: #7bf3ec; }
.feature-card h3 { margin: 0 0 8px; font-size: 16px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13.5px; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  text-align: center;
}
.step {
  position: relative;
  padding: 26px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 15.5px; }
.step p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 20px 40px;
  text-align: center;
  margin-top: 30px;
}
.footer-brand { font-weight: 700; margin: 0 0 6px; }
.footer-note { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.footer-copy { color: var(--muted-2); font-size: 12.5px; margin: 0; }

/* ============ 历史 ============ */
.history {
  max-width: 720px;
  margin: 20px auto 0;
  animation: rise 0.4s ease;
}
.history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 4px 10px;
}
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.history-item:hover { background: var(--surface-2); border-color: var(--border-strong); }
.history-item img, .history-noimg {
  flex-shrink: 0;
  width: 56px; height: 40px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--bg-soft);
}
.history-text { min-width: 0; }
.history-title {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 2px;
  color: var(--text);
  font-weight: 500;
}
.history-meta { font-size: 12px; color: var(--muted-2); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  max-width: min(90vw, 420px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); color: var(--err); }

/* ============ 隐藏 ============ */
.hidden { display: none !important; }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .hero { padding-top: 44px; }
  .result-head { flex-direction: column; }
  .thumb { width: 100%; height: 168px; }
  .tool-bar { flex-direction: column; }
  .detect { min-height: 18px; }
  .btn-primary { width: 100%; }
}
