/* ============================================================
   DrumScore · 鼓谱师 — Website Design System
   与 App（iOS / Android）同一套视觉：深色 + 薄荷绿强调色
   ============================================================ */

:root {
  --bg: #0e1217;
  --bg2: #0b0f13;
  --panel: #151b23;
  --panel2: #10151b;
  --line: #232c38;
  --line2: #1a2129;
  --accent: #2fd6b0;
  --accent-dim: rgba(47, 214, 176, .12);
  --accent-line: rgba(47, 214, 176, .45);
  --blue: #3e7bfa;
  --warn: #f5a623;
  --danger: #e05a5a;
  --text: #dce4ee;
  --dim: #7d8b9d;
  --dim2: #46586c;
  --radius: 12px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(47, 214, 176, .28); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #263140; border-radius: 8px; border: 2px solid var(--bg2); }
::-webkit-scrollbar-thumb:hover { background: #33445a; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.page { padding: 32px 0 72px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 顶栏 ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  max-width: 1240px; margin: 0 auto;
  height: 58px; display: flex; align-items: center; gap: 26px;
  padding: 0 24px;
  background: rgba(14, 18, 23, .82);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.logo .mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex; align-items: center; justify-content: center;
  color: #04241c; font-size: 15px; font-weight: 800;
}
.logo small { color: var(--dim); font-weight: 400; font-size: 11px; letter-spacing: 1px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 7px 12px; border-radius: 8px; color: var(--dim); font-size: 13px;
  transition: .16s;
}
.nav-links a:hover { color: var(--text); background: #1a222c; }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }
.nav .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: 9px;
  background: #1c242e; border: 1px solid var(--line);
  color: var(--text); font-size: 13px; cursor: pointer;
  transition: .16s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: #3a4a5c; background: #222c38; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04241c; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffb4b4; border-color: rgba(224, 90, 90, .4); }
.btn.danger:hover { background: rgba(224, 90, 90, .12); border-color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.icon { padding: 7px 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.playing { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- 胶囊 / 徽章 ---------- */
.chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  background: #171f28; border: 1px solid var(--line); color: var(--dim);
  cursor: pointer; transition: .16s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #3a4a5c; }
.chip.active { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: #1b2430; color: var(--dim); border: 1px solid var(--line);
}
.badge.easy { color: #58d68d; border-color: rgba(88, 214, 141, .3); background: rgba(88, 214, 141, .1); }
.badge.medium { color: var(--warn); border-color: rgba(245, 166, 35, .3); background: rgba(245, 166, 35, .1); }
.badge.hard { color: #ff8a8a; border-color: rgba(224, 90, 90, .32); background: rgba(224, 90, 90, .1); }
.badge.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.badge.blue { color: #9db9ff; border-color: rgba(62, 123, 250, .35); background: rgba(62, 123, 250, .12); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.card.hover:hover { border-color: #3a4a5c; transform: translateY(-2px); box-shadow: var(--shadow); }
.card.hover { transition: .18s; }

.sect-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.sect-title h2 { font-size: 17px; font-weight: 700; }
.sect-title span { color: var(--dim); font-size: 12px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--dim); }
.input, select.input, textarea.input {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; font-size: 13px; outline: none; transition: .16s; width: 100%;
}
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(47, 214, 176, .1); }
.input::placeholder { color: var(--dim2); }
.input:disabled {
  background: rgba(255,255,255,.03);
  color: var(--dim);
  cursor: not-allowed;
  -webkit-text-fill-color: var(--dim);
  opacity: 1;
}

/* ---------- 首页 ---------- */
.hero { position: relative; padding: 84px 0 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -180px -80px auto -80px; height: 520px;
  background: radial-gradient(58% 60% at 50% 0%, rgba(47, 214, 176, .16), transparent 70%),
              radial-gradient(40% 50% at 82% 12%, rgba(62, 123, 250, .14), transparent 70%);
  pointer-events: none;
}
.hero .inner { position: relative; text-align: center; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px; font-size: 12px; color: var(--accent);
  background: var(--accent-dim); border: 1px solid var(--accent-line); margin-bottom: 22px;
}
.hero h1 { font-size: clamp(34px, 5.4vw, 62px); line-height: 1.12; letter-spacing: -1px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { max-width: 640px; margin: 20px auto 0; color: var(--dim); font-size: 16px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.hero .cta .btn { padding: 12px 24px; font-size: 14px; border-radius: 11px; }

.hero-shot {
  margin: 58px auto 0; max-width: 1040px;
  border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow); overflow: hidden;
  text-align: left;
}
.hero-shot .bar {
  height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: #111821; border-bottom: 1px solid var(--line);
}
.hero-shot .bar i { width: 9px; height: 9px; border-radius: 50%; background: #2b3644; }
.hero-shot .bar i:first-child { background: #e05a5a; }
.hero-shot .bar i:nth-child(2) { background: #f5a623; }
.hero-shot .bar i:nth-child(3) { background: #58d68d; }
.hero-shot .bar span { margin-left: 8px; color: var(--dim2); font-size: 11px; letter-spacing: .6px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 22px; }
.feature .ico {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--accent-dim); border: 1px solid var(--accent-line); color: var(--accent);
}
.feature.blue .ico { background: rgba(62, 123, 250, .12); border-color: rgba(62, 123, 250, .4); color: #9db9ff; }
.feature.warm .ico { background: rgba(245, 166, 35, .12); border-color: rgba(245, 166, 35, .4); color: var(--warm); }
.feature h3 { font-size: 15px; margin-bottom: 8px; }
.feature p { color: var(--dim); font-size: 13px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.step { position: relative; padding: 22px 22px 22px 64px; }
.step::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  position: absolute; left: 22px; top: 20px;
  font-size: 13px; font-weight: 800; color: var(--accent);
  width: 28px; height: 28px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); border: 1px solid var(--accent-line);
}

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px rgba(47, 214, 176, .18) inset; }
.plan .price { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.plan .price small { font-size: 13px; font-weight: 400; color: var(--dim); }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 9px; color: var(--dim); font-size: 13px; }
.plan li::before { content: "✓"; color: var(--accent); margin-right: 8px; font-weight: 700; }

/* ---------- 谱库 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { position: relative; flex: 1; min-width: 220px; }
.search .input { padding-left: 34px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--dim2); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.score-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; }
.score-card .thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(135deg, #1b2a33, #16202b 55%, #1a2333);
  display: flex; align-items: center; justify-content: center;
}
.score-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.score-card .thumb .staff-lines { position: absolute; inset: 0; opacity: .5; }
.score-card .thumb .play-fab {
  position: absolute; right: 12px; bottom: 12px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(47, 214, 176, .92); color: #04241c;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  transition: .16s;
}
.score-card:hover .play-fab { transform: scale(1.08); }
.score-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.score-card .title { font-size: 14px; font-weight: 700; }
.score-card .meta { color: var(--dim); font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score-card .stats { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line2); display: flex; gap: 14px; color: var(--dim2); font-size: 11px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; }
.pager .btn { min-width: 36px; padding: 7px 11px; }
.pager .page-info { color: var(--dim); font-size: 12px; margin: 0 8px; }

/* ---------- 编辑器 ---------- */
.editor-shell { display: flex; flex-direction: column; height: calc(100vh - 58px); overflow: hidden; max-width: 1240px; margin: 0 auto; }
.editor-top {
  height: 64px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.editor-top .title-input {
  width: 190px; background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 9px; font-size: 14px; font-weight: 600;
}
.editor-top .title-input:hover { border-color: var(--line); }
.editor-top .title-input:focus { border-color: var(--accent-line); background: var(--bg2); outline: none; }
.editor-top .group { display: flex; align-items: center; gap: 6px; padding: 0 8px; border-left: 1px solid var(--line); height: 30px; flex: none; }
.editor-top label { color: var(--dim); font-size: 11px; letter-spacing: .4px; }
.editor-top select, .editor-top input[type=number] {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 8px; font-size: 12px; outline: none;
}
.editor-top select:focus, .editor-top input:focus { border-color: var(--accent-line); }
.editor-top .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

.editor-main { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.scroller { flex: 1; overflow: auto; position: relative; }
.canvas-wrap { position: relative; width: max-content; min-width: 100%; padding: 14px 24px 22px 12px; }

.score-svg-wrap { margin-left: 8px; min-width: 0; background: #fff; border-radius: 10px; padding: 12px 14px 8px; }
.score-svg-wrap svg { display: block; width: 100%; height: auto; }
.playhead {
  position: absolute; top: 0; width: 40px; pointer-events: none; display: none;
  background: rgba(47, 214, 176, .09);
  border-left: 1px solid rgba(47, 214, 176, .55);
  border-right: 1px solid rgba(47, 214, 176, .55);
}

.grid { margin-top: 14px; margin-left: 8px; width: max-content; user-select: none; }
.grow { display: flex; align-items: stretch; }
.lab {
  position: sticky; left: 0; z-index: 3; width: 150px; flex: none;
  display: flex; align-items: center; gap: 7px; padding: 0 8px;
  background: var(--bg); font-size: 11px; color: var(--dim);
  border-right: 1px solid var(--line); white-space: nowrap;
}
.lab i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.inst-img { width: 26px; height: 16px; object-fit: contain; flex: none; border-radius: 3px; }
.cell {
  width: 40px; height: 32px; flex: none;
  border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  cursor: pointer; position: relative; background: var(--panel2);
}
.cell.alt { background: #121822; }
.cell.msep { border-left: 2px solid #2c3a4a; }
.cell.beatsep { border-left: 1px solid #2c3a4a; }
.cell:hover { box-shadow: inset 0 0 0 1px #3d5266; }
.cell.on { display: flex; align-items: center; justify-content: center; }
.cell .note {
  width: 26px; height: 20px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #04201a;
}
.cell .note.v2 { outline: 1px solid #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .35); }
.cell .note.v3 { opacity: .42; border-radius: 10px; }

.beatnum { display: flex; width: max-content; margin-left: 8px; }
.beatnum span { text-align: center; font-size: 10px; color: var(--dim2); padding: 3px 0; border-left: 1px solid var(--line2); }

.side {
  width: 232px; flex: none; background: var(--panel); border-left: 1px solid var(--line);
  padding: 14px; display: flex; flex-direction: column; gap: 14px; overflow: auto;
}
.side h3 { font-size: 11px; color: var(--dim); font-weight: 700; letter-spacing: 1.2px; margin-bottom: 8px; text-transform: uppercase; }
.sect { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.drumbtn { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--dim); }
.drumbtn:hover { background: #1c242e; color: var(--text); }
.drumbtn i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.vel { display: flex; gap: 6px; }
.vel button {
  flex: 1; padding: 7px 0; font-size: 11px; border-radius: 8px;
  background: #1c242e; border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.vel button:hover { border-color: var(--accent-line); }
.vel button.sel { background: var(--accent); color: #04241c; border-color: var(--accent); font-weight: 700; }
.side .sect .btn { width: 100%; margin-top: 6px; }

.hints {
  height: 28px; flex: none; display: flex; align-items: center; gap: 20px;
  padding: 0 16px; background: var(--panel); border-top: 1px solid var(--line);
  color: var(--dim2); font-size: 11px; overflow-x: auto; white-space: nowrap;
}
kbd {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 4px;
  padding: 0 5px; font-size: 10px; color: var(--dim);
}

/* ---------- 个人中心 ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; }
.avatar {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #04241c;
}
.profile-head h1 { font-size: 21px; }
.profile-head .sub { color: var(--dim); font-size: 12px; margin-top: 3px; }

.member-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #16302c, #14202c 60%, #17223a);
  border: 1px solid var(--accent-line);
}
.member-card::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(47, 214, 176, .22), transparent 70%);
  pointer-events: none;   /* 纯装饰光晕，不能挡住按钮的点击 */
}
.member-card .stat { display: flex; gap: 26px; margin-top: 14px; flex-wrap: wrap; }
.member-card .stat div { display: flex; flex-direction: column; gap: 2px; }
.member-card .stat b { font-size: 17px; }
.member-card .stat span { color: var(--dim); font-size: 11px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  background: none; border: none; padding: 10px 14px; font-size: 13px; color: var(--dim);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px;
}
.list-item:hover { border-color: #3a4a5c; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { color: var(--dim2); font-size: 11px; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.list-item .ops { display: flex; gap: 6px; flex: none; }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; padding: 64px 20px; color: var(--dim); }
.empty .big { font-size: 34px; margin-bottom: 12px; opacity: .7; }
.empty p { font-size: 13px; margin-bottom: 18px; }

.skeleton {
  background: linear-gradient(90deg, #151b23 25%, #1c242e 37%, #151b23 63%);
  background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 10px;
}
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 10, 14, .72); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(720px, 100%); max-height: 86vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
  transform: translateY(8px) scale(.99); opacity: 0; transition: .2s;
}
.modal-mask.show .modal { transform: none; opacity: 1; }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--panel);
}

/* ---------- 谱库详情弹层（谱面为主内容，比通用弹层更大） ---------- */
.modal.lib-detail { width: min(1180px, 96vw); max-height: 92vh; }
.lib-detail .modal-body { padding: 16px 18px; }
/* 谱面自己滚动，弹层头/底栏固定，试听时联动滚动不会带着按钮跑 */
.lib-detail .lib-score { max-height: 62vh; }

/* ---------- 谱面播放联动：当前音符高亮（谱库试听 + 编辑器转谱共用） ---------- */
/* Verovio 的符头是 <use> 引用 SMuFL 符号，实测 CSS 可覆盖其 fill */
.score-hit use { fill: #14B8A6 !important; }
.score-hit .stem, .score-hit .stem path { stroke: #14B8A6; }
.score-hit { filter: drop-shadow(0 0 2px rgba(45, 212, 168, .85)); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 74px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 360px;
  padding: 12px 16px; border-radius: 10px;
  background: #1b2632; border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn .22s ease-out;
}
.toast .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.toast.ok .dot { background: var(--accent); }
.toast.err .dot { background: var(--danger); }
.toast.warn .dot { background: var(--warn); }
.toast.out { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { transform: translateX(24px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(24px); opacity: 0; } }

/* ---------- DEMO 提示条 ---------- */
.demo-bar {
  background: rgba(245, 166, 35, .1); border-bottom: 1px solid rgba(245, 166, 35, .28);
  color: #f7c46c; font-size: 12px; padding: 7px 20px; text-align: center;
}
.demo-bar b { color: #ffd489; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line); margin-top: 70px;
  padding: 34px 0 44px; color: var(--dim2); font-size: 12px;
}
.footer .cols { display: flex; gap: 60px; flex-wrap: wrap; margin-bottom: 26px; }
.footer h4 { color: var(--dim); font-size: 12px; margin-bottom: 10px; letter-spacing: .6px; }
.footer a { display: block; color: var(--dim2); margin-bottom: 7px; }
.footer a:hover { color: var(--text); }

/* ---------- 语言切换 ---------- */
.lang-switch {
  display: inline-flex; align-items: center; padding: 2px;
  border: 1px solid var(--line); border-radius: 8px; background: #131a22;
}
.lang-switch a {
  padding: 3px 8px; border-radius: 6px; font-size: 11px; color: var(--dim2);
  letter-spacing: .4px; line-height: 1.4;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.on { background: var(--accent-dim); color: var(--accent); font-weight: 700; }

/* ---------- 独立 kicker（下载页等非 hero 场景） ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px; font-size: 12px; color: var(--accent);
  background: var(--accent-dim); border: 1px solid var(--accent-line); margin-bottom: 22px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .features, .steps, .plans { grid-template-columns: 1fr 1fr; }
  .side { width: 200px; }
}
@media (max-width: 820px) {
  .nav { gap: 12px; padding: 0 14px; }
  .nav-links a { padding: 6px 9px; font-size: 12px; }
  .nav .right .btn span { display: none; }
  .hero { padding: 54px 0 40px; }
  .features, .steps, .plans { grid-template-columns: 1fr; }
  .editor-main { flex-direction: column; }
  .side {
    width: auto; flex-direction: row; flex-wrap: wrap; border-left: none;
    border-top: 1px solid var(--line); max-height: 210px;
  }
  .side .sect { flex: 1; min-width: 150px; }
  .footer .cols { gap: 30px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .nav-links { display: none; }
  .cards { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .list-item { flex-wrap: wrap; }
}

/* ---------- 打印（只打谱面） ---------- */
@media print {
  body { background: #fff; color: #000; }
  .nav, .editor-top, .side, .hints, .footer, .demo-bar, .toast-wrap, .playhead,
  .grid, .beatnum, .editor-main .scroller > .canvas-wrap > .grid { display: none !important; }
  .editor-shell { height: auto; }
  .scroller { overflow: visible; }
  .score-svg-wrap svg { width: 100% !important; height: auto !important; }
  .score-svg-wrap { margin: 0; }
  .canvas-wrap { padding: 0; }
}

/* ---------- 小节轨道（App MeasureRailView 同款）：连续小节条、无隔断 ---------- */
.rail {
  height: 58px; flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.rail-mode { font-weight: 700; white-space: nowrap; }
.rail-mode.on { color: var(--accent); border-color: var(--accent-line); }
.rail-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; min-width: 0; }
.rail-cells {
  display: flex; align-items: stretch; height: 40px;
  border: 1px solid var(--line); border-radius: 8px; width: max-content; min-width: 100%;
}
.rail-seg {
  position: relative; flex: none; display: flex; cursor: pointer;
  background: #1a222c; overflow: hidden;
}
.rail-seg:first-child { border-radius: 7px 0 0 7px; }
.rail-seg:last-child { border-radius: 0 7px 7px 0; }
.rail-seg:hover { background: #1d2833; }
.rail-seg.sel { background: #16241f; box-shadow: inset 0 0 0 1.5px var(--accent); z-index: 1; }
.rail-seg.playing { background: #16241f; }
.rail-lines { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; }
/* 拍内的细分线比拍线短：靠底部、上端留出间距；颜色更亮保证清晰 */
.rail-lines i { flex: 1; border-left: 1px solid rgba(168,186,206,.55); margin: 8px 0 0 0; }
.rail-lines i:first-child { border-left: none; }
.rail-lines i.tall { border-left: 1px solid rgba(178,196,216,.85); margin: 0; }
.rail-lines i:first-child.tall { border-left: none; }
.rail-num {
  position: absolute; left: 4px; top: 2px; z-index: 2;
  font-size: 11px; font-weight: 700; color: var(--dim); line-height: 1;
  padding: 2px 5px; border-radius: 4px; background: rgba(10,14,18,.6);
}
.rail-seg.sel .rail-num { color: var(--accent); }
.rail-playline {
  position: absolute; top: 3px; bottom: 3px; width: 2px; z-index: 3;
  background: var(--accent); border-radius: 2px; pointer-events: none;
  box-shadow: 0 0 6px rgba(45,212,168,.7);
}
.rail-btn { flex: none; width: 34px; font-weight: 700; }

/* ---------- 谱面 loading ---------- */
.score-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 150px; color: var(--dim); font-size: 13px;
}
.score-spin, .score-loading .spin {
  width: 16px; height: 16px; flex: none; display: inline-block;
  border: 2px solid rgba(120,140,160,.35); border-top-color: #4b93c9;
  border-radius: 50%; animation: dsspin .8s linear infinite;
}
@keyframes dsspin { to { transform: rotate(360deg); } }

/* ---------- 转谱 modal ---------- */
.render-modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(6,10,14,.82);
  display: flex; flex-direction: column; padding: 26px 30px;
}
.render-bar {
  flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 22px; margin-bottom: 14px;
}
.pv-title { font-weight: 700; }
.pv-badge { display: inline-flex; align-items: center; }
.pv-sub { color: var(--dim); font-size: 12px; }
/* 循环 / 节拍器开关：开启时用主色描边 */
.pv-toggle.on { color: var(--accent); border-color: var(--accent-line); }
.render-body {
  flex: 1; overflow: auto; background: #eef1f5; border-radius: 12px; padding: 20px 24px;
}
/* A4 纸面：一页一个白块，比例与打印出来的 A4 完全一致 */
.score-page {
  background: #fff; max-width: 960px; margin: 0 auto 18px;
  border-radius: 4px; box-shadow: 0 2px 10px rgba(12, 20, 30, .16); overflow: hidden;
}
.score-page:last-child { margin-bottom: 0; }
.score-page svg { display: block; width: 100%; height: auto; }
.render-body > svg { display: block; width: 100%; height: auto; max-width: 100%; margin: 0 auto; }

/* 打印：只打印谱面（转谱 modal 打开时打 modal，否则打编辑器谱面区） */
@page { size: A4; margin: 0; }
@media print {
  .rail, .rail-scroll, .rail-cells, .render-bar, .render-modal[style*="none"], .render-modal[style*="display: none"] { display: none !important; }
}
@media print {
  /* body 全局有 min-height:100vh —— 打印时它正好等于纸张高度，与「Verovio 页高=A4 纸高」
     的谱面叠加后，任何 px→pt 舍入都会把底边顶到第 2 页（结果就是一页空白纸）。
     打印时一律清掉高度约束。 */
  html, body { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  body.render-printing > *:not(.render-modal) { display: none !important; }
  .render-modal { position: static; background: none; padding: 0; display: block !important; }
  .render-body { padding: 0; overflow: visible; background: none; }
  .score-page {
    max-width: none; margin: 0; border-radius: 0; box-shadow: none;
    /* 分页改「每页之前断」（第一页除外）：用 break-after 时，只要 .score-page 后面
       还挂着任何节点（空白文本/占位），末尾就会多出一张空白纸 */
    break-before: page; page-break-before: always;
    break-after: auto; page-break-after: auto;
  }
  .score-page:first-child { break-before: auto; page-break-before: auto; }
  /* 宽度留 0.6%（约 1.8mm）余量：谱面高度正好等于纸高时，舍入误差会让内容溢出 1px */
  .score-page svg { width: 99.4%; margin: 0 auto; }

  /* ---------- 打印水印 ----------
     让「打印 / 导出 PDF」出来的谱面带上品牌水印（屏显预览不加）。
     做法：在页面白块上盖一层平铺的 SVG 文字（data URI），绝对定位 + 不可点，
     不参与排版 → 不会撑出新的分页。print-color-adjust:exact 保证浏览器
     不把背景图当「背景」丢掉（Chrome/Safari 默认不打印背景色/图）。 */
  .score-page, .score-svg-wrap { position: relative; }
  .score-page::after, .score-svg-wrap::after {
    content: '';
    position: absolute; inset: 0; z-index: 3;
    pointer-events: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='300'%3E%3Ctext x='230' y='160' font-family='Helvetica,Arial,sans-serif' font-size='17' font-weight='600' fill='%23000000' fill-opacity='0.07' text-anchor='middle' transform='rotate(-26 230 160)'%3EDrumScore%20%20http://drumscore.me/%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    background-position: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* 轨道上的每小节速度标签（每小节可不同 BPM） */
.rail-seg .rail-bpm {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 8.5px;
  line-height: 1;
  color: var(--dim2);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.rail-seg.sel .rail-bpm { color: var(--accent); }
