:root {
  color-scheme: light;
  --ink: #332821;
  --muted: #77695f;
  --line: #eadfd5;
  --paper: #fbf6ef;
  --panel: #fffdf9;
  --panel-warm: #f8eee6;
  --primary: #7d4f45;
  --primary-strong: #4b302b;
  --accent: #d78a8f;
  --accent-strong: #a6535e;
  --rose-soft: #f6dfe1;
  --sage: #6f8b78;
  --good: #527a5d;
  --focus: #c88945;
  --shadow: 0 22px 60px rgba(82, 58, 42, 0.13);
  --shadow-soft: 0 10px 28px rgba(82, 58, 42, 0.08);
  font-family: "Avenir Next", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(246, 223, 225, 0.58), transparent 34%),
    linear-gradient(180deg, #fffaf5 0%, #fbf6ef 44%, #f6eee4 100%),
    repeating-linear-gradient(90deg, rgba(125, 79, 69, 0.025) 0 1px, transparent 1px 18px),
    var(--paper);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
}

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

button,
label.file-drop {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.file-drop:focus-within,
.skip-link:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.skip-link {
  background: var(--primary-strong);
  color: #fff;
  left: 1rem;
  padding: 0.75rem 1rem;
  position: fixed;
  top: 1rem;
  transform: translateY(-150%);
  z-index: 50;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  margin: 0 auto;
  max-width: 920px;
  padding: 34px 18px 56px;
}

.auth-screen {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(246, 223, 225, 0.64), transparent 34%),
    linear-gradient(180deg, #fffaf5 0%, #fbf6ef 100%);
  display: flex;
  inset: 0;
  justify-content: center;
  min-height: 100vh;
  padding: 22px;
  position: fixed;
  z-index: 80;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  max-width: 430px;
  padding: 30px;
  width: 100%;
}

.auth-card h1 {
  font-size: clamp(2rem, 8vw, 3.2rem);
}

.auth-mark {
  height: 66px;
  width: 66px;
}

.auth-error {
  background: #fff2f1;
  border: 1px solid #d78a8f;
  border-radius: 12px;
  color: #8b2e36;
  font-weight: 800;
  margin: 0;
  padding: 12px 14px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 76px 1fr;
  margin-bottom: 22px;
}

.brand-mark {
  align-items: center;
  background:
    linear-gradient(145deg, #fff7ef, #f4d4d7 58%, #c98b82);
  border: 1px solid rgba(125, 79, 69, 0.18);
  border-radius: 24px;
  box-shadow: 0 18px 34px rgba(166, 83, 94, 0.18);
  color: var(--primary-strong);
  display: flex;
  height: 76px;
  justify-content: center;
  width: 76px;
}

.brand-mark svg {
  height: 42px;
  width: 42px;
}

.eyebrow {
  color: var(--accent-strong);
  font-weight: 800;
  margin: 0 0 2px;
}

h1,
h2 {
  font-family: "Avenir Next", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 4.4rem);
}

h2 {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
}

.lead,
.panel p,
.note {
  color: var(--muted);
  margin: 0;
}

.lead {
  max-width: 35rem;
}

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

.step {
  align-items: center;
  background: rgba(255, 253, 249, 0.78);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
}

.step span {
  align-items: center;
  background: #efe2d7;
  color: var(--primary-strong);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 32px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
}

.step.is-active {
  background: #fffdf9;
  border-color: var(--accent);
  box-shadow: 0 14px 32px rgba(166, 83, 94, 0.14);
}

.step.is-active span,
.step.is-done span {
  background: var(--accent-strong);
  color: #fff;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 249, 0.96)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  padding: clamp(20px, 5vw, 34px);
}

.primary-actions {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.25fr 1fr;
}

.mega-button,
.file-drop,
.action-button,
.publish-button,
.secondary-button {
  align-items: center;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 58px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.mega-button {
  background:
    linear-gradient(145deg, #bd6570, #d78a8f 52%, #e8aaa7);
  box-shadow: 0 18px 34px rgba(166, 83, 94, 0.26);
  color: #fff;
  flex-direction: column;
  font-size: clamp(1.4rem, 5vw, 2rem);
  gap: 10px;
  min-height: 190px;
  padding: 26px;
}

.mega-button svg {
  height: 48px;
  width: 48px;
}

.mega-button.is-recording {
  background:
    linear-gradient(145deg, #8b2e36, #b74751 60%, #d7787f);
}

.file-drop {
  background:
    linear-gradient(180deg, #fffaf6, #f8eee6);
  border: 2px dashed #d1aa9e;
  color: var(--primary);
  flex-direction: column;
  gap: 8px;
  min-height: 190px;
  padding: 22px;
  text-align: center;
}

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

.file-drop svg {
  height: 42px;
  width: 42px;
}

.file-drop small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.status-box {
  background: #f1f7ee;
  border: 2px solid #bad2ae;
  border-radius: 12px;
  display: grid;
  gap: 4px;
  padding: 16px;
}

.record-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  background: var(--panel-warm);
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
}

.record-tip svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  fill: none;
  stroke: var(--focus);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-tip strong {
  color: var(--accent-strong);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 800;
}

input,
select,
textarea {
  background: #fffdf9;
  border: 2px solid #d8c5b8;
  border-radius: 12px;
  color: var(--ink);
  min-height: 56px;
  padding: 14px 15px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.split-fields,
.result-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-button,
.publish-button {
  background:
    linear-gradient(145deg, var(--primary-strong), var(--primary));
  color: #fff;
  gap: 10px;
  min-height: 68px;
  padding: 0 22px;
}

.action-button svg,
.publish-button svg,
.secondary-button svg {
  height: 24px;
  width: 24px;
}

.progress-list {
  display: grid;
  gap: 14px;
}

.progress-row {
  align-items: center;
  background: #fbf2ea;
  border: 1px solid #eadfd5;
  border-radius: 12px;
  display: flex;
  gap: 14px;
  min-height: 62px;
  padding: 14px;
}

.progress-row span {
  background: #decfc4;
  border-radius: 999px;
  flex: 0 0 24px;
  height: 24px;
}

.progress-row.is-done span {
  background: var(--good);
}

.progress-row.is-active span {
  animation: pulse 1s ease-in-out infinite;
  background: var(--accent-strong);
}

.result-header,
.audio-output {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.handoff-steps,
.soundon-fields {
  display: grid;
  gap: 14px;
}

.handoff-step {
  align-items: center;
  background: #fff8f3;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: 42px 1fr auto;
  padding: 16px;
}

.handoff-step > span {
  align-items: center;
  background: var(--accent-strong);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.handoff-step strong {
  display: block;
  font-size: 1.12rem;
}

.copy-field {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.copy-field-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.copy-field label {
  font-weight: 900;
}

.mini-copy-button {
  min-height: 46px;
  padding: 0 14px;
}

.ready-badge {
  background: #eef6ea;
  border-radius: 999px;
  color: var(--good);
  font-weight: 900;
  padding: 8px 14px;
  white-space: nowrap;
}

.audio-output {
  background:
    linear-gradient(180deg, #fff8f3, #f8eee6);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.secondary-button {
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--primary);
  gap: 8px;
  padding: 0 18px;
  white-space: nowrap;
}

.package-button {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.quiet-button {
  border-color: #d1aa9e;
  color: var(--primary-strong);
}

.publish-button {
  background:
    linear-gradient(145deg, #bd6570, #d78a8f);
  font-size: 1.2rem;
}

.toast {
  background: var(--primary-strong);
  border-radius: 14px;
  bottom: 18px;
  box-shadow: var(--shadow);
  color: #fff;
  font-weight: 800;
  left: 50%;
  max-width: min(92vw, 520px);
  padding: 14px 18px;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  z-index: 100;
}

button:hover,
.file-drop:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(82, 58, 42, 0.13);
}

button:active,
.file-drop:active {
  transform: translateY(1px);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.16);
  }
}

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

@media (max-width: 720px) {
  .app-shell {
    padding: 18px 14px 42px;
  }

  .hero {
    grid-template-columns: 58px 1fr;
  }

  .brand-mark {
    border-radius: 16px;
    height: 58px;
    width: 58px;
  }

  .brand-mark svg {
    height: 32px;
    width: 32px;
  }

  .stepper,
  .primary-actions,
  .split-fields,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .step {
    min-height: 52px;
  }

  .mega-button,
  .file-drop {
    min-height: 150px;
  }

  .result-header,
  .audio-output,
  .handoff-step,
  .copy-field-header {
    align-items: stretch;
    flex-direction: column;
  }

  .handoff-step {
    grid-template-columns: 1fr;
  }

  .secondary-button {
    width: 100%;
  }

  .download-actions {
    width: 100%;
  }
}
