/* ============================================================
   custom.css — 站点 UI 打磨层（在主题样式之后加载，仅做视觉微调）
   跟随主题 CSS 变量，深色模式自动适配。
   ============================================================ */

/* ---------- 全局 ---------- */
html { scroll-behavior: smooth; }
::selection { background: rgba(73, 177, 245, .25); }

/* ---------- 首页文章卡片：圆角、悬浮上浮 ---------- */
#recent-posts .recent-post-item {
  border-radius: 12px;
  border: 1px solid rgba(128, 128, 128, .12);
}
#recent-posts .recent-post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}
#recent-posts .recent-post-item:hover .article-title { color: #49b1f5; }
.recent-post-info { padding: 26px 32px; }
.recent-post-info .content { opacity: .85; }

/* 首页卡片 meta：Created 标签与日期之间的间距（主题只处理了 .post-meta-label） */
.article-meta-wrap .article-meta-label { margin-right: .35em; }
.article-meta-wrap time { margin-left: .25em; }

/* ---------- 侧栏卡片 ---------- */
.card-widget { border-radius: 12px; }
.card-widget:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .10); }

/* Follow Me 按钮：渐变 + 悬浮微动 */
#card-info-btn {
  background: linear-gradient(135deg, #49b1f5, #6f7ef2);
  box-shadow: 0 4px 12px rgba(73, 177, 245, .35);
}
#card-info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(73, 177, 245, .45);
}

/* ---------- 文章页排版 ---------- */
#article-container { line-height: 1.9; }
#article-container img {
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}
#article-container a:not(.fancybox):not(.post-meta-categories):not(.post-meta-categories-links) {
  text-decoration: none;
  border-bottom: 1px dashed rgba(73, 177, 245, .6);
  transition: color .3s, border-color .3s;
}
#article-container a:not(.fancybox):hover { color: #49b1f5; border-bottom-color: #49b1f5; }

/* 文章头 meta 日期间距 */
#post-info #post-meta time { margin-left: .2em; }

/* ---------- 分页 ---------- */
.pagination .page-number:hover,
.pagination .extend:hover { color: #fff; background: #49b1f5; }

/* ---------- 搜索结果日期/分类 ---------- */
#local-search-results .search-result-meta {
  display: inline-block;
  margin-left: 8px;
  font-size: .78rem;
  color: #999;
}
#local-search-results .search-result-sep { margin: 0 6px; opacity: .6; }

/* ---------- 文章目录（TOC）卡片 ---------- */
#card-toc .card-toc-body { padding: 8px 18px 14px; font-size: .88rem; }
#card-toc .toc-list, #card-toc .toc-list ul { list-style: none; margin: 0; padding-left: 0; }
#card-toc .toc-sub { padding-left: 14px; }
#card-toc .toc-item { margin: 2px 0; line-height: 1.6; }
#card-toc .toc-item a {
  display: block;
  color: var(--font-color);
  padding: 3px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all .2s;
}
#card-toc .toc-item a:hover { color: #49b1f5; background: rgba(73, 177, 245, .08); }
#card-toc .toc-level-2 > a { border-left-color: #49b1f5; }
#card-toc .toc-level-3 > a { opacity: .8; }

/* ---------- 代码块工具条（语言标签 + 复制/折叠/全屏按钮） ----------
   主题 CSS 没有为 main.js 注入的 .highlight-tools 提供样式，这里补齐；
   同时适配 kramdown/rouge 的 div.highlighter-rouge 结构。 */
#article-container .highlight-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eff1f3;
  color: #6a737d;
  font-size: .8rem;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
}
#article-container .highlight-tools .code-lang { text-transform: uppercase; user-select: none; }
#article-container .highlight-tools i { cursor: pointer; transition: color .3s; }
#article-container .highlight-tools i:hover { color: #49b1f5; }
#article-container .highlight-tools .expand { transition: transform .3s; }
#article-container .highlight-tools.closed .expand { transform: rotate(-90deg); }
#article-container .highlight-tools.closed ~ * { display: none; }
#article-container div.highlighter-rouge { margin: 14px 0; }
#article-container div.highlighter-rouge:has(.highlight-tools) pre {
  border-radius: 0 0 8px 8px;
  margin-top: 0;
}
[data-theme=dark] #article-container .highlight-tools { background: #2b3a4e; color: #a3b2c2; }
[data-theme=dark] #article-container div.highlighter-rouge:has(.highlight-tools) pre {
  border-radius: 0 0 8px 8px;
}

/* ---------- 右侧悬浮按钮 ---------- */
#rightside button:hover,
#rightside a:hover { background: #49b1f5; color: #fff; }

/* ---------- 首页文章卡片封面 ----------
   卡片固定高度，所有封面统一长宽；
   桌面端封面与文字左右排布，奇偶交替方向；
   移动端（<=768px）封面全宽置顶，高度统一 180px。 */
#recent-posts .recent-post-item.has-cover {
  display: flex;
  align-items: stretch;
  height: 250px;
}
#recent-posts .recent-post-item.has-cover.cover-right { flex-direction: row-reverse; }
#recent-posts .recent-post-item.has-cover .post-cover {
  display: block;
  flex: 0 0 42%;
  overflow: hidden;
}
#recent-posts .recent-post-item.has-cover .cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
#recent-posts .recent-post-item.has-cover:hover .cover-img { transform: scale(1.06); }
#recent-posts .recent-post-item.has-cover .recent-post-info { flex: 1; min-width: 0; overflow: hidden; }

@media (max-width: 768px) {
  #recent-posts .recent-post-item.has-cover,
  #recent-posts .recent-post-item.has-cover.cover-right {
    flex-direction: column;
    height: auto;
  }
  #recent-posts .recent-post-item.has-cover .post-cover {
    flex: none;
    width: 100%;
    height: 180px;
  }
}

/* ---------- 阅读进度条 ---------- */
#reading-progress {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #49b1f5, #6f7ef2);
  transition: width .1s linear;
  pointer-events: none;
}
.type-post #reading-progress { display: block; }

/* ---------- 文末公众号引流卡片 ---------- */
.qrcode-promo {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 30px 0;
  padding: 22px 26px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(73, 177, 245, .10), rgba(111, 126, 242, .12));
  border: 1px solid rgba(73, 177, 245, .25);
}
.qrcode-promo__text { flex: 1; }
.qrcode-promo__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.qrcode-promo__desc { font-size: .9rem; line-height: 1.8; opacity: .9; }
.qrcode-promo__desc b { color: #49b1f5; }
.qrcode-promo__img {
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
@media (max-width: 600px) {
  .qrcode-promo { flex-direction: column; text-align: center; }
}

/* ---------- 相关文章（延伸阅读） ---------- */
.related-posts { margin: 26px 0; }
.related-posts__title { font-size: 1.02rem; font-weight: 600; margin-bottom: 14px; color: var(--text-highlight-color, #34495e); }
.related-posts__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.related-post {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid rgba(128, 128, 128, .12);
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.related-post:hover {
  transform: translateY(-3px);
  border-color: rgba(73, 177, 245, .5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
}
.related-post__title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-highlight-color, #34495e);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-post:hover .related-post__title { color: #49b1f5; }
.related-post__meta { font-size: .8rem; color: #999; }

/* ---------- TOC 滚动高亮 ---------- */
#card-toc .toc-item a.active {
  color: #49b1f5;
  background: rgba(73, 177, 245, .10);
  border-left-color: #49b1f5;
  font-weight: 600;
}

/* ---------- 右侧随机一读按钮 ---------- */
#go-random:hover { background: #6f7ef2; color: #fff; }

/* ---------- 友链页面 ---------- */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.friend-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid rgba(128, 128, 128, .12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.friend-card:hover {
  transform: translateY(-3px);
  border-color: rgba(73, 177, 245, .5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
}
.friend-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.friend-card__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.friend-card__name { font-size: .98rem; color: var(--text-highlight-color, #34495e); }
.friend-card:hover .friend-card__name { color: #49b1f5; }
.friend-card__desc {
  font-size: .82rem;
  color: #999;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 首页 iOS 桌面 ---------- */
body.home #page-header { display: none; }
.ios-desktop {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 14px 6vw 18px;
  overflow: hidden;
  background: url(/assets/images/wallpaper.jpg) center / cover no-repeat fixed;
}
/* 压暗一层，保证白色图标标签可读（层级在动态壁纸之上、桌面内容之下） */
.ios-desktop::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 25, 50, .10), rgba(20, 25, 50, .28));
  pointer-events: none;
}
/* 动态壁纸图层：加载成功后淡入，盖在静态壁纸上、遮罩之下 */
.ios-wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity .9s ease;
  pointer-events: none;
}
.ios-wallpaper.is-ready { opacity: 1; }
/* 壁纸透明度滑杆（现控制桌面组件透明度） */
.wp-op-row { display: flex; align-items: center; gap: 10px; padding: 2px 2px 12px; }
.wp-op-row input[type=range] { flex: 1; accent-color: #49b1f5; cursor: pointer; }
.wp-op-row .wp-op-val { font-size: .8rem; min-width: 44px; text-align: right; color: #1f2d3d; }
[data-theme=dark] .wp-op-row .wp-op-val { color: #d8e2ec; }
/* 桌面组件透明度（0% = 只显示完整壁纸；控制中心与打开的应用不受影响） */
.ios-statusbar, .ios-widgets, .ios-grid, .ios-dock { opacity: var(--cc-op, 1); }
@media (prefers-reduced-motion: reduce) {
  .ios-wallpaper { transition: none; }
}
.ios-statusbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  font-weight: 600;
  color: rgba(31, 45, 61, .85);
  padding: env(safe-area-inset-top) 4px 0;
}
.ios-statusbar__right { display: flex; gap: 10px; }

.ios-widgets {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  margin: 26px auto 10px;
  width: 100%;
  max-width: 1060px;
}
.ios-widget {
  flex: 1;
  border-radius: 22px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, .42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(31, 45, 61, .10);
  border: 1px solid rgba(255, 255, 255, .55);
}
.ios-widget__time { font-size: 2.4rem; font-weight: 700; color: #1f2d3d; line-height: 1.2; }
.ios-widget__date { font-size: .88rem; color: rgba(31, 45, 61, .75); margin-top: 4px; }
.ios-widget__hi { font-size: 1.05rem; font-weight: 600; color: #1f2d3d; }
.ios-widget__sub { font-size: .82rem; color: rgba(31, 45, 61, .65); margin-top: 8px; }

.ios-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 10px;
  width: 100%;
  max-width: 560px;
  margin: 30px auto;
}
.ios-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.ios-app__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 17px;
  color: #fff;
  font-size: 1.55rem;
  box-shadow: 0 6px 16px rgba(31, 45, 61, .22), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s ease, box-shadow .25s ease;
}
/* 运行中的应用在 Dock 图标下方亮一颗小圆点（macOS 风格） */
.ios-app.is-running .ios-app__icon::after,
#dock-game .ios-app__icon::after,
#dock-tool .ios-app__icon::after,
#dock-photos .ios-app__icon::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 5px rgba(255, 255, 255, .65);
}

/* Dock 右键菜单 */
.dock-menu {
  position: fixed;
  z-index: 3000;
  min-width: 148px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(28, 36, 50, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.dock-menu__title {
  font-size: .72rem;
  color: #8b98a5;
  padding: 4px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.dock-menu button {
  border: none;
  background: transparent;
  color: #e6edf3;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .86rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.dock-menu button:hover { background: rgba(255, 255, 255, .12); }
.dock-menu button.is-danger:hover { background: #ff453a; color: #fff; }
@media (hover: hover) {
  .ios-app:hover .ios-app__icon { transform: scale(1.1); box-shadow: 0 10px 24px rgba(31, 45, 61, .30); }
}
.ios-app:active .ios-app__icon { transform: scale(.96); }
.ios-app__label {
  font-size: .8rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 3px rgba(31, 45, 61, .55), 0 0 8px rgba(31, 45, 61, .35);
}

.ios-search {
  position: relative;
  z-index: 2;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px auto 16px;
  padding: 9px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: rgba(31, 45, 61, .8);
  font-size: .88rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(31, 45, 61, .08);
  transition: transform .25s;
}
@media (hover: hover) { .ios-search:hover { transform: scale(1.04); } }

.ios-dock {
  position: relative;
  z-index: 2;
  align-self: center;
  display: flex;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, .38);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 10px 30px rgba(31, 45, 61, .12);
}
.ios-dock .ios-app__icon { width: 52px; height: 52px; font-size: 1.3rem; }
.ios-scroll-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(31, 45, 61, .55);
  font-size: .95rem;
  animation: ios-bounce 2s infinite;
}
@keyframes ios-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

@media (max-width: 768px) {
  .ios-desktop { padding: 12px 7vw calc(14px + env(safe-area-inset-bottom)); }
  .ios-widgets { flex-direction: column; gap: 12px; margin-top: 18px; }
  .ios-grid { grid-template-columns: repeat(4, 1fr); gap: 20px 6px; }
  .ios-app__icon { width: 56px; height: 56px; border-radius: 15px; font-size: 1.3rem; }
  .ios-widget__time { font-size: 1.9rem; }
  /* Dock 一行 8 个图标放不下小屏：缩小间距 + 允许横向滚动 */
  .ios-dock { gap: 9px; padding: 10px 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ios-dock::-webkit-scrollbar { display: none; }
  .ios-dock .ios-app { flex: none; }
  .ios-dock .ios-app__icon { width: 46px; height: 46px; font-size: 1.15rem; }
  .ios-dock .ios-app__icon--img img,
  .ios-dock .ios-app__letter { border-radius: 13px; }
  .ios-scroll-hint { display: none; }
}

[data-theme=dark] .ios-desktop {
  background-image: url(/assets/images/wallpaper-dark.jpg);
}
[data-theme=dark] .ios-desktop::before {
  background: linear-gradient(180deg, rgba(0, 0, 10, .30), rgba(0, 0, 10, .45));
}
[data-theme=dark] .ios-widget,
[data-theme=dark] .ios-search,
[data-theme=dark] .ios-dock {
  background: rgba(30, 42, 58, .55);
  border-color: rgba(255, 255, 255, .08);
}
[data-theme=dark] .ios-widget__time,
[data-theme=dark] .ios-widget__hi,
[data-theme=dark] .ios-search { color: #d8e2ec; }
[data-theme=dark] .ios-widget__date,
[data-theme=dark] .ios-widget__sub { color: rgba(216, 226, 236, .6); }
[data-theme=dark] .ios-statusbar { color: rgba(216, 226, 236, .85); }

/* iOS 桌面需全宽：首页取消主题双栏与内容限宽 */
body.home .layout { display: block; }
body.home #content-inner { max-width: 100%; margin: 0; padding: 0; }
body.home #aside-content { display: none; }
body.home #recent-posts {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 16px 40px;
}
body.home #recent-posts .recent-post-item { margin-bottom: 24px; }
body.home #pagination { max-width: 1100px; margin: 0 auto; }

/* ---------- iOS 桌面音乐组件（免费 Meting API · 网易云歌单） ---------- */
.ios-widget--music {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1.4;
}
.music-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 3px 10px rgba(31, 45, 61, .18);
}
.music-info { flex: 1; min-width: 0; }
.music-name {
  font-size: .92rem;
  font-weight: 600;
  color: #1f2d3d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-artist {
  font-size: .78rem;
  color: rgba(31, 45, 61, .65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 6px;
}
.music-progress {
  height: 3px;
  border-radius: 2px;
  background: rgba(31, 45, 61, .15);
  overflow: hidden;
}
.music-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, #49b1f5, #6f7ef2);
  transition: width .3s linear;
}
.music-ctrl { display: flex; flex-direction: column; gap: 6px; }
.music-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(31, 45, 61, .12);
  color: #1f2d3d;
  font-size: .78rem;
  cursor: pointer;
  transition: background .25s, transform .2s;
}
.music-btn:hover { background: #49b1f5; color: #fff; transform: scale(1.08); }
.music-btn:active { transform: scale(.94); }
[data-theme=dark] .ios-widget--music .music-name { color: #d8e2ec; }
[data-theme=dark] .ios-widget--music .music-artist { color: rgba(216, 226, 236, .6); }
[data-theme=dark] .music-btn { background: rgba(216, 226, 236, .15); color: #d8e2ec; }

/* ---------- 音乐 App 弹窗（仿 macOS Music） ---------- */
.ios-app__icon--music { background: linear-gradient(135deg, #fc5c7d, #e6194b) !important; }
.music-app { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; }
.music-app[hidden] { display: none; }
.music-app__mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.music-app__window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, 94vw);
  height: min(640px, 88vh);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(24, 32, 44, .96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: #e6edf3;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.music-app__lights { display: flex; gap: 8px; padding: 12px 14px 0; }
.music-app__lights span { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; }
.music-app__lights .l-red { background: #ff5f57; }
.music-app__lights .l-yellow { background: #febc2e; }
.music-app__lights .l-green { background: #28c840; }
.music-app__body { flex: 1; display: flex; overflow: hidden; }
.music-side {
  width: 180px;
  flex: none;
  padding: 12px 10px;
  background: rgba(255, 255, 255, .05);
  overflow: auto;
}
.music-side__title { font-size: .8rem; color: #8b98a5; margin: 4px 8px 8px; }
.music-playlists { list-style: none; margin: 0; padding: 0; }
.music-playlists li {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .92rem;
  cursor: pointer;
  transition: background .2s;
}
.music-playlists li:hover { background: rgba(255, 255, 255, .08); }
.music-playlists li.active { background: #49b1f5; color: #fff; font-weight: 600; }
.music-side__foot { margin-top: 18px; padding: 0 8px; font-size: .68rem; color: #5c6b7a; }
.music-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 8px 8px 0 4px; }
.music-main__title { font-size: 1.15rem; font-weight: 700; padding: 6px 14px 10px; }
.music-songs { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 6px 12px; }
.music-loading { padding: 20px 14px; color: #8b98a5; font-size: .9rem; }
.song-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .92rem;
  transition: background .2s;
}
.song-row:hover { background: rgba(255, 255, 255, .07); }
.song-row.playing { color: #49b1f5; }
.song-row.playing .song-row__name::after { content: ' ♪'; }
.song-row__idx { width: 26px; flex: none; color: #6b7a89; font-size: .82rem; }
.song-row__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-row__artist { width: 32%; flex: none; color: #8b98a5; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.music-player {
  height: 76px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(12, 18, 26, .95);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.music-player__cover { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; flex: none; }
.music-player__info { flex: 1; min-width: 0; }
.music-player__info b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-player__info span { display: block; font-size: .78rem; color: #8b98a5; margin: 2px 0 6px; }
.music-progress--dark { background: rgba(255, 255, 255, .12); }
.music-progress--dark span { background: #49b1f5; }
.music-player__ctrl { display: flex; align-items: center; gap: 10px; flex: none; }
.music-player__ctrl button {
  width: 38px; height: 38px;
  border: none; border-radius: 50%;
  background: transparent; color: #e6edf3;
  font-size: .95rem; cursor: pointer;
  transition: background .2s, transform .2s;
}
.music-player__ctrl button:hover { background: rgba(255, 255, 255, .1); }
.music-player__ctrl .is-play { background: #49b1f5; width: 44px; height: 44px; font-size: 1.05rem; }
.music-player__ctrl .is-play:hover { background: #6cc0f7; }

@media (max-width: 720px) {
  .music-side { display: none; }
  .music-app__window { height: 92vh; }
}

/* ---------- 音乐 App 发现页 ---------- */
.music-side__brand {
  font-size: 1rem;
  font-weight: 700;
  padding: 4px 10px 14px;
  color: #e6edf3;
}
.music-side__brand i { color: #fc5c7d; margin-right: 4px; }
.music-nav { list-style: none; margin: 0; padding: 0; }
.music-nav li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .92rem;
  cursor: pointer;
  color: #c6d2de;
  transition: background .2s;
}
.music-nav li:hover { background: rgba(255, 255, 255, .08); }
.music-nav li.active { background: #49b1f5; color: #fff; font-weight: 600; }
.music-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.music-view[hidden] { display: none; }
.music-banner {
  position: relative;
  margin: 10px 12px 6px;
  border-radius: 12px;
  min-height: 110px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.music-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(73, 177, 245, .92), rgba(111, 126, 242, .78));
}
.music-banner__text {
  position: relative;
  padding: 18px 22px;
  color: #fff;
}
.music-banner__text b { display: block; font-size: 1.25rem; margin-bottom: 6px; }
.music-banner__text span { font-size: .82rem; opacity: .9; }
.music-banner__play {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .25s, background .25s;
}
.music-banner__play:hover { transform: translateY(-50%) scale(1.1); background: rgba(255, 255, 255, .4); }
.music-sec-title { font-size: 1.02rem; font-weight: 700; padding: 12px 16px 8px; }
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 0 14px 16px;
  overflow-y: auto;
}
.playlist-card { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.playlist-card__cover {
  position: relative;
  display: block;
  padding-top: 100%;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  transition: transform .3s, box-shadow .3s;
}
.playlist-card:hover .playlist-card__cover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0, 0, 0, .35); }
.playlist-card__play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: .8rem;
  opacity: 0;
  transition: opacity .25s;
}
.playlist-card:hover .playlist-card__play { opacity: 1; }
.playlist-card__count {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: .68rem;
  color: #fff;
  background: rgba(0, 0, 0, .4);
  padding: 2px 8px;
  border-radius: 999px;
}
.playlist-card__name { font-size: .92rem; font-weight: 600; color: #e6edf3; }
.playlist-card:hover .playlist-card__name { color: #49b1f5; }
.playlist-card__desc { font-size: .74rem; color: #8b98a5; }
.music-back {
  padding: 8px 14px 0;
  font-size: .82rem;
  color: #8b98a5;
  cursor: pointer;
  transition: color .2s;
}
.music-back:hover { color: #49b1f5; }
.music-heart {
  width: 36px;
  height: 36px;
  flex: none;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #8b98a5;
  font-size: 1rem;
  cursor: pointer;
  transition: color .25s, transform .2s;
}
.music-heart:hover { color: #fc5c7d; transform: scale(1.12); }
.music-heart.liked { color: #fc5c7d; }
.music-player__time {
  flex: none;
  font-size: .78rem;
  color: #8b98a5;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .music-player__time { display: none; }
}

/* ---------- 游戏组件与游戏机弹窗 ---------- */
.ios-widget--games {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  flex: 0.9;
}
/* 壁纸组件：当前壁纸缩略图 + 标签，点击打开换壁纸弹窗 */
.ios-widget--wallpaper {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  flex: 0.9;
}
.wp-thumb {
  height: 64px;
  border-radius: 12px;
  background: center / cover no-repeat;
  box-shadow: 0 2px 6px rgba(31, 45, 61, .18);
  transition: transform .25s;
}
.ios-widget--wallpaper:hover .wp-thumb { transform: translateY(-2px); }
.wp-label { font-size: .78rem; color: rgba(31, 45, 61, .7); }
[data-theme=dark] .wp-label { color: rgba(216, 226, 236, .7); }
[data-theme=dark] .ios-widget--wallpaper .wp-thumb { box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.games-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.games-preview__app {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(31, 45, 61, .18);
  transition: transform .25s;
}
.ios-widget--games:hover .games-preview__app { transform: translateY(-2px); }
.games-preview__label { font-size: .78rem; color: rgba(31, 45, 61, .7); }
[data-theme=dark] .games-preview__label { color: rgba(216, 226, 236, .7); }

.games-app__window { height: min(640px, 88vh); }
.games-home { padding: 24px 28px; overflow-y: auto; }
.games-home__title { font-size: 1.25rem; font-weight: 700; margin-bottom: 18px; color: #e6edf3; }
.games-home__title i { color: #fc5c7d; margin-right: 6px; }
.games-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.game-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: transform .25s, background .25s;
}
.game-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .12); }
.game-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.game-card b { font-size: .98rem; color: #e6edf3; }
.game-card span { font-size: .76rem; color: #8b98a5; }
.games-hint { margin-top: 18px; font-size: .78rem; color: #5c6b7a; }

.games-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 16px;
  overflow: auto;
}
.games-stage__head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  color: #e6edf3;
}
.games-stage__head b { flex: 1; text-align: center; font-size: 1.05rem; }
.games-stage__score { font-size: .85rem; color: #8b98a5; font-variant-numeric: tabular-nums; }
.games-stage__btn {
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  color: #e6edf3;
  font-size: .85rem;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .2s;
}
.games-stage__btn:hover { background: rgba(255, 255, 255, .2); }
#games-canvas {
  border-radius: 12px;
  max-width: 100%;
  height: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.games-pad {
  display: none;
  grid-template-areas: '. u .' 'l d r';
  gap: 8px;
}
.games-pad button {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  color: #e6edf3;
  font-size: 1.05rem;
  cursor: pointer;
}
.games-pad button:active { background: #49b1f5; }
@media (pointer: coarse) { .games-pad { display: grid; } }

/* ---------- 游戏中心：4399 H5 游戏架 ---------- */
.games-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 0;
}
.games-tabs button {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: .88rem;
  background: rgba(255, 255, 255, .08);
  color: #c6d2de;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.games-tabs button.active { background: #49b1f5; color: #fff; font-weight: 600; }
.games-content { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.games-h5 { flex: 1; overflow-y: auto; padding: 12px 16px 16px; }
.h5-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 16px 10px;
}
.h5-card { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.h5-card__icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .28);
  transition: transform .25s, box-shadow .25s;
}
.h5-card:hover .h5-card__icon { transform: scale(1.08); box-shadow: 0 10px 22px rgba(0, 0, 0, .38); }
.h5-card__name {
  font-size: .78rem;
  color: #c6d2de;
  max-width: 96px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h5-card:hover .h5-card__name { color: #49b1f5; }
.h5-card__src { font-size: .66rem; color: #5c6b7a; }
.games-iframe { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: #0d141d; }
.games-iframe[hidden] { display: none; }
.games-iframe__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, .06);
}
.games-iframe__bar b { flex: 1; text-align: center; font-size: .92rem; color: #e6edf3; }
.games-iframe__bar button {
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  color: #e6edf3;
  font-size: .8rem;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .2s;
}
.games-iframe__bar button:hover { background: rgba(255, 255, 255, .22); }
#games-iframe-frame { flex: 1; width: 100%; border: none; background: #000; }

/* ---------- 游戏弹窗（毛玻璃图标页 + 游戏页） ---------- */
.games-pop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.games-pop[hidden] { display: none; }
.games-pop__window {
  position: relative;
  width: min(760px, 92vw);
  height: min(560px, 80vh);
  border-radius: 20px;
  background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 30px 80px rgba(31, 45, 61, .25);
  overflow: hidden;
}
[data-theme=dark] .games-pop__window {
  background: rgba(24, 34, 46, .78);
  border-color: rgba(255, 255, 255, .1);
}
.games-pop__close {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 3;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(31, 45, 61, .18);
  color: rgba(31, 45, 61, .7);
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s;
}
.games-pop__close:hover { background: #ff5f57; color: #fff; }
[data-theme=dark] .games-pop__close { background: rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .7); }
.games-pop__title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2d3d;
  padding: 16px 0 4px;
}
[data-theme=dark] .games-pop__title { color: #e6edf3; }
.games-pop__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 20px 8px;
  padding: 16px 22px 22px;
  overflow-y: auto;
  max-height: calc(100% - 60px);
}
.games-pop__app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.games-pop__app img {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(31, 45, 61, .22);
  transition: transform .25s, box-shadow .25s;
}
@media (hover: hover) { .games-pop__app:hover img { transform: scale(1.1); box-shadow: 0 10px 22px rgba(31, 45, 61, .32); } }
.games-pop__app:active img { transform: scale(.95); }
.games-pop__app span {
  font-size: .74rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(31, 45, 61, .55), 0 0 8px rgba(31, 45, 61, .3);
  max-width: 96px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.games-pop__stage { position: absolute; inset: 0; background: #0d141d; }
.games-pop__stage[hidden] { display: none; }
#games-frame { width: 100%; height: 100%; border: none; background: #000; }
.games-pop__back {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}
.games-pop__back:hover { background: rgba(0, 0, 0, .7); }

/* Dock 上的游戏图标（打开过的游戏） */
.ios-app__icon--img { padding: 0; overflow: hidden; }
.ios-app__icon--img img { width: 100%; height: 100%; object-fit: cover; border-radius: 17px; }

/* hidden 属性优先于组件的 display 样式 */
.ios-app[hidden] { display: none !important; }

/* 游戏文字图标（无图时的兜底） */
.games-pop__letter,
.ios-app__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border-radius: 16px;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(31, 45, 61, .22);
}
.ios-app__letter { width: 100%; height: 100%; border-radius: 17px; font-size: 1.4rem; }

/* ---------- 壁纸弹窗（复用 games-pop 窗体样式） ---------- */
.wp-pop__window {
  width: min(680px, 92vw);
  height: auto;
  max-height: 84vh;
}
.wp-pop__body {
  padding: 4px 22px 20px;
  overflow-y: auto;
  max-height: calc(84vh - 60px);
}
.wp-pop__sec {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
  font-weight: 700;
  color: rgba(31, 45, 61, .65);
  margin: 14px 2px 9px;
}
[data-theme=dark] .wp-pop__sec { color: rgba(216, 226, 236, .65); }
.wp-bing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.wp-bing-item {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(31, 45, 61, .18);
  outline: 2px solid transparent;
  outline-offset: 1px;
  transition: transform .25s, outline-color .25s;
}
.wp-bing-item:hover { transform: translateY(-3px); }
.wp-bing-item.is-active { outline-color: #49b1f5; }
.wp-bing-item__img {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat;
}
.wp-bing-item__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 7px 4px;
  font-size: .68rem;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.wp-pop__hint {
  grid-column: 1 / -1;
  font-size: .8rem;
  color: rgba(31, 45, 61, .55);
  padding: 8px 2px;
}
[data-theme=dark] .wp-pop__hint { color: rgba(216, 226, 236, .5); }
.wp-rand-row { display: flex; flex-wrap: wrap; gap: 10px; }
.wp-rand-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 12px;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #1f2d3d;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.wp-rand-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .75); }
.wp-rand-btn--ghost { background: rgba(255, 255, 255, .28); }
.wp-pop__foot { margin-top: 14px; font-size: .72rem; color: rgba(31, 45, 61, .45); }
[data-theme=dark] .wp-rand-btn {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .12);
  color: #d8e2ec;
}
[data-theme=dark] .wp-rand-btn:hover { background: rgba(255, 255, 255, .18); }
[data-theme=dark] .wp-pop__foot { color: rgba(216, 226, 236, .45); }
@media (max-width: 640px) {
  .wp-bing-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 工具组件 + 工具箱弹窗 ---------- */
.ios-widget--tools {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  flex: 0.9;
}
.tools-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tools-preview__app {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  font-size: .8rem;
  box-shadow: 0 2px 6px rgba(31, 45, 61, .18);
  transition: transform .25s;
}
.ios-widget--tools:hover .tools-preview__app { transform: translateY(-2px); }
.tools-preview__label { font-size: .78rem; color: rgba(31, 45, 61, .7); }
[data-theme=dark] .tools-preview__label { color: rgba(216, 226, 236, .7); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 20px 8px;
  padding: 16px 22px 22px;
  overflow-y: auto;
  max-height: calc(100% - 60px);
}
.tools-pop__app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.tools-pop__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border-radius: 16px;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 6px 14px rgba(31, 45, 61, .22);
  transition: transform .25s, box-shadow .25s;
}
.tools-pop__app:hover .tools-pop__icon { transform: scale(1.1); box-shadow: 0 10px 22px rgba(31, 45, 61, .32); }
.tools-pop__app:active .tools-pop__icon { transform: scale(.95); }
.tools-pop__app > span:last-child {
  font-size: .74rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(31, 45, 61, .55), 0 0 8px rgba(31, 45, 61, .3);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme=dark] .tools-pop__app > span:last-child { color: #e6edf3; text-shadow: none; }

.tools-stage {
  position: absolute;
  inset: 0;
  padding: 56px 22px 20px;
  overflow-y: auto;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
[data-theme=dark] .tools-stage { background: rgba(24, 34, 46, .92); }
.tools-stage[hidden] { display: none; }
.tools-stage .games-pop__back { background: rgba(31, 45, 61, .12); color: #1f2d3d; }
.tools-stage .games-pop__back:hover { background: rgba(31, 45, 61, .3); color: #fff; }
[data-theme=dark] .tools-stage .games-pop__back { background: rgba(255, 255, 255, .14); color: #d8e2ec; }
.tool-pane[hidden] { display: none; }
.tool-pane { max-width: 460px; margin: 0 auto; }

.tool-row { display: flex; gap: 10px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.tool-label { font-size: .82rem; color: rgba(31, 45, 61, .65); min-width: 60px; flex: none; }
[data-theme=dark] .tool-label { color: rgba(216, 226, 236, .65); }
.tool-hint { font-size: .8rem; color: rgba(31, 45, 61, .5); }
[data-theme=dark] .tool-hint { color: rgba(216, 226, 236, .5); }
.tool-input {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(31, 45, 61, .18);
  background: rgba(255, 255, 255, .7);
  color: #1f2d3d;
  font: inherit;
  font-size: .9rem;
}
.tool-input:focus { outline: 2px solid rgba(73, 177, 249, .5); }
[data-theme=dark] .tool-input {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .15);
  color: #d8e2ec;
}
.tool-note { width: 100%; height: 220px; resize: vertical; line-height: 1.6; }
.tool-btn {
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  background: #0a84ff;
  color: #fff;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, filter .2s;
}
.tool-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.tool-btn--ghost { background: rgba(31, 45, 61, .12); color: #1f2d3d; }
[data-theme=dark] .tool-btn--ghost { background: rgba(255, 255, 255, .12); color: #d8e2ec; }
.tool-out {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #10161d;
  color: #d8e2ec;
  font-family: Consolas, Monaco, monospace;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow: auto;
}
.tool-out.is-err { color: #ff8a80; }
.tool-qr-wrap { text-align: center; margin-top: 16px; min-height: 120px; }
.tool-qr-img {
  width: 220px;
  height: 220px;
  background: #fff;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(31, 45, 61, .25);
}
.tool-stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.tool-stat__item {
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 10px;
  padding: 10px 12px;
}
[data-theme=dark] .tool-stat__item { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); }
.tool-stat__item b { display: block; font-size: 1.12rem; color: #1f2d3d; font-variant-numeric: tabular-nums; }
[data-theme=dark] .tool-stat__item b { color: #d8e2ec; }
.tool-stat__item span { font-size: .72rem; color: rgba(31, 45, 61, .55); }
[data-theme=dark] .tool-stat__item span { color: rgba(216, 226, 236, .55); }

/* iOS 风格计算器 */
.calc {
  width: 280px;
  margin: 0 auto;
  background: #16181c;
  border-radius: 20px;
  padding: 16px 14px 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}
.calc-display {
  color: #fff;
  text-align: right;
  font-size: 2.2rem;
  font-weight: 300;
  padding: 6px 8px 16px;
  min-height: 64px;
  overflow: hidden;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.calc-btn {
  height: 50px;
  border: none;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 500;
  cursor: pointer;
  background: #33343a;
  color: #fff;
  transition: filter .15s;
}
.calc-btn:active { filter: brightness(1.5); }
.calc-btn--fn { background: #a5a5a8; color: #000; }
.calc-btn--op { background: #ff9f0a; }
.calc-btn--op.is-active { filter: brightness(1.4); }
.calc-btn--zero {
  grid-column: span 2;
  border-radius: 25px;
  text-align: left;
  padding-left: 19px;
}
@media (max-width: 640px) {
  .tool-stat { grid-template-columns: repeat(2, 1fr); }
  .tools-stage { padding: 52px 14px 16px; }
}

/* ---------- 音乐 App 滚动歌词 ---------- */
.music-lyrics {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 86px;
  max-height: 46%;
  display: flex;
  flex-direction: column;
  background: rgba(18, 26, 38, .82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .4);
  overflow: hidden;
  z-index: 5;
}
.music-lyrics[hidden] { display: none; }
.music-lyrics__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  color: #e6edf3;
  font-size: .86rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.music-lyrics__head span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-lyrics__head button {
  flex: none;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #cfd8e3;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s;
}
.music-lyrics__head button:hover { background: rgba(255, 255, 255, .22); }
.music-lyrics__list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 24px;
  text-align: center;
  scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.lrc-line {
  padding: 7px 0;
  color: rgba(230, 237, 243, .45);
  font-size: .92rem;
  line-height: 1.5;
  transition: color .3s, font-size .3s;
  cursor: pointer;
}
.lrc-line:hover { color: rgba(230, 237, 243, .78); }
.lrc-line.active { color: #fff; font-weight: 700; font-size: 1.06rem; }

/* ---------- 工具箱补充：颜色块 / 番茄钟 ---------- */
.color-swatch {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(31, 45, 61, .2);
  background: transparent;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55);
}
[data-theme=dark] .color-swatch { border-color: rgba(255, 255, 255, .25); }
select.tool-input { appearance: auto; cursor: pointer; }
.tool-stat__item b { word-break: break-all; }
.pomo { text-align: center; padding: 6px 0; }
.pomo-time {
  font-size: 3.2rem;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  color: #1f2d3d;
  line-height: 1.2;
  letter-spacing: 2px;
}
[data-theme=dark] .pomo-time { color: #d8e2ec; }
.tool-out mark {
  background: #ffd60a;
  color: #000;
  border-radius: 3px;
  padding: 0 1px;
}

/* ---------- 小组件区改网格（8 个组件两行排布） ---------- */
.ios-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* ---------- 锁屏 ---------- */
#ios-lock {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: url(/assets/images/wallpaper.jpg) center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12vh 20px 8vh;
  cursor: pointer;
  transition: transform .7s cubic-bezier(.5, 0, .2, 1), opacity .7s;
}
#ios-lock::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 30, .42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
#ios-lock.unlocking {
  transform: translateY(-102%);
  opacity: .4;
  pointer-events: none;
}
/* 关键：ID 选择器的 display:flex 会压过 UA 的 [hidden] 规则，必须显式声明 */
#ios-lock[hidden] { display: none; }
.ios-lock__inner { position: relative; text-align: center; color: #fff; }
.ios-lock__brand {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 8px;
  opacity: 0;
  animation: lock-brand-in 1.1s .2s ease-out forwards;
  margin-bottom: 4vh;
}
@keyframes lock-brand-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(8px); }
  to { opacity: .92; transform: none; filter: blur(0); }
}
.ios-lock__time {
  font-size: clamp(4.5rem, 14vw, 8rem);
  font-weight: 200;
  line-height: 1.05;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .35);
  font-variant-numeric: tabular-nums;
}
.ios-lock__date { font-size: 1.25rem; margin-top: 10px; opacity: .92; }
.ios-lock__hint {
  position: relative;
  color: rgba(255, 255, 255, .9);
  font-size: .95rem;
  animation: lock-hint 2.2s ease-in-out infinite;
}
.ios-lock__hint i { display: block; margin-bottom: 6px; font-size: 1.2rem; }
@keyframes lock-hint {
  0%, 100% { transform: translateY(0); opacity: .75; }
  50% { transform: translateY(-8px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ios-lock__hint, .ios-lock__brand { animation: none; opacity: 1; }
  #ios-lock { transition: none; }
}

/* ---------- 状态栏控制中心按钮 + 面板 ---------- */
.cc-trigger {
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  color: inherit;
  font-size: .78rem;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
@media (hover: hover) { .cc-trigger:hover { background: rgba(255, 255, 255, .55); transform: scale(1.08); } }
[data-theme=dark] .cc-trigger { background: rgba(255, 255, 255, .14); }
.control-center {
  position: fixed;
  top: 52px;
  right: max(12px, 4vw);
  z-index: 2500;
  width: 300px;
  max-height: min(560px, calc(100vh - 80px));
  overflow-y: auto;
  padding: 14px 14px 16px;
  border-radius: 20px;
  background: rgba(26, 34, 48, .9);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  color: #e6edf3;
}
.control-center[hidden] { display: none; }
.cc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cc-head b { font-size: .95rem; }
.cc-head b i { color: #49b1f5; margin-right: 6px; }
.cc-head button {
  border: none; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: #cfd8e3; cursor: pointer;
}
.cc-head button:hover { background: rgba(255, 255, 255, .22); }
.cc-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 4px; }
.cc-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  color: #cfd8e3;
  font-size: .82rem;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.cc-tile i { font-size: 1.1rem; color: #8b98a5; }
.cc-tile:hover { transform: translateY(-1px); }
.cc-tile.on { background: rgba(73, 177, 249, .28); border-color: rgba(73, 177, 249, .5); color: #fff; }
.cc-tile.on i { color: #6cc0f7; }
.cc-sec { font-size: .74rem; color: #8b98a5; margin: 12px 4px 8px; }
.cc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  color: #d8e2ec;
  font-size: .8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.cc-btn:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }
.cc-running { display: flex; flex-direction: column; gap: 8px; }
.cc-empty { font-size: .8rem; color: rgba(216, 226, 236, .45); padding: 2px; }
.cc-app {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
}
.cc-app b { flex: 1; min-width: 0; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-app__icon {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .85rem;
}
.cc-app button {
  border: none; padding: 6px 10px; border-radius: 8px;
  background: rgba(73, 177, 249, .25); color: #6cc0f7;
  font-size: .76rem; cursor: pointer;
}
.cc-app button.is-danger { background: rgba(255, 69, 58, .18); color: #ff8a80; }
.cc-app button.is-danger:hover { background: #ff453a; color: #fff; }

/* ---------- 日历小组件 ---------- */
.ios-widget--calendar { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.cal-head { display: flex; align-items: baseline; gap: 8px; }
.cal-head b { font-size: 1.6rem; font-weight: 700; color: #1f2d3d; }
.cal-head span { font-size: .82rem; color: rgba(31, 45, 61, .6); }
[data-theme=dark] .cal-head b { color: #d8e2ec; }
[data-theme=dark] .cal-head span { color: rgba(216, 226, 236, .6); }
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px 0; text-align: center; }
.cal-week span { font-size: .62rem; color: rgba(31, 45, 61, .5); }
[data-theme=dark] .cal-week span { color: rgba(216, 226, 236, .5); }
.cal-days span {
  font-size: .68rem;
  line-height: 1.55;
  color: rgba(31, 45, 61, .82);
  border-radius: 6px;
}
[data-theme=dark] .cal-days span { color: rgba(216, 226, 236, .82); }
.cal-days span.today {
  background: #ff5f57;
  color: #fff;
  font-weight: 700;
}

/* ---------- 天气小组件 ---------- */
.ios-widget--weather { display: flex; flex-direction: column; justify-content: center; gap: 4px; cursor: pointer; }
.wx-main { display: flex; align-items: center; gap: 8px; }
.wx-icon { font-size: 1.7rem; line-height: 1; }
.wx-temp { font-size: 1.9rem; font-weight: 300; color: #1f2d3d; font-variant-numeric: tabular-nums; }
[data-theme=dark] .wx-temp { color: #d8e2ec; }
.wx-city { font-size: .78rem; color: rgba(31, 45, 61, .65); }
[data-theme=dark] .wx-city { color: rgba(216, 226, 236, .65); }
.wx-hours { display: flex; gap: 8px; margin-top: 2px; }
.wx-hours span { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: .64rem; color: rgba(31, 45, 61, .55); }
.wx-hours span em { font-style: normal; white-space: nowrap; }
[data-theme=dark] .wx-hours span { color: rgba(216, 226, 236, .55); }

/* ---------- 文章图标新文章角标 ---------- */
.ios-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ff3b30;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 59, 48, .45);
}

/* ---------- 壁纸弹窗自动换开关 ---------- */
.wp-auto {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: rgba(31, 45, 61, .7);
  margin: 4px 2px 0;
  cursor: pointer;
}
[data-theme=dark] .wp-auto { color: rgba(216, 226, 236, .7); }

/* ---------- 文章页工具栏（听全文/分享图/点赞/字号） ---------- */
.post-extras-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(73, 177, 249, .07);
  border: 1px solid rgba(73, 177, 249, .15);
}
.post-extras-bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: none;
  border-radius: 10px;
  background: rgba(73, 177, 249, .12);
  color: #2b7fd4;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
[data-theme=dark] .post-extras-bar button { background: rgba(73, 177, 249, .18); color: #6cc0f7; }
.post-extras-bar button:hover { transform: translateY(-1px); background: rgba(73, 177, 249, .22); }
.post-extras-bar #pe-like.liked { background: rgba(252, 92, 125, .16); color: #fc5c7d; }
.post-extras-bar #pe-like.pop { animation: pe-pop .45s; }
@keyframes pe-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.pe-font { margin-left: auto; display: inline-flex; gap: 6px; }
.pe-font button { font-size: .78rem; }

/* 分享海报弹层 */
.pe-poster-mask {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(10, 16, 30, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pe-poster {
  position: relative;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}
.pe-poster img { max-height: calc(92vh - 120px); max-width: min(420px, 86vw); border-radius: 12px; }
.pe-poster__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #ff5f57;
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
}
.pe-poster__foot { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: .8rem; color: #8b98a5; }
.pe-poster__save {
  padding: 7px 16px;
  border-radius: 10px;
  background: #49b1f5;
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
}

/* ---------- 书影清单页 ---------- */
.books-sec { margin: 26px 0; }
.books-sec__title { font-size: 1.12rem; font-weight: 700; margin-bottom: 14px; }
.books-sec__title small { color: #8b98a5; font-weight: 400; margin-left: 6px; }
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.book-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(73, 177, 249, .06);
  border: 1px solid rgba(73, 177, 249, .14);
  transition: transform .25s, box-shadow .25s;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31, 45, 61, .1); }
.book-card__title { font-weight: 700; color: #1f2d3d; text-decoration: none; }
.book-card__title:hover { color: #49b1f5; }
[data-theme=dark] .book-card__title { color: #d8e2ec; }
.book-card__author { font-size: .8rem; color: #8b98a5; }
.book-card__stars { color: #f0932b; font-size: .86rem; letter-spacing: 2px; }
.book-card__note { font-size: .78rem; color: #8b98a5; }

/* ---------- 友链朋友圈页 ---------- */
.fc-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.fc-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(73, 177, 249, .06);
  border: 1px solid rgba(73, 177, 249, .14);
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}
.fc-item:hover { transform: translateX(4px); box-shadow: 0 8px 20px rgba(31, 45, 61, .1); }
.fc-item__friend {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 700;
  color: #2b7fd4;
  background: rgba(73, 177, 249, .14);
  padding: 2px 9px;
  border-radius: 8px;
}
.fc-item__title { font-size: .98rem; color: #1f2d3d; }
.fc-item:hover .fc-item__title { color: #49b1f5; }
[data-theme=dark] .fc-item__title { color: #d8e2ec; }
.fc-item__meta { font-size: .76rem; color: #8b98a5; }
.fc-empty, .fc-loading { padding: 26px 0; color: #8b98a5; font-size: .9rem; }
.fc-foot { font-size: .8rem; color: #8b98a5; }

@media (max-width: 768px) {
  .ios-widgets { grid-template-columns: repeat(2, 1fr); }
  .control-center { right: 10px; left: 10px; width: auto; }
}

/* ---------- 控制中心入口更醒目 ---------- */
.cc-trigger {
  width: auto;
  height: 24px;
  padding: 0 11px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 600;
  animation: cc-hint 1.8s ease-in-out 3;
}
@keyframes cc-hint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(73, 177, 249, 0); }
  50% { box-shadow: 0 0 0 6px rgba(73, 177, 249, .35); }
}
@media (prefers-reduced-motion: reduce) {
  .cc-trigger { animation: none; }
}
@media (max-width: 640px) {
  .cc-trigger span { display: none; }
  .cc-trigger { width: 26px; padding: 0; justify-content: center; }
}

/* ---------- 功能指南 ---------- */
.cc-guide-toggle { cursor: pointer; display: flex; align-items: center; gap: 6px; user-select: none; }
.cc-guide-toggle:hover { color: #d8e2ec; }
.cc-guide-arrow { transition: transform .25s; margin-left: auto; }
.cc-guide { display: flex; flex-direction: column; gap: 9px; }
.cc-guide[hidden] { display: none; }
.cc-g { display: flex; gap: 9px; align-items: flex-start; }
.cc-g > i { flex: none; width: 15px; text-align: center; color: #49b1f5; font-size: .78rem; margin-top: 2px; }
.cc-g b { display: block; font-size: .8rem; color: #e6edf3; }
.cc-g span { font-size: .74rem; line-height: 1.5; color: rgba(216, 226, 236, .55); }
.cc-g a { color: #6cc0f7; text-decoration: none; }
.cc-g a:hover { text-decoration: underline; }

/* ---------- 相册组件（回忆录重构） ---------- */
.photos-home {
  height: calc(100% - 52px);
  overflow-y: auto;
  padding: 2px 22px 22px;
}
.photos-sec {
  font-size: .84rem;
  font-weight: 700;
  color: rgba(31, 45, 61, .6);
  margin: 14px 2px 10px;
}
[data-theme=dark] .photos-sec { color: rgba(216, 226, 236, .6); }
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.photo-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background: #dfe6ee;
  box-shadow: 0 4px 12px rgba(31, 45, 61, .15);
}
[data-theme=dark] .photo-card { background: #26313f; }
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.photo-card:hover img { transform: scale(1.08); }
.photo-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: #ff0000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.photo-card__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 5px;
  font-size: .7rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photos-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #0d141d;
  display: flex;
  flex-direction: column;
  padding: 52px 58px 12px;
}
.photos-stage[hidden] { display: none; }
.photos-stage .games-pop__back { z-index: 3; }
.photos-viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photos-viewer img,
.photos-viewer video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
}
.photos-caption {
  text-align: center;
  color: #cfd8e3;
  font-size: .84rem;
  padding-top: 8px;
}
.photos-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s;
}
.photos-nav:hover { background: rgba(255, 255, 255, .32); }
.photos-nav--prev { left: 12px; }
.photos-nav--next { right: 12px; }

/* ---------- 视频壁纸层 ---------- */
.ios-wallpaper-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* ---------- 全站 mini 播放条（非首页） ---------- */
#global-mini-player {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 264px;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(20, 28, 40, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .35);
  overflow: hidden;
}
#global-mini-player[hidden] { display: none; }
#gmp-cover {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
}
.gmp-info { flex: 1; min-width: 0; }
.gmp-info b {
  display: block;
  font-size: .84rem;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gmp-info span {
  display: block;
  font-size: .7rem;
  color: #8b98a5;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#gmp-toggle, #gmp-next, #gmp-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #e6edf3;
  font-size: .82rem;
  cursor: pointer;
  transition: background .2s;
}
#gmp-toggle { background: #49b1f5; width: 34px; height: 34px; }
#gmp-toggle:hover { background: #6cc0f7; }
#gmp-next:hover, #gmp-close:hover { background: rgba(255, 255, 255, .12); }
#gmp-close { color: #8b98a5; }
.gmp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, .08);
}
.gmp-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: #49b1f5;
  transition: width .3s linear;
}
@media (max-width: 640px) {
  #global-mini-player { right: 10px; bottom: 10px; width: min(264px, calc(100vw - 20px)); }
}

/* ---------- 相册灯箱下载按钮 ---------- */
.photos-dl {
  position: absolute;
  right: 14px;
  bottom: 40px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
  transition: background .2s, transform .2s;
}
.photos-dl:hover { background: #49b1f5; transform: translateY(-2px); }

/* ---------- 移动端触控 & 无障碍 ---------- */
/* iOS Safari：fixed 背景在触屏上会抖动/错位，改用随内容滚动 */
@media (hover: none), (pointer: coarse) {
  .ios-desktop { background-attachment: scroll; }
}
/* 触屏：去掉点按高亮蓝框，避免与交互冲突 */
.ios-desktop, .ios-dock, .ios-grid,
.ios-app, .ios-widget, .games-pop__app, .cc-tile, .cc-btn,
.dock-menu button { -webkit-tap-highlight-color: transparent; }
/* Dock 长按走自定义菜单，屏蔽原生长按（复制/链接菜单） */
.ios-dock .ios-app,
.ios-dock .ios-app__icon { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
@media (prefers-reduced-motion: reduce) {
  .ios-scroll-hint { animation: none; }
  .ios-app__icon, .ios-search, .cc-trigger, .games-pop__app img { transition: none; }
}
/* 小屏设备 Dock 图标下方留出触控余量 */
@media (max-width: 768px) {
  .ios-dock { margin-bottom: env(safe-area-inset-bottom); }
  .music-player__ctrl button { width: 44px; height: 44px; }
}

/* ---------- App 启动动效（从图标处放大弹出） ---------- */
.music-app, .games-pop { will-change: transform; }
.is-launching { animation: ios-launch .32s cubic-bezier(.22, .9, .36, 1); }
@keyframes ios-launch {
  from { transform: scale(.35); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.is-closing { animation: ios-close .22s ease-in forwards; }
@keyframes ios-close {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(.92); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .is-launching, .is-closing { animation: none; } }

/* ---------- 文章阅读进度条 ---------- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 4000;
  background: linear-gradient(90deg, #4c8bf5, #9a6cf5, #f56ec6);
  pointer-events: none;
}

/* ---------- 离线提示胶囊 ---------- */
.offline-pill {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: rgba(31, 45, 61, .92);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: .85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 3000;
}
.offline-pill.is-offline { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 每日一言组件 ---------- */
.ios-widget__quote { margin-top: 8px; font-size: .74rem; line-height: 1.5; color: rgba(31, 45, 61, .72); }
.ios-widget__quote .ios-quote__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ios-widget__quote .ios-quote__src { display: block; margin-top: 2px; font-size: .66rem; color: rgba(31, 45, 61, .5); }
[data-theme=dark] .ios-widget__quote { color: rgba(216, 226, 236, .72); }
[data-theme=dark] .ios-widget__quote .ios-quote__src { color: rgba(216, 226, 236, .5); }

/* ---------- 日历农历 / 节日 ---------- */
.cal-lunar { font-size: .66rem; color: rgba(31, 45, 61, .6); margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme=dark] .cal-lunar { color: rgba(216, 226, 236, .6); }
.cal-days span.fest { color: #e8590c; font-weight: 600; }
[data-theme=dark] .cal-days span.fest { color: #ffab70; }
.cal-days span.today.fest { color: #fff; }
