/* ==========================================================================
   刘葫芦 · 工牌领取处
   单页范式：极淡纸底 + 超大中文标题 + 一个可拖拽的吊牌 + 极克制控件
   日/夜两套变量，一套主色（powder blue）
   ========================================================================== */

:root {
  --paper: #f4f6f9;
  --paper-2: #e9eef6;
  --ink: #29365b;
  --ink-2: #46536f;
  --muted: #747c94;
  --line: #ccd4e4;
  --brand: #4964a0;
  --brand-soft: #dbe6f7;
  --card: #e1ebfa;
  --deep: #323e62;
  --light: #778bb8;
  --white: #ffffff;
  --watermark: rgba(73, 100, 160, 0.34);
  --watermark-shine: rgba(255, 255, 255, 0.6);
  --shadow-card: 0 34px 70px -34px rgba(41, 54, 91, 0.45), 0 2px 6px rgba(41, 54, 91, 0.06);
  --shadow-pill: 0 8px 20px -12px rgba(41, 54, 91, 0.4);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #0d1320;
  --paper-2: #121a2b;
  --ink: #e8eefb;
  --ink-2: #c2cde3;
  --muted: #8b99b4;
  --line: #27334a;
  --brand: #8fb0e8;
  --brand-soft: #1b2740;
  --card: #1a2436;
  --deep: #f0f5ff;
  --light: #6d88b5;
  --white: #ffffff;
  --watermark: rgba(150, 185, 240, 0.30);
  --watermark-shine: rgba(255, 255, 255, 0.42);
  --shadow-card: 0 34px 80px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(143, 176, 232, 0.12);
  --shadow-pill: 0 8px 22px -12px rgba(0, 0, 0, 0.8);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body.page-index {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

.pass {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

/* -------------------------------------------------------------- 跳到正文 */
.skip-link {
  position: absolute;
  left: 16px;
  top: -70px;
  z-index: 99;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus-visible { top: 16px; }

/* ------------------------------------------------------------------ 水印 */
.pass-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  /* 字数从 4 个变成 10 个（LIUHULU.CN），字号要按同一「视觉宽度」反算：
     原来 4 字 × 26vw ≈ 72vw 宽，现在 10 字取 15.4vw 差不多同样宽 */
  font-size: clamp(78px, 15.4vw, 250px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--watermark);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* 一道从左往右掠过的光影（参考站 ShinyText 的效果）。
   用 ::after 叠一层同样的字，只给这层做 background-clip:text + 移动的
   高光带，底色那层保持纯 color，两层互不干扰 */
.pass-watermark::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  /* 两端必须用「白色 + alpha 0」而不是 transparent：transparent 是 rgba(0,0,0,0)，
     与白色插值时中途会经过灰，深色模式下会在笔画末端显出一块灰色方形伪影 */
  background-image: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 40%,
    var(--watermark-shine) 50%,
    rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0) 100%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  animation: wm-sweep 4.5s ease-in-out infinite;
  animation-delay: 1.2s;
}

@keyframes wm-sweep {
  0%, 22% { background-position: 130% 0; }
  78%, 100% { background-position: -30% 0; }
}

/* -------------------------------------------------------------- 3D 画布 */
/* 整屏铺满：拖拽不限制在中间那一块，屏幕任何位置都能抓。
   z-index 要高过正文，吊牌被拖到标题上时应该压在标题上面 */
.pass-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: grab;
  touch-action: none;
}

.pass-stage:active { cursor: grabbing; }
.pass-stage canvas { display: block; width: 100%; height: 100%; }

/* 3D 起不来时的静态兜底：至少让人看到一张工牌，而不是一片空白 */
.pass-stage canvas.pass-fallback {
  position: absolute;
  left: 50%;
  top: 20%;
  width: min(44vh, 72vw);
  height: auto;
  transform: translateX(-50%);
  border-radius: 14px;
  box-shadow: 0 40px 70px -36px rgba(24, 38, 70, .5);
  pointer-events: none;
}

/* ------------------------------------------------------------------ 顶栏 */
.pass-head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(20px, 3vw, 34px) clamp(20px, 3.4vw, 46px);
  pointer-events: none;
}

.pass-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;   /* 品牌隐藏后仍然靠右 */
  pointer-events: auto;
}

/* ---------------------------------------------------------------- 胶囊 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: blur(10px);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.pill:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-pill);
}

.pill:active { transform: translateY(0); }

.pill--solid {
  border-color: transparent;
  background: var(--ink);
  color: var(--paper);
}

.pill--solid:hover {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.pill--icon {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.pill svg { width: 15px; height: 15px; display: block; }

/* ---------------------------------------------------------------- 主文案 */
.pass-hero {
  position: absolute;
  left: clamp(20px, 3.4vw, 46px);
  top: 50%;
  transform: translateY(-54%);
  z-index: 3;
  width: min(28rem, 30vw);
  pointer-events: none;
}

.pass-kicker {
  margin: 0 0 clamp(14px, 2vh, 22px);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.pass-title {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.14;
  color: var(--ink);
  text-wrap: balance;
}

.pass-meta {
  margin: clamp(18px, 3vh, 30px) 0 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.pass-meta span { color: var(--brand); }

/* ---------------------------------------------------------------- 工具条 */
.pass-dock {
  position: absolute;
  /* 与吊牌同一条中线（画布铺满整屏，构图重心由 camera.position.x 控制） */
  left: 50%;
  bottom: clamp(52px, 7vh, 74px);
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* -------------------------------------------------------- 右侧竖排编号 */
.pass-spine {
  position: absolute;
  right: clamp(14px, 2vw, 26px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  opacity: 0.72;
  pointer-events: none;
}

.pass-spine b {
  font-weight: 500;
  color: var(--brand);
}

/* ------------------------------------------------------------------ 页脚 */
.pass-foot {
  position: absolute;
  left: clamp(20px, 3.4vw, 46px);
  right: clamp(20px, 3.4vw, 46px);
  bottom: clamp(18px, 2.6vh, 26px);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  pointer-events: none;
}

.pass-foot p {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pass-foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.pass-foot a:hover {
  color: var(--brand);
  border-color: currentColor;
}

.pass-foot .pill { pointer-events: auto; height: 34px; font-size: 0.76rem; }

/* --------------------------------------------------------- 复制提示 */
.pass-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 10px);
  z-index: 40;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.pass-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------- 加载遮罩 */
.pass-boot {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--paper);
  transition: opacity 0.6s var(--ease), visibility 0s linear 0.6s;
}

.pass-boot.is-done {
  opacity: 0;
  visibility: hidden;
}

.pass-boot-mark {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.pass-boot-bar {
  width: 120px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.pass-boot-bar::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: var(--brand);
  animation: boot 1.1s var(--ease) infinite;
}

@keyframes boot {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ------------------------------------------------------ 安装引导浮层 */
.pass-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pass-sheet[hidden] { display: none; }

.pass-sheet-veil {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  backdrop-filter: blur(7px);
  cursor: pointer;
  animation: sheet-fade 0.26s var(--ease);
}

.pass-sheet-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 13px;
  padding: 26px 26px 20px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 40px 90px -40px rgba(20, 32, 58, 0.55);
  animation: sheet-pop 0.34s var(--ease);
}

.pass-sheet-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: #6b7488;
}

.pass-sheet-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: #1e2a44;
  letter-spacing: -0.01em;
}

.pass-sheet-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  width: min(78vw, 300px);
  counter-reset: sheet-step;
}

.pass-sheet-steps li {
  position: relative;
  padding-left: 28px;
  font-size: 0.8rem;
  line-height: 1.62;
  color: #5a6478;
  counter-increment: sheet-step;
}

.pass-sheet-steps li::before {
  content: counter(sheet-step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #eef3fc;
  color: #4964a0;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}

.pass-sheet-steps b {
  color: #29365b;
  font-weight: 700;
}

.pass-sheet-card .pill {
  border-color: #d5dcea;
  background: #29365b;
  color: #ffffff;
  height: 34px;
  padding: 0 20px;
}

.pass-sheet-card .pill:hover {
  background: #4964a0;
  border-color: #4964a0;
  color: #ffffff;
}

@keyframes sheet-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .pass-hero { width: min(26rem, 38vw); }
  .pass-title { font-size: clamp(2rem, 4.6vw, 3.1rem); }
}

@media (max-width: 900px) {
  body.page-index { overflow: hidden; }

  .pass-head { padding: 16px 18px; }

  /* 手机端标题回到左上角：桌面是 left+垂直居中，手机屏窄，卡片居中会把它
     盖住，所以要挪到顶部、靠左，让标题在卡片上方清晰可见（对齐参考站） */
  .pass-hero {
    top: 84px;
    left: 18px;
    transform: none;
    width: auto;
    max-width: 52vw;
  }
  .pass-meta { display: none; }
}

@media (max-width: 560px) {
  .pass-foot .pill { display: none; }
}

/* ------------------------------------------------------------ 减动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .pass-boot-bar::after { animation: none; width: 100%; }
  .pass-watermark::after { animation: none; }
  .pill, body.page-index { transition-duration: 0.01ms; }
}
