:root {
  --bg: #0a0f16;
  --bg-soft: #0f1722;
  --card: #121c28;
  --card-2: #16212f;
  --line: #223243;
  --line-soft: #1a2736;
  --text: #e6eef8;
  --muted: #8ea3b8;
  --accent: #19c3b0;
  --accent-2: #0ea5e9;
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1100px 500px at 8% -10%, rgba(25, 195, 176, .12), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(14, 165, 233, .10), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 "SF Pro SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 22px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
  color: #051018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(25, 195, 176, .35);
}

.brand-title { font-size: 19px; font-weight: 650; letter-spacing: .2px; }
.brand-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid rgba(25, 195, 176, .35);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 2px;
}

.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
.pill.ok { color: #c7f9ec; border-color: rgba(25, 195, 176, .4); background: rgba(25, 195, 176, .10); }
.pill.ok i { background: var(--ok); }
.pill.bad { color: #ffd7d7; border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .1); }
.pill.bad i { background: var(--danger); }
.pill-warn i { background: var(--warn); }

.tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 18px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.panel { display: none; }
.panel.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h3 { margin: 0 0 10px; font-size: 15.5px; font-weight: 650; }

.grid.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat { padding: 16px; margin: 0; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: .3px; }
.stat-value.small { font-size: 15px; word-break: break-all; }
.stat-foot { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.grow, .grow { flex: 1; min-width: 0; }
.small-gap { gap: 8px; margin-top: 12px; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #172434;
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: transform .08s, border-color .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #2c4256; background: #1a2a3c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, rgba(25, 195, 176, .95), rgba(14, 165, 233, .9));
  border-color: transparent;
  color: #041219;
  font-weight: 650;
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, rgba(25, 195, 176, 1), rgba(14, 165, 233, 1)); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(248, 113, 113, .4); color: #ffc9c9; background: rgba(248, 113, 113, .08); }
.small-btn { padding: 5px 10px; font-size: 12px; }

.input {
  background: #0c141e;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  min-width: 150px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: rgba(25, 195, 176, .55); box-shadow: 0 0 0 3px rgba(25, 195, 176, .12); }
.input::placeholder { color: #5f7488; }
.select { min-width: 130px; cursor: pointer; }
.select.compact { min-width: 92px; padding: 7px 10px; }
.textarea { width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 92px; }

label.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
label.block { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
label.block .textarea { margin-top: 8px; color: var(--text); }

.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, .25);
  background: rgba(251, 191, 36, .07);
  color: #f6e2b6;
  font-size: 12.5px;
}

.steps { margin: 4px 0 0 18px; padding: 0; color: #c8d6e5; }
.steps li { margin: 6px 0; }

.sep { height: 1px; background: var(--line-soft); margin: 16px 0; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; word-break: break-all; }

.log-card { padding: 14px 18px; }
.log-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.progress {
  height: 6px;
  border-radius: 999px;
  background: #0a121b;
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}

.log {
  max-height: 150px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0a121b;
  border: 1px solid var(--line-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #a9bccf;
  white-space: pre-wrap;
  word-break: break-word;
}
.log:empty::after { content: "暂无记录"; color: #516679; }
.log .ok { color: var(--ok); }
.log .err { color: var(--danger); }
.log .warn { color: var(--warn); }

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.song {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #121d2a, #0f1822);
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.song:hover { border-color: #2b4358; }
.song.selected { border-color: rgba(25, 195, 176, .65); box-shadow: 0 0 0 2px rgba(25, 195, 176, .12); }
.song.disabled { opacity: .55; cursor: default; }

.song-cover {
  width: 64px;
  height: 64px;
  border-radius: 9px;
  object-fit: cover;
  background: #0b1219;
  flex: 0 0 auto;
}
.song-body { min-width: 0; flex: 1; }
.song-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-sub { color: var(--muted); font-size: 11.5px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.song-check {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.ok { color: #bff7e5; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.badge.warn { color: #f8e0ad; border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .07); }
.badge.bad { color: #ffcfcf; border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .07); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}

.drop {
  border: 1px dashed #2a4257;
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: rgba(255, 255, 255, .015);
}
.drop:hover, .drop.drag { border-color: rgba(25, 195, 176, .6); background: rgba(25, 195, 176, .05); }
.drop-title { font-size: 14px; font-weight: 600; }
.drop-sub { color: var(--muted); font-size: 12px; margin-top: 6px; word-break: break-all; }

.result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(25, 195, 176, .35);
  background: rgba(25, 195, 176, .08);
  font-size: 13px;
}
.result a { color: var(--accent); }
.hidden { display: none; }
[hidden] { display: none !important; }

.block-input { width: 100%; margin-top: 7px; }
.check { width: 15px; height: 15px; accent-color: var(--accent); }
.check-line { cursor: pointer; user-select: none; }

@media (max-width: 900px) {
  .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid.cards { grid-template-columns: 1fr; }
  .app { padding: 16px 14px 40px; }
}
