:root{
    --bg:#F5F5F7; --card:#FFFFFF; --text:#1D1D1F; --sub:#86868B;
    --line:#E5E5EA; --accent:#FA243C; --radius:16px;
    --bar-bg:rgba(255,255,255,0.72);
  }
  html{ -webkit-text-size-adjust:100%; }
  body{
    margin:0; background:var(--bg); color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
    -webkit-font-smoothing:antialiased;
  }
  h1,h2,h3,p{ margin:0; }
  button{ font-family:inherit; border:none; background:none; cursor:pointer; color:inherit; padding:0; }
  img{ display:block; }
  .hidden{ display:none !important; }

  /* ---------- 通用图标按钮 ---------- */
  .icon-btn{
    width:40px; height:40px; border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    color:var(--text); transition:background .18s ease, transform .12s ease;
    flex:none;
  }
  .icon-btn:hover{ background:rgba(0,0,0,0.05); }
  .icon-btn:active{ transform:scale(0.92); }
  .icon-btn svg{ width:22px; height:22px; }
  .icon-btn.small{ width:36px; height:36px; color:#6E6E73; }
  .icon-btn.small svg{ width:20px; height:20px; }
  .icon-btn.small:hover{ color:var(--text); }

  /* ---------- 密钥门禁 ---------- */
  #gateView{
    min-height:100vh; min-height:100dvh;
    display:flex; align-items:center; justify-content:center;
    padding:24px;
  }
  .gate-box{ width:100%; max-width:380px; text-align:center; animation:rise .5s ease both; }
  @keyframes rise{ from{opacity:0; transform:translateY(12px);} to{opacity:1; transform:none;} }
  .gate-logo{
    width:76px; height:76px; margin:0 auto 22px; border-radius:22px;
    background:linear-gradient(145deg,#FC5C7D,#FA243C);
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 14px 30px rgba(250,36,60,.28); color:#fff;
  }
  .gate-logo svg{ width:38px; height:38px; }
  .gate-box h1{ font-size:32px; font-weight:700; letter-spacing:.02em; }
  .gate-box .gate-sub{ margin-top:10px; font-size:15px; color:var(--sub); line-height:1.6; }
  .gate-form{ margin-top:30px; }
  #keyInput{
    width:100%; height:54px; padding:0 20px;
    font-size:16px; color:var(--text);
    background:#fff; border:1.5px solid var(--line); border-radius:999px;
    outline:none; transition:border-color .18s ease, box-shadow .18s ease;
    box-sizing:border-box; text-align:center; letter-spacing:.04em;
  }
  #keyInput:focus{ border-color:var(--accent); box-shadow:0 0 0 4px rgba(250,36,60,.10); }
  #keyInput::placeholder{ color:#B9B9BE; letter-spacing:0; }
  #keySubmit{
    margin-top:14px; width:100%; height:52px; border-radius:999px;
    background:var(--accent); color:#fff; font-size:16px; font-weight:600;
    transition:opacity .18s ease, transform .12s ease;
  }
  #keySubmit:active{ transform:scale(.985); }
  #keySubmit:disabled{ opacity:.55; cursor:not-allowed; }
  .gate-note{ margin-top:18px; font-size:12.5px; color:#B0B0B5; line-height:1.7; }

  /* ---------- 全屏加载遮罩 ---------- */
  #overlay{
    position:fixed; inset:0; z-index:200;
    background:rgba(0,0,0,0.45);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px;
  }
  .spinner{
    width:38px; height:38px; border-radius:50%;
    border:3.5px solid rgba(255,255,255,.25); border-top-color:#fff;
    animation:spin .8s linear infinite;
  }
  .spinner.dark{ border-color:rgba(0,0,0,.12); border-top-color:var(--accent); width:26px; height:26px; border-width:3px; }
  @keyframes spin{ to{ transform:rotate(360deg); } }
  #overlay p{ color:#fff; font-size:15px; letter-spacing:.14em; text-indent:.14em; }

  /* ---------- 顶部轻提示 Toast ---------- */
  #toast{
    position:fixed; top:calc(env(safe-area-inset-top, 0px) + 14px); left:50%;
    transform:translate(-50%,-16px); z-index:300;
    max-width:min(88vw,460px);
    background:rgba(28,28,30,.94); color:#fff;
    font-size:14px; line-height:1.5; text-align:center;
    padding:11px 20px; border-radius:999px;
    box-shadow:0 10px 28px rgba(0,0,0,.22);
    opacity:0; pointer-events:none;
    transition:opacity .25s ease, transform .25s ease;
  }
  #toast.show{ opacity:1; transform:translate(-50%,0); }

  /* ---------- 应用顶栏 ---------- */
  #appBar{
    position:sticky; top:0; z-index:50;
    background:var(--bar-bg);
    -webkit-backdrop-filter:saturate(180%) blur(20px);
    backdrop-filter:saturate(180%) blur(20px);
    border-bottom:1px solid rgba(0,0,0,0.06);
  }
  .appbar-in{
    max-width:1080px; margin:0 auto; height:64px; padding:0 20px;
    display:flex; align-items:center; justify-content:space-between; gap:12px;
  }
  .appbar-left{ display:flex; align-items:center; gap:6px; min-width:0; }
  .appbar-left h1{ font-size:27px; font-weight:700; letter-spacing:.01em; }
  .appbar-left .bar-title{
    font-size:17px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:52vw;
  }
  .appbar-right{ display:flex; align-items:center; gap:4px; flex:none; }

  /* ---------- 主内容 ---------- */
  #appMain{ max-width:1080px; margin:0 auto; padding:28px 20px 170px; }
  .section-head{ display:flex; align-items:baseline; justify-content:space-between; margin:6px 0 18px; }
  .section-head h2{ font-size:22px; font-weight:700; }
  .section-head span{ font-size:13px; color:var(--sub); }

  /* 歌单卡片:网格 */
  .col-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(136px,1fr)); gap:20px 16px; }
  .col-card{ cursor:pointer; text-align:left; width:100%; min-width:0; }
  .col-card .cover{
    position:relative; width:100%; aspect-ratio:1/1; border-radius:var(--radius);
    overflow:hidden; background:linear-gradient(145deg,#E9E9EE,#DCDCE2);
    transition:transform .25s ease, box-shadow .25s ease;
  }
  .col-card:hover .cover{ transform:translateY(-3px); box-shadow:0 14px 28px rgba(0,0,0,.13); }
  .col-card .cover img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
  .cover .ph{
    position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#A7A7AE;
  }
  .cover .ph svg{ width:44px; height:44px; }
  .col-card h3{
    margin-top:11px; font-size:15.5px; font-weight:600; line-height:1.35;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .col-card p{ margin-top:3px; font-size:12.5px; color:var(--sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .col-card .meta{ min-width:0; }
  .skl-card{ min-width:0; }

  /* 歌单卡片:列表模式 */
  .col-list{ display:flex; flex-direction:column; gap:12px; }
  .col-list .col-card{
    display:flex; align-items:center; gap:14px;
    background:var(--card); border-radius:var(--radius); padding:12px 14px;
  }
  .col-list .col-card .cover{ width:58px; height:58px; flex:none; border-radius:10px; }
  .col-list .col-card:hover .cover{ transform:none; box-shadow:none; }
  .col-list .col-card h3{ margin-top:0; }
  .col-list .col-card .meta{ min-width:0; }

  /* ---------- 骨架屏 ---------- */
  .skl{ border-radius:var(--radius); background:linear-gradient(100deg,#ECECF0 40%,#F5F5F8 50%,#ECECF0 60%); background-size:200% 100%; animation:shimmer 1.3s infinite; }
  @keyframes shimmer{ to{ background-position:-200% 0; } }
  .skl-card .skl-cover{ width:100%; aspect-ratio:1/1; }
  .skl-line{ height:13px; border-radius:6px; margin-top:11px; }
  .skl-row{ display:flex; align-items:center; gap:13px; padding:9px 0; }
  .skl-row .skl-thumb{ width:52px; height:52px; border-radius:9px; flex:none; }
  .skl-row .skl-lines{ flex:1; }
  .loading-center{ display:flex; flex-direction:column; align-items:center; gap:13px; padding:56px 0; color:var(--sub); font-size:14px; }

  /* 封面懒加载:毛玻璃模糊 → 渐渐清晰 */
  .cover img, .s-cover img, .p-cover img, .d-cover img{
    opacity:0; filter:blur(14px) saturate(1.25); transform:scale(1.07);
    transition:opacity .55s ease, filter .55s ease, transform .55s ease;
  }
  .cover img.ld, .s-cover img.ld, .p-cover img.ld, .d-cover img.ld{
    opacity:1; filter:blur(0) saturate(1); transform:none;
  }
*{touch-action:manipulation}
/* ---------- 详情页 ---------- */
  .detail-head{ display:flex; gap:22px; align-items:center; margin:8px 0 26px; }
  .detail-head .d-cover{
    position:relative; width:148px; height:148px; flex:none;
    border-radius:18px; overflow:hidden; background:linear-gradient(145deg,#E9E9EE,#DCDCE2);
    box-shadow:0 16px 34px rgba(0,0,0,.14);
  }
  .detail-head .d-cover img{ width:100%; height:100%; object-fit:cover; }
  .detail-head h2{ font-size:27px; font-weight:700; line-height:1.3; }
  .detail-head .d-sub{ margin-top:8px; font-size:14px; color:var(--sub); line-height:1.6; }
  .play-all{
    margin-top:16px; display:inline-flex; align-items:center; gap:8px;
    height:40px; padding:0 20px; border-radius:999px;
    background:var(--accent); color:#fff; font-size:14.5px; font-weight:600;
    transition:transform .12s ease, opacity .18s ease;
  }
  .play-all:active{ transform:scale(.96); }
  .play-all svg{ width:16px; height:16px; }

  /* ---------- 歌曲列表行 ---------- */
  .song-list{ display:flex; flex-direction:column; }
  .song-row{
    display:flex; align-items:center; gap:13px;
    padding:9px 10px; border-radius:12px; cursor:pointer;
    transition:background .15s ease;
  }
  .song-row:hover{ background:rgba(0,0,0,0.035); }
  .song-row .s-cover{
    position:relative; width:52px; height:52px; flex:none;
    border-radius:9px; overflow:hidden; background:linear-gradient(145deg,#E9E9EE,#DCDCE2);
  }
  .song-row .s-cover img{ width:100%; height:100%; object-fit:cover; }
  .song-row .s-cover .ph{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#A7A7AE; }
  .song-row .s-cover .ph svg{ width:22px; height:22px; }
  .song-row .s-meta{ flex:1; min-width:0; }
  .song-row .s-name{ display:flex; align-items:center; gap:7px; min-width:0; font-size:15.5px; font-weight:500; line-height:1.35; }
  .song-row .s-name .nm{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .song-row .s-artist{ margin-top:2px; font-size:13px; color:var(--sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .song-row .s-actions{ display:flex; gap:2px; flex:none; }
  .song-row.playing .s-name{ color:var(--accent); }
  .eq{ display:none; align-items:flex-end; gap:2px; height:12px; flex:none; }
  .song-row.playing .eq{ display:inline-flex; }
  .eq i{ width:3px; height:100%; background:var(--accent); border-radius:2px; transform-origin:bottom; animation:eq 0.9s ease-in-out infinite; }
  .eq i:nth-child(1){ height:60%; } .eq i:nth-child(2){ height:100%; animation-delay:.25s; } .eq i:nth-child(3){ height:45%; animation-delay:.5s; }
  @keyframes eq{ 0%,100%{ transform:scaleY(.5);} 50%{ transform:scaleY(1);} }
  .list-end{ text-align:center; color:#B0B0B5; font-size:13px; padding:26px 0 6px; }
  .empty-box{ text-align:center; color:var(--sub); padding:64px 20px; font-size:14.5px; line-height:1.8; }

  /* ---------- 搜索 ---------- */
  .search-box{
    display:flex; align-items:center; gap:9px;
    background:#fff; border:1.5px solid var(--line); border-radius:999px;
    padding:0 8px 0 18px; height:50px;
  }
  .search-box svg{ width:19px; height:19px; color:#B0B0B5; flex:none; }
  .search-box input{
    flex:1; min-width:0; border:none; outline:none; font-size:16px; background:none; color:var(--text);
  }
  .search-box input::placeholder{ color:#B9B9BE; }
  .search-go{
    flex:none; height:36px; padding:0 18px; border-radius:999px;
    background:var(--accent); color:#fff; font-size:14px; font-weight:600;
  }
  .chips{ display:flex; gap:8px; margin:16px 0 8px; overflow-x:auto; padding-bottom:4px; scrollbar-width:none; }
  .chips::-webkit-scrollbar{ display:none; }
  .chip{
    flex:none; height:32px; padding:0 15px; border-radius:999px;
    background:#ECECF0; color:#3A3A3C; font-size:13.5px;
    display:inline-flex; align-items:center; transition:all .15s ease;
  }
  .chip.on{ background:var(--text); color:#fff; font-weight:600; }
  .scroll-loading{ display:flex; justify-content:center; padding:22px 0; }

  /* ---------- 底部播放栏 ---------- */
  #playerBar{
    position:fixed; left:0; right:0; bottom:0; z-index:60;
    background:var(--bar-bg);
    -webkit-backdrop-filter:saturate(180%) blur(22px);
    backdrop-filter:saturate(180%) blur(22px);
    border-top:1px solid rgba(0,0,0,0.07);
    padding-bottom:env(safe-area-inset-bottom, 0px);
  }
  .player-in{ max-width:1080px; margin:0 auto; padding:10px 20px 12px; }
  .progress-row{ display:flex; align-items:center; gap:10px; }
  .progress-row .t{ font-size:11px; color:var(--sub); width:34px; font-variant-numeric:tabular-nums; }
  .progress-row .t:last-child{ text-align:right; }
  #progress{
    flex:1; height:22px; display:flex; align-items:center; cursor:pointer; touch-action:none;
  }
  #progressTrack{ position:relative; width:100%; height:4px; border-radius:4px; background:rgba(0,0,0,0.14); }
  #progressFill{ position:absolute; left:0; top:0; bottom:0; width:0%; border-radius:4px; background:var(--accent); }
  #progressDot{
    position:absolute; top:50%; left:0%; width:12px; height:12px; border-radius:50%;
    background:var(--accent); transform:translate(-50%,-50%);
    box-shadow:0 1px 5px rgba(250,36,60,.45);
  }
  .controls-row{ display:flex; align-items:center; gap:13px; margin-top:7px; }
  .p-cover{
    position:relative; width:48px; height:48px; flex:none; border-radius:9px; overflow:hidden;
    background:linear-gradient(145deg,#E9E9EE,#DCDCE2);
  }
  .p-cover img{ width:100%; height:100%; object-fit:cover; }
  .p-cover .ph{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#A7A7AE; }
  .p-cover .ph svg{ width:22px; height:22px; }
  .p-meta{ flex:1; min-width:0; }
  .p-name{ font-size:15px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .p-artist{ margin-top:1px; font-size:12.5px; color:var(--sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .p-btns{ display:flex; align-items:center; gap:4px; flex:none; }
  .p-btns .icon-btn svg{ width:26px; height:26px; }
  #playBtn{
    width:46px; height:46px; border-radius:50%; background:var(--accent); color:#fff;
    display:inline-flex; align-items:center; justify-content:center;
    box-shadow:0 6px 16px rgba(250,36,60,.35); transition:transform .12s ease;
  }
  #playBtn:active{ transform:scale(.93); }
  #playBtn svg{ width:22px; height:22px; }

  .foot-note{ margin-top:44px; text-align:center; }
  .foot-note button{ font-size:13px; color:#B0B0B5; text-decoration:underline; text-underline-offset:3px; }

  /* ---------- 响应式 ---------- */
  @media (max-width:640px){
    #appMain{ padding:20px 16px 168px; }
    .appbar-in{ padding:0 14px; }
    .appbar-left h1{ font-size:24px; }
    .col-grid{ grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 12px; }
    .col-card h3{ margin-top:8px; font-size:13.5px; }
    .col-card p{ font-size:11.5px; }
    .col-card .cover .ph svg{ width:30px; height:30px; }
    .detail-head{ gap:16px; }
    .detail-head .d-cover{ width:104px; height:104px; border-radius:14px; }
    .detail-head h2{ font-size:21px; }
    .player-in{ padding:8px 14px 10px; }
    .song-row{ padding:8px 6px; }
  }
  @media (prefers-reduced-motion: reduce){
    .gate-box{ animation:none; }
    .eq i{ animation:none; }
  }
