/* M1-1 三屏静态壳 —— 静态结构先稳住层级、间距和状态流转。 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #eef2f1;
  --ink: #181614;
  --muted: #6f7472;
  --soft: #d9e0dd;
  --panel: #fbfbf8;
  --panel-strong: #ffffff;
  --accent: #ff4f3e;
  --accent-dark: #c93327;
  --teal: #0f766e;
  --shadow: 0 24px 70px rgba(23, 28, 26, .13);
}
body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 76px;
}
#app {
  width: min(100%, 860px);
  min-height: 620px;
  padding: 28px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 28px;
}
.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}
.brandmark {
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
}
.brand-note { text-transform: uppercase; }

/* 状态机：默认隐藏，仅 [data-active] 显示 */
.screen {
  display: none;
  min-height: 520px;
  background: var(--panel);
  border: 1px solid rgba(24, 22, 20, .08);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 56px);
}
.screen[data-active] {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen-head {
  max-width: 640px;
  margin: 0 auto 30px;
  text-align: center;
}
.screen-head.compact { margin-bottom: 22px; }
.eyebrow {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}
.title {
  font-size: clamp(34px, 4.8vw, 56px);
  line-height: 1.04;
  font-weight: 900;
  margin-bottom: 14px;
}
.accent { color: var(--accent); }
.sub {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.meta-line {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 18px;
}

/* ① 上传区 */
.dropzone {
  width: min(100%, 600px);
  margin: 0 auto;
  border: 2px dashed rgba(24, 22, 20, .22);
  border-radius: 14px;
  padding: clamp(30px, 6vw, 54px) 24px;
  background: var(--panel-strong);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  border-color: var(--accent);
  background: #fff8f5;
  box-shadow: 0 16px 42px rgba(255, 79, 62, .13);
  outline: none;
}
.dropzone:active { transform: scale(.99); }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 30px;
  line-height: 1;
}
.dropzone-text {
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
}

/* ② 转换中 */
.process-layout {
  display: grid;
  place-items: center;
  gap: 18px;
}
.process-meter {
  width: min(100%, 500px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 20px 22px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(24, 22, 20, .08);
  box-shadow: 0 16px 42px rgba(23, 28, 26, .08);
}
.process-meter[data-phase="waiting"] {
  background: #fffdf4;
  border-color: rgba(182, 121, 0, .18);
}
.process-meter[data-phase="running"] {
  background: #f7fffc;
  border-color: rgba(15, 118, 110, .18);
}
.timer-ring {
  width: 124px;
  height: 124px;
  border: 5px solid var(--soft);
  border-top-color: var(--accent);
  border-right-color: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 1.2s linear infinite; /* 呼吸式连续动效，不暴露 10s 轮询颗粒 */
}
.timer-eta {
  font-size: 15px;
  color: var(--ink);
  font-weight: 800;
  animation: spin 1.2s linear infinite reverse;
}
.process-copy {
  display: grid;
  gap: 8px;
  text-align: left;
}
.process-label {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}
.process-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
@keyframes spin { to { transform: rotate(360deg); } }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  width: min(100%, 520px);
}
.steps li {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 10px;
  background: #edf1ef;
  border: 1px solid transparent;
}
.steps li[data-state="active"] {
  color: var(--accent-dark);
  background: #fff8f5;
  border-color: rgba(255, 79, 62, .24);
  font-weight: 800;
}
.steps li[data-state="done"] { color: var(--teal); }
.steps li[data-state="done"]::before { content: "✓ "; }
.process-footnote {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* ④ 失败屏 */
.failure-panel {
  width: min(100%, 500px);
  margin: 0 auto 8px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(24, 22, 20, .08);
  text-align: left;
}
.failure-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff8f5;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 10px;
}
.failure-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ③ 结果页 */
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 auto 22px;
  width: min(100%, 700px);
}
.wave {
  min-width: 0;
  background: var(--panel-strong);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(24, 22, 20, .08);
}
.wave figcaption {
  font-size: 13px;
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 12px;
}
.wave audio { width: 100%; }
.wave-placeholder {
  min-height: 52px;
  margin-top: 10px;
  display: flex;
  align-items: end;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent);
  font-size: 24px;
  overflow: hidden;
  white-space: nowrap;
}

/* 按钮 */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}
.btn {
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(24, 22, 20, .14);
  background: var(--panel-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s, border-color .12s, background .12s;
}
.btn:hover { border-color: rgba(24, 22, 20, .3); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-link {
  border: none;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  min-height: auto;
}

/* dev bar */
.devbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #18181b; color: #fafafa; padding: 8px 12px;
  display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap;
}
.devbar[hidden] { display: none; }
.devbar button {
  background: #3f3f46; color: #fafafa; border: none;
  padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.devbar button:hover { background: var(--accent-dark); }

@media (max-width: 640px) {
  body { align-items: stretch; padding: 14px 12px 116px; }
  #app {
    min-height: auto;
    padding: 0;
    gap: 16px;
  }
  .brandbar { padding: 4px 2px 0; }
  .brand-note { display: none; }
  .screen {
    min-height: calc(100svh - 146px);
    border-radius: 14px;
    padding: 28px 18px;
  }
  .title {
    font-size: 34px;
    line-height: 1.08;
  }
  .sub { font-size: 15px; line-height: 1.6; }
  .compare { grid-template-columns: 1fr; }
  .process-meter {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 16px;
    padding: 20px 18px;
  }
  .process-copy { text-align: center; }
  .timer-ring {
    width: 118px;
    height: 118px;
  }
  .steps { grid-template-columns: 1fr; width: 100%; }
  .failure-panel { text-align: center; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  .btn-link { width: auto; align-self: center; }
  .devbar { max-height: 92px; overflow: auto; }
}
