/* ============================================================================
 * public/sfx.css —— 点击音效：入口卡 + 底部设置弹层（2026-09-17 · 开发员17号）
 *
 * 独立文件、排在 style.css 之后加载（铁律：改别人的样式别动 style.css）。
 * 入口卡复用站内 `.func-card row` 的既有样式，这里只写弹层。
 * ========================================================================== */

/* ---- 遮罩：默认 display:none，靠 .on 显示（别用 hidden 属性 ——
       会被 open 时的 display 覆盖掉，这是本项目踩过的坑）---- */
.sfx-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(30, 20, 12, 0.38);
  -webkit-tap-highlight-color: transparent;
}
.sfx-mask.on { display: block; animation: sfxFade 0.18s ease both; }
@keyframes sfxFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- 弹层：从底部升起 ---- */
.sfx-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9001;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(58, 42, 30, 0.16);
}
.sfx-sheet.on { display: block; animation: sfxUp 0.22s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes sfxUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* 弹层打开时锁住背景滚动（否则手指滑动会带着页面跑） */
body.sfx-lock { overflow: hidden; }

/* ---- 标题行 + 开关 ---- */
.sfx-sh-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sfx-sh-hd b {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
}

.sfx-sh-tip {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text2);
}

/* ---- iOS 风格开关（自绘，不依赖任何库）---- */
.sfx-sw {
  flex: 0 0 auto;
  position: relative;
  width: 46px;
  height: 27px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #e6dcd3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease;
}
.sfx-sw i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}
.sfx-sw.on { background: var(--primary); }
.sfx-sw.on i { transform: translateX(19px); }
.sfx-sw:active i { width: 23px; }          /* 按下时拉长一点，手感像真的 */

/* ---- 音色：只有名字（用户明确不要描述）---- */
.sfx-sh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 15px 0 20px;
}
.sfx-chip {
  flex: 1 1 auto;
  min-width: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(240, 120, 60, 0.2);
  border-radius: 13px;
  background: var(--chip-bg);
  color: #8a5a3a;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sfx-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.sfx-chip:active { transform: scale(0.97); }

/* ---- 完成 ---- */
.sfx-sh-done {
  display: block;
  width: 100%;
  padding: 13px 0;
  border: none;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 16px rgba(249, 89, 1, 0.26);
}
.sfx-sh-done:active { opacity: 0.9; }

/* ---- 平板 / 桌面：弹层居中限宽，别铺满整个屏幕 ---- */
@media (min-width: 768px) {
  .sfx-sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 420px;
    transform: translate(-50%, -50%);
    border-radius: 22px;
    padding-bottom: 20px;
  }
  .sfx-sheet.on { animation: sfxPop 0.2s ease both; }
  @keyframes sfxPop {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
}
