:root {
  color-scheme: light;
  --ink: #151719;
  --muted: #687077;
  --line: #dfe3e6;
  --surface: #ffffff;
  --soft: #f4f6f7;
  --accent: #ef3340;
  --accent-dark: #d51f2d;
  --teal: #0d7f78;
  --shadow: 0 12px 34px rgba(17, 24, 28, .09);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #f7f8f8; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fff 0, #f7f8f8 420px, #f7f8f8 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

button, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 64px;
  border-bottom: 1px solid rgba(25, 30, 34, .08);
  background: rgba(255, 255, 255, .94);
}

.topbar-inner {
  width: min(1100px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; color: #fff; background: var(--ink); font-size: 21px; }
.topbar-note { color: var(--muted); font-size: 14px; }

.page-shell { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 44px; }
.tool-section { width: 100%; }
.intro { max-width: 700px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: 12px; font-weight: 800; }
.intro h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); line-height: 1.14; letter-spacing: 0; }
.intro > p:last-child { margin: 16px 0 0; color: var(--muted); line-height: 1.7; }

.parse-form {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.parse-form > label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.input-wrap { position: relative; }
textarea {
  display: block;
  width: 100%;
  min-height: 106px;
  padding: 16px 84px 16px 16px;
  resize: vertical;
  border: 1px solid #cbd1d5;
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #fbfcfc;
  line-height: 1.55;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
textarea:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(13,127,120,.12); }
textarea::placeholder { color: #92999e; }

.paste-button {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 60px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #3f474c;
  background: #fff;
  cursor: pointer;
}
.paste-button:hover { background: var(--soft); }

.primary-button, .download-button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: background .16s, transform .16s;
}
.primary-button { width: 100%; margin-top: 14px; }
.primary-button:hover, .download-button:hover { background: var(--accent-dark); }
.primary-button:active, .download-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .78; }
.button-loading { display: none; align-items: center; justify-content: center; gap: 9px; }
.primary-button.is-loading .button-label { display: none; }
.primary-button.is-loading .button-loading { display: flex; }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { margin-top: 16px; padding: 13px 15px; border: 1px solid #efc6c9; border-radius: 6px; color: #8b1d25; background: #fff2f3; line-height: 1.5; }
.notice.success { border-color: #b8ddd8; color: #11655f; background: #eef9f7; }

.result { margin-top: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.media-summary { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 24px; border-bottom: 1px solid var(--line); }
.cover-wrap { position: relative; width: 180px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 6px; background: #e9edef; }
.cover-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.duration { position: absolute; right: 8px; bottom: 8px; padding: 4px 7px; border-radius: 4px; color: #fff; background: rgba(0,0,0,.7); font-size: 12px; }
.media-copy { align-self: center; min-width: 0; }
.result-label { margin: 0 0 10px; color: var(--teal); font-size: 13px; font-weight: 800; }
.media-copy h2 { margin: 0; font-size: 22px; line-height: 1.5; overflow-wrap: anywhere; }
.author { margin: 13px 0 0; color: var(--muted); }

.quality-section { padding: 24px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h3 { margin: 0; font-size: 17px; }
.section-heading span { color: var(--muted); font-size: 13px; }
.quality-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quality-option { position: relative; min-width: 0; }
.quality-option input { position: absolute; opacity: 0; pointer-events: none; }
.quality-option label { display: flex; min-height: 70px; padding: 11px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; text-align: center; transition: border-color .16s, background .16s, box-shadow .16s; }
.quality-option label:hover { border-color: #adb6bb; background: #fafbfb; }
.quality-option input:focus-visible + label { box-shadow: 0 0 0 3px rgba(13,127,120,.14); }
.quality-option input:checked + label { border-color: var(--teal); background: #eff8f7; box-shadow: inset 0 0 0 1px var(--teal); }
.quality-name { font-weight: 800; overflow-wrap: anywhere; }
.quality-size { color: var(--muted); font-size: 12px; }

.download-button { display: flex; width: 100%; margin-top: 16px; padding: 0 18px; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.download-meta { color: rgba(255,255,255,.78); font-size: 13px; font-weight: 600; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 54px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 24px 18px; }
.step + .step { border-left: 1px solid var(--line); }
.step > span { color: var(--accent); font-weight: 900; }
.step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.step strong { display: block; margin-bottom: 3px; color: var(--ink); }
footer { padding: 22px 20px 28px; color: #858c91; text-align: center; font-size: 12px; }

@media (max-width: 700px) {
  .topbar { height: 58px; }
  .topbar-inner, .page-shell { width: min(100% - 28px, 920px); }
  .topbar-note { display: none; }
  .page-shell { padding-top: 40px; }
  .intro { margin-bottom: 22px; }
  .intro h1 { font-size: 32px; }
  .parse-form { padding: 18px; }
  .media-summary { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 18px; }
  .cover-wrap { width: 112px; }
  .media-copy h2 { font-size: 17px; }
  .quality-section { padding: 18px; }
  .quality-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; margin-top: 38px; }
  .step + .step { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 420px) {
  .media-summary { grid-template-columns: 92px minmax(0, 1fr); gap: 13px; }
  .cover-wrap { width: 92px; }
  .media-copy h2 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
}

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