:root {
  color-scheme: dark;
  background: #171717;
  color: #f4f0e8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-synthesis: none;

  /* ★ 全站动画的唯一节奏：卡片、遮罩、详情面板、导航、搜索框全部读这两个值。
     JS 也是从这里读的，所以大家永远同速度、同节奏。想整体变快/变慢，只改这里。 */
  --dur: 460ms;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --site-search-w: 380px;
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 1ms; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: #171717; }
body { min-height: 100vh; }
button, input { font: inherit; }

/* 打开作品时锁住页面滚动。--sbw 由 JS 填入滚动条宽度并补回来，
   这样滚动条消失时页面宽度不变，网格不会重排，周围作品不会跳位。 */
body.scroll-locked { overflow: hidden; padding-right: var(--sbw, 0px); }

/* ---------- 全局背景遮罩 ---------- */
/* 不再用 backdrop-filter 模糊：遮罩 92% 不透明，模糊几乎看不出来，
   却要每一帧重新模糊整个屏幕（含 WebGL 作品），是掉帧和闪烁的主要来源。 */
body::before {
  content: ""; position: fixed; z-index: 20; inset: 0;
  background: rgba(10,10,12,.92);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
body.viewing::before { opacity: 1; pointer-events: auto; }

/* ---------- 左侧导航 ---------- */
#mario-nav {
  position: fixed; left: 28px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 19px;
  z-index: 19; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; backdrop-filter: none;
  transition: opacity var(--dur) var(--ease), visibility 0s linear 0s;
}
/* 它在遮罩下面：打开时跟着遮罩一起被盖住 */
body.viewing #mario-nav {
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
/* 关闭时它直接"在遮罩下面站好"，完全靠遮罩淡出慢慢露出来，自己不跳 */
body.view-closing #mario-nav { transition: none; }

.mario-block {
  --face:#efa02c; --side:#a85f10; --ink:#1b2146;
  position:relative; display:grid; place-items:center; width:58px; height:58px; padding:0;
  border:3px solid #34220e; border-radius:5px; color:var(--ink);
  cursor:pointer; background:var(--face);
  box-shadow:0 5px 0 var(--side),0 7px 0 #34220e;
  image-rendering:pixelated;
  text-decoration:none;
  transition:transform .12s steps(2),box-shadow .12s ease;
}
.mario-block::before { content:none; }
.mario-block svg { width:25px; height:25px; stroke-width:2.4; filter:none; }
.mario-block:active,.mario-block.active {
  transform:translateY(5px); box-shadow:0 1px 0 var(--side),0 2px 0 #34220e;
}
.mario-block:focus-visible { outline:2px solid #f4f0e8; outline-offset:5px; }
.block-q,.block-coin { --face:#efa02c; --side:#a85f10; --ink:#1b2146; }
.block-brick { --face:#ffd400; --side:#b58f00; --ink:#1b2146; }

/* ---------- 指南针视图：首页里的另一个视图，不是新页面 ----------
   点中间那个方块，作品列表收起、指南针内容出现；
   左侧三个马里奥方块始终留在原位可见。 */
#compass-view { display:none; }
body.compass-mode #compass-view { display:block; }
body.compass-mode { overflow:hidden; }
body.compass-mode .grid { display:none; }
body.compass-mode .top-bar { opacity:0; visibility:hidden; pointer-events:none; }
.compass-view-inner { width:min(620px,100%); padding-left:24px; }
.compass-view-block {
  display:grid;place-items:center;width:74px;height:74px;margin:0 0 28px;
  border:3px solid #34220e;border-radius:5px;background:#ffd400;color:#1b2146;
  box-shadow:0 5px 0 #b58f00,0 7px 0 #34220e;
}
.compass-view-block svg { width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round; }
.compass-view-kicker { margin:0 0 12px;color:#f4bd3c;font:900 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:2.4px; }
.compass-view h1 { margin:0;color:#f4f0e8;font-size:clamp(32px,6vw,54px);font-weight:900;letter-spacing:-1.8px;line-height:1.08; }
.compass-view-note { margin:18px 0 0;color:#b8aa92;font-size:13px;line-height:1.95; }
@media(max-width:600px){ .compass-view-inner { padding-left:24px; } }

/* ---------- 搜索：仅在作品列表视图出现 ---------- */
.top-bar {
  position: fixed;
  top: 24px;
  left: 24px;
  /* 搜索栏与右上角三个工具按钮共用一行，右侧固定留出按钮组宽度和16px间距 */
  right: 24px;
  z-index: 19;
  width: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: opacity var(--dur) var(--ease), visibility 0s linear 0s;
}
body.viewing .top-bar,
body.artwork-only .top-bar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
body.view-closing .top-bar { transition: none; }

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px 0 17px;
  color: #211d15;
  background: #f5ecd9;
  border: 2px solid #080808;
  border-radius: 7px;
  box-shadow: 4px 4px 0 #080808;
  cursor: text;
  /* 收起时向左缩回，滑到左侧导航那一列：112px(搜索栏左缘) - 28px(导航左缘) */
  --collapse-shift: -84px;
  transition:
    max-width var(--dur) var(--ease),
    height var(--dur) var(--ease),
    padding var(--dur) var(--ease),
    gap var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.search-wrapper:focus-within {
  border-color: #f4bd3c;
  box-shadow: 4px 4px 0 #080808, 0 0 0 3px rgba(244,189,60,.2);
}
.search-wrapper.is-active { background: #fff8e9; }
.search-icon { width: 19px; height: 19px; color: #554632; flex: 0 0 auto; }
#search-input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1a1712;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .1px;
  appearance: none;
  transition: width var(--dur) var(--ease), opacity .18s ease;
}
#search-input::-webkit-search-cancel-button { display: none; }
#search-input::placeholder { color: #9b8a70; font-weight: 500; }
.search-clear {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: #5c4b32;
  background: transparent;
  cursor: pointer;
}
.search-clear[hidden] { display: none; }
.search-clear:hover { color: #17130d; background: #eadcc2; }
.search-clear svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* 收起时清空按钮也一起缩掉 */
html.search-collapsed .search-clear { width: 0; min-width: 0; padding: 0; opacity: 0; overflow: hidden; pointer-events: none; }

/* ---------- 下滑时：搜索栏缩回成放大镜方块，滑到左侧导航那一列 ----------
   收起后是一个 58×58 的方块，和左边三个马里奥方块同尺寸、同左缘，
   只是上下位置不一样（导航是垂直居中的，搜索栏贴着顶部）。 */
/* 收起后就是一个和左边三个马里奥方块一模一样的方块：
   同样的 58×58、同样的边框/圆角/投影，用指南针那块黄（#ffd400 + #b58f00 侧边）。 */
html.search-collapsed .search-wrapper {
  width: 58px;
  max-width: 58px;
  height: 58px;
  padding: 0;
  margin: 0;
  gap: 0;
  justify-content: center;
  transform: translateX(var(--collapse-shift));
  border: 3px solid #34220e;
  border-radius: 5px;
  background: #ffd400;
  box-shadow: 0 5px 0 #b58f00, 0 7px 0 #34220e;
}
html.search-collapsed .search-icon { width: 25px; height: 25px; color: #1b2146; stroke-width: 2.4; }
html.search-collapsed #search-input {
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
html.search-collapsed .search-status { opacity: 0; }
.search-status {
  min-height: 14px;
  margin: 0 0 0 3px;
  color: #b8aa92;
  font-size: 11px;
  line-height: 1.3;
  opacity: 0;
  transition: opacity .16s ease;
}
.search-status.visible { opacity: 1; }

/* ---------- 页面基础布局 ---------- */
main { min-height: calc(100vh + 420px); padding: 94px 24px 180px; }
.grid { display:grid; grid-template-columns:repeat(var(--gallery-columns, 1), minmax(0,1fr)); gap:24px; padding-left:0; }

/* 卡片：缩略态。外框收紧，给作品画面更多空间。 */
.preview-card {
  position: relative; align-self: start; width: 100%;
  background: #f5ecd9; color: #1a1712;
  border: 2px solid #080808; border-radius: 3px; padding: 5px;
  cursor: zoom-in;
  box-shadow: 8px 8px 0 rgba(0,0,0,.68), 0 18px 42px rgba(0,0,0,.18);
  transition: box-shadow var(--dur) var(--ease);
  max-height: calc(100dvh - 32px); overflow-y: auto;
  /* 卡片本身没有可滚动内容时，滚轮要能接着往页面传。
     之前写了 overscroll-behavior:contain，把滚轮死死按在卡片里，
     于是鼠标停在任何一张卡片上（标题、画面）都滚不动页面。 */
  overscroll-behavior: auto;
}
.preview-card.hidden { display: none !important; }
.preview-card:focus-visible { outline: 3px solid #f5bd32; outline-offset: 6px; }

/* 展开时留在原地占位的"影子卡片"（JS 克隆出来的，布局和真卡片完全一样） */
.preview-card-placeholder {
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
}

/* ---------- 作品框 + "舞台" ----------
   作品框(.preview-mount)只负责：占位、边框、裁切。它的大小会随卡片缩放。
   作品内容（iframe / 嵌入的画布）是"舞台"：永远保持固定的像素尺寸，
   只靠 transform: scale 缩放去贴合作品框。
   → 动画全程内容从不重新布局，iframe/WebGL 不会被 resize，也就不会白屏、闪烁。
   --stage-w / --stage-h / --k 由 JS 设置；JS 没跑之前回退成 100% 和 1，等于原来的样子。 */
.preview-mount {
  position: relative;
  display: block;
  box-sizing: content-box;               /* 宽高比按内容区算，才能和舞台严格对齐 */
  aspect-ratio: var(--mount-ratio, 1.6439);
  overflow: hidden;
  border: 2px solid #000;
  cursor: default;
}
.preview-mount > :not(script):not(style) {
  position: absolute !important;
  left: 0 !important; top: 0 !important; right: auto !important; bottom: auto !important;
  width: var(--stage-w, 100%) !important;
  height: var(--stage-h, 100%) !important;
  max-width: none !important; max-height: none !important;
  margin: 0 !important; border: 0 !important; border-radius: 0 !important;
  transform-origin: 0 0 !important;
  transform: scale(var(--k, 1)) !important;
}
/* 只在动画期间让内容独占合成层，缩放全交给 GPU；动画结束就释放，让它按最终大小重新清晰渲染 */
.preview-card.is-animating .preview-mount > :not(script):not(style) { will-change: transform; }

/* ---------- Pixel Orbit: real cross-fade between fully painted scenes ---------- */
/* The existing fixed stage scales this stack as one surface; both frames share it. */
.orbit-frame-stack {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}
.orbit-frame-stack > iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.orbit-frame-stack > iframe.is-visible { opacity: 1; }

/* ---------- 卡片底部文字 ---------- */
.card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding: 0 2px;
  color: #000;
  cursor: zoom-in;
  transition: opacity var(--dur) var(--ease);
}
.card-title { font-size: 13px; line-height: 1.1; font-weight: 900; letter-spacing: 1px; }
.preview-card.is-open .card-title { font-size: 18px; }
/* v2.8.6 — 「像素风」标签离开卡片下巴，搬到详情面板里做成真正的标签样式 */
.work-tags { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
.detail-tags { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; }
.detail-tags .work-tag {
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 10px 6px; border:2px solid #211d15; border-radius:3px;
  background:#f4d78e; color:#3a2c12;
  box-shadow:2px 3px 0 #211d15;
  font:900 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing:1.6px; white-space:nowrap;
  transform:rotate(-1.5deg);
}
.detail-tags .work-tag::before {
  content:"#";
  color:#8c5d13;
  font-size:11px; font-weight:900; letter-spacing:0;
}

/* ---------- 空状态 ---------- */
.empty-state {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; text-align: center; color: #8b7d67; grid-column: 1 / -1;
}
.empty-state.visible { display: flex; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 900; margin: 0 0 8px 0; color: #c9bda7; }
.empty-desc { font-size: 13px; margin: 0; }

/* ---------- 浮动操作按钮组 ---------- */
.preview-actions {
  position: fixed; z-index: 100;
  top: 24px; right: 28px;
  display: flex; align-items: center; gap: 12px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(40px);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
body.viewing .preview-actions {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s;
}
body.view-closing .preview-actions {
  transition: opacity .18s ease, visibility 0s linear .18s;
}

.action-btn {
  display: grid; place-items: center; width: 44px; height: 44px;
  margin: 0; padding: 0; border: 3px solid #000; border-radius: 4px;
  background: #f4bd3c; color: #1b160e; cursor: pointer;
  box-shadow: 3px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s, background 0.2s;
}
.action-btn svg { width: 22px; height: 22px; }
.action-btn:active { transform: translate(3px, 4px); box-shadow: none; }
.action-btn:focus-visible { outline: 2px solid #f5bd32; outline-offset: 3px; }

.close-view, .expand-artwork { background: #e94c43; color: #fff; }
.close-view svg, .expand-artwork svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter; }
.bookmark-card[aria-pressed="true"] { background: #efa02c; }
.bookmark-card[aria-pressed="true"] svg path { fill: currentColor; }

/* ---------- 展开中的卡片（状态类，几何数值全部由 JS 给） ---------- */
.preview-card.is-open {
  position: fixed; margin: 0; z-index: 21; isolation: isolate;
  cursor: default; padding: 12px;
  overflow-x: hidden; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.9);
}
.preview-card.is-open .card-info { cursor: default; }

/* "放大作品展示区域"：托盘四边等距；操作按钮固定在视口右上角，不占用托盘空间 */
.preview-card.is-artwork-expanded {
  z-index: 25; max-height: none; overflow: hidden;
  /* Override any legacy top reservation from earlier immersive layouts. */
  /* Slight optical correction: move the artwork 3px upward inside the tray. */
  padding: 18px 15px 12px !important;
  box-sizing: border-box;
}
.preview-card.is-artwork-expanded .preview-mount {
  margin: 0 !important;
}
.preview-card.is-artwork-expanded .card-info { opacity: 0; pointer-events: none; }

/* 关闭飞回去的途中：仍然浮在遮罩上方 */
.preview-card.is-closing {
  position: fixed; margin: 0; z-index: 22; isolation: isolate;
  max-height: none; cursor: default;
}
/* 动画期间永远裁切，避免出现一闪而过的滚动条 */
.preview-card.is-animating { overflow: hidden; }

/* ---------- 详情面板（所有作品共用） ----------
   谁是当前作品，JS 就给它的面板加 .is-active。面板的出入场用的是和卡片同一套 --dur / --ease，
   所以和卡片缩放同速度、同节奏。 */
.work-detail {
  display: block; position: fixed; z-index: 22; top: 18px; right: 18px; bottom: 18px;
  width: calc(38vw - 36px); min-width: 300px; max-width: 520px;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 80px 26px 34px;
  border: 1px solid #c9bda7; background: #f5ecd9; color: #1a1712;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);

  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(40px);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
body.viewing:not(.artwork-only) .work-detail.is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s;
}
/* 放大作品 / 关闭：面板沿同一条曲线滑出（visibility 会等动画走完才切成 hidden） */
body.artwork-only .work-detail.is-active,
body.view-closing .work-detail.is-active {
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(100%);
}

/* ---------- 详情内容样式 ---------- */
.detail-overview { display:grid; grid-template-columns:1fr; gap:24px; align-items:start; }
.detail-copy h1 { margin:0 0 5px; color:#191711; font-size:clamp(24px,3.3vw,38px); line-height:1.08; letter-spacing:-1.2px; }
.english-title { margin:0 0 16px; color:#9b7542; font-size:12px; font-weight:800; letter-spacing:1.1px; }
.detail-description { max-width:620px; margin:0; color:#514a3d; font-size:14px; line-height:1.85; }
.project-link {
  display:inline-flex; align-items:center; gap:10px; margin-top:20px; padding:12px 15px;
  border:2px solid #211d15; background:#f4bd3c; color:#1b160e; text-decoration:none;
  font-size:13px; font-weight:900; box-shadow:4px 4px 0 #211d15; transition:transform .15s,box-shadow .15s;
}
.project-link:hover { transform:translate(2px,2px); box-shadow:2px 2px 0 #211d15; }
.project-link svg { width:18px; height:18px; fill:currentColor; }

/* ---------- 详情页动作区：查看 GitHub 项目 + 开发者与贡献者 ---------- */
.detail-actions{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:10px;margin-top:20px}
.detail-actions .project-link{margin-top:0}
/* 颜色取左侧「指南针」方块的马里奥金 */
.creator-link{
  display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:11px 15px;
  border:2px solid #211d15;border-radius:8px;background:#ffd400;color:#1b160e;text-decoration:none;
  font-size:13px;font-weight:900;box-shadow:0 3px 0 #211d15;
  transition:transform .15s,box-shadow .15s,background .15s;
}
.creator-link:hover{transform:translateY(1px);box-shadow:0 2px 0 #211d15;background:#ffe04d}
.creator-link:active{transform:translateY(3px);box-shadow:none}
.creator-link svg{width:18px;height:18px}
.creator-link:focus-visible{outline:2px solid #f4bd3c;outline-offset:3px}
.lab-link{background:#f5ecd9;color:#211d15;border-style:dashed}
.lab-link:hover{background:#f4bd3c}

/* ---------- 统一详情页的专属功能区 ---------- */
.detail-feature{margin-top:26px;padding-top:16px;border-top:1px solid #d9cbb1}
.detail-feature .gallery-heading{margin:0 0 10px;padding:0}
.detail-feature .gallery-heading h2{font-size:20px}
.detail-feature>p:not(.detail-feature-meta){margin:0;color:#514a3d;font-size:13px;line-height:1.85}
.detail-feature-meta{margin:12px 0 0;color:#9b7542;font:800 10px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.45px}

/* ---------- 详情页里的嵌入式代码 ---------- */
.embed-snippet{margin-top:26px;padding-top:16px;border-top:1px solid #d9cbb1}
.embed-snippet h2{margin:0;padding:0 0 10px;color:#191711;font-size:20px}
.embed-note{margin:0 0 12px;color:#6b5d47;font-size:12px;line-height:1.8}
.embed-note:last-child{margin:12px 0 0}
.detail-actions .creator-link,.detail-actions .project-link{min-height:44px}
.detail-actions .creator-link{margin:0}
.code-block{display:flex;flex-direction:column;border:2px solid #211d15;border-radius:6px;background:#efe6d2;overflow:hidden}
.code-block pre{margin:0;padding:13px 14px;overflow-x:auto;color:#2a2418;font:12px/1.75 ui-monospace,SFMono-Regular,Menlo,monospace}
.code-copy{align-self:flex-end;margin:0 10px 10px;padding:6px 11px;border:2px solid #211d15;border-radius:3px;background:#f4bd3c;color:#211d15;font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.3px;cursor:pointer;box-shadow:2px 2px 0 #211d15;transition:transform .1s,box-shadow .1s,background .15s}
.code-copy:hover{background:#ffd36a}
.code-copy:active{transform:translate(2px,2px);box-shadow:none}
.code-copy.is-done{background:#5c7a54;color:#f7f1e5}
.link-arrow { margin-left:12px; font-size:17px; }
.detail-facts { display:grid; gap:0; }
.detail-facts div { display:flex; justify-content:space-between; gap:12px; padding:12px 0; }
.detail-facts span { color:#6b5d47; font-size:11px; }
.detail-facts strong { color:#292319; font-size:11px; text-align:right; }
.gallery-heading { display:flex; flex-direction:column; align-items:flex-start; gap:6px; margin:30px 0 14px; }
.gallery-heading h2,.lab-links h2 { margin:0; color:#191711; font-size:21px; letter-spacing:-.5px; }
.lab-links { display:grid; gap:0; margin-top:30px; }
.lab-links h2 { padding:18px 0 8px; }
.lab-links a { display:flex; justify-content:space-between; align-items:center; padding:13px 2px; color:#4d3a1d; text-decoration:none; font-size:13px; font-weight:800; }
.lab-links a:hover { color:#a46b0e; }
.contributor { display:flex; flex-direction:column; gap:5px; padding:13px 2px; }
.contributor strong { color:#292319; font-size:13px; }
.contributor span { color:#6b5d47; font-size:11px; }
.lab-links a span { font-size:17px; }

/* ---------- 场景选择 ---------- */
.scene-picker {
  display:flex; gap:12px; margin-top:14px; padding:4px 2px 12px;
  overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x mandatory;
  scrollbar-width:thin; scrollbar-color:#b99a67 transparent;
}
.scene-choice {
  display:flex; flex:0 0 190px; min-width:0; flex-direction:column; align-items:stretch;
  gap:9px; padding:8px; border:1px solid #d1c3a8; background:#fff8e9;
  color:#403522; cursor:pointer; text-align:left; scroll-snap-align:start;
  transition:border-color .16s,background .16s,transform .16s;
}
.scene-choice:disabled { opacity:.55; cursor:wait; }
.scene-thumb {
  display:block; width:100%; aspect-ratio:16/10;
  background-image:url("https://raw.githubusercontent.com/GSvegetable/pixel-daylight-switch/main/assets/scene-gallery.png");
  background-repeat:no-repeat; background-size:500% 100%; background-position:center;
  border:1px solid rgba(55,42,24,.18);
}
.thumb-countryside { background-position:0% center; }
.thumb-japanese-street { background-position:25% center; }
.thumb-apartment { background-position:50% center; }
.thumb-seaside { background-position:75% center; }
.thumb-mountain-cabin { background-position:100% center; }
.scene-choice strong { padding:0 3px 3px; font-size:12px; font-weight:800; white-space:nowrap; }
.scene-choice:hover:not(:disabled) { border-color:#b98936; transform:translateY(-2px); }
.scene-choice.is-active { border:2px solid #8c5d13; background:#f4d78e; box-shadow:2px 2px 0 #211d15; }
.scene-choice:focus-visible { outline:2px solid #8c5d13; outline-offset:2px; }

/* Pixel Orbit uses the same .detail-copy, .detail-facts and .lab-links
   primitives as every other work; only its scene thumbnails are project-specific. */

/* ---------- 响应式 ---------- */
@media (max-width:1024px) {
  .top-bar { right: 14px; }
}
@media (max-width:680px) {
  .detail-overview { grid-template-columns:1fr; gap:22px; }
  .detail-facts { max-width:none; }
}
@media (max-width:600px) {
  #mario-nav { left:14px; gap:15px; }
  .mario-block { width:50px; height:50px; }
  .mario-block svg { width:22px; height:22px; }

  .top-bar { top: 16px; left: 14px; right: 14px; width: auto; }
  .search-wrapper { height: 46px; padding: 0 11px 0 13px; gap: 9px; border-radius: 6px; --collapse-shift: -64px; }
  html.search-collapsed .search-wrapper { width: 50px; max-width: 50px; height: 50px; }
  html.search-collapsed .search-icon { width: 22px; height: 22px; }
  .search-status { font-size: 10px; }

  main { min-height: calc(100vh + 420px); padding:80px 14px 180px; }
  .grid { padding-left:0; }

  .preview-actions { top: 14px; right: 14px; gap: 8px; }
  .action-btn { width: 40px; height: 40px; border-width: 2px; }
  .action-btn svg { width: 20px; height: 20px; }

  /* v2.8.5 — 手机端作品视图：上半屏放作品，详情面板改成底部抽屉（下半屏）滑出。
     旧版面板从右侧盖住整块作品区，手机上根本看不到作品，对比区也没地方放。 */
  .work-detail {
    top:auto; left:14px; right:14px; bottom:14px;
    width:auto; min-width:0; max-width:none;
    height:46vh; max-height:520px;
    padding:18px 18px 26px; border-radius:4px;
    box-shadow:0 -18px 48px rgba(0,0,0,.35);
    transform:translateY(110%);
  }
  /* 不写 body.viewing：关闭途中面板尺寸也不能变，否则会在滑出时跳一下 */
  body.viewing:not(.artwork-only) .work-detail.is-active { transform:none; }
  body.artwork-only .work-detail.is-active,
  body.view-closing .work-detail.is-active { transform:translateY(110%); }
  /* 手机上外框热区加宽一点，手指更好点 */
  .cmp-edge--top, .cmp-edge--bottom { height:20px; }
  .cmp-edge--left, .cmp-edge--right { width:20px; }
  /* 对比模式：主视图缩到左半屏，卡片标题让位给并排的两个画面 */
  body.compare-mode .preview-card.is-open .card-info { display:none; }
  .work-detail .compare-control { margin-top:16px; }
  .detail-description { font-size:13px; }
  .scene-choice strong { font-size:10px; }
  .orbit-detail-copy > p:not(.orbit-detail-kicker):not(.orbit-detail-subtitle) { font-size: 13px; }
}

/* ---------- 网站版本标识 ---------- */
.site-version {
  position: fixed;
  right: 12px;
  bottom: 72px;
  z-index: 120;
  padding: 5px 8px;
  border: 1px solid rgba(245,236,217,.24);
  border-radius: 4px;
  background: rgba(12,12,12,.72);
  color: #d8cbb4;
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .5px;
  pointer-events: none;
  user-select: none;
}

/* ---------- Unified project detail actions and section headings ---------- */
.project-link {
  min-height:46px;
  border-radius:8px;
  box-shadow:0 3px 0 #211d15;
}
.project-link:hover { transform:translateY(1px); box-shadow:0 2px 0 #211d15; }
.gallery-heading {
  margin-top:30px;
  padding-bottom:8px;
}
.gallery-heading h2 { font-size:20px; }
.gallery-heading > span { color:#75684f; font-size:12px; line-height:1.5; }
.lab-links { margin-top:26px; }
.lab-links h2 { font-size:18px; }

/* ---------- Language switch ---------- */
.language-toggle{position:fixed;top:25px;right:28px;z-index:19;min-width:48px;height:38px;padding:0 12px;border:2px solid #080808;border-radius:4px;background:#efa02c;color:#211d15;font-size:11px;font-weight:900;letter-spacing:.4px;box-shadow:0 3px 0 #080808;cursor:pointer;transition:transform .14s,box-shadow .14s}
.language-toggle:hover{transform:translateY(2px);box-shadow:0 1px 0 #080808}
.language-toggle:active{transform:translateY(3px);box-shadow:none}
.language-toggle:focus-visible{outline:2px solid #f5ecd9;outline-offset:4px}
@media(max-width:600px){.language-toggle{top:73px;right:14px;min-width:44px;height:34px}}

/* ---------- Top-right utility buttons: match the site's Mario block style ----------
   两个都是正方形图标方块：左边是设置齿轮，右边是贡献者小人。
   下滑时整组向上滑出视口（不是从屏幕边缘探出半个身子）——
   半截方块挂在屏幕边上既挡视线又容易被误触，干脆整个让开。 */
.top-utility-actions{position:fixed;top:24px;right:28px;z-index:120;display:flex;align-items:center;gap:10px;transition:transform var(--dur) var(--ease),opacity var(--dur) var(--ease)}
html.top-utility-hidden .top-utility-actions{transform:translateY(calc(-100% - 34px));opacity:0;pointer-events:none}
.top-utility-actions .contributors-toggle{
  position:static;display:grid;place-items:center;gap:0;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  border:3px solid #080808;border-radius:3px;background:#f4bd3c;color:#211d15;
  box-shadow:3px 4px 0 #000;cursor:pointer;text-decoration:none;
  transition:transform .1s,box-shadow .1s,background .15s;
}
.top-utility-actions .contributors-toggle:hover{transform:translate(1px,2px);box-shadow:2px 2px 0 #000;background:#ffd36a}
.top-utility-actions .contributors-toggle:active{transform:translate(3px,4px);box-shadow:none}
.top-utility-actions .contributors-toggle svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.top-utility-actions .language-toggle{position:static;display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 12px;border:3px solid #080808;border-radius:3px;background:#f4bd3c;color:#211d15;font:900 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.25px;text-decoration:none;white-space:nowrap;box-shadow:3px 4px 0 #000;cursor:pointer;transition:transform .1s,box-shadow .1s,background .15s}
.top-utility-actions .language-toggle:hover{transform:translate(1px,2px);box-shadow:2px 2px 0 #000;background:#ffd36a}
.top-utility-actions .language-toggle:active{transform:translate(3px,4px);box-shadow:none}
.top-utility-actions :focus-visible{outline:2px solid #f5ecd9;outline-offset:4px}
.top-utility-actions .language-toggle{min-width:48px}
@media(max-width:600px){
 .top-utility-actions{top:72px;right:14px;gap:7px}
 .top-utility-actions .contributors-toggle{width:38px;height:38px;min-width:38px;min-height:38px;box-shadow:2px 3px 0 #000}
 .top-utility-actions .contributors-toggle svg{width:21px;height:21px}
 .top-utility-actions .language-toggle{min-height:34px;padding:0 8px;border-width:2px;font-size:10px;box-shadow:2px 3px 0 #000}
 .top-utility-actions .language-toggle{min-width:42px}
}

/* Detail facts are intentionally clean: no row separators. */
.detail-facts,.detail-facts div{border:0!important;outline:0!important;box-shadow:none!important;background-image:none!important}
.detail-facts div::before,.detail-facts div::after{content:none!important;display:none!important}

/* One single divider between contributor credits and extended links. */
.contributor-list{border:0!important}
.contributor-list + .lab-links{border:0!important;border-top:1px solid rgba(41,35,25,.28)!important;margin-top:18px;padding-top:8px}
.contributor-list + .lab-links::before,.contributor-list + .lab-links::after{content:none!important;display:none!important}

/* Settings menu */
.top-utility-actions .settings-toggle{position:static;display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:3px solid #080808;border-radius:3px;background:#f4bd3c;color:#211d15;box-shadow:3px 4px 0 #000;cursor:pointer;transition:transform .1s,box-shadow .1s,background .15s}
.top-utility-actions .settings-toggle:hover{transform:translate(1px,2px);box-shadow:2px 2px 0 #000;background:#ffd36a}
.top-utility-actions .settings-toggle:active{transform:translate(3px,4px);box-shadow:none}
.top-utility-actions .settings-toggle .settings-icon{display:block;width:24px;height:24px;flex:none;overflow:visible;transform:none;vertical-align:middle}

.top-utility-actions .layout-toggle{position:static;display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:3px solid #080808;border-radius:3px;background:#f4bd3c;color:#211d15;box-shadow:3px 4px 0 #000;cursor:pointer;transition:transform .1s,box-shadow .1s,background .15s}
.top-utility-actions .layout-toggle:hover{transform:translate(1px,2px);box-shadow:2px 2px 0 #000;background:#ffd36a}
.top-utility-actions .layout-toggle:active{transform:translate(3px,4px);box-shadow:none}
.top-utility-actions .layout-toggle.is-tapping{animation:layout-button-tap 180ms ease-out}
@keyframes layout-button-tap{
  0%,100%{transform:translate(0,0);box-shadow:3px 4px 0 #000}
  35%{transform:translate(3px,4px);box-shadow:none}
}
.top-utility-actions .layout-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media(prefers-reduced-motion:reduce){.top-utility-actions .layout-toggle.is-tapping{animation:none}}

.settings-panel{position:absolute;top:calc(100% + 12px);right:0;width:230px;padding:12px 14px 12px;background:#f4ecd9;color:#211d15;border:3px solid #080808;border-radius:3px;box-shadow:5px 6px 0 #000;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.settings-panel[hidden]{display:none}
/* 面板开合用站点一贯的干脆时序，和马里奥方块的 0.1s 反馈一致 */
@keyframes settings-panel-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.settings-panel{animation:settings-panel-in .16s ease-out}
@media (prefers-reduced-motion: reduce){ .settings-panel{animation:none} }
.settings-panel-title{display:flex;justify-content:space-between;align-items:center;padding-bottom:11px;border-bottom:2px solid #211d15;font-size:13px;font-weight:900}
.settings-panel-title span{font-size:9px;opacity:.55;letter-spacing:1px}
.settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:7px;font-size:11px;font-weight:800;line-height:1.25}
.settings-row:first-child{padding-top:0}
/* 设置面板里的账号入口 */
.account-entry{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border:2px solid #080808;border-radius:2px;background:#f4bd3c;color:#211d15;font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;text-decoration:none;white-space:nowrap;box-shadow:2px 3px 0 #000;cursor:pointer;transition:transform .1s,box-shadow .1s,background .15s}
.account-entry:hover{background:#ffd36a}
.account-entry:active{transform:translate(2px,3px);box-shadow:none}
.account-entry.is-signed-in{background:#efe6d2;max-width:130px;overflow:hidden;text-overflow:ellipsis}
.account-note{color:#a2701a;font:700 10px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.1px}
.account-note[hidden]{display:none}
.top-utility-actions .settings-panel .language-toggle{position:static;min-width:48px;min-height:32px;padding:0 9px;border:2px solid #080808;border-radius:2px;background:#f4bd3c;color:#211d15;font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;box-shadow:2px 3px 0 #000;cursor:pointer}
@media(max-width:600px){
 .top-utility-actions .settings-toggle{min-height:34px;padding:0 9px;border-width:2px;font-size:10px;box-shadow:2px 3px 0 #000}
 .settings-panel{top:calc(100% + 9px);width:215px;padding:12px}
}

/* Keep top utility controls out of the way while a work is open. */
body.viewing .top-utility-actions{
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;
  transition:opacity .16s ease,visibility 0s linear .16s;
}

/* 关闭动画一开始首页就已重新显露，顶部工具按钮同步出现，不等待作品落位。 */
body.view-closing .top-utility-actions{
  opacity:1;visibility:visible;pointer-events:auto;
  transition:opacity .16s ease,visibility 0s;
}

/* Settings is a single square icon button, matching the pixel-block controls. */
.top-utility-actions .settings-toggle{
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  display:grid;place-items:center;gap:0;
  border:3px solid #080808;border-radius:3px;background:#f4bd3c;color:#211d15;
  box-shadow:3px 4px 0 #000;cursor:pointer;
}
.top-utility-actions .settings-toggle svg{
  width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}
.top-utility-actions .settings-toggle:hover{transform:translate(1px,2px);box-shadow:2px 2px 0 #000;background:#ffd36a}
.top-utility-actions .settings-toggle:active{transform:translate(3px,4px);box-shadow:none}
@media(max-width:600px){
 .top-utility-actions .settings-toggle{width:38px;height:38px;min-width:38px;min-height:38px;padding:0}
 .top-utility-actions .layout-toggle{width:38px;height:38px;min-width:38px;min-height:38px}
 .top-utility-actions .layout-toggle svg{width:20px;height:20px}
 .top-utility-actions .settings-toggle svg{width:21px;height:21px}
}

/* Gallery zoom changes the grid's column density, not the site chrome. */
main{--gallery-card-min:300px}
.grid{transform-origin:top left}
.preview-card{touch-action:pan-y}

/* Detail facts were removed; let the remaining project description use the full row. */
.detail-overview { grid-template-columns:minmax(0,1fr); }
.detail-copy { max-width:none; }

/* v3.3.13 — Pixel Orbit lab sits directly beneath its title on the work card. */
.orbit-card-info{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;cursor:default}
.preview-card.is-open .orbit-card-info{gap:8px}
.orbit-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.preview-card.is-open .orbit-card-info{opacity:1;pointer-events:auto}
@media(max-width:600px){}

/* v3.3.15 — restore the title and place the lab beneath the expanded artwork. */
.orbit-card-info{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:10px}
.orbit-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.preview-card.is-open .orbit-card-info{opacity:1!important;visibility:visible!important;pointer-events:auto!important}

/* v3.3.17 — stabilize the artwork's live scale and reveal the lab during the opening motion. */
/* Ease the per-frame ResizeObserver scale updates on the embedded artwork to avoid
   sub-pixel shimmer while the card is moving and resizing. */
.preview-card.is-animating .preview-mount > :not(script):not(style){
  transition:transform 90ms linear !important;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}

/* v3.3.18 — remove lag from the live iframe scale; JS updates it frame-by-frame. */
.preview-card.is-animating .preview-mount > :not(script):not(style){
  transition:none !important;
  backface-visibility:visible;
  -webkit-backface-visibility:visible;
}

/* v3.3.22 — three distinct Pixel Orbit editions and a genuinely expandable lab. */
.orbit-thumb-world{
  background:radial-gradient(circle at 50% 46%,#f7d98c 0 12%,#bd8a43 13% 19%,#27365c 20% 34%,#11172f 35% 100%);
  position:relative;
}
.orbit-thumb-world::after{
  content:"";position:absolute;inset:20%;border:2px solid rgba(255,224,150,.82);
  border-radius:50%;box-shadow:0 0 0 3px rgba(239,160,44,.18),0 0 12px rgba(239,160,44,.35);
}

/* ===== v2.8.6 — 收藏页重做：文件夹模式（文件夹列表 → 文件夹内作品缩略图） ===== */
.bookmarks-view { padding: 0 0 6px; }
.bookmarks-view[hidden] { display: none; }
body.is-bookmarks main { padding-top: 78px; }

.bookmarks-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 10px; padding-left: 88px;
}
.bookmarks-toolbar h2 { margin: 0; color: #191711; font-size: 22px; letter-spacing: -.5px; }
.bookmarks-toolbar h2::after { content: ''; } /* 去掉计数小字 */
.bookmarks-back {
  display: grid; place-items: center; width: 34px; height: 34px; margin-left: -2px;
  border: 3px solid #080808; border-radius: 4px; background: #f4bd3c; color: #211d15;
  box-shadow: 2px 3px 0 #000; cursor: pointer; transition: transform .1s, box-shadow .1s;
}
.bookmarks-back svg { width: 17px; height: 17px; }
.bookmarks-back:hover { background: #ffd36a; }
.bookmarks-back:active { transform: translate(2px, 3px); box-shadow: none; }
.bookmarks-back[hidden] { display: none; }

.folder-new {
  display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
  height: 38px; padding: 0 14px; cursor: pointer;
  border: 3px solid #080808; border-radius: 4px; background: #f4bd3c; color: #211d15;
  font: 900 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 3px 4px 0 #000; transition: transform .1s, box-shadow .1s, background .15s;
}
.folder-new:hover { background: #ffd36a; }
.folder-new:active { transform: translate(3px, 4px); box-shadow: none; }
.folder-new[hidden] { display: none; }
.folder-new-plus { font-size: 14px; line-height: 1; }

.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px 18px; padding: 14px 0 0 88px;
}
.folder-card {
  position: relative; padding: 14px 12px; text-align: left;
  border: 3px solid #080808; border-radius: 5px; background: #f5ecd9; color: #1a1712;
  box-shadow: 4px 4px 0 rgba(0,0,0,.5);
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.folder-card:hover { transform: translate(-1px, -2px); box-shadow: 5px 6px 0 rgba(0,0,0,.55); }
.folder-card:focus-visible { outline: 3px solid #f4bd3c; outline-offset: 4px; }
.folder-thumbs { display: flex; gap: 6px; min-height: 40px; margin-bottom: 10px; }
.folder-thumb {
  width: 60px; height: 40px; border: 2px solid #080808; border-radius: 3px;
  background: #211d15; flex: 0 0 auto;
}
.folder-thumb[data-work="pixel-daylight-switch"] {
  background: linear-gradient(160deg, #d6ecff 0%, #93c6e6 38%, #2c4757 39%, #1a2a36 100%);
}
.folder-thumb[data-work="pixel-orbit"] {
  background: radial-gradient(circle at 50% 52%, #ffd36a 0 20%, #b8792d 21% 34%, #1b2947 35% 100%);
}
.folder-thumb.is-empty {
  background: repeating-linear-gradient(135deg, #e7dcc4 0 6px, #f0e7d3 6px 12px);
  box-shadow: none; border-style: dashed; border-color: #b9a889;
}
.folder-name {
  display: block; max-width: 100%; color: #191711;
  font-size: 16px; font-weight: 900; letter-spacing: .3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.folder-meta { display: none; } /* 去掉计数 */
.folder-actions { display: none; } /* 去掉重命名/删除按钮 */
.folder-name-input {
  width: 100%; height: 32px; padding: 0 8px;
  border: 2px solid #080808; border-radius: 3px; background: #fffdf7; color: #1a1712;
  font: 900 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none;
}
.folder-hint { padding: 60px 20px; margin: 0; text-align: center; color: #8b7d67; font-size: 13px; font-weight: 700; }
.folder-hint[hidden] { display: none; }

/* 收藏夹原位展开：文件夹卡片保留，作品区作为它后面的整行内容出现。 */
body.folders-root .grid { display: none; }
.folder-inline-panel {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 2px 0 10px;
  animation: folder-panel-in .28s cubic-bezier(.2,.75,.25,1) both;
}
.folder-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-items: start;
  gap: 18px 20px;
  padding: 4px 2px 8px;
}
.folder-inline-empty {
  margin: 0;
  padding: 22px 18px;
  border: 2px dashed #c8b995;
  border-radius: 4px;
  color: #8b7d67;
  font-size: 12px;
  font-weight: 700;
}
@keyframes folder-panel-in {
  from { opacity: 0; transform: translateY(-9px); }
  to { opacity: 1; transform: translateY(0); }
}
body.is-bookmarks .preview-card:not(.is-open):not(.is-closing) {
  position: relative;
  padding: 8px;
  transition: transform .22s cubic-bezier(.2,.75,.25,1), box-shadow .22s cubic-bezier(.2,.75,.25,1);
}
.folder-card.is-expanded {
  background: #f4bd3c;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 4px 4px 0 rgba(0,0,0,.58);
}
body.is-bookmarks .preview-card.folder-item-enter:not(.is-open):not(.is-closing) {
  animation: folder-work-in .34s cubic-bezier(.2,.75,.25,1) both;
  animation-delay: calc(var(--folder-item-index, 0) * 55ms);
}
@keyframes folder-work-in {
  from { opacity: 0; transform: translateY(13px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* 第一次点作品只向左探出一点；第二次点击交给主页原有 FLIP 展开。 */
body.is-bookmarks .preview-card.folder-peeked:not(.is-open):not(.is-closing) {
  z-index: 4;
  transform: translateX(-10px) translateY(-2px);
  box-shadow: 12px 11px 0 rgba(0,0,0,.62), 0 22px 42px rgba(0,0,0,.2);
}
@media (prefers-reduced-motion: reduce) {
  .folder-inline-panel, body.is-bookmarks .preview-card.folder-item-enter { animation: none !important; }
  body.is-bookmarks .preview-card.folder-peeked { transition-duration: .01ms !important; }
}
/* 「移出文件夹」按钮默认不出现：只在收藏页打开文件夹时显示在缩略图右上角 */
.bookmark-remove { display: none; }
body.is-bookmarks .bookmark-desc { display: none; }
body.is-bookmarks.folder-open .bookmark-remove {
  display: grid; place-items: center; position: absolute; top: 16px; right: 16px; z-index: 3;
  width: 26px; height: 26px; padding: 0; cursor: pointer;
  border: 2px solid #080808; border-radius: 3px; background: #f5ecd9; color: #211d15;
  font: 900 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 2px 2px 0 #000; transition: transform .1s, box-shadow .1s, background .15s;
}
body.is-bookmarks.folder-open .bookmark-remove:hover { background: #e94c43; color: #fff; }
body.is-bookmarks.folder-open .bookmark-remove:active { transform: translate(2px, 2px); box-shadow: none; }

/* 「收藏到文件夹」弹层 */
.folder-picker {
  position: fixed; z-index: 130; width: 264px; padding: 14px;
  border: 3px solid #080808; border-radius: 5px; background: #f5ecd9; color: #1a1712;
  box-shadow: 6px 7px 0 rgba(0,0,0,.72);
}
.folder-picker[hidden] { display: none; }
.fp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px; color: #8a6a1c;
  font: 900 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1.2px;
}
.fp-close {
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border: 2px solid #080808; border-radius: 3px; background: #f5ecd9; cursor: pointer;
  font: 900 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #211d15;
}
.fp-close:hover { background: #f4bd3c; }
.fp-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.fp-empty { margin: 2px 0 4px; color: #8a7a5c; font: 700 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.fp-row {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px;
  border: 2px solid transparent; border-radius: 3px; background: #efe6d2; color: #211d15;
  font: 800 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: left; cursor: pointer;
}
.fp-row:hover { background: #f7eeda; }
.fp-check {
  display: grid; place-items: center; width: 16px; height: 16px; flex: 0 0 auto;
  border: 2px solid #211d15; border-radius: 2px; background: #fffdf7;
}
.fp-row.is-in .fp-check { background: #f4bd3c; }
.fp-row.is-in .fp-check::after {
  content: "✓"; font: 900 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #211d15;
}
.fp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-count { color: #8a7a5c; font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.fp-new { display: flex; gap: 6px; margin-top: 10px; }
.fp-new input {
  flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 8px;
  border: 2px solid #211d15; border-radius: 3px; background: #fffdf7; color: #1a1712;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none;
}
.fp-new input:focus { border-color: #f4bd3c; box-shadow: 0 0 0 3px rgba(244,189,60,.25); }
.fp-new button {
  width: 34px; height: 32px; padding: 0; cursor: pointer;
  border: 2px solid #080808; border-radius: 3px; background: #f4bd3c; color: #211d15;
  font: 900 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; box-shadow: 2px 2px 0 #000;
}

@media (max-width: 600px) {
  body.is-bookmarks main { padding-top: 70px; }
  .bookmarks-toolbar { padding-left: 64px; gap: 10px; margin-bottom: 8px; }
  .bookmarks-toolbar h2 { font-size: 19px; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; padding-top: 4px; }
  .folder-card { padding: 16px 10px 12px; }
  .folder-tab { width: 64px; }
  .folder-thumb { width: 100%; max-width: 60px; height: 40px; }
  .folder-actions { opacity: 1; }
  .folder-new { height: 34px; padding: 0 10px; }
  .folder-works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  body.is-bookmarks .preview-card.folder-peeked:not(.is-open):not(.is-closing) { transform: translateX(-6px) translateY(-2px); }
  .folder-picker { left: 14px; right: 14px; bottom: 14px; width: auto; padding: 16px; }
}

/* v2.7 — 设置面板去掉标题与横线后，账号/语言按钮统一尺寸 */
.top-utility-actions .settings-panel .account-entry,
.top-utility-actions .settings-panel .language-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; height: 32px; min-height: 32px; padding: 0 11px;
  border: 2px solid #080808; border-radius: 3px;
  font: 900 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 2px 3px 0 #000;
}

/* ===== v2.8.2 — 作品视图：左侧随页面滚动，右侧面板独立滚动 ===== */
.work-spacer { display: block; height: 0; }
/* 作品打开后：卡片改为文档流坐标的绝对定位，随页面滚动，且不再有内部滚动条 */
.preview-card.is-open.is-settled { position: absolute; max-height: none; overflow: visible; }

/* 版本对比：主视图下方「版本对比」开关 + 副视图 */
.work-extras {
  position: absolute; z-index: 20;
  display: flex; flex-direction: column; gap: 12px;
  pointer-events: auto;
}
.work-extras[hidden] { display: none; }

.compare-toggle {
  align-self: flex-start;
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; cursor: pointer;
  border: 3px solid #080808; border-radius: 4px;
  background: #f5ecd9; color: #211d15;
  font: 900 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 3px 4px 0 #000;
  transition: transform .1s, box-shadow .1s, background .15s;
}
.compare-toggle:hover { background: #ffd36a; }
.compare-toggle[aria-pressed="true"] { background: #f4bd3c; }
.compare-toggle:active { transform: translate(3px, 4px); box-shadow: none; }

.compare-view { display: flex; flex-direction: column; gap: 8px; }
.compare-view[hidden] { display: none; }
.compare-view .compare-frame {
  position: relative; width: 100%; aspect-ratio: 1.6439;
  border: 3px solid #080808; border-radius: 4px; background: #0e0d0a; overflow: hidden;
  cursor: pointer; box-shadow: 5px 6px 0 #000;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.compare-view .compare-frame iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; pointer-events: auto; }
.compare-view.is-selected .compare-frame { border-color: #f4bd3c; box-shadow: 0 0 0 3px #f4bd3c, 5px 6px 0 #000; }
.compare-view-caption { margin: 0; color: #8a7a5c; font: 700 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 选中主视图：作品框变黄 */
.preview-card.is-compare-selected .preview-mount { border-color: #f4bd3c; box-shadow: 0 0 0 3px #f4bd3c; }

/* ===== v2.8.5 — 「版本对比」开关搬进右侧面板（「嵌进你的网页」上方） ===== */
.work-detail .compare-control { display:flex; flex-direction:column; gap:7px; margin:26px 0 0; padding-top:16px; border-top:1px solid #d9cbb1; }
.work-detail .compare-toggle { align-self:flex-start; }
.compare-hint { margin:0; color:#8a7a5c; font:700 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ===== v2.8.5 — 选中改为「点外框」：画面中间永远可交互 ===== */
.cmp-ring { position:absolute; inset:0; z-index:6; display:none; pointer-events:none; }
/* 只在当前作品的主视图 / 副视图上启用外框；网格里其他卡片（包括被遮罩盖住的）不显示 */
body.compare-mode .preview-card.is-open .cmp-ring,
body.compare-mode .compare-frame .cmp-ring { display:block; }
.cmp-edge {
  position:absolute; appearance:none; margin:0; padding:0; border:0;
  background:transparent; cursor:pointer; pointer-events:auto;
}
.cmp-edge--top { top:0; left:0; right:0; height:16px; }
.cmp-edge--bottom { bottom:0; left:0; right:0; height:16px; }
.cmp-edge--left { top:0; bottom:0; left:0; width:16px; }
.cmp-edge--right { top:0; bottom:0; right:0; width:16px; }
.cmp-ring-border {
  position:absolute; inset:0; border:2px dashed rgba(244,189,60,.5);
  pointer-events:none; transition:border-color .12s ease, box-shadow .12s ease;
}
.cmp-ring:hover .cmp-ring-border { border-color:#f4bd3c; border-style:solid; }
.preview-card.is-compare-selected .cmp-ring-border,
.compare-view.is-selected .cmp-ring-border {
  border:3px solid #f4bd3c;
  box-shadow:0 0 0 2px rgba(8,8,8,.6), 0 0 18px rgba(244,189,60,.45);
}
.cmp-ring-badge {
  display:none; position:absolute; top:8px; left:8px; z-index:2;
  padding:4px 7px; border:2px solid #080808; border-radius:2px;
  background:#f4bd3c; color:#1b160e;
  font:900 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing:.5px;
  pointer-events:none;
}
.preview-card.is-compare-selected .cmp-ring-badge,
.compare-view.is-selected .cmp-ring-badge { display:block; }
/* 外框挂在 .preview-mount 里，要躲开「舞台内容绝对定位 + scale」那条通用规则 */
.preview-mount > .cmp-ring {
  position:absolute !important;
  left:0 !important; top:0 !important; right:0 !important; bottom:0 !important;
  width:auto !important; height:auto !important; max-width:none !important; max-height:none !important;
  margin:0 !important; border:0 !important; border-radius:0 !important;
  transform:none !important; transform-origin:0 0 !important;
  pointer-events:none;
}
.preview-card.is-animating .cmp-ring { display:none !important; }
body.artwork-only .cmp-ring, body.view-closing .cmp-ring { display:none !important; }


/* ---------- 返回顶部：与右上角工具方块同尺寸，滚动时从底部接力入场 ---------- */
.back-to-top{
  position:fixed;right:28px;bottom:24px;z-index:121;
  display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  border:3px solid #080808;border-radius:3px;background:#ffd400;color:#1b2146;
  box-shadow:3px 4px 0 #000;cursor:pointer;
  opacity:0;visibility:hidden;pointer-events:none;
  transform:translateY(calc(100% + 34px));
  transition:transform var(--dur) var(--ease),opacity var(--dur) var(--ease),visibility 0s linear var(--dur),background .15s;
}
.back-to-top svg{width:23px;height:23px;display:block}
.back-to-top:hover{transform:translateY(0) translate(1px,-2px);background:#ffe04d;box-shadow:2px 2px 0 #000}
.back-to-top:active{transform:translateY(0) translate(3px,2px);box-shadow:none}
html.back-to-top-visible .back-to-top{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);transition:transform var(--dur) var(--ease),opacity var(--dur) var(--ease),visibility 0s,background .15s}
.back-to-top:focus-visible{outline:2px solid #f4bd3c;outline-offset:4px}
@media(max-width:600px){.back-to-top{right:14px;bottom:16px}}


/* v2.8.14 — 收藏页专属工具栏：用新建文件夹替换布局与设置入口 */
body.is-bookmarks .top-utility-actions .layout-toggle,
body.is-bookmarks .top-utility-actions .settings-toggle { display:none !important; }
body.is-bookmarks .top-utility-actions { pointer-events:none; }
body.is-bookmarks .bookmarks-toolbar .folder-new {
  position:fixed; top:24px; right:28px; z-index:121; margin:0;
  pointer-events:auto;
}
@media(max-width:600px){
  body.is-bookmarks .bookmarks-toolbar .folder-new { top:72px; right:14px; }
}
.folder-card { padding-right:42px; }
.folder-delete {
  position:absolute; top:9px; right:9px; z-index:2;
  display:grid; place-items:center; width:27px; height:27px; padding:0;
  border:2px solid #080808; border-radius:3px; background:#efe6d2; color:#211d15;
  box-shadow:2px 2px 0 #000; cursor:pointer;
  font:900 18px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  transition:background .12s, color .12s, transform .1s, box-shadow .1s;
}
.folder-delete:hover { background:#e94c43; color:#fff; }
.folder-delete:active { transform:translate(2px,2px); box-shadow:none; }

/* 账号弹窗：点击账号先查看资料，只有二次确认后才退出 */
.account-modal-backdrop {
  position:fixed; inset:0; z-index:500; display:grid; place-items:center;
  padding:20px; background:rgba(12,10,7,.58); backdrop-filter:blur(4px);
}
.account-modal {
  width:min(390px,100%); border:3px solid #080808; border-radius:4px;
  background:#f5ecd9; color:#211d15; box-shadow:6px 7px 0 #000;
  animation:account-modal-in .16s ease-out;
}
@keyframes account-modal-in { from{opacity:0;transform:translateY(-8px) scale(.98)} to{opacity:1;transform:none} }
.account-modal-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border-bottom:3px solid #080808; background:#efe6d2; }
.account-modal-kicker { margin:0 0 5px; color:#a2701a; font:900 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:1.8px; }
.account-modal-head h2 { margin:0; font-size:19px; font-weight:900; }
.account-modal-close { width:30px; height:30px; border:2px solid #080808; border-radius:3px; background:#f4bd3c; color:#211d15; font:900 20px/1 ui-monospace,monospace; cursor:pointer; box-shadow:2px 3px 0 #000; }
.account-modal-body { padding:20px 18px 18px; }
.account-modal-label { display:block; margin-bottom:7px; color:#8b7d67; font:800 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:1px; }
.account-modal-username { display:block; overflow-wrap:anywhere; font-size:17px; font-weight:900; }
.account-modal-actions { display:flex; gap:10px; margin-top:22px; }
.account-modal-actions button { flex:1; min-height:40px; padding:0 12px; border:2px solid #080808; border-radius:3px; font:900 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace; cursor:pointer; box-shadow:2px 3px 0 #000; }
.account-modal-logout,.account-modal-confirm { background:#f4bd3c; color:#211d15; }
.account-modal-cancel { background:#fffdf7; color:#211d15; }
.account-modal-actions button:active { transform:translate(2px,3px); box-shadow:none; }
.account-modal-confirm-title { margin:0; font-size:16px; font-weight:900; }
.account-modal-confirm-text { margin:9px 0 0; color:#74664f; font-size:12px; line-height:1.7; }
@media(prefers-reduced-motion:reduce){.account-modal{animation:none}}


/* v2.9.6 — 顶栏账号入口：未登录显示 Sign in，登录后只显示方形头像 */
.top-utility-actions > .account-entry {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:44px;
  padding:0 12px;
  border:3px solid #080808;
  border-radius:3px;
  background:#f4bd3c;
  color:#211d15;
  font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  text-decoration:none;
  white-space:nowrap;
  box-shadow:3px 4px 0 #000;
  cursor:pointer;
  transition:transform .1s,box-shadow .1s,background .15s;
}
.top-utility-actions > .account-entry:hover { background:#ffd36a; }
.top-utility-actions > .account-entry:active { transform:translate(3px,4px);box-shadow:none; }
.top-utility-actions > .account-entry.is-signed-in {
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  overflow:hidden;
  background:#efe6d2;
}
.top-utility-actions > .account-entry.is-signed-in .account-avatar {
  display:grid;
  width:100%;
  height:100%;
  flex:1 1 auto;
  border:0;
  border-radius:0;
  background:transparent;
  font-size:14px;
}
.top-utility-actions > .account-entry.is-signed-in .account-avatar img {
  width:100%;
  height:100%;
  object-fit:cover;
}
.top-utility-actions > .account-entry .account-entry-name { display:none; }
@media (max-width:700px) {
  .top-utility-actions > .account-entry.is-signed-in {
    width:38px;height:38px;min-width:38px;min-height:38px;
  }
  .top-utility-actions > .account-entry:not(.is-signed-in) {
    min-height:38px;padding:0 9px;border-width:2px;
    box-shadow:2px 3px 0 #000;
  }
}

.top-utility-actions > .account-note {
  position:absolute;
  top:calc(100% + 8px);
  right:54px;
  max-width:220px;
  padding:7px 9px;
  border:1px solid rgba(8,8,8,.25);
  border-radius:3px;
  background:#f4ecd9;
  box-shadow:2px 3px 0 rgba(0,0,0,.35);
}
@media (max-width:700px) {
  .top-utility-actions > .account-note { right:46px;max-width:190px; }
}

/* v2.9.7 — 顶栏顺序为布局、设置、账号；Sign in 字重与图标线条协调 */
.top-utility-actions > .account-entry:not(.is-signed-in) {
  font-weight:600;
  letter-spacing:.15px;
}

/* v2.9.8 — language/globe icon and stronger Sign in lettering */
.top-utility-actions > .account-entry:not(.is-signed-in) {
  font-weight:800;
  letter-spacing:.1px;
}
.top-utility-actions .settings-toggle .settings-icon {
  stroke-width:2;
}


/* v2.11.0 — square account avatar and refreshed account dialog */
.account-modal-backdrop{z-index:700}
.account-modal{border-radius:10px;box-shadow:0 22px 70px rgba(0,0,0,.28)}
.account-modal-kicker{display:none!important}
.account-avatar{border-radius:0!important}


/* v2.12.19 — blank handoff canvas for the future bookmarks page */
body.is-bookmarks {
  overflow: hidden !important;
  background: #000 !important;
}
body.is-bookmarks #mario-nav,
body.is-bookmarks #top-bar,
body.is-bookmarks #top-utility,
body.is-bookmarks #settings-panel,
body.is-bookmarks .site-version,
body.is-bookmarks .detail-content,
body.is-bookmarks .work-detail,
body.is-bookmarks .preview-actions,
body.is-bookmarks .work-extras {
  display: none !important;
}
body.is-bookmarks main {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #000 !important;
}
body.is-bookmarks main > :not(#bookmarks-view) {
  display: none !important;
}
body.is-bookmarks #bookmarks-view {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
}
