/* ==================================================================
   样例站点 · Viscose 环形轮播（配套 testing-example/viscose.js）

   参考 https://github.com/Yousuf-developer/Viscose-carousel —— 卡片沿一只
   大半在屏外的圆环排布，相邻卡片在着色器里用 SDF 的 smooth-minimum 混在一起，
   靠近时融成一坨、分开时拉出细丝。这里把图片换成站点卡片。

   本文件只管「壳」：舞台尺寸、叠加的文字、右侧索引列、提示。
   圆环本体是 canvas，配色从皮肤变量读（--bg / --card-bg / --accent / --ink），
   所以 52 套皮肤换装时轮播跟着换。
================================================================== */

.ring-sec { margin-top: clamp(18px, 3.5vh, 40px); }
.ring-sec[hidden] { display: none; }

/* 这页没有可见的标题区，但 h1 得留 —— 视觉上裁掉、读屏仍能读到。
   用 1px 裁切而不是 display:none / visibility:hidden：后两者是真的读不到。 */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* 这页整页就这一个舞台 —— topbar + 轮播 + footer 三段。
   高度吃掉 topbar (~50) + footer (~170) 之间的全部空间：clamp(580, 100vh-200, 940)。
   之前是 clamp(420, 62vh, 660)，大屏上 stage 只占 556px，留了一大块空白；
   小屏上反而要溢出。换成 calc(100vh-200) 后，环直接顶满。 */
.ring-stage {
  position: relative; isolation: isolate;
  height: 100%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  /* 鼠标滚轮整页翻卡片 —— 不让浏览器滚 */
  overscroll-behavior: contain;
  /* 竖向留给页面翻页，横向拖动归轮播 —— 手机上不会把人困在这里 */
  touch-action: pan-y;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
.ring-stage.is-drag { cursor: grabbing; }
.ring-stage[hidden] { display: none; }

.ring-canvas { display: block; width: 100%; height: 100%; }

/* ── 兜底：拿不到 WebGL / 用户要求减少动效时，退回这一列朴素链接 ──
   刻意不做成卡片堆 —— 轮播已经是主视觉，兜底只要把站点列全、能点开就行。 */
.ring-list {
  margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line);
}
.ring-list[hidden] { display: none; }
.ring-list li { border-bottom: 1px solid var(--line); }
.ring-list .rl-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 13px 6px; color: var(--ink); text-decoration: none;
  transition: background .2s var(--ease);
}
a.rl-row:hover, a.rl-row:focus-visible { background: var(--glass-bg); }
.rl-num {
  flex: none; width: 2.6em;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--ink-3);
}
.rl-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rl-main b { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.3; }
.rl-desc {
  font-family: var(--serif); font-size: 13px; line-height: 1.5;
  color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rl-sub {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  color: var(--ink-3); text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rl-empty {
  padding: 22px 6px; color: var(--ink-3);
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
}

/* ── 正面那张卡的信息：环的下方正中空着，放这里不挡卡片 ──
   .ring-front 不再写死 bottom —— 由 viscose.js 的 placeFront() 把顶边贴在
   「正面卡下沿 + frontGap」处，bottom 设为 auto。这样 1 行简介不会在盒子里
   留出 ~26px 的死区（之前锁两行 min-height 的副作用），副字紧跟描述下方。 */
.ring-front {
  position: absolute; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 0 74px; text-align: center; pointer-events: none;
}
.ring-name {
  pointer-events: auto;
  font-family: var(--serif); font-size: clamp(19px, 2.3vw, 29px); line-height: 1.25;
  color: var(--ink); text-decoration: none;
  display: inline-block; padding: 2px 4px;
  transition: color .3s var(--ease), opacity .3s var(--ease);
}
.ring-name:hover, .ring-name:focus-visible { color: var(--accent); }
/* 卡面那行小字在环上被投影缩到 ~9px，读不清；这里给一份等价的正文副本。
   限两行只是兜底（防止极长的简介在轮播里把整个 overlay 撑爆）——
   **不能**用 min-height 锁高度。叠加块是顶锚的（见 viscose.js 的 placeFront），
   高度由简介实际行数决定；环心按「最坏情况」反推，转盘才不会转着转着上下跳。 */
.ring-desc {
  max-width: 46ch;
  font-family: var(--serif); font-size: clamp(13px, 1.15vw, 15px); line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; overflow: hidden;
}
.ring-desc[hidden] { display: none; }
.ring-sub {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ── 右侧索引列：对应原作右上角那个 01–18 的项目表，可点着跳 ── */
.ring-col {
  position: absolute; right: clamp(10px, 2vw, 20px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1px;
  margin: 0; padding: 0; list-style: none;
}
.ring-col button {
  display: block; width: 100%; padding: 3px 6px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  color: var(--ink-3); opacity: .55;
  transition: color .3s var(--ease), opacity .3s var(--ease);
}
.ring-col button:hover, .ring-col button:focus-visible { opacity: 1; color: var(--ink); }
.ring-col button[aria-current="true"] { opacity: 1; color: var(--accent); }

/* ── 窄屏 ──────────────────────────────────────────────────────────
   窄屏上台面小、字号却不跟着缩，叠加文字相对更占地方。这里只收「文字自己」的
   字号与间距；**环心让位由 viscose.js 按实测文字块高度反推**，不写死 cy ——
   舞台高 = clamp(420px, 62vh, 660px) 随视口变，写死 cy 在某个高度上必然翻车
   （实测 1440×900 桌面端净空只剩 4.5px，比手机还惨）。 */
@media (max-width: 700px) {
  /* 窄屏 footer 也得给空间：减到 180 留给版权区。最小 500，够两张卡侧身。
     真到 380px (iPhone SE) 上限收到 720，再大就溢到 footer 上面了。 */
  .ring-stage { height: 100%; }
  .ring-col { display: none; }          /* 窄屏放不下，改靠拖动 */
  .ring-front {
    padding: 0 18px;
    gap: 7px;
  }
  .ring-name { font-size: 18px; }
  .ring-desc { font-size: 12.5px; max-width: none; }
  .ring-sub  { font-size: 10px; }
}


/* ================= 首页分类 tabs =================
   首页不再跳子页：三类作品平铺在 hero 下面，点一下转盘换一组。
   排布沿用 .toc（flex + 圆角 + mono 计数），这里只补 button 的状态。 */
.cat-tabs { justify-content: center; margin-top: 40px; gap: 12px; padding-top: 18px; border-top: 1px solid var(--glass-border); }
.cat-tabs button {
  display: inline-flex; gap: 10px; align-items: baseline;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2); border-radius: 100px; padding: 12px 22px;
  background: none; border: 1px double var(--glass-border); cursor: pointer;
  transition: color .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease);
}
.cat-tabs button:hover,
.cat-tabs button:focus-visible { transform: translateY(-1px); }
.cat-tabs button.is-on { color: var(--accent); border-color: var(--accent); border-style: solid; }
.cat-tabs em { font-style: normal; color: var(--ink-3); }
.cat-tabs button.is-on em { color: inherit; opacity: .75; }


/* ============================================================
   一屏：整个首页锁进 100dvh，滚轮只用来翻转盘上的卡片
   之前文档高 1503 / 视口 900（超出 603）：lede 56 + 风格条 102 + footer 156
   三块就吃掉了小半屏。现在 lede 去掉、风格收进顶栏浮层、footer 压成一行，
   剩下的高度全部给转盘 —— 用户进站就能看见全貌，滚动只发生在卡片上。
   ============================================================ */
html, body { height: 100%; }
body { overflow: hidden; }

.wrap {
  height: 100vh;
  height: 100dvh;              /* 移动端地址栏收起/展开时不跳 */
  display: flex; flex-direction: column;
}
.hero {
  flex: none; min-height: 0;
  /* 没有大 logo，hero 只挂分类 tabs。上 padding 留呼吸、下 padding 紧凑——
     让 .ring-sec 拿到更多高度，转盘卡片能学样例站点那样粘连。 */
  padding-block: clamp(14px, 2.2vh, 22px) clamp(6px, 1vh, 12px);
}
.ring-sec {
  flex: 1 1 auto; min-height: 280px;
  margin-top: 0; overflow-y: auto;   /* 无 WebGL 退回列表时，滚动发生在这一层 */
}
footer { flex: none; margin-top: 0; padding: 10px 0 12px; }
.foot-meta { line-height: 1.7; }

/* 矮屏（横屏手机 / 小窗）放不下就别硬锁，交还给页面滚动 */
@media (max-height: 520px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .wrap { height: auto; }
  .ring-sec { min-height: 420px; overflow: visible; }
}

/* 浮层要贴着右上角的按钮展开，锚点就设在按钮所在的这一格上 */
.topbar-right { position: relative; }

/* ============================================================
   风格面板：收进顶栏，点「风格」展开
   #skinBar 还在（只是搬进浮层），i18n.js 照旧走「平铺」分支注入分组+芯片，
   不用改任何脚本。按钮上那颗小圆点取 --accent，跟着当前风格实时变色。
   ============================================================ */
.skin-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  color: var(--ink-2); background: none;
  border: 1px double var(--glass-border);
  transition: color .4s var(--ease), border-color .4s var(--ease);
}
.skin-toggle:hover { color: var(--ink); }
.skin-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); border-style: solid; }
.skin-toggle-dot {
  flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--spot-c, transparent);
}

.skin-panel {
  position: absolute; z-index: 60; top: calc(100% + 10px); right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 16px 16px 14px; border-radius: 18px;
  background: var(--card-bg, var(--bg));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  /* 页面锁了一屏（body overflow:hidden），浮层自己超了就滚自己 ——
     否则「游戏界面」14 个芯片会顶出视口，既看不见也滚不到。 */
  max-height: calc(100dvh - 84px);
  overflow-y: auto; overscroll-behavior: contain;
}
.skin-panel[hidden] { display: none; }
.skin-panel .skin-bar { margin-bottom: 10px; }
.skin-panel .skin-random { align-self: stretch; justify-content: center; margin: 0; }

@keyframes skinDrop {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .skin-panel:not([hidden]) { animation: skinDrop .18s var(--ease); }
}
