* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f1115;
  color: #e6e6e6;
  min-height: 100vh;
  padding: 24px;
}
.topbar { text-align: center; margin-bottom: 32px; }
.topbar h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.5px; }
.topbar .sub { color: #888; margin-top: 6px; font-size: 14px; }

#app { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: #1a1d24;
  border: 1px solid #262a33;
  border-radius: 12px;
  padding: 24px;
}
.hidden { display: none !important; }

#dropzone {
  position: relative;
  border: 2px dashed #3a3f4a;
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: #1a1d24;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.2s ease;
  will-change: transform, box-shadow;
}
#dropzone:hover {
  border-color: #4a8cff;
  background: rgba(74, 140, 255, 0.04);
  transform: translateY(-2px);
  box-shadow:
    0 6px 24px rgba(74, 140, 255, 0.18),
    0 0 0 1px rgba(74, 140, 255, 0.25);
}
#dropzone:hover .dz-icon {
  color: #4a8cff;
  transform: scale(1.08) rotate(90deg);
}
#dropzone:hover .dz-title { color: #ffffff; }
#dropzone:hover .dz-hint { color: #999; }
#dropzone:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 140, 255, 0.12);
}
#dropzone.drag {
  border-color: #4a8cff;
  background: rgba(74, 140, 255, 0.08);
  transform: translateY(-3px);
  box-shadow:
    0 8px 32px rgba(74, 140, 255, 0.28),
    0 0 0 2px rgba(74, 140, 255, 0.4);
}
#dropzone.drag .dz-icon { color: #6ad1ff; transform: scale(1.15) rotate(90deg); }

.dz-icon {
  font-size: 40px;
  color: #555;
  margin-bottom: 8px;
  font-weight: 200;
  display: inline-block;
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dz-title {
  font-size: 16px;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}
.dz-hint {
  font-size: 12px;
  color: #777;
  transition: color 0.2s ease;
}

#upload-status { margin-top: 12px; font-size: 13px; color: #999; min-height: 18px; }
#upload-status.err { color: #ff6b6b; }

.prog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.lbl { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.fname { font-size: 15px; margin-top: 2px; word-break: break-all; }
.pct { font-size: 24px; font-weight: 500; }

.bar { height: 6px; background: #262a33; border-radius: 3px; overflow: hidden; }
.fill { height: 100%; background: linear-gradient(90deg, #4a8cff, #6ad1ff); width: 0%; transition: width 0.3s; }
.queue { margin-top: 10px; font-size: 13px; color: #888; }

.steps { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #20242c; border-radius: 6px; font-size: 13px;
}
.step .dot { width: 8px; height: 8px; border-radius: 50%; background: #444; flex-shrink: 0; }
.step.running .dot { background: #4a8cff; animation: pulse 1s infinite; }
.step.done .dot { background: #4ade80; }
.step.error .dot { background: #ff6b6b; }
.step .name { flex: 1; }
.step .meta { color: #888; font-size: 11px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.early-info { margin-top: 18px; padding: 14px; background: #20242c; border-radius: 8px; display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.ei-row { display: flex; justify-content: space-between; font-size: 13px; }
.ei-k { color: #888; }
.ei-v { font-weight: 500; color: #e6e6e6; }

.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.diff-tabs { display: flex; gap: 4px; background: #20242c; padding: 4px; border-radius: 8px; }
.diff-tabs button { background: transparent; border: none; color: #aaa; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background 0.15s, color 0.15s; }
.diff-tabs button.active { background: #4a8cff; color: white; }
.diff-tabs button:hover:not(.active) { color: #e6e6e6; background: rgba(255,255,255,0.04); }

#alphatab-container { background: #ffffff; color: #000; border-radius: 8px; padding: 16px; min-height: 200px; overflow-x: auto; }

footer { text-align: center; color: #555; font-size: 11px; margin-top: 40px; }
/* ===== 顶部导航 ===== */
.topnav { display: inline-flex; gap: 4px; margin-top: 14px; background: #1a1d24; padding: 4px; border-radius: 8px; border: 1px solid #262a33; }
.navbtn { background: transparent; border: none; color: #aaa; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background 0.15s, color 0.15s; font-family: inherit; }
.navbtn.active { background: #4a8cff; color: white; }
.navbtn:hover:not(.active) { color: #e6e6e6; background: rgba(255,255,255,0.04); }

/* ===== 任务 ID 直跳 ===== */
.quick-jump { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #262a33; font-size: 13px; color: #888; flex-wrap: wrap; }
.quick-jump label { white-space: nowrap; }
.quick-jump input {
  flex: 1; min-width: 180px; background: #20242c; border: 1px solid #2a2f38; color: #e6e6e6;
  padding: 8px 12px; border-radius: 6px; font-size: 13px; font-family: ui-monospace, "SF Mono", Consolas, monospace; outline: none;
  transition: border-color 0.15s;
}
.quick-jump input:focus { border-color: #4a8cff; }
.quick-jump button {
  background: #4a8cff; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: background 0.15s;
}
.quick-jump button:hover { background: #3a7ce8; }

/* ===== 历史任务列表 ===== */
.hist-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ghostbtn {
  background: transparent; border: 1px solid #2a2f38; color: #aaa; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ghostbtn:hover { color: #e6e6e6; border-color: #4a8cff; background: rgba(74,140,255,0.06); }

.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-loading { padding: 24px; text-align: center; color: #888; font-size: 13px; }
.hist-loading.err { color: #ff6b6b; }
.hist-empty { padding: 32px; text-align: center; color: #777; font-size: 13px; }

.hist-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; background: #20242c; border: 1px solid transparent; border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.hist-row:hover { border-color: #2f3540; background: #232730; }

.hist-main { flex: 1; min-width: 0; }
.hist-name { font-size: 14px; color: #e6e6e6; word-break: break-all; margin-bottom: 4px; }
.hist-sub { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: #888; }
.hist-id { font-family: ui-monospace, "SF Mono", Consolas, monospace; color: #6a7080; }
.hist-meta { color: #9aa0ad; }
.hist-err { margin-top: 6px; font-size: 12px; color: #ff8585; word-break: break-all; }

.hist-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hist-status {
  font-size: 11px; padding: 3px 8px; border-radius: 4px; background: #2a2f38; color: #aaa;
  white-space: nowrap;
}
.hist-status.status-done { background: rgba(74,222,128,0.15); color: #4ade80; }
.hist-status.status-running { background: rgba(74,140,255,0.15); color: #6ad1ff; }
.hist-status.status-queued { background: rgba(250,204,21,0.12); color: #facc15; }
.hist-status.status-error { background: rgba(255,107,107,0.15); color: #ff8585; }
.hist-pct { font-weight: 500; }

.hist-open {
  background: transparent; border: 1px solid #4a8cff; color: #6ad1ff; padding: 6px 14px; border-radius: 6px; cursor: pointer;
  font-size: 12px; transition: background 0.15s, color 0.15s;
}
.hist-open:hover { background: #4a8cff; color: white; }

@media (max-width: 640px) {
  .hist-row { flex-direction: column; align-items: stretch; }
  .hist-side { justify-content: space-between; }
}


/* ===== 重新识别歌词 ===== */
.result-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.relyrics-status { font-size: 12px; color: #9aa0ad; }
.relyrics-status.running { color: #6ad1ff; }
.relyrics-status.done { color: #4ade80; }
.relyrics-status.error { color: #ff8585; }
.ghostbtn:disabled { opacity: 0.5; cursor: not-allowed; }
