/* ==================================================================
   Twitter / X Video Downloader — 纯前端样式
   ================================================================== */

:root {
  --bg: #07080c;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.072);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f7;
  --muted: #9aa3b5;
  --dim: #6a7284;
  --blue: #1d9bf0;
  --blue-deep: #0a7fd1;
  --violet: #7c5cff;
  --green: #00ba7c;
  --red: #ff5f7e;
  --amber: #ffb02e;
  --radius: 18px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body.no-scroll {
  overflow: hidden;
}

[hidden],
.hidden {
  display: none !important;
}

a {
  color: var(--blue);
  text-decoration: none;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

svg {
  display: block;
}

/* ------------------------------ 背景装饰 ------------------------------ */

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.bg-glow-1 {
  width: 640px;
  height: 640px;
  top: -260px;
  left: 50%;
  transform: translateX(-70%);
  background: radial-gradient(circle, rgba(29, 155, 240, 0.55), transparent 65%);
}

.bg-glow-2 {
  width: 560px;
  height: 560px;
  top: 120px;
  right: -220px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.42), transparent 66%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(7, 8, 12, 0.86), rgba(7, 8, 12, 0.55));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 15px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(29, 155, 240, 0.9);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 186, 124, 0.16);
}

/* ------------------------------ 页面骨架 ------------------------------ */

.page {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 92px) 0 60px;
}

.hero {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 36px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(29, 155, 240, 0.32);
  background: rgba(29, 155, 240, 0.1);
  color: #8fd0ff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 20px 0 14px;
  font-size: clamp(34px, 6.4vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.grad {
  background: linear-gradient(100deg, #63c4ff 0%, #1d9bf0 35%, #8b6dff 75%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

/* ------------------------------ 搜索框 ------------------------------ */

.search-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  max-width: 780px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.search-card:focus-within {
  border-color: rgba(29, 155, 240, 0.45);
  box-shadow: var(--shadow), 0 0 0 3px rgba(29, 155, 240, 0.13);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  min-width: 0;
  padding: 0 8px 0 14px;
  border-radius: 14px;
  background: rgba(9, 11, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.input-row:focus-within {
  border-color: rgba(29, 155, 240, 0.42);
  background: rgba(9, 11, 16, 0.85);
}

.input-icon {
  flex: none;
  width: 19px;
  height: 19px;
  color: #7f8aa0;
}

#url-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  letter-spacing: -0.005em;
}

#url-input::placeholder {
  color: #5c6579;
}

#url-input:disabled {
  opacity: 0.6;
}

.ghost-btn {
  flex: none;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
}

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--dim);
  transition: all 0.16s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.parse-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 26px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2aa8f5, #1d9bf0 45%, #6e5cff);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 14px 30px -14px rgba(29, 155, 240, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  overflow: hidden;
}

.parse-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.34) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.parse-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 18px 38px -14px rgba(29, 155, 240, 1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.parse-btn:hover:not(:disabled)::after {
  transform: translateX(120%);
}

.parse-btn:active:not(:disabled) {
  transform: translateY(0);
}

.parse-btn:disabled {
  cursor: progress;
  filter: saturate(0.75) brightness(0.9);
}

.btn-arrow {
  width: 17px;
  height: 17px;
  transition: transform 0.18s ease;
}

.parse-btn:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

.spinner {
  display: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}

.parse-btn.is-loading .spinner {
  display: block;
}

.parse-btn.is-loading .btn-label,
.parse-btn.is-loading .btn-arrow {
  display: none;
}

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

/* ------------------------------ 示例 ------------------------------ */

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px auto 0;
  max-width: 780px;
}

.examples-label {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.example-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12.5px;
  transition: all 0.16s ease;
}

.example-chip:hover {
  color: var(--text);
  border-color: rgba(29, 155, 240, 0.4);
  background: rgba(29, 155, 240, 0.1);
}

/* ------------------------------ 状态提示 ------------------------------ */

.status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 780px;
  margin: 22px auto 0;
  padding: 12px 15px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.6;
  animation: rise 0.3s ease both;
}

.status-icon {
  flex: none;
  margin-top: 1px;
}

.status-icon svg {
  width: 17px;
  height: 17px;
}

.status-text {
  min-width: 0;
}

.status-error {
  border: 1px solid rgba(255, 95, 126, 0.32);
  background: rgba(255, 95, 126, 0.09);
  color: #ffb3c2;
}

.status-warn {
  border: 1px solid rgba(255, 176, 46, 0.3);
  background: rgba(255, 176, 46, 0.08);
  color: #ffd79a;
}

.status-info {
  border: 1px solid rgba(29, 155, 240, 0.3);
  background: rgba(29, 155, 240, 0.08);
  color: #a7d8ff;
}

/* ------------------------------ 结果区域 ------------------------------ */

.result {
  max-width: 880px;
  margin: 0 auto;
  opacity: 0;
}

.result.is-visible {
  opacity: 1;
  animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tweet-card {
  margin-top: 26px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #253247, #171c26);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  font-weight: 800;
  font-size: 18px;
  color: #9fb4d6;
}

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

.author-name {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-sub .sep {
  opacity: 0.6;
}

.tweet-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.tweet-link svg {
  width: 13px;
  height: 13px;
}

.tweet-link:hover {
  color: var(--text);
  border-color: rgba(29, 155, 240, 0.45);
  background: rgba(29, 155, 240, 0.1);
}

.tweet-text {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: #d5dae6;
  white-space: pre-wrap;
  word-break: break-word;
}

.tweet-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--dim);
  font-size: 12.5px;
}

.stat b {
  color: #c2c9d8;
  font-weight: 700;
  margin-right: 5px;
}

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 4px 12px;
}

.result-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.result-head .count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(29, 155, 240, 0.16);
  color: #8fd0ff;
  font-size: 12px;
  vertical-align: 1px;
}

.result-hint {
  color: var(--dim);
  font-size: 12.5px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ------------------------------ 视频卡片 ------------------------------ */

.video-card {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -26px rgba(0, 0, 0, 0.9);
}

.video-thumb {
  position: relative;
  align-self: start;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0d1017;
  cursor: pointer;
  outline: none;
}

.video-thumb:focus-visible {
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.5);
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease;
}

.video-thumb:hover .thumb-img {
  transform: scale(1.045);
  filter: brightness(0.88);
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #16202e, #0d1119);
}

.thumb-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 35%, transparent 60%, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.badge {
  position: absolute;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #f2f5fb;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  backdrop-filter: blur(4px);
}

.badge-duration {
  right: 8px;
  bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.badge-type {
  left: 8px;
  top: 8px;
  background: rgba(29, 155, 240, 0.85);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}

.play-btn {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0b0d12;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-btn svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.video-thumb:hover .play-btn {
  transform: scale(1.08);
  background: #fff;
}

.video-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
  min-width: 0;
}

.video-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #cdd4e3;
  font-size: 12.5px;
  font-weight: 600;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.16);
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field label {
  flex: none;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.select-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.quality-select {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 12, 18, 0.8);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.quality-select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.quality-select:focus {
  border-color: rgba(29, 155, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.12);
}

.quality-select option {
  background: #12151d;
  color: var(--text);
}

.select-arrow {
  position: absolute;
  right: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  color: #8b94a8;
  pointer-events: none;
}

.file-meta {
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-height: 18px;
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2aa8f5, #1d9bf0 55%, #6e5cff);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 26px -14px rgba(29, 155, 240, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.download-btn svg {
  width: 16px;
  height: 16px;
}

.download-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 32px -14px rgba(29, 155, 240, 1), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.download-btn:active:not(:disabled) {
  transform: translateY(0);
}

.download-btn:disabled {
  cursor: progress;
  opacity: 0.82;
  filter: saturate(0.8);
}

.secondary-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.secondary-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

/* ------------------------------ 无视频 / 骨架 ------------------------------ */

.no-video {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.no-video-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
}

.no-video-icon svg {
  width: 22px;
  height: 22px;
}

.no-video b {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.no-video p {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

.skeleton-card {
  margin-top: 26px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.skeleton-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.11) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.sk-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.sk-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sk-line {
  height: 12px;
}

.w25 {
  width: 25%;
}
.w40 {
  width: 40%;
}
.w60 {
  width: 60%;
}
.w70 {
  width: 70%;
}
.w80 {
  width: 80%;
}
.w90 {
  width: 90%;
}

.skeleton-video {
  display: flex;
  gap: 18px;
  margin-top: 22px;
}

.sk-thumb {
  width: 320px;
  max-width: 40%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ------------------------------ 使用说明 ------------------------------ */

.tips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 54px;
}

.tip {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.tip-index {
  display: inline-block;
  margin-bottom: 10px;
  color: rgba(29, 155, 240, 0.75);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.tip h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.tip p {
  margin: 0;
  color: var(--dim);
  font-size: 12.8px;
  line-height: 1.7;
}

/* ------------------------------ 页脚 ------------------------------ */

.footer {
  position: relative;
  z-index: 1;
  padding: 26px 20px 40px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(7, 8, 12, 0.6);
}

.footer p {
  margin: 0 0 6px;
  color: var(--dim);
  font-size: 12.5px;
}

.footer-dim {
  color: #4f5768;
  font-size: 11.5px !important;
}

/* ------------------------------ 预览弹层 ------------------------------ */

#preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade-in 0.2s ease both;
}

.preview-panel {
  position: relative;
  width: min(100%, 920px);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: #0b0d13;
  box-shadow: 0 40px 90px -30px #000;
  overflow: hidden;
  animation: pop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13.5px;
  font-weight: 600;
  color: #cfd6e4;
}

.preview-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #000;
}

.preview-body video {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: min(64vh, 560px);
  background: #000;
  outline: none;
}

.preview-error {
  margin: 0;
  padding: 14px 16px;
  color: #ffb3c2;
  font-size: 13px;
  background: rgba(255, 95, 126, 0.08);
}

.preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.preview-meta {
  color: var(--dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.preview-link {
  font-size: 12.5px;
  font-weight: 600;
}

/* ------------------------------ Toast ------------------------------ */

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: min(92vw, 520px);
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 186, 124, 0.35);
  background: rgba(10, 16, 16, 0.94);
  color: #bdf5df;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 20px 40px -18px #000;
  transform: translate(-50%, 14px);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
  backdrop-filter: blur(12px);
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast-icon {
  flex: none;
  margin-top: 1px;
}

.toast-icon svg {
  width: 16px;
  height: 16px;
}

.toast-text {
  min-width: 0;
}

.toast-error {
  border-color: rgba(255, 95, 126, 0.42);
  background: rgba(24, 10, 15, 0.95);
  color: #ffc2cf;
}

.toast a {
  color: #8fd0ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 860px) {
  .video-card {
    grid-template-columns: 1fr;
  }

  .video-thumb {
    max-height: 360px;
  }

  .tips {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 40px;
  }

  .sk-thumb {
    max-width: 46%;
  }
}

@media (max-width: 640px) {
  .topbar-meta {
    display: none;
  }

  .page {
    width: min(100% - 28px, 980px);
    padding-top: 40px;
  }

  .search-card {
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 18px;
  }

  .parse-btn {
    width: 100%;
    height: 50px;
  }

  .input-row {
    height: 52px;
    padding-left: 12px;
  }

  #url-input {
    font-size: 14px;
  }

  .ghost-btn {
    display: none;
  }

  #paste-btn {
    display: inline-flex;
    align-items: center;
  }

  .tweet-card {
    padding: 16px;
  }

  .tweet-head {
    flex-wrap: wrap;
  }

  .tweet-link {
    order: 3;
    margin-left: 60px;
  }

  .video-card {
    padding: 10px;
    gap: 13px;
  }

  .download-btn {
    flex: 1;
    padding: 0 14px;
  }

  .secondary-btn {
    padding: 0 13px;
  }

  .preview-panel {
    border-radius: 14px;
  }

  .preview-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .toast {
    bottom: 16px;
    width: calc(100vw - 28px);
    max-width: none;
  }

  .hero h1 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .hero-sub {
    font-size: 13.5px;
  }

  .examples {
    gap: 6px;
  }
}

/* ------------------------------ 广告位 ------------------------------ */

.ad-slot {
  position: relative;
  max-width: 880px;
  margin: 22px auto 0;
  padding: 28px 20px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.018);
  text-align: center;
}

.ad-label {
  position: absolute;
  top: 6px;
  left: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #525a6c;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.ad-content {
  min-height: 60px;
}

.ad-placeholder {
  padding: 10px 0;
}

.ad-placeholder-text {
  margin: 0 0 4px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ad-placeholder-sub {
  margin: 0;
  color: #4a5163;
  font-size: 11.5px;
}

/* ------------------------------ 捐赠区 ------------------------------ */

.donate-section {
  position: relative;
  z-index: 1;
  padding: 54px 20px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(7, 8, 12, 0.55);
}

.donate-inner {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.donate-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #63c4ff 0%, #8b6dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.donate-desc {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* 平台按钮 */
.donate-platforms {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.donate-btn svg {
  width: 18px;
  height: 18px;
}

.donate-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.donate-bmc {
  background: #ffdd00;
  color: #0b0d12;
  box-shadow: 0 10px 22px -12px rgba(255, 221, 0, 0.7);
}

.donate-kofi {
  background: #13c3ff;
  color: #0b0d12;
  box-shadow: 0 10px 22px -12px rgba(19, 195, 255, 0.7);
}

/* 收款码 */
.donate-qrcodes {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.qrcode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: zoom-in;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  max-width: 180px;
}

.qrcode-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.qrcode-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.4);
}

.qrcode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.qrcode-badge svg {
  width: 13px;
  height: 13px;
}

.qrcode-wechat {
  background: rgba(7, 193, 96, 0.16);
  color: #3cc47a;
}

.qrcode-alipay {
  background: rgba(16, 180, 238, 0.16);
  color: #4dc6f2;
}

.qrcode-img-wrap {
  width: 130px;
  height: 130px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
}

.qrcode-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.qrcode-label {
  color: var(--dim);
  font-size: 11.5px;
}

/* ------------------------------ 收款码弹层 ------------------------------ */

.qrcode-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
}

.qrcode-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.2s ease both;
}

.qrcode-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 18px;
  padding-top: 42px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: #0b0d13;
  box-shadow: 0 40px 90px -30px #000;
  animation: pop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.qrcode-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.qrcode-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.qrcode-modal .qrcode-img-wrap {
  width: 280px;
  height: 280px;
  padding: 10px;
}

.qrcode-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #e4e8f1;
}

/* ------------------------------ 响应式补充 ------------------------------ */

@media (max-width: 640px) {
  .qrcode-img-wrap {
    width: 110px;
    height: 110px;
  }

  .donate-qrcodes {
    gap: 14px;
  }

  .donate-btn {
    flex: 1;
    justify-content: center;
    min-width: 140px;
  }

  .qrcode-card {
    max-width: 148px;
    padding: 12px;
  }

  .qrcode-modal .qrcode-img-wrap {
    width: 240px;
    height: 240px;
  }
}

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