@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
  --paper: #f7f6f2;
  --panel: #fbfaf7;
  --ink: #242722;
  --muted: #898b82;
  --line: #e8e6df;
  --accent: #b84b3c;
  --accent-soft: #f3e8e3;
  --green: #6b806b;
  --radius: 5px;
  --player-h: 76px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', 'Noto Sans JP', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: calc(var(--player-h) + 28px); }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6vw;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, .92);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 35px; height: 35px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fffaf3;
  background: var(--accent);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 18px;
}
.brand-name { display: flex; flex-direction: column; font-size: 16px; font-weight: 600; letter-spacing: .04em; }
.brand-name small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .19em; }
.ghost-btn { border: 1px solid var(--line); border-radius: 99px; padding: 9px 15px; color: var(--ink); background: transparent; font-size: 13px; }
.ghost-btn:hover, .ghost-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.layout { width: min(1240px, 90vw); margin: 56px auto 70px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(38px, 7vw, 100px); align-items: start; }
.sidebar { position: sticky; top: 28px; padding: 6px 0 20px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .18em; }
.sidebar h2 { margin: 0 0 36px; font-family: 'Noto Sans JP', sans-serif; font-size: 27px; line-height: 1.55; font-weight: 500; letter-spacing: .02em; }
.search label, .filter-group > label, .filter-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.search-field { display: flex; border-bottom: 1px solid #bcbab1; transition: border-color .2s; }
.search-field:focus-within { border-color: var(--accent); }
.search input { width: 100%; min-width: 0; padding: 11px 2px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search input::placeholder { color: #aaa99f; }
.search-field button { width: 38px; border: 0; color: var(--accent); background: transparent; font-size: 22px; }
.filter-group { margin-top: 31px; }
.country-select { width: 100%; padding: 10px 30px 10px 11px; border: 1px solid var(--line); border-radius: var(--radius); outline: 0; color: var(--ink); background: var(--panel); font-size: 12px; }
.country-select:focus { border-color: #c9a39b; }
.genre-group { margin-top: 31px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; max-height: 205px; overflow: auto; }
.chip { padding: 6px 10px; border: 1px solid transparent; border-radius: 99px; color: #777970; background: #eeede7; font-size: 11px; transition: all .15s; }
.chip:hover { border-color: #ddc6c0; color: var(--accent); }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.https-toggle { display: flex; align-items: center; gap: 9px; margin-top: 28px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.https-toggle span { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #c8c6bd; border-radius: 50%; color: transparent; font-size: 10px; }
.https-toggle.active { color: var(--green); }
.https-toggle.active span { border-color: var(--green); color: white; background: var(--green); }
.sidebar-note { display: flex; align-items: center; gap: 8px; margin-top: 48px; color: #a1a197; font-size: 10px; }
.note-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.content { min-width: 0; }
.list-header { min-height: 82px; display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.list-header .eyebrow { margin-bottom: 8px; }
.list-header h1 { margin: 0; font-family: 'Noto Sans JP', sans-serif; font-size: 25px; font-weight: 500; letter-spacing: .03em; }
.list-sub { padding-bottom: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.grid { display: flex; flex-direction: column; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 88px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: background .16s;
}
.card:hover { background: rgba(255, 255, 255, .65); }
.card.playing { background: #f1efe8; }
.card-index { color: #aaa99f; font-size: 11px; font-variant-numeric: tabular-nums; }
.card-body { min-width: 0; }
.card-name { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.card-tags { margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-badges { display: flex; gap: 6px; align-items: center; }
.badge { color: #85867e; font-size: 9px; letter-spacing: .04em; }
.badge.bitrate { color: var(--green); }
.card-fav { padding: 7px; border: 0; color: #aaa99f; background: transparent; font-size: 15px; }
.card-fav:hover, .card-fav.on { color: var(--accent); }

.empty { padding: 72px 15px; color: var(--muted); text-align: center; font-size: 13px; }
.empty-icon { display: none; }
.loader { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 40px 0; color: var(--muted); font-size: 12px; }
.spinner { width: 15px; height: 15px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.player { position: fixed; z-index: 40; inset: auto 0 0; min-height: var(--player-h); display: flex; align-items: center; gap: 22px; padding: 10px max(5vw, calc((100vw - 1240px)/2)); border-top: 1px solid var(--line); background: rgba(251,250,247,.97); backdrop-filter: blur(12px); }
.p-meta { min-width: 0; flex: 1; }
.p-name { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.p-info { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.p-controls { display: flex; align-items: center; gap: 8px; }
.p-controls button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--ink); background: transparent; font-size: 16px; }
.p-controls button:hover { color: var(--accent); background: var(--accent-soft); }
.p-controls .p-play { width: 40px; height: 40px; color: #fff; background: var(--accent); font-size: 15px; }
.p-controls .p-play:hover { color: #fff; background: #a54134; }
.p-play.buffering { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.p-volume { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.p-volume input { width: 78px; accent-color: var(--accent); }
.p-actions { display: flex; align-items: center; gap: 6px; }
.p-actions button, .p-actions a { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 13px; }
.p-actions button:hover, .p-actions a:hover, #p-fav.on { border-color: var(--accent); color: var(--accent); }

.toast { position: fixed; z-index: 60; bottom: calc(var(--player-h) + 18px); left: 50%; transform: translateX(-50%); max-width: min(90vw, 560px); padding: 11px 17px; border: 1px solid #e7c9c0; border-radius: var(--radius); color: #7c352b; background: #fff8f4; box-shadow: 0 6px 24px #29241a12; font-size: 12px; }
.foot { padding: 18px 20px 24px; color: #a1a197; text-align: center; font-size: 10px; }
.foot a { color: var(--accent); }

@media (max-width: 760px) {
  :root { --player-h: 68px; }
  .topbar { min-height: 65px; padding: 0 5vw; }
  .layout { width: 90vw; margin: 29px auto 40px; grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; padding: 0; }
  .sidebar h2 { margin-bottom: 22px; font-size: 23px; }
  .sidebar h2 br { display: none; }
  .search { max-width: none; }
  .filter-group { margin-top: 22px; }
  .genre-group { margin-top: 22px; }
  .chip-row { max-height: 82px; }
  .sidebar-note { display: none; }
  .list-header { min-height: 72px; }
  .list-header h1 { font-size: 22px; }
  .card { min-height: 76px; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 12px 4px; }
  .player { gap: 10px; padding: 8px 4vw; }
  .p-volume, #p-prev, #p-next { display: none; }
  .p-actions { gap: 3px; }
  .p-actions button, .p-actions a { width: 29px; height: 29px; }
}
