:root {
  --bg: #f5efe3;
  --surface: rgba(255, 250, 241, 0.92);
  --surface-strong: #fffdf7;
  --surface-soft: rgba(255, 255, 255, 0.68);
  --ink: #1c1a17;
  --muted: #726a5d;
  --accent: #0a7c66;
  --accent-2: #d66f2a;
  --line: rgba(28, 26, 23, 0.12);
  --line-strong: rgba(28, 26, 23, 0.18);
  --shadow: 0 18px 40px rgba(40, 30, 12, 0.08);
  --shadow-strong: 0 24px 64px rgba(40, 30, 12, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 111, 42, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(10, 124, 102, 0.14), transparent 28%),
    linear-gradient(135deg, #f7f3e9, #ece7da);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.site-header-main {
  display: grid;
  gap: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(28, 26, 23, 0.1);
}

.user-badge strong {
  font-size: 14px;
}

.user-badge span {
  font-size: 12px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.site-title {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.06;
  max-width: none;
}

.mode-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(28, 26, 23, 0.08);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.mode-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), #0b9682);
  box-shadow: 0 10px 24px rgba(10, 124, 102, 0.18);
}

.grid-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: start;
}

.job-page,
.center-stage {
  display: grid;
  gap: 20px;
}

.product-page {
  display: grid;
  gap: 22px;
}

.product-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.center-stage {
  place-items: center;
  min-height: calc(100vh - 180px);
}

.auth-layout {
  align-items: center;
}

.auth-card {
  width: min(460px, 100%);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.card h2,
.card h3 {
  margin: 0 0 10px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading h2,
.section-heading h3 {
  margin-bottom: 6px;
}

label {
  display: grid;
  gap: 8px;
}

label span,
.meta-label {
  font-size: 13px;
  color: var(--muted);
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(28, 26, 23, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-strong);
}

input:focus,
select:focus {
  outline: 2px solid rgba(10, 124, 102, 0.28);
  border-color: rgba(10, 124, 102, 0.32);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.primary-button {
  border: none;
  background: linear-gradient(135deg, var(--accent), #0b9682);
  color: white;
  box-shadow: 0 10px 24px rgba(10, 124, 102, 0.24);
}

.ghost-button {
  border: 1px solid rgba(28, 26, 23, 0.12);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.ghost-button.small {
  padding: 8px 12px;
  font-size: 13px;
}

.submit-button {
  min-height: 50px;
  font-weight: 700;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.or-divider {
  position: relative;
  text-align: center;
  color: var(--muted);
}

.or-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
}

.or-divider span {
  position: relative;
  padding: 0 12px;
  background: var(--surface);
}

.advanced-panel {
  border: 1px dashed rgba(28, 26, 23, 0.14);
  border-radius: 18px;
  padding: 14px 16px;
}

.advanced-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.advanced-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.submission-card,
.info-card {
  position: relative;
  overflow: hidden;
}

.submission-card::after,
.info-card::after,
.hero-panel::after,
.highlight-card::after,
.preview-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.job-list {
  display: grid;
  gap: 12px;
}

.empty-block {
  border: 1px dashed rgba(28, 26, 23, 0.14);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.job-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.55);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.job-row:hover,
.artifact-row:hover,
.preview-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 124, 102, 0.22);
  background: rgba(255, 255, 255, 0.78);
}

.job-row strong {
  display: block;
  margin-bottom: 6px;
}

.job-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.muted {
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-queued,
.status-reading_source,
.status-drafting_slides,
.status-building_pptx,
.status-validating,
.status-validating_pptx,
.status-writing_narration,
.status-generating_audio,
.status-preflighting_video,
.status-rendering_video,
.status-uploading {
  background: rgba(214, 111, 42, 0.15);
  color: #a65115;
}

.status-succeeded {
  background: rgba(10, 124, 102, 0.15);
  color: var(--accent);
}

.status-failed {
  background: rgba(186, 52, 52, 0.12);
  color: #ab2c2c;
}

.alert {
  padding: 12px 14px;
  border-radius: 16px;
}

.alert.error {
  background: rgba(186, 52, 52, 0.1);
  color: #8d2323;
}

.alert.success {
  background: rgba(10, 124, 102, 0.12);
  color: #0d6c59;
}

.success-line {
  color: var(--accent);
  font-weight: 700;
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
  padding: 28px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(214, 111, 42, 0.22), transparent 28%),
    radial-gradient(circle at bottom left, rgba(10, 124, 102, 0.18), transparent 36%),
    linear-gradient(140deg, rgba(255, 252, 246, 0.95), rgba(247, 239, 226, 0.92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-strong);
}

.hero-video::after {
  background:
    linear-gradient(125deg, transparent 52%, rgba(10, 124, 102, 0.08) 52%, transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 52%);
}

.hero-pptx::after,
.auth-hero::after {
  background:
    linear-gradient(130deg, transparent 56%, rgba(214, 111, 42, 0.08) 56%, transparent 74%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 52%);
}

.admin-hero::after {
  background:
    linear-gradient(125deg, transparent 48%, rgba(10, 124, 102, 0.1) 48%, transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 52%);
}

.hero-copy,
.hero-aside,
.hero-workflow {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  margin: 0 0 14px;
  max-width: 13ch;
  font-size: clamp(30px, 3.8vw, 54px);
  line-height: 1.02;
}

.hero-body {
  margin: 0;
  max-width: 33rem;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(28, 26, 23, 0.86);
}

.output-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.output-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(28, 26, 23, 0.1);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.hero-aside {
  display: grid;
  gap: 14px;
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-stat-grid > div,
.hero-feature,
.highlight-card {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(28, 26, 23, 0.08);
  backdrop-filter: blur(10px);
}

.hero-stat-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.45;
}

.hero-feature-list {
  display: grid;
  gap: 12px;
}

.hero-feature strong,
.highlight-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.hero-workflow {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.hero-workflow h3 {
  margin: 0 0 12px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.workflow-step {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

.workflow-index {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.workflow-step strong {
  display: block;
  margin-bottom: 8px;
}

.side-stack {
  display: grid;
  gap: 20px;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  line-height: 1.6;
}

.job-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

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

.highlight-card strong {
  font-size: 26px;
  margin-bottom: 4px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.form-actions {
  align-items: center;
}

.preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.workflow-rail {
  display: grid;
  gap: 12px;
}

.workflow-rail-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.48);
}

.workflow-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(28, 26, 23, 0.15);
  box-shadow: 0 0 0 4px rgba(28, 26, 23, 0.05);
}

.workflow-rail-item.done {
  border-color: rgba(10, 124, 102, 0.18);
  background: rgba(10, 124, 102, 0.08);
}

.workflow-rail-item.done .workflow-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 124, 102, 0.12);
}

.workflow-rail-item.active {
  border-color: rgba(214, 111, 42, 0.26);
  background: rgba(214, 111, 42, 0.08);
}

.workflow-rail-item.active .workflow-dot {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(214, 111, 42, 0.12);
}

.workflow-rail-item.failed {
  border-color: rgba(186, 52, 52, 0.24);
  background: rgba(186, 52, 52, 0.08);
}

.workflow-rail-item.failed .workflow-dot {
  background: #ab2c2c;
  box-shadow: 0 0 0 4px rgba(171, 44, 44, 0.12);
}

.summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.artifact-list {
  display: grid;
  gap: 12px;
}

.artifact-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(28, 26, 23, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.54);
}

.preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.preview-tile {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

.preview-tile img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(245, 239, 227, 0.8);
}

.preview-tile span {
  font-weight: 700;
}

.log-view {
  margin: 0;
  padding: 16px;
  min-height: 260px;
  border-radius: 16px;
  background: #191716;
  color: #f4f1ea;
  overflow: auto;
  line-height: 1.5;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

@media (max-width: 900px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .workflow-strip,
  .highlight-grid,
  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .site-header,
  .header-actions,
  .job-header,
  .job-row {
    flex-direction: column;
  }

  .job-meta {
    justify-items: start;
  }
}
