:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #68736d;
  --paper: #f7f7f5;
  --card: rgba(255, 255, 255, 0.96);
  --line: rgba(23, 33, 29, 0.12);
  --accent: #0f6b4f;
  --accent-soft: #dff0e9;
  --danger: #b33b32;
  --warning: #9a6410;
  --shadow: 0 8px 28px rgba(29, 45, 38, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--paper);
}

button,
select,
textarea,
input {
  font: inherit;
}

button,
select {
  min-height: 42px;
}

input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 36px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.subtitle {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.good {
  color: #0b5a40;
  background: #dff3e9;
  border-color: #b8dfcf;
}

.pill.bad {
  color: #8d2924;
  background: #f9e6e3;
  border-color: #edc5bf;
}

.pill.neutral {
  color: #5e6863;
  background: rgba(255, 255, 255, 0.6);
}

.panel,
.result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

[hidden] {
  display: none !important;
}

.workflow-panel {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px 24px;
  align-items: center;
  padding: 20px;
  margin-bottom: 16px;
}

.workflow-panel .eyebrow,
.capture-heading .eyebrow {
  margin-bottom: 6px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-button {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.mode-button strong {
  font-size: 15px;
}

.mode-button span {
  color: var(--muted);
  font-size: 12px;
}

.mode-button.active {
  border-color: rgba(15, 107, 79, 0.52);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 107, 79, 0.08);
}

.mode-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.workflow-panel > .hint {
  grid-column: 2;
  margin: -10px 0 0;
}

.optional {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(280px, 1fr);
  gap: 26px;
  align-items: center;
  padding: 26px;
}

.field label,
.options {
  font-size: 14px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

select {
  width: 100%;
  padding: 0 40px 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.hint,
.prompt-preview {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.record-zone {
  display: grid;
  place-items: center;
  gap: 8px;
}

.record-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  justify-content: center;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 107, 79, 0.23);
}

.record-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.record-button.recording {
  background: var(--danger);
  animation: pulse 1.6s infinite;
}

.record-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
}

.timer {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.record-ready-hint {
  max-width: 210px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.options {
  display: grid;
  gap: 9px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  color: #404a45;
  line-height: 1.45;
}

.check-row input {
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.keyword-box {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.meeting-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.4fr;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.keyword-list span {
  padding: 5px 9px;
  border-radius: 9px;
  color: #245b49;
  background: var(--accent-soft);
  font-size: 12px;
}

.message-panel {
  margin: 16px 0;
  padding: 14px 18px;
  box-shadow: none;
}

.text-entry {
  margin-top: 16px;
  padding: 22px;
  box-shadow: none;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-head .eyebrow {
  margin-bottom: 5px;
}

.section-head h2 {
  margin-bottom: 4px;
}

.section-head .hint {
  margin: 0;
}

.process-button {
  flex: 0 0 auto;
  min-width: 120px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.process-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.text-entry textarea {
  min-height: 130px;
}

.message-panel p {
  margin: 0;
  color: var(--muted);
}

.message-panel.error {
  border-color: #e5aaa4;
  background: #fff1ef;
}

.message-panel.error p {
  color: #8d2924;
}

.message-panel.success {
  border-color: #add6c5;
  background: #edf8f3;
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.result-card {
  padding: 20px;
  box-shadow: none;
}

.result-card.recommended {
  border-color: rgba(15, 107, 79, 0.38);
  box-shadow: inset 0 0 0 1px rgba(15, 107, 79, 0.08);
}

.final-draft-card {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, rgba(237, 248, 243, 0.98), rgba(255, 255, 255, 0.96));
}

.final-draft-card textarea {
  min-height: 260px;
  font-size: 15px;
  line-height: 1.75;
}

.card-note {
  margin: -3px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.card-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 175px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(250, 250, 248, 0.85);
  line-height: 1.75;
}

.copy-button,
.actions button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.primary-copy {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.comparison,
.audit-summary {
  margin-top: 16px;
  padding: 20px;
}

.comparison textarea {
  margin-top: 14px;
  min-height: 110px;
}

.audit-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: none;
}

.audit-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button:disabled {
  opacity: 0.5;
}

.actions .quiet-button {
  color: var(--danger);
}

footer {
  padding: 22px 6px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.setup-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 20px;
  padding: 22px;
  margin-bottom: 16px;
}

.attendees-field {
  grid-column: span 2;
}

.capture-panel {
  padding: 24px;
}

.capture-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.capture-heading > .hint {
  max-width: 560px;
  margin: 0;
}

.action-with-reason {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.action-reason {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.action-reason[data-state="ASR_KEY_REQUIRED"],
.action-reason[data-state="CONTEXT_REQUIRED"] {
  color: var(--warning);
}

.inline-field {
  display: flex;
  gap: 8px;
}

.inline-field input,
.inline-field select {
  min-width: 0;
  flex: 1;
}

input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.inline-field button,
.secondary-button,
.primary-button,
.quiet-button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.record-zone {
  gap: 12px;
}

.record-actions,
.draft-actions,
.capture-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-button:disabled,
.primary-button:disabled,
.inline-field button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger-outline,
.quiet-button {
  color: var(--danger);
}

.primary-button {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.volume-meter {
  width: min(240px, 50vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e3;
}

.volume-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #61a989, #d39a42, #b33b32);
  transition: width 90ms linear;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 112px;
  margin-top: 22px;
  padding: 18px;
  border: 1.5px dashed #9eb5aa;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(247, 250, 248, 0.8);
  cursor: pointer;
  text-align: center;
}

.drop-zone strong {
  color: var(--ink);
}

.drop-zone.dragging,
.drop-zone:focus-visible {
  outline: 3px solid rgba(15, 107, 79, 0.18);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.audio-draft {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(15, 107, 79, 0.28);
  border-radius: 16px;
  background: #f3faf6;
}

.audio-draft[hidden] {
  display: none;
}

.audio-draft audio {
  width: 100%;
}

.audio-draft p {
  margin: 5px 0 0;
}

.options-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.progress-panel {
  margin: 16px 0;
  padding: 18px 20px;
}

.progress-panel[hidden] {
  display: none;
}

.progress-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: phases;
}

.progress-list li {
  counter-increment: phases;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.progress-list li::before {
  content: counter(phases) ". ";
  font-weight: 900;
}

.progress-list li.active {
  color: #205e49;
  border-color: #7cb69f;
  background: var(--accent-soft);
}

.progress-list li.done {
  color: #0b5a40;
  border-color: #add6c5;
  background: #edf8f3;
}

.progress-list li.failed {
  color: #8d2924;
  border-color: #e5aaa4;
  background: #fff1ef;
}

.comparison label {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 800;
}

@keyframes pulse {
  0%,
  100% { box-shadow: 0 0 0 0 rgba(179, 59, 50, 0.25); }
  50% { box-shadow: 0 0 0 14px rgba(179, 59, 50, 0); }
}

@media (max-width: 900px) {
  .workflow-panel {
    grid-template-columns: 1fr;
  }

  .workflow-panel > .hint {
    grid-column: auto;
    margin-top: -6px;
  }

  .setup-panel,
  .audio-draft {
    grid-template-columns: 1fr;
  }

  .attendees-field {
    grid-column: auto;
  }

  .progress-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .keyword-box {
    grid-column: auto;
  }

  .meeting-meta {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .results {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1040px);
    padding-top: 24px;
  }

  .hero,
  .audit-summary,
  .section-head,
  .capture-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .status-stack {
    justify-content: flex-start;
  }

  .controls {
    padding: 18px;
  }

  .capture-panel,
  .setup-panel {
    padding: 16px;
  }

  .inline-field,
  .record-actions,
  .draft-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .options-grid,
  .progress-list,
  .mode-switch {
    grid-template-columns: 1fr;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }
}
