:root {
  color-scheme: light;
  --bg: #f4f8fb;
  --panel: #ffffff;
  --ink: #13202b;
  --muted: #617487;
  --line: #d8e3eb;
  --accent: #087f8c;
  --accent-strong: #06606a;
  --accent-soft: #e2f5f7;
  --danger: #b3261e;
  --ok: #138a36;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #f7fbfd 0%, var(--bg) 42%, #eef5f8 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
}

.version-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 5px 9px;
  border: 1px solid #b9dfe5;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 800;
}

.lead {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.status-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.status-panel strong,
.status-panel span:last-child {
  display: block;
}

.status-panel strong {
  margin-bottom: 6px;
}

#statusHint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: #b8c6cf;
  box-shadow: 0 0 0 5px rgba(184, 198, 207, 0.18);
}

.status-dot.ready {
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(19, 138, 54, 0.14);
}

.status-dot.busy {
  background: #d9822b;
  box-shadow: 0 0 0 5px rgba(217, 130, 43, 0.16);
}

.workspace,
.output {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f9fcfd;
  border-radius: 8px 8px 0 0;
}

.tab {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  border-color: #b9dfe5;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tool-form {
  padding: 20px;
}

.tool-panel {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-panel.active {
  display: grid;
}

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

.field.wide {
  grid-column: span 2;
}

label {
  color: #233645;
  font-weight: 800;
}

small {
  color: var(--muted);
}

input[type="file"],
input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

input[type="file"] {
  padding: 8px 10px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  margin-top: 28px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.actions button,
.download-link {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.actions .primary,
.download-link {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.actions button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.output {
  margin-top: 18px;
  padding: 20px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.progress-bar {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef3;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.result.empty {
  display: block;
  color: var(--muted);
}

.result strong,
.result span {
  display: block;
}

.result audio {
  width: 100%;
  margin-top: 10px;
}

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

.logs {
  margin-top: 16px;
  color: var(--muted);
}

.logs summary {
  cursor: pointer;
  font-weight: 800;
}

pre {
  max-height: 230px;
  overflow: auto;
  padding: 12px;
  border-radius: 7px;
  background: #0f1f29;
  color: #d9f6f8;
  white-space: pre-wrap;
}

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

@media (max-width: 820px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding-top: 22px;
  }

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

  .tabs,
  .tool-panel {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: auto;
  }

  .result {
    grid-template-columns: 1fr;
  }
}
