:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(18, 18, 18, 0.86);
  --panel-strong: #121212;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.1);
  --orange: #f97316;
  --orange-2: #f59e0b;
  --cyan: #22d3ee;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(249, 115, 22, 0.22), transparent 28rem),
    radial-gradient(circle at 82% 14%, rgba(34, 211, 238, 0.12), transparent 24rem),
    linear-gradient(180deg, #050505 0%, #0b0b0b 48%, #050505 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent);
}

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

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

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin: 16px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(245, 158, 11, 0.08));
  box-shadow: inset 0 0 22px rgba(249, 115, 22, 0.16);
}

.brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease-out, border-color 180ms ease-out, background 180ms ease-out;
}

.nav a:hover,
.nav a:focus-visible,
.nav button:hover,
.nav button:focus-visible {
  color: var(--text);
  border-color: rgba(249, 115, 22, 0.36);
  background: rgba(249, 115, 22, 0.08);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 30px;
  align-items: center;
  min-height: calc(100vh - 112px);
  padding: 70px 0 46px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.08);
  color: #fed7aa;
  font-size: 13px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--orange);
  box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.15);
}

.hero-title {
  max-width: 720px;
  margin: 0;
  font-size: clamp(32px, 5.8vw, 64px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-title-line {
  display: block;
}

.text-gradient {
  color: var(--orange-2);
  text-shadow: 0 0 28px rgba(249, 115, 22, 0.32);
}

.hero-copy {
  max-width: 680px;
  margin: 14px 0 0;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.82;
}

.parser-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.parser-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(120deg, transparent 0%, rgba(249, 115, 22, 0.15) 45%, transparent 72%);
  transform: translateX(-100%);
  animation: sheen 6s ease-in-out infinite;
}

.parser-inner {
  position: relative;
  z-index: 1;
  padding: 26px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.card-copy {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-weight: 700;
}

.url-input,
.search-input,
.select-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.url-input::placeholder,
.search-input::placeholder {
  color: #64748b;
}

.url-input:focus,
.search-input:focus,
.select-input:focus {
  border-color: rgba(249, 115, 22, 0.85);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(249, 115, 22, 0.5);
  border-radius: 8px;
  color: #111827;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(249, 115, 22, 0.24);
  transition: transform 180ms ease-out, box-shadow 180ms ease-out, filter 180ms ease-out;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 18px 42px rgba(249, 115, 22, 0.32);
  outline: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.btn.danger {
  color: #fff;
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: none;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 12px;
}

.action-row .btn {
  width: 100%;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.status-line {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.status-line.error {
  color: #fecaca;
}

.status-line.notice {
  color: #fed7aa;
}

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

.stat-mini,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 16px;
}

.stat-mini {
  display: grid;
  min-height: 72px;
  place-items: center;
  text-align: center;
}

.stat-mini strong,
.metric-card strong {
  display: block;
  font-size: 26px;
}

.stat-mini span,
.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.visual-stack {
  display: grid;
  gap: 14px;
}

.signal-card {
  border: 1px solid rgba(249, 115, 22, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.13), rgba(255, 255, 255, 0.03)),
    rgba(8, 8, 8, 0.75);
  padding: 20px;
}

.signal-card.large {
  min-height: 260px;
}

.wave-lines {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.wave-lines i {
  display: block;
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--orange), transparent);
  animation: wave 2.4s ease-in-out infinite;
}

.wave-lines i:nth-child(2) {
  width: 78%;
  animation-delay: 120ms;
}

.wave-lines i:nth-child(3) {
  width: 56%;
  animation-delay: 240ms;
}

.section {
  padding: 52px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head h2,
.page-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: 0;
}

.section-head p,
.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.record-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 180ms ease-out, background 180ms ease-out;
}

.record-card:hover,
.record-card:focus-within {
  border-color: rgba(249, 115, 22, 0.42);
  background: rgba(249, 115, 22, 0.06);
}

.thumb {
  display: grid;
  min-height: 168px;
  place-items: center;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(34, 211, 238, 0.08));
  color: var(--muted);
}

.thumb img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.record-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.home-record-grid .record-body {
  gap: 14px;
}

.home-publish-time {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.record-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.record-title a,
.title-link {
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease-out;
}

.record-title a:hover,
.record-title a:focus-visible,
.title-link:hover,
.title-link:focus-visible {
  color: #fed7aa;
  outline: none;
}

.meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  white-space: nowrap;
}

.badge.success {
  border-color: rgba(34, 197, 94, 0.34);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
}

.badge.failed {
  border-color: rgba(239, 68, 68, 0.34);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(320px, 0.72fr);
  gap: 22px;
  padding: 46px 0;
}

.video-stage {
  display: grid;
  min-height: 460px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.14), transparent),
    #0a0a0a;
}

.video-stage img,
.video-stage video {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
}

.image-gallery {
  position: relative;
  width: 100%;
  min-height: inherit;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  width: 100%;
  min-height: inherit;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-slide {
  position: relative;
  display: grid;
  flex: 0 0 100%;
  min-height: inherit;
  margin: 0;
  place-items: center;
  scroll-snap-align: center;
}

.gallery-slide img {
  display: block;
  width: 100%;
  min-height: inherit;
  object-fit: contain;
}

.gallery-slide figcaption {
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(0, 0, 0, 0.62);
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(249, 115, 22, 0.46);
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(0, 0, 0, 0.56);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 180ms ease-out, border-color 180ms ease-out;
  backdrop-filter: blur(10px);
}

.gallery-nav:hover,
.gallery-nav:focus-visible {
  border-color: rgba(249, 115, 22, 0.78);
  background: rgba(249, 115, 22, 0.2);
  outline: none;
}

.gallery-prev {
  left: 16px;
}

.gallery-next {
  right: 16px;
}

.inline-player {
  display: grid;
  width: 100%;
  min-height: inherit;
  place-items: center;
}

.inline-player video {
  display: block;
  min-height: inherit;
  background: #000;
}

.player-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 16px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.72);
  border-top: 1px solid var(--line);
}

.player-fallback[hidden] {
  display: none;
}

.player-fallback a {
  color: #fed7aa;
  font-weight: 800;
}

.play-overlay {
  display: grid;
  gap: 18px;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.play-overlay.cover-only {
  position: relative;
  width: 100%;
  min-height: inherit;
  padding: 0;
}

.play-overlay.cover-only img {
  display: block;
  min-height: inherit;
}

.play-circle {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(249, 115, 22, 0.58);
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.14);
  color: #fed7aa;
  cursor: pointer;
  transition: background 180ms ease-out, transform 180ms ease-out;
}

.play-circle:hover,
.play-circle:focus-visible {
  background: rgba(249, 115, 22, 0.22);
  outline: none;
}

.cover-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.cover-play-button:hover,
.cover-play-button:focus-visible {
  transform: translate(-50%, -50%);
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.info-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.info-item span:first-child {
  color: var(--muted);
}

.break-anywhere {
  overflow-wrap: anywhere;
}

.json-panel {
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070707;
  color: #d1d5db;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: #cbd5e1;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.data-table td {
  color: #e2e8f0;
}

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.pagination a:hover,
.pagination a:focus-visible,
.pagination .active {
  border-color: rgba(249, 115, 22, 0.48);
  color: var(--text);
  background: rgba(249, 115, 22, 0.12);
  outline: none;
}

.mobile-records {
  display: none;
}

.footer {
  padding: 34px 0 44px;
  color: var(--muted);
  text-align: center;
}

.page-pad {
  padding: 46px 0;
}

.empty {
  padding: 34px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.admin-filter-form {
  display: grid;
  grid-template-columns: 1fr 180px 180px auto;
  gap: 12px;
  align-items: end;
}

@keyframes sheen {
  0%, 52% { transform: translateX(-120%); }
  78%, 100% { transform: translateX(120%); }
}

@keyframes wave {
  0%, 100% { opacity: 0.48; transform: scaleX(0.74); transform-origin: left; }
  50% { opacity: 1; transform: scaleX(1); transform-origin: left; }
}

@media (max-width: 920px) {
  .hero,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
  }

  .record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    position: relative;
    top: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    justify-content: stretch;
  }

  .nav a,
  .nav button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .form-row,
  .stats-strip,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .parser-inner {
    padding: 20px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .desktop-table {
    display: none;
  }

  .mobile-records {
    display: grid;
    gap: 12px;
  }

  .video-stage {
    min-height: 330px;
  }

  .info-item {
    grid-template-columns: 1fr;
  }

  .admin-filter-form {
    grid-template-columns: 1fr;
  }
}

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