:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  --ink: #1e2430;
  --muted: #667085;
  --line: #dde3ec;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --accent: #d94841;
  --accent-dark: #a52d2b;
  --teal: #128b7d;
  --gold: #d69b22;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f7f3ed 0%, #eef5f8 46%, #f8f7fb 100%);
  color: var(--ink);
}

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

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

button:hover {
  border-color: #bac6d6;
  box-shadow: 0 8px 24px rgba(20, 31, 45, 0.08);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.control-panel,
.stage-panel {
  min-width: 0;
}

.brand-block {
  padding: 22px 0 18px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

.brand-block p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.recorder-card,
.metric,
.chart-panel,
.records-panel,
.summary-panel {
  border: 1px solid rgba(196, 207, 220, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(30, 43, 58, 0.08);
}

.recorder-card {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 150px;
  padding: 12px;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18, 139, 125, 0.12);
}

.record-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

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

.meter-wrap {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
  margin-bottom: 16px;
}

.meter-bar {
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--accent));
  transition: width 0.08s linear;
}

.transcript-label {
  margin-top: 6px;
}

.status-text {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.chart-panel {
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#resetButton {
  min-height: 34px;
  padding: 0 12px;
  color: #7a2c2a;
}

.emotion-chart {
  display: block;
  width: 100%;
  height: 300px;
  border-radius: 8px;
  background: #fbfcfe;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.records-panel,
.summary-panel {
  min-height: 290px;
  padding: 16px;
}

.records-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  margin-top: 12px;
  overflow: auto;
  padding-right: 4px;
}

.record-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.record-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.record-item strong {
  color: var(--ink);
}

.record-speech {
  margin-top: 8px;
  line-height: 1.6;
}

.record-features {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.emotion-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff2e5;
  color: #8a4d10;
  font-size: 13px;
  font-weight: 700;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 12px 0 0;
  color: #344054;
  font-family: inherit;
  line-height: 1.7;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding: 14px 0;
  }

  h1 {
    font-size: 28px;
  }

  .form-grid,
  .record-actions,
  .metrics-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

}
