/* 180跑步音乐编辑 · 网页版样式
   设计基调：浅色工作台 + 运动感橙红强调色，卡片式布局，桌面/移动自适应 */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --ink: #101a2c;
  --muted: #64708a;
  --line: #e6eaf2;
  --brand: #ff5a28;
  --brand-2: #ff9a3d;
  --brand-grad: linear-gradient(135deg, #ff5a28, #ff9a3d);
  --brand-soft: #fff3ec;
  --brand-line: #ffc3ab;
  --brand-ink: #d6420f;
  --danger: #e5484d;
  --ok: #16a34a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 26, 44, 0.04), 0 8px 24px rgba(16, 26, 44, 0.06);
  --shadow-lift: 0 4px 12px rgba(16, 26, 44, 0.1), 0 16px 40px rgba(16, 26, 44, 0.12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255, 154, 61, 0.1), transparent 60%),
    radial-gradient(700px 380px at -10% 0%, rgba(255, 90, 40, 0.06), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

/* ---- 顶部导航 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  flex: none;
  display: block;
  box-shadow: 0 4px 12px rgba(255, 90, 40, 0.35);
}

.brand-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.2px; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.nav { display: flex; gap: 6px; align-items: center; }

/* 条幅广告位（站点标题下方；大陆访客隐藏） */
.ad-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  margin: 14px auto 0;
}
.ad-banner[hidden] { display: none; }

/* Monetag 广告脚本会把 iframe 以 fixed 定位钉在右上角（挂在 <html> 下），
   这里覆盖为左上角展示 */
html > iframe {
  left: 0 !important;
  right: auto !important;
}

/* 语言选择框（顶栏，标题右侧） */
.lang-select {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  flex: none;
  transition: all 0.12s ease;
}
.lang-select:hover { border-color: #c6cede; color: var(--ink); }
.lang-select:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 40, 0.12); }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14.5px;
  transition: all 0.15s ease;
}
.nav-link:hover { color: var(--ink); background: #eef1f7; }
.nav-link.on {
  color: #fff;
  background: var(--ink);
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.nav-link.on .nav-badge { background: var(--brand); }

/* ---- 页面骨架 ---- */
main { flex: 1; padding: 32px 0 56px; }

.page-head { margin: 4px 2px 24px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: 0.2px; }
.page-head p { margin: 0; color: var(--muted); }

.edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px;
  align-items: start;
}
.edit-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---- 卡片与步骤 ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.step-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.step-no {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.step-sub { color: var(--muted); font-size: 12.5px; margin-inline-start: auto; }

.card.is-disabled { opacity: 0.45; }
.card.is-disabled .vol-row { pointer-events: none; }

/* ---- 导入区 ---- */
#importCard { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
#importCard.dragover { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 90, 40, 0.12), var(--shadow); }
#importCard.is-loading { min-height: 260px; display: flex; flex-direction: column; justify-content: center; }

.dropzone {
  width: 100%;
  min-height: 240px;
  border: 2px dashed #d3dae8;
  border-radius: 14px;
  background: #fafbfd;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  cursor: pointer;
  font: inherit;
  transition: all 0.15s ease;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.dz-main { font-size: 15.5px; font-weight: 600; color: inherit; }
.dz-sub { font-size: 12.5px; color: var(--muted); }

.import-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  padding: 40px 0;
}

.file-block { display: flex; flex-direction: column; gap: 14px; }
.file-row { display: flex; align-items: center; gap: 12px; }
.file-ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.file-meta { min-width: 0; flex: 1; }
.file-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sub { color: var(--muted); font-size: 12.5px; }

.bpm-show {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff6f0, #fdf1fb00);
  border: 1px solid var(--brand-line);
}
.bpm-show.is-zero { background: #f6f7fa; border-color: var(--line); }
.bpm-num {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bpm-show.is-zero .bpm-num { color: var(--muted); background: none; -webkit-text-fill-color: var(--muted); }
.bpm-unit { color: var(--muted); font-size: 13px; }

/* BPM 行右侧的原曲播放/暂停按钮 */
.src-play-btn {
  margin-inline-start: auto;
  align-self: center;
  color: var(--brand-ink);
  background: #fff;
  border: 1.5px solid var(--brand-line);
}
.src-play-btn:hover { background: var(--brand-soft); }

.wave {
  width: 100%;
  height: 96px;
  display: block;
  border-radius: 10px;
  background: #fafbfd;
}

/* ---- 芯片 / 输入 ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip:hover { border-color: #c6cede; color: var(--ink); }
.chip.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.field-inline { display: flex; align-items: center; gap: 8px; }
.num-input {
  width: 110px;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.num-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 40, 0.12); }
.unit { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.hint { color: #9aa4bb; font-size: 12.5px; margin-inline-start: auto; }

/* ---- 音色 ---- */
.drum-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.drum-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 6px 12px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.drum-pill:hover { border-color: #c6cede; color: var(--ink); transform: translateY(-1px); }
.drum-pill.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
  box-shadow: 0 0 0 3px rgba(255, 90, 40, 0.1);
}

/* ---- 音量 ---- */
.vol-row { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.vol-row input[type="range"] {
  flex: 1;
  height: 6px;
  accent-color: var(--brand);
  cursor: pointer;
}
.vol-val {
  min-width: 48px;
  text-align: end;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---- 模式 ---- */
.mode-list { display: flex; flex-direction: column; gap: 10px; }
.mode-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: all 0.12s ease;
}
.mode-item:hover { border-color: #c6cede; }
.mode-item.on {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.mode-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c6cede;
  margin-top: 2px;
  flex: none;
  position: relative;
  transition: border-color 0.12s ease;
}
.mode-item.on .mode-radio { border-color: var(--brand); }
.mode-item.on .mode-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand-grad);
}
.mode-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mode-title { font-weight: 700; font-size: 14.5px; }
.mode-desc { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 11px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 90, 40, 0.35);
}
.btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 90, 40, 0.42); }
.btn-primary:not(:disabled):active { transform: translateY(0); }

.btn-xl { width: 100%; padding: 15px 20px; font-size: 16.5px; border-radius: 14px; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn-ghost:not(:disabled):hover { border-color: #c6cede; color: var(--ink); background: #fff; }

.btn-outline {
  background: #fff;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: #fff; }

.btn-danger-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--danger);
}
.btn-danger-ghost:not(:disabled):hover { border-color: var(--danger); background: #fdf1f1; }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: all 0.12s ease;
}
.icon-btn:hover { background: #eef1f7; color: var(--ink); }
.del-btn:hover { background: #fdeeee; color: var(--danger); }

/* ---- 处理进度与结果 ---- */
.adjust-area { display: flex; flex-direction: column; gap: 12px; }

.stage-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 2px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--brand-line);
  border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
  flex: none;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 13px;
  background: #ecfdf3;
  border: 1px solid #b7ebc6;
  color: #12653a;
  font-size: 14px;
}
.result-strip .result-ic { color: var(--ok); display: inline-flex; }
.result-txt { flex: 1; min-width: 200px; font-weight: 600; }
.result-ops { display: flex; gap: 8px; }

/* ---- 导出页 ---- */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
  position: relative;
}
.sel-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.sel-all.is-disabled { opacity: 0.45; pointer-events: none; }
.sel-info { color: var(--muted); font-size: 14px; }
.sel-info b { color: var(--ink); font-variant-numeric: tabular-nums; }
.toolbar-spacer { flex: 1; }

.checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #c6cede;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  color: transparent;
  transition: all 0.12s ease;
}
.checkbox:hover { border-color: var(--brand); }
.checkbox.checked {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
}

.progress-track {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #edf0f6;
  overflow: hidden;
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 10px;
}
.progress-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-grad);
  transition: width 0.15s ease;
}

.result-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  border-color: #b7ebc6;
  background: #f2fdf6;
}
.result-card .result-ic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #d8f5e3;
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.result-meta { flex: 1; min-width: 220px; }
.result-name { font-weight: 700; font-variant-numeric: tabular-nums; }
.result-sub { color: var(--muted); font-size: 12.5px; }

/* ---- 歌曲列表 ---- */
.song-list { display: flex; flex-direction: column; gap: 8px; }

.song-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
  touch-action: pan-y;
}
.song-row:hover { box-shadow: var(--shadow-lift); }
.song-row.playing { border-color: var(--brand-line); background: #fffaf7; }

.drag-handle {
  color: #b3bccf;
  cursor: grab;
  display: inline-flex;
  padding: 8px 4px;
  margin: -8px -4px;
  flex: none;
  touch-action: none;
}
.drag-handle:hover { color: var(--muted); }
.song-row.dragging {
  z-index: 5;
  position: relative;
  box-shadow: var(--shadow-lift);
  border-color: var(--brand-line);
  cursor: grabbing;
}
body.row-dragging { cursor: grabbing; user-select: none; }
body.row-dragging .song-row { transition: none; }

.song-main { flex: 1; min-width: 0; position: relative; }
.song-name {
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge {
  padding: 1.5px 9px;
  border-radius: 999px;
  background: #eef1f7;
  color: #5b6780;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.badge-primary { background: var(--brand-soft); color: var(--brand-ink); }

.song-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  overflow: hidden;
  display: none;
}
.song-row.playing .song-progress { display: block; background: #f1e3da; }
.song-progress i {
  display: block;
  height: 100%;
  background: var(--brand-grad);
  border-radius: 999px;
}

.song-dur {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.play-btn { color: var(--brand-ink); }
.play-btn:hover { background: var(--brand-soft); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 64px 20px;
  color: var(--muted);
  text-align: center;
}
.empty-state .icon { color: #c3cbdc; }
.empty-title { font-weight: 700; font-size: 16px; color: var(--ink); }
.empty-sub { font-size: 13.5px; }
.empty-state .btn { margin-top: 10px; }

.tip { text-align: center; color: #9aa4bb; font-size: 12.5px; margin: 18px 0 0; }

/* ---- Toast / 模态 ---- */
.toast-wrap {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  max-width: min(480px, 90vw);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-err { background: var(--danger); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16, 26, 44, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-lift);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}
.modal-overlay.show .modal { transform: none; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.modal-content { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- 页脚 / 杂项 ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: #9aa4bb;
  font-size: 12.5px;
  text-align: center;
}

/* ICP 备案号（工信部要求：链接至 beian.miit.gov.cn） */
.icp-link {
  display: inline-block;
  margin-top: 6px;
  color: #9aa4bb;
  font-size: 12px;
  text-decoration: none;
  letter-spacing: 0.3px;
}
.icp-link:hover { color: var(--muted); text-decoration: underline; }

/* 静态 FAQ 文案区（SEO，页脚上方） */
.seo-section { padding-bottom: 8px; }
.seo-section h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 34px 0 14px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.faq-item h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
}
.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- 响应式 ---- */
@media (max-width: 1000px) {
  .edit-grid { grid-template-columns: 1fr; }
  .drum-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 640px) {
  main { padding: 20px 0 40px; }
  .brand-sub { display: none; }
  .page-head h1 { font-size: 22px; }
  .card { padding: 16px; }
  .drum-grid { grid-template-columns: repeat(3, 1fr); }
  .bpm-num { font-size: 42px; }
  .toolbar { padding-bottom: 26px; }
  .progress-track { left: 16px; right: 16px; }
  .song-dur { display: none; }
}
