:root {
  --paper: #f2efe8;
  --paper-deep: #e8e3d9;
  --ink: #17213c;
  --ink-soft: #5f6677;
  --signal: #f05242;
  --signal-dark: #d93d31;
  --acid: #dbe74e;
  --line: rgba(23, 33, 60, 0.2);
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(34, 31, 26, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(240, 82, 66, 0.1), transparent 22rem),
    var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand b {
  color: var(--signal);
}

.brand-mark {
  width: 33px;
  height: 33px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.brand-mark i {
  display: block;
  background: var(--ink);
  border-radius: 2px;
}

.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 17px; background: var(--signal); }
.brand-mark i:nth-child(3) { height: 12px; }

.domain-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.domain-status strong {
  color: var(--ink);
  font-weight: 700;
}

.pulse {
  width: 8px;
  height: 8px;
  position: relative;
  border-radius: 50%;
  background: #3dab70;
  box-shadow: 0 0 0 4px rgba(61, 171, 112, 0.12);
}

.hero {
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 80px;
  align-items: end;
  padding: 88px 0 74px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 27px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.eyebrow span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-size: 9px;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 770px;
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(58px, 7.2vw, 105px);
  line-height: 0.94;
  letter-spacing: -0.065em;
  font-weight: 700;
}

.hero h1 span {
  color: var(--signal);
  font-style: italic;
  white-space: nowrap;
}

.intro {
  max-width: 690px;
  margin: 35px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.85;
}

.hero-note {
  min-height: 190px;
  position: relative;
  padding: 24px;
  background: var(--acid);
  transform: rotate(2.5deg);
  box-shadow: 8px 10px 0 rgba(23, 33, 60, 0.08);
}

.hero-note::after {
  content: "";
  position: absolute;
  width: 58px;
  height: 20px;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 255, 255, 0.65);
}

.note-number {
  display: block;
  margin-bottom: 43px;
  font: 800 10px/1 Inter, sans-serif;
  letter-spacing: 0.16em;
}

.hero-note p {
  margin: 0 0 8px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 700;
}

.hero-note small {
  color: rgba(23, 33, 60, 0.7);
  font-size: 12px;
  line-height: 1.7;
}

.parser-panel {
  position: relative;
  padding: 37px 40px 27px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
}

.parser-panel::before {
  content: "";
  position: absolute;
  width: 7px;
  inset: 0 auto 0 0;
  background: var(--signal);
}

.parser-panel label {
  display: block;
  margin-bottom: 12px;
  color: rgba(255, 253, 248, 0.68);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

.url-field {
  min-width: 0;
  position: relative;
}

.url-field input {
  width: 100%;
  height: 66px;
  padding: 0 22px 0 57px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 0;
  outline: none;
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.url-field input:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 4px rgba(219, 231, 78, 0.13);
}

.link-icon {
  width: 18px;
  height: 9px;
  position: absolute;
  top: 29px;
  left: 24px;
  z-index: 1;
  border: 2px solid var(--ink);
  border-radius: 8px;
  transform: rotate(-42deg);
}

.link-icon::after {
  content: "";
  width: 18px;
  height: 9px;
  position: absolute;
  top: 4px;
  left: 9px;
  border: 2px solid var(--ink);
  border-radius: 8px;
}

.parse-button {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 21px 0 24px;
  color: var(--white);
  background: var(--signal);
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.parse-button:hover {
  background: var(--signal-dark);
  transform: translateY(-2px);
}

.parse-button:focus-visible,
.download-button:focus-visible,
.direct-link:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

.parse-button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.button-arrow {
  font-size: 22px;
}

.form-foot {
  display: flex;
  gap: 30px;
  padding: 19px 0 0;
  color: rgba(255, 253, 248, 0.58);
  font-size: 11px;
}

.form-foot span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.check {
  width: 13px;
  height: 13px;
  position: relative;
  display: inline-block;
  border: 1px solid rgba(255, 253, 248, 0.4);
  border-radius: 50%;
}

.check::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 2px;
  top: 3px;
  left: 3px;
  border: solid var(--acid);
  border-width: 0 0 1px 1px;
  transform: rotate(-45deg);
}

.loading-panel,
.error-panel,
.results {
  margin-top: 28px;
}

.loading-panel {
  min-height: 210px;
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 36px;
  padding: 35px 45px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.5);
}

.loading-panel[hidden],
.error-panel[hidden],
.results[hidden] {
  display: none;
}

.loading-panel h2,
.error-panel h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 28px;
}

.loading-panel p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.loading-panel .eyebrow {
  margin-bottom: 18px;
}

.scanner {
  height: 120px;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.scanner span {
  width: 13px;
  background: var(--ink);
  animation: bars 1.1s ease-in-out infinite alternate;
}

.scanner span:nth-child(1) { height: 20%; animation-delay: -0.8s; }
.scanner span:nth-child(2) { height: 55%; animation-delay: -0.4s; }
.scanner span:nth-child(3) { height: 88%; animation-delay: -0.65s; background: var(--signal); }
.scanner span:nth-child(4) { height: 42%; animation-delay: -0.2s; }
.scanner span:nth-child(5) { height: 68%; animation-delay: -0.95s; }

.scanner i {
  position: absolute;
  inset: 0;
  height: 2px;
  background: var(--acid);
  box-shadow: 0 0 15px rgba(219, 231, 78, 0.9);
  animation: scan 1.8s ease-in-out infinite;
}

@keyframes bars {
  to { height: 22%; opacity: 0.45; }
}

@keyframes scan {
  0%, 100% { transform: translateY(12px); }
  50% { transform: translateY(105px); }
}

.error-panel {
  display: grid;
  grid-template-columns: 58px 1fr 40px;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  color: #fff;
  background: var(--signal);
}

.error-code {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font: italic 700 25px Georgia, serif;
}

.error-panel p,
.error-panel h2 {
  margin: 0;
}

.error-panel p {
  margin-bottom: 5px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}

.error-panel button {
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 30px;
}

.results {
  padding: 48px;
  min-width: 0;
  background: var(--white);
  box-shadow: var(--shadow);
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.results-header > div:first-child,
.video-card,
.video-details {
  min-width: 0;
}

.results-header .eyebrow {
  margin-bottom: 20px;
}

.results-header h2,
.section-label h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(35px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.source-link {
  display: inline-block;
  max-width: 700px;
  margin-top: 12px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.count-block {
  display: flex;
  align-items: end;
  gap: 10px;
  flex: 0 0 auto;
}

.count-block strong {
  color: var(--signal);
  font-family: Georgia, serif;
  font-size: 76px;
  line-height: 0.75;
}

.count-block span {
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.result-rule {
  height: 1px;
  margin: 39px 0 10px;
  background: var(--line);
}

.video-card {
  display: grid;
  grid-template-columns: minmax(250px, 42%) 1fr;
  gap: 42px;
  padding: 38px 0;
  border-bottom: 1px solid var(--line);
}

.poster-wrap {
  min-height: 245px;
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.poster {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  transition: transform 500ms ease;
}

.video-card:hover .poster {
  transform: scale(1.025);
}

.poster-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(255,255,255,.08) 46% 47%, transparent 47%),
    var(--ink);
}

.poster-fallback span {
  width: 12px;
  background: var(--paper);
}

.poster-fallback span:nth-child(1) { height: 32px; }
.poster-fallback span:nth-child(2) { height: 63px; background: var(--signal); }
.poster-fallback span:nth-child(3) { height: 45px; }

.video-index,
.file-badge {
  position: absolute;
  z-index: 2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.video-index {
  top: 14px;
  left: 14px;
  padding: 8px 10px;
  color: var(--white);
  background: var(--signal);
}

.file-badge {
  right: 14px;
  bottom: 14px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--acid);
}

.video-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.video-kicker {
  margin: 0 0 11px;
  color: var(--signal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.video-details h3 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.video-details dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 28px 0;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}

.video-details dl div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.video-details dt {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.video-details dd {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.status-ok::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #3dab70;
}

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

.download-button {
  min-width: 172px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px 15px 20px;
  color: var(--white);
  background: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.download-button:hover {
  background: var(--signal);
  transform: translateY(-2px);
}

.download-button i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  font-style: normal;
  font-size: 16px;
}

.direct-link {
  color: var(--ink-soft);
  font-size: 11px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}

.results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding-top: 24px;
}

.results-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.results-footer button,
.how-it-works button {
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  line-height: 2;
}

.how-it-works {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 90px;
  padding: 115px 0 120px;
}

.how-it-works ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.how-it-works li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.how-it-works li > span {
  color: var(--signal);
  font: italic 700 25px/1 Georgia, serif;
}

.how-it-works strong {
  display: block;
  margin-bottom: 6px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 21px;
}

.how-it-works li p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.site-footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.site-footer p { margin: 0; }
.site-footer span { color: var(--signal); }

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
  }

  .hero-note {
    width: 220px;
    min-height: 150px;
    margin-left: auto;
  }

  .note-number { margin-bottom: 22px; }
  .video-card { grid-template-columns: 1fr; gap: 28px; }
  .poster-wrap { aspect-ratio: 16 / 8.5; }
  .how-it-works { grid-template-columns: 1fr; gap: 50px; }
}

@media (max-width: 620px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .site-header { height: 74px; }
  .domain-status span:not(.pulse) { display: none; }
  .hero { min-height: auto; padding: 65px 0 55px; }
  .hero h1 { font-size: clamp(49px, 15vw, 72px); }
  .intro { margin-top: 25px; font-size: 15px; }
  .hero-note { display: none; }
  .parser-panel { padding: 27px 21px 22px; }
  .input-row { grid-template-columns: 1fr; }
  .url-field input { font-size: 13px; }
  .form-foot { flex-wrap: wrap; gap: 10px 18px; }
  .loading-panel { grid-template-columns: 1fr; padding: 28px; }
  .scanner { display: none; }
  .error-panel { grid-template-columns: 44px 1fr 28px; padding: 24px 18px; gap: 13px; }
  .error-code { width: 42px; height: 42px; }
  .error-panel h2 { font-size: 21px; }
  .results { padding: 30px 20px; }
  .results-header { align-items: start; }
  .count-block strong { font-size: 58px; }
  .count-block span { display: none; }
  .result-rule { margin-top: 28px; }
  .video-card { padding: 28px 0; }
  .poster-wrap { min-height: 0; }
  .video-details dl { grid-template-columns: 1fr 1fr; gap: 12px 0; }
  .video-details dl div:nth-child(3) { grid-column: 1 / -1; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); }
  .video-actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .direct-link { text-align: center; }
  .results-footer { align-items: start; flex-direction: column; }
  .how-it-works { padding: 85px 0; }
  .site-footer { align-items: start; flex-direction: column; justify-content: center; padding: 22px 0; line-height: 1.6; }
}

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