/* リセットとベース */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #3b82f6;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --error-color: #ef4444;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --bg-light: #f9fafb;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background: linear-gradient(to bottom right, #eff6ff, #ffffff, #f3e8ff);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ヘッダー */
.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: bold;
}

.logo-icon {
  font-size: 2rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s;
}

.main-nav a:hover {
  color: var(--primary-color);
}

/* ドロップダウンメニュー */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  transition: color 0.3s, background 0.3s;
  border-radius: 0.25rem;
}

.nav-dropdown-toggle:hover {
  color: var(--primary-color);
  background: rgba(0, 0, 0, 0.05);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.nav-dropdown.active .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.nav-dropdown-menu a:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.nav-dropdown-menu a:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
}

.nav-dropdown-menu a:hover {
  background: var(--primary-color);
  color: white;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-name {
  color: var(--text-light);
}

/* メインコンテンツ */
.main-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* ヒーローセクション */
.hero {
  padding: 4rem 0;
  text-align: center;
}

.hero-content {
  margin-bottom: 3rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.text-highlight {
  color: var(--primary-color);
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-light);
}

/* カードグリッド */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.card-text {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* 機能セクション */
.features {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature {
  text-align: center;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.feature-text {
  color: var(--text-light);
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #7c3aed;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-logout {
  padding: 0.5rem 1rem;
  background: var(--error-color);
  color: white;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.3s;
}

.btn-logout:hover {
  background: #dc2626;
}

/* 認証ページ */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

.auth-box {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
}

.auth-title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.auth-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.auth-links {
  text-align: center;
  color: var(--text-light);
}

.auth-links a {
  color: var(--primary-color);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* アラート */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert ul {
  list-style: none;
}

.alert li {
  margin-bottom: 0.25rem;
}

/* フッター */
.site-footer {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-light);
  margin-top: 4rem;
}

/* ダッシュボード */
.dashboard,
.tracks-page,
.form-page,
.browse-page,
.playlists-page,
.playlist-detail-page {
  padding: 2rem 0;
}

.page-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-light);
  margin-bottom: 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  color: var(--text-light);
}

.quick-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section {
  margin-bottom: 3rem;
}

/* 楽曲リスト */
.tracks-list {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.track-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.track-item:last-child {
  border-bottom: none;
}

.track-info {
  flex: 1;
}

.track-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.track-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.track-plays {
  color: var(--text-light);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 1rem;
  font-size: 0.85rem;
}

.badge-secondary {
  background: var(--secondary-color);
}

.badge-warning {
  background: #f59e0b;
}

/* ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s;
}

.pagination-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination-info {
  font-weight: 500;
  color: var(--text-color);
}

/* ジャケット画像 */
.track-card-cover {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.track-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* テーブル */
.tracks-table {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.tracks-table table {
  width: 100%;
  border-collapse: collapse;
}

.tracks-table th {
  background: var(--bg-light);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

.tracks-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.tracks-table tr:last-child td {
  border-bottom: none;
}

.track-title-cell strong {
  display: block;
  margin-bottom: 0.25rem;
}

.track-title-cell small {
  color: var(--text-light);
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  text-decoration: none;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-small:hover {
  background: #2563eb;
}

.btn-danger {
  background: var(--error-color);
}

.btn-danger:hover {
  background: #dc2626;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* フォーム */
.form-box {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 700px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-help {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  display: block;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.required {
  color: var(--error-color);
}

.info-box {
  background: var(--bg-light);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

/* 検索 */
.search-box {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-input-group {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
}

.filter-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
}

/* 楽曲グリッド */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.track-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.track-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.track-card-header {
  margin-bottom: 1rem;
}

.track-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.track-card-artist {
  color: var(--text-light);
}

.track-card-description {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.track-card-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.track-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-play,
.btn-add-playlist {
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-play {
  background: var(--primary-color);
  color: white;
}

.btn-play:hover {
  background: #2563eb;
}

.btn-add-playlist {
  background: var(--bg-light);
  color: var(--text-color);
}

.btn-add-playlist:hover {
  background: var(--border-color);
}

/* プレイリストグリッド */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.playlist-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.playlist-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.playlist-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #f3f4f6;
}

.playlist-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.playlist-description {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.playlist-meta {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.playlist-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* プレイリスト詳細 */
.playlist-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.playlist-header-icon {
  font-size: 4rem;
}

.playlist-header-info {
  flex: 1;
}

.playlist-header-description {
  color: var(--text-light);
  margin: 0.5rem 0;
}

.playlist-header-meta {
  color: var(--text-light);
}

.playlist-actions-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.playlist-tracks {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.playlist-track-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.playlist-track-item:last-child {
  border-bottom: none;
}

.track-number {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
  min-width: 2rem;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
}

.btn-icon:hover {
  opacity: 0.7;
}

.back-link {
  margin-top: 2rem;
}

.back-link a {
  color: var(--primary-color);
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

/* 音楽プレイヤー */
.music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.player-info {
  flex: 1;
}

.player-title {
  font-weight: 600;
}

.player-controls {
  display: flex;
  gap: 0.5rem;
}

.player-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
}

.player-btn:hover {
  background: #2563eb;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-bottom: 1.5rem;
}

.playlist-item {
  padding: 1rem;
  background: var(--bg-light);
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.3s;
}

.playlist-item:hover {
  background: var(--border-color);
}

/* 空の状態 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .tracks-table {
    overflow-x: auto;
  }

  .playlist-header {
    flex-direction: column;
    text-align: center;
  }

  .quick-actions {
    flex-direction: column;
  }
}

/* グローバル音楽プレーヤー */
.global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.player-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 250px;
}

.player-artwork {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

#player-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

#player-default-icon {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.player-text {
  flex: 1;
}

.player-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 0.875rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.player-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.player-btn-main {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.3);
}

.player-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
}

.player-progress span {
  font-size: 0.875rem;
  min-width: 45px;
  text-align: center;
}

.player-seek {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.player-seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-volume-slider {
  width: 80px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

.player-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
}

.player-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.player-close:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: scale(1.1);
}

/* 再生回数 */
.track-plays {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-light);
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-light);
  border-radius: 0.25rem;
}

/* ハンバーガーメニュー */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 1.75rem;
  height: 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
  position: relative;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active {
  justify-content: center;
}

.mobile-menu-toggle.active span {
  position: absolute;
  top: 50%;
  left: 0;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-50%) rotate(-45deg);
}

/* ドラッグ&ドロップ */
.drag-handle {
  cursor: move;
  cursor: grab;
  padding: 0.5rem;
  color: var(--text-light);
  font-size: 1.2rem;
  user-select: none;
  transition: color 0.2s ease;
}

.drag-handle:hover {
  color: var(--primary-color);
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-ghost {
  opacity: 0.4;
  background: var(--bg-light);
}

.sortable-drag {
  opacity: 0.8;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

.playlist-track-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.playlist-track-item.sortable-chosen {
  box-shadow: var(--shadow-lg);
}

/* トラックアイテムのレイアウト調整（ドラッグハンドル対応） */
.playlist-track-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.track-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: default;
  background: white;
  width: 100%;
}

/* 削除背景（デフォルトは非表示） */
.track-delete-bg {
  display: none;
}

/* スマホ表示でのみスワイプ機能を有効化 */
@media (max-width: 768px) {
  .playlist-track-item {
    position: relative;
    overflow: hidden;
    display: block; /* スマホではblock */
  }

  .track-content {
    position: relative;
    z-index: 1;
    padding: 0.75rem;
  }

  .track-delete-bg {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100px;
    background: var(--error-color);
    color: white;
    display: flex; /* スマホでは有効化 */
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 0;
  }
}

.playlist-track-item:hover .drag-handle {
  color: var(--primary-color);
  transform: scale(1.1);
}

.playlist-header-cover {
  width: 120px;
  height: 120px;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.playlist-header-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-track-item .track-number {
  min-width: 2rem;
  text-align: center;
}

.playlist-track-item .track-info {
  flex: 1;
  min-width: 0;
}

.playlist-track-item .track-meta {
  flex-shrink: 0;
}

.playlist-track-item .track-actions {
  flex-shrink: 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
  /* ヘッダーレイアウトをモバイル用に調整 */
  .header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
  }

  .logo {
    grid-column: 1;
  }

  /* ハンバーガーメニューを表示 */
  .mobile-menu-toggle {
    display: flex;
    grid-column: 3;
  }

  /* ナビゲーションをモバイル用に調整 */
  .main-nav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 0;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    z-index: 100;
  }

  .main-nav.active {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .main-nav > a,
  .main-nav > .nav-dropdown {
    width: 100%;
    margin: 0;
  }

  .main-nav > a {
    padding: 0.875rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    display: block;
    text-decoration: none;
    color: var(--text-color);
  }

  .main-nav > a:hover {
    background: var(--bg-light);
  }

  /* ドロップダウンメニューをモバイル用に調整 */
  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-toggle {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    color: var(--text-color);
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .nav-dropdown-toggle:hover {
    background: var(--bg-light);
  }

  .nav-dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    background: #f9fafb;
    border-radius: 0;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-dropdown.active .nav-dropdown-menu {
    display: flex;
    flex-direction: column;
  }

  .nav-dropdown-menu a {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: var(--text-color);
    display: block;
  }

  .nav-dropdown-menu a:last-child {
    border-bottom: none;
  }

  .nav-dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  /* ユーザーメニュー */
  .user-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-top: 2px solid var(--border-color);
    margin: 0;
    width: 100%;
  }

  .user-menu .user-name {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: block;
    font-weight: 600;
    color: var(--text-color);
  }

  .user-menu .btn-logout {
    padding: 0.875rem 1rem;
    border-radius: 0;
    display: block;
    text-align: left;
    background: transparent;
    color: var(--error-color);
    font-weight: normal;
    text-decoration: none;
  }

  .user-menu .btn-logout:hover {
    background: #fef2f2;
  }

  /* プレーヤー */
  .player-content {
    flex-direction: column;
    gap: 1rem;
  }

  .player-track-info {
    width: 100%;
  }

  .player-progress {
    width: 100%;
  }

  .player-volume-slider {
    width: 60px;
  }

  /* ドラッグハンドル */
  .drag-handle {
    font-size: 1rem;
    padding: 0.25rem;
  }

  .playlist-track-item {
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
  }

  .track-content {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  /* スマホ表示: 楽曲情報を簡略化 */
  .track-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
  }

  .track-info.track-tap-play:active {
    background: rgba(0, 0, 0, 0.05);
  }

  /* スマホ表示: バッジと再生ボタンを非表示 */
  .playlist-tracks .track-meta,
  .playlist-tracks .track-actions,
  .playlist-tracks .track-actions .btn-icon,
  .playlist-tracks .track-actions .delete-track-btn,
  .playlist-tracks .track-actions .play-track-btn {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  /* ドラッグハンドルと曲番号は表示 */
  .drag-handle,
  .track-number {
    display: block;
  }

  .track-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .track-artist {
    font-size: 0.875rem;
    color: var(--text-light);
  }

  /* プレイリストヘッダー（モバイル） */
  .playlist-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .playlist-header-cover {
    width: 200px;
    height: 200px;
    margin-bottom: 1rem;
  }

  /* その他のレイアウト調整 */
  .container {
    padding: 0 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* グローバルプレーヤーをモバイル用に調整 */
  .global-player {
    padding: 0.75rem;
  }

  .player-content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .player-artwork {
    width: 60px;
    height: 60px;
  }

  .player-track-info {
    min-width: auto;
    flex: 1;
  }
}
