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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: rgba(230, 230, 235, 0.5);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航 - 毛玻璃效果 */
.header {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
}

.version {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  color: #6e6e73;
}

.main-content {
  flex: 1;
  padding-bottom: 70px;
  overflow-y: auto;
}

.page {
  display: none;
  padding: 20px;
}

.page.active {
  display: block;
}

/* 歌曲库 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

.btn-add {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: none;
  color: #007aff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.empty-tip {
  text-align: center;
  color: #8e8e93;
  padding: 60px 0;
}

/* 歌曲卡片 - 毛玻璃效果 */
.song-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.song-card.playing {
  border: 2px solid #007aff;
  background: rgba(0, 122, 255, 0.08);
}

.song-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.song-info {
  flex: 1;
  overflow: hidden;
}

.song-name {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1d1d1f;
}

.song-size {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 4px;
}

.btn-delete {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  font-size: 14px;
  cursor: pointer;
}

.song-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-group label {
  font-size: 11px;
  color: #8e8e93;
}

.bpm-input {
  width: 70px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: #1d1d1f;
  font-size: 14px;
  text-align: center;
}

.bpm-input:focus {
  border-color: #007aff;
  outline: none;
}

.preview-btn-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-preview {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: #007aff;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* 播放页面 */
.player-info {
  text-align: center;
  padding: 20px 0;
}

#current-song-name {
  font-size: 22px;
  font-weight: 600;
  color: #1d1d1f;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.setting-row label {
  font-size: 16px;
  color: #1d1d1f;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-control input[type="range"] {
  width: 120px;
  accent-color: #007aff;
}

.setting-control input[type="number"] {
  width: 80px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: #1d1d1f;
  font-size: 16px;
  text-align: center;
}

.setting-control span {
  font-size: 14px;
  color: #8e8e93;
  min-width: 50px;
}

.bpm-hint {
  font-size: 12px;
  color: #8e8e93;
}

.timer-controls {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-start {
  flex: 1;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: #007aff;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.btn-start.running {
  background: #ff3b30;
}

.btn-pause {
  flex: 1;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 149, 0, 0.9);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.btn-pause.paused {
  background: #34c759;
}

.timer-display {
  text-align: center;
  margin-top: 30px;
  display: none;
}

.timer-display.active {
  display: block;
}

#timer-text {
  font-size: 56px;
  font-weight: 300;
  font-family: 'SF Pro Display', -apple-system, sans-serif;
  color: #1d1d1f;
  letter-spacing: 2px;
}

/* 底部导航 - 毛玻璃效果 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  color: #8e8e93;
}

.tab.active {
  color: #007aff;
}

.tab-icon {
  font-size: 22px;
}

/* 上传弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: #6e6e73;
  font-size: 18px;
  cursor: pointer;
}

.upload-area {
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
}

.upload-area:active {
  background: rgba(0, 0, 0, 0.03);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.upload-area p {
  color: #1d1d1f;
  font-size: 16px;
}

.upload-hint {
  color: #8e8e93;
  font-size: 14px;
  margin-top: 8px;
}

/* 提示框 */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 24px;
  border-radius: 22px;
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 300;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}
