:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #1a1a26;
  --border: #2a2a3a;
  --text: #f0f0f5;
  --muted: #8888a0;
  --accent: #7c5cff;
  --accent-hover: #9078ff;
  --success: #34d399;
  --error: #f87171;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(124, 92, 255, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(52, 211, 153, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: var(--shadow);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.upload-zone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: rgba(124, 92, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-zone .upload-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.upload-zone .upload-hint {
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 360px;
}

.queue {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.875rem;
}

.queue-item .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item .status {
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.queue-item .status.uploading { color: var(--accent); }
.queue-item .status.done { color: var(--success); }
.queue-item .status.error { color: var(--error); }

.progress-bar {
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-bar div {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

.library {
  margin-top: 48px;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.library-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.count {
  color: var(--muted);
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, transform 0.15s;
  animation: fadeIn 0.3s ease;
}

.card:hover {
  border-color: rgba(124, 92, 255, 0.4);
  transform: translateY(-1px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-word;
}

.card-date {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.card audio {
  display: block;
  width: 100%;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 8px;
  color-scheme: dark;
}

.card-url {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-url input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 8px 12px;
  font-family: inherit;
  outline: none;
}

.card-url input:focus {
  border-color: var(--accent);
  color: var(--text);
}

.btn-copy {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-copy:hover { background: var(--accent-hover); }
.btn-copy.copied { background: var(--success); }

.empty,
.loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty svg {
  width: 48px;
  height: 48px;
  stroke: var(--border);
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 100;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error { border-color: var(--error); color: var(--error); }
.toast.success { border-color: var(--success); color: var(--success); }

@media (max-width: 600px) {
  .wrap { padding: 32px 16px 48px; }
  header h1 { font-size: 1.5rem; }
  .card-url { flex-direction: column; }
  .btn-copy { width: 100%; }
}
