:root {
  --ink: #0b1f2a;
  --ink-soft: #2a4554;
  --paper: #fff8ef;
  --sun: #ffb703;
  --flame: #fb8500;
  --coral: #ff5a36;
  --sea: #00c2cb;
  --sea-deep: #0077a8;
  --foam: #e8fffb;
  --line: rgba(11, 31, 42, 0.12);
  --shadow: 0 24px 60px rgba(255, 90, 54, 0.18);
  --radius: 28px;
  --font-display: "Fredoka", "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  --font-body: "Nunito", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffe08a 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #7ef0ea 0%, transparent 50%),
    radial-gradient(700px 500px at 80% 100%, #ff9b7a 0%, transparent 45%),
    linear-gradient(165deg, #fff4e0 0%, #eefcff 48%, #ffe9de 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 75%);
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  position: relative;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.5rem;
  animation: rise 0.7s ease both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 30% 70% 60% 40% / 40% 30% 70% 60%;
  background: conic-gradient(from 180deg, var(--sun), var(--coral), var(--sea), var(--sun));
  box-shadow: 0 10px 24px rgba(251, 133, 0, 0.35);
  animation: blob 6s ease-in-out infinite;
}

.top-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: stretch;
  min-height: min(78vh, 720px);
  animation: rise 0.9s 0.05s ease both;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 0 2rem;
}

.brand-hero {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 9vw, 6.2rem);
  line-height: 0.95;
  margin: 0 0 1rem;
  background: linear-gradient(110deg, var(--coral) 10%, var(--flame) 40%, var(--sea-deep) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 0 rgba(255, 183, 3, 0.15);
  animation: pop 1s cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}

.hero-copy h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
  max-width: 14ch;
}

.hero-copy p {
  margin: 0;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 420px;
  background:
    linear-gradient(145deg, rgba(0, 194, 203, 0.85), rgba(255, 90, 54, 0.75)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='rgba(255,255,255,0.12)' d='M0 80h160M80 0v160'/%3E%3C/svg%3E");
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.45), transparent 35%),
    radial-gradient(circle at 70% 70%, rgba(255, 183, 3, 0.45), transparent 40%);
  mix-blend-mode: screen;
  animation: shimmer 5s ease-in-out infinite;
}

.orbit {
  position: absolute;
  inset: 12%;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.orbit-core {
  position: absolute;
  inset: 28%;
  border-radius: 28px;
  background: rgba(255, 248, 239, 0.92);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  z-index: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.orbit-core strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin-bottom: 0.35rem;
}

.orbit-core span {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.floater {
  position: absolute;
  z-index: 2;
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(11, 31, 42, 0.12);
  animation: floaty 4.5s ease-in-out infinite;
}

.floater.a { top: 12%; left: 8%; animation-delay: 0s; }
.floater.b { top: 18%; right: 8%; animation-delay: 0.6s; }
.floater.c { bottom: 14%; left: 14%; animation-delay: 1.1s; }

.panel {
  margin-top: 2.5rem;
  padding: 1.6rem;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 119, 168, 0.08);
  animation: rise 1s 0.12s ease both;
}

.panel h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.panel > .lead {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 1.5rem;
  border-radius: 24px;
  border: 2.5px dashed rgba(0, 194, 203, 0.55);
  background:
    linear-gradient(180deg, rgba(232, 255, 251, 0.9), rgba(255, 248, 239, 0.9));
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.dropzone:hover,
.dropzone.dragover {
  transform: translateY(-2px);
  border-color: var(--coral);
  box-shadow: 0 16px 36px rgba(255, 90, 54, 0.15);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 0.75rem;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: #fff;
  box-shadow: 0 12px 24px rgba(251, 133, 0, 0.35);
}

.dropzone strong {
  font-size: 1.15rem;
}

.dropzone p {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 1.25rem;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.option input {
  margin-top: 0.2rem;
  accent-color: var(--coral);
}

.option label {
  display: block;
  font-weight: 800;
}

.option small {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--coral), var(--flame) 45%, var(--sun));
  box-shadow: 0 14px 28px rgba(255, 90, 54, 0.28);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  color: var(--ink);
}

.file-name {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.progress-wrap {
  display: none;
  margin-top: 1.35rem;
  padding: 1.1rem 1.2rem;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(0, 194, 203, 0.12), rgba(255, 183, 3, 0.16));
}

.progress-wrap.show {
  display: block;
  animation: rise 0.45s ease both;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  font-weight: 700;
}

.bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sea), var(--sun), var(--coral));
  background-size: 200% 100%;
  animation: slide 1.6s linear infinite;
  transition: width 0.35s ease;
}

.result {
  display: none;
  margin-top: 1.35rem;
}

.result.show {
  display: block;
  animation: rise 0.5s ease both;
}

.result-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.preview-box,
.sub-box {
  border-radius: 22px;
  background: #0b1f2a;
  color: #fff;
  overflow: hidden;
  min-height: 280px;
}

.preview-box video {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: block;
  background: #000;
}

.preview-stage {
  position: relative;
  width: 100%;
  background: #000;
}

.preview-stage video {
  width: 100%;
  min-height: 280px;
  display: block;
}

.sub-cover {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  height: 22%;
  background: rgba(0, 0, 0, 0.92);
  pointer-events: none;
  z-index: 2;
}

.preview-stage.soft-subs .sub-cover {
  display: block;
}

.sub-overlay {
  display: none;
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 14%;
  z-index: 3;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  line-height: 1.35;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
  pointer-events: none;
  white-space: pre-wrap;
}

.preview-stage.soft-subs .sub-overlay {
  display: block;
}

.sub-box {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 1rem;
  overflow: auto;
  max-height: 360px;
}

.sub-box h4 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
}

.cue {
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--line);
}

.cue.active {
  background: rgba(255, 122, 26, 0.12);
  margin: 0 -0.4rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  border-radius: 8px;
}

.cue:last-child {
  border-bottom: 0;
}

.cue .zh {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.cue .en {
  margin-top: 0.2rem;
  font-weight: 800;
}

.error {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #ffe4de;
  color: #9c1d00;
  border: 1px solid #ffb4a4;
}

.error.show {
  display: block;
}

.footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes blob {
  0%, 100% { border-radius: 30% 70% 60% 40% / 40% 30% 70% 60%; transform: rotate(0deg); }
  50% { border-radius: 60% 40% 30% 70% / 60% 40% 70% 30%; transform: rotate(12deg); }
}

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

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes slide {
  to { background-position: 200% 0; }
}

@media (max-width: 900px) {
  .hero,
  .result-grid,
  .options {
    grid-template-columns: 1fr;
  }

  .hero-copy h2 {
    max-width: none;
  }

  .hero-visual {
    min-height: 340px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
