:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-elev: #1c2330;
  --border: #2d333f;
  --text: #e6e9ef;
  --text-dim: #9aa4b2;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --success: #3fb950;
  --error: #f85149;
  --radius: 12px;
  --maxw: 900px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.9);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.logo {
  font-size: 1.35rem; font-weight: 800; color: var(--text);
  text-decoration: none; letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 0.85rem;
  padding: 6px 10px; border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--bg-elev); }

/* Hero */
.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 12px; letter-spacing: -0.5px;
}
.tagline { color: var(--text-dim); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Converter */
.converter { margin: 24px 0; }
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--bg-elev);
}
.dz-icon { color: var(--accent); margin-bottom: 8px; }
.dz-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 4px; }
.dz-sub { color: var(--text-dim); margin: 0; font-size: 0.9rem; }
.dz-sub .link { color: var(--accent); text-decoration: underline; }

.controls {
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border);
}
.control { display: flex; flex-direction: column; gap: 6px; }
.control label { font-size: 0.85rem; color: var(--text-dim); }
.control select {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 0.95rem;
}
.control input[type="range"] { width: 180px; accent-color: var(--accent); }
.control:last-child { margin-left: auto; flex-direction: row; gap: 8px; }

.btn {
  border: none; border-radius: 8px; padding: 10px 18px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-dim); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* File list */
.file-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
}
.file-thumb {
  width: 44px; height: 44px; border-radius: 6px; object-fit: cover;
  background: var(--bg); flex-shrink: 0;
}
.file-meta { flex: 1; min-width: 0; }
.file-name {
  font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-sub { font-size: 0.78rem; color: var(--text-dim); }
.file-progress {
  height: 4px; background: var(--bg); border-radius: 2px; margin-top: 6px; overflow: hidden;
}
.file-progress > div {
  height: 100%; width: 0%; background: var(--accent);
  border-radius: 2px; transition: width 0.2s;
}
.file-item.done .file-progress > div { background: var(--success); width: 100% !important; }
.file-item.error .file-progress > div { background: var(--error); width: 100% !important; }
.file-actions { flex-shrink: 0; }
.file-actions .btn { padding: 6px 12px; font-size: 0.8rem; }
.out-name {
  margin-top: 6px; width: 100%; max-width: 260px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: 0.8rem; font-family: inherit;
}
.out-name:focus { outline: none; border-color: var(--accent); }
.status-line { margin: 14px 0 0; font-size: 0.85rem; color: var(--text-dim); min-height: 1.2em; }

/* Ad slots */
.ad-slot { margin: 24px auto; text-align: center; min-height: 0; }
.ad-leaderboard { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-rect { min-height: 250px; display: flex; align-items: center; justify-content: center; }
.ad-slot:empty { display: none; }

/* Content sections */
.content-section { margin: 40px 0; }
.content-section h2 { font-size: 1.4rem; margin: 0 0 16px; letter-spacing: -0.3px; }
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
}
.feature {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.feature h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--accent); }
.feature p { margin: 0; font-size: 0.9rem; color: var(--text-dim); }

.steps { padding-left: 22px; }
.steps li { margin-bottom: 8px; }

details {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px; margin-bottom: 10px;
}
summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
details p { margin: 10px 0 0; color: var(--text-dim); font-size: 0.9rem; }

.link-list { list-style: none; padding: 0; }
.link-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; color: var(--text-dim); }
.link-list li:last-child { border-bottom: none; }
.link-list a { color: var(--accent); text-decoration: none; font-weight: 600; }
.link-list a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 48px; padding: 28px 0;
  color: var(--text-dim); font-size: 0.85rem; text-align: center;
}
.site-footer nav { margin-top: 8px; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 600px) {
  .control:last-child { margin-left: 0; width: 100%; }
  .controls { align-items: stretch; }
  .hero { padding: 32px 0 16px; }
}
