/**
 * [INPUT]: 依赖 index.html 的电平表/回放控件结构与 app.js 写入的电平、播放状态
 * [OUTPUT]: 对外提供 dBFS 电平条、一键播放按钮、播放进度与主按钮播放态样式
 * [POS]: assets 模块的录音控制视觉层，补充 styles.css 而不承载业务逻辑
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */

.level-panel {
  position: relative;
  z-index: 2;
  margin: -8px 0 24px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.level-heading,
.level-heading > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.level-heading > span {
  justify-content: flex-start;
}

.level-heading strong {
  font-size: 13px;
}

.level-heading small,
.level-note,
.level-scale {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

.level-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.level-meter {
  position: relative;
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.level-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #56d8be 0 58%, #f0c95a 78%, #fb7299 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 80ms linear;
}

.level-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.level-note {
  margin: 9px 0 0;
  line-height: 1.55;
}

.playback-action {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  margin-top: 20px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  text-align: left;
}

.playback-label {
  font-size: 16px;
  font-weight: 760;
}

.playback-time {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.playback-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--pink);
}

.playback-action[data-playing="true"] .playback-icon {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, var(--pink) 0 34%, transparent 34% 66%, var(--pink) 66% 100%);
}

.playback-progress {
  height: 3px;
  margin: 10px 4px 0;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.playback-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pink);
  transition: width 100ms linear;
}

.primary-action[data-mode="play"] .button-icon {
  width: 0;
  height: 0;
  border-radius: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  background: transparent;
}

.primary-action[data-mode="pause"] .button-icon {
  width: 11px;
  height: 12px;
  border-radius: 0;
  background: linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66% 100%);
}

@media (max-width: 420px) {
  .level-heading > span {
    display: grid;
    gap: 3px;
  }

  .playback-action {
    grid-template-columns: 20px 1fr;
  }

  .playback-time {
    grid-column: 2;
  }
}
