/* ============================================================
   Suno 风格深色主题
   ============================================================ */

:root {
  --bg-primary: #0e0e0e;
  --bg-secondary: #181818;
  --bg-card: #1f1f1f;
  --bg-hover: #2a2a2a;
  --bg-input: #161616;
  --border-color: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-tertiary: #6e6e6e;
  --accent-orange: #ff6b35;
  --accent-orange-hover: #ff8a5c;
  --accent-blue: #3b82f6;
  --success: #22c55e;
  --error: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
  color: inherit;
}

.hidden { display: none !important; }

/* 纯音乐开关 */
.instrumental-toggle {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.switch-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.switch-label input { display: none; }
.switch-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--border-color);
  transition: all 0.2s;
  flex-shrink: 0;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: all 0.2s;
}
.switch-label input:checked + .switch-track {
  background: var(--accent-orange);
}
.switch-label input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
}
.switch-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================
   生成页容器
   ============================================================ */
.generate-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 120px;
}

/* ============================================================
   顶部模式切换 Tab
   ============================================================ */
.mode-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--bg-secondary);
  border-radius: 999px;
  margin: 16px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mode-tabs::-webkit-scrollbar { display: none; }

.mode-tab {
  flex: 1;
  min-width: auto;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s;
  text-align: center;
}
.mode-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
}
.mode-tab:hover:not(.active) {
  color: var(--text-primary);
}

/* ============================================================
   输入卡片（Suno 风格）
   ============================================================ */
.input-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}

.input-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.input-card-header .title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}
.input-card-header .title .icon {
  font-size: 18px;
}
.input-card-header .chevron {
  color: var(--text-secondary);
  transition: transform 0.2s;
  font-size: 14px;
}
.input-card.collapsed .chevron {
  transform: rotate(-90deg);
}
.input-card.collapsed .input-card-body {
  display: none;
}

.input-card-body {
  padding: 0 18px 18px;
}

/* 文本输入 */
.text-input {
  width: 100%;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-primary);
  resize: none;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.text-input:focus {
  border-color: #3a3a3a;
}
.text-input::placeholder {
  color: var(--text-tertiary);
}
textarea.text-input {
  min-height: 120px;
  line-height: 1.6;
}

/* 输入标题 */
.input-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

/* 输入行（标题 + 图标输入） */
.icon-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 48px;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.icon-input-row:focus-within {
  border-color: #3a3a3a;
}
.icon-input-row .prefix-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.icon-input-row input {
  flex: 1;
  height: 100%;
  font-size: 15px;
  background: transparent;
}
.icon-input-row input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================================
   风格标签 / Tags
   ============================================================ */
.style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.style-tag {
  padding: 6px 14px;
  background: var(--bg-input);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.style-tag:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.style-tag.active {
  background: var(--accent-orange);
  color: #fff;
}

/* 风格工具按钮 */
.style-tools {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.style-tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.style-tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.style-tool-btn.magic {
  background: var(--accent-blue);
  color: #fff;
}

/* ============================================================
   时长 / MV 选择器
   ============================================================ */
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.option-row .label {
  font-size: 14px;
  color: var(--text-secondary);
}
.option-row .value {
  font-size: 14px;
  font-weight: 500;
}

.segmented-control {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}
.segmented-control button {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.segmented-control button.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================================
   上传区域
   ============================================================ */
.upload-zone {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  border: 2px dashed #333;
  transition: all 0.2s;
  cursor: pointer;
}
.upload-zone:hover {
  border-color: #555;
  background: #1a1a1a;
}
.upload-zone .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.upload-zone .upload-text {
  font-size: 14px;
  color: var(--text-secondary);
}
.upload-zone .upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.upload-preview {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.upload-preview .file-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.upload-preview .file-info {
  flex: 1;
  min-width: 0;
}
.upload-preview .file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-preview .file-size {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.upload-preview .remove-btn {
  color: var(--text-tertiary);
  font-size: 18px;
  padding: 4px;
  flex-shrink: 0;
}

.upload-progress {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.upload-progress .bar {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  margin: 10px 0 6px;
  overflow: hidden;
}
.upload-progress .bar-fill {
  height: 100%;
  background: var(--accent-orange);
  border-radius: 2px;
  transition: width 0.3s;
}
.upload-progress .text {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ============================================================
   更多选项折叠
   ============================================================ */
.more-options-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 18px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  font-size: 15px;
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.more-options-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.more-options-btn .arrow {
  transition: transform 0.2s;
}
.more-options-btn.open .arrow {
  transform: rotate(90deg);
}

/* ============================================================
   底部固定 Create 按钮
   ============================================================ */
.create-bar {
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, var(--bg-primary) 60%, transparent);
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.create-bar-inner {
  max-width: 720px;
  width: 100%;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.credit-info {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.credit-info .icon { font-size: 16px; }
.credit-info .cost { color: var(--accent-orange); }

.create-btn {
  flex: 1;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}
.create-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
}
.create-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.create-btn .icon { font-size: 20px; }

/* ============================================================
   进度弹窗（全屏遮罩）
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay .modal-content {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: modalPop 0.25s ease-out;
}
@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 进度内容 */
.progress-header {
  padding: 28px 24px 16px;
  text-align: center;
}
.progress-header .status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 32px;
  background: rgba(255, 107, 53, 0.15);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.8; }
}
.progress-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.progress-header .sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-bar-track {
  margin: 20px 24px;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange), #ffb088);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  padding: 0 24px 20px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.progress-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border-color);
}
.progress-actions button {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.btn-secondary:hover { background: #353535; }
.btn-primary {
  background: var(--accent-orange);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-orange-hover); }

/* ============================================================
   结果展示（成功）
   */
.result-cover {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-input);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-cover .play-btn-overlay {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s;
}
.result-cover .play-btn-overlay:hover {
  transform: scale(1.08);
}

.result-info {
  padding: 18px 20px;
  text-align: center;
}
.result-info .song-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-all;
}
.result-info .song-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.result-info .song-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.result-downloads {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}
.result-downloads a {
  flex: 1;
  height: 42px;
  border-radius: 999px;
  background: var(--bg-hover);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.result-downloads a:hover {
  background: #353535;
}

.result-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border-color);
}
.result-actions button {
  flex: 1;
  height: 46px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

/* ============================================================
   失败样式
   ============================================================ */
.fail-status .status-icon {
  background: rgba(239, 68, 68, 0.15);
}
.fail-reason {
  padding: 0 24px 20px;
  font-size: 13px;
  color: var(--error);
  text-align: center;
  background: rgba(239, 68, 68, 0.05);
  padding: 12px 20px;
  margin: 0 20px 20px;
  border-radius: var(--radius-md);
}

/* ============================================================
   我的音乐列表
   ============================================================ */
.music-list-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.filter-btn.active {
  background: #fff;
  color: #000;
}
.filter-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.music-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .music-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.music-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}
.music-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.music-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: var(--bg-input);
}
.music-card-cover .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}
.music-card:hover .play-overlay { opacity: 1; }
.music-card-cover .play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.music-card-cover .duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.music-card-cover .status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}
.status-badge.generating {
  background: rgba(255, 107, 53, 0.8);
  color: #fff;
}
.status-badge.success {
  background: rgba(34, 197, 94, 0.8);
  color: #fff;
}
.status-badge.failed {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}

.refresh-status-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s;
}
.refresh-status-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}
.refresh-status-btn.spinning {
  animation: spin .6s linear;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.music-card-info {
  padding: 14px 16px;
}
.music-card-info .title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-card-info .desc {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-card-info .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.music-card-info .clip-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.music-card-info .clip-dot {
  font-size: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}
.music-card-info .clip-dot:hover {
  transform: scale(1.3);
}
.music-card-info .clip-dot.active {
  color: var(--accent-purple);
  transform: scale(1.3);
}

.music-card-info .meta .mode-tag {
  padding: 3px 8px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}
.mode-inspiration { background: #fef3c7; color: #d97706; }
.mode-professional { background: #dbeafe; color: #2563eb; }
.mode-cover { background: #fce7f3; color: #db2777; }
.mode-remaster { background: #ede9fe; color: #7c3aed; }
.mode-sound_effect { background: #d1fae5; color: #059669; }


.music-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}
.action-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  transition: all 0.2s;
}
.action-icon-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.08);
}

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state .title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state .desc {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ============================================================
   分页
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.pagination button:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.pagination button.active {
  background: var(--accent-orange);
  color: #fff;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   底部播放条（预留）
   ============================================================ */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(24, 24, 24, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 40;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.player-bar.hidden { display: none; }

.player-bar .mini-cover {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-input);
  flex-shrink: 0;
}
.player-bar .mini-info {
  flex: 1;
  min-width: 0;
}
.player-bar .mini-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-bar .mini-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-bar .mini-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-bar .ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}
.player-bar .ctrl-btn.play {
  background: #fff;
  color: #000;
  width: 40px;
  height: 40px;
  font-size: 18px;
}
.player-bar .ctrl-btn:hover { background: #3a3a3a; }
.player-bar .ctrl-btn.play:hover { transform: scale(1.06); }

/* ============================================================
   Toast 提示
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  background: var(--bg-card);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
}
.toast.error { border-color: rgba(239, 68, 68, 0.4); }
.toast.success { border-color: rgba(34, 197, 94, 0.4); }
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 480px) {
  .mode-tab {
    padding: 9px 12px;
    font-size: 13px;
  }
  .create-bar { padding: 12px; bottom: 70px; }
  .create-btn { height: 52px; font-size: 15px; }
  .page-header h1 { font-size: 20px; }
}

/* ============================================================
   迷你 Tab（已有歌曲/上传音频切换）
   */
.tab-mini {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
}
.tab-mini-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ---- Range Slider ---- */
.slider-field {
  margin-bottom: 20px;
}
.slider-field:last-child {
  margin-bottom: 0;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: #c0c4cc;
}
.slider-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  min-width: 48px;
  text-align: center;
}
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--card-hover);
  outline: none;
  transition: all 0.2s;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--surface-bg);
  box-shadow: 0 0 8px var(--primary-glow);
  transition: all 0.2s ease;
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 16px var(--primary-glow);
}
.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--surface-bg);
  box-shadow: 0 0 8px var(--primary-glow);
}
.tab-mini-btn.active {
  background: var(--bg-input);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.source-panel {
  animation: fadeSlideDown 0.25s ease;
}
.source-panel.hidden { display: none; }

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hint-text {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  line-height: 1.5;
}

/* ============================================================
   字段行
   */
.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.field-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 100px;
}
.field-row .text-input { flex: 1; }

/* ---------- 模型版本选择 ---------- */
.mv-select {
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  transition: all 0.2s;
}
.mv-select:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.mv-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(115, 102, 255, 0.15);
}

/* ---------- 歌曲设置卡片 ---------- */
.song-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.song-settings .text-input {
  flex: 1;
  min-width: 200px;
}

/* ---------- 补丁：模型选择器 ---------- */
.model-version {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.mv-select {
  min-width: 80px;
}

/* ---------- 补丁：专业模式歌曲设置 ---------- */
.song-settings {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.song-settings .text-input {
  width: 100%;
  min-width: auto;
}
.song-settings .instrumental-switch {
  align-self: flex-end;
}

/* ---------- 补丁：确保滑块数值显示可见 ---------- */
.slider-row .slider-value {
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 滑块样式强化（深色模式可见） ---------- */
input[type="range"].adv-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
input[type="range"].adv-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--primary);
  cursor: pointer;
  transition: transform 0.15s;
}
input[type="range"].adv-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
input[type="range"].adv-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--card-bg);
  cursor: pointer;
}
/* 填充条效果（用渐变实现） */
input[type="range"].adv-range {
  background: linear-gradient(to right, var(--primary) var(--fill, 50%), var(--border-color) var(--fill, 50%));
}

/* ========== 列表式布局（Suno 风格） ========== */
.music-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 900px;
  margin: 0 auto;
}

.music-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: background 0.2s;
  cursor: pointer;
}

.music-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* 封面 */
.list-item-cover {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 12px;
  background: #1a1a1a center/cover no-repeat;
  flex-shrink: 0;
  overflow: hidden;
}

.list-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

.music-list-item:hover .list-play-overlay {
  opacity: 1;
}

.list-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.music-list-item.active-card {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
    border-radius: 12px;
    transition: outline 0.2s ease;
}
.music-list-item.active-card .list-play-btn {
    background: #ff6b6b;
    color: #fff;
    transform: scale(1.1);
}


.list-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 信息区 */
.list-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-item-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-item-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-name-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9a56, #ff6b9d);
  color: #fff;
  font-weight: 500;
  margin-left: 6px;
  border: none;
}

.version-tag, .type-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.15);
}

.list-item-style {
  font-size: 14px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #888;
}

/* 操作按钮区 */
.list-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.list-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.list-action-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* 更多菜单 */
.list-more-wrap {
  position: relative;
}

.list-more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #2a2a2a;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  min-width: 120px;
  display: none;
  z-index: 100;
  overflow: hidden;
}

.list-more-menu.show {
  display: block;
}

.more-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 6px 0;
}

.more-menu-item {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.more-menu-item:hover {
  background: rgba(255,255,255,0.1);
}
a.more-menu-item {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.more-menu-item:hover {
  color: inherit;
}

/* 播放中状态 */
.music-list-item.playing .list-item-title {
  color: var(--accent-orange);
}

.music-list-item.playing .list-play-btn {
  background: var(--accent-orange);
  color: #fff;
}

/* 刷新加载动画 */
.refresh-status-btn.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 640px) {
  html { zoom: 0.85; }
  /* 导航栏小屏适配 */
  .site-header { padding: 8px 10px; }
  .site-header .header-inner { gap: 10px; }
  .site-header .site-logo { font-size: 16px; }
  .site-header .site-nav a { font-size: 13px; padding: 0 4px; }
  .site-header .site-nav { gap: 4px; flex-shrink: 0; }
  .site-header .credit-badge { padding: 2px 8px; font-size: 11px; }
  .site-header .user-avatar { width: 26px; height: 26px; font-size: 12px; }
  .site-header .user-area { gap: 6px; flex-shrink: 0; }
  .site-header .user-area a { font-size: 12px; }
  .list-item-cover {
    width: 80px;
    height: 80px;
  }
  .list-item-title {
    font-size: 15px;
  }
  .list-item-style {
    font-size: 12px;
  }
  .list-item-actions {
    gap: 2px;
  }
  .list-action-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
}

/* 进度百分比 */
.progress-text {
  font-size: 12px;
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  font-weight: 500;
}

.list-item-title-row .progress-text {
  margin-left: 0;
  margin-right: auto;
}

/* 创作类型选择器 */
.creative-type-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.creative-type-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #aaa;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.creative-type-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}
.creative-type-btn.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #fff;
}
@media (max-width: 640px) {
  .creative-type-btn {
    font-size: 12px;
    padding: 8px 10px;
    min-width: 70px;
  }
}

/* ========== 分享弹窗 ========== */
.share-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.share-modal {
  width: 100%;
  max-width: 500px;
  background: #1c1c2b;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 28px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.share-modal-title {
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 24px;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
}

.share-option:active {
  opacity: 0.7;
}

.share-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(255,255,255,0.1);
}

.share-icon.qq { background: linear-gradient(135deg, #12B7F5, #0A8CFF); }
.share-icon.qzone { background: linear-gradient(135deg, #FFCE00, #FFA500); }
.share-icon.wechat { background: linear-gradient(135deg, #07C160, #00AD36); }
.share-icon.link { background: linear-gradient(135deg, #667eea, #764ba2); }

.share-cancel {
  text-align: center;
  padding: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
}

.share-cancel:active {
  background: rgba(255,255,255,0.15);
}

@media (min-width: 640px) {
  .share-mask { align-items: center; }
  .share-modal { border-radius: 20px; max-width: 420px; }
}


/* === 任务详情弹窗 === */
.task-detail-modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: maskFadeIn 0.2s ease;
}
.task-detail-modal-mask.hidden { display: none; }
@keyframes maskFadeIn { from { opacity: 0; } to { opacity: 1; } }

.task-detail-modal {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.detail-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.detail-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  transition: all 0.2s;
}
.detail-modal-close:hover { background: #eee; color: #666; }

.detail-modal-body {
  flex: 1;
  overflow-y: auto;
}

.detail-cover {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #667eea, #764ba2) center/cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-play-btn {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: all 0.2s;
}
.detail-play-btn:hover { transform: scale(1.1); }

.detail-info { padding: 20px; }

.detail-title {
  font-size: 20px;
  font-weight: 600;
  color: #222;
  margin-bottom: 10px;
}

.detail-meta {
  display: flex;
  gap: 12px;
  color: #999;
  font-size: 13px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-mode {
  padding: 2px 10px;
  background: #f0f2ff;
  color: #667eea;
  border-radius: 4px;
  font-size: 12px;
}

.detail-section { margin-bottom: 20px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.detail-style {
  padding: 12px 16px;
  background: #f8f9fc;
  border-radius: 8px;
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  word-break: break-all;
}

.detail-lyrics {
  padding: 16px;
  background: #f8f9fc;
  border-radius: 8px;
  font-size: 13px;
  color: #555;
  line-height: 2;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* 详情按钮 */
.list-detail-btn {
  padding: 4px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.list-detail-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(102,126,234,0.4);
}

@media (max-width: 480px) {
  .task-detail-modal { width: 95%; max-height: 90vh; border-radius: 12px; }
  .detail-title { font-size: 17px; }
}
