:root {
  --bg: #090a0d;
  --glass: rgba(18, 20, 26, 0.88);
  --fg: #f5f5f7;
  --sub: #86868b;
  --fill: rgba(255, 255, 255, 0.08);
  --fill-hover: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.14);
  --accent: #ffffff;
  --accent-gold: #e2ba73;
  --red: #ff3b30;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  touch-action: pan-y;
}

/* 顶部悬浮控制栏 */
#bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(1040px, calc(100vw - 20px));
  padding: 8px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.back-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 16px;
  opacity: 0.6;
  padding: 0 4px;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 1;
}

#pp {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

#pp:hover {
  transform: scale(1.06);
}

#pp:active {
  background: rgba(255, 255, 255, 0.8);
}

#tm {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
}

.g {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sub);
  font-size: 12px;
}

.g b {
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.seg {
  display: inline-flex;
  background: var(--fill);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.seg button:hover {
  background: var(--fill-hover);
}

.seg button:active {
  background: var(--accent);
  color: #000;
}

#off {
  width: 58px;
  border: 0;
  background: var(--fill);
  color: var(--fg);
  border-radius: 6px;
  padding: 4px 6px;
  text-align: center;
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#off:focus {
  outline: 1px solid rgba(255, 255, 255, 0.3);
}

input[type=range] {
  accent-color: #ffffff;
  width: 80px;
}

#lt {
  color: var(--accent-gold);
  font-weight: 600;
}

.icon-btn {
  border: 0;
  background: var(--fill);
  color: var(--fg);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  margin-left: auto;
  font-size: 14px;
}

.icon-btn:hover {
  background: var(--fill-hover);
}

/* ============================================================
   QUICK JUMP DOCK (平板触控专属急救快切工具条)
   ============================================================ */
.quick-jump-dock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
  background: rgba(14, 16, 22, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
}

.dock-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--sub);
  text-align: center;
  text-transform: uppercase;
}

.dock-btn-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.jump-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 58px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.jump-btn .jump-icon {
  font-size: 14px;
  line-height: 1;
}

.jump-btn .jump-text {
  font-size: 10px;
  color: var(--sub);
  font-weight: 500;
}

.jump-btn:active {
  background: #ffffff;
  color: #000000;
  transform: scale(0.95);
}

.jump-btn:active .jump-text {
  color: #000000;
}

.jump-btn.highlight {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.jump-btn.highlight:active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

/* 乐谱主容器 */
#sc {
  padding-top: 86px;
  padding-bottom: 85vh;
  width: min(1060px, calc(100vw - 20px));
  margin: 0 auto;
}

.pg {
  position: relative;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
  background: #fff;
  transition: filter 0.3s ease;
}

.pg img {
  width: 100%;
  display: block;
}

/* 负片护眼模式 */
body.invert-mode .pg {
  background: #000;
}
body.invert-mode .pg img {
  filter: invert(0.92) hue-rotate(180deg) contrast(1.15) brightness(0.95);
}

/* 小节选区与游标 */
.b {
  position: absolute;
  cursor: pointer;
  touch-action: manipulation;
}

.b:hover, .b:active {
  background: rgba(255, 255, 255, 0.12);
}

.b.cur {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

.b.loop {
  box-shadow: inset 0 -4px #ffffff;
}

/* 音符光标红线 */
.nc {
  position: absolute;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--red);
  pointer-events: none;
  z-index: 10;
  display: none;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.9);
}

@media (max-width: 800px) {
  #bar {
    gap: 8px;
    padding: 6px 12px;
    border-radius: 18px;
  }
  #hint {
    display: none;
  }
  #sc {
    padding-top: 130px;
  }
  .quick-jump-dock {
    bottom: 15px;
    right: 15px;
    padding: 6px 8px;
  }
  .jump-btn {
    min-width: 52px;
    height: 44px;
    padding: 6px 8px;
  }
}
