:root {
  color-scheme: light;
  --ink: #10243d;
  --ink-soft: #536273;
  --paper: #f7f6f2;
  --surface: rgba(255, 254, 251, 0.96);
  --line: rgba(16, 36, 61, 0.14);
  --accent: #0071e3;
  --accent-dark: #0057b7;
  --sky: #70b5ff;
  --success: #167263;
  --danger: #a4372b;
  --shadow: 0 24px 70px rgba(16, 36, 61, 0.11);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), transparent 42%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
label[for="audio-file"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.45;
  pointer-events: none;
}

.ambient-one {
  top: -160px;
  right: -110px;
  background: radial-gradient(circle, rgba(112, 181, 255, 0.58), transparent 68%);
}

.ambient-two {
  bottom: -190px;
  left: -150px;
  background: radial-gradient(circle, rgba(173, 204, 236, 0.5), transparent 66%);
}

.shell {
  width: min(100%, 940px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(44px, env(safe-area-inset-bottom));
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.login-view {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 4px 52px;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-lockup strong {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.brand-lockup span {
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-lockup.is-compact {
  gap: 9px;
  margin-bottom: 11px;
}

.brand-lockup.is-compact strong {
  font-size: 20px;
}

.login-view h1 {
  max-width: 720px;
  margin: 4px 0 18px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(42px, 9vw, 76px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.lede {
  max-width: 560px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
}

.login-form {
  width: min(100%, 520px);
  margin-top: 44px;
}

.login-form > label,
.title-field > span {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 750;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-row input,
.title-field input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  padding: 0 15px;
}

.password-row input:focus,
.title-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.password-row button,
.primary-button {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--ink);
  padding: 0 22px;
  font-weight: 800;
}

.topbar,
.section-heading,
.job-title-row,
.job-progress-row,
.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(25px, 5vw, 36px);
  letter-spacing: -0.035em;
}

.text-button {
  min-width: 54px;
  min-height: 44px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}

.upload-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.upload-card::after {
  position: absolute;
  top: -80px;
  right: -65px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(112, 181, 255, 0.19);
  content: "";
  pointer-events: none;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #e5f1ff;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.upload-intro h2 {
  margin: 15px 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(30px, 7vw, 48px);
  letter-spacing: -0.045em;
}

.upload-intro p {
  max-width: 620px;
  margin: 0 0 24px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.file-drop {
  position: relative;
  display: flex;
  min-height: 164px;
  border: 1.5px dashed rgba(16, 36, 61, 0.28);
  border-radius: 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: rgba(247, 246, 242, 0.75);
  padding: 24px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.file-drop:active,
.file-drop.is-dragging {
  border-color: var(--accent);
  background: #f1f7ff;
  transform: scale(0.995);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-glyph {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 13px;
  border-radius: 50%;
  place-items: center;
  color: white;
  background: var(--accent);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.file-primary {
  font-size: 17px;
  font-weight: 800;
  word-break: break-word;
}

.file-secondary {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}

.title-field {
  display: block;
  margin: 20px 0;
}

.title-field small {
  color: var(--ink-soft);
  font-weight: 500;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.22);
}

.primary-button:active {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.45;
}

.upload-progress {
  margin-top: 20px;
}

.progress-copy {
  margin-bottom: 8px;
  font-size: 13px;
}

.progress-track,
.job-progress {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(16, 36, 61, 0.1);
}

.progress-track span,
.job-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 300ms ease;
}

.form-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.retention-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.retention-note span::before {
  color: var(--accent);
  content: "●";
  margin-right: 7px;
  font-size: 7px;
  vertical-align: 1px;
}

.jobs-section {
  margin-top: 44px;
}

.section-heading {
  margin-bottom: 16px;
}

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

.job-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 254, 251, 0.82);
  padding: 17px;
}

.job-main {
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: #a6aaa6;
  box-shadow: 0 0 0 4px rgba(166, 170, 166, 0.13);
}

.job-card[data-status="done"] .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(28, 116, 95, 0.13);
}

.job-card[data-status="failed"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(164, 55, 43, 0.13);
}

.job-card[data-active="true"] .status-dot {
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 7px rgba(0, 113, 227, 0.09); }
}

.job-copy {
  min-width: 0;
}

.job-title-row {
  align-items: baseline;
}

.job-title-row h3 {
  overflow: hidden;
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-title-row time {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 11px;
}

.job-file {
  overflow: hidden;
  margin: 4px 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-progress-row {
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
}

.job-percent {
  color: var(--ink);
}

.job-card[data-status="done"] .job-progress span {
  background: var(--success);
}

.job-card[data-status="failed"] .job-progress span {
  background: var(--danger);
}

.job-error {
  margin: 10px 0 0;
  border-radius: 10px;
  color: var(--danger);
  background: rgba(164, 55, 43, 0.07);
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.5;
}

.artifact-actions,
.job-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  padding-left: 23px;
}

.artifact-link,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  padding: 0 13px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}

.artifact-link.is-primary {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.secondary-button {
  color: var(--ink-soft);
  cursor: pointer;
}

.secondary-button.is-danger {
  color: var(--danger);
}

.empty-state {
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 28px;
}

.empty-state:not([hidden]) {
  display: flex;
}

.empty-state span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 34px;
}

.empty-state p {
  max-width: 280px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

@media (min-width: 720px) {
  .shell {
    padding: 52px 28px 72px;
  }

  .login-view {
    padding-left: 34px;
  }

  .upload-card {
    padding: 38px;
  }

  .file-drop {
    min-height: 190px;
  }

  .job-card {
    padding: 21px;
  }
}

@media (max-width: 560px) {
  .password-row {
    grid-template-columns: 1fr;
  }

  .password-row button {
    width: 100%;
  }

  .upload-card {
    border-radius: 23px;
    padding: 20px;
  }

  .artifact-actions,
  .job-secondary-actions {
    padding-left: 0;
  }

  .artifact-link {
    flex: 1 1 calc(50% - 4px);
  }
}

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