:root {
  color-scheme: dark;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #f8f8fa;
  background: #070708;
  --muted: #b5bac4;
  --border: #2b2c30;
  --accent: #83e8f1;
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --gutter: clamp(20px, 3vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 105px; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip:focus { position: fixed; top: 6px; left: 6px; z-index: 5; padding: 10px; background: #111; }

.header {
  position: fixed;
  z-index: 3;
  inset: 26px 26px auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 8px 16px 8px 25px;
  border: 1px solid #ffffff42;
  border-radius: 40px;
  background: linear-gradient(125deg, #212b3bd9, #101520e8);
  box-shadow: inset 0 1px #ffffff13, 0 5px 22px #0003;
}
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 9px; transition: color .2s ease, scale .2s var(--ease-out); }
.brand:is(:hover, :focus-visible) { color: var(--accent); }
.brand:active { scale: .97; }
.brand img { object-fit: contain; }
.brand span { font: 700 33px/1 "Avenir Next", Inter, system-ui, sans-serif; letter-spacing: -.025em; }
.header nav { display: flex; align-items: center; gap: clamp(18px, 4.1vw, 62px); }
.header nav :is(a, button), footer button {
  background: transparent;
  border: 0;
  padding: 7px 0;
  font-size: 14px;
  color: #c1c1c8;
  white-space: nowrap;
}
.header nav :is(a, button), footer > div :is(a, button) {
  position: relative;
  transition: color .22s ease, translate .23s var(--ease-out), text-shadow .22s ease;
}
.header nav :is(a, button)::after {
  content: "";
  position: absolute;
  inset: auto 0 3px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  scale: .28 1;
  transition: scale .26s var(--ease-out), opacity .2s ease;
}
.header nav [aria-current], .header nav :is(a, button):is(:hover, :focus-visible), footer > div :is(a, button):is(:hover, :focus-visible) {
  color: var(--accent);
  text-shadow: 0 0 16px #73e8ff50;
}
.header nav :is(a, button):is([aria-current], :hover, :focus-visible)::after { opacity: .9; scale: 1; }
.header nav :is(a, button):active, footer > div :is(a, button):active { translate: 0 2px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 23px;
  border: 0;
  border-radius: 999px;
  background: #f5f7fc;
  color: #141418;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .2s ease, box-shadow .24s ease, translate .24s var(--ease-out), scale .18s var(--ease-out);
}
.button:is(:hover, :focus-visible) { translate: 0 -3px; box-shadow: 0 5px 20px #85e8f154; background: #d6fbff; }
.button:active { translate: 0 1px; scale: .965; box-shadow: 0 1px 8px #85e8f14a; }
.button span { transition: translate .24s var(--ease-out); }
.button:is(:hover, :focus-visible) span { translate: 3px 0; }
.header > .button { justify-self: end; min-width: 142px; }

.hero { min-height: min(900px, 100svh); position: relative; isolation: isolate; display: grid; align-items: end; background: #10182f; }
.hero-image, .hero-video, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image, .hero-video { z-index: -2; object-fit: cover; object-position: 50% 43%; }
.hero-video { opacity: 0; transition: opacity .45s ease; }
.hero-video.is-ready { opacity: 1; }
.hero::after {
  content: "";
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 64%, #0707084d 79%, #070708ba 92%, #070708 100%);
}
.hero-body { width: 100%; padding: 148px var(--gutter) 12px; text-align: center; }
h1, .section h2 { font-size: clamp(34px, 3.75vw, 60px); line-height: 1.16; font-weight: 700; letter-spacing: -.024em; }
h1 { color: #fff; text-shadow: 0 2px 6px #080b10b3; }
.hero-body > p:not(.form-status) { margin: 20px auto 24px; color: #e8edf5; font-size: clamp(16px, 1.39vw, 20px); line-height: 1.65; text-shadow: 0 1px 4px #080b10; }
.source-form {
  width: min(674px, 100%);
  margin: auto;
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid #ffffff48;
  border-radius: 14px;
  background: #171e2dec;
  box-shadow: inset 0 1px #ffffff14, 0 8px 22px #0004;
  transition: border-color .2s ease, box-shadow .25s ease;
}
.source-form:focus-within { border-color: #83e8f1a0; box-shadow: inset 0 1px #ffffff18, 0 0 0 3px #83e8f12e, 0 12px 40px #0004; }
.source-field {
  --field-inset: 12px;
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}
.source-field input {
  width: 100%;
  min-width: 0;
  padding: 6px var(--field-inset);
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  scroll-margin-top: 10px;
}
.source-hint {
  position: absolute;
  inset-inline: var(--field-inset);
  align-self: center;
  text-align: start;
  color: #c1c7d0;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  visibility: hidden;
  transform-origin: left center;
  transition: transform .25s var(--ease-out), color .2s ease, text-shadow .2s ease;
}
.source-field input:placeholder-shown + .source-hint { visibility: visible; }
.source-field:is(:hover, :focus-within) .source-hint {
  color: var(--accent);
  text-shadow: 0 0 10px #83e8f150;
}
.form-status { min-height: 27px; margin: 7px auto 0; color: #f5f5f6; font-size: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .source-field:is(:hover, :focus-within) input:placeholder-shown + .source-hint {
    transform: translateY(-3px) scale(1.04);
    animation: source-hint-pop .44s ease-out;
  }
  @keyframes source-hint-pop {
    0% { transform: none; }
    38% { transform: translateY(-8px) scale(1.075); }
    68% { transform: translateY(-1px) scale(1.02); }
    100% { transform: translateY(-3px) scale(1.04); }
  }
  .hero-body > :is(h1, p:not(.form-status), .source-form) { animation: hero-enter .55s var(--ease-out) backwards; }
  .hero-body > p:not(.form-status) { animation-delay: .1s; }
  .hero-body > .source-form { animation-delay: .2s; }
  @keyframes hero-enter { from { opacity: 0; translate: 0 17px; } }
  .reveal-pending { opacity: 0; transform: translateY(20px); }
  .reveal-visible { opacity: 1; transform: none; transition: opacity .55s ease-out, transform .55s ease-out; }
}

.section { max-width: 1536px; margin: 0 auto; padding: 96px var(--gutter) 0; }
.section-heading { margin: 0 0 52px; text-align: center; }
.section-heading p { margin-top: 16px; color: var(--muted); font-size: clamp(16px, 1.35vw, 19px); line-height: 1.65; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 1.9vw, 28px); }
.tool {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 19px;
  overflow: hidden;
  background: #14161b;
}
.tool, .tool.reveal-visible { transition: opacity .55s ease-out, transform .55s ease-out, translate .28s var(--ease-out), scale .18s var(--ease-out), border-color .23s ease, box-shadow .25s ease; }
.tool:is(:hover, :focus-within) { translate: 0 -5px; border-color: #83e8f16e; box-shadow: 0 12px 34px #0009; }
.tool:active { translate: 0 -1px; scale: .99; }
.tool > img { width: 100%; height: auto; aspect-ratio: 1.6; object-fit: cover; transition: scale .45s var(--ease-out); }
.tool:is(:hover, :focus-within) > img { scale: 1.027; }
.tool:last-child > img { object-position: 50% 30%; }
.tool-body { padding: 23px 24px 28px; background: inherit; }
.tool h3 { font-size: clamp(20px, 1.95vw, 28px); }
.tool-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; font-weight: 700; }
.tool-link { transition: color .2s ease; }
.tool-link::after { content: ""; position: absolute; inset: 0; }
.tool-link span { font: 400 20px/1 system-ui, sans-serif; transition: translate .22s var(--ease-out); }
.tool:is(:hover, :focus-within) .tool-link { color: var(--accent); }
.tool:is(:hover, :focus-within) .tool-link span { translate: 3px -3px; }
.tool p { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.example-grid { display: grid; grid-template-columns: 1.69fr 1fr; gap: clamp(18px, 2.3vw, 34px); align-items: start; }
.comparison {
  --split: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #17171a;
}
.comparison .original, .revised, .revised img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.revised { clip-path: inset(0 0 0 var(--split)); }
.revised img { filter: saturate(.8) sepia(.23) hue-rotate(267deg); }
.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  transform: translateX(-50%);
  background: #f8f8fa;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.divider span { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -21px; border-radius: 50%; background: #f8f8fa; color: #111; font: 20px/1 system-ui, sans-serif; }
.comparison input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.comparison:focus-within { outline: 2px solid #dedee8; outline-offset: 4px; }
.frame-label { position: absolute; top: 16px; left: 16px; padding: 6px 10px; border-radius: 8px; background: #141419dc; font-size: 13px; pointer-events: none; }
.frame-label-after { left: auto; right: 16px; }
.frame-guide, .caption { display: none; }
[data-mode="frame"] :is(.revised, .divider, input, .frame-label-after),
[data-mode="script"] :is(.revised, .divider, input, .frame-label-after) { display: none; }
[data-mode="frame"] .frame-guide {
  display: block;
  position: absolute;
  inset: 5% auto;
  left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 9 / 16;
  height: 90%;
  outline: 2px solid #fff;
  box-shadow: 0 0 0 100vmax #000b;
}
[data-mode="script"] .caption {
  display: block;
  position: absolute;
  left: 5%;
  bottom: 8%;
  padding: 8px 12px;
  border-radius: 8px;
  background: #141419e8;
  font-size: clamp(12px, 1.4vw, 20px);
}
[data-mode="script"] .caption-original { text-decoration: line-through; color: #ccc; bottom: 24%; }
.example-options { display: grid; gap: 12px; }
.example-options button { position: relative; width: 100%; text-align: left; padding: clamp(16px, 1.7vw, 25px); border: 1px solid transparent; border-bottom-color: var(--border); border-radius: 14px; background: transparent; transition: translate .23s var(--ease-out), scale .18s var(--ease-out), background-color .24s ease, border-color .24s ease; }
.example-options button::before { content: ""; position: absolute; inset: 16px auto 16px 0; width: 2px; border-radius: 2px; background: var(--accent); opacity: 0; scale: 1 .28; transition: opacity .22s ease, scale .27s var(--ease-out); }
.example-options button[aria-pressed="true"] { border-color: #83e8f150; background: #182229; }
.example-options button[aria-pressed="true"]::before { opacity: 1; scale: 1; }
.example-options button:is(:hover, :focus-visible) { translate: 3px 0; background: #192229; }
.example-options button:active { translate: 1px 0; scale: .985; }
.example-options strong { display: block; margin-bottom: 8px; font-size: clamp(18px, 1.8vw, 25px); transition: color .23s ease; }
.example-options button:is([aria-pressed="true"], :hover, :focus-visible) strong { color: var(--accent); }
.example-options span { display: block; color: var(--muted); font-size: 15px; line-height: 1.65; }

.closing { margin: 115px var(--gutter) 0; padding: 62px 16px; border-top: 1px solid var(--border); text-align: center; }
.closing h2 { margin-bottom: 25px; font-size: clamp(28px, 2.8vw, 42px); }
footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 var(--gutter); padding: 24px 0; border-top: 1px solid var(--border); }
footer .brand span { font-size: 26px; }
footer > div { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; }

dialog { width: min(460px, calc(100% - 36px)); padding: 26px; border: 1px solid #55565c; border-radius: 17px; background: #18191d; color: #f8f8fa; }
dialog::backdrop { background: #000b; }
dialog h2 { padding-right: 42px; font-size: 25px; }
dialog p { margin-top: 14px; color: #bcbcc3; line-height: 1.65; }
dialog .button { margin-top: 20px; }
.dialog-close { float: right; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #33343a; font: 22px/1 system-ui, sans-serif; transition: background-color .2s ease, scale .2s ease; }
.dialog-close:is(:hover, :focus-visible) { background: #53565c; }
.dialog-close:active { scale: .92; }

@media (max-width: 800px) {
  .header { inset: 14px 14px auto; min-height: 54px; padding-inline: 13px 8px; }
  .brand span { font-size: 25px; }
  .brand img { width: 32px; height: 32px; }
  .header > .button { min-width: auto; min-height: 38px; padding-inline: 15px; font-size: 14px; }
  .header nav { gap: 16px; }
  .header nav :is(a, button) { font-size: 13px; }
  .section { padding-top: 70px; }
  .section-heading { margin-bottom: 32px; }
  .tool-body { padding: 17px 16px 20px; }
  .example-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .header { grid-template-columns: 1fr auto; }
  .header nav { display: none; }
  .hero { min-height: max(560px, 90svh); }
  .hero-image, .hero-video {
    top: 4%;
    height: 62%;
    object-position: 48% 44%;
    mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
  }
  .hero-body { padding-bottom: 6px; }
  .hero-body > p:not(.form-status) { max-width: 310px; margin-top: 15px; }
  .source-form { gap: 4px; padding: 5px; }
  .source-field { --field-inset: 7px; }
  .source-field input { font-size: 16px; }
  .source-hint { font-size: 12px; }
  .source-form .button { min-height: 40px; padding-inline: 13px; font-size: 14px; }
  .tool-grid { grid-template-columns: 1fr; }
  .closing { margin-top: 72px; padding: 48px 0; }
  footer > div { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
  .brand, .button, .button span, .header nav :is(a, button), footer > div :is(a, button),
  .tool, .tool > img, .tool-link span, .example-options button, .dialog-close {
    translate: none !important;
    scale: none !important;
  }
}
