* {
  box-sizing: border-box;
}

@font-face {
  font-family: "Zpix";
  src: url("https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font/dist/Zpix.ttf") format("truetype");
  font-display: swap;
}

:root {
  --font-pixel: "Zpix", "SimSun", "宋体", monospace;
  --font-kai: "LXGW ZhenKai GB", "Ma Shan Zheng", "KaiTi", "楷体", serif;

  --aero-ink: #0b2f5c;
  --aero-deep: #1257c4;
  --aero-glow: rgba(55, 130, 240, .5);
  --aero-edge: rgba(255, 255, 255, .85);
  --aero-shadow: rgba(16, 64, 130, .2);
  --gel: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .5) 48%, rgba(210, 230, 250, .35) 52%, rgba(172, 206, 246, .55) 100%);
  --gel-on: linear-gradient(180deg, rgba(255, 255, 255, .8) 0%, rgba(110, 175, 250, .94) 46%, rgba(45, 130, 235, .97) 54%, rgba(16, 90, 205, 1) 100%);
  --gel-sh: inset 0 1px 0 #fff, inset 0 -6px 11px rgba(110, 160, 225, .26), 0 2px 5px var(--aero-shadow);
  --gel-on-sh: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 9px var(--aero-glow), 0 0 14px var(--aero-glow);
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-pixel);
  /* pixel font is the default for all chrome/UI */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--aero-ink);
  /* Frutiger-Aero sky behind the window well (matches /museum/) */
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(150, 205, 255, .55), transparent 60%),
    linear-gradient(180deg, #6fa8ee 0%, #9cc4f5 26%, #c8dcfb 58%, #e9f1fd 100%);
  background-attachment: fixed;
}

/* dreamy floating bokeh behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(360px 360px at 12% 16%, rgba(255, 255, 255, .9), transparent 62%),
    radial-gradient(300px 300px at 82% 8%, rgba(150, 200, 255, .72), transparent 60%),
    radial-gradient(420px 420px at 70% 78%, rgba(150, 195, 255, .5), transparent 62%),
    radial-gradient(260px 260px at 30% 88%, rgba(255, 255, 255, .7), transparent 60%);
  filter: blur(6px);
}

/* ── shared museum header ───────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 3;
  flex: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .62) 0%, rgba(196, 220, 250, .5) 42%, rgba(206, 226, 250, .32) 100%);
  backdrop-filter: blur(20px) saturate(1.45);
  -webkit-backdrop-filter: blur(20px) saturate(1.45);
  box-shadow: 0 10px 26px rgba(18, 70, 135, .14);
}

.topbar .gradient {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 11px 22px;
}

.brand h1 {
  margin: 0;
  font: 400 22px/1.2 var(--font-pixel);
  letter-spacing: -.4px;
  color: var(--aero-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
}

.brand h1::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 9px;
  vertical-align: -4px;
  background: url("favicon.png") center/contain no-repeat;
  image-rendering: pixelated;
}

.topnav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.topnav a,
.topnav button {
  font: 400 14px/1 var(--font-pixel);
  letter-spacing: -.4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--aero-deep);
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--aero-edge);
  background: var(--gel);
  box-shadow: var(--gel-sh);
  transition: transform .12s, box-shadow .15s, background .15s, color .15s;
}

#lang {
  min-width: 40px;
}

.topnav a:hover,
.topnav button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px var(--aero-shadow), 0 0 0 2px rgba(110, 175, 250, .34);
}

.topnav a.on {
  color: #fff;
  border-color: rgba(255, 255, 255, .9);
  background: var(--gel-on);
  box-shadow: var(--gel-on-sh);
  text-shadow: 0 1px 1px rgba(0, 40, 95, .4);
}


.viewer {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  padding: 16px 18px 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
}

.viewer-frame {
  position: relative;
  width: min(1280px, 100%);

  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--aero-edge);
  background: rgba(255, 255, 255, .26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 18px 44px rgba(18, 70, 135, .28);
}

.viewer-bar {
  flex: none;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(206, 226, 250, .34));
  border-bottom: 1px solid rgba(255, 255, 255, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.viewer-tools {
  flex-wrap: nowrap;
}

.viewer-loc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
  font: 400 13px/1 var(--font-pixel);
  letter-spacing: -.3px;
  color: var(--aero-deep);
}

.viewer-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c7e7ff, #3f8fe6);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 1px 2px rgba(16, 64, 130, .4);
}

.viewer-tools {
  display: flex;
  gap: 6px;
}

#stageWrap {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: #dde6ec;
}

/* custom (follower) cursor active → suppress the native cursor on the whole stage,
   including the hand/text cursors links, buttons & inputs show on hover. The toolbar
   and market sit outside #stageWrap, so they keep their normal cursor. */
body.custom-cursor #stageWrap,
body.custom-cursor #stageWrap * {
  cursor: url("../assets/blank.png") 0 0, none !important;
}

#skinBg {
  position: absolute;
  inset: 0;
  min-height: 100%;
  z-index: 0;
  background: #dde6ec;
}

.browser {
  position: relative;
  z-index: 2;
  width: 1280px;
  min-width: 1280px;
  /* the 空间 is 1280 wide; the .viewer-frame window hugs this size (see .viewer-frame) */
  flex: none;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

/* the window body bounds EVERYTHING */
.browser-body {
  position: relative;
  height: 900px;
  /* tall like a real QZone page (was too short → looked squished) */
  overflow: hidden;
  background: #dde6ec;
}

#stageDeco {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* floaty */
#pageDeco {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

/* 挂件 + player */
#pageDeco .deco {
  pointer-events: auto;
}

/* content (980px) centered in the 1280px window */
.space {
  position: relative;
  z-index: 3;
  width: 980px;
  min-height: 100%;
  margin: 0 auto;
  padding-top: 10px;
}

.who {
  position: relative;
  z-index: 1;
  margin-top: 4rem;
  font-family: "ZCOOL KuaiLe", cursive;
  font-size: 28px;
  color: var(--c-nick, #fff);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

/* QZone v5 nav: a horizontal strip of square ~25px tabs sitting ON a baseline border
   (NOT rounded pills). The active tab is white and "opens" down into the content. */
/* masthead band — constant height; banner is the backdrop, nav sits at its bottom on top */
.masthead {
  position: relative;
  height: 130px;
  margin-top: 10px;
}

.nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* line up with the BOTTOM of the title banner */
  z-index: 2;
  /* nav sits ON TOP of the title image */
  display: flex;
  gap: 1px;
  padding: 0;
  /* natural side gaps from the banner edges */
  flex-wrap: wrap;
  font-family: var(--font-pixel);
  /* border-bottom: 2px solid var(--c-tabborder, #8fbfe0); */
  /* the baseline the tabs rest on = content-top */
}

.nav a {
  font-size: 13px;
  line-height: 25px;
  color: var(--c-link, #2a5a8a);
  padding: 0 18px;
  margin-bottom: 0px;
  /* overlap the baseline */
  cursor: pointer;
  background: var(--c-tabbg, #eaf4fd);
  opacity: 0.9;
  border: 1px solid var(--c-tabborder, #8fbfe0);
  border-radius: 0;
  /* v5 = square corners */
}

.nav a.on {
  background: var(--c-tabactive, #fff);
  color: var(--c-link, #1a4a7a);
  font-weight: 700;
  /* border-bottom: 0px solid var(--c-tabactive, #fff); */
  position: relative;
  z-index: 1;
}

/* 配色 accent (hover) color — what some scheme runs (e.g. 23–38) actually vary */
.nav a:hover {
  color: var(--c-hover, #0a7a2f);
  border-color: var(--c-hover, var(--c-tabborder, #8fbfe0));
}

/* 页头/标题栏 banner (type 19, 715x100): backdrop that fills the masthead. Always present
   (frame constant); only the image appears/disappears when a 标题栏 is applied. The bottom
   ~26px sits behind the nav, leaving the upper part of the banner showing above it. */
.page-header {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100%;
  /* span the full content width like a real 页头 banner */
}

.columns {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: flex-start;
  padding-top: 14px;
  /* small breathing room under the nav-line / banner; spacing above is owned by .nav margin + .page-header */
}

/* two columns filling the 980 content */
.col-main {
  flex: 1;
}

.col-menu {
  flex: 2;
  min-width: 0;
}

/* module boxes fill their column, colored by the 配色 scheme. The surface color is the
   scheme's tabActive (the "content" color — dark schemes have dark surfaces + light text),
   kept semi-transparent so the skin's full-screen _top art shows through (the real-era
   模块透明度 effect; skins were splashes designed to peek around content). */
.mod-profile {
  width: 100%;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, .72);
  background: color-mix(in srgb, var(--c-tabactive, #fff) 72%, transparent);
  border: 1px solid var(--c-tabborder, #c7e5eb);
  /* v5: flat 1px border, square corners */
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
}

.mod-profile .hd {
  height: 31px;
  line-height: 31px;
  padding: 0 12px;
  font-weight: 700;
  color: var(--c-hdtext, #fff);
  /* module title follows the 配色 scheme; slightly more opaque than the body */
  background: var(--c-hd, #7fa9c9);
  background: color-mix(in srgb, var(--c-hd, #7fa9c9) 85%, transparent);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .3);
}

.mod-profile .bd {
  min-height: 48px;
}

.mod-profile .bottom {
  display: none;
}

.hd-gen {
  float: right;
  margin-top: 4px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .25);
  color: var(--c-hdtext, #fff);
  border-radius: 4px;
  width: 24px;
  height: 22px;
  line-height: 1;
  font-size: 12px;
  padding: 0;
}

.hd-gen:hover {
  background: rgba(255, 255, 255, .45);
}

body.view-only .hd-gen {
  display: none;
}

.hd-action {
  float: right;
  /* margin-top: 1px; */
  font-size: 12px;
  font-weight: 400;
  color: var(--c-hdtext, #fff);
  opacity: .9;
  text-decoration: underline;
  /* underlined by default */
  cursor: pointer;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
}

.hd-action:hover {
  opacity: 1;
  color: var(--c-hover, #ffe9a8);
  /* hover takes the 配色 theme accent */
}

.rz-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 14px;
  border-bottom: 1px dashed #e6ebf0;
  text-decoration: none;
  cursor: pointer;
}

.rz-item:last-child {
  border-bottom: 0;
}

.rz-item:hover {
  background: rgba(80, 140, 220, .07);
}

.rz-cat {
  flex: none;
  font-size: 12px;
  color: #9aa6b0;
}

.rz-t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--c-link, #2a5a8a);
}

.rz-img {
  flex: none;
  font-size: 11px;
  color: #c0392b;
}

.rz-c {
  flex: none;
  font-size: 11px;
  color: #9aa6b0;
}

/* empty 相册 placeholder */
.album-empty {
  padding: 26px 14px;
  text-align: center;
  font-family: var(--font-kai);
  font-size: 13px;
  line-height: 1.9;
  color: #9aa6b0;
  color: color-mix(in srgb, var(--c-text, #667786) 62%, var(--c-tabactive, #fff));
}

/* generated 日志 — title · paragraph body · 阅读/评论/转载/分享 + date. Two posts share
   the box; the second is divided off with a top border. */
.rizhi {
  padding: 8px 12px 10px;
}

.rizhi+.rizhi {
  border-top: 1px solid #e6ebf0;
  border-top-color: color-mix(in srgb, var(--c-tabborder, #c7e5eb) 55%, transparent);
}

/* 最近访客 — vertical list of recovered classic QQ pixel avatars + 非主流 网名 + 来访时间.
   Matches the real v5 好友秀/最近访客 module: bigger avatar on the left, name stacked beside it. */
.visitors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 11px;
}

.visitor {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
}

.visitor-av {
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid var(--c-tabborder, #c7e5eb);
  background: #fff;
  image-rendering: pixelated;
  /* keep the pixel avatars crisp */
}

.visitor-meta {
  min-width: 0;
  flex: 1;
}

.visitor-nick {
  font-size: 13px;
  color: var(--c-link, #2a5a8a);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visitor-t {
  font-size: 11px;
  color: #9aa6b0;
  color: color-mix(in srgb, var(--c-text, #667786) 62%, var(--c-tabactive, #fff));
  margin-top: 2px;
}


.rizhi-title {
  font-family: var(--font-kai);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-link, #2a5a8a);
  margin: 10px 0px 6px 0px;
}

.rizhi-p {
  font-family: var(--font-kai);
  /* warm 楷 for the written content (the 日志 prose) */
  font-size: 14px;
  color: var(--c-text, #444);
  line-height: 1.8;
  text-indent: 2em;
  margin: 0 0 5px;
}

.rizhi-meta {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e2e2;
  border-top-color: color-mix(in srgb, var(--c-tabborder, #c7e5eb) 55%, transparent);
  font-size: 12px;
  color: #9aa6b0;
  color: color-mix(in srgb, var(--c-text, #667786) 62%, var(--c-tabactive, #fff));
}

.rizhi-date {
  float: right;
}

/* embedded QQ秀 (qqshow2000.com) — a portrait avatar card in the 个人资料 module.
   The iframe gets a phone-sized 390×844 viewport (qqshow2000's nicest layout: the
   avatar card centered under its header), scaled + shifted so only the avatar card
   fills our window. The whole card links to the full view (desktop only). */
.qqshow-card {
  position: relative;
  display: block;
  width: 210px;
  max-width: 100%;
  height: 320px;
  margin: 8px auto;
  overflow: hidden;
  /* background: #000; */
  /* border: 1px solid var(--c-tabborder, #c7e5eb); */
  /* border-radius: 2px; */
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}

.name {
  display: flex;
}

.qqshow-namerow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px auto 10px;
  padding: 4px 6px 4px 10px;
  /* nick box rides the scheme's content surface */
  background: var(--c-tabactive, #fff);
  border: 1px solid var(--c-tabborder, #c3ccd8);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.qqshow-name {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text, #2a4d63);
  min-width: 100px;
  max-width: 150px;
  outline: none;
  word-break: break-word;
}

.qqshow-name:empty::before {
  content: attr(data-ph);
  color: #aaa;
  font-weight: 400;
}

.qqshow-edit-btn {
  flex: none;
  cursor: pointer;
  border: 1px solid #b9c0c9;
  background: linear-gradient(#fcfcfd, #e2e5ea);
  border-radius: 4px;
  width: 24px;
  height: 22px;
  font-size: 13px;
  line-height: 1;
  color: #3a566e;
  padding: 0;
}

.qqshow-edit-btn:hover {
  background: linear-gradient(#fff, #d6e3f5);
  color: #1559cf;
}

/* share toast + "remix this space" banner (both float above everything) */
#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(20, 28, 40, .92);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 100000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

#forkBanner {
  position: fixed;
  top: 66px;
  /* below the museum header */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #c3ccd8;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #33475a;
  z-index: 100000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}

#forkBanner button {
  cursor: pointer;
  border: 1px solid #4a86c5;
  background: linear-gradient(#eaf4ff, #cfe4fb);
  color: #1559cf;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 13px;
}

/* in preview, the name isn't editable → hide the ✎ and the box chrome */
body.view-only .qqshow-edit-btn {
  display: none;
}

body.view-only .qqshow-namerow {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body:not(.view-only) .qqshow-name[contenteditable="true"] {
  cursor: text;
}

/* WebKit multiplies a child document's layout viewport by the page zoom (Chrome
   doesn't) — fitQQShow() counter-zooms the frame to 1/pageZoom so qqshow2000 always
   lays out at 390×844, and carries the page zoom in the transform's scale instead
   (transforms never reach the inner layout). Keep scale/translate in sync with
   QQSHOW_CROP in qzone-library.js. */
.qqshow-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 390px;
  height: 844px;
  border: 0;
  transform-origin: 0 0;
  transform: scale(.94) translate(-83px, -236px);
  pointer-events: none;
  /* clicks fall through to the card link */
}

/* QZone-style control strip (top-right), modeled on the real 显示导航|装扮空间|自定义 bar:
   a beveled gray bar of small 宋体 buttons separated by hairlines. Slides left so it
   sits just beside the market panel when it's open. */
/* glossy gel button (in the window title-bar) */
.viewer-tools button {
  cursor: pointer;
  color: var(--aero-deep);
  border: 1px solid var(--aero-edge);
  border-radius: 8px;
  background: var(--gel);
  box-shadow: var(--gel-sh);
  padding: 5px 13px;
  font-size: 12px;
  font-family: var(--font-pixel);
  transition: transform .12s, box-shadow .15s, background .15s, color .15s;
}

.viewer-tools button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px var(--aero-shadow), 0 0 0 2px rgba(110, 175, 250, .34);
}

/* active state for an open market — glowing aqua gel (NOT used for 编辑 anymore) */
.viewer-tools button.on,
.viewer-tools button.primary {
  color: #fff;
  border-color: rgba(255, 255, 255, .9);
  background: var(--gel-on);
  box-shadow: var(--gel-on-sh);
  text-shadow: 0 1px 1px rgba(0, 40, 95, .4);
}

/* preview (view-only): clean toolbar — keep only 编辑 (to exit preview) + 分享.
   Hide the editing actions 装扮空间 / 随机 / 清空. */
body.view-only #marketToggle,
body.view-only #randomBtn,
body.view-only #clearBtn {
  display: none;
}

#marketToggle::before {
  content: "\25B8\00A0";
  /* ▸ when closed; flips to ▾ when open (the panel is "down") */
  color: currentColor;
}

#marketToggle.on::before {
  content: "\25BE\00A0";
  /* ▾ */
}

/* the buttons always stay visible (edit OR preview) — only the per-item delete/drag
   chrome is what view-only hides (see .deco rules below). */

/* decorations */
.deco {
  position: absolute;
  cursor: grab;
  user-select: none;
  touch-action: none;
  /* touch-drag the deco, don't scroll the page */
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25));
}

.deco:active {
  cursor: grabbing;
}

/* control chrome — always visible in edit mode so items are obviously deletable */
.deco .ph {
  position: absolute;
  top: -30px;
  right: 0;
  display: flex;
  gap: 5px;
  z-index: 2;
}

.deco .ph button {
  border: 0;
  cursor: pointer;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 5px;
}

.deco .ph button.del:hover,
.deco .ph button.mbtn:hover {
  background: #0033ff;
  color: #ffffff;
}

/* view-only: hide all editing chrome, no grab cursor */
body.view-only .deco .ph {
  display: none;
}

body.view-only .deco {
  cursor: default;
}

.swfdeco {
  position: absolute;
}

/* transparent overlay over the (UI-only) music player so the WHOLE thing is a drag handle */
.drag-surface {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: grab;
}

.drag-surface:active {
  cursor: grabbing;
}

/* in view-only the player surface stays clickable (so you can play/pause), just no grab cursor */
body.view-only .drag-surface {
  cursor: pointer;
}

/* now-playing marquee  */
.player-deco .mp-title {
  display: none;
}

.player-deco.has-music .mp-title {
  display: flex;
  align-items: center;
  position: absolute;
  left: 18%;
  right: 18%;
  top: 8%;
  /* top: 50%;
  transform: translateY(-50%); */
  z-index: 3;
  height: 30px;
  overflow: hidden;
  pointer-events: none;
}

.player-deco .mp-title span {
  display: inline-block;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  line-height: 18px;
  /* text follows the theme */
  color: var(--c-hdtext, #fff);
  text-shadow: 1px 0 8px var(--c-hd, #00000050);
  padding-left: 90%;
  animation: mp-marquee 7s linear infinite;
}

@keyframes mp-marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

/* music-link popover — opens when you click the player gadget (it IS the bg-music player) */
/* frosted aero glass popover — same family as the toolbar/market chrome */
.music-pop {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 30px;
  /* clear the ✕ row above the gadget */
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 290px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(212, 231, 252, .68));
  backdrop-filter: blur(14px) saturate(1.45);
  -webkit-backdrop-filter: blur(14px) saturate(1.45);
  border: 1px solid var(--aero-edge);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 10px 26px rgba(18, 70, 135, .3);
  z-index: 6;
  font-family: var(--font-pixel);
}

.music-pop.open {
  display: flex;
}

.music-pop .mp-row {
  display: flex;
  gap: 6px;
}

.music-pop .mp-in {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--aero-edge);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 2px 5px rgba(60, 120, 175, .22), inset 0 1px 0 rgba(255, 255, 255, .7);
  color: var(--aero-ink);
  outline: none;
  transition: box-shadow .15s, background .15s;
}

.music-pop .mp-in::placeholder {
  color: #88a6c8;
}

.music-pop .mp-in:focus {
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 2px 5px rgba(60, 120, 175, .15), 0 0 0 3px rgba(60, 140, 240, .3);
}

.music-pop .mp-go {
  flex: none;
  cursor: pointer;
  border: 1px solid var(--aero-edge);
  border-radius: 8px;
  background: var(--gel);
  box-shadow: var(--gel-sh);
  color: var(--aero-deep);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-pixel);
  transition: transform .12s, box-shadow .15s;
}

.music-pop .mp-go:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px var(--aero-shadow), 0 0 0 2px rgba(110, 175, 250, .34);
}

.music-pop .mp-st {
  font-size: 11px;
  color: var(--aero-deep);
  min-height: 13px;
}

.music-pop .mp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.music-pop .mp-eg {
  font-size: 11px;
  color: var(--aero-deep);
  text-decoration: none;
}

.music-pop .mp-eg:hover {
  text-decoration: underline;
}

.music-pop .mp-del {
  border: 0;
  background: none;
  cursor: pointer;
  color: #b3422e;
  font-size: 11px;
  padding: 0;
}

.music-pop .mp-del:hover {
  color: #d62b0e;
  text-decoration: underline;
}

body.view-only .music-pop {
  display: none !important;
}

.snowflake {
  position: absolute;
  pointer-events: none;
}

/* JS-positioned, faithful to fall() */

/* ─────────────── collapsible "market" (item browser) ─────────────── */
/* the 素材库 (精品装饰) drops down BELOW the top bar, like the real QZone edit panel */
.market {
  position: fixed;
  /* fixed → escapes the window's overflow:hidden so it floats as a real dropdown;
     JS positions top/right under the 装扮空间 button (see setMarket) */
  top: 100px;
  right: 18px;
  width: 440px;
  max-width: calc(100vw - 24px);
  max-height: 78vh;
  z-index: 80;
  display: flex;
  flex-direction: column;
  /* frosted Frutiger-Aero glass panel */
  background: linear-gradient(180deg, rgba(244, 249, 255, .82) 0%, rgba(224, 238, 255, .78) 100%);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--aero-edge);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(18, 70, 135, .3), inset 0 1px 0 rgba(255, 255, 255, .8);
  overflow: hidden;
  color: var(--aero-ink);
  font-family: var(--font-pixel);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease;
}

.market.collapsed {
  opacity: 0;
  transform: scale(.97) translateY(-8px);
  pointer-events: none;
}

/* "我的 QQ 秀" editor at the top of the market — paste a qqshow2000 link/id */
.qqshow-edit {
  margin: 10px 12px 8px;
  padding: 10px 12px;
  /* inset glass sub-panel */
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 6px rgba(110, 160, 225, .14);
}

/* label row: 我的 QQ 秀 on the left, the 去 qqshow2000 创建 link on its right */
.qqshow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.qqshow-edit label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--aero-ink);
}

.qqshow-edit .row {
  display: flex;
  gap: 6px;
}

.qqshow-edit input,
.search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--aero-edge);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 2px 5px rgba(60, 120, 175, .22), inset 0 1px 0 rgba(255, 255, 255, .7);
  color: var(--aero-ink);
  font-size: 12.5px;
  outline: none;
  transition: box-shadow .15s, background .15s;
}

.qqshow-edit input::placeholder,
.search input::placeholder {
  color: #88a6c8;
}

.qqshow-edit input:focus,
.search input:focus {
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 2px 5px rgba(60, 120, 175, .15), 0 0 0 3px rgba(60, 140, 240, .3);
}

.qqshow-edit button,
.tabs button {
  cursor: pointer;
  border: 1px solid var(--aero-edge);
  border-radius: 8px;
  background: var(--gel);
  box-shadow: var(--gel-sh);
  color: var(--aero-deep);
  font-weight: 700;
  font-family: var(--font-pixel);
  font-size: 12.5px;
  padding: 6px 12px;
  transition: transform .12s, box-shadow .15s, background .15s, color .15s;
}

.qqshow-edit button:hover,
.tabs button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px var(--aero-shadow), 0 0 0 2px rgba(110, 175, 250, .34);
}

.tabs button.on {
  color: #fff;
  border-color: rgba(255, 255, 255, .9);
  background: var(--gel-on);
  box-shadow: var(--gel-on-sh);
  text-shadow: 0 1px 1px rgba(0, 40, 95, .4);
}

.qqshow-edit .qqshow-make {
  font-size: 11px;
  color: var(--aero-deep);
  text-decoration: none;
  white-space: nowrap;
}

.qqshow-edit .qqshow-make:hover {
  text-decoration: underline;
}

.market h1 {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  padding: 11px 16px 9px;
  color: var(--aero-ink);
  letter-spacing: -.4px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
  /* seamless frosted deck header — soft glow, no hard line */
  background: linear-gradient(180deg, rgba(255, 255, 255, .5) 0%, rgba(206, 226, 250, .28) 100%);
  box-shadow: 0 6px 16px rgba(18, 70, 135, .1);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
}

.search {
  margin: 4px 14px 6px;
}

.count {
  padding: 0 16px 6px;
  font-size: 11px;
  color: var(--muted, #5876a4);
}

.grid {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 8px 14px 28px;
  align-content: start;
}

.grid.c1 {
  grid-template-columns: 1fr;
}

.grid.c2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid.c3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid.c4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid.c6 {
  grid-template-columns: repeat(6, 1fr);
}

.cell {
  position: relative;
  min-width: 0;
  /* never force the grid track wider than its column → no horizontal overflow */
  height: 96px;
  /* explicit per-cell height (overridden per tab below). NOTE: aspect-ratio is
     unreliable on grid items with auto rows — the row collapses to the image's
     min-height and cells go cramped. A real height per tab avoids that. */
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e3e7ef;
  background: conic-gradient(#fbfbfd 90deg, #eef0f5 0 180deg, #fbfbfd 0 270deg, #eef0f5 0) 0 0/14px 14px;
  transition: transform .12s, box-shadow .12s;
}

.cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(60, 70, 100, .18);
  z-index: 2;
}

/* the leading "无" (none / disable) cell — turns the singular decoration off */
.cell.cell-none {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f7fb;
  border: 1px dashed #c2c8d6;
  color: #97a0b3;
  font-size: 13px;
  font-weight: 700;
}

.cell.cell-none:hover {
  color: #1559cf;
  border-color: #1559cf;
}

/* per-tab cell HEIGHTS — matched to each item's natural proportions at its column count */
.grid.t-skin .cell {
  height: 120px;
}

/* wide banner */
.grid.t-pendant .cell {
  height: 108px;
}

/* tall hanging ornament */
.grid.t-floaty .cell,
.grid.t-cursor .cell {
  height: 92px;
}

.grid.t-color .cell {
  height: 66px;
}

.grid.t-player .cell {
  height: 100px;
}

/* 标题栏 = wide ~715x100 header strips (one per row) */
.grid.t-titlebar .cell {
  height: 62px;
}

.grid.t-titlebar .cell img {
  object-fit: contain;
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.grid.t-skin .cell img {
  object-fit: cover;
}

/* player previews are transparent skins — show the whole thing on a contrasting bg */
.grid.t-player .cell img {
  object-fit: contain;
}

/* items with transparency/white content (挂件·漂浮物·鼠标·标题栏·音乐) sit on ONE uniform
   white-ish gradient instead of the transparent checker — so white art/text stays visible. */
.grid.t-pendant .cell,
.grid.t-floaty .cell,
.grid.t-cursor .cell,
.grid.t-titlebar .cell,
.grid.t-player .cell {
  background: linear-gradient(160deg, #fdfdff, #dfe4ee);
}

.cell .id {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 9px;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  padding: 1px;
  text-align: center;
}

/* selection indicator (QQ blue ring + checkmark badge) */
.cell.on {
  outline: 3px solid #1559cf;
  outline-offset: -3px;
}

.cell.on::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #1559cf;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  z-index: 4;
  pointer-events: none;
}

/* 配色 swatch = a mini-palette: big nav band on top + a strip of the key colors below */
.cell.swatch {
  display: flex;
  flex-direction: column;
  color: #fff;
}

.cell.swatch .sw-main {
  flex: 1;
}

.cell.swatch .sw-strip {
  display: flex;
  height: 36%;
  border-top: 1px solid rgba(255, 255, 255, .5);
}

.cell.swatch .sw-strip i {
  flex: 1;
  display: block;
}

/* number sits as a small pill top-left so it doesn't cover the palette strip */
.cell.swatch .id {
  left: 3px;
  right: auto;
  top: 3px;
  bottom: auto;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .5);
}

.foot {
  font-size: 10px;
  color: #98a1b2;
  padding: 8px 16px;
  border-top: 1px solid #e6e9f0;
}

.foot code {
  color: #1559cf;
}

/* touch devices: no hover, no real cursor — the follower-cursor illusion can't work
   (it would just stick where you last tapped), so keep the native behavior. */
@media (hover: none) {
  #followCursor {
    display: none !important;
  }

  body.custom-cursor #stageWrap,
  body.custom-cursor #stageWrap * {
    cursor: auto !important;
  }

  /* the whole QQ秀 card is a link to qqshow2000 — too easy to fat-finger while
     panning on a phone, so taps fall through (the market still links there) */
  .qqshow-card {
    pointer-events: none;
  }
}

/* ── mobile: the editing chrome goes compact; the QZone page keeps a READABLE zoom
   (fitPage floors it at fill-height) and PANS horizontally inside the well instead
   of shrinking the whole 1280 to fit. The market becomes a full-width sheet. ── */
@media (max-width: 640px) {

  #stageWrap {
    overflow-x: auto;
  }

  /* squeeze brand + the 4 nav gels onto one row even with the wider EN labels */
  .topbar .gradient {
    padding: 8px 8px;
    gap: 6px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand h1::before {
    width: 17px;
    height: 17px;
    margin-right: 5px;
    vertical-align: -3px;
  }

  .topnav {
    gap: 3px;
  }

  .topnav a,
  .topnav button {
    font-size: 11px;
    padding: 6px 7px;
  }

  #lang {
    min-width: 30px;
  }

  .market {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .market.collapsed {
    transform: translateY(-100%);
  }

  .viewer {
    padding: 8px;
  }

  /* the bar wraps to two rows (breadcrumb + tools) — let it grow past its fixed 48px */
  .viewer-bar {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }

  .viewer-tools {
    flex-wrap: wrap;
  }

  .viewer-tools button {
    padding: 6px 9px;
  }
}

/* ---------- frutiger aero scrollbars (same recipe as museum.css — keep in sync) ---------- */
::-webkit-scrollbar {
  width: 13px;
  height: 13px;
}

::-webkit-scrollbar-track {
  background: rgba(228, 240, 253, .55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), inset 0 0 6px rgba(60, 120, 175, .28);
}

::-webkit-scrollbar-thumb {
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 2px rgba(255, 255, 255, .85);
  min-height: 36px;
  min-width: 36px;
}

::-webkit-scrollbar-thumb:vertical {
  background: linear-gradient(90deg, rgba(255, 255, 255, .95) 0%, rgba(186, 215, 250, .95) 46%, rgba(150, 195, 247, .95) 54%, rgba(120, 172, 240, .95) 100%);
}

::-webkit-scrollbar-thumb:horizontal {
  background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(186, 215, 250, .95) 46%, rgba(150, 195, 247, .95) 54%, rgba(120, 172, 240, .95) 100%);
}

::-webkit-scrollbar-thumb:vertical:hover,
::-webkit-scrollbar-thumb:vertical:active {
  background: linear-gradient(90deg, rgba(255, 255, 255, .85) 0%, rgba(110, 175, 250, .95) 46%, rgba(45, 130, 235, .97) 54%, rgba(16, 90, 205, 1) 100%);
}

::-webkit-scrollbar-thumb:horizontal:hover,
::-webkit-scrollbar-thumb:horizontal:active {
  background: linear-gradient(180deg, rgba(255, 255, 255, .85) 0%, rgba(110, 175, 250, .95) 46%, rgba(45, 130, 235, .97) 54%, rgba(16, 90, 205, 1) 100%);
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
  border-color: #fff;
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox fallback — must stay scoped: scrollbar-color disables ::-webkit-scrollbar in Chromium */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-color: #8ab2ef rgba(228, 240, 253, .7);
  }
}