:root {
  --bg: #f7f3ea;
  --card: #fffdf7;
  --text: #2b2f36;
  --muted: #8b8577;
  --border: #e4dcca;
  --accent: #a87b2a;
  --accent-hover: #8a641f;
  --accent-soft: #f2e7cf;
  --chip: #efe8d6;
  --hover: #f2ecdd;
  --shadow: 0 1px 3px rgba(60, 50, 20, .08);
  --placeholder: #ece5d2;
  --serif: Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
}

html[data-theme="dark"] {
  --bg: #14161d;
  --card: #1b1e26;
  --text: #e9e3d4;
  --muted: #8d91a0;
  --border: #2a2e39;
  --accent: #d2a85e;
  --accent-hover: #e0bd7e;
  --accent-soft: #2e2a20;
  --chip: #262a35;
  --hover: #232734;
  --shadow: 0 1px 3px rgba(0, 0, 0, .45);
  --placeholder: #232734;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  transition: background .25s, color .25s;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.logo {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text);
  white-space: nowrap;
}
.logo em { font-style: normal; color: var(--accent); }

.searchbar {
  flex: 1;
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
  max-height: 420px;
  overflow-y: auto;
  z-index: 30;
}
.suggest .grp {
  padding: 6px 14px 2px;
  color: var(--muted);
  font-size: 12px;
}
.suggest .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
}
.suggest .item:hover, .suggest .item.active { background: var(--hover); }
.suggest .item .n {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest .item .s { color: var(--muted); font-size: 12px; flex: none; }
.suggest .mini {
  width: 30px; height: 30px; border-radius: 6px; flex: none;
  background: var(--placeholder);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 14px; font-weight: 700;
}
.suggest .mini.cover { object-fit: cover; }

.searchbar input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}

.searchbar input:focus { border-color: var(--accent); }

.searchbar button {
  padding: 9px 24px;
  border: none;
  border-radius: 0 8px 8px 0;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  letter-spacing: 4px;
  cursor: pointer;
  transition: background .2s;
}

.searchbar button:hover { background: var(--accent); color: #fff; }

#theme-toggle {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

#theme-toggle:hover { color: var(--text); border-color: var(--muted); }

main { flex: 1; width: 100%; max-width: 1060px; margin: 0 auto; padding: 24px 20px 48px; }

.loading, .empty { text-align: center; color: var(--muted); padding: 80px 0; }

@keyframes vinyl-spin { to { transform: rotate(360deg); } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

body.home .topbar .searchbar, body.home .topbar #theme-toggle { visibility: hidden; }

.hero {
  position: relative;
  text-align: center;
  padding: 96px 20px 48px;
  max-width: 720px;
  margin: 0 auto;
  overflow: visible;
  animation: fade-up .7s ease both;
}

.hero .vinyl {
  position: absolute;
  width: 560px;
  height: 560px;
  right: -220px;
  top: -150px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      rgba(255, 255, 255, .045) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 50% 50%,
      var(--accent) 0 17%, #17181c 17.5% 82%, #101114 82.5% 100%);
  box-shadow: 0 24px 70px rgba(20, 15, 5, .28);
  opacity: .16;
  animation: vinyl-spin 36s linear infinite;
  pointer-events: none;
  z-index: -1;
}

.hero .vinyl::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 3px #d8d2c2;
}

.hero .eyebrow {
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: 14px;
  text-indent: 14px;
  color: var(--text);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .en {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 8px;
  color: var(--muted);
  margin-bottom: 26px;
}

.hero .rule, .rule {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--accent);
  margin: 0 auto 10px;
  max-width: 340px;
}

.hero .rule::before, .hero .rule::after,
.rule::before, .rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border));
}

.hero .rule::after, .rule::after { background: linear-gradient(90deg, var(--border), transparent); }
.hero .rule span, .rule span { font-size: 11px; }

.hero .tagline {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 6px;
  letter-spacing: 2px;
}

.hero .stats {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 34px;
}

.hero-search {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto 30px;
}

.hero-search input {
  flex: 1;
  padding: 10px 4px 12px;
  border: none;
  border-bottom: 2px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 19px;
  font-family: var(--serif);
  letter-spacing: 1px;
  outline: none;
  transition: border-color .25s;
}

.hero-search input:focus { border-bottom-color: var(--accent); }
.hero-search input::placeholder { color: var(--placeholder); font-size: 15px; letter-spacing: 2px; }

.hero-search button {
  padding: 12px 30px;
  border: 1.5px solid var(--text);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 6px;
  text-indent: 6px;
  cursor: pointer;
  transition: all .25s;
}

.hero-search button:hover {
  background: var(--text);
  color: var(--bg);
}

.hero-tags { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-tags button {
  padding: 5px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; letter-spacing: 1px;
  transition: all .2s;
}
.hero-tags button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 2px;
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.section-head .count { color: var(--muted); font-size: 13px; }
.section-head .more { margin-left: auto; color: var(--muted); cursor: pointer; font-size: 13px; letter-spacing: 1px; transition: color .2s; }
.section-head .more:hover { color: var(--accent); }

.page-head { text-align: center; padding: 26px 0 4px; animation: fade-up .5s ease both; }
.page-head h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 2px;
  margin: 0 0 14px;
}
.page-head .rule { max-width: 280px; }

.pcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 18px 12px;
}
.pcard { text-align: center; padding: 10px 4px; border-radius: 12px; transition: background .2s; }
.pcard:hover { background: var(--hover); }
.avatar, .pavatar, .bigavatar { object-fit: cover; }
.bigavatar {
  width: 220px; height: 220px; border-radius: 50%;
  background: var(--placeholder); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 700; color: var(--accent);
}
.pavatar {
  width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 30px; font-weight: 600;
  border: 1px solid var(--border);
}
.pcard:hover .pavatar { transform: scale(1.06); box-shadow: var(--shadow); }
.pcard .pt {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcard .ps { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tracklist { display: flex; flex-direction: column; }
.track {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 8px; border-radius: 8px;
  transition: background .15s;
}
.track:hover { background: var(--hover); }
.track .no {
  font-family: var(--serif); font-style: italic;
  color: var(--accent); font-size: 14px; width: 30px; flex: none;
  text-align: right;
}
.track .t { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.track .dots { flex: 1; border-bottom: 1.5px dotted var(--border); transform: translateY(-4px); min-width: 30px; }
.track .who { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30%; }
.track .len { color: var(--muted); font-size: 13px; flex: none; font-variant-numeric: tabular-nums; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; }

.cover-card {
  background: transparent; border: none; border-radius: 4px;
  overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.cover-card:hover { transform: translateY(-4px); }
.cover-card .cover,
.cover-card .ph { border-radius: 6px; box-shadow: 0 3px 14px rgba(40, 30, 10, .16); }
.cover-card:hover .cover, .cover-card:hover .ph { box-shadow: 0 10px 28px rgba(40, 30, 10, .28); }
.cover-card .cover {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: var(--placeholder);
}
.cover-card .ph {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--placeholder); color: var(--muted); font-size: 34px; font-weight: 700;
}
.cover-card .info { padding: 8px 10px 10px; }
.cover-card .t {
  font-weight: 600; font-size: 14px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cover-card .s {
  color: var(--muted); font-size: 12px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.row-list { display: flex; flex-direction: column; gap: 8px; }
.row-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.row-card:hover { background: var(--hover); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--placeholder); color: var(--accent);
  font-size: 22px; font-weight: 700;
}
.row-card .body { min-width: 0; flex: 1; }
.row-card .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .tail { color: var(--muted); font-size: 13px; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 3px 12px; border-radius: 999px; background: var(--chip);
  color: var(--muted); font-size: 12px;
}
.stars { color: #e8a33d; letter-spacing: 2px; }
.muted { color: var(--muted); font-size: 13px; }

.flag {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 24px; height: 24px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; cursor: pointer;
  box-shadow: var(--shadow);
}
.flag:hover { color: var(--accent); border-color: var(--accent); }
.pcard { position: relative; }
.pcard:hover .flag, .cover-card:hover .flag, .track:hover .flag { display: flex; }
.track { position: relative; }
.track .flag { top: 50%; transform: translateY(-50%); right: 6px; width: 20px; height: 20px; font-size: 10px; }

.fb-inline {
  font-size: 12px; font-weight: 400; vertical-align: middle;
  margin-left: 10px; padding: 2px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.fb-inline:hover { color: var(--accent); border-color: var(--accent); }

.fb-dlg { position: fixed; inset: 0; z-index: 60; }
.fb-dlg[hidden] { display: none; }
.fb-mask { position: absolute; inset: 0; background: rgba(10, 10, 14, .45); }
.fb-box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, 92vw); background: var(--card);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 18px 60px rgba(0, 0, 0, .3);
}
.fb-box h3 { margin: 0 0 6px; font-size: 17px; }
.fb-target {
  font-size: 13px; color: var(--muted); margin-bottom: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-box select, .fb-box textarea, .fb-box input {
  width: 100%; margin-bottom: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; outline: none;
}
.fb-box textarea { resize: vertical; }
.fb-box select:focus, .fb-box textarea:focus, .fb-box input:focus { border-color: var(--accent); }
.fb-actions { display: flex; gap: 10px; justify-content: flex-end; }
.fb-actions button {
  padding: 7px 20px; border-radius: 8px; cursor: pointer; font: inherit;
  border: 1px solid var(--border); background: transparent; color: var(--text);
}
.fb-actions .fb-send { background: var(--text); color: var(--bg); border-color: var(--text); }
.fb-actions .fb-send:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.fb-msg { color: var(--accent); font-size: 13px; min-height: 18px; margin-top: 6px; text-align: center; }

.detail-head {
  display: flex; gap: 22px; margin: 8px 0 10px; flex-wrap: wrap;
}
.detail-head .cover-box { flex: none; }
.detail-head img.bigcover {
  width: 220px; height: 220px; object-fit: cover; border-radius: 12px;
  background: var(--placeholder); box-shadow: var(--shadow);
}
.detail-head .ph.bigcover {
  width: 220px; height: 220px; border-radius: 12px; background: var(--placeholder);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 52px; font-weight: 700;
}
.detail-head .meta { flex: 1; min-width: 260px; }
.detail-head h1 { font-size: 26px; margin: 4px 0 6px; }
.detail-head .line { color: var(--muted); margin: 2px 0; }
.detail-head .line b { color: var(--text); font-weight: 600; }

table.tracks { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.tracks th, table.tracks td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
table.tracks th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.tracks tr.song { cursor: pointer; }
table.tracks tr.song:hover { background: var(--hover); }
table.tracks td.num { color: var(--muted); width: 46px; }
table.tracks td.len { color: var(--muted); width: 70px; text-align: right; }
table.tracks td.who { color: var(--muted); font-size: 13px; }

.crumb { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--accent); }
.crumb a:hover { text-decoration: underline; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 20px;
  border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 99;
}
.toast.show { opacity: .92; }

.foot {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 18px; border-top: 1px solid var(--border);
}
.foot a { color: var(--accent); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .searchbar { order: 3; flex-basis: 100%; max-width: none; }
  .hero h1 { font-size: 32px; }
  .detail-head img.bigcover, .detail-head .ph.bigcover { width: 150px; height: 150px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
}
