@font-face { font-family: "Pickset Wordmark"; src: url("./fonts/pickset-wordmark.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Pickset Latin"; font-weight: 500; src: url("./fonts/pickset-latin-medium.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #f5f4f1;
  --table: #ebe9e4;
  --card: #ffffff;
  --ink: #141414;
  --muted: #5d5b56;
  --line: #e4e1db;
  --soft: #f2f1ee;
  --focus: #2f6fed;
  --danger: #b3261e;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow: 0 8px 32px rgba(20, 20, 20, 0.16);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --pad: 20px;      /* 面板左右的内边距 */
  --side: 0px;      /* 电脑上右侧面板占掉的宽度 */
  --panelH: 0px;    /* 手机上底部面板的高度，由脚本量出来 */

  /* 文字只用这五档，网站名单独算。字重只用 400 和 500，只有第 1 名的名次加粗 */
  --fsTitle: 20px;  /* 标题、名次 */
  --fsBody: 16px;   /* 正文、条目名 */
  --fsUi: 15px;     /* 按钮、卡片里的标题 */
  --fsNote: 14px;   /* 次要文字 */
  --fsTiny: 13px;   /* 卡片里的次要文字、dock */
  /* system-ui 是各系统自己的界面字体。电脑版 Chrome 不认 -apple-system，只写它会退到苹方 */
  --sans: system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans CJK SC", Roboto, sans-serif;
  --heading: "Pickset Latin", var(--sans);
  --gap: 24px;      /* 组与组之间；组内用 8 到 12 */
}
/* 汉字的字形随语言不同（日文的“直”“骨”和中文的写法不一样），按界面语言换中日韩字体；画布上的字见 render/kit.js 的 FONTS */
:root:lang(zh-Hant) { --sans: system-ui, -apple-system, "PingFang TC", "HarmonyOS Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", Roboto, sans-serif; }
:root:lang(ja) { --sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Yu Gothic UI", Meiryo, Roboto, sans-serif; }
:root:lang(ko) { --sans: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans CJK KR", "Malgun Gothic", Roboto, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fsBody)/1.5 var(--sans);
}
/* 整个界面默认不能选文字、长按不弹系统菜单（iOS 长按拖动画面或按钮时会去选附近的文字），图片也不能拖出去。
   能打字的框、“关于”和导出弹窗里的说明文字照常可以选、复制；导出的图片和视频、下载链接保留长按菜单（长按存图） */
.app, .sheet { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; }
input[type="text"], input[type="search"], textarea, .sheet p, .sheet li { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.sheet img, .sheet video, .sheet a { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; -webkit-user-drag: auto; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
/* 图标都是 Lucide 的 24 格画布。缩小显示时线宽按比例加粗，看起来和 24px 的一样粗 */
svg { flex: 0 0 auto; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
svg.s20 { width: 20px; height: 20px; stroke-width: 2.1; }
svg.s18 { width: 18px; height: 18px; stroke-width: 2.33; }
svg.s16 { width: 16px; height: 16px; stroke-width: 2.6; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* 英文标题的字距已经收紧在字体里（见 tools/make_title_font.py），中文不收 */
h1, h2 { margin: 0; font-family: var(--heading); font-size: var(--fsTitle); font-weight: 500; line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
.count { color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: var(--fsNote); margin-left: 4px; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: var(--fsNote); margin: 0; }
.hint:empty { display: none; }
.srOnly { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- 通用控件 ---------- */

.seg { display: inline-flex; gap: 2px; background: var(--soft); border-radius: 23px; padding: 3px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font-size: var(--fsUi); font-weight: 500;
  padding: 0 14px; border-radius: 20px; min-width: 60px; min-height: 40px;
}
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
/* 选中的白色底块（js/seg.js 放进来的 .segOn）：和 dock 的选中块一样滑过去，同样的 0.38 秒和缓动。
   三片拼成：两头的圆只平移，中间一条横向缩放，只动 transform。接上脚本后（.slides）按钮自己不再画底 */
.seg { --slide: 0.38s cubic-bezier(0.4, 0, 0.1, 1); position: relative; }
.seg.slides button { position: relative; transition: color var(--slide); }
.seg.slides button[aria-pressed="true"], .seg.slides button[aria-selected="true"] { background: transparent; box-shadow: none; }
.segOn { position: absolute; left: 0; right: 0; pointer-events: none; opacity: 0; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12)); transition: opacity 0.2s ease; }
.segOn.shown { opacity: 1; }
.segOn i { position: absolute; left: 0; top: 0; height: 100%; background: var(--card); transform-origin: 0 0; transition: transform var(--slide); }
.segOn i:nth-child(odd) { width: calc(var(--r) * 2); border-radius: var(--r); }
.segOn i:nth-child(2) { width: 1px; }
.segOn.still i, .segOn.hard { transition: none; }   /* 直接到位：still 不滑，hard 连淡入淡出也不要 */

.btn {
  display: block; width: 100%; text-align: center; text-decoration: none; font-size: var(--fsUi); font-weight: 500; border: 0; border-radius: 26px;
  cursor: pointer; background: var(--ink); color: #fff; min-height: 50px; line-height: 50px; padding: 0 18px;
}
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.small { width: auto; min-height: 44px; line-height: 44px; padding: 0 18px; border-radius: 22px; }
.btn:disabled { opacity: 0.4; }
.main {
  display: block; width: 100%; min-height: 50px; border: 0; border-radius: 25px; padding: 0 20px;
  background: var(--ink); color: #fff; font-size: var(--fsUi); font-weight: 500;
}
/* 首屏的按钮：黑底碟面，一两道压暗的彩光绕着按钮下方的圆心慢慢转，鼠标划过时再偏一点（--aim 由脚本给）。
   旁边没有别的文字，按正文字号 */
#btnStart, #btnPick {
  position: relative; isolation: isolate; overflow: hidden; width: auto; min-height: 50px; padding: 0 30px; background: #131315; font-size: var(--fsBody);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.3), 0 12px 22px -10px rgba(20, 20, 20, 0.45); transition: transform 0.18s var(--ease);
}
#btnStart:active, #btnPick:active { transform: scale(0.97); }
#btnStart::before, #btnPick::before {
  content: ""; position: absolute; z-index: -1; left: calc(50% - 224px); top: -24px; width: 448px; height: 448px; rotate: var(--aim, 0deg); transition: rotate 0.35s var(--ease);
  background: conic-gradient(from -90deg, #131315 0, #151517 70deg, #1f1a26 74deg, #2b2550 78deg, #1f3b5c 81.5deg, #1a4a47 84.5deg, #343d26 87.5deg, #33241f 90.5deg, #1a1a1c 95deg,
    #151517 100deg, #211c2e 103deg, #1a2f40 106deg, #1a332c 108.5deg, #161618 113deg, #131315);
  animation: gleam 14s ease-in-out infinite alternate;
}
#btnStart::after, #btnPick::after { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
@keyframes gleam { from { transform: rotate(-13deg); } to { transform: rotate(13deg); } }
.main:disabled { background: #e4e2dd; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px;
  background: var(--soft); font-size: var(--fsUi); font-weight: 500; white-space: nowrap;
}
.pill.small { padding: 0 14px; }
.textBtn { min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: transparent; color: var(--muted); font-size: var(--fsUi); font-weight: 500; white-space: nowrap; }
.round { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px; background: transparent; display: grid; place-items: center; }
.icon { flex: 0 0 auto; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center; }
.capsule {
  padding: 6px; border-radius: 31px; background: rgba(255, 255, 255, 0.78); box-shadow: var(--shadow), inset 0 0 0 1px rgba(20, 20, 20, 0.06);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.rowText { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.rowText small { color: var(--muted); font-size: var(--fsNote); }

/* ---------- 整体布局 ---------- */

/* 底色：首屏取视频边缘的颜色；进入编辑后是桌面的边缘色，画面四周再由 .desk 接着桌面的渐变画，看不出边界。
   桌面的颜色定义在 render/cases.js，由脚本写到 --desk */
.app { position: fixed; inset: 0; overflow: hidden; background: none; }
.app::before { content: ""; position: absolute; inset: 0; background: linear-gradient(#f0eee9, var(--table)); }
.app:not([data-screen="hero"])::before { background: var(--desk, var(--table)); }
.desk { position: absolute; z-index: -1; pointer-events: none; }
.desk canvas { display: block; width: 100%; height: 100%; }

.hero { position: absolute; inset: 0; overflow: hidden; opacity: 1; transition: opacity 0.4s ease; }
.app:not([data-screen="hero"]) .hero { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; }
.heroMedia { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.heroMedia.on { opacity: 1; }
img.heroMedia { transition: opacity 0.4s ease; }
/* 实时首屏：hero-live.html 铺满首屏，点击穿过它 */
.heroLive { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
/* 特别宽的窗口：铺满宽度会把上下裁掉太多，改成按高度放，两侧融进背景 */
@media (min-aspect-ratio: 19/10) {
  .heroMedia { object-fit: contain; -webkit-mask-image: linear-gradient(90deg, transparent 12%, #000 30%, #000 70%, transparent 88%); mask-image: linear-gradient(90deg, transparent 12%, #000 30%, #000 70%, transparent 88%); }
}

.topbar {
  position: absolute; z-index: 2; left: 0; right: var(--side); top: 0; height: calc(72px + var(--sat)); padding: var(--sat) 14px 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; transition: right 0.42s var(--ease), opacity 0.2s ease;
}
.topbar > * { pointer-events: auto; }
.wordmark { border: 0; background: transparent; padding: 0; min-height: 44px; font-family: "Pickset Wordmark", serif; font-size: 24px; font-weight: 400; letter-spacing: -0.02em; }
.topbar .wordmark { padding-bottom: 4px; }   /* 抬 2px，小写字母的中线和右边的图标对齐 */
.topActions { position: relative; display: flex; gap: 2px; }
/* 语言菜单：挂在右上角两个按钮下面，右边和关于按钮对齐。颜色自带，不跟着深色桌面变 */
.langMenu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 168px; padding: 6px; display: flex; flex-direction: column;
  border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px rgba(20, 20, 20, 0.06);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98); transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.38s var(--ease), visibility 0.2s;
}
.langMenu.on { opacity: 1; visibility: visible; transform: none; }
.langMenu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 16px;
  background: transparent; color: inherit; font: inherit; font-size: var(--fsUi); text-align: left; cursor: pointer;
}
.langMenu button:hover { background: var(--soft); }
.langMenu button[aria-pressed="true"] { font-weight: 500; }
.langMenu button[aria-pressed="true"]::after {   /* 对勾 */
  content: ""; width: 12px; height: 7px; margin-top: -3px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg);
}

.stageArea {
  position: absolute; z-index: 1; left: 0; right: var(--side); top: calc(72px + var(--sat)); bottom: calc(max(var(--panelH), 102px + var(--sab)) + 16px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: bottom 0.42s var(--ease), right 0.42s var(--ease);
}
.stageWrap { position: relative; flex: 0 1 auto; min-height: 0; height: 100%; max-height: calc((100vw - 40px) * 4 / 3); aspect-ratio: 3 / 4; }
#stage { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.3s ease; }
#stage.ready { opacity: 1; }
/* 三维引擎和封面还没准备好时转圈，稍等一下再出现，快的时候不闪 */
#stage:not(.ready) ~ .loading { display: block; }
.loading { display: none; position: absolute; left: 50%; top: 50%; margin: -17px; opacity: 0; animation: spin 0.8s linear infinite, appear 0.3s 0.6s forwards; }
@keyframes appear { to { opacity: 1; } }
.replay { position: absolute; inset: 0; border: 0; padding: 0; background: transparent; }
/* 手动摆放时叠在画面上的一层：平时不拦截操作，摆放时接管拖动 */
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#overlay.on { pointer-events: auto; touch-action: none; cursor: grab; }
#overlay.on.dragging { cursor: grabbing; }
#overlay.on.preview { cursor: pointer; }
/* 裁切标记：标出导出画面的边界 */
.crop { position: absolute; width: 18px; height: 18px; border: 0 solid rgba(20, 20, 20, 0.45); pointer-events: none; }
.crop.tl { left: -9px; top: -9px; border-width: 1.5px 0 0 1.5px; }
.crop.tr { right: -9px; top: -9px; border-width: 1.5px 1.5px 0 0; }
.crop.bl { left: -9px; bottom: -9px; border-width: 0 0 1.5px 1.5px; }
.crop.br { right: -9px; bottom: -9px; border-width: 0 1.5px 1.5px 0; }
.replayHint { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: var(--fsNote); }
.app:not([data-screen="stage"]) .replayHint { display: none; }

.dock {
  position: absolute; z-index: 5; left: 16px; right: calc(16px + var(--side)); bottom: calc(24px + var(--sab)); max-width: 348px; height: 62px; margin: 0 auto;
  display: flex; justify-content: center; align-items: stretch; gap: 4px; transition: transform 0.42s var(--ease), right 0.42s var(--ease);
}
.tab {
  flex: 1; min-width: 0; padding: 0; border: 0; border-radius: 25px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; font-size: var(--fsTiny); font-weight: 500; line-height: 1.25;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.9; }
/* 选中的样子是盖在上面的一层黑底白字的副本（app.js 里复制出来），只露出圆角的一块，切换时这一块滑过去，
   文字正好在边缘处变色。--i 是第几个；没有选中时缩小一点淡出，再选中时原地出现，不从别处滑来 */
.dockOn {
  --w: calc((100% - 8px) / 3); --in: 6px; --left: calc(var(--i, 0) * (var(--w) + 4px));
  position: absolute; inset: 6px; display: flex; gap: 4px; background: var(--ink); color: #fff; pointer-events: none; opacity: 0;
  clip-path: inset(var(--in) calc(100% - var(--left) - var(--w) + var(--in) * 2) var(--in) calc(var(--left) + var(--in) * 2) round 25px);
  transition: opacity 0.2s ease, clip-path 0s 0.2s;
}
.dockOn.on { --in: 0px; opacity: 1; transition: opacity 0.2s ease, clip-path 0.38s cubic-bezier(0.4, 0, 0.1, 1); }
.app.working .dockOn.on { opacity: 0.35; }
.tab:disabled { opacity: 0.35; }
/* 首屏只有一颗按钮，不要底下的胶囊 */
.app[data-screen="hero"] .dock { padding-inline: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.app[data-screen="hero"] .tab, .app[data-screen="hero"] .dockOn, .app:not([data-screen="hero"]) #btnStart { display: none; }
/* 看分享链接（/s/<编号>）：底下只有一颗 Pick your set，和首屏的按钮一个样子；快照还没取到时什么都不显示 */
.app:not(.viewing) #btnPick, .app.viewing .tab, .app.viewing .dockOn, .app.viewing #btnStart, .app.viewing .hero { display: none; }
.app.viewing .dock { padding-inline: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.app.viewing[data-screen="hero"] .dock { visibility: hidden; }
@media (max-width: 899px) { .app[data-screen="add"] .stageArea { visibility: hidden; } }
.app[data-screen="add"] .dock, .app[data-screen="arrange"] .dock { transform: translateY(calc(140% + var(--sab))); }

/* ---------- 面板：手机上从底部升起，电脑上在右侧 ---------- */

.panel {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: var(--gap);
  padding: 6px 20px calc(102px + var(--sab)); background: var(--card); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px rgba(20, 20, 20, 0.12);
  transform: translateY(104%); visibility: hidden; transition: transform 0.42s var(--ease), visibility 0.42s;
}
.panel.open { transform: none; visibility: visible; }
.panel.add { top: calc(72px + var(--sat)); padding-top: 20px; padding-bottom: 0; gap: 12px; }
.panel.list { height: calc(100% - 240px - var(--sat)); min-height: 380px; gap: 0; }
/* 同一组的设置行、按钮下的说明，都贴近上一块 */
.panel > .row + .row, .panel > .main + .hint, .panel > .btn + .hint { margin-top: calc(12px - var(--gap)); }
.panel > .main + .btn { margin-top: calc(8px - var(--gap)); }
/* 抓手：点一下或往下拖收起面板（app.js 的 dragToClose）。按得到的是面板顶上横贯整宽、44px 高的一条，
   上边和左右顶到面板边缘；那道短横线还在原来的位置（离顶 16px）。下边的负外边距把后面的内容拉回原处，
   后面的内容叠在它上面、先接住点按。拖动时不让浏览器滚动或回弹 */
.grabber {
  align-self: stretch; flex: 0 0 auto; height: 44px; margin: -6px -20px -14px; padding: 0 0 8px; border: 0; border-radius: 28px 28px 0 0;
  background: transparent; touch-action: none;
}
.panel:not(.list) > .grabber { margin-bottom: -26px; }
.grabber:focus-visible { outline-offset: -4px; }
.grabber::before { content: ""; display: block; width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: #d9d7d1; }
/* 往上拖时面板会抬起一点，下面接一截同色的底，不露出桌面 */
@media (max-width: 899px) {
  .panel:has(> .grabber)::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; background: inherit; pointer-events: none; }
}
/* 标题那行的空白让给抓手，只有标题文字和清空按钮自己接点按 */
.panelHead { pointer-events: none; }
.panelHead > * { pointer-events: auto; }
.panelHead { display: flex; align-items: center; gap: 4px; min-height: 56px; }
.panelHead h2 { flex: 1; min-width: 0; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(114px + var(--sab)); margin: 0 calc(-1 * var(--pad)); padding-left: var(--pad); padding-right: var(--pad); }

/* 榜单：添加按钮跟在最后一行下面，列表长了就停在底部，列表在它上面滚动 */
.panel.list .scroll { flex: 0 1 auto; padding-bottom: 8px; border-radius: 0; }
#btnClear { margin-right: -14px; }   /* 文字和右边缘对齐 */
#btnAdd { flex: 0 0 auto; justify-content: center; min-height: 50px; border-radius: 25px; }

.searchRow { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin-left: -12px; }
.searchBox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 25px; background: var(--soft); color: var(--muted); }
.searchBox:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.searchBox input { flex: 1; min-width: 0; height: 44px; border: 0; padding: 0; background: transparent; font: inherit; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
.searchBox input::placeholder { color: #75726c; }
/* 类型多了放不下时，这一行可以左右滑。上下的内边距留给按钮超出自己的点击范围和焦点框 */
.chips { flex: 0 0 auto; display: flex; gap: 8px; margin: -4px calc(-1 * var(--pad)); padding: 4px var(--pad); overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { position: relative; flex: 0 0 auto; min-height: 44px; padding: 0 20px; border: 0; border-radius: 22px; background: var(--soft); font-size: var(--fsUi); font-weight: 500; }
.chips button::after { content: ""; position: absolute; inset: -4px 0; }
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; }
/* 底部胶囊：左边是已选的一小叠封面，右边是完成 */
.picked { display: flex; gap: 8px; }
.pickedBtn { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 12px 0 8px; border: 0; border-radius: 25px; background: transparent; }
.picked .main { flex: 1; width: auto; min-width: 0; }
/* 封面比胶囊高，往上探出去一截 */
.stack { position: relative; display: block; width: 112px; height: 50px; }
.stack::before { content: ""; position: absolute; left: 34px; top: 3px; width: 44px; height: 44px; border-radius: 4px; border: 1.5px dashed #b9b6af; }
.stack:not(:empty)::before { display: none; }
.card { position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; border-radius: 4px; object-fit: cover; background: var(--soft); box-shadow: 0 3px 10px rgba(20, 20, 20, 0.32); transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)); }
.card.game { width: 50px; height: 70px; }
.card.landing { animation: land 0.38s var(--ease); }
@keyframes land { 0% { transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(calc(var(--r) + 7deg)) scale(1.16); } 55% { transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(calc(var(--r) - 4deg)) scale(0.97); } }
.card.flying { position: fixed; z-index: 20; margin: 0; transform: none; pointer-events: none; box-shadow: 0 12px 28px rgba(20, 20, 20, 0.28); }
.pickedCount { font-size: var(--fsUi); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.panel.add .capsule { position: absolute; left: 16px; right: 16px; bottom: calc(24px + var(--sab)); }

/* 手机上打字时（app.js 加的类）：.compact 把面板顶到最上面，收紧间距；.kbd 是键盘正开着，
   --kb 是它挡住的高度。收起键盘后 .compact 还留着，列表不会在手指下跳动 */
.panel.add { transition: transform 0.42s var(--ease), visibility 0.42s, top 0.3s var(--ease); }
.panel.add .capsule { transition: opacity 0.2s ease, visibility 0.2s; }
@media (max-width: 899px) {
  .app.compact .topbar { opacity: 0; visibility: hidden; }
  .app.compact .panel.add { top: calc(8px + var(--sat)); padding-top: 12px; gap: 8px; }
  .app.compact .chips button { min-height: 36px; padding: 0 16px; }
  .app.kbd .panel.add .capsule { opacity: 0; visibility: hidden; }
  .app.kbd .panel.add .scroll { padding-bottom: calc(var(--kb) + 72px); }
  /* 写标题或颜色值时键盘开着（.kbdRow）：样式面板只留输入框那一行（拾色器是色相和 HEX 那行），贴在键盘上面；
     网站名、dock 和提示让开，画面占剩下的地方 */
  .app.kbdRow .topbar, .app.kbdRow .dock { opacity: 0; visibility: hidden; }
  .app.kbdRow .replayHint { display: none; }
  .app.kbdRow .stageArea { top: calc(12px + var(--sat)); }
  .app.kbdRow .panel.style { bottom: var(--kb); padding: 12px 20px; border-radius: 20px 20px 0 0; }
  .app.kbdRow .panel.style > .grabber, .app.kbdRow .paneTabs, .app.kbdRow .pickHead, .app.kbdRow .pane:not(.on),
  .app.kbdRow #paneTitle > :not(.titleRow), .app.kbdRow .picker .sv { display: none; }
}

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.thumbBox { flex: 0 0 auto; width: 48px; height: 52px; display: grid; place-items: center; pointer-events: none; }
.thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--soft); }
.game .thumb { width: 37px; height: 52px; border-radius: 4px; }
/* 游戏盒：缩略图的大小按实物比例，上、右、下露出外壳的颜色（颜色和 render/cases.js 里的 BOXES 对应） */
.box-ps { --box: #2c66ea; }
.box-xbox { --box: #2b8c2a; }
.box-nintendo { --box: #da3a3b; }
.box-pc { --box: #dfe3e8; }
[class*="box-"] .thumb { border: solid var(--box); border-width: 3px 2px 3px 0; border-radius: 3px; }
.box-ps .thumb, .box-xbox .thumb { width: 39px; height: 49px; }
.box-nintendo .thumb { width: 31px; height: 49px; }
.blank { display: grid; place-items: center; color: var(--muted); font-size: var(--fsTiny); }
.meta { flex: 1 1 auto; min-width: 0; line-height: 1.35; text-align: left; }
.meta b, .meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta b { font-weight: 500; text-wrap: balance; }
.meta span { color: var(--muted); font-size: var(--fsNote); }
.results li { min-height: 0; }
.results button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 0; border: 0; background: transparent; }
.results button:disabled { opacity: 0.45; }
/* 结果下面的“显示更多”：居中，上下和“手动添加”一样隔 12px */
#moreResults { margin: 12px auto 0; }
.mark { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); }
[aria-pressed="true"] > .mark { background: var(--ink); color: #fff; }

/* 榜单行：标题允许折成两行，上下各留 8px */
.ranked li { gap: 12px; position: relative; margin: 0 calc(-1 * var(--pad)); min-height: 64px; background: var(--card); }
.ranked .meta { padding: 8px 0; }
.ranked .meta b { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.3; }
/* 两侧是拖动区：左边整块名次、右边整块手柄，都顶到面板边缘，占满行高 */
.ranked .grip, .ranked .rank { align-self: stretch; cursor: grab; touch-action: none; }
.ranked .grip { width: calc(34px + var(--pad)); margin-left: -8px; padding-right: calc(var(--pad) - 6px); border-radius: 0; color: var(--muted); }
.ranked .remove { width: 40px; }
/* 游戏行：点封面和名称展开换盒子 */
.pick { flex: 1 1 0; min-width: 0; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; border-radius: 10px; background: transparent; }
.ranked li.open { flex-wrap: wrap; row-gap: 0; }
/* 抽屉的高度从 0 长到内容那么高：外层的行高从 0fr 变到 1fr，里面那层裁掉多出来的 */
.drawer { flex: 0 0 100%; display: grid; grid-template-rows: 0fr; opacity: 0; scroll-margin: 64px 0 8px; transition: grid-template-rows 0.24s var(--ease), opacity 0.18s linear; }
.drawer.shown { grid-template-rows: 1fr; opacity: 1; }
.drawer > div { min-height: 0; overflow: hidden; }
.boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px var(--pad) 14px; }
.boxOption { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 10px 2px 8px; border: 0; border-radius: 14px; background: transparent; font-size: var(--fsTiny); color: var(--muted); }
.boxOption[aria-pressed="true"] { background: var(--soft); color: var(--ink); font-weight: 500; }
.boxAll { grid-column: 1 / -1; justify-self: center; margin-top: 4px; }
/* 名次和导出画面里的写法一致：两位数、等宽数字、常规体，第 1 名加粗 */
.rank { flex: 0 0 auto; width: calc(40px + var(--pad)); margin-right: -4px; padding-left: var(--pad); display: flex; align-items: center; font-size: var(--fsTitle); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--muted); }
.ranked li:first-child .rank { color: var(--ink); font-weight: 700; }
.ranked.sorting, .ranked.sorting li, .ranked.sorting .grip, .ranked.sorting .rank { cursor: grabbing; }
.ranked li.dragging { z-index: 1; border-radius: 10px; box-shadow: 0 6px 20px rgba(20, 20, 20, 0.16); }

.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ways button { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: transparent; text-align: left; font-size: var(--fsUi); }
.ways img { display: block; width: 100%; height: 124px; object-fit: cover; border-radius: 16px; box-shadow: 0 0 0 1px rgba(20, 20, 20, 0.12); }
/* 首屏时不下载缩略图，带宽让给首屏的图和视频 */
.app[data-screen="hero"] .ways img { display: none; }
.ways button[aria-pressed="true"] { font-weight: 500; }
.ways button[aria-pressed="true"] img { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }

/* 样式面板：顶上一行分段，下面三段叠在同一格里，没选中的看不见但还占着地方，面板高度取最高的那段，切换时不跳。
   上面要留出画面边改边看，面板不比原来只有动画时高（375×812 下约 430px），所以组间距收到 16px、缩略图矮一些 */
.panel.style { --gap: 16px; }
.panel.style > .grabber { margin-bottom: -22px; }   /* 抓手的高度见上面 .grabber */
.paneTabs { display: flex; flex: 0 0 auto; }
.paneTabs button { flex: 1; }
.panes { display: grid; }
.pane { grid-area: 1 / 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.pane:not(.on) { visibility: hidden; }
.pane > .row + .row { margin-top: calc(4px - var(--gap)); }
.panel.style .ways img { height: 84px; }
/* 标题：最上面是“显示标题”开关和“恢复默认”，下面输入框、字号（旁边是粗体开关）、颜色。输入框 16px，iOS 不会自动放大页面。
   面板不比原来高：开关一行和输入框贴近一些，字重并进字号那行 */
.titleHead + .titleRow { margin-top: calc(8px - var(--gap)); }
.titleHead .textBtn { margin-right: -14px; }   /* 文字和右边缘对齐 */
.titleRow { display: flex; align-items: center; gap: 4px; }
.titleRow input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 0; border-radius: 24px; background: var(--soft); color: var(--ink);
  font: inherit; font-size: var(--fsBody); outline: none; -webkit-appearance: none; appearance: none;
}
.titleRow input::placeholder { color: #75726c; }
.titleRow input:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.sizeBold { display: flex; gap: 8px; }
/* 关掉标题后，下面的设置变灰（同时 inert，点不了），值都留着 */
.tOpt { transition: opacity 0.2s ease; }
.tOpt.off { opacity: 0.4; }
/* 开关：文字和滑块一起是一个按钮，整行好点。开着是黑底，和选中的色块、dock 一致 */
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; border: 0; background: transparent; text-align: left; }
.switch i { position: relative; flex: 0 0 auto; width: 44px; height: 26px; border-radius: 13px; background: #d3d0c9; transition: background 0.38s cubic-bezier(0.4, 0, 0.1, 1); }
.switch i::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(20, 20, 20, 0.22), 0 0 0 0.5px rgba(20, 20, 20, 0.08); transition: transform 0.38s cubic-bezier(0.4, 0, 0.1, 1);   /* 和 dock、.seg 一样 */
}
.switch[aria-checked="true"] i { background: var(--ink); }
.switch[aria-checked="true"] i::after { transform: translateX(18px); }
.textBtn:disabled { opacity: 0.5; }
.resetBtn { align-self: flex-start; margin-left: -14px; }   /* 文字和上面的色块左边对齐 */
.pane .row { min-height: 46px; }
.row .swatches { flex: none; }

/* 色块：背景和标题颜色共用。最后一个彩环打开拾色器。选中的和出场方式的缩略图一样套一圈黑边 */
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }   /* 屏幕很窄放不下时折到下一行 */
/* 宽高写死：只靠 flex-basis 和 aspect-ratio 定大小时，Safari 算这一排的宽度会当成 0，色块溢出到屏幕右边 */
.swatches > * { position: relative; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; }
.swatches button { background: var(--c); box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.14); }
/* 点按的范围比色块大一些，手指好点 */
.swatches > *::after { content: ""; position: absolute; inset: -9px -5px; }
.swatches button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.14), 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.swatches .custom { cursor: pointer; background: conic-gradient(#e5484d, #f5a524, #f2d33b, #46a758, #3e9bd6, #6e56cf, #d6409f, #e5484d); }
/* 选了自己的颜色时，彩环中间显示它 */
.swatches .custom::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--pick, var(--card)); box-shadow: 0 0 0 1px rgba(20, 20, 20, 0.12); }
/* 标题颜色的“自动”：半黑半白，表示跟着背景换深色字或白字 */
.swatches .auto { background: linear-gradient(135deg, var(--ink) 50%, #fff 50%); }

/* 拾色器（js/picker.js）：打开时顶上的分段换成 .pickHead，和分段一样高；拾色器和三段叠在同一格里，面板高度不变。
   上面是饱和度 / 明度方块，占满剩下的高度；下面一行是色相滑杆和 HEX 输入框。
   把手 20px：3px 白边、里面是当前的颜色，一圈细描边加一点投影，浅色、白色上也看得清。方块和滑杆整块都能按，可点区域够大 */
.pickHead { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding-left: 2px; }
.pickHead span { font-size: var(--fsUi); font-weight: 500; }
.pickHead .textBtn { margin-right: -14px; color: var(--ink); }
.picker { gap: 12px; }
.picker .sv, .picker .hue { position: relative; touch-action: none; -webkit-user-select: none; user-select: none; outline: none; }
.picker .sv {
  flex: 1 1 auto; min-height: 120px; border-radius: 14px;
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, var(--hue));
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.08);
}
.pickRow { flex: 0 0 auto; display: flex; align-items: center; gap: 16px; }
.picker .hue { flex: 1; min-width: 0; height: 44px; }
.picker .hue::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 12px; margin-top: -6px; border-radius: 6px;
  background: linear-gradient(90deg, #f00, #ff0 16.67%, #0f0 33.33%, #0ff 50%, #00f 66.67%, #f0f 83.33%, #f00);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.08);
}
.picker .knob {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 3px solid #fff; border-radius: 50%; background: var(--color); pointer-events: none;
  box-shadow: 0 0 0 0.5px rgba(20, 20, 20, 0.22), 0 1px 4px rgba(20, 20, 20, 0.3), inset 0 0 0 0.5px rgba(20, 20, 20, 0.16);
  transition: transform 0.12s var(--ease);
}
.picker .hue .knob { top: 50%; left: calc(10px + var(--p, 0) * (100% - 20px)); background: var(--hue); }
.picker .dragging .knob { transform: scale(1.15); }
.picker .sv:focus-visible .knob, .picker .hue:focus-visible .knob { box-shadow: 0 1px 4px rgba(20, 20, 20, 0.3), 0 0 0 2px var(--card), 0 0 0 4px var(--focus); }
/* HEX：和输入框一样的浅底胶囊，左边一个当前颜色的小圆，# 是灰的 */
.hexBox { flex: 0 0 auto; display: flex; align-items: center; width: 132px; height: 44px; padding: 0 14px 0 11px; border-radius: 22px; background: var(--soft); cursor: text; }
.hexBox:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.hexDot { flex: 0 0 auto; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--color); box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.14); }
.hexHash { color: var(--muted); }
.hexBox input {
  flex: 1; min-width: 0; width: 100%; height: 40px; margin-left: 1px; padding: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: var(--fsBody); font-variant-numeric: tabular-nums; text-transform: uppercase; outline: none; -webkit-appearance: none; appearance: none;
}

/* 深色桌面：画面四周的网站名、按钮、提示和裁切标记换成浅色 */
.app.darkDesk:not([data-screen="hero"]) .topbar { color: #fff; }
.app.darkDesk .replayHint { color: rgba(255, 255, 255, 0.7); }
.app.darkDesk .crop { border-color: rgba(255, 255, 255, 0.5); }
.app.darkDesk .loading { filter: invert(1); }
/* 手动摆放时画面下面的提示和时间轴也直接放在桌面上 */
.app.darkDesk .arrangeBar > .hint, .app.darkDesk .timeRow { --ink: #fff; --muted: rgba(255, 255, 255, 0.7); color: #fff; }
.app.darkDesk .seek::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--ink) var(--p), rgba(255, 255, 255, 0.24) 0); }
.app.darkDesk .seek::-moz-range-track { background: rgba(255, 255, 255, 0.24); }

/* 手动摆放：直接放在桌面上，胶囊和 dock 在同一个位置 */
.arrangeBar {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; max-width: 380px; margin: 0 auto; padding: 0 16px calc(24px + var(--sab)); display: flex; flex-direction: column; gap: 6px;
  transform: translateY(40px); opacity: 0; visibility: hidden; transition: transform 0.42s var(--ease), opacity 0.2s, visibility 0.2s;
}
.arrangeBar.open { transform: none; opacity: 1; visibility: visible; }
.arrangeBar > .hint { text-align: center; }
.timeRow { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
#tlPlay svg { width: 22px; height: 22px; fill: currentColor; }
#tlPlay:not(.playing) .pauseIcon, #tlPlay.playing .playIcon { display: none; }
.seek { --p: 100%; appearance: none; -webkit-appearance: none; flex: 1; min-width: 0; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: none; }
.seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--p), rgba(20, 20, 20, 0.16) 0); }
.seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(20, 20, 20, 0.16); }
.seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 10px; background: var(--ink); }
.seek::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 10px; background: var(--ink); }
.tlTime { flex: 0 0 auto; min-width: 76px; text-align: right; color: var(--muted); font-size: var(--fsNote); font-variant-numeric: tabular-nums; white-space: nowrap; }
.arrangeEnd { display: flex; gap: 4px; }
.arrangeEnd .textBtn { color: var(--ink); padding: 0 20px; }
.arrangeEnd .textBtn:disabled { color: var(--muted); opacity: 0.5; }
.arrangeEnd .main { flex: 1; width: auto; min-width: 0; }

.fmts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fmts button { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 104px; padding: 12px; border: 0; border-radius: 18px; background: var(--soft); text-align: left; }
.fmts button[aria-pressed="true"] { background: var(--card); box-shadow: inset 0 0 0 2px var(--ink); }
.fmts button:disabled { opacity: 0.4; }
.fmts b { font-size: var(--fsUi); font-weight: 500; white-space: nowrap; }
.fmts small { color: var(--muted); font-size: var(--fsTiny); line-height: 1.4; }

details { margin-top: 12px; }
summary { display: flex; align-items: center; gap: 6px; width: fit-content; color: var(--muted); font-size: var(--fsNote); cursor: pointer; padding: 10px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
/* 结果下面那一行：“搜不到？认真搜索 ·”浮在左边，summary（手动添加）排在它右边，两者一样高（上下 10px 加一行字），
   展开的表单仍从整行下面开始。没有“认真搜索”时只剩 summary，和原来一样 */
.manualLine { display: flow-root; margin-top: 12px; }
.manualLine > details { margin-top: 0; }
.harder { float: left; display: flex; align-items: center; margin: 0; color: var(--muted); font-size: var(--fsNote); white-space: nowrap; }
.harder button { padding: 10px 0; border: 0; background: transparent; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.harder button[aria-disabled="true"] { cursor: default; opacity: 0.5; }
.harderDot { margin: 0 6px; }
:lang(en) .harderLead, :lang(ko) .harderLead { margin-right: 0.3em; }   /* 英文、韩文词之间有空格 */
/* 展开、收起的箭头 */
.down { color: var(--muted); transition: transform 0.24s var(--ease); }
[aria-expanded="true"] > .down, [open] > summary > .down { transform: rotate(180deg); }
/* 高度动画要浏览器支持 interpolate-size，不支持的直接展开 */
@supports (interpolate-size: allow-keywords) {
  details { interpolate-size: allow-keywords; }
  details::details-content { height: 0; overflow: clip; overflow-clip-margin: 4px; transition: height 0.24s var(--ease), content-visibility 0.24s allow-discrete; }
  details[open]::details-content { height: auto; }
}
.manual { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 4px; }
.manual .btn { margin-top: 12px; }
.manual label, .manual .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: var(--fsNote); color: var(--muted); }
/* 选封面：浏览器自带的文件按钮藏起来，点这颗胶囊就是点它 */
.manual .filePick { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.filePick .pill { color: var(--ink); }
.filePick input:focus-visible + .pill { outline: 2px solid var(--focus); outline-offset: 2px; }
.filePicked { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.filePicked img { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--soft); }
.filePicked span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manual input[type="text"] { font: inherit; font-size: var(--fsBody); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.edDev { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.edDev textarea { width: 100%; font: var(--fsTiny)/1.4 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--bg); color: var(--ink); resize: vertical; }

.sheet { border: 0; border-radius: 32px; padding: 0 24px 24px; width: min(calc(100vw - 24px), 440px); max-height: 88vh; overflow: auto; color: var(--ink); background: var(--card); }
.sheet::backdrop { background: rgba(20, 20, 20, 0.28); }
/* 标题和右上角的 × 一直看得到，内容从下面滚过去 */
.sheetHead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -12px 8px 0; padding: 16px 0 8px; background: var(--card); }
.sheet img, .sheet video { display: block; width: 100%; border-radius: 10px; margin: 0 0 16px; }
.sheet ol { margin: 0 0 12px; padding-left: 22px; }
.sheet p { margin: 0 0 12px; }
.sheet p.note { color: var(--muted); font-size: var(--fsNote); }
.sheet p.note a { color: inherit; }
.sheet .row { margin-top: var(--gap); }
.sheet .btn { margin-top: 8px; }
.sheet p + .btn, .sheet ol + .btn { margin-top: var(--gap); }
/* 分享链接的地址框；导出弹窗最下面各平台的一排按钮 */
.linkBox { display: block; width: 100%; min-height: 50px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--soft); color: var(--ink); font: inherit; font-size: var(--fsBody); text-overflow: ellipsis; }
.sheet p.appsNote { margin: var(--gap) 0 0; }
.apps { display: flex; gap: 8px; }
.apps .btn { flex: 1; min-width: 0; padding: 0 8px; }

/* 生成视频或实况照片时盖在预览上的转圈 */
.busy { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  font-size: var(--fsUi); font-weight: 500; font-variant-numeric: tabular-nums; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(20, 20, 20, 0.16); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 电脑 ---------- */

@media (min-width: 900px) {
  .app { --side: 0px; --pad: 28px; }
  .app[data-screen="add"], .app[data-screen="list"], .app[data-screen="style"], .app[data-screen="share"] { --side: 448px; }
  .topbar { padding-left: 32px; padding-right: 24px; }
  .wordmark { font-size: 26px; }
  .stageArea { bottom: calc(102px + 24px); }
  .app[data-screen="arrange"] .stageArea { bottom: calc(var(--panelH) + 24px); }
  .panel { left: auto; right: 24px; bottom: 24px; width: 400px; border-radius: 32px; padding: 24px 28px; box-shadow: var(--shadow); transform: translateX(calc(100% + 60px)); }
  .panel.add, .panel.list { top: 24px; height: auto; }
  .panel.add { padding-bottom: 0; }
  .chips { flex-wrap: wrap; }   /* 鼠标不好左右滑，放不下就换行 */
  .grabber { display: none; }
  .scroll { padding-bottom: 28px; border-radius: 0 0 32px 32px; }
  .panel.add .scroll { padding-bottom: 110px; }
  .panel.add .capsule { left: 20px; right: 20px; bottom: 20px; }
  .ways img, .panel.style .ways img { height: 150px; }
}

/* 矮屏（手机浏览器的工具栏占掉一截时）：面板收紧，画面才不至于太小 */
@media (max-width: 899px) and (max-height: 720px) {
  .app { --gap: 16px; }
  .ways img { height: 84px; }
  .fmts button { height: 84px; padding: 12px; }
  .panel.list { height: calc(100% - 210px - var(--sat)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 2s !important; }
  #btnStart::before, #btnPick::before { animation: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .ranked.sorting li:not(.dragging) { transition: transform 0.16s ease; }
  .ranked li.settling { transition: transform 0.16s ease; }
}
