:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --line: #d8e0e8;
  --text: #17202a;
  --muted: #5d6b78;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 4vw, 56px) 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.eyebrow,
.section-label {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 22px;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 56px) 42px;
}

.editor-panel,
.controls-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-panel {
  display: flex;
  min-height: 660px;
  flex-direction: column;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.counter {
  color: var(--muted);
  font-size: 14px;
}

textarea {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: none;
  border: 0;
  padding: 22px;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  line-height: 1.75;
  outline: none;
}

textarea::placeholder {
  color: #8a97a3;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.control-block,
.slider-row {
  display: grid;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

input[type="search"],
select {
  padding: 0 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--accent);
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button-icon {
  font-size: 12px;
  transform: translateY(1px);
}

.result-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

audio {
  width: 100%;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.download-link:hover {
  background: var(--surface-soft);
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.message.error {
  color: var(--danger);
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    min-height: 460px;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    padding-inline: 14px;
  }

  .editor-panel {
    min-height: 380px;
  }
}
