[hidden] { display: none !important; }
:root {
  --bg: #0b0b12;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f4f8;
  --muted: #a3a3b8;
  --accent: #ff3d6e;
  --accent-2: #ff8a3d;
  --ok: #3ddc97;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45; animation: float 18s ease-in-out infinite alternate; }
.bg span:nth-child(1) { width: 480px; height: 480px; background: #ff3d6e; top: -160px; left: -120px; }
.bg span:nth-child(2) { width: 420px; height: 420px; background: #6a3dff; top: 120px; right: -160px; animation-delay: -6s; opacity: 0.35; }
.bg span:nth-child(3) { width: 360px; height: 360px; background: #ff8a3d; bottom: -180px; left: 30%; animation-delay: -12s; opacity: 0.25; }
@keyframes float { to { transform: translate(40px, 60px) scale(1.12); } }

.top {
  max-width: 880px; margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand img { border-radius: 10px; }
.ghost {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 999px; font-size: 14px; font-weight: 500;
}
.ghost:hover { background: var(--panel-2); }

main { max-width: 880px; margin: 0 auto; padding: 0 20px 40px; }
.hero { text-align: center; padding: 36px 0 20px; }
h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.12; letter-spacing: -0.035em; margin: 0 0 14px; font-weight: 800; }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); margin: 0 auto 28px; max-width: 520px; }

.search { display: flex; gap: 10px; max-width: 700px; margin: 0 auto; }
.field {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 16px; padding: 0 8px 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus-within { border-color: rgba(255, 61, 110, 0.6); box-shadow: 0 0 0 4px rgba(255, 61, 110, 0.15); }
.field .lnk { color: var(--muted); flex: none; }
.field input {
  flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px;
}
.field input::placeholder { color: #75758a; }
.paste {
  flex: none; border: 0; background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
}
.paste:hover { background: rgba(255, 255, 255, 0.14); }
.go {
  position: relative; flex: none; height: 58px; padding: 0 28px; border: 0; border-radius: 16px; color: #fff; font-weight: 700; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px rgba(255, 61, 110, 0.7);
  transition: transform 0.15s, filter 0.2s;
}
.go:hover { filter: brightness(1.08); }
.go:active { transform: scale(0.97); }
.go .spin { display: none; width: 20px; height: 20px; border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
.go.loading .lbl { visibility: hidden; }
.go.loading .spin { display: block; position: absolute; inset: 0; margin: auto; }
.go.wide { width: 100%; height: 50px; margin-top: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { list-style: none; display: flex; justify-content: center; gap: 10px; padding: 0; margin: 22px 0 0; flex-wrap: wrap; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chips .yt svg { color: #ff3b3b; }
.chips .tt svg { color: #25f4ee; }
.chips .fb svg { color: #4c8bff; }

.error {
  max-width: 700px; margin: 18px auto 0; padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 61, 110, 0.12); border: 1px solid rgba(255, 61, 110, 0.35); color: #ffc1cf; font-size: 15px;
}

.result {
  margin: 26px auto 0; max-width: 760px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 18px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: rise 0.35s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.media { display: flex; gap: 16px; align-items: flex-start; }
.thumb { position: relative; flex: none; width: 220px; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #1a1a24; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur, .plat { position: absolute; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.75); }
.dur { right: 8px; bottom: 8px; }
.plat { left: 8px; top: 8px; text-transform: capitalize; }
.dur:empty { display: none; }
.meta { min-width: 0; }
.meta h2 { font-size: 18px; line-height: 1.35; margin: 2px 0 6px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.meta p { margin: 0; color: var(--muted); font-size: 14px; }

.group { margin-top: 18px; }
.group h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 10px 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid transparent; margin-bottom: 6px;
}
.row:hover { border-color: var(--line); }
.row .q b { display: block; font-size: 15px; }
.row .q small { color: var(--muted); font-size: 12.5px; }
.row .sz { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.dl {
  display: inline-flex; align-items: center; justify-content: center; min-width: 84px; height: 40px; padding: 0 16px; border-radius: 11px; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
}
.dl.alt { background: var(--panel-2); }
.dl[disabled] { opacity: 0.6; pointer-events: none; }
.prog { grid-column: 1 / -1; display: none; }
.row.busy .prog { display: block; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.2s; }
.prog small { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.imgs a { position: relative; display: block; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; background: #1a1a24; }
.imgs img { width: 100%; height: 100%; object-fit: cover; }
.imgs span { position: absolute; right: 6px; bottom: 6px; font-size: 12px; background: rgba(0, 0, 0, 0.7); padding: 2px 8px; border-radius: 6px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 44px; }
.features div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.features b { display: block; margin-bottom: 4px; }
.features span { color: var(--muted); font-size: 14px; }
.howto { margin-top: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.howto h3 { margin: 0 0 8px; font-size: 17px; }
.howto ol { margin: 0; padding-left: 20px; color: #d6d6e2; font-size: 15px; }
.howto li { margin: 6px 0; }

footer { text-align: center; color: #6e6e85; font-size: 13px; padding: 10px 20px 30px; }

.sheet {
  border: 1px solid var(--line); background: #15151f; color: var(--text); border-radius: 22px; padding: 22px; max-width: 380px; width: calc(100% - 32px);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.sheet h3 { margin: 10px 0 8px; text-align: center; font-size: 18px; }
.sheet-icon { display: block; margin: 0 auto; border-radius: 16px; }
.sheet ol { padding-left: 20px; color: #d6d6e2; font-size: 15px; }
.sheet li { margin: 8px 0; }
.sheet .ic { vertical-align: -4px; color: #4c8bff; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #22222e; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50;
  animation: rise 0.25s ease-out;
}

@media (max-width: 640px) {
  .hero { padding-top: 16px; }
  .search { flex-direction: column; }
  .go { width: 100%; }
  .media { flex-direction: column; }
  .thumb { width: 100%; }
  .features { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr auto; }
  .row .sz { display: none; }
  .ghost span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bg span { animation: none; }
}

/* Phím tắt iPhone */
.shortcut {
  margin-top: 26px; display: flex; gap: 16px; align-items: flex-start; padding: 20px;
  border-radius: var(--radius); border: 1px solid rgba(255, 61, 110, 0.35);
  background: linear-gradient(135deg, rgba(255, 61, 110, 0.14), rgba(255, 138, 61, 0.08));
}
.sc-icon {
  flex: none; width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #ff3d6e, #ff8a3d); box-shadow: 0 8px 24px -8px rgba(255, 61, 110, 0.7);
}
.sc-body h3 { margin: 2px 0 6px; font-size: 18px; }
.sc-body p { margin: 0 0 14px; color: #d6d6e2; font-size: 15px; }
.sc-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sc-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; text-decoration: none; font-size: 15px; }
.sc-note { color: var(--muted); font-size: 13.5px; margin: 4px 0 6px; }
@media (max-width: 640px) {
  .shortcut { flex-direction: column; }
  .sc-btn { width: 100%; justify-content: center; }
  .sc-actions .ghost { width: 100%; justify-content: center; }
  .sc-actions .ghost span { display: inline; }
}
.sc-file { color: var(--muted); font-size: 13.5px; }

/* Tab & tải hàng loạt */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 auto 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.tab.on { background: var(--panel-2); color: var(--text); }
.batch { max-width: 700px; margin: 0 auto; text-align: left; }
.batch textarea {
  width: 100%; resize: vertical; min-height: 140px; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; outline: 0;
}
.batch textarea:focus { border-color: rgba(255, 61, 110, 0.6); box-shadow: 0 0 0 4px rgba(255, 61, 110, 0.15); }
.batch-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.batch-bar .go { height: 48px; margin-left: auto; }
.batch-bar .paste { height: 40px; }
.sel { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sel select {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #1a1a24; color: var(--text); font: inherit; font-size: 14px;
}
.count { font-size: 13px; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
.batch-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.batch-head h2 { margin: 0; font-size: 18px; }
.batch-head span { color: var(--muted); font-size: 14px; }
.batch-head .ghost { margin-left: auto; }
.bitem { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); margin-bottom: 6px; align-items: center; }
.bitem .st { width: 44px; height: 44px; border-radius: 10px; background: #1a1a24 center/cover; display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.bitem b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bitem small { display: block; color: var(--muted); font-size: 12.5px; margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bitem.done small { color: var(--ok); }
.bitem.fail small { color: #ff8fa7; white-space: normal; }
.bitem .bar { height: 5px; }
@media (max-width: 640px) {
  .batch-bar .go { width: 100%; margin-left: 0; }
}
