/* 标题/展示字体：站酷快乐体（开源 OFL 协议），经 Google Fonts 中国镜像在线加载。
   按需分包（unicode-range 分片），只下载页面用到的字形分片，通常几十 KB，无需本地内置字体文件。 */
@import url('https://fonts.loli.net/css2?family=ZCOOL+KuaiLe&display=swap');
html,body {
  margin: 0;
}
html {
  font-size: 13.3333vw;
}
body {
  font-size: 16px;
  background-color: #fff;
  font-family: sans-serif;
}

body::after {
  content: '';
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-image: url('../images/hand-hold.png');
  background-size: auto 100%;
  background-position: 50% 100%;
  background-repeat: no-repeat;
}

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

main {
  width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

h1 {
  margin-top: 6vh;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: clamp(28px, 7vw, 44px);
  font-weight: normal;
  color: #252628;
  line-height: 1.1;
}

h1 .site-avatar {
  width: clamp(40px, 10vw, 56px);
  height: clamp(40px, 10vw, 56px);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

h1 .site-title-text {
  font-family: 'ZCOOL KuaiLe', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 赞助项的读屏专用文字（图标已示意，文字仅供辅助技术）；勿用 li span 这类宽选择器，
   否则会把第三方组件（如 APlayer 歌曲列表）里 li 内的 span 一并隐藏 */
li a .sr-only {
  position: absolute !important;
  clip: rect(1px 1px 1px 1px);
  clip: rect(1px, 1px, 1px, 1px);
  padding:0 !important;
  border:0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden;
}

/* 横幅区：只用 .banner 精确匹配，避免误伤其他 section（如音乐播放器 music-sec） */
section.banner {
  position: relative;
  display: block;
  padding: 35% 0 0;
  background-image: url('../images/banner.png');
  background-size: auto 100%;
  background-position: 0 50%;
  background-repeat: no-repeat;
  user-select: none;
}
section.banner, li a {
  border-radius: 6px;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background-color: rgba(0,18,165,.05);
  -webkit-user-select: none;
  user-select: none;
}

article {
  position: absolute;
  top: 0;
  right: 2.5%;
  bottom: 0;
  font-family: 'ZCOOL KuaiLe',sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 60%;
  overflow: hidden;
}

article h2 {
  margin: 0;
  font-size: .54rem;
  font-weight: normal;
  font-family: 'ZCOOL KuaiLe', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
article p {
  margin: 0;
  font-size: .32rem;
  line-height: 1.2;
  font-family: 'ZCOOL KuaiLe', sans-serif;
}

ul {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

li {
  padding-top: 100%;
  position: relative;
}

li a {
  position: absolute;
  z-index: 9;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 悬停/聚焦底色由内联 CSS 变量注入（app.js 按 config 的 hoverColor 计算），
   未自定义时 JS 会填入各图标品牌默认色，与摆放位置无关。
   图标为模板自带的 <img>（assets/ico/ 或三方 URL），颜色不做重着色。 */
li a:hover {
  background-color: var(--hbg, rgb(7 193 96/.2));
}

li .icon-img { width: 32%; }

li .qr {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  visibility: hidden;
  z-index: 8;
  border-radius: 6px;
}

a:focus,
a.selected {
  background-color: rgb(255 255 255 /.4)!important;
  box-shadow: inset 0 0 1px rgb(0 0 0 /.2);
}

a:focus .icon-img,
a.selected .icon-img {
  visibility: hidden;
}

a:focus .qr,
a.selected .qr {
  visibility: visible;
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0 5vh;
  color: #878b99;
}

/* 音乐播放器（APlayer + MetingJS）：紧跟赞助图标下方，普通文档流，无背景图无卡片包装 */
.music-sec {
  margin-top: 20px;
}
.music-sec .aplayer {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  font-family: sans-serif;
  margin: 0;
}
.music-sec .aplayer .aplayer-info .aplayer-music .aplayer-name { color: #252628; }
.music-sec .aplayer .aplayer-info .aplayer-music .aplayer-author { color: #8a8fa3; }
.music-sec .aplayer .aplayer-info .aplayer-controller .aplayer-time { color: #6a6d78; }
/* 歌曲列表：实底白底 + 明确文字色，保证展开后清晰可读 */
.music-sec .aplayer .aplayer-list {
  border-radius: 0 0 6px 6px;
  background: #fff;
}
.music-sec .aplayer .aplayer-list ol li {
  color: #333;
  border-top-color: #eee;
}
.music-sec .aplayer .aplayer-list ol li:hover { background: #f5f5f7; }
.music-sec .aplayer .aplayer-list ol li .aplayer-list-index { color: #a0a3b1; }
.music-sec .aplayer .aplayer-list ol li .aplayer-list-author { color: #8a8fa3; }
.music-sec .aplayer .aplayer-list ol li.aplayer-list-light { background: #f0f0f2; }
/* APlayer 图标按钮仅 15px，手机手指很难点中：用透明外扩层把热区扩大到约 35px */
.music-sec .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon {
  position: relative;
  touch-action: manipulation;
}
.music-sec .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon::before {
  content: '';
  position: absolute;
  top: -10px; right: -10px; bottom: -10px; left: -10px;
}
footer::before {
  content: '';
  display: block;
  width: 100px;
  height: 100px;
  background-image: url('../images/dissapoint.png');
  background-size: cover;
  background-repeat: no-repeat;
}
footer span::before {
  content: '''';
}

/* 加载屏：与页面同底色、弱化文字，数据到达后被 app.js 整块替换（平台统一规范） */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: #b8bcc8;
  font-family: 'ZCOOL KuaiLe', sans-serif;
}

@media screen and (orientation: portrait) and (max-width: 750px) {
  article {
    max-width: 65%;
  }
  article h2 {
    font-size: clamp(24px, 7vw, 40px);
    margin-right: 0.3rem;
  }
  article p {
    font-size: clamp(14px, 4vw, 20px);
    line-height: 1.3;
    margin-right: 0.3rem;
    margin-top: 4px;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }
  article p br {
    display: block;
  }
}
@media screen and (orientation: portrait) and (max-width: 560px) {
  ul {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media screen and (max-width: 800px) {
  main {
    width: auto;
    margin: 0 20px;
  }
}
@media screen and (min-width: 750px) {
  html { font-size: 100px;}
}
@media (prefers-color-scheme: dark) {
  body {
    background-color: #191919;
  }
  h1 {
    color: #fff;
  }
  h1 .site-avatar {
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
  }
  article {color: #fff;}
  section.banner, li a {
    background-color: rgb(255 255 255/.05);
    box-shadow: inset 0 0 1px rgb(255 255 255 / 30%), 0 0 1px rgb(0 0 0 / 30%);
  }
  li a:focus {
    background-color: rgb(255 255 255/.2)!important;
  }
  li a:hover {
    box-shadow: none;
  }
  /* 深色模式下给浅色图标垫一层底，避免与背景融为一体 */
  li .icon-img {
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.45));
  }
  footer {
    color: rgb(255 255 255/.2);
  }
  /* 音乐播放器：暗色玻璃拟态 */
  .music-sec .aplayer {
    background: rgba(255,255,255,.06);
    box-shadow: inset 0 0 1px rgb(255 255 255 / 30%), 0 0 1px rgb(0 0 0 / 30%);
  }
  .music-sec .aplayer .aplayer-info .aplayer-music .aplayer-name { color: #e8e8ec; }
  .music-sec .aplayer .aplayer-info .aplayer-music .aplayer-author { color: #9a9ba6; }
  .music-sec .aplayer .aplayer-info .aplayer-controller .aplayer-time { color: #9a9ba6; }
  .music-sec .aplayer .aplayer-list { background: rgba(30,30,32,.94); }
  .music-sec .aplayer .aplayer-list ol li { color: #c9cad2; border-top-color: rgba(255,255,255,.06); }
  .music-sec .aplayer .aplayer-list ol li:hover { background: rgba(255,255,255,.05); }
}
