/* 梦屿小站 · tapi.fun — 宋锦星象诗笺精雕样式（纯 GPU 合成层动画，零外部资源，零毛玻璃回读掉帧） */

:root {
  --ink: #eff4fa;
  --paper-ink: #f7f0e2;
  --gold: #ffe0ad;
  --gold-deep: #d4a662;
  --gold-soft: rgba(255, 224, 173, .70);
  --gold-line: rgba(255, 224, 173, .24);
  --jade: #90ece1;
  --jade-soft: rgba(144, 236, 225, .58);
  --muted: rgba(196, 215, 235, .58);
  --faint: rgba(164, 188, 214, .28);
  --line: rgba(168, 204, 236, .17);
  --night: #050812;
  --kai: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "Noto Serif CJK SC", serif;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: rgba(255, 224, 173, .24); color: #fff; }

/* 提升 WebGL 画布为独立硬件合成层，避免与上层 DOM 混合重绘 */
canvas#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
  transform: translateZ(0);
  will-change: transform;
}
canvas#scene:active { cursor: grabbing; }

/* 玄青暗角画框与宋锦回纹四角星矩 */
.frame {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  contain: strict;
  background:
    linear-gradient(180deg, rgba(4, 8, 16, .66) 0%, rgba(4, 8, 16, 0) 22%, rgba(4, 8, 16, 0) 72%, rgba(4, 8, 16, .74) 100%),
    radial-gradient(124% 94% at 50% 46%, rgba(0, 0, 0, 0) 50%, rgba(2, 5, 12, .50) 100%);
}

.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  color: rgba(255, 224, 173, .46);
  opacity: 0;
  transition: opacity 1.8s ease .5s;
}
body.ready .corner { opacity: 1; }
.c-tl { top: clamp(13px, 1.8vw, 24px); left: clamp(13px, 1.8vw, 24px); }
.c-tr { top: clamp(13px, 1.8vw, 24px); right: clamp(13px, 1.8vw, 24px); transform: scaleX(-1); }
.c-bl { bottom: clamp(13px, 1.8vw, 24px); left: clamp(13px, 1.8vw, 24px); transform: scaleY(-1); }
.c-br { bottom: clamp(13px, 1.8vw, 24px); right: clamp(13px, 1.8vw, 24px); transform: scale(-1, -1); }

/* 点击微光涟漪（纯 transform + opacity GPU 动画） */
.ripples {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1px solid rgba(255, 224, 173, .56);
  border-radius: 50%;
  will-change: transform, opacity;
  animation: rippleOut .9s cubic-bezier(.16, .72, .24, 1) forwards;
}
@keyframes rippleOut {
  0% { transform: translate3d(0, 0, 0) scale(.35); opacity: .88; }
  100% { transform: translate3d(0, 0, 0) scale(5.2); opacity: 0; }
}

/* ---------------- HUD 顶栏 ---------------- */
.hud {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 3.1vw, 44px) clamp(24px, 3.6vw, 52px);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  will-change: transform, opacity;
  transition: opacity 1.3s ease .22s, transform 1.5s cubic-bezier(.2, .7, .2, 1) .22s;
}
body.ready .hud { opacity: 1; transform: translate3d(0, 0, 0); }
.hud > * { pointer-events: auto; }

.brand { min-width: 0; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-cn {
  margin: 0;
  font-family: var(--kai);
  font-weight: 400;
  font-size: clamp(23px, 2.45vw, 32px);
  line-height: 1;
  letter-spacing: .32em;
  text-indent: .32em;
  color: var(--paper-ink);
  text-shadow: 0 2px 26px rgba(0, 0, 0, .72), 0 0 22px rgba(255, 224, 173, .14);
}

/* 双线倒角朱文篆印饰 */
.brand-seal {
  display: inline-flex;
  padding: 2px;
  border: 1px solid rgba(218, 98, 82, .62);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(162, 50, 42, .22), rgba(112, 30, 26, .16));
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  user-select: none;
}
.brand-seal i {
  display: inline-block;
  font-style: normal;
  padding: 1.5px 4.5px;
  border: 0.5px solid rgba(236, 142, 126, .34);
  border-radius: 1.5px;
  color: rgba(248, 184, 168, .92);
  font-family: var(--kai);
  font-size: 9.5px;
  line-height: 1.05;
  letter-spacing: .16em;
  text-indent: .16em;
}

.brand-en {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  font-size: 9px;
  letter-spacing: .36em;
  color: rgba(206, 224, 244, .46);
  white-space: nowrap;
}
.brand-en .glyph {
  color: var(--gold-soft);
  font-size: 8px;
}

.brand-tag {
  position: relative;
  margin: 16px 0 0;
  padding-left: 13px;
  max-width: 24em;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 2.05;
  letter-spacing: .2em;
  color: rgba(218, 232, 246, .68);
  text-shadow: 0 1px 14px rgba(0, 0, 0, .78);
}
.brand-tag::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 1.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 224, 173, .62), rgba(144, 236, 225, .14));
}

.hud-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 11px;
  text-align: right;
}

/* 右上角星图拾梦计：高质感漆匣渐变底，移除常驻 backdrop-filter 彻底消除合成器回读掉帧 */
.counter-box {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  padding: 8px 15px 9px;
  border: 1px solid rgba(255, 224, 173, .20);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(12, 21, 36, .84), rgba(6, 12, 22, .78));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .38),
    0 1px 0 rgba(255, 236, 204, .08) inset;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .3s ease, background .3s ease, transform .3s ease;
}
.counter-box:hover,
.counter-box:focus-visible {
  border-color: rgba(255, 224, 173, .44);
  background: linear-gradient(160deg, rgba(18, 30, 50, .92), rgba(9, 16, 29, .88));
  transform: translate3d(0, -1px, 0);
  outline: none;
}

.counter {
  display: flex;
  align-items: baseline;
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--muted);
  white-space: nowrap;
}
.counter-kicker { margin-right: .55em; }
.counter b {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.counter .slash { margin: 0 .4em; opacity: .38; }
.counter #total {
  font-family: var(--serif);
  opacity: .58;
  letter-spacing: .1em;
}
.counter.bump b { animation: bump .7s cubic-bezier(.2, .8, .2, 1); }
@keyframes bump {
  0% { color: #fff8e8; transform: scale(1.16); }
  100% { color: var(--gold); transform: none; }
}

.star-dots {
  display: flex;
  align-items: center;
  gap: 4.5px;
}
.star-dots i {
  display: block;
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: rgba(176, 198, 224, .24);
  transition: background .4s ease, transform .4s ease, box-shadow .4s ease;
}
.star-dots i.lit {
  background: var(--jade);
  box-shadow: 0 0 6px rgba(144, 236, 225, .75);
  transform: scale(1.14);
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(160deg, rgba(10, 18, 31, .80), rgba(6, 11, 20, .74));
  box-shadow: 0 4px 16px rgba(0, 0, 0, .28), 0 1px 0 rgba(255, 255, 255, .04) inset;
  color: rgba(216, 230, 246, .68);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: .18em;
  line-height: 1.4;
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease, background .3s ease, transform .3s ease;
  white-space: nowrap;
}
.btn-ico {
  width: 12px;
  height: 12px;
  flex: none;
  color: rgba(255, 224, 173, .64);
  transition: color .3s ease;
}
.ghost:hover,
.ghost:focus-visible {
  color: var(--paper-ink);
  border-color: rgba(255, 224, 173, .42);
  background: linear-gradient(160deg, rgba(17, 29, 47, .90), rgba(9, 16, 28, .86));
  transform: translate3d(0, -1px, 0);
  outline: none;
}
.ghost:hover .btn-ico,
.ghost:focus-visible .btn-ico { color: var(--gold); }
.ghost:focus-visible { box-shadow: 0 0 0 2px rgba(255, 224, 173, .22); }

/* ---------------- 提示 / 页脚 ---------------- */
.hint {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: clamp(60px, 7.8vh, 88px);
  margin: 0;
  transform: translate3d(-50%, 0, 0);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .32em;
  color: rgba(214, 228, 244, .50);
  white-space: nowrap;
  pointer-events: none;
  will-change: opacity;
  transition: opacity 1.2s ease;
  animation: breath 5s ease-in-out infinite;
}
.hint-orn {
  color: rgba(255, 224, 173, .34);
  letter-spacing: .12em;
}
.hint.off { opacity: 0; animation: none; }
@keyframes breath { 50% { opacity: .80; } }

.foot {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 0 18px clamp(12px, 2.2vh, 22px);
  font-size: 10px;
  letter-spacing: .14em;
  color: rgba(206, 222, 240, .68);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .82);
  opacity: 0;
  transition: opacity 1.4s ease .55s;
}
body.ready .foot { opacity: 1; }
.foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .3s ease, border-color .3s ease;
}
.foot a:hover {
  color: var(--gold);
  border-bottom-color: rgba(255, 224, 173, .38);
}
.foot .sep { opacity: .4; }

/* ---------------- 悬停星标（纯 transform 定位，零重排与毛玻璃开销） ---------------- */
.orb-label {
  position: fixed;
  z-index: 4;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px;
  border: 1px solid rgba(255, 224, 173, .28);
  border-radius: 999px;
  background: linear-gradient(160deg, rgba(10, 18, 32, .90), rgba(6, 11, 20, .88));
  box-shadow: 0 10px 26px rgba(0, 0, 0, .48);
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: rgba(255, 238, 206, .92);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity .24s ease;
  white-space: nowrap;
}
.orb-label.show { opacity: 1; }
.orb-label.collected {
  border-color: rgba(144, 236, 225, .32);
  color: rgba(214, 250, 245, .94);
}
.orb-label .reticle {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
  background: rgba(255, 224, 173, .5);
  box-shadow: 0 0 8px var(--gold);
}
.orb-label.collected .reticle {
  border-color: var(--jade);
  background: rgba(144, 236, 225, .5);
  box-shadow: 0 0 8px var(--jade);
}

/* ---------------- 宋锦双线星象诗笺卡片（纯 transform/opacity 丝滑进出场） ---------------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 15;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(3, 6, 12, 0) 28%, rgba(3, 7, 15, .66) 100%),
    linear-gradient(180deg, rgba(3, 6, 12, .12), rgba(3, 6, 14, .44));
  opacity: 0;
  will-change: opacity;
  transition: opacity .5s ease;
}
.scrim[hidden] { display: none; }
.scrim.show { opacity: 1; }

.card {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: clamp(64px, 8.8vh, 108px);
  width: min(92vw, 596px);
  padding: clamp(28px, 3.2vw, 38px) clamp(28px, 3.8vw, 48px) clamp(22px, 2.5vw, 28px);
  border: 1px solid rgba(255, 224, 173, .28);
  border-radius: 16px;
  background:
    radial-gradient(95% 85% at 100% 0%, rgba(44, 92, 98, .20) 0%, transparent 62%),
    radial-gradient(80% 70% at 0% 100%, rgba(212, 166, 98, .10) 0%, transparent 60%),
    linear-gradient(168deg, rgba(13, 23, 38, .97) 0%, rgba(8, 14, 25, .98) 58%, rgba(5, 9, 18, .99) 100%);
  box-shadow:
    0 40px 110px rgba(0, 0, 0, .74),
    0 1px 0 rgba(255, 238, 204, .16) inset;
  color: var(--ink);
  opacity: 0;
  transform: translate3d(-50%, 18px, 0) scale(.99);
  will-change: transform, opacity;
  transition: opacity .48s ease, transform .58s cubic-bezier(.2, .75, .2, 1);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: min(72vh, 540px);
}
.card[hidden] { display: none; }
.card.show {
  opacity: 1;
  transform: translate3d(-50%, 0, 0) scale(1);
}

/* 宋锦笺谱双线泥金内衬框 */
.card-inner-frame {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 224, 173, .085);
  border-radius: 11px;
  pointer-events: none;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 173, .62), rgba(144, 236, 225, .38), transparent);
}

.card-astrolabe {
  position: absolute;
  top: -40px;
  right: -36px;
  width: 188px;
  height: 188px;
  color: rgba(255, 224, 173, .085);
  pointer-events: none;
  will-change: transform;
  animation: slowSpin 78s linear infinite;
}
@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

.card > *:not(.card-astrolabe):not(.card-inner-frame) {
  position: relative;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity .62s ease, transform .72s cubic-bezier(.2, .75, .2, 1);
}
.card.show > *:not(.card-astrolabe):not(.card-inner-frame) {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.card.show .card-head { transition-delay: .06s; }
.card.show .card-line { transition-delay: .13s; }
.card.show .card-rule { transition-delay: .22s; }
.card.show .card-echo { transition-delay: .30s; }
.card.show .card-actions { transition-delay: .40s; }
.card.show .card-close { transition-delay: .14s; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding-right: 36px;
}

.card-seal {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 9px;
  border: 1px solid rgba(255, 224, 173, .36);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(255, 224, 173, .12), rgba(144, 236, 225, .05));
  font-family: var(--kai);
  font-size: 11px;
  letter-spacing: .2em;
  text-indent: .2em;
  color: var(--gold);
}

.card-meta {
  margin: 0;
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .28em;
  color: rgba(214, 228, 246, .58);
}

.card-line {
  position: relative;
  margin: 0;
  padding-left: 16px;
  font-family: var(--kai);
  font-weight: 400;
  font-size: clamp(20.5px, 2.3vw, 25.5px);
  line-height: 1.9;
  letter-spacing: .08em;
  color: var(--paper-ink);
  text-wrap: pretty;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .45);
}
.card-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: .32em;
  bottom: .32em;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), rgba(144, 236, 225, .42));
}

.card-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 16px;
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: .32em;
  color: rgba(255, 224, 173, .50);
}
.card-rule i {
  font-style: normal;
  font-size: 8px;
  color: rgba(144, 236, 225, .50);
}
.card-rule::before,
.card-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 173, .24));
}
.card-rule::after { background: linear-gradient(90deg, rgba(255, 224, 173, .24), transparent); }
.card-rule span { flex: none; }

.card-echo {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2.12;
  letter-spacing: .06em;
  color: rgba(220, 235, 250, .82);
  text-wrap: pretty;
  transition: opacity .24s ease, transform .24s ease;
}
.card-echo.swap {
  opacity: 0;
  transform: translate3d(0, 4px, 0);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  margin: 24px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(168, 204, 236, .10);
}
.card-act {
  appearance: none;
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: rgba(255, 226, 178, .72);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .2em;
  cursor: pointer;
  transition: color .25s ease, background .25s ease;
}
.card-act:hover,
.card-act:focus-visible {
  color: var(--paper-ink);
  background: rgba(255, 224, 173, .10);
  outline: none;
}
.card-act-muted { color: rgba(190, 210, 234, .50); }
.act-sep {
  color: rgba(180, 202, 228, .28);
  font-size: 10px;
}

.card-close {
  position: absolute !important;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
  background: rgba(9, 15, 27, .65);
  color: rgba(206, 222, 240, .54);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color .28s ease, border-color .28s ease, background .28s ease;
}
.card-close:hover,
.card-close:focus-visible {
  color: var(--paper-ink);
  border-color: rgba(255, 224, 173, .40);
  background: rgba(255, 224, 173, .10);
  outline: none;
}

/* ---------------- 弹层（关于本站 & 拾梦诗笺） ---------------- */
.panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 14, .82);
}
.panel[hidden] { display: none; }

.panel-card {
  position: relative;
  width: min(92vw, 560px);
  max-height: min(84vh, 680px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(28px, 3.8vw, 40px);
  border: 1px solid rgba(255, 224, 173, .24);
  border-radius: 16px;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(44, 90, 98, .16) 0%, transparent 60%),
    linear-gradient(175deg, rgba(13, 22, 37, .98), rgba(6, 10, 19, .99));
  box-shadow: 0 36px 96px rgba(0, 0, 0, .72);
  will-change: transform, opacity;
  animation: panelIn .42s cubic-bezier(.2, .75, .2, 1) both;
}
.panel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 173, .48), transparent);
}
@keyframes panelIn {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.panel-kicker {
  margin: 0 0 8px !important;
  font-family: var(--sans) !important;
  font-size: 9px !important;
  letter-spacing: .34em !important;
  color: rgba(255, 224, 173, .48) !important;
}

.panel-card h2 {
  margin: 0 0 18px;
  font-family: var(--kai);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: .32em;
  color: var(--paper-ink);
}
.panel-card p {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 2.1;
  letter-spacing: .04em;
  color: rgba(212, 228, 246, .70);
}
.panel-card a { color: var(--gold); text-decoration: none; }
.panel-card a:hover { text-decoration: underline; }
.panel-meta {
  padding-top: 10px;
  border-top: 1px solid rgba(168, 204, 236, .11);
  font-size: 12px !important;
  color: rgba(192, 210, 234, .50) !important;
}
.panel-close { margin-top: 10px; }

/* 自定义纤细暗金滚动条 */
.card,
.panel-card,
.slip-grid {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 224, 173, .22) transparent;
}
.card::-webkit-scrollbar,
.panel-card::-webkit-scrollbar,
.slip-grid::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.card::-webkit-scrollbar-track,
.panel-card::-webkit-scrollbar-track,
.slip-grid::-webkit-scrollbar-track {
  background: transparent;
}
.card::-webkit-scrollbar-thumb,
.panel-card::-webkit-scrollbar-thumb,
.slip-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 224, 173, .22);
  border-radius: 999px;
}

/* 拾梦诗笺图鉴网格 */
.anthology-card {
  width: min(94vw, 688px);
  max-height: min(86vh, 740px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px) clamp(22px, 3.2vw, 36px);
}
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-right: 36px;
  margin-bottom: 8px;
  flex: none;
}
.panel-head h2 { margin-bottom: 0; }
.anthology-stat {
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: .2em;
  color: var(--jade);
  white-space: nowrap;
}
.anthology-lead {
  margin-bottom: 14px !important;
  font-size: 12px !important;
  line-height: 1.75 !important;
  color: rgba(198, 216, 238, .54) !important;
  flex: none;
}

.slip-grid {
  list-style: none;
  margin: 0 0 16px;
  padding: 2px 4px 2px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
}
.slip { margin: 0; }
.slip-btn {
  appearance: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px 13px;
  border: 1px solid rgba(168, 204, 236, .12);
  border-radius: 10px;
  background: rgba(10, 17, 29, .62);
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .28s ease, background .28s ease, transform .28s ease;
}
.slip-btn.seen {
  border-color: rgba(144, 236, 225, .24);
  background: linear-gradient(155deg, rgba(16, 32, 46, .78), rgba(10, 18, 31, .74));
}
.slip-btn.seen:hover,
.slip-btn.seen:focus-visible {
  border-color: rgba(255, 224, 173, .46);
  background: linear-gradient(155deg, rgba(22, 41, 58, .92), rgba(13, 24, 40, .86));
  transform: translate3d(0, -1px, 0);
  outline: none;
}
.slip-btn.unseen {
  opacity: .56;
  cursor: default;
}
.slip-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(255, 224, 173, .64);
}
.slip-btn.seen .slip-isle { color: var(--jade); }
.slip-btn.unseen .slip-top { color: rgba(178, 198, 222, .44); }
.slip-text {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: .04em;
  color: var(--paper-ink);
}
.slip-btn.unseen .slip-text {
  color: rgba(176, 196, 220, .4);
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.panel-foot .panel-close { margin-top: 0; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  z-index: 25;
  left: 50%;
  top: clamp(96px, 15vh, 160px);
  transform: translate3d(-50%, -6px, 0);
  padding: 10px 20px;
  border: 1px solid rgba(255, 224, 173, .28);
  border-radius: 999px;
  background: rgba(8, 14, 25, .92);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .52);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .22em;
  color: rgba(255, 234, 196, .92);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity .6s ease, transform .6s ease;
  white-space: nowrap;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate3d(-50%, 0, 0); }

/* ---------------- 星象罗盘加载层 ---------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(100% 80% at 50% 45%, #0b1626 0%, #050812 62%, #03050a 100%);
  transition: opacity 1.1s ease, visibility 1.1s;
}
body.ready .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-astrolabe {
  width: 72px;
  height: 72px;
  will-change: transform;
  animation: slowSpin 18s linear infinite;
}
.loader-word {
  font-family: var(--kai);
  font-size: 14px;
  letter-spacing: .62em;
  text-indent: .62em;
  color: rgba(232, 238, 248, .66);
  animation: breath 3.2s ease-in-out infinite;
}
.loader-bar {
  position: relative;
  width: 108px;
  height: 1px;
  overflow: hidden;
  background: rgba(158, 196, 232, .14);
}
.loader-bar i {
  position: absolute;
  inset: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 173, .84), rgba(144, 236, 225, .62), transparent);
  will-change: transform;
  animation: sweep 1.85s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes sweep {
  0% { transform: translate3d(-115%, 0, 0); }
  100% { transform: translate3d(265%, 0, 0); }
}

/* ---------------- 无障碍 / 回退 ---------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sr-open {
  position: fixed;
  z-index: 40;
  left: 18px;
  bottom: 18px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 224, 173, .34);
  border-radius: 999px;
  background: rgba(8, 13, 22, .94);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .12em;
  cursor: pointer;
  transform: translate3d(0, 140%, 0);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.sr-open:focus-visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  outline: 2px solid rgba(255, 224, 173, .35);
  outline-offset: 2px;
}

.fallback {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(90% 70% at 50% 38%, #0d1c32 0%, #050812 66%, #03050a 100%);
}
.fallback[hidden] { display: none; }
.fallback-kicker {
  margin: 0;
  font-size: 9px;
  letter-spacing: .4em;
  color: rgba(255, 224, 173, .44);
}
.fallback h2 {
  margin: 0;
  font-family: var(--kai);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: .42em;
  text-indent: .42em;
  color: var(--paper-ink);
}
.fallback p {
  margin: 0;
  max-width: 34em;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 2.1;
  letter-spacing: .05em;
  color: rgba(204, 220, 240, .62);
}
.fallback-lines { color: rgba(255, 226, 178, .78) !important; margin-top: 10px !important; }
.fallback-meta { font-size: 11.5px !important; color: rgba(186, 205, 230, .44) !important; }
.fallback a { color: var(--gold); text-decoration: none; }

.no-webgl #scene,
.no-webgl .frame,
.no-webgl .ripples,
.no-webgl .hint,
.no-webgl .orb-label,
.no-webgl .loader { display: none; }
.no-webgl .hud { opacity: 1; transform: none; }
.no-webgl .foot { opacity: 1; }

.noscript {
  position: fixed;
  z-index: 70;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 520px);
  padding: 24px;
  border: 1px solid rgba(255, 224, 173, .22);
  border-radius: 14px;
  background: rgba(7, 12, 22, .97);
  color: rgba(224, 236, 248, .76);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 2;
  letter-spacing: .06em;
  text-align: center;
}

/* ---------------- 窄屏与移动端适配 ---------------- */
@media (max-width: 760px) {
  .hud {
    padding: calc(16px + env(safe-area-inset-top)) 16px 0;
    gap: 10px;
  }
  .brand-row { gap: 8px; }
  .brand-cn { font-size: 21px; letter-spacing: .24em; text-indent: .24em; }
  .brand-seal i { font-size: 8.5px; padding: 1px 3.5px; }
  .brand-en { margin-top: 9px; font-size: 8px; letter-spacing: .26em; }
  .brand-tag {
    margin-top: 12px;
    padding-left: 9px;
    max-width: 15.5em;
    font-size: 10.5px;
    line-height: 1.88;
    letter-spacing: .13em;
  }
  .hud-aside { gap: 8px; }
  .counter-box { padding: 6px 10px 7px; gap: 5px; border-radius: 10px; }
  .counter { font-size: 9px; letter-spacing: .15em; }
  .counter b { font-size: 12.5px; }
  .star-dots { gap: 3px; }
  .star-dots i { width: 3.5px; height: 3.5px; }
  .controls { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .controls #bookBtn { display: none; }
  .ghost { padding: 6px 11px; font-size: 9px; letter-spacing: .14em; gap: 5px; }
  .btn-ico { width: 10.5px; height: 10.5px; }

  .hint { bottom: calc(58px + env(safe-area-inset-bottom)); font-size: 9.5px; letter-spacing: .2em; }
  .hint-orn { display: none; }

  .foot {
    gap: 4px 10px;
    padding: 0 14px calc(10px + env(safe-area-inset-bottom));
    font-size: 10px;
    letter-spacing: .06em;
  }

  .card {
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 68vh;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    transform: translate3d(0, 22px, 0);
  }
  .card.show { transform: translate3d(0, 0, 0); }
  .card-inner-frame { inset: 5px 5px 0 5px; border-bottom: 0; border-radius: 15px 15px 0 0; }
  .card-head { margin-bottom: 14px; }
  .card-meta { font-size: 9.5px; letter-spacing: .2em; }
  .card-line { font-size: 19px; line-height: 1.9; padding-left: 12px; }
  .card-rule { margin: 18px 0 14px; }
  .card-echo { font-size: 14px; line-height: 2.05; }
  .card-actions { margin-top: 18px; padding-top: 12px; gap: 6px 8px; }
  .card-act { font-size: 10.5px; letter-spacing: .14em; }

  .slip-grid { grid-template-columns: 1fr; }
  .orb-label { display: none; }
  .corner { display: none; }
  .sr-open { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .brand-tag { display: none; }
  .brand-en { letter-spacing: .2em; }
}

@media (max-height: 660px) and (min-width: 761px) {
  .brand-tag { display: none; }
  .card { bottom: 56px; max-height: 76vh; }
}

@media (prefers-reduced-motion: reduce) {
  .hint,
  .loader-word,
  .loader-bar i,
  .loader-astrolabe,
  .card-astrolabe { animation: none; }
  .card,
  .card > *,
  .panel-card,
  .toast,
  .scrim,
  .hud { transition-duration: .01s !important; animation-duration: .01s !important; }
}
