:root {
  --bg: #0f1117;
  --card: #1a1d27;
  --border: #2a2f3d;
  --text: #e8eaef;
  --muted: #8b92a8;
  --accent: #6c8cff;
  --accent-hover: #8aa3ff;
  --success: #4ade80;
  --error: #f87171;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.hidden {
  display: none !important;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.06);
}

.dropzone .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.dropzone p {
  color: var(--muted);
}

.hint {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.options-grid {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.field label {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.35rem;
}

.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.api-config {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.api-config label {
  font-size: 0.8rem;
  color: var(--muted);
}

.api-config input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.filename {
  font-weight: 600;
  margin-bottom: 1rem;
  word-break: break-all;
}

.progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.status-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.error-text {
  color: var(--error);
  margin-top: 0.5rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-header h2 {
  font-size: 1.1rem;
}

.stem-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stem-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stem-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.stem-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(108, 140, 255, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.stem-name {
  font-weight: 600;
  font-size: 1rem;
}

.stem-name-en {
  font-size: 0.8rem;
  color: var(--muted);
}

.stem-desc,
.stem-file,
.stem-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.results-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.stem-info {
  flex: 1;
  min-width: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-ghost {
  margin-top: 1.25rem;
  width: 100%;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
}

audio {
  width: 100%;
  max-width: 200px;
  height: 32px;
  margin-top: 0.35rem;
}
