:root {
  color-scheme: dark;
  --bg: #0d0e12;
  --panel: rgba(24, 25, 32, 0.78);
  --panel-solid: #181920;
  --text: #f6f3ef;
  --muted: #9a9ca8;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff4f75;
  --accent-2: #ff7c5c;
  --success: #7be0af;
  --radius: 24px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 79, 117, 0.14), transparent 38%),
    linear-gradient(180deg, #101116 0%, var(--bg) 55%);
}

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

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.ambient span {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
}

.ambient span:first-child { top: 12%; left: -220px; background: #6b4dff; }
.ambient span:last-child { top: 34%; right: -220px; background: #ff4f75; }

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 79, 117, 0.22), rgba(255, 124, 92, 0.08));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 20px;
}

.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: 0.08em; }
.brand small { margin-top: 3px; color: #777986; font-size: 9px; letter-spacing: 0.16em; }

.status-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b6b8c1;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(123, 224, 175, 0.1);
}

.hero { padding: 88px 0 72px; text-align: center; }

.eyebrow {
  margin: 0 0 18px;
  color: #777986;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
}

h1 {
  max-width: 780px;
  margin: 0 auto;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

h1 em {
  color: transparent;
  background: linear-gradient(100deg, #ffb2c2, var(--accent), var(--accent-2));
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}

.lead { margin: 22px 0 0; color: var(--muted); font-size: 16px; }

.parser-card {
  max-width: 900px;
  margin: 48px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(31, 32, 40, 0.92), rgba(21, 22, 28, 0.88));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.06);
  text-align: left;
  backdrop-filter: blur(18px);
}

.parser-card > label {
  display: block;
  margin: 0 0 11px 4px;
  color: #cacbd2;
  font-size: 13px;
  font-weight: 650;
}

.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

.url-field { position: relative; }

.url-field svg {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 20px;
  fill: none;
  stroke: #737581;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transform: translateY(-50%);
}

.url-field input {
  width: 100%;
  height: 58px;
  padding: 0 50px 0 50px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  outline: none;
  color: var(--text);
  background: rgba(6, 7, 10, 0.56);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.url-field input::placeholder { color: #646672; }
.url-field input:focus { border-color: rgba(255, 79, 117, 0.56); box-shadow: 0 0 0 4px rgba(255, 79, 117, 0.08); }

.clear-button {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #8d8f99;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transform: translateY(-50%);
}

.parse-button {
  min-width: 142px;
  height: 58px;
  padding: 0 24px;
  border: 0;
  border-radius: 15px;
  color: white;
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(255, 79, 117, 0.22);
  cursor: pointer;
  font-weight: 720;
  transition: transform 160ms ease, filter 160ms ease;
}

.parse-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.parse-button:disabled { cursor: wait; filter: saturate(0.6); transform: none; }
.button-loading { display: none; align-items: center; gap: 8px; }
.button-loading i { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.parser-card.is-loading .button-label { display: none; }
.parser-card.is-loading .button-loading { display: inline-flex; }

.form-meta {
  display: flex;
  justify-content: space-between;
  padding: 11px 5px 0;
  color: #727480;
  font-size: 12px;
}

.form-meta button { padding: 0; border: 0; color: #b9bac2; background: none; cursor: pointer; }
.form-message { min-height: 0; margin: 0; color: #ff9caf; font-size: 13px; }
.form-message:not(:empty) { min-height: 20px; padding: 12px 5px 0; }

.steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  color: #737580;
  font-size: 12px;
}

.steps span { display: inline-flex; gap: 8px; align-items: center; }
.steps b { color: #b8bac3; font-size: 10px; }
.steps i { width: 44px; height: 1px; background: var(--line); }

.result {
  margin-bottom: 30px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.result[hidden] { display: none; }
.result-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.result-heading .eyebrow { margin-bottom: 8px; }
.result-heading h2 { margin: 0; font-size: 26px; }

.success-tag { padding: 7px 11px; border: 1px solid rgba(123,224,175,.18); border-radius: 999px; color: var(--success); background: rgba(123,224,175,.07); font-size: 12px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 24px; }
.video-panel, .detail-panel { min-width: 0; }

.video-frame {
  position: relative;
  display: grid;
  min-height: 430px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: #090a0d;
}

.video-frame video { display: block; width: 100%; max-height: 620px; background: black; }
.video-placeholder { color: #777985; text-align: center; }
.video-placeholder span { display: grid; width: 58px; height: 58px; margin: 0 auto 12px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #bfc0c8; background: rgba(255,255,255,.04); }
.video-placeholder p { margin: 0; font-size: 13px; }

.video-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.video-actions a, .video-actions button { display: grid; min-height: 46px; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: #d8d9de; background: rgba(255,255,255,.035); text-decoration: none; cursor: pointer; }
.video-actions .primary-link { border-color: transparent; color: white; background: linear-gradient(110deg, var(--accent), var(--accent-2)); }

.detail-panel { padding: 6px 4px; }
.author-card { display: flex; gap: 15px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.author-card img, .avatar-fallback { width: 60px; height: 60px; flex: 0 0 auto; border-radius: 18px; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; color: #ffb2c2; background: linear-gradient(135deg, rgba(255,79,117,.22), rgba(255,124,92,.08)); font-family: Georgia, serif; font-size: 22px; }
.author-card span, .description span, .source-link > span { color: #777985; font-size: 11px; letter-spacing: .08em; }
.author-card h3 { margin: 4px 0; font-size: 18px; }
.author-card p { margin: 0; color: #9799a4; font-size: 13px; }
.description { padding: 22px 0; border-bottom: 1px solid var(--line); }
.description p { margin: 9px 0 0; color: #d0d1d6; line-height: 1.75; }
.result-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.result-meta div { padding: 14px; border-radius: 13px; background: rgba(255,255,255,.035); }
.result-meta dt { color: #747681; font-size: 11px; }
.result-meta dd { margin: 6px 0 0; color: #d6d7dc; font-size: 13px; }
.source-link { min-width: 0; }
.source-link code { display: block; margin-top: 8px; overflow: hidden; color: #888a95; font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }

.notice { display: flex; gap: 16px; align-items: flex-start; margin: 28px 0 80px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.022); }
.notice-icon { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #b4b6c0; background: rgba(255,255,255,.07); font-family: Georgia, serif; }
.notice h2 { margin: 1px 0 6px; font-size: 14px; }
.notice p { margin: 0; color: #7e808c; font-size: 12px; line-height: 1.7; }

footer { display: flex; justify-content: space-between; padding: 26px 0 36px; border-top: 1px solid var(--line); color: #666873; font-size: 12px; }
footer p { margin: 0; }
footer strong { color: #a4a6af; }

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

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 24px, 1120px); }
  .site-header { padding-top: 18px; }
  .status-pill { display: none; }
  .hero { padding: 58px 0 54px; }
  h1 { font-size: clamp(36px, 12vw, 52px); }
  .lead { font-size: 14px; line-height: 1.7; }
  .parser-card { margin-top: 34px; padding: 14px; border-radius: 20px; }
  .input-row { grid-template-columns: 1fr; }
  .parse-button { width: 100%; }
  .steps { gap: 9px; }
  .steps i { width: 18px; }
  .steps span { gap: 4px; }
  .result { padding: 18px; border-radius: 22px; }
  .result-grid { grid-template-columns: 1fr; }
  .video-frame { min-height: 300px; }
  .detail-panel { padding-top: 10px; }
  .notice { margin-bottom: 54px; }
  footer { gap: 12px; flex-direction: column; }
}

@media (max-width: 430px) {
  .steps i { display: none; }
  .steps { justify-content: space-between; }
  .steps span { flex-direction: column; }
  .form-meta { align-items: flex-start; gap: 8px; }
  .result-heading { align-items: flex-end; }
  .success-tag { font-size: 10px; }
}

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