:root {
  color-scheme: dark;
  --bg: #070a10;
  --bg-soft: #0a0e16;
  --panel: #0d121c;
  --panel-2: #0a0f17;
  --panel-3: #111827;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f2f5fa;
  --muted: #939db2;
  --muted-2: #6f7a90;
  --pink: #fb7299;
  --pink-strong: #ff5b88;
  --purple: #b47cff;
  --blue: #00aeec;
  --cyan: #58d9ff;
  --green: #42dfa0;
  --danger: #ff6b7d;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-lg: 0 36px 90px rgba(0, 0, 0, 0.5);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

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

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

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(251, 114, 153, 0.35);
  color: #fff;
}

.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;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 55% at 50% -15%, rgba(42, 54, 82, 0.38), transparent 65%),
    linear-gradient(180deg, #080b12 0%, #070a10 48%, #06080d 100%);
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 75%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.24;
  animation: float 14s ease-in-out infinite alternate;
}

.orb-pink {
  width: 440px;
  height: 440px;
  top: -190px;
  left: 2%;
  background: #e8448a;
}

.orb-blue {
  width: 380px;
  height: 380px;
  top: 180px;
  right: -150px;
  background: #1476c8;
  animation-delay: -7s;
}

.grid-glow {
  position: absolute;
  width: 760px;
  height: 420px;
  top: 350px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255, 95, 145, 0.07), transparent 68%);
}

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(22px, 28px, 0) scale(1.08); }
}

.site-header {
  position: relative;
  z-index: 30;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink) 4%, #d85cff 52%, var(--blue) 100%);
  box-shadow: 0 10px 30px rgba(251, 114, 153, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-icon svg {
  width: 26px;
  height: 26px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7e879b;
  box-shadow: 0 0 0 3px rgba(126, 135, 155, 0.12);
}

.status-pill.online {
  color: #c9f5e1;
  border-color: rgba(66, 223, 160, 0.22);
  background: rgba(66, 223, 160, 0.06);
}

.status-pill.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(66, 223, 160, 0.13), 0 0 14px rgba(66, 223, 160, 0.5);
}

.status-pill.offline {
  color: #ffc5cc;
  border-color: rgba(255, 107, 125, 0.24);
  background: rgba(255, 107, 125, 0.06);
}

.status-pill.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 107, 125, 0.12);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.hero {
  max-width: 900px;
  padding: clamp(54px, 8.5vw, 104px) 0 34px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: #b7c0d2;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px rgba(251, 114, 153, 0.8);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 6.2vw, 5.45rem);
  line-height: 0.99;
  letter-spacing: -0.055em;
  font-weight: 850;
}

.gradient {
  background: linear-gradient(100deg, #ff7aa0 0%, #e078ff 42%, #66d8ff 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(251, 114, 153, 0.18));
}

.hero-sub {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.75;
}

.converter-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(21, 28, 43, 0.94), rgba(10, 14, 22, 0.94));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.converter-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(251, 114, 153, 0.22), transparent 32%, transparent 68%, rgba(88, 217, 255, 0.13));
  opacity: 0.8;
  pointer-events: none;
}

.field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 10px 0 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #090d15;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field:focus-within {
  border-color: rgba(251, 114, 153, 0.52);
  background: #0a0f18;
  box-shadow: 0 0 0 4px rgba(251, 114, 153, 0.08), 0 10px 30px rgba(0, 0, 0, 0.2);
}

.field-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: #727e93;
}

.field-icon svg {
  width: 100%;
  height: 100%;
}

#url-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 17px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  letter-spacing: -0.01em;
}

#url-input::placeholder {
  color: #59657a;
}

.paste-btn {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #b6c0d2;
  font-size: 13px;
  transition: all 0.2s ease;
}

.paste-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
}

.paste-btn:active {
  transform: scale(0.97);
}

.actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 12px;
}

.quality-field {
  flex: 0 0 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 0 13px 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.quality-label {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 8px 24px 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #dce3ef;
  font-size: 13px;
  font-weight: 600;
  direction: rtl;
  text-align: right;
}

.select-wrap select option {
  color: #111;
  background: #fff;
}

.select-wrap svg {
  position: absolute;
  right: 0;
  width: 17px;
  height: 17px;
  color: #7d899e;
  pointer-events: none;
}

.convert-btn {
  position: relative;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(102deg, #fb5f8d 0%, #d95ef0 54%, #7f7dff 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 30px rgba(226, 76, 142, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.convert-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 38px rgba(226, 76, 142, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.convert-btn:active {
  transform: translateY(0) scale(0.99);
}

.convert-btn:disabled {
  cursor: wait;
  filter: saturate(0.7);
  opacity: 0.82;
}

.btn-arrow {
  width: 19px;
  height: 19px;
  transition: transform 0.2s ease;
}

.convert-btn:hover .btn-arrow {
  transform: translateX(3px);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
  color: var(--muted-2);
  font-size: 12px;
}

.text-btn {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #aab4c6;
  font-size: 12px;
  transition: color 0.2s ease;
}

.text-btn:hover {
  color: #fff;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 2px 0;
}

.examples-label {
  margin-right: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.example-chip {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: #aab4c6;
  font-size: 12px;
  transition: all 0.2s ease;
}

.example-chip:hover {
  color: #fff;
  border-color: rgba(251, 114, 153, 0.35);
  background: rgba(251, 114, 153, 0.08);
}

.error-box {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 107, 125, 0.3);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(66, 20, 30, 0.55), rgba(35, 14, 20, 0.55));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  animation: rise 0.28s ease both;
}

.error-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 107, 125, 0.14);
  color: #ff9eaa;
  font-weight: 800;
  font-size: 14px;
}

.error-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.error-copy strong {
  display: block;
  color: #ffd3d8;
  font-size: 14px;
}

.error-copy p {
  margin: 4px 0 0;
  color: #e6aab3;
  font-size: 13px;
  line-height: 1.55;
}

.error-copy .error-hint {
  color: #b98891;
  font-size: 12px;
}

.icon-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b98891;
  font-size: 22px;
  line-height: 1;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 26px;
}

.result > * {
  animation: rise 0.48s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.result > *:nth-child(2) { animation-delay: 0.04s; }
.result > *:nth-child(3) { animation-delay: 0.08s; }
.result > *:nth-child(4) { animation-delay: 0.12s; }

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

.video-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(17, 23, 35, 0.9), rgba(10, 14, 22, 0.94));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.cover-frame {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(251, 114, 153, 0.23), transparent 50%),
    linear-gradient(135deg, #161d2b, #0c111b);
}

.cover-frame img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.3s ease;
}

.video-card:hover .cover-frame img {
  transform: scale(1.025);
}

.cover-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06) 35%, rgba(5, 8, 13, 0.76) 100%),
    linear-gradient(90deg, transparent 60%, rgba(8, 12, 19, 0.35));
  pointer-events: none;
}

.duration-pill,
.quality-pill {
  position: absolute;
  z-index: 2;
  bottom: 13px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(4, 7, 12, 0.72);
  color: #f1f4f9;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.duration-pill { right: 13px; }

.quality-pill {
  left: 13px;
  color: #ffd9e4;
  background: rgba(89, 19, 44, 0.72);
  border: 1px solid rgba(251, 114, 153, 0.24);
}

.video-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 30px 34px;
}

.video-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8f9bb2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.video-kicker .dot {
  color: #4c566b;
}

.video-body h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 10px 0 8px;
  color: #f4f7fc;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.video-author {
  margin: 0;
  color: #8b96ab;
  font-size: 13px;
}

.video-author span {
  color: #c8d0de;
}

.video-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 12px 0 0;
  color: #778298;
  font-size: 12px;
  line-height: 1.65;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #6f7b91;
  font-size: 11px;
}

.stat b {
  color: #b7c1d2;
  font-size: 12px;
  font-weight: 650;
}

.page-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.page-picker label {
  flex: 0 0 auto;
  color: #778298;
  font-size: 12px;
}

.page-select-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.page-select-wrap select {
  padding-right: 22px;
  color: #c5cede;
  font-size: 12px;
  font-weight: 500;
  direction: ltr;
  text-align: left;
  text-overflow: ellipsis;
}

.api-card,
.player-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.92), rgba(9, 13, 21, 0.94));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.api-head,
.player-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: #5f6b80;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.api-head h2,
.player-head h2,
.docs-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: #a4afc1;
  font-size: 12px;
  transition: all 0.2s ease;
}

.ghost-btn:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.ghost-btn svg {
  width: 15px;
  height: 15px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 0;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  position: relative;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #78849a;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab:hover {
  color: #c9d2e1;
  background: rgba(255, 255, 255, 0.03);
}

.tab.active {
  border-color: rgba(251, 114, 153, 0.2);
  background: rgba(251, 114, 153, 0.1);
  color: #ffd4e0;
}

.tab-panel {
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #080c14;
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.method,
.panel-type {
  padding: 3px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.method {
  background: rgba(66, 223, 160, 0.09);
  color: #7be8b9;
  border: 1px solid rgba(66, 223, 160, 0.17);
}

.panel-type {
  background: rgba(88, 217, 255, 0.07);
  color: #8ae5ff;
  border: 1px solid rgba(88, 217, 255, 0.13);
}

.panel-desc {
  margin: 11px 0 0;
  color: #7f8ba1;
  font-size: 12px;
  line-height: 1.6;
}

.url-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #05080e;
}

.url-row code {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 100px;
  overflow: auto;
  padding: 4px 0;
  color: #c5d9e8;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.65;
  word-break: break-all;
  white-space: pre-wrap;
  scrollbar-width: thin;
}

.copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(251, 114, 153, 0.21);
  border-radius: 8px;
  background: rgba(251, 114, 153, 0.08);
  color: #ffb0c6;
  font-size: 11px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(251, 114, 153, 0.16);
  color: #fff;
}

.copy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}

.panel-foot > span {
  color: #5f6b80;
  font-size: 11px;
}

.panel-foot a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: #8e9ab0;
  font-size: 11px;
  transition: color 0.2s ease;
}

.panel-foot a:hover {
  color: #fff;
}

.panel-foot a svg {
  width: 12px;
  height: 12px;
}

.api-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 15px;
  padding: 0 3px;
  color: #647086;
  font-size: 10px;
}

.api-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(66, 223, 160, 0.55);
}

.player-head {
  align-items: center;
  margin-bottom: 14px;
}

.player-note {
  color: #667288;
  font-size: 11px;
}

.video-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.segment-link {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #9da8bb;
  font-size: 11px;
  transition: all 0.2s ease;
}

.segment-link:hover {
  color: #fff;
  border-color: rgba(251, 114, 153, 0.3);
}

.result-notice {
  margin: 0;
  padding: 12px 15px;
  border: 1px solid rgba(255, 194, 102, 0.16);
  border-radius: 12px;
  background: rgba(255, 194, 102, 0.045);
  color: #cbb68d;
  font-size: 12px;
  line-height: 1.65;
}

.docs {
  margin-top: clamp(64px, 9vw, 110px);
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.docs-head {
  max-width: 600px;
}

.docs-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.doc-card {
  position: relative;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.doc-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}

.doc-index {
  color: #4f5b70;
  font-family: var(--font-mono);
  font-size: 10px;
}

.doc-card h3 {
  margin: 10px 0 6px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.doc-card p {
  min-height: 54px;
  margin: 0 0 13px;
  color: #7d889d;
  font-size: 12px;
  line-height: 1.65;
}

.doc-card p code {
  color: #b2bfd2;
  font-family: var(--font-mono);
  font-size: 11px;
}

.doc-card > code {
  display: block;
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 7px;
  background: #080c14;
  color: #91a8bd;
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #080c14;
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  color: #6f7b90;
  font-size: 11px;
}

.code-card pre {
  margin: 0;
  padding: 17px 18px 19px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-card code {
  color: #a9c7d9;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.8;
  white-space: pre;
}

.docs-note {
  margin: 14px 0 0;
  color: #566176;
  font-size: 11px;
  line-height: 1.65;
}

.history {
  margin-top: 54px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #758197;
  font-size: 12px;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: #9ca8bb;
  font-size: 11px;
  text-align: left;
  transition: all 0.2s ease;
}

.history-chip:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.history-chip b {
  flex: 0 0 auto;
  color: #ffabc2;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.history-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 calc(34px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  color: #4f5a6e;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.site-footer a {
  color: #758197;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: #c8d2e2;
}

.footer-dot {
  color: #333d4f;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 100;
  transform: translate(-50%, 16px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(18, 24, 36, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  color: #e9eef7;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  backdrop-filter: blur(18px);
}

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

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

  .cover-frame {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .cover-frame img {
    min-height: 0;
    height: 100%;
  }

  .video-body {
    padding: 24px;
  }

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

  .doc-card p {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .site-header {
    width: calc(100% - 32px);
    padding: 16px 0;
  }

  .shell {
    width: calc(100% - 32px);
  }

  .nav-link {
    display: none;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-badge {
    margin-bottom: 18px;
    font-size: 11px;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 12vw, 3.9rem);
  }

  .hero-sub {
    margin-top: 18px;
    font-size: 14px;
  }

  .converter-card {
    padding: 11px;
    border-radius: 22px;
  }

  .field {
    min-height: 58px;
    padding-left: 13px;
    gap: 9px;
  }

  .field-icon {
    width: 19px;
    height: 19px;
  }

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

  .paste-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .actions {
    flex-direction: column;
    gap: 9px;
  }

  .quality-field {
    flex: 0 0 auto;
    min-height: 48px;
    width: 100%;
  }

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

  .form-foot {
    padding-top: 10px;
  }

  .examples {
    margin-top: 13px;
  }

  .video-card {
    border-radius: 22px;
  }

  .video-body {
    padding: 20px;
  }

  .video-body h2 {
    font-size: 20px;
  }

  .api-card,
  .player-card {
    padding: 17px;
    border-radius: 22px;
  }

  .api-head h2,
  .player-head h2,
  .docs-head h2 {
    font-size: 19px;
  }

  .tabs {
    margin-top: 18px;
    margin-right: -17px;
    padding-right: 17px;
  }

  .tab {
    padding: 8px 12px;
  }

  .tab-panel {
    padding: 14px;
  }

  .url-row {
    flex-direction: column;
    gap: 8px;
  }

  .url-row code {
    max-height: 130px;
  }

  .copy-btn {
    width: 100%;
    min-height: 36px;
  }

  .panel-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .api-meta {
    gap: 9px 13px;
  }

  .docs {
    margin-top: 62px;
  }

  .site-footer {
    width: calc(100% - 32px);
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .brand-copy small {
    display: none;
  }

  .brand-icon {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .status-pill {
    padding: 5px 9px;
    font-size: 11px;
  }

  .hero h1 {
    letter-spacing: -0.06em;
  }

  .example-chip {
    padding: 6px 10px;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: clamp(2rem, 10.8vw, 2.45rem);
  }

  .field {
    gap: 7px;
    padding-left: 10px;
  }

  .paste-btn {
    padding-left: 8px;
    padding-right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
