:root {
  --paper: #f6f3ed;
  --paper-deep: #ece8df;
  --ink: #1f201d;
  --muted: #6f716b;
  --line: #d7d2c8;
  --accent: #e84b2f;
  --accent-dark: #cf3a22;
  --green: #277a58;
  --green-pale: #e5f0e9;
  --white: #fffdf8;
  --shadow: 0 24px 60px rgba(55, 49, 40, 0.09);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 13%, rgba(232, 75, 47, 0.08), transparent 27%),
    linear-gradient(rgba(42, 42, 38, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 42, 38, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  height: 84px;
  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: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 22px;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.privacy-note i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(39, 122, 88, 0.1);
}

main {
  padding: 72px 0 80px;
}

.hero {
  max-width: 760px;
  margin: 0 auto 50px;
  text-align: center;
}

.eyebrow,
.section-label,
.result-kicker {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow-line {
  width: 25px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  margin: 20px 0 22px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.08;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.hero h1 em {
  color: var(--accent);
  font-family: Georgia, "Noto Serif SC", serif;
  font-weight: 500;
}

.hero-copy {
  max-width: 610px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.support-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-top: 26px;
  color: #575954;
  font-size: 13px;
}

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

.check {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: var(--green);
  background: var(--green-pale);
  border-radius: 50%;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.workbench,
.result-card {
  width: min(790px, 100%);
  margin: 0 auto;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(202, 196, 186, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.workbench {
  padding: 34px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-heading > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.step-no {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}

.card-heading h2 {
  margin: 0;
  font-size: 18px;
}

.text-button {
  padding: 8px 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: #bbb4aa;
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--accent);
}

.input-wrap {
  overflow: hidden;
  background: #f2efe8;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.input-wrap:focus-within {
  background: var(--white);
  border-color: rgba(232, 75, 47, 0.55);
  box-shadow: 0 0 0 4px rgba(232, 75, 47, 0.08);
}

textarea {
  width: 100%;
  min-height: 168px;
  display: block;
  padding: 20px 20px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  resize: vertical;
  font-size: 14px;
  line-height: 1.8;
}

textarea::placeholder {
  color: #999990;
}

.input-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px 10px 20px;
}

.input-toolbar p {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #96968e;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

#linkHint {
  overflow: hidden;
  text-overflow: ellipsis;
}

#linkIndicator {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: #b1afa8;
  border-radius: 50%;
}

.input-wrap.has-link #linkIndicator {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(39, 122, 88, 0.1);
}

.input-wrap.has-link #linkHint {
  color: var(--green);
}

.input-toolbar > div {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.paste-button,
.icon-button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #44453f;
  background: var(--white);
  border: 1px solid #d8d3ca;
  border-radius: 10px;
  cursor: pointer;
}

.paste-button {
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
}

.paste-button svg {
  width: 17px;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.icon-button svg {
  width: 17px;
}

.is-hidden {
  display: none;
}

.primary-button,
.download-button {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  margin-top: 18px;
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 12px 25px rgba(232, 75, 47, 0.2);
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.primary-button:active,
.download-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.76;
}

.button-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.button-loading {
  display: none;
  align-items: center;
  gap: 5px;
}

.button-loading i {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  animation: blink 1s infinite ease-in-out;
}

.button-loading i:nth-child(2) {
  animation-delay: 120ms;
}

.button-loading i:nth-child(3) {
  margin-right: 7px;
  animation-delay: 240ms;
}

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

.primary-button.is-loading .button-loading {
  display: flex;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.28; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.status-panel {
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 15px 17px;
  background: #f3eee8;
  border-radius: 13px;
}

.status-panel:not([hidden]) {
  display: flex;
}

.status-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  color: var(--accent);
  background: rgba(232, 75, 47, 0.1);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.status-panel strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.status-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.status-panel.is-error {
  background: #f8eae6;
}

.status-panel.is-success {
  background: var(--green-pale);
}

.status-panel.is-success .status-icon {
  color: var(--green);
  background: rgba(39, 122, 88, 0.12);
}

.result-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 0;
  margin-top: 24px;
  padding: 14px;
  position: relative;
}

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

.result-kicker {
  position: absolute;
  top: 29px;
  right: 30px;
  color: var(--green);
}

.result-kicker span {
  margin-right: 5px;
}

.video-stage {
  min-height: 360px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.12), transparent 28%),
    #20211e;
  border-radius: 19px;
}

.video-stage video {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: none;
  position: absolute;
  inset: 0;
  object-fit: contain;
  background: #151613;
}

.video-stage.has-video video {
  display: block;
}

.video-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.66);
}

.video-placeholder svg {
  width: 64px;
}

.video-stage.has-video .video-placeholder {
  display: none;
}

.result-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 28px 26px 32px;
}

.result-content h2 {
  margin: 0 0 7px;
  font-size: 24px;
}

.video-title {
  min-height: 23px;
  margin: 0 0 23px;
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
  line-height: 1.7;
}

.result-url {
  margin-bottom: 17px;
}

.result-url > span {
  display: block;
  margin-bottom: 8px;
  color: #8c8d86;
  font-size: 11px;
}

.result-url > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 11px 11px 13px;
  background: #f1eee7;
  border: 1px solid #ded9d0;
  border-radius: 11px;
}

.result-url code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #575852;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-url button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: #686961;
  background: var(--white);
  border: 1px solid #d5d0c7;
  border-radius: 8px;
  cursor: pointer;
}

.result-url button svg {
  width: 15px;
}

.download-button {
  gap: 9px;
  color: var(--white);
  background: var(--green);
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(39, 122, 88, 0.16);
}

.download-button:hover {
  background: #1d694a;
  transform: translateY(-1px);
}

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

.download-tip {
  margin: 11px 0 0;
  color: #93948e;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.how-it-works {
  margin: 88px auto 0;
  text-align: center;
}

.how-it-works h2 {
  margin: 12px 0 38px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.04em;
}

.flow-grid {
  display: grid;
  grid-template-columns: 1fr 46px 1fr 46px 1fr;
  align-items: center;
}

.flow-grid article {
  min-height: 185px;
  padding: 28px 23px;
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.flow-grid article > span {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  background: rgba(232, 75, 47, 0.09);
  border-radius: 50%;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}

.flow-grid h3 {
  margin: 15px 0 8px;
  font-size: 16px;
}

.flow-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.flow-line {
  height: 1px;
  position: relative;
  background: #c9c4ba;
}

.flow-line::after {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  top: -2px;
  right: 0;
  border-top: 1px solid #9e9a91;
  border-right: 1px solid #9e9a91;
  transform: rotate(45deg);
}

.notice {
  max-width: 790px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 48px auto 0;
  padding: 17px 20px;
  color: #62635d;
  background: rgba(232, 75, 47, 0.055);
  border-left: 3px solid rgba(232, 75, 47, 0.55);
}

.notice svg {
  width: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--accent);
}

.notice p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.notice strong {
  margin-right: 10px;
  color: var(--ink);
}

footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #989991;
  border-top: 1px solid var(--line);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
}

.toast {
  max-width: calc(100vw - 36px);
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  padding: 11px 16px;
  color: #fff;
  background: rgba(31, 32, 29, 0.92);
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 13px;
}

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 28px, 620px);
  }

  .topbar {
    height: 70px;
  }

  .privacy-note {
    font-size: 10px;
  }

  main {
    padding: 50px 0 55px;
  }

  .hero {
    margin-bottom: 35px;
  }

  .hero h1 {
    margin-top: 16px;
    font-size: clamp(40px, 13vw, 61px);
  }

  .hero-copy {
    font-size: 14px;
  }

  .workbench {
    padding: 22px;
    border-radius: 22px;
  }

  .result-card {
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 22px;
  }

  .result-kicker {
    top: 29px;
    right: 25px;
  }

  .video-stage,
  .video-stage video {
    min-height: min(105vw, 500px);
  }

  .result-content {
    padding: 26px 14px 16px;
  }

  .result-content h2 {
    padding-right: 100px;
    font-size: 21px;
  }

  .flow-grid {
    width: min(440px, 100%);
    grid-template-columns: 1fr;
    margin: 0 auto;
  }

  .flow-line {
    width: 1px;
    height: 27px;
    margin: 0 auto;
  }

  .flow-line::after {
    top: auto;
    right: -2px;
    bottom: 0;
    transform: rotate(135deg);
  }

  .flow-grid article {
    min-height: auto;
  }

  .how-it-works {
    margin-top: 70px;
  }

  .how-it-works h2 {
    margin-bottom: 28px;
  }
}

@media (max-width: 430px) {
  .page-shell {
    width: calc(100% - 24px);
  }

  .brand {
    gap: 9px;
    font-size: 17px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .hero h1 {
    letter-spacing: -0.07em;
  }

  .support-row {
    gap: 12px;
    font-size: 11px;
  }

  .workbench {
    padding: 18px 14px 14px;
  }

  .card-heading {
    padding: 0 3px;
  }

  textarea {
    min-height: 185px;
    padding: 17px 15px 8px;
    font-size: 13px;
  }

  .input-toolbar {
    padding-left: 15px;
  }

  .input-toolbar p {
    max-width: 50%;
  }

  .result-content h2 {
    padding-right: 90px;
  }

  .notice {
    padding: 15px;
  }

  footer {
    min-height: 92px;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
  }
}

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