:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a26;
  --border: #26263a;
  --text: #f2f2f8;
  --text-muted: #9a9ab0;
  --accent: #00e5ff;
  --accent-2: #7c5cff;
  --success: #3ddc97;
  --danger: #ff5c7a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,.8);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 1.4rem; font-weight: 800; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo-mark { color: var(--accent); }
.logo-accent { color: var(--accent); }
.site-header nav a { color: var(--text-muted); text-decoration: none; margin-left: 24px; font-size: .95rem; }
.site-header nav a:hover { color: var(--text); }

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(0,229,255,.12), transparent),
    radial-gradient(ellipse 50% 40% at 80% 10%, rgba(124,92,255,.12), transparent);
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 12px; }
.hero h1 span { color: var(--accent); }
.subtitle { color: var(--text-muted); max-width: 560px; margin: 0 auto 36px; font-size: 1.05rem; }

/* Input */
.grab-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  max-width: 720px;
  margin: 0 auto;
}
.input-wrap { display: flex; gap: 10px; }
.platform-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: center; }
.input-icon { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; align-self: center; margin-left: 6px; }
#video-url {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
#video-url:focus { border-color: var(--accent); }
/* Mode tabs */
.mode-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.mode-tab {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-muted); padding: 8px 22px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.mode-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }

.batch-area {
  width: 100%; min-height: 140px; resize: vertical;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; color: var(--text);
  font-family: inherit; font-size: .95rem; outline: none; margin-top: 10px;
}
.batch-area:focus { border-color: var(--accent); }
#grab-btn {
  display: block; width: 100%; margin-top: 14px;
  background: linear-gradient(135deg, var(--accent), #00b8d4);
  color: #000; border: none; border-radius: 10px;
  padding: 14px; font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: transform .15s, opacity .15s;
}
#grab-btn:hover { transform: translateY(-1px); }
#grab-btn:disabled { opacity: .5; cursor: wait; transform: none; }

/* Options */
.opt-group { margin-bottom: 14px; }
.opt-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 8px; }
.duration-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.8); font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
}

/* Batch results */
.batch-results { margin-top: 24px; max-width: 720px; margin-left: auto; margin-right: auto; display: flex; flex-direction: column; gap: 14px; }
.batch-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
}
.batch-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.batch-head img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--bg-elevated); flex-shrink: 0; }
.batch-meta { min-width: 0; }
.batch-title { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-sub { color: var(--text-muted); font-size: .8rem; }
.batch-actions { margin-bottom: 0; }
.batch-actions .btn { padding: 8px 14px; font-size: .85rem; }
.batch-err { color: var(--danger); font-size: .9rem; padding: 8px 0; word-break: break-all; }

.input-wrap { display: flex; gap: 10px; }
.chip { font-size: .78rem; padding: 4px 12px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); }
.chip-youtube { color: #ff4d4d; } .chip-shorts { color: #ff8c42; }
.chip-tiktok { color: #25f4ee; } .chip-instagram { color: #e1306c; }
.chip-bilibili { color: #fb7299; } .chip-x { color: #e7e9ea; }
.chip-facebook { color: #1877f2; }

/* Status */
.status {
  margin: 24px auto 0;
  max-width: 720px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: .95rem;
}
.status.loading { background: rgba(0,229,255,.08); border: 1px solid rgba(0,229,255,.3); color: var(--accent); }
.status.error { background: rgba(255,92,122,.08); border: 1px solid rgba(255,92,122,.3); color: var(--danger); }
.status.success { background: rgba(61,220,151,.08); border: 1px solid rgba(61,220,151,.3); color: var(--success); }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(0,229,255,.3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -3px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.result { margin-top: 24px; max-width: 720px; margin-left: auto; margin-right: auto; }
.result-card {
  display: flex; gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
}
.thumb-wrap { position: relative; flex-shrink: 0; width: 200px; }
.thumb-wrap img { width: 100%; border-radius: 10px; display: block; background: var(--bg-elevated); aspect-ratio: 16/9; object-fit: cover; }
.platform-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
  font-size: .7rem; font-weight: 700; padding: 2px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .5px;
}
.result-info { flex: 1; min-width: 0; }
.result-info h2 { font-size: 1.1rem; margin-bottom: 4px; word-break: break-word; }
.author { color: var(--text-muted); font-size: .9rem; margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all .15s; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #00b8d4); color: #000; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--bg-elevated); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.hint { margin-top: 12px; font-size: .8rem; color: var(--text-muted); }

/* Sections */
.section { padding: 60px 0; }
.section h2 { font-size: 1.6rem; margin-bottom: 32px; text-align: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.step {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 22px; text-align: center;
}
.step-num {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000; font-weight: 800; font-size: 1.2rem;
}
.step h3 { margin-bottom: 8px; font-size: 1.05rem; }
.step p { color: var(--text-muted); font-size: .9rem; }

/* FAQ */
details {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 12px;
}
summary { cursor: pointer; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+ "; color: var(--accent); font-weight: 800; }
details[open] summary::before { content: "− "; }
details p { margin-top: 10px; color: var(--text-muted); font-size: .92rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px; }
.site-footer p { text-align: center; color: var(--text-muted); font-size: .85rem; }

/* Responsive */
@media (max-width: 640px) {
  .result-card { flex-direction: column; }
  .thumb-wrap { width: 100%; }
  .input-wrap { flex-direction: column; }
  #grab-btn { padding: 14px; }
  .site-header nav { display: none; }
}
