:root {
  --bg: #0b0e14;
  --ink: #f4efe6;
  --muted: #9c968b;
  --card: rgba(18, 21, 30, 0.78);
  --line: rgba(232, 195, 122, 0.2);
  --accent: #2ee0b8;
  --accent-ink: #05241c;
  --gold: #e8c37a;
  --official: #3ee0a6;
  --official-bg: rgba(12, 90, 62, 0.4);
  --reseller: #f0b56a;
  --reseller-bg: rgba(120, 70, 16, 0.4);
  --fail: #ff8d86;
  --fail-bg: rgba(120, 28, 24, 0.42);
  --unknown: #c4bedb;
  --unknown-bg: rgba(70, 64, 96, 0.4);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --mono: "Cascadia Mono", "Sarasa Mono SC", "Consolas", ui-monospace, monospace;
  --sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.atmosphere .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.orb-a {
  width: 520px;
  height: 520px;
  left: -12%;
  top: -8%;
  background: radial-gradient(circle, rgba(46, 224, 184, 0.45), transparent 68%);
  animation: drift-a 22s ease-in-out infinite alternate;
}
.orb-b {
  width: 640px;
  height: 640px;
  right: -18%;
  top: 18%;
  background: radial-gradient(circle, rgba(232, 195, 122, 0.32), transparent 70%);
  animation: drift-b 28s ease-in-out infinite alternate;
}
.orb-c {
  width: 420px;
  height: 420px;
  left: 30%;
  bottom: -20%;
  background: radial-gradient(circle, rgba(80, 110, 255, 0.18), transparent 70%);
  animation: drift-a 26s ease-in-out infinite alternate-reverse;
}
.grain, body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.grain {
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  z-index: 1;
  background: radial-gradient(1200px 700px at 50% -10%, transparent 40%, rgba(0,0,0,0.45) 100%);
}
.top, main, footer { position: relative; z-index: 2; width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.top { padding: 48px 0 16px; display: grid; gap: 16px; animation: rise 0.8s ease both; }
.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
}
h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(120deg, #fff8ea 20%, var(--gold) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { margin: 0; max-width: 70ch; color: var(--muted); animation: rise 0.8s ease 0.08s both; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 24px 20px;
  margin: 18px 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: rise 0.7s ease both;
}
main .card:nth-of-type(1) { animation-delay: 0.10s; }
main .card:nth-of-type(2) { animation-delay: 0.18s; }
main .card:nth-of-type(3) { animation-delay: 0.26s; }
main .card:nth-of-type(4) { animation-delay: 0.34s; }
  main .card:nth-of-type(5) { animation-delay: 0.42s; }
.card.muted { opacity: 0.88; }
.card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 20px; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.step {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(160deg, var(--gold), #9a6d2a);
  color: #1a1206;
  display: grid; place-items: center;
  font-weight: 700; flex: 0 0 auto;
  box-shadow: 0 0 18px rgba(232, 195, 122, 0.28);
}
.field { display: grid; gap: 6px; margin: 10px 0; font-size: 14px; }
.field span { color: var(--muted); }
.field.grow { flex: 1; min-width: 200px; }
input[type="text"], input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  border: 1px solid rgba(232, 195, 122, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: rgba(8, 10, 16, 0.72);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(46, 224, 184, 0.4);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46, 224, 184, 0.12);
}
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; color: var(--muted); min-height: 44px; }
.check.tight { margin: 10px 0 18px; }
.check input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 8px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  min-height: 44px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  background: #2a2d38;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}
.btn.primary {
  background: linear-gradient(160deg, #5af0cc, var(--accent) 40%, #14967a);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(46, 224, 184, 0.22);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:not(:disabled):hover,
.btn:not(:disabled):active,
.tpl:active { filter: brightness(1.08); }
.btn:not(:disabled):active { transform: scale(0.97); }
.btn, .tpl, .check { -webkit-tap-highlight-color: rgba(46, 224, 184, 0.18); touch-action: manipulation; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,0.35) 50%, transparent 75%);
  transform: translateX(-120%);
  animation: sweep 1.1s ease-in-out infinite;
}
.hidden { display: none !important; }
.result, .status, .player, .gallery { margin-top: 18px; }
.result { display: grid; gap: 12px; }
.result.enter, .status.enter, .player.enter, .gallery.enter {
  animation: rise 0.55s ease both;
}
.verdict {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-radius: 14px; padding: 16px 18px; border: 1px solid transparent;
}
.verdict.official { background: var(--official-bg); color: var(--official); box-shadow: 0 0 24px rgba(62, 224, 166, 0.12); }
.verdict.reseller, .verdict.open_proxy { background: var(--reseller-bg); color: var(--reseller); }
.verdict.auth_failed, .verdict.fail { background: var(--fail-bg); color: var(--fail); }
.verdict.unknown { background: var(--unknown-bg); color: var(--unknown); }
.verdict h3 { margin: 0 0 4px; font-size: 22px; }
.verdict p { margin: 0; }
.meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 650;
}
.badge.official, .badge.authorized { background: var(--official-bg); color: var(--official); }
.badge.reseller, .badge.open_proxy, .badge.rate_limited { background: var(--reseller-bg); color: var(--reseller); }
.badge.auth_failed, .badge.denied { background: var(--fail-bg); color: var(--fail); }
.badge.unknown, .badge.listed { background: var(--unknown-bg); color: var(--unknown); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(232, 195, 122, 0.12);
  border-radius: 12px;
  padding: 12px;
  animation: rise 0.45s ease both;
}
.stats .stat:nth-child(1) { animation-delay: 0.02s; }
.stats .stat:nth-child(2) { animation-delay: 0.06s; }
.stats .stat:nth-child(3) { animation-delay: 0.10s; }
.stats .stat:nth-child(4) { animation-delay: 0.14s; }
.stats .stat:nth-child(5) { animation-delay: 0.18s; }
.stats .stat:nth-child(6) { animation-delay: 0.22s; }
.stats .stat:nth-child(7) { animation-delay: 0.26s; }
.stats .stat:nth-child(8) { animation-delay: 0.30s; }
.stat b { display: block; font-size: 22px; letter-spacing: -0.03em; color: var(--ink); }
.stat span { color: var(--muted); font-size: 12px; }
.templates { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tpl {
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.6);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.tpl.active {
  border-color: var(--accent);
  background: rgba(46, 224, 184, 0.14);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(46, 224, 184, 0.25);
}
.status {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  font-size: 14px;
}
.status.busy::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 42%;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold), transparent);
  animation: scan 1.2s ease-in-out infinite;
}
.player { width: 100%; }
.player video {
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #05070b;
  margin-top: 12px;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.gallery figure { margin: 0; background: #05070b; border-radius: 14px; overflow: hidden; }
.gallery img { width: 100%; height: auto; display: block; object-fit: contain; background: #05070b; }
.gallery figure, .player video, .lib-item video, .lib-item img { animation: media-in 0.55s ease both; }
.library-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.lib-item {
  margin: 0;
  background: #05070b;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.lib-item video, .lib-item img {
  width: 100%;
  max-height: 360px;
  height: auto;
  display: block;
  object-fit: contain;
  background: #05070b;
}
.lib-item figcaption {
  margin: 0;
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 13px;
}
.lib-item figcaption .meta { display: block; margin-top: 2px; }
.err { color: var(--fail); }
footer { padding: 10px 0 48px; color: var(--muted); font-size: 13px; animation: rise 0.8s ease 0.4s both; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--gold); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes media-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(8%, 10%, 0); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-10%, 8%, 0); }
}
@keyframes sweep {
  to { transform: translateX(120%); }
}
@keyframes scan {
  0% { transform: translateX(-20%); }
  100% { transform: translateX(260%); }
}


.extracted {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.extracted h3 { margin: 0; font-size: 16px; color: var(--gold); }
.extracted ul { margin: 0; padding-left: 1.15em; color: var(--ink); }
.extracted li { margin: 2px 0; }
.extracted .meta { margin-top: 4px; }
@media (max-width: 720px) {
  .top, main, footer {
    width: min(1080px, calc(100% - 20px));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .top { padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: 12px; gap: 10px; }
  footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; line-height: 1.25; }
  .lede, .card-head p, .hint { font-size: 14px; }
  .card { padding: 16px 14px 14px; margin: 14px 0; border-radius: 14px; }
  .card-head { gap: 10px; margin-bottom: 12px; }
  .card-head h2 { font-size: 18px; }
  .field { min-width: 0; width: 100%; margin: 8px 0; }
  .field.grow { min-width: 0; flex: 1 1 100%; }
  .row { gap: 8px; align-items: stretch; }
  .row > .field { flex: 1 1 calc(50% - 8px); min-width: 140px; }
  .row > .field.grow, .row > .check { flex: 1 1 100%; }
  input[type="text"], input[type="number"], input[type="url"], textarea, select {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
  }
  textarea { min-height: 88px; }
  .btn { min-height: 44px; padding: 12px 18px; width: 100%; }
  .actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .actions .hint { width: 100%; }
  .templates { gap: 8px; }
  .tpl { flex: 1 1 auto; text-align: center; }
  .verdict { padding: 14px; }
  .verdict h3 { font-size: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 20px; }
  table { font-size: 12px; min-width: 520px; }
  th, td { padding: 8px 10px; }
  .meta { word-break: break-all; overflow-wrap: anywhere; }
  .gallery, .library-list { grid-template-columns: 1fr; }
  .player video, .lib-item video { max-height: 60vh; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .top, .lede, .card, footer, .result, .status, .player, .gallery, .library-list, .stat,
  .gallery figure, .player video, .lib-item video, .lib-item img {
    opacity: 1 !important;
    transform: none !important;
  }
  .atmosphere .orb { filter: blur(80px); opacity: 0.35; }
}