/* ==========================================================================
   星屿手记 · 基础样式（全站共用）
   1. 设计变量 / 主题
   2. 重置与排版
   3. 通用小组件（图标、按钮、玻璃面板）
   4. 顶部导航
   5. 左侧图标栏
   6. 页面骨架
   7. 侧边栏通用模块
   8. 页脚 / 悬浮按钮 / 移动端导航
   9. 弹窗 / 轻提示
   10. 分页 / 空状态 / 页头
   11. 响应式
   ========================================================================== */

/* SECTION: tokens */
:root{
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 24px;
  --glass-bg: rgba(255,255,255,0.72);
  --glass-bg-hover: rgba(255,255,255,0.92);
  --glass-border: rgba(255,140,158,0.20);
  --glass-shadow: 0 8px 32px rgba(31,38,135,0.10), 0 2px 8px rgba(255,140,158,0.15);
  --glass-shadow-accent: 0 10px 34px rgba(255,140,158,0.22), 0 2px 8px rgba(255,140,158,0.25);
  --text-primary: #4a4a68;
  --text-secondary: #6b6b88;
  --text-tertiary: #9494a8;
  --accent-primary: #ff8fa3;
  --accent-light: #ffc5d0;
  --accent-pale: #ffeef2;
  --border-divider: rgba(255,140,158,0.12);
  --page-bg: linear-gradient(165deg,#fdf3f6 0%,#f3eefa 45%,#eaf0fb 100%);
  --chip-bg: rgba(255,255,255,0.70);
  --img-fallback: linear-gradient(135deg,#ffd9e2,#ded7f7);
  --header-h: 88px;
}
html.dark{
  --glass-bg: rgba(38,38,70,0.72);
  --glass-bg-hover: rgba(45,45,80,0.92);
  --glass-border: rgba(255,255,255,0.10);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  --glass-shadow-accent: 0 10px 34px rgba(255,140,158,0.18), 0 2px 8px rgba(0,0,0,0.30);
  --text-primary: #f2f2ff;
  --text-secondary: #dcdcf0;
  --text-tertiary: #a9a9cd;
  --accent-primary: #ffa0b4;
  --accent-light: #ffb8c4;
  --accent-pale: #3a3a5e;
  --border-divider: rgba(255,140,158,0.10);
  --page-bg: linear-gradient(165deg,#151531 0%,#1a1a3a 50%,#222244 100%);
  --chip-bg: rgba(45,45,80,0.80);
  --img-fallback: linear-gradient(135deg,#40325a,#2b2b52);
}

/* SECTION: reset */
*,*::before,*::after{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI",system-ui,-apple-system,sans-serif;
  color: var(--text-primary);
  background: var(--page-bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .3s ease;
}
body::before{
  content:"";
  position: fixed;
  inset: -20% -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 12% 8%, rgba(255,182,199,0.55), transparent 70%),
    radial-gradient(34% 30% at 88% 18%, rgba(199,186,255,0.50), transparent 72%),
    radial-gradient(40% 36% at 70% 88%, rgba(178,214,255,0.45), transparent 70%);
  filter: blur(10px);
  opacity: .9;
}
html.dark body::before{ opacity:.32; }
a{ color: inherit; text-decoration: none; }
button,input,select,textarea{ font-family: inherit; font-size: 100%; }
button{ color: inherit; }
img{ display:block; max-width:100%; }
ul,ol{ list-style:none; margin:0; padding:0; }
p{ margin: 0 0 12px; }
h1,h2,h3,h4{ margin: 0; line-height: 1.35; }
::selection{ background: var(--accent-light); color:#fff; }

/* SECTION: utilities */
.ico{
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}
.skip-link{
  position: absolute;
  left: 12px; top: -60px;
  z-index: 999;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #fff;
  font-size: 13px;
  transition: top .2s;
}
.skip-link:focus{ top: 12px; }
.glass{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}
.muted{ color: var(--text-tertiary); }
.hidden{ display: none !important; }

/* SECTION: buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid var(--accent-light);
  background: transparent;
  color: var(--accent-primary);
  transition: .25s;
}
.btn:hover{ box-shadow: var(--glass-shadow-accent); transform: translateY(-1px); }
.btn.primary{
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  border-color: transparent;
}
.btn.ghost{
  color: var(--text-secondary);
  border-color: var(--border-divider);
  background: var(--chip-bg);
}
.btn.block{ width: 100%; }
.btn:disabled{ opacity:.5; cursor: default; transform:none; box-shadow:none; }
.icon-btn{
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-divider);
  background: var(--chip-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: .25s;
}
.icon-btn:hover{ color: var(--accent-primary); border-color: var(--accent-light); transform: translateY(-1px); }

/* SECTION: header */
.header{
  position: sticky;
  top: 12px;
  z-index: 60;
  max-width: 1080px;
  width: calc(100% - 24px);
  margin: 16px auto 14px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.logo{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.logo-mark{
  width: 34px; height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  display: grid; place-items: center;
  color:#fff;
  box-shadow: var(--glass-shadow-accent);
}
.logo-mark .ico{ width:17px; height:17px; }
.logo-text{ font-size: 16px; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
.nav{ display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; flex:1; min-width:0; }
.nav::-webkit-scrollbar{ display:none; }
.nav a{
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: .25s;
}
.nav a:hover{ color: var(--accent-primary); background: var(--glass-bg-hover); }
.nav a.is-active{
  color: var(--accent-primary);
  background: var(--glass-bg-hover);
  box-shadow: inset 0 0 0 1px var(--accent-light);
}
.header-right{ display:flex; align-items:center; gap:10px; flex-shrink:0; }

/* 顶部导航迷你播放条：播放/暂停 + 横向滚动歌名 */
.hn-player{
  display: flex; align-items: center; gap: 6px;
  max-width: 210px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  border: 1px solid var(--border-divider);
}
.hn-player[hidden]{ display: none; }
.hn-toggle{
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  cursor: pointer;
  transition: transform .2s;
}
.hn-toggle:hover{ transform: scale(1.08); }
.hn-toggle .ico{ width: 11px; height: 11px; }
.hn-pause{ display: none; }
.hn-player.is-playing .hn-play{ display: none; }
.hn-player.is-playing .hn-pause{ display: block; }
.hn-info{
  flex: 1; min-width: 0;
  overflow: hidden;
  cursor: pointer;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8% 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8% 92%, transparent);
}
.hn-text{
  display: inline-block;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding-right: 28px;
}
.hn-player.is-playing .hn-text{ color: var(--accent-primary); }
/* 歌名超出宽度时横向滚动（时长按字数由脚本设定） */
.hn-text.is-scroll{ animation: hn-marquee var(--dur, 10s) linear infinite; }
@keyframes hn-marquee{
  0%, 12%{ transform: translateX(0); }
  88%, 100%{ transform: translateX(var(--shift, -50%)); }
}
@media (prefers-reduced-motion: reduce){
  .hn-text.is-scroll{ animation: none; }
}
@media (max-width: 860px){
  .hn-player{ max-width: 150px; padding: 3px 8px 3px 3px; }
  .hn-toggle{ width: 22px; height: 22px; }
  .hn-text{ font-size: 10.5px; }
}
@media (max-width: 640px){
  .hn-player{ max-width: 150px; }
}
.search{
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  border: 1px solid var(--border-divider);
  color: var(--text-tertiary);
  transition: .25s;
}
.search:focus-within{ border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(255,143,163,0.14); }
.search input{
  border: 0; outline: 0; background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  width: 120px; min-width: 0;
}
.search input::placeholder{ color: var(--text-tertiary); }

/* SECTION: shell */
.shell{
  max-width: 1080px;
  width: calc(100% - 24px);
  margin: 0 auto 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.column{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.row{ display: flex; gap: 16px; align-items: flex-start; }

/* SECTION: rail */
.rail{
  width: 76px;
  flex-shrink: 0;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 50;
}
.rail-group{ display:flex; flex-direction:column; gap:14px; }
.rail-btn{
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .25s;
}
.rail-btn:hover{ color: var(--accent-primary); background: var(--glass-bg-hover); border-color: var(--accent-light); }
.rail-btn.is-active{
  color: var(--accent-primary);
  background: var(--glass-bg-hover);
  border-color: var(--accent-light);
  box-shadow: 0 4px 14px rgba(255,140,158,0.20);
}

/* SECTION: sidebar modules */
.sidebar{
  width: 244px;
  flex-shrink: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: var(--header-h);
  height: fit-content;
  z-index: 40;
}
.profile{ text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--border-divider); }
.avatar{
  width: 86px; height: 86px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--img-fallback);
  box-shadow: var(--glass-shadow-accent);
  border: 3px solid rgba(255,255,255,0.70);
  transition: transform .3s;
}
html.dark .avatar{ border-color: rgba(255,255,255,0.14); }
.avatar:hover{ transform: rotate(-4deg) scale(1.04); }
.avatar img{ width:100%; height:100%; object-fit: cover; }
.profile-name{ margin: 0 0 6px; font-size: 17px; letter-spacing: 1px; }
.profile-desc{ margin: 0 0 12px; font-size: 12.5px; color: var(--text-secondary); }
.profile-tags{ display:flex; justify-content:center; gap:7px; flex-wrap:wrap; }
.profile-tag{
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
}
.side-block{ min-width: 0; }
.side-title{
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-divider);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.side-title .ico{ width:16px; height:16px; color: var(--accent-primary); }
.side-title .shuffle{
  margin-left: auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--text-tertiary);
  border-radius: 8px;
  cursor: pointer;
  transition: .25s;
}
.side-title .shuffle:hover{ color: var(--accent-primary); background: var(--glass-bg-hover); transform: rotate(90deg); }
.side-title .shuffle .ico{ width:14px; height:14px; color: inherit; }
.post-list{ display:flex; flex-direction:column; gap:2px; }
.post-list li a{
  display: block;
  padding: 7px 9px;
  font-size: 13.2px;
  color: var(--text-secondary);
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: .2s;
}
.post-list li a:hover{ color: var(--accent-primary); background: var(--chip-bg); }
.tags{ display:flex; flex-wrap:wrap; gap:7px; }
.tag{
  padding: 5px 11px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: .25s;
}
.tag:hover{ color:#fff; background: linear-gradient(135deg, var(--accent-light), var(--accent-primary)); border-color: transparent; }
.stats{ display:grid; grid-template-columns: repeat(3,1fr); gap:8px; }
.stat{
  text-align:center;
  padding: 9px 4px;
  border-radius: var(--radius-sm);
  background: var(--chip-bg);
  border: 1px solid var(--border-divider);
}
.stat b{ display:block; font-size: 15px; color: var(--accent-primary); }
.stat span{ font-size: 11px; color: var(--text-tertiary); }

/* SECTION: footer */
.footer{
  max-width: 1080px;
  width: calc(100% - 24px);
  margin: 0 auto 26px;
  padding: 15px 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.footer p{ margin: 0; }
.footer a{ color: var(--accent-primary); }
.footer .dot{ margin: 0 6px; opacity: .55; }

/* SECTION: floating */
.floating{
  position: fixed;
  right: max(14px, calc((100vw - 1080px) / 2 - 62px));
  bottom: 26px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.float-btn{
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: var(--text-tertiary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: .25s;
}
.float-btn:hover{ color: var(--accent-primary); transform: translateY(-3px); box-shadow: var(--glass-shadow-accent); }
.float-btn.is-on{ color: var(--accent-primary); border-color: var(--accent-light); }

/* SECTION: mobile nav */
.mobile-nav{ display: none; }

/* SECTION: modal */
.modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open{ display: flex; }
.modal-mask{ position: absolute; inset: 0; background: rgba(30,24,45,0.42); backdrop-filter: blur(4px); }
.modal-card{
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  border-radius: var(--radius);
  background: var(--glass-bg-hover);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-accent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.modal-card h3{ margin: 0 0 8px; font-size: 16px; }
.modal-card p{ margin: 0 0 14px; font-size: 13.5px; color: var(--text-secondary); }
.modal-mail{
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--chip-bg);
  border: 1px dashed var(--accent-light);
  font-size: 13px;
  word-break: break-all;
}
.modal-actions{ display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn{ flex: 1; }

/* SECTION: toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 16px);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  box-shadow: var(--glass-shadow-accent);
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  z-index: 300;
  max-width: 82vw;
  text-align: center;
}
.toast.is-show{ opacity: 1; transform: translate(-50%, 0); }

/* SECTION: page hero */
.page-hero{
  position: relative;
  padding: 22px 24px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.page-hero::after{
  content:"";
  position: absolute;
  right: -40px; top: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,197,208,0.55), rgba(206,199,255,0.45));
  filter: blur(6px);
  pointer-events: none;
}
html.dark .page-hero::after{ opacity:.35; }
.page-hero h1{ font-size: clamp(20px, 3vw, 26px); letter-spacing: 1px; }
.page-hero p{ margin: 8px 0 0; font-size: 13.5px; color: var(--text-secondary); max-width: 52ch; }
.page-hero .hero-icon{
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  margin-bottom: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  box-shadow: var(--glass-shadow-accent);
  position: relative;
  z-index: 1;
}
.page-hero .hero-icon .ico{ width: 20px; height: 20px; }
.page-hero > *{ position: relative; z-index: 1; }

/* SECTION: pagination */
.pagination{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}
.page-btn{
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--chip-bg);
  border: 1px solid var(--border-divider);
  cursor: pointer;
  transition: .2s;
}
.page-btn:hover:not(:disabled){ color: var(--accent-primary); border-color: var(--accent-light); }
.page-btn.is-active{
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  border-color: transparent;
}
.page-btn:disabled{ opacity: .45; cursor: default; }
.page-info{ font-size: 12.5px; color: var(--text-tertiary); padding: 0 4px; }

/* SECTION: empty */
.empty{
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 16px;
  color: var(--text-tertiary);
  font-size: 14px;
  text-align: center;
}
.empty.is-show{ display: flex; }
.empty .ico{ width: 34px; height: 34px; opacity: .5; }

/* SECTION: responsive */
@media (max-width: 980px){
  .sidebar{ position: static; width: 224px; }
}
@media (max-width: 860px){
  .rail{ display: none; }
  .row{ flex-direction: column; }
  .sidebar{ width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar > *{ flex: 1 1 180px; }
  .profile{
    border-bottom: 0;
    padding-bottom: 0;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .avatar{ margin: 0; width: 64px; height: 64px; }
  .profile-name{ margin: 0; }
  .profile-desc{ margin: 0; flex-basis: 100%; }
  .profile-tags{ justify-content: flex-start; }
  .floating{ right: 14px; bottom: 84px; }
  .mobile-nav{
    display: flex;
    position: fixed;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 90;
    padding: 8px;
    justify-content: space-around;
    border-radius: var(--radius);
    background: var(--glass-bg-hover);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-accent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .mobile-nav button,
  .mobile-nav a{
    width: 46px; height: 44px;
    display: grid; place-items: center;
    border: 0; background: transparent;
    border-radius: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
  }
  .mobile-nav button.is-active,
  .mobile-nav a.is-active{ color: var(--accent-primary); background: var(--chip-bg); }
  .footer{ margin-bottom: 96px; }
}
@media (max-width: 640px){
  /* 两行各自独立成行（grid 共享列宽会让两行互相挤压）：
     第一行 logo+搜索+主题，第二行 导航(可横滑)+歌曲条。 */
  .header{
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 10px 14px;
    top: 8px;
  }
  .logo{ order: 0; flex: 1 1 auto; min-width: 0; }
  /* 右侧容器拆开，子元素各自排序成行 */
  .header-right{ display: contents; }
  .search{ order: 1; flex: 0 0 auto; }
  .header .js-theme{ order: 2; flex: 0 0 auto; }
  /* 强制断行：flex 换行按基础宽度计算，导航基础宽 0 会赖在第一行，
     用一个占满整行的空伪元素把第二行单独隔出来 */
  .header::after{ content: ""; order: 3; flex-basis: 100%; height: 0; }
  /* 导航基础宽设 0：换行判断按基础宽算，auto 会把整排链接宽度算进去，
     导致播放条被挤到第三行；设 0 后再伸展填充剩余空间 */
  .nav{ order: 4; flex: 1 1 0; min-width: 0; gap: 2px; }
  .nav a{ padding: 4px 8px; font-size: 13px; }
  .hn-player{ order: 5; flex: 0 0 auto; max-width: 150px; }
  .search input{ width: 88px; font-size: 16px; }
  .side-btn, .cat-item{ min-height: 36px; }
  .page-hero{ padding: 18px 16px; }
  .stat b{ font-size: 14px; }
}
/* SECTION: wechat modal */
.modal-wechat{ text-align: center; width: min(360px, 100%); }
.modal-wechat h3{ font-size: 17px; margin-bottom: 6px; }
.modal-wechat p{ margin-bottom: 14px; }
.qr-box{
  width: 200px;
  height: 200px;
  margin: 0 auto 14px;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-divider);
  box-shadow: 0 4px 18px rgba(255,143,163,0.18);
  display: grid;
  place-items: center;
}
.qr-box img{ width: 100%; height: 100%; object-fit: contain; }
.qr-empty{
  background: var(--chip-bg);
  color: var(--text-tertiary);
  font-size: 12.5px;
  text-align: center;
  gap: 4px;
  grid-auto-rows: min-content;
  align-content: center;
}
.qr-empty small{ font-size: 11px; opacity: .75; }

/* SECTION: music player（入口固定右下角 + 面板独立悬浮可拖） */
.music-player{
  position: fixed;
  left: 18px;
  bottom: 24px;
  /* 高于底部导航(90)，低于弹窗(200)，避免被导航遮住 */
  z-index: 95;
  /* 容器尺寸跟面板一样大，最小化后若仍接收点击，会在原地留下一片
     看不见的「死区」挡住下面内容。容器一律不接点击，只让展开的面板接。 */
  pointer-events: none;
}
.music-player.is-open{ pointer-events: auto; }
/* 右下角音乐入口：播放中呼吸光晕提示 */
.float-btn.js-music.is-on{
  color: var(--accent-primary);
  border-color: var(--accent-light);
  animation: mp-fab-pulse 2.4s ease-in-out infinite;
}
@keyframes mp-fab-pulse{
  0%, 100%{ box-shadow: var(--glass-shadow); }
  50%{ box-shadow: 0 0 0 5px rgba(255,143,163,0.14), var(--glass-shadow-accent); }
}
.music-player.is-drag{ user-select: none; }
.music-player.is-drag .mp-panel{ transition: none; transform: none; }
.mp-head{ touch-action: none; cursor: grab; }
.music-player.is-drag .mp-head{ cursor: grabbing; }

/* 播放/暂停图标切换 */
.music-icon-pause{ display: none; }
.music-player.is-playing .music-icon-play{ display: none; }
.music-player.is-playing .music-icon-pause{ display: block; }

/* 玻璃控制台（盒子即面板，拖拽坐标 1:1） */
.mp-panel{
  position: relative;
  width: min(320px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(12px) scale(.88);
  transform-origin: bottom right;
  pointer-events: none;
  /* 收起：快速缩回淡出，干脆不拖沓 */
  transition: opacity .18s ease, transform .18s ease;
}
.music-player.is-open .mp-panel{
  opacity: 1;
  transform: none;
  pointer-events: auto;
  /* 展开：从按钮方向弹性弹出，带轻微回弹 */
  animation: mp-pop .34s cubic-bezier(.3, 1.4, .4, 1);
}
@keyframes mp-pop{
  0%{ opacity: 0; transform: translateY(16px) scale(.86); }
  60%{ opacity: 1; }
  100%{ opacity: 1; transform: none; }
}
/* 尊重系统「减少动效」设置 */
@media (prefers-reduced-motion: reduce){
  .mp-panel{ transition: opacity .15s ease; }
  .music-player.is-open .mp-panel{ animation: none; }
}
.mp-head{ display: flex; align-items: center; gap: 10px; }
.mp-cover{
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  background-size: cover; background-position: center;
}
.mp-cover .ico{ width: 18px; height: 18px; }
.mp-cover.has-img .ico{ display: none; }
.mp-meta{ flex: 1; min-width: 0; }
.mp-title{
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-artist{
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-close{
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: .2s;
}
.mp-close:hover{ color: var(--accent-primary); background: var(--chip-bg); }
.mp-close .ico{ width: 13px; height: 13px; transform: rotate(-90deg); }
.mp-lyric-btn{
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: .2s;
}
.mp-lyric-btn:hover{ color: var(--accent-primary); background: var(--chip-bg); }
.mp-lyric-btn.is-on{ color: #fff; background: linear-gradient(135deg, var(--accent-light), var(--accent-primary)); }

/* 进度条：可点击可拖动 */
.mp-seek{
  margin-top: 12px;
  height: 5px;
  border-radius: 3px;
  background: var(--border-divider);
  cursor: pointer;
  touch-action: none;
}
.mp-seek span{
  display: block;
  width: 0; height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-light), var(--accent-primary));
}
.mp-times{
  display: flex; justify-content: space-between;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* 控制行 */
.mp-ctrl{ display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mp-btn{
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: .2s;
}
.mp-btn:hover{ color: var(--accent-primary); background: var(--chip-bg); }
.mp-btn .ico{ width: 15px; height: 15px; }
.mp-flip{ transform: scaleX(-1); }
.mp-main{
  width: 42px; height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  box-shadow: 0 3px 12px rgba(255,140,158,0.35);
}
.mp-main:hover{ color: #fff; transform: scale(1.06); background: linear-gradient(135deg, var(--accent-light), var(--accent-primary)); }
.mp-main .ico{ width: 17px; height: 17px; }
.mp-vol{ display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.mp-mute .ico{ width: 14px; height: 14px; }
.mp-vol-off{ display: none; }
.music-player.is-muted .mp-vol-on{ display: none; }
.music-player.is-muted .mp-vol-off{ display: block; opacity: .5; }
.music-player.is-muted .mp-mute{ color: var(--text-tertiary); }

/* 自定义音量滑杆：渐变填充 + 白色圆钮，浅深色主题都协调 */
.mp-vol input[type=range]{
  -webkit-appearance: none;
  appearance: none;
  width: 72px; height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 55%;
}
.mp-vol input[type=range]:focus{ outline: none; }
.mp-vol input[type=range]::-webkit-slider-runnable-track{
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-light), var(--accent-primary) var(--p), var(--border-divider) var(--p));
}
.mp-vol input[type=range]::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 12px; height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 1px 4px rgba(31,38,135,0.25);
  transition: transform .15s;
}
.mp-vol input[type=range]:hover::-webkit-slider-thumb{ transform: scale(1.15); }
.mp-vol input[type=range]::-moz-range-track{
  height: 4px; border-radius: 2px; background: var(--border-divider);
}
.mp-vol input[type=range]::-moz-range-progress{
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-light), var(--accent-primary));
}
.mp-vol input[type=range]::-moz-range-thumb{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 1px 4px rgba(31,38,135,0.25);
}

/* 播放列表 */
.mp-list-head{
  margin: 12px 0 6px;
  font-size: 11px;
  letter-spacing: .5px;
  color: var(--text-tertiary);
}
.mp-list{
  max-height: 168px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-light) transparent;
}
/* 列表滚动条：细、圆角、主题色，浅色下不再是一条灰杠 */
.mp-list::-webkit-scrollbar{ width: 4px; }
.mp-list::-webkit-scrollbar-track{ background: transparent; }
.mp-list::-webkit-scrollbar-thumb{
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent-primary));
}
.mp-item{
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: .15s;
}
.mp-item:hover{ background: var(--chip-bg); }
.mp-item.is-cur{ background: var(--chip-bg); color: var(--accent-primary); }
.mp-item-no{
  width: 16px; flex-shrink: 0;
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.mp-item.is-cur .mp-item-no{ color: var(--accent-primary); font-weight: 700; }
.mp-item-name{
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-item-art{
  max-width: 72px; flex-shrink: 0;
  font-size: 10.5px;
  color: var(--text-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 歌词视图：替换播放列表区域，随播放滚动高亮 */
.mp-lyric{
  margin-top: 10px;
  height: 176px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-light) transparent;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18% 82%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18% 82%, transparent);
}
/* 歌词滚动条：与列表同款主题色细条 */
.mp-lyric::-webkit-scrollbar{ width: 4px; }
.mp-lyric::-webkit-scrollbar-track{ background: transparent; }
.mp-lyric::-webkit-scrollbar-thumb{
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent-primary));
}
.mp-lyric-inner{ padding: 70px 6px; display: flex; flex-direction: column; gap: 10px; }
.mp-lyric-line{
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  opacity: .68;
  text-align: center;
  transition: color .25s, opacity .25s, transform .25s, text-shadow .25s;
}
.mp-lyric-line.is-cur{
  color: var(--accent-primary);
  opacity: 1;
  font-weight: 600;
  font-size: 13px;
  transform: scale(1.04);
  text-shadow: 0 0 14px rgba(255,143,163,0.35);
}
.mp-lyric-empty{
  padding: 20px 10px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.8;
}
.music-player.is-lyric .mp-list,
.music-player.is-lyric .mp-list-head{ display: none; }

/* 移动端：面板宽度自适应，音量滑杆略短 */
@media (max-width: 860px){
  .mp-vol input[type=range]{ width: 56px; }
}

/* SECTION: guestbook */
.gb-form{
  padding: 18px;
  border-radius: var(--radius);
  background: var(--chip-bg);
  border: 1px solid var(--border-divider);
  margin-bottom: 18px;
}
.gb-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px){
  .gb-grid{ grid-template-columns: 1fr; }
}
.gb-field{ display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.gb-field > span{ font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.gb-field > span em{ font-style: normal; color: var(--text-tertiary); font-weight: 400; }
.gb-field input,
.gb-field textarea{
  width: 100%;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-divider);
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  font-size: 13.8px;
  font-family: inherit;
  outline: none;
  transition: .2s;
}
.gb-field input:focus,
.gb-field textarea:focus{
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(255,143,163,0.14);
}
.gb-field textarea{ resize: vertical; min-height: 110px; line-height: 1.75; }
.gb-note{
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
}
.gb-alert{
  padding: 10px 15px;
  border-radius: 11px;
  font-size: 13.2px;
  margin-bottom: 14px;
}
.gb-alert.ok{ color: #2e7d5b; background: rgba(64,190,130,0.16); border: 1px solid rgba(64,190,130,0.35); }
.gb-alert.err{ color: #b83a4e; background: rgba(255,140,160,0.16); border: 1px solid rgba(236,110,132,0.4); }
html.dark .gb-alert.ok{ color: #8be3b6; }
html.dark .gb-alert.err{ color: #ffb0bd; }

.gb-list{ display: flex; flex-direction: column; gap: 12px; }
.gb-item{
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--glass-bg-hover);
  border: 1px solid var(--border-divider);
  transition: box-shadow .25s;
}
.gb-item:hover{ box-shadow: var(--glass-shadow); }
.gb-head{
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.gb-avatar{
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
}
.gb-name{ font-size: 13.8px; font-weight: 600; color: var(--text-primary); }
.gb-time{ font-size: 11.8px; color: var(--text-tertiary); margin-left: auto; }
.gb-content{
  font-size: 13.8px;
  line-height: 1.8;
  color: var(--text-secondary);
  word-break: break-word;
  white-space: pre-wrap;
}
.gb-contact{
  display: inline-block;
  margin-top: 8px;
  font-size: 11.8px;
  color: var(--text-tertiary);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
}
.gb-reply{
  margin-top: 11px;
  padding: 10px 13px;
  border-radius: 11px;
  background: var(--accent-pale);
  border-left: 3px solid var(--accent-primary);
  font-size: 13.2px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
html.dark .gb-reply{ background: rgba(255,160,180,0.1); }
.gb-reply b{ color: var(--accent-primary); font-size: 12.3px; }

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}