:root {
  --bg: #070d17;
  --panel: rgba(15, 26, 43, 0.78);
  --panel-solid: #101c2d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f7f9fc;
  --muted: #94a5b9;
  --muted-dark: #65758a;
  --mint: #48e2b0;
  --mint-dark: #20b88b;
  --coral: #ff7c6e;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, #163655 0, transparent 38%),
    var(--bg);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

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

.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.62;
}

.orb-one {
  top: -190px;
  left: -110px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle at 55% 55%, rgba(36, 218, 171, 0.26), transparent 68%);
  animation: drift-one 18s ease-in-out infinite alternate;
}

.orb-two {
  right: -210px;
  top: 38%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 45% 50%, rgba(255, 111, 101, 0.16), transparent 69%);
  animation: drift-two 21s ease-in-out infinite alternate;
}

.grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 78%);
}

@keyframes drift-one {
  to { transform: translate3d(55px, 45px, 0) scale(1.08); }
}

@keyframes drift-two {
  to { transform: translate3d(-65px, -35px, 0) scale(0.94); }
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding:
    max(22px, env(safe-area-inset-top))
    0
    max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

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

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgba(116, 255, 213, 0.28);
  border-radius: 13px;
  color: var(--mint);
  background: linear-gradient(145deg, rgba(72, 226, 176, 0.19), rgba(72, 226, 176, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--muted-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

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

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(72, 226, 176, 0.12), 0 0 18px rgba(72, 226, 176, 0.62);
}

.hero {
  padding: 78px 6px 36px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #9bb0c5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.eyebrow i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--coral);
}

.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(38px, 8vw, 68px);
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -0.065em;
}

.hero h1 em {
  color: var(--mint);
  font-style: normal;
  text-shadow: 0 0 45px rgba(72, 226, 176, 0.2);
}

.hero p {
  max-width: 550px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.converter-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.045), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(26px) saturate(125%);
}

.card-glow {
  position: absolute;
  top: -110px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(72, 226, 176, 0.1);
  filter: blur(20px);
  pointer-events: none;
}

.field-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 3px;
}

.field-head label {
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0.03em;
}

.field-head span {
  color: var(--muted-dark);
  font-size: 11px;
}

.input-shell {
  position: relative;
}

.input-shell textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 18px 18px 48px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  outline: none;
  color: var(--text);
  caret-color: var(--mint);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 48%),
    rgba(4, 11, 21, 0.62);
  font-size: 15px;
  line-height: 1.65;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.input-shell textarea::placeholder {
  color: #586a7f;
}

.input-shell textarea:focus {
  border-color: rgba(72, 226, 176, 0.55);
  background-color: rgba(4, 11, 21, 0.8);
  box-shadow: 0 0 0 4px rgba(72, 226, 176, 0.07);
}

.paste-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #9fb0c2;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  cursor: pointer;
  transition: 160ms ease;
}

.paste-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.paste-button svg {
  width: 16px;
  height: 16px;
}

.inline-error {
  margin-top: 11px;
  color: #ffb4aa;
  font-size: 13px;
  line-height: 1.55;
}

.resolve-button {
  position: relative;
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  color: #04120d;
  background:
    linear-gradient(110deg, #64e6c0, #43daa9 62%, #74efc8);
  box-shadow:
    0 14px 34px rgba(47, 209, 159, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.resolve-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 28%, rgba(255, 255, 255, 0.3) 50%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 550ms ease;
  content: "";
}

.resolve-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 40px rgba(47, 209, 159, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.resolve-button:hover::after {
  transform: translateX(120%);
}

.resolve-button:active {
  transform: translateY(0);
}

.resolve-button:disabled {
  cursor: wait;
  filter: saturate(0.7);
}

.button-label,
.button-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.button-label svg {
  width: 20px;
  height: 20px;
}

.button-loading {
  display: none;
}

.resolve-button.is-loading .button-label {
  display: none;
}

.resolve-button.is-loading .button-loading {
  display: inline-flex;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(4, 18, 13, 0.22);
  border-top-color: #04120d;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-top: 17px;
  color: var(--muted-dark);
  font-size: 11px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trust-row svg {
  width: 14px;
  height: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 28px;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(72, 226, 176, 0.18);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(72, 226, 176, 0.06), transparent 34%),
    rgba(14, 25, 41, 0.9);
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.34);
  animation: result-in 420ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.result-card[hidden] {
  display: none;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

.result-cover-wrap {
  position: relative;
  align-self: stretch;
  min-height: 246px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background:
    radial-gradient(circle at 30% 20%, rgba(72, 226, 176, 0.18), transparent 52%),
    #0a1422;
}

.result-cover {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 246px;
  object-fit: cover;
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.2);
}

.cover-placeholder svg {
  width: 42px;
  height: 42px;
}

.clean-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid rgba(72, 226, 176, 0.26);
  border-radius: 999px;
  color: #b9ffe9;
  background: rgba(5, 20, 17, 0.76);
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: blur(10px);
}

.clean-badge svg {
  width: 15px;
  height: 15px;
}

.result-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.result-kicker {
  margin-bottom: 9px;
  color: var(--mint);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.18em;
}

.result-info h2 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 680;
  line-height: 1.45;
  letter-spacing: -0.02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.result-tags span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.result-tags span:first-child {
  border-color: rgba(72, 226, 176, 0.19);
  color: #a8f8dc;
  background: rgba(72, 226, 176, 0.07);
}

.result-divider {
  height: 1px;
  margin: 20px 0 16px;
  background: var(--line);
}

.download-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-radius: 14px;
  color: #03130d;
  background: linear-gradient(110deg, #71eac6, #49d9ac);
  box-shadow: 0 12px 30px rgba(44, 201, 154, 0.18);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.download-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(44, 201, 154, 0.24);
}

.download-button span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.download-button svg {
  width: 20px;
  height: 20px;
}

.download-button .chevron {
  width: 16px;
  height: 16px;
  opacity: 0.65;
}

.save-note,
.expiry-note {
  margin: 10px 2px 0;
  color: var(--muted-dark);
  font-size: 11px;
  line-height: 1.55;
}

.expiry-note {
  margin-top: 4px;
}

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

.steps article {
  display: flex;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.022);
}

.steps article > span {
  color: rgba(72, 226, 176, 0.6);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.steps h3 {
  margin: -2px 0 7px;
  font-size: 13px;
  font-weight: 650;
}

.steps p {
  margin: 0;
  color: var(--muted-dark);
  font-size: 11px;
  line-height: 1.65;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 5px 6px;
  color: #4d5e71;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  max-width: min(calc(100% - 36px), 440px);
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #eaf3fb;
  background: rgba(14, 26, 43, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.44);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 180ms ease;
  backdrop-filter: blur(15px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sheet-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(0, 5, 12, 0.72);
  backdrop-filter: blur(5px);
}

.sheet-backdrop[hidden],
.save-sheet[hidden] {
  display: none;
}

.save-sheet {
  position: fixed;
  z-index: 41;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 520px);
  margin: auto;
  padding: 12px 22px calc(22px + env(safe-area-inset-bottom));
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 25px 25px 0 0;
  background: #101c2d;
  box-shadow: 0 -25px 70px rgba(0, 0, 0, 0.5);
  animation: sheet-in 240ms ease both;
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.download-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 21px;
}

.download-state-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid rgba(72, 226, 176, 0.23);
  border-radius: 14px;
  color: var(--mint);
  background: rgba(72, 226, 176, 0.09);
}

.download-state-icon svg {
  width: 22px;
  height: 22px;
}

.download-state-icon.is-complete {
  color: #04120d;
  background: var(--mint);
}

.download-state-icon.is-error {
  border-color: rgba(255, 124, 110, 0.25);
  color: #ff9b90;
  background: rgba(255, 124, 110, 0.09);
}

.download-heading h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.download-heading p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-block {
  margin-bottom: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.progress-labels,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-labels {
  margin-bottom: 11px;
}

.progress-labels strong {
  color: var(--mint);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.progress-labels span,
.progress-meta {
  color: var(--muted-dark);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3ed6a6, #7aefcc);
  box-shadow: 0 0 16px rgba(72, 226, 176, 0.35);
  transition: width 140ms linear;
}

.progress-track.is-indeterminate .progress-fill {
  width: 36%;
  animation: progress-indeterminate 1.25s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  from { transform: translateX(-120%); }
  to { transform: translateX(380%); }
}

.progress-meta {
  margin-top: 9px;
}

.download-result {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -2px 0 16px;
  color: #bcefe0;
  font-size: 12px;
  line-height: 1.55;
}

.download-result[hidden] {
  display: none;
}

.download-result p {
  margin: 0;
}

.result-check {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  color: #04130e;
  background: var(--mint);
}

.result-check svg {
  width: 14px;
  height: 14px;
}

.ios-save-steps {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.ios-save-steps[hidden] {
  display: none;
}

.save-sheet h3 {
  margin: 0 0 13px;
  font-size: 18px;
}

.sheet-primary,
.sheet-close,
.sheet-direct,
.sheet-photo,
.sheet-open-video {
  display: grid;
  width: 100%;
  min-height: 49px;
  place-items: center;
  border-radius: 13px;
  text-decoration: none;
}

.sheet-primary {
  color: #04120d;
  background: var(--mint);
  font-size: 14px;
  font-weight: 750;
}

.sheet-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #04120d;
  background: linear-gradient(110deg, #71eac6, #49d9ac);
  box-shadow: 0 12px 30px rgba(44, 201, 154, 0.2);
  font-size: 14px;
  font-weight: 760;
}

.sheet-photo svg {
  width: 20px;
  height: 20px;
}

.sheet-open-video {
  margin-top: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.sheet-close {
  margin-top: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.sheet-primary[hidden],
.sheet-close[hidden],
.sheet-direct[hidden],
.sheet-photo[hidden],
.sheet-open-video[hidden] {
  display: none;
}

.sheet-direct {
  border: 1px solid rgba(72, 226, 176, 0.25);
  color: var(--mint);
  background: rgba(72, 226, 176, 0.08);
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 24px, 920px);
  }

  .hero {
    padding: 58px 2px 28px;
  }

  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .hero h1 {
    margin-top: 18px;
    font-size: clamp(34px, 11vw, 50px);
  }

  .hero p {
    padding: 0 10px;
    font-size: 13px;
  }

  .converter-card {
    padding: 18px;
    border-radius: 23px;
  }

  .trust-row {
    gap: 14px;
  }

  .result-card {
    grid-template-columns: 112px 1fr;
    gap: 16px;
    padding: 15px;
    border-radius: 22px;
  }

  .result-cover-wrap {
    min-height: 172px;
  }

  .result-cover {
    min-height: 172px;
  }

  .clean-badge {
    left: 7px;
    bottom: 7px;
    padding: 5px 7px;
    font-size: 9px;
  }

  .result-info h2 {
    font-size: 15px;
    -webkit-line-clamp: 3;
  }

  .result-kicker {
    margin-bottom: 6px;
  }

  .result-tags {
    gap: 4px;
    margin-top: 9px;
  }

  .result-tags span {
    padding: 4px 6px;
    font-size: 9px;
  }

  .result-divider {
    margin: 11px 0 10px;
  }

  .download-button {
    min-height: 45px;
    padding: 0 12px;
    font-size: 12px;
  }

  .save-note,
  .expiry-note {
    display: none;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 16px;
  }

  .steps article {
    padding: 15px;
  }

  footer {
    flex-direction: column;
    gap: 7px;
    padding-top: 24px;
  }
}

@media (max-width: 380px) {
  .status-pill {
    padding: 7px 9px;
    font-size: 10px;
  }

  .trust-row {
    justify-content: space-between;
    gap: 6px;
  }

  .result-card {
    grid-template-columns: 96px 1fr;
    gap: 12px;
  }
}

@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;
  }
}
