:root {
  color-scheme: light;
  --ink: #191813;
  --muted: #686154;
  --paper: #fffaf0;
  --paper-2: #f5ecd8;
  --line: #d5c7ad;
  --accent: #ed6a38;
  --accent-2: #166b61;
  --blue: #265f88;
  --bad: #b6403e;
  --good: #14785f;
  --shadow: 8px 8px 0 rgba(25, 24, 19, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", Aptos, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(25, 24, 19, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(25, 24, 19, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 16% 12%, rgba(237, 106, 56, 0.16), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(22, 107, 97, 0.16), transparent 28%),
    #efe4cc;
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

p,
h1,
h2 {
  margin: 0;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar,
.brand,
.top-pills,
.action-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--paper);
  background: var(--ink);
  font-weight: 950;
  box-shadow: 5px 5px 0 rgba(237, 106, 56, 0.35);
}

.brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.1;
}

.brand small,
.eyebrow,
.top-pills span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.top-pills {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.top-pills span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(25, 24, 19, 0.13);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 250, 240, 0.76);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.52fr);
  gap: 18px;
  align-items: stretch;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.landing-copy,
.subtitle-demo-panel,
.landing-grid article {
  border: 2px solid rgba(25, 24, 19, 0.84);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow), 0 18px 50px rgba(25, 24, 19, 0.08);
}

.landing-copy {
  min-height: 520px;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: clamp(22px, 5vw, 48px);
}

.landing-copy h1 {
  max-width: 760px;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.92;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 680px;
  color: #3d392f;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.72;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.subtitle-demo-panel {
  min-height: 520px;
  display: grid;
  gap: 16px;
  align-content: center;
  padding: clamp(18px, 3vw, 28px);
  background:
    radial-gradient(circle at 88% 10%, rgba(237, 106, 56, 0.18), transparent 210px),
    rgba(255, 250, 240, 0.96);
}

.demo-screen {
  min-height: 330px;
  display: grid;
  align-content: end;
  gap: 12px;
  border-radius: 18px;
  padding: 18px;
  color: #fffaf0;
  background:
    linear-gradient(145deg, rgba(18, 28, 44, 0.98), rgba(22, 107, 97, 0.92)),
    #121c2c;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.12);
  overflow: hidden;
}

.demo-wave {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 118px;
  margin-bottom: auto;
}

.demo-wave span {
  width: 18%;
  min-height: 42px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, rgba(255, 213, 106, 0.82), rgba(237, 106, 56, 0.72));
  animation: subtitlePulse 1.4s ease-in-out infinite;
}

.demo-wave span:nth-child(2) { animation-delay: 0.12s; min-height: 78px; }
.demo-wave span:nth-child(3) { animation-delay: 0.24s; min-height: 56px; }
.demo-wave span:nth-child(4) { animation-delay: 0.36s; min-height: 92px; }
.demo-wave span:nth-child(5) { animation-delay: 0.48s; min-height: 64px; }

.demo-caption {
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(255, 250, 240, 0.12);
  font-weight: 900;
  line-height: 1.45;
}

.demo-caption.translated {
  color: #121c2c;
  background: #ffd56a;
}

.demo-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(25, 24, 19, 0.13);
  border-radius: 16px;
  padding: 14px;
  background: #fffef9;
}

.demo-meta strong {
  color: var(--accent);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.demo-meta span {
  color: var(--muted);
  font-weight: 950;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.landing-grid article {
  min-height: 190px;
  padding: 20px;
}

.landing-grid span {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  color: #fffaf0;
  background: var(--ink);
  font-weight: 950;
}

.landing-grid h2 {
  margin-top: 18px;
  font-size: 28px;
  line-height: 1.1;
}

.landing-grid p {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.65;
}

@keyframes subtitlePulse {
  0%, 100% { transform: scaleY(0.72); opacity: 0.78; }
  50% { transform: scaleY(1); opacity: 1; }
}

.command-panel,
.status-panel,
.preview-panel,
.download-panel,
.loading-panel {
  border: 2px solid rgba(25, 24, 19, 0.84);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow), 0 18px 50px rgba(25, 24, 19, 0.08);
}

.command-panel {
  min-height: 520px;
  padding: clamp(20px, 4vw, 38px);
}

.panel-head {
  max-width: 760px;
  margin-bottom: 22px;
}

.panel-head h1 {
  margin-top: 8px;
  font-size: clamp(40px, 5.6vw, 74px);
  line-height: 0.95;
  letter-spacing: 0;
}

.access-card,
.job-form,
.controls,
.stage-copy,
.segments,
.downloads {
  display: grid;
  gap: 14px;
}

.price-anchor {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(237, 106, 56, 0.28);
  border-radius: 16px;
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(237, 106, 56, 0.15), transparent 55%),
    #fffef9;
}

.price-anchor strong {
  color: var(--accent);
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.9;
  font-weight: 950;
}

.price-anchor span {
  padding-bottom: 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.price-anchor small {
  padding-bottom: 8px;
  color: var(--muted);
  font-weight: 850;
  overflow-wrap: anywhere;
}

label {
  display: grid;
  gap: 8px;
  color: #3d392f;
  font-size: 13px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(25, 24, 19, 0.24);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--ink);
  background: #fffef9;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(237, 106, 56, 0.14);
}

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(25, 24, 19, 0.18);
  border-radius: 12px;
  padding: 0 16px;
  color: var(--ink);
  background: #f7edd8;
  font-weight: 950;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 rgba(25, 24, 19, 0.12);
}

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

.btn.accent {
  color: #fffaf0;
  background: var(--accent);
}

.drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: center;
  min-height: 176px;
  border: 2px dashed rgba(25, 24, 19, 0.34);
  border-radius: 18px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(237, 106, 56, 0.11), transparent 46%),
    #fffef9;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #fff6e8;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
}

.drop-zone p,
.stage-copy p,
.empty-state,
.segment em {
  color: var(--muted);
  line-height: 1.58;
  font-weight: 650;
}

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

.action-row {
  flex-wrap: wrap;
  gap: 10px;
}

.notice {
  min-height: 22px;
  color: var(--good);
  font-size: 13px;
  font-weight: 900;
}

.notice.error,
.empty-state.bad {
  color: var(--bad);
}

.status-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 22px;
}

.status-orbit {
  position: relative;
  width: 190px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 6px auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--progress, 0deg), #e5d8bd 0deg);
}

.status-orbit::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: inherit;
  background: var(--paper);
}

.status-orbit span {
  position: relative;
  z-index: 1;
  font-size: 42px;
  font-weight: 950;
  letter-spacing: 0;
}

.status-orbit.good {
  background: conic-gradient(var(--good) var(--progress, 0deg), #e5d8bd 0deg);
}

.status-orbit.bad {
  background: conic-gradient(var(--bad) var(--progress, 0deg), #e5d8bd 0deg);
}

.stage-copy h2,
.section-title h2 {
  margin-top: 6px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.05;
}

.film-visual {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid rgba(25, 24, 19, 0.16);
  border-radius: 16px;
  background: #171813;
  color: #fffaf0;
}

.film-visual span {
  position: absolute;
  top: 18px;
  width: 48px;
  height: 74px;
  border-radius: 6px;
  background: linear-gradient(180deg, #675f50, #2a2a22);
}

.film-visual span:nth-child(1) { left: 18px; }
.film-visual span:nth-child(2) { left: 78px; }
.film-visual span:nth-child(3) { left: 138px; }
.film-visual span:nth-child(4) { left: 198px; }

.film-visual b,
.film-visual strong {
  position: absolute;
  left: 18px;
  right: 18px;
}

.film-visual b {
  bottom: 58px;
  color: #f0b05a;
}

.film-visual strong {
  bottom: 22px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.13);
}

.video-shell video {
  display: block;
  width: 100%;
  max-height: 260px;
  border-radius: 16px;
  background: #171813;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.56fr);
  gap: 18px;
  margin-top: 18px;
}

.preview-panel,
.download-panel {
  padding: 22px;
  box-shadow: none;
}

.section-title {
  margin-bottom: 14px;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed rgba(25, 24, 19, 0.22);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 254, 249, 0.6);
}

.segment {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid rgba(25, 24, 19, 0.11);
  padding: 12px 0;
}

.segment time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.segment p,
.segment strong {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.download-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(25, 24, 19, 0.14);
  border-radius: 14px;
  padding: 14px;
  background: #fffef9;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.download-card:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 rgba(22, 107, 97, 0.16);
}

.download-card span {
  font-weight: 950;
}

.download-card small {
  color: var(--muted);
  font-weight: 750;
}

.quote-card.compact {
  min-height: auto;
  color: var(--muted);
  font-weight: 900;
}

.quote-card.compact.error {
  color: var(--bad);
}

.selected-files {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  padding-right: 2px;
}

.selected-files div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(25, 24, 19, 0.13);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fffef9;
}

.selected-files span {
  overflow-wrap: anywhere;
  font-weight: 850;
}

.selected-files em {
  color: var(--blue);
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.selected-files strong {
  color: var(--accent);
  white-space: nowrap;
}

.file-stack-visual {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(25, 24, 19, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(237, 106, 56, 0.12), rgba(22, 107, 97, 0.10)),
    #fffef9;
}

.file-stack-visual strong {
  font-size: 76px;
  line-height: 0.9;
}

.file-stack-visual span,
.file-stack-visual small {
  color: var(--muted);
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quote-price {
  display: block;
  margin: 8px 0 14px;
  font-size: clamp(42px, 6vw, 62px);
  line-height: 1;
}

.quote-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-weight: 850;
}

.quote-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quote-facts div {
  min-width: 0;
  border: 1px solid rgba(25, 24, 19, 0.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 254, 249, 0.72);
}

.quote-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quote-facts dd {
  margin: 3px 0 0;
  font-weight: 950;
}

.single-result {
  grid-template-columns: 1fr;
}

.task-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 10px;
  align-items: center;
}

.task-link-box input {
  min-width: 0;
}

.admin-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(25, 24, 19, 0.13);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 250, 240, 0.76);
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.admin-login {
  min-height: 420px;
}

.admin-board {
  border: 2px solid rgba(25, 24, 19, 0.84);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow), 0 18px 50px rgba(25, 24, 19, 0.08);
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 190px 250px;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(25, 24, 19, 0.13);
  border-radius: 14px;
  padding: 12px;
  background: #fffef9;
}

.admin-row strong,
.admin-row p {
  overflow-wrap: anywhere;
}

.admin-source-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.admin-source-files a {
  display: inline-flex;
  max-width: 100%;
  gap: 6px;
  align-items: center;
  border: 1px solid rgba(25, 24, 19, 0.12);
  border-radius: 999px;
  padding: 4px 8px;
  background: #f7edd8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.admin-source-files small {
  color: var(--muted);
}

.admin-row p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fffaf0;
  background: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-upload {
  position: relative;
  overflow: hidden;
}

.result-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.loading-panel {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 8px;
}

@media (max-width: 920px) {
  .workspace,
  .landing-hero,
  .result-grid,
  .controls {
    grid-template-columns: 1fr;
  }

  .command-panel,
  .landing-copy,
  .subtitle-demo-panel {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 12px;
  }

  .topbar,
  .price-anchor,
  .drop-zone,
  .segment,
  .admin-row,
  .task-link-box,
  .quote-facts,
  .landing-grid,
  .demo-meta {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .top-pills {
    justify-content: stretch;
  }

  .top-pills span,
  .btn {
    width: 100%;
  }

  .price-anchor {
    align-items: start;
  }

  .panel-head h1 {
    font-size: clamp(36px, 13vw, 52px);
  }

  .landing-copy h1 {
    font-size: clamp(42px, 14vw, 58px);
  }

  .command-panel,
  .status-panel,
  .preview-panel,
  .download-panel,
  .landing-copy,
  .subtitle-demo-panel {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
