/* ==========================================================
   导航站 v1.0 — 前台样式
   自适应手机 / 电脑
   ========================================================== */
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  background:#f4f6fa;
  color:#1f2430;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}
a{text-decoration:none;color:inherit}
img{display:block;max-width:100%}
h1,h2,p{margin:0}

/* ---------- 整页背景轮播 ---------- */
.page-bg{position:fixed;inset:0;z-index:-1;overflow:hidden}
.page-bg-item{
  position:absolute;inset:0;background-size:cover;background-position:center;
  opacity:0;transition:opacity 1.1s ease;
  transform:scale(1.04);
}
.page-bg-item.active{opacity:1}
.page-bg-mask{position:absolute;inset:0}

/* ---------- 顶部搜索栏 + 刷新 ---------- */
[hidden]{display:none !important}
.nav-topbar{
  position:sticky;top:0;z-index:40;padding:12px 12px 8px;
  background:rgba(244,246,250,.88);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
.nav-topbar-inner{max-width:680px;margin:0 auto;display:flex;gap:8px;align-items:center}
.search-field{
  flex:1;min-width:0;display:flex;align-items:center;gap:8px;
  height:42px;padding:0 14px;background:#fff;
  border:1px solid #e9edf5;border-radius:999px;
  box-shadow:0 2px 10px rgba(80,100,150,.06);transition:.2s;
}
.search-field:focus-within{border-color:var(--main,#4C7CFF);box-shadow:0 4px 14px rgba(76,124,255,.14)}
.search-field input{
  flex:1;min-width:0;border:none;outline:none;background:transparent;
  font-size:14px;color:#1f2430;font-family:inherit;
}
.search-field input::placeholder{color:#a9b0bf}
.search-field input::-webkit-search-cancel-button{display:none}
.search-clear{
  width:20px;height:20px;padding:0;flex:none;border:none;cursor:pointer;
  background:#eef1f7;color:#8b93a6;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
}
.refresh-btn{
  width:42px;height:42px;flex:none;border-radius:50%;cursor:pointer;
  border:1px solid #e9edf5;background:#fff;color:#5b6478;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 10px rgba(80,100,150,.06);transition:.2s;
}
.refresh-btn:hover{color:var(--main,#4C7CFF);border-color:#c9d8ff}
.refresh-btn:active{transform:scale(.93)}
.refresh-btn.spin svg{animation:navSpinRefresh .5s linear}
@keyframes navSpinRefresh{to{transform:rotate(360deg)}}
.search-empty{text-align:center;color:#a6adbb;font-size:13px;padding:30px 0}

/* ---------- 紧凑模式（按钮多时卡片自动缩小） ---------- */
body.compact .item{padding:9px 10px;gap:8px;border-radius:13px;min-height:52px}
body.compact .item-icon,body.compact .item-icon .ico{width:24px;height:24px}
body.compact .item-text b{font-size:13px}
body.compact .item-text em{font-size:10.5px}
body.compact .grid{gap:9px}

/* ---------- 容器 ---------- */
.wrap{max-width:680px;margin:0 auto;padding:12px 12px 40px}

/* ---------- 主卡片 ---------- */
.card{
  background:#fff;
  border-radius:24px;
  overflow:hidden;
  box-shadow:0 12px 40px rgba(80,100,150,.10),0 2px 8px rgba(80,100,150,.05);
}
body.mode-page .card,
body.mode-both .card{background:rgba(255,255,255,.94);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}

/* ---------- 顶部背景大图轮播 ---------- */
.banner{
  position:relative;
  height:168px;
  background:#e9edf4;
  overflow:hidden;
}
.banner-item{
  position:absolute;inset:0;
  background-size:cover;background-position:center 42%;
  opacity:0;transition:opacity .9s ease;
  transform:scale(1.02);
}
.banner-item.active{opacity:1}
.banner-plain{background:linear-gradient(135deg,#e8edf7,#dfe6f3)}
.banner-dots{
  position:absolute;bottom:10px;left:50%;transform:translateX(-50%);
  display:flex;gap:5px;z-index:3;
}
.banner-dots i{
  width:6px;height:6px;border-radius:50%;
  background:rgba(255,255,255,.55);
  box-shadow:0 0 4px rgba(0,0,0,.15);
  transition:.3s;
}
.banner-dots i.on{width:16px;background:#fff}

/* ---------- 头像 & 资料 ---------- */
.profile{position:relative;text-align:center;padding:0 20px 4px}
.avatar{
  width:88px;height:88px;border-radius:50%;
  margin:-46px auto 10px;
  border:4px solid #fff;
  background:#eef1f7;
  box-shadow:0 6px 18px rgba(60,80,140,.14);
  overflow:hidden;position:relative;z-index:2;
}
.avatar img{width:100%;height:100%;object-fit:cover}
.site-name{font-size:20px;font-weight:700;letter-spacing:.3px;color:#171b24}
.site-intro{font-size:12.5px;color:#98a1b2;margin-top:5px}

/* ---------- 快捷按钮 ---------- */
.quick-btns{display:flex;justify-content:center;gap:10px;margin:14px 0 4px;flex-wrap:wrap}
.qb{
  display:inline-flex;align-items:center;gap:6px;
  height:36px;padding:0 22px;border-radius:999px;
  font-size:13.5px;font-weight:600;
  transition:transform .18s ease,box-shadow .18s ease;
}
.qb:active{transform:scale(.96)}
.qb-main{background:var(--main,#4C7CFF);color:#fff;box-shadow:0 6px 16px rgba(76,124,255,.30)}
.qb-contact{background:#fff;color:#4b5468;border:1px solid #e6eaf2}
.qb svg{flex:none}

/* ---------- 内容区 ---------- */
.content{padding:8px 16px 4px}
.empty{text-align:center;color:#a4acbd;font-size:13px;padding:34px 0}

.cat{margin-top:16px}
.cat-title{
  display:flex;align-items:center;gap:7px;
  font-size:14px;font-weight:700;color:#2b3242;
  margin:0 4px 10px;
}
.cat-title img{width:17px;height:17px;object-fit:contain;opacity:.82}
.cat-title em{font-style:normal;font-size:11.5px;font-weight:400;color:#a6adbb}

.grid{
  display:grid;
  grid-template-columns:repeat(var(--cols-mb,2),minmax(0,1fr));
  gap:12px;
  justify-content:center;
}
@media(min-width:640px){
  .grid{grid-template-columns:repeat(var(--cols-pc,2),minmax(0,1fr));gap:14px}
}

/* 导航模块：内容居中、卡片饱满 */
.item{
  display:flex;align-items:center;justify-content:center;gap:11px;
  padding:14px 12px;
  min-height:60px;
  background:#fff;
  border:1px solid #eef1f7;
  border-radius:16px;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
  min-width:0;
}
.item:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(80,100,150,.13);border-color:#e3e9f6}
.item:active{transform:scale(.98)}
.item-icon{width:30px;height:30px;flex:none;display:flex;align-items:center;justify-content:center}
.item-icon .ico{width:30px;height:30px;border-radius:9px;object-fit:cover;display:block}
.item-icon .ico-text{font-size:23px;line-height:1;display:flex;align-items:center;justify-content:center}
.item-text{min-width:0;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}
.item-text b{font-size:14.5px;font-weight:600;color:#242b39;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item-text em{font-style:normal;font-size:11.5px;color:#a5acbb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}

/* 电脑端卡片更饱满 */
@media(min-width:640px){
  .item{padding:15px 14px;min-height:66px;gap:12px;border-radius:17px}
  .item-icon,.item-icon .ico{width:32px;height:32px}
  .item-text b{font-size:15px}
}

/* ---------- 页脚 ---------- */
.foot{
  text-align:center;font-size:11.5px;color:#b0b7c6;
  padding:22px 16px 20px;margin-top:12px;
  border-top:1px solid #f2f4f9;
}
.foot a{color:#b0b7c6}
.foot a:hover{color:var(--main,#4C7CFF)}

/* ==========================================================
   模板变体
   ========================================================== */
/* 玻璃拟态 */
body.tpl-glass{background:linear-gradient(150deg,#eef3ff,#f7f2ff 45%,#eaf6ff)}
body.tpl-glass .card{background:rgba(255,255,255,.7);backdrop-filter:blur(22px) saturate(150%);-webkit-backdrop-filter:blur(22px) saturate(150%);border:1px solid rgba(255,255,255,.6)}
body.tpl-glass .item{background:rgba(255,255,255,.62);border-color:rgba(255,255,255,.7)}
body.tpl-glass .item:hover{background:rgba(255,255,255,.85)}

/* 极简 */
body.tpl-minimal{background:#fff}
body.tpl-minimal .card{box-shadow:none;border-radius:0;background:transparent}
body.tpl-minimal .banner{border-radius:14px;margin:0 16px;margin-top:16px}
body.tpl-minimal .item{border-color:transparent;background:#f7f8fb}
body.tpl-minimal .item:hover{background:#f1f4fa;box-shadow:none}
body.tpl-minimal .foot{border-top-color:transparent}

/* 渐变卡片 */
body.tpl-gradient{background:linear-gradient(170deg,#f3f6ff,#eef1fb)}
body.tpl-gradient .item{border:none;background:linear-gradient(135deg,rgba(76,124,255,.07),rgba(156,120,255,.09))}
body.tpl-gradient .qb-main{background:linear-gradient(135deg,#5C8BFF,#8F6BFF)}

/* 卡片风格：实心 */
body.card-solid .item{background:#f6f8fc;border-color:transparent}
body.card-solid .item:hover{background:#eef3fb}
/* 卡片风格：玻璃 */
body.card-glass .item{background:rgba(255,255,255,.6);border-color:rgba(255,255,255,.8);backdrop-filter:blur(10px)}

/* ==========================================================
   背景音乐播放器
   ========================================================== */
.music-player{
  position:fixed;z-index:99;display:flex;flex-direction:column;align-items:center;gap:8px;
  touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.music-player.pos-br{right:12px;bottom:12px}
.music-player.pos-bl{left:12px;bottom:12px}
.music-player.dragging{cursor:grabbing}
.music-player.dragging{transition:none}
.music-player.dragging .music-btn{transform:scale(1.08);box-shadow:0 12px 28px rgba(76,124,255,.45)}
.music-btn{
  position:relative;width:48px;height:48px;border-radius:50%;
  border:none;cursor:pointer;color:#fff;
  background:var(--main,#4C7CFF);
  box-shadow:0 8px 22px rgba(76,124,255,.38);
  display:flex;align-items:center;justify-content:center;
  transition:transform .2s ease;
}
.music-btn:active{transform:scale(.92)}
.music-btn .ico-note,.music-btn .ico-pause{position:absolute;transition:opacity .25s ease,transform .25s ease}
.music-btn .ico-pause{opacity:0;transform:scale(.6)}
.music-player.playing .ico-note{opacity:0;transform:scale(.6)}
.music-player.playing .ico-pause{opacity:1;transform:scale(1)}
.music-ring{
  position:absolute;inset:0;border-radius:50%;
  border:2px solid var(--main,#4C7CFF);opacity:0;
}
.music-player.playing .music-ring{animation:navPulse 2s ease-out infinite}
.music-player.playing .music-ring.r2{animation-delay:1s}
@keyframes navPulse{
  0%{transform:scale(1);opacity:.55}
  100%{transform:scale(1.75);opacity:0}
}
.music-btn .ico-note{animation:navSpin 6s linear infinite;animation-play-state:paused}
.music-player.playing .ico-note{animation-play-state:running}
@keyframes navSpin{to{transform:rotate(360deg)}}
.music-tip{
  position:absolute;right:50%;bottom:64px;transform:translateX(50%);
  background:rgba(28,34,48,.86);color:#fff;font-size:12px;
  padding:7px 12px;border-radius:8px;white-space:nowrap;
  opacity:0;pointer-events:none;transition:opacity .3s ease;
}
.music-player.pos-bl .music-tip{right:50%;left:auto}
.music-tip.show{opacity:1}
.music-name{
  font-size:11px;color:#a7aebd;max-width:150px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;
}

/* ---------- 手机适配 ---------- */
@media(max-width:639px){
  .wrap{padding:10px 10px 90px}
  .card{border-radius:20px}
  .banner{height:150px}
  .avatar{width:78px;height:78px;margin-top:-40px;border-width:3px}
  .site-name{font-size:18.5px}
  .content{padding:6px 12px 0}
  .item{padding:13px 10px;gap:10px;border-radius:15px;min-height:58px}
  .item-icon,.item-icon .ico{width:28px;height:28px}
  .item-text b{font-size:14px}
  .qb{height:34px;padding:0 18px;font-size:13px}
  .foot{padding:18px 12px 16px}
  .music-player.pos-br{right:10px;bottom:10px}
  .music-player.pos-bl{left:10px;bottom:10px}
  .music-btn{width:44px;height:44px}
}
/* ---------- 自定义主页入口 ---------- */
.item-icon.custom-icon{
  width:34px;height:34px;border-radius:11px;
  color:#fff;font-size:15px;font-weight:700;
  box-shadow:0 4px 12px rgba(80,100,150,.18);
}

/* 深色系统偏好下保持浅色设计（导航站演示为浅色） */
@media(prefers-color-scheme:dark){
  body{color-scheme:light}
}
