/* 微信风格节拍器样式 */
:root {
  --wechat-green: #07c160;
  --wechat-green-active: #06ad56;
  --bg-color: #f8f8f8;
  --card-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #e5e5e5;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  --border-radius: 8px;
  --transition: all 0.2s ease;
}

/* 基础重置和全局样式 */
* {
  box-sizing: border-box;
}

body {
  background: var(--bg-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 16px;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 30px;
}

/* 主容器 */
.container {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* 标题 */
h1 {
  text-align: center;
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 24px 0;
}

/* 描述区域 */
.description {
  margin-bottom: 24px;
  text-align: center;
}

.description p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* BPM控制区域 */
.bpm-control {
  margin-bottom: 32px;
  text-align: center;
}

.bpm-control label {
  display: block;
  margin-bottom: 16px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1.1rem;
}

/* 滑块样式 */
#bpm {
  width: 100%;
  height: 4px;
  margin: 16px 0;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

#bpm::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--wechat-green);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

#bpm::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--wechat-green);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

/* BPM显示区域 */
.bpm-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wechat-green);
}

/* BPM调整按钮 */
.bpm-adjust-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.bpm-adjust-btn:hover {
  background: var(--wechat-green);
  color: white;
  transform: scale(1.1);
}

.bpm-adjust-btn:active {
  transform: scale(0.95);
}

/* 播放按钮 */
.play-btn {
  background: var(--wechat-green);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 16px auto;
  display: block;
  width: 100%;
  max-width: 200px;
  box-shadow: 0 2px 4px rgba(7, 193, 96, 0.12);
  user-select: none;
}

.play-btn:hover {
  background: var(--wechat-green-active);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.2);
}

.play-btn:active {
  transform: translateY(0);
}

.play-btn.playing {
  background: #ff3b30;
}

/* 预设按钮 */
.preset-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 4px;
  min-height: 44px;
  user-select: none;
}

.preset-btn:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

/* 声音按钮 */
.sound-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 4px;
  min-height: 44px;
  user-select: none;
}

.sound-btn:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

.sound-btn.active {
  background: var(--wechat-green);
  color: white;
  border-color: var(--wechat-green);
}

/* 控制区域 */
.control-section {
  margin-bottom: 24px;
  text-align: center;
}

.control-section h2 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0 0 16px 0;
  font-weight: 600;
}

.presets, .sound-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

/* 提示区域 */
.tips {
  margin-top: 24px;
}

.tips h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.tips p {
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 480px) {
  body {
    padding: 8px;
    padding-top: 20px;
  }
  
  .container {
    padding: 16px;
    border-radius: 8px;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }
  
  .bpm-display {
    font-size: 1.2rem;
    gap: 12px;
  }
  
  .bpm-adjust-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
  
  .play-btn, .preset-btn, .sound-btn {
    font-size: 0.9rem;
    padding: 10px 20px;
    min-height: 40px;
  }
  
  .presets, .sound-options {
    gap: 6px;
  }
  
  .description {
    margin-bottom: 16px;
  }
  
  .description p {
    font-size: 0.9rem;
  }
}

/* 可访问性 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 焦点样式 */
button:focus-visible {
  outline: 2px solid var(--wechat-green);
  outline-offset: 2px;
}


/* 播放控制标题 */
#playback-heading {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0 0 16px 0;
  font-weight: 600;
  text-align: center;
}


/* h3标题居中显示 */
h3 {
  text-align: center;
}