:root {
  --bg: #f1f5ef;
  --bg-strong: #e4ebde;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --ink: #16211b;
  --muted: #637067;
  --line: rgba(22, 33, 27, 0.1);
  --line-strong: rgba(22, 33, 27, 0.18);
  --hero: #12231d;
  --hero-strong: #0d1915;
  --accent: #b7f36b;
  --accent-strong: #89cf36;
  --accent-ink: #132013;
  --secondary: #f7f9f4;
  --success-bg: rgba(183, 243, 107, 0.18);
  --success-ink: #6aa323;
  --error-bg: rgba(199, 95, 64, 0.14);
  --error-ink: #b45235;
  --shadow: 0 24px 70px rgba(20, 29, 23, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
  background:
    radial-gradient(circle at top center, rgba(183, 243, 107, 0.22), transparent 22%),
    linear-gradient(180deg, #f6faf3 0%, #edf3e8 48%, #f4f7f1 100%);
}

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

textarea,
button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(241, 245, 239, 0.82);
  border-bottom: 1px solid rgba(22, 33, 27, 0.06);
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: var(--scroll-progress, 0%);
  height: 2px;
  background: linear-gradient(90deg, #b7f36b 0%, #7fcf4c 100%);
  transition: width 0.08s linear;
}

.nav-inner,
.page,
.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.feature-icon,
.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(16, 31, 25, 0.2);
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text,
.eyebrow,
.section-kicker,
.status-label,
.attempts-title,
.result-kicker,
.feature-icon,
.step-index,
.nav-links,
.nav-cta,
.primary-btn,
.secondary-btn,
.download-link strong,
.source-link,
.footer-brand {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
}

.brand-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.nav-links {
  display: inline-flex;
  gap: 26px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--hero);
  color: #f5f8f1;
  font-size: 0.92rem;
  font-weight: 700;
}

.page {
  padding: 42px 0 72px;
}

.hero {
  display: grid;
  gap: 24px;
}

.hero-copy,
.section-heading {
  text-align: center;
}

.eyebrow,
.section-kicker,
.result-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.result-head h2,
.feature-card h3,
.step-card h3,
.support-card h3 {
  margin: 0;
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  letter-spacing: -0.05em;
}

.hero h1 {
  max-width: 12ch;
  margin: 14px auto 0;
  font-size: clamp(2.05rem, 4.3vw, 3.15rem);
  line-height: 1.12;
}

.hero-text,
.section-heading p,
.feature-card p,
.step-card p,
.support-card p,
.result-meta,
.attempt-list,
.download-link span,
.faq-list p,
.footer-note {
  color: var(--muted);
  line-height: 1.72;
}

.hero-text {
  max-width: 58ch;
  margin: 18px auto 0;
  font-size: 1.05rem;
}

.hero-subtext {
  margin: 10px auto 0;
  max-width: 64ch;
  color: rgba(246, 250, 243, 0.85);
  font-size: 0.95rem;
  line-height: 1.6;
}

.hero-stage {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 36px;
  background:
    radial-gradient(circle at top right, rgba(183, 243, 107, 0.16), transparent 28%),
    linear-gradient(180deg, #182b24 0%, #10211c 100%);
  box-shadow: 0 34px 90px rgba(12, 22, 18, 0.18);
}

.resolver-card,
.result-card,
.feature-card,
.step-card,
.support-card,
.faq-list details {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.resolver-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: rgba(13, 25, 21, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.input-label {
  display: block;
  margin-bottom: 14px;
  color: #eaf2ea;
  font-weight: 700;
}

.input-tip {
  margin: 10px 0 0;
  color: rgba(234, 242, 234, 0.75);
  font-size: 0.86rem;
  line-height: 1.5;
}

textarea {
  width: 100%;
  min-height: 126px;
  resize: vertical;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  outline: none;
}

textarea:focus {
  border-color: rgba(183, 243, 107, 0.48);
  box-shadow: 0 0 0 4px rgba(183, 243, 107, 0.12);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.primary-btn,
.secondary-btn,
.download-link,
.source-link,
.nav-cta {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.primary-btn,
.secondary-btn {
  min-height: 56px;
  border-radius: 18px;
  border: 0;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 700;
}

.primary-btn {
  grid-column: span 2;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-ink);
  box-shadow: 0 16px 28px rgba(137, 207, 54, 0.2);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.primary-btn:hover,
.secondary-btn:hover,
.download-link:hover,
.source-link:hover,
.nav-cta:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.62;
  cursor: wait;
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.status-label {
  color: rgba(234, 242, 234, 0.68);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.progress-wrap {
  margin-top: 12px;
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(234, 242, 234, 0.9);
  font-size: 0.86rem;
}

.progress-stage {
  font-weight: 600;
}

.progress-percent {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-weight: 700;
}

.progress-track {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b7f36b 0%, #89cf36 100%);
  transition: width 0.26s ease;
}

.attempts-wrap {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.attempts-title {
  margin: 0 0 10px;
  color: rgba(234, 242, 234, 0.68);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.attempt-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(234, 242, 234, 0.84);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.attempt-list li + li {
  margin-top: 6px;
}

.result-card {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.98);
}

.script-content-wrap {
  margin-top: 10px;
}

.script-content-textarea {
  width: 100%;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbf5;
  color: #243229;
  padding: 14px;
  line-height: 1.72;
  font-size: 0.95rem;
  resize: vertical;
}

.history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbf5;
  padding: 12px 14px;
}

.history-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-item-title {
  font-weight: 700;
  color: #17241f;
}

.history-item-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.history-item-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.history-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.result-head h2 {
  margin-top: 8px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.04;
}

.result-meta {
  margin: 10px 0 0;
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-desc {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f6f9f3;
  color: #4b5850;
  line-height: 1.65;
  font-size: 0.93rem;
  white-space: pre-wrap;
  user-select: text;
}

.result-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--secondary);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

#download-all-btn {
  border-color: rgba(102, 170, 44, 0.35);
  background: linear-gradient(180deg, #b8f36f 0%, #95d944 100%);
  color: #132013;
  box-shadow: 0 8px 18px rgba(137, 207, 54, 0.25);
}

#copy-desc-btn {
  background: #ffffff;
}

.result-body {
  display: flex;
  gap: 18px;
  align-items: stretch;
}

#result-thumb {
  width: min(280px, 36%);
  max-width: 34%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #f1f5ed;
  padding: 0;
}

.result-section[data-media-type='gallery'] #result-thumb {
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: 8px;
}

.download-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.result-section[data-media-type='gallery'] .download-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.download-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(22, 33, 27, 0.08);
  background: linear-gradient(180deg, #17241f 0%, #0e1714 100%);
  color: #f6faf3;
}

.download-link strong {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.download-link span {
  color: rgba(246, 250, 243, 0.72);
  font-size: 0.88rem;
}

.download-link[data-priority='high'] {
  background: linear-gradient(180deg, #b7f36b 0%, #89cf36 100%);
  color: #132013;
}

.download-link[data-priority='high'] span {
  color: rgba(19, 32, 19, 0.72);
}

.download-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(22, 33, 27, 0.1);
  background: #f8fbf5;
}

.download-thumb {
  width: 100%;
  height: 172px;
  object-fit: cover;
  background: #e9efe3;
}

.download-thumb-link {
  display: block;
  line-height: 0;
}

.download-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 12px;
}

.download-card-body strong {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.download-card-body span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.download-card-actions {
  display: flex;
  gap: 0;
  margin-top: auto;
}

.download-main-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  border: 0;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(137, 207, 54, 0.2);
}

.media-download-card {
  border-radius: 22px;
}

.media-download-actions {
  gap: 8px;
  width: 100%;
}

.media-action-btn {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  box-shadow: none;
}

.media-save-btn {
  background: rgba(246, 250, 243, 0.14);
  color: inherit;
  box-shadow: inset 0 0 0 1px rgba(246, 250, 243, 0.25);
}

.download-link[data-priority='high'] .media-save-btn {
  background: rgba(19, 32, 19, 0.1);
  box-shadow: inset 0 0 0 1px rgba(19, 32, 19, 0.16);
}

.download-link[data-kind='audio'],
.download-link[data-kind='image'] {
  background: linear-gradient(180deg, #fbfcf9 0%, #f0f5eb 100%);
  color: var(--ink);
}

.download-link[data-kind='audio'] span,
.download-link[data-kind='image'] span {
  color: var(--muted);
}

.feature-section,
.steps-section,
.support-section,
.faq-section {
  margin-top: 30px;
}

.section-heading h2 {
  margin-top: 12px;
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  line-height: 1.08;
}

.section-heading p {
  max-width: 60ch;
  margin: 14px auto 0;
}

.feature-grid,
.steps-grid,
.support-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.feature-grid,
.support-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.steps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.step-card,
.support-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  transform-style: preserve-3d;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card h3,
.step-card h3,
.support-card h3 {
  margin-top: 18px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.feature-card p,
.step-card p,
.support-card p {
  margin: 10px 0 0;
  font-size: 0.95rem;
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #e8f3dc;
  color: #4c6b2a;
  font-size: 0.88rem;
  font-weight: 700;
}

.step-index {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--hero);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}

.support-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(245, 248, 241, 0.98) 100%);
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.faq-list details {
  padding: 0 22px;
  border-radius: var(--radius-lg);
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 0;
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list p {
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.legal-section {
  margin-top: 30px;
}

.legal-list {
  margin: 22px 0 0;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--muted);
  line-height: 1.7;
}

.legal-list li + li {
  margin-top: 10px;
}

.legal-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer {
  border-top: 1px solid rgba(22, 33, 27, 0.06);
  background: rgba(246, 250, 243, 0.9);
  position: relative;
  z-index: 3;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 42px;
}

.footer-brand {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.footer-note {
  max-width: 48ch;
  margin: 10px 0 0;
  font-size: 0.94rem;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
  font-size: 0.94rem;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 0.84rem;
}

.reveal-section {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 1040px) {
  .feature-grid,
  .steps-grid,
  .support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }

  .action-grid {
    grid-template-columns: 1fr 1fr;
  }

  .primary-btn {
    grid-column: span 2;
  }

  .result-body {
    flex-direction: column;
  }

  #result-thumb {
    width: 100%;
    max-width: 100%;
    max-height: 360px;
    border-radius: 18px;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-inner,
  .page,
  .footer-inner {
    width: min(100% - 20px, 1180px);
  }

  .nav-inner {
    min-height: 68px;
  }

  .nav-cta {
    display: none;
  }

  .page {
    padding: 26px 0 52px;
  }

  .hero h1 {
    font-size: clamp(1.7rem, 8.2vw, 2.35rem);
  }

  .hero-text {
    font-size: 1rem;
  }

  .hero-subtext {
    font-size: 0.9rem;
  }

  .hero-stage {
    padding: 16px;
    border-radius: 28px;
  }

  .resolver-card,
  .result-card,
  .feature-card,
  .step-card,
  .support-card,
  .faq-list details {
    border-radius: 22px;
  }

  .status-row {
    width: 100%;
    justify-content: space-between;
  }

  .progress-meta {
    font-size: 0.82rem;
  }

  .feature-grid,
  .steps-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .result-head,
  .footer-inner {
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .source-link {
    width: 100%;
  }

  .download-card {
    min-height: 236px;
  }

  .download-thumb {
    height: 160px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 14px;
  }

  .legal-list {
    padding: 18px 18px;
    font-size: 0.92rem;
  }
}
