/* ===== BPM 与延迟 · 节拍时间轴 ===== */
.bpm {
    background: #fafafb;
    border: 1px solid #e4e4ea;
    border-radius: 12px;
    padding: 24px 22px;
    margin-bottom: 26px;
    box-shadow: 0 10px 30px rgba(30, 30, 50, .07);
}

.bpm-stage {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    align-items: stretch;
}

/* ---- 时间轴 ---- */
.bpm-timeline {
    background: #14151c; border: 1px solid #262833; border-radius: 10px;
    padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 9px;
    position: relative; overflow: hidden;
}
.bpm-timeline::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(90% 70% at 15% 0%, rgba(74, 222, 128, .1), transparent 65%);
    pointer-events: none;
}
.bpm-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font: 700 9.5px/1.4 ui-monospace, monospace; color: #6b7280;
    position: relative; z-index: 1;
}
.bpm-head b { color: #4ade80; }
.bpm-ruler {
    position: relative; height: 26px; border-bottom: 1px solid #2a2d3a;
    display: flex;
}
.bpm-beat {
    flex: 1 1 0; border-left: 1px solid #2a2d3a;
    font: 700 8.5px/1 ui-monospace, monospace; color: #4b5563;
    padding: 2px 0 0 3px; position: relative;
}
.bpm-beat:last-child { border-right: 1px solid #2a2d3a; }
.bpm-beat.accent { background: rgba(74, 222, 128, .06); }
.bpm-beat.accent::after {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
    background: #4ade80;
}
.bpm-rows { display: flex; flex-direction: column; gap: 7px; position: relative; z-index: 1; }
.bpm-row { display: grid; grid-template-columns: 62px 1fr 56px; align-items: center; gap: 8px; }
.bpm-row > span {
    font: 700 8.5px/1.2 ui-monospace, monospace; color: #6b7280; white-space: nowrap;
}
.bpm-row > b {
    font: 700 9px/1 ui-monospace, monospace; color: #9ca3af; text-align: right;
}
.bpm-lane { position: relative; height: 14px; background: rgba(255, 255, 255, .04); border-radius: 3px; }
.bpm-bar {
    position: absolute; left: 0; top: 1px; bottom: 1px; border-radius: 3px;
    transition: width .35s;
}
.bpm-bar.c1 { background: linear-gradient(90deg, #4ade80, #16a34a); }
.bpm-bar.c2 { background: linear-gradient(90deg, #38bdf8, #2563eb); }
.bpm-bar.c3 { background: linear-gradient(90deg, #fbbf24, #d97706); }
.bpm-bar.c4 { background: linear-gradient(90deg, #f472b6, #db2777); }
.bpm-bar.c5 { background: linear-gradient(90deg, #a78bfa, #7c3aed); }

/* ---- 读数 ---- */
.bpm-read {
    background: #fff; border: 1px solid #e4e4ea; border-radius: 10px;
    padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
}
.bpm-big small { font-size: 10px; color: #8b8ba3; letter-spacing: .05em; display: block; }
.bpm-big b {
    font: 700 38px/1 ui-monospace, Consolas, monospace; color: #16a34a;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.bpm-big b em { font-style: normal; font-size: 11px; color: #8b8ba3; font-weight: 400; }
.bpm-big i {
    font-style: normal; font-size: 10.5px; font-weight: 700; margin-left: 8px;
    padding: 4px 9px; border-radius: 4px; vertical-align: middle;
    background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0;
}

.bpm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bpm-card {
    background: #f8f9fb; border: 1px solid #e9eaf0; border-radius: 7px; padding: 8px 10px;
}
.bpm-card span { display: block; font-size: 9.5px; color: #8b8ba3; }
.bpm-card b {
    font: 700 14px/1.35 ui-monospace, monospace; color: #1f2937;
    font-variant-numeric: tabular-nums;
}
.bpm-card b em { font-style: normal; font-size: 9px; color: #8b8ba3; font-weight: 400; }

/* ---- 时值表 ---- */
.bpm-table { margin-top: 18px; border-top: 1px solid #e4e4ea; padding-top: 14px; }
.bpm-table head { display: block; }
.bpm-table-head {
    display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px;
}
.bpm-table-head span { font-size: 11px; font-weight: 700; color: #47475f; letter-spacing: .05em; }
.bpm-table-head i { font-style: normal; font-size: 10px; color: #a3a3b8; }
.bpm-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.bpm-note {
    display: flex; align-items: baseline; justify-content: space-between;
    background: #fff; border: 1px solid #e9eaf0; border-radius: 6px;
    padding: 7px 10px;
}
.bpm-note span { font-size: 10px; color: #6b6b85; }
.bpm-note b { font: 700 12px/1.3 ui-monospace, monospace; color: #111827; }
.bpm-note.hl { border-color: #bbf7d0; background: #f0fdf4; }
.bpm-note.hl b { color: #15803d; }

/* ---- 参数 ---- */
.bpm-params { margin-top: 18px; border-top: 1px solid #e4e4ea; padding-top: 15px; }
.bpm-params h2 { font-size: 12px; letter-spacing: .07em; color: #47475f; margin: 0 0 11px; }
.bpm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.bpm-grid label { display: flex; flex-direction: column; gap: 4px; }
.bpm-grid span { font-size: 10.5px; color: #8b8ba3; }
.bpm-grid input, .bpm-grid select {
    font: inherit; font-size: 12px; padding: 7px 9px; border: 1px solid #e4e4ea;
    border-radius: 5px; background: #fff; color: #1f2937; font-variant-numeric: tabular-nums;
    min-width: 0;
}
.bpm-grid input:focus, .bpm-grid select:focus { outline: 2px solid rgba(22, 163, 74, .14); border-color: #16a34a; }
.bpm-grid input.is-bad { border-color: #dc2626; background: #fff1f2; }

.bpm-verdict {
    margin: 15px 0 0; padding: 10px 13px; border-radius: 8px;
    font-size: 11.5px; line-height: 1.7; color: #14532d; background: #f2fdf5;
    border-left: 3px solid #22c55e;
}
.bpm-verdict.bad { color: #9f1239; background: #fff5f7; border-left-color: #e11d48; }

@media (max-width: 880px) {
    .bpm-stage { grid-template-columns: 1fr; }
    .bpm-grid { grid-template-columns: 1fr 1fr; }
    .bpm-notes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .bpm { padding: 16px 13px; }
    .bpm-grid { grid-template-columns: 1fr; }
    .bpm-cards { grid-template-columns: 1fr; }
    .bpm-big b { font-size: 30px; }
    .bpm-row { grid-template-columns: 54px 1fr; }
    .bpm-row > b { display: none; }
}

/* ---- 深色 ---- */
[data-theme="dark"] .bpm { background: #0d0e12; border-color: #262832; box-shadow: none; }
[data-theme="dark"] .bpm-read { background: #13141a; border-color: #262832; }
[data-theme="dark"] .bpm-big b { color: #4ade80; }
[data-theme="dark"] .bpm-big small, [data-theme="dark"] .bpm-card span, [data-theme="dark"] .bpm-grid span, [data-theme="dark"] .bpm-note span { color: #8b8ba3; }
[data-theme="dark"] .bpm-card { background: #181920; border-color: #262832; }
[data-theme="dark"] .bpm-card b { color: #e5e7eb; }
[data-theme="dark"] .bpm-table { border-color: #262832; }
[data-theme="dark"] .bpm-table-head span { color: #d1d5db; }
[data-theme="dark"] .bpm-note { background: #13141a; border-color: #262832; }
[data-theme="dark"] .bpm-note b { color: #e5e7eb; }
[data-theme="dark"] .bpm-note.hl { background: rgba(22, 163, 74, .12); border-color: rgba(74, 222, 128, .3); }
[data-theme="dark"] .bpm-note.hl b { color: #6ee7b7; }
[data-theme="dark"] .bpm-params { border-color: #262832; }
[data-theme="dark"] .bpm-params h2 { color: #d1d5db; }
[data-theme="dark"] .bpm-grid input, [data-theme="dark"] .bpm-grid select { background: #13141a; border-color: #262832; color: #e5e7eb; }
[data-theme="dark"] .bpm-verdict { background: rgba(34, 197, 94, .1); color: #bbf7d0; }
[data-theme="dark"] .bpm-verdict.bad { background: rgba(190, 18, 60, .12); color: #fda4af; }
