/* 声音设置面板：音频处理开关 + 输入电平表
 * 单独成文件，避免被旧 service worker 缓存（旧策略会忽略 ?v= 参数）
 */

/* 麦克风 / 扬声器两列，音频处理单独占满一行 */
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fx-field {
  grid-column: 1 / -1;
}

.fx-title {
  display: block;
  margin-bottom: 6px;
}

.fx-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.fx-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .38);
  background: rgba(255, 255, 255, .78);
  color: var(--text, #14213d);
  font: inherit;
  font-weight: 760;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

button.fx-chip:hover {
  border-color: rgba(47, 109, 246, .5);
}

button.fx-chip:active {
  transform: translateY(1px);
}

button.fx-chip.active {
  background: var(--accent, #2f6df6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 109, 246, .28);
}

button.fx-chip:focus-visible {
  outline: 2px solid rgba(47, 109, 246, .55);
  outline-offset: 2px;
}

/* 输入电平表 */
.level-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  font-weight: 760;
}

.level-meter {
  position: relative;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg, #22c55e, #facc15, #ef4444);
}

.level-mask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: #cfd6df;
}

.level-peak {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #0f172a;
  opacity: .9;
  z-index: 2;
}

body.dark button.fx-chip {
  background: rgba(30, 41, 59, .72);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, .34);
}

body.dark button.fx-chip.active {
  background: var(--accent, #2f6df6);
  color: #fff;
}

body.dark .level-mask { background: #334155; }
body.dark .level-peak { background: #f8fafc; }

@media (max-width: 720px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .level-line {
    grid-template-columns: 72px minmax(0, 1fr) 54px;
    gap: 8px;
  }
}
