/* ==========================================================================
   万里行手记馆 · 3D 全地形保障车轮罗盘样式表 (Tire Dial Stylesheet)
   供 Claude 接入站点使用，可直接引入或合并入 assets/site.css
   ========================================================================== */

/* 1. 3D WebGL 渲染画布 (固定于全屏最上层浮层，不参与底层文档流排版) */
#webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 55;
  pointer-events: none;
  touch-action: none;
  background: transparent;
}
#webgl-canvas.interactive {
  pointer-events: auto;
  cursor: grab;
}
#webgl-canvas.interactive:active {
  cursor: grabbing;
}

/* 2. 顶部古铜金定位指针 (展开对齐指示) */
.top-needle {
  position: fixed;
  width: 0;
  height: 0;
  /* 🔴 站主 2026-09-04：指针要落在胎壁上、又不能挡住刻字。
     实测各圈的位置（以展开半径 R=120 为例，距轮胎顶端）：
        胎面花纹  0 ~ 8px
        胎壁刻字  8 ~ 29px   ← 「★ SXT 善行团 · 爱心万里行 …」在这一圈
        内盘金线  29px
        「第一季」36px 起
     原来 22×18 的三角放在 9px 处，正好压在刻字上。
     缩到 14×9 并落在金线上（29px）—— 金线是装饰不是字，压它不碍事。 */
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #c4a066;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 6px rgba(196, 160, 102, 0.5));
  z-index: 65;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 0) scale(0.7);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.top-needle.on {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* 3. 屏幕边缘微露把手感应区 (贴边 Peek 状态下点击快速呼出展开，支持左/右两侧贴边) */
.peek-hitbox {
  position: fixed;
  width: 52px;
  height: 100px;
  z-index: 68;
  cursor: pointer;
  background: transparent;
  display: none;
}
.peek-hitbox.on {
  display: block;
}

/* 4. 点击空白处收起暗幕/遮罩 (展开状态下点击外部任意区域自动缩小贴边) */
.dismiss-veil {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 52;
  display: none;
}
.dismiss-veil.on {
  display: block;
}

/* 5. 开场呼啸入场全屏暗幕 (开场前淡出压光) */
.intro-veil {
  position: fixed;
  inset: 0;
  /* 🔴 站主 2026-09-04：「从首页四季点进去后，场景是整个轮胎的场景，
     不应该出现目录页，哪怕模糊出现的都不行。」
     原来是 rgba(8,12,18,.72)，目录页在后面透出来 —— 改成页面底色、完全不透明。
     ⚠️ 底色必须与 body 一致（--bg #071320），否则开场结束那一下会闪一层灰。 */
  background: #071320;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease-out;
}
.intro-veil.on {
  opacity: 1;
}

/* 6. 阅读页篇目列表右侧滑出抽屉 */
.read-catalog-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 86vw);
  background: rgba(10, 14, 20, 0.96);
  border-left: 1px solid rgba(196, 160, 102, 0.25);
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(20px);
  z-index: 80;
  transform: translateX(105%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.read-catalog-drawer.on {
  transform: translateX(0);
}
.read-catalog-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.read-catalog-drawer .drawer-head h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: #ede5d8;
  margin: 0;
}
.read-catalog-drawer .drawer-head button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a09886;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}
.read-catalog-drawer .drawer-head button:hover {
  border-color: #c4a066;
  color: #fff;
}
.read-catalog-drawer .drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}
.read-catalog-drawer .drawer-item {
  display: block;
  padding: 12px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(220, 225, 235, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}
.read-catalog-drawer .drawer-item:hover,
.read-catalog-drawer .drawer-item.active {
  background: rgba(196, 160, 102, 0.12);
  color: #c4a066;
  border-bottom-color: transparent;
}
.read-catalog-drawer .drawer-item span {
  display: block;
  font-size: 11px;
  color: #7e8b9b;
  margin-top: 4px;
}

/* 🔴 无障碍层：WebGL 画布读屏读不到，这组真按钮补上。
   ⚠️ 不能用 display:none / visibility:hidden —— 那样读屏也读不到了。
   用「1px 裁切」这个无障碍界的标准写法：视觉上没有，语义上还在。 */
.dial-a11y button {
  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;
}
/* 键盘 Tab 过来时显形，让键盘用户看得见自己在哪 */
.dial-a11y button:focus-visible {
  position: fixed; right: 16px; bottom: 16px; z-index: 120;
  width: auto; height: auto; margin: 0; padding: 8px 14px;
  clip: auto; clip-path: none;
  background: #0f2032; color: #f2ede3;
  border: 2px solid #c8a86a; border-radius: 8px;
  font-size: 14px; letter-spacing: .05em;
}

/* ══════════ 开场的「跳过 / 不再显示」 ══════════
   站主 2026-09-08：「所有进入轮胎的画面都要加上提示"跳过和不再弹出"的功能选项」。
   ⚠️ z-index 要压过开场遮罩(50)、画布(55)、指针(65)、命中区(68)、无障碍导航(80)。
   ⚠️ 这一条只在 st==="intro" 时挂 .on，别的状态一律收起 —— 它不是常驻控件。 */
.intro-skip {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(6px);
  z-index: 90; display: flex; align-items: center; gap: 14px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(7, 19, 32, .58); border: 1px solid rgba(239, 131, 84, .22);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .35s ease .9s, transform .35s ease .9s;
}
.intro-skip.on { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.intro-skip button {
  appearance: none; cursor: pointer; background: none; border: 0; padding: 6px 2px;
  min-height: 32px; font-family: var(--mono, ui-monospace, monospace);
  font-size: .72rem; letter-spacing: .14em; color: rgba(236, 230, 218, .72);
  transition: color .2s;
}
.intro-skip button:hover, .intro-skip button:focus-visible { color: #efa06a; }
.intro-skip .sp { width: 1px; height: 14px; background: rgba(236, 230, 218, .22); }
@media (max-width: 640px) { .intro-skip { bottom: 26px; gap: 12px; padding: 7px 14px; } }
