:root {
  --night: #0c0a10;
  --paper: #100e14;
  --ink: #f6f0e8;
  --dim: rgba(246, 240, 232, 0.68);
  --faint: rgba(246, 240, 232, 0.42);
  --rule: rgba(214, 186, 148, 0.28);
  --warm: #d6ba94;
  --rose: #e8c9a8;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Palatino Linotype", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --display-en: "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
  font-family: var(--sans);
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #06050a;
  position: fixed;
  inset: 0;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
p { margin: 0; }
::placeholder { color: var(--faint); }

.stage {
  position: fixed;
  inset: 0;
  height: 100%;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.phone {
  --kb: 0px;
  --shell-h: 100dvh;
  width: 100%;
  max-width: 100%;
  height: var(--shell-h);
  max-height: var(--shell-h);
  background: var(--paper);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  transform: none !important;
}
@media (min-width: 520px) {
  .phone {
    width: min(100%, 430px);
    max-width: min(100%, 430px);
    height: min(920px, var(--shell-h, 100svh));
    max-height: min(920px, var(--shell-h, 100svh));
    border-radius: 10px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  }
}

.cover, .book, .realm, .meet-welcome, .rank-guide { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.book { position: relative; }
.thread { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* —— 六档金属：珠宝级嵌套框 —— */
.rank-n {
  --rim: linear-gradient(160deg, #fff9f0 0%, #efe0c8 18%, #c9a57a 42%, #f7ecda 58%, #8f7350 78%, #f2e6d2 100%);
  --rim-inner: linear-gradient(180deg, rgba(255, 248, 236, 0.55), rgba(120, 96, 68, 0.35));
  --metal: linear-gradient(180deg, #fff8ee, #d8bc94);
  --ink: #e9d5b4;
  --glow: rgba(210, 180, 130, 0.28);
  --chip: linear-gradient(165deg, #4a4034 0%, #2a241c 55%, #1a1612 100%);
  --chip-solid: #2e2820;
  --chip-fg: #f6ecdc;
  --chip-line: rgba(236, 214, 176, 0.55);
  --bubble: rgba(34, 28, 22, 0.86);
  --bubble-line: rgba(232, 210, 176, 0.42);
  --you-bg: #e8d6ba;
  --composer: rgba(26, 20, 14, 0.9);
  --inlay: linear-gradient(180deg, #f4ebe0 0%, #e2d2bc 45%, #c9b396 100%);
  --emblem: url("/portraits/frames/emblem-n.png");
  --frame: url("/portraits/frames/frame-n.png");
}
.rank-r {
  --rim: linear-gradient(160deg, #fbfdff 0%, #e4eef6 18%, #9eb4c8 42%, #f2f7fb 58%, #5a7288 78%, #e8f0f6 100%);
  --rim-inner: linear-gradient(180deg, rgba(245, 250, 255, 0.5), rgba(70, 90, 110, 0.35));
  --metal: linear-gradient(180deg, #f7fafd, #b8cad8);
  --ink: #d5e4f0;
  --glow: rgba(170, 195, 220, 0.3);
  --chip: linear-gradient(165deg, #3a4a58 0%, #1c2834 55%, #101820 100%);
  --chip-solid: #1c2834;
  --chip-fg: #eef5fb;
  --chip-line: rgba(200, 220, 236, 0.55);
  --bubble: rgba(18, 26, 36, 0.86);
  --bubble-line: rgba(190, 212, 230, 0.45);
  --you-bg: #d8e6f2;
  --composer: rgba(12, 18, 28, 0.92);
  --inlay: linear-gradient(180deg, #eef3f8 0%, #c8d5e2 45%, #8fa6ba 100%);
  --emblem: url("/portraits/frames/emblem-r.png");
  --frame: url("/portraits/frames/frame-r.png");
}
.rank-sr {
  --rim: linear-gradient(160deg, #ffe8d8 0%, #f0b898 18%, #c45a38 42%, #ffd8c4 58%, #7a2e1c 78%, #f8c8b0 100%);
  --rim-inner: linear-gradient(180deg, rgba(255, 220, 200, 0.5), rgba(120, 48, 28, 0.4));
  --metal: linear-gradient(180deg, #ffdcc8, #d07050);
  --ink: #f0a888;
  --glow: rgba(210, 110, 70, 0.32);
  --chip: linear-gradient(165deg, #e07850 0%, #a84828 55%, #6a2818 100%);
  --chip-solid: #b85030;
  --chip-fg: #fff4ec;
  --chip-line: rgba(255, 200, 168, 0.55);
  --bubble: rgba(48, 24, 18, 0.86);
  --bubble-line: rgba(232, 152, 120, 0.48);
  --you-bg: #f0c8b0;
  --composer: rgba(38, 18, 14, 0.9);
  --inlay: linear-gradient(180deg, #f6cfc0 0%, #d88868 45%, #9a4630 100%);
  --emblem: url("/portraits/frames/emblem-sr.png");
  --frame: url("/portraits/frames/frame-sr.png");
}
.rank-ssr {
  --rim: linear-gradient(160deg, #fff6d0 0%, #f0d878 18%, #c89618 40%, #ffeab0 58%, #8a6808 78%, #fff0c0 100%);
  --rim-inner: linear-gradient(180deg, rgba(255, 240, 180, 0.55), rgba(120, 90, 10, 0.4));
  --metal: linear-gradient(180deg, #fff2c4, #e0b028);
  --ink: #f0d060;
  --glow: rgba(220, 170, 40, 0.36);
  --chip: linear-gradient(165deg, #f0c840 0%, #c89010 50%, #7a5808 100%);
  --chip-solid: #c89818;
  --chip-fg: #2a1e08;
  --chip-line: rgba(255, 230, 150, 0.6);
  --bubble: rgba(40, 32, 14, 0.88);
  --bubble-line: rgba(232, 192, 64, 0.52);
  --you-bg: #f0d878;
  --composer: rgba(30, 24, 10, 0.92);
  --inlay: linear-gradient(180deg, #ffe9a8 0%, #e0b840 45%, #a07810 100%);
  --emblem: url("/portraits/frames/emblem-ssr.png");
  --frame: url("/portraits/frames/frame-ssr.png");
}
.rank-sp {
  --rim: linear-gradient(160deg, #f6f0ff 0%, #d0b8f0 18%, #7a58b8 40%, #ebe0ff 58%, #3e2878 78%, #e0d0f8 100%);
  --rim-inner: linear-gradient(180deg, rgba(236, 224, 255, 0.5), rgba(60, 40, 110, 0.4));
  --metal: linear-gradient(180deg, #f0e8ff, #a888d8);
  --ink: #d0b8f0;
  --glow: rgba(150, 120, 210, 0.34);
  --chip: linear-gradient(165deg, #a888d8 0%, #6848a8 55%, #382868 100%);
  --chip-solid: #6a48a0;
  --chip-fg: #f8f4ff;
  --chip-line: rgba(220, 200, 255, 0.55);
  --bubble: rgba(32, 22, 48, 0.88);
  --bubble-line: rgba(190, 168, 230, 0.48);
  --you-bg: #e0d0f8;
  --composer: rgba(24, 16, 38, 0.92);
  --inlay: linear-gradient(180deg, #ddd0f4 0%, #8a68c0 45%, #4a3088 100%);
  --emblem: url("/portraits/frames/emblem-sp.png");
  --frame: url("/portraits/frames/frame-sp.png");
}
.rank-myth {
  --rim: linear-gradient(160deg, #ffe7a8 0%, #e8b040 16%, #c42828 38%, #2a1010 55%, #f0c060 74%, #8a1810 92%, #ffe0a0 100%);
  --rim-inner: linear-gradient(180deg, rgba(255, 220, 140, 0.5), rgba(90, 16, 16, 0.5));
  --metal: linear-gradient(180deg, #ffe6a0, #c42828 62%, #5a1010);
  --ink: #f0c060;
  --glow: rgba(200, 48, 40, 0.38);
  --chip: linear-gradient(165deg, #e04030 0%, #a01818 45%, #4a0808 100%);
  --chip-solid: #b02020;
  --chip-fg: #ffe9b0;
  --chip-line: rgba(255, 210, 120, 0.6);
  --bubble: rgba(40, 12, 12, 0.9);
  --bubble-line: rgba(240, 192, 96, 0.55);
  --you-bg: #f0c060;
  --composer: rgba(28, 8, 8, 0.94);
  --inlay: linear-gradient(180deg, #e8a858 0%, #a82828 40%, #4a1010 100%);
  --emblem: url("/portraits/frames/emblem-myth.png");
  --frame: url("/portraits/frames/frame-myth.png");
}

/* —— 梦中人抽屉 —— */
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 10, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 2;
}
.book.open .scrim { opacity: 1; pointer-events: auto; }
.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(288px, 82vw);
  z-index: 3;
  transform: translateX(110%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  background: rgba(248, 244, 236, 0.96);
  backdrop-filter: blur(22px);
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 0;
  color: #2a241c;
}
.book.open .drawer { transform: translateX(0); }
.book.stage .drawer {
  background:
    radial-gradient(90% 28% at 50% -6%, rgba(232, 210, 168, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(16, 14, 20, 0.97), rgba(9, 8, 12, 0.98));
  color: #f6f0e8;
  border-left: 1px solid rgba(214, 186, 148, 0.14);
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.35);
}
.drawer-head {
  flex: none;
  padding: 4px 2px 14px;
  border-bottom: 1px solid rgba(214, 186, 148, 0.14);
}
.drawer-kicker {
  margin: 0;
  font-family: var(--display-en);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.28em;
  color: rgba(232, 210, 168, 0.62);
}
.drawer-head h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: #f6efe4;
}
.drawer-section {
  flex: none;
  margin: 16px 2px 10px;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: rgba(246, 240, 232, 0.42);
}
.men-label {
  font-size: 11px;
  letter-spacing: 0.5em;
  color: #8a5a3c;
  padding-left: 2px;
}
.book.stage .men-label { color: var(--warm); }
.drawer-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(214, 186, 148, 0.12);
}
.rank-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.rank-entry-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.rank-entry b {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: rgba(240, 212, 164, 0.88);
}
.rank-entry em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(246, 240, 232, 0.4);
}
.rank-entry i {
  flex: none;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid rgba(232, 210, 168, 0.45);
  border-right: 1.5px solid rgba(232, 210, 168, 0.45);
  transform: rotate(45deg);
  opacity: 0.65;
}
.rank-entry:active {
  background: rgba(232, 210, 168, 0.06);
}
.rank-guide {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(80% 40% at 50% -4%, rgba(232, 210, 168, 0.16), transparent 58%),
    linear-gradient(180deg, #121018 0%, #0a090e 38%, #07060a 100%);
  color: #f6f0e8;
  overflow: hidden;
}
.rank-guide::before {
  content: "";
  position: absolute;
  left: 42px;
  top: calc(148px + var(--safe-top));
  bottom: 12%;
  width: 1px;
  background: linear-gradient(180deg, rgba(232, 210, 168, 0.38), rgba(232, 210, 168, 0.04));
  pointer-events: none;
}
.rank-guide .back {
  position: absolute;
  z-index: 3;
  top: calc(8px + var(--safe-top));
  left: 6px;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 0;
  background: transparent;
  color: #fff;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
}
.rank-guide-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: calc(52px + var(--safe-top)) 26px calc(36px + var(--safe-bottom)) 26px;
  scrollbar-width: none;
}
.rank-guide-body::-webkit-scrollbar { display: none; }
.rank-guide-body .mark {
  margin: 0;
  font-family: var(--display-en);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.28em;
  color: rgba(232, 210, 168, 0.7);
}
.rank-guide-body h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.36em;
}
.rank-guide-body .lede {
  margin: 14px 0 8px;
  max-width: 28em;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(246, 240, 232, 0.7);
}
.rule-plain {
  margin: 16px 0 0;
  padding: 0 0 0 1.15em;
  max-width: 32em;
  color: rgba(246, 240, 232, 0.82);
  font-size: 14px;
  line-height: 1.75;
}
.rule-plain li { margin: 0 0 8px; }
.rule-plain li::marker { color: rgba(232, 210, 168, 0.55); }
.bond-sheet {
  position: relative;
  margin: 32px 0 0;
  padding: 26px 0 0;
}
.bond-sheet::before {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 0 0 22px;
  background: linear-gradient(90deg, rgba(232, 210, 168, 0.7), transparent);
}
.bond-sheet-title {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: rgba(246, 240, 232, 0.94);
}
.bond-sheet .bond-rules {
  margin-top: 12px;
}
.grade-lead {
  margin: 10px 0 0;
  max-width: 28em;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: rgba(246, 240, 232, 0.58);
}
.grade-ladder {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grade-ladder li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px 14px 12px 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--ink) 16%, transparent), transparent 62%);
}
.grade-ladder .grade-mark {
  width: 46px;
  height: 46px;
  background: var(--emblem) center / contain no-repeat;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.grade-ladder strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ink);
}
.grade-ladder p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: rgba(246, 240, 232, 0.9);
}
.grade-ladder em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--ink) 72%, #fff);
}
.grade-ladder li.rank-myth {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 28%, transparent), 0 10px 28px rgba(0, 0, 0, 0.18);
}
.bond-you {
  margin: 16px 0 0;
  max-width: 32em;
  padding: 12px 14px;
  border-left: 1px solid rgba(232, 210, 168, 0.42);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(240, 212, 164, 0.88);
  background: rgba(240, 212, 164, 0.06);
}
.rank-table-kicker {
  margin: 28px 0 0;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(232, 210, 168, 0.62);
}
.bond-sheet .rank-table-kicker {
  margin-top: 22px;
}
.rank-ladder {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}
.rank-ladder li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 0 18px;
  border-bottom: 1px solid rgba(214, 186, 148, 0.12);
  background: transparent;
  box-shadow: none;
}
.rank-ladder li:last-child { border-bottom: 0; }
.rank-ladder li > b {
  position: relative;
  z-index: 1;
  margin-top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--heat, rgba(246, 240, 232, 0.92));
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.rank-ladder header {
  display: flex;
  align-items: baseline;
  gap: 0;
}
.rank-ladder header span {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--heat, rgba(246, 240, 232, 0.94));
}
.rank-ladder .rank-sub {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #e8d2a8;
}
.rank-ladder .rank-lead {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(246, 240, 232, 0.86);
}
.rank-ladder .offer {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: rgba(232, 210, 168, 0.62);
}
.rank-points {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.rank-points li {
  display: block;
  margin: 0;
  padding: 3px 0;
  border: 0;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(246, 240, 232, 0.78);
}
.rank-points em {
  display: inline-block;
  min-width: 4.5em;
  margin-right: 6px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(232, 210, 168, 0.72);
}
.rank-keys {
  margin: 8px 0 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(246, 240, 232, 0.28);
}
.rank-keys em {
  font-style: normal;
}
.rank-keys em.on { color: var(--ink); }
.rank-keys em.off { color: rgba(246, 240, 232, 0.28); }
.sand-sheet {
  position: relative;
  margin: 28px 0 0;
  padding: 22px 0 0;
}
.sand-sheet::before {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 0 0 20px;
  background: linear-gradient(90deg, rgba(232, 210, 168, 0.7), transparent);
}
.sand-balance {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-size: 15px;
  color: #f0d4a4;
}
.sand-costs {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(247, 239, 230, 0.55);
}
.sand-buy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sand-buy-btn {
  height: 42px;
  border: 1px solid rgba(240, 212, 164, 0.28);
  background: rgba(240, 212, 164, 0.08);
  color: #f0d4a4;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.sand-buy-btn:active {
  background: rgba(240, 212, 164, 0.16);
}
.sand-chip {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(240, 212, 164, 0.28);
  background: rgba(240, 212, 164, 0.08);
  color: rgba(240, 212, 164, 0.92);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-align: center;
  cursor: pointer;
}
.sand-chip:active {
  background: rgba(240, 212, 164, 0.16);
}
.sand-balance-link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(240, 212, 164, 0.35);
}
.sand-shop-balance {
  margin: 12px 0 0;
  font-size: 15px;
  color: rgba(247, 239, 230, 0.78);
}
.sand-shop-balance b {
  color: #f0d4a4;
  font-weight: 400;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.06em;
}
.sand-shop-rules {
  margin-top: 14px;
}
.sand-shop .rank-table-kicker {
  margin-top: 20px;
}
.sand-shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 8px;
}
.sand-shop-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(240, 212, 164, 0.28);
  background: rgba(240, 212, 164, 0.07);
  color: #f7f0e6;
  font-family: var(--serif);
  text-align: left;
  cursor: pointer;
}
.sand-shop-item:active {
  background: rgba(240, 212, 164, 0.14);
}
.sand-shop-name {
  font-size: 16px;
  letter-spacing: 0.12em;
}
.sand-shop-meta {
  font-size: 13px;
  color: rgba(240, 212, 164, 0.75);
}
.sand-shop-price {
  font-size: 16px;
  color: #f0d4a4;
  font-weight: 400;
}
.night-keep {
  position: relative;
  margin: 36px 0 0;
  padding: 28px 0 0;
}
.night-keep::before {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 0 0 26px;
  background: linear-gradient(90deg, rgba(232, 210, 168, 0.7), transparent);
}
.night-keep-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: #e8d2a8;
}
.night-keep-lamps {
  display: flex;
  gap: 14px;
  margin: 16px 0 18px;
}
.night-keep-lamps i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(232, 210, 168, 0.55);
  background: transparent;
  box-shadow: 0 0 10px rgba(232, 210, 168, 0.12);
}
.night-keep-lamps i.on {
  background: #f0d4a4;
  border-color: #f0d4a4;
  box-shadow: 0 0 14px rgba(240, 212, 164, 0.55);
}
.night-keep h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.55;
  color: #f6efe4;
}
.rule-list {
  margin: 12px 0 0;
  padding: 0 0 0 1.2em;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(246, 240, 232, 0.7);
}
.rule-list li + li { margin-top: 8px; }
.night-keep p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(246, 240, 232, 0.68);
}
.night-keep-you {
  margin-top: 16px !important;
  color: #e8d2a8 !important;
  letter-spacing: 0.04em;
}
.lamp-row { display: none; }
.meet-new.has-lamp {
  border-color: rgba(232, 210, 168, 0.5);
  background: rgba(232, 210, 168, 0.1);
}
.men-empty {
  margin: 8px 2px 0;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.12em;
  line-height: 1.9;
  color: rgba(246, 240, 232, 0.5);
}
#won {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 0 0 4px;
  scrollbar-width: none;
}
#won::-webkit-scrollbar { display: none; }

.meet-new {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(214, 186, 148, 0.28);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(240, 212, 164, 0.12), rgba(255, 255, 255, 0.03));
  color: #f6f0e8;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.meet-new:active { transform: scale(0.98); }
.meet-new b {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: #f0d4a4;
}
.meet-new span {
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.58;
  line-height: 1.45;
}
.book.stage .meet-new {
  border-color: rgba(214, 186, 148, 0.28);
  color: #f6f0e8;
}
.book.stage .meet-new:hover,
.book.paper .meet-new:hover {
  border-color: rgba(214, 186, 148, 0.55);
}

/* —— 梦中人卡槽：边框按稀有度，不随羁绊升阶变化 ——
   在 .man.rank-* 上重声明，避免被外层 .book.rank-* 变量污染 */
.man.rank-n {
  --glow: rgba(210, 180, 130, 0.28);
  --ink: #e9d5b4;
  --emblem: url("/portraits/frames/emblem-n.png");
  --frame: url("/portraits/frames/frame-n.png");
}
.man.rank-r {
  --glow: rgba(170, 195, 220, 0.3);
  --ink: #d5e4f0;
  --emblem: url("/portraits/frames/emblem-r.png");
  --frame: url("/portraits/frames/frame-r.png");
}
.man.rank-sr {
  --glow: rgba(210, 110, 70, 0.32);
  --ink: #f0a888;
  --emblem: url("/portraits/frames/emblem-sr.png");
  --frame: url("/portraits/frames/frame-sr.png");
}
.man.rank-ssr {
  --glow: rgba(220, 170, 40, 0.36);
  --ink: #f0d060;
  --emblem: url("/portraits/frames/emblem-ssr.png");
  --frame: url("/portraits/frames/frame-ssr.png");
}
.man.rank-sp {
  --glow: rgba(150, 120, 210, 0.34);
  --ink: #d0b8f0;
  --emblem: url("/portraits/frames/emblem-sp.png");
  --frame: url("/portraits/frames/frame-sp.png");
}
.man.rank-myth {
  --glow: rgba(200, 48, 40, 0.38);
  --ink: #f0c060;
  --emblem: url("/portraits/frames/emblem-myth.png");
  --frame: url("/portraits/frames/frame-myth.png");
}
.man {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 14px;
  text-align: left;
  color: inherit;
  border: 1px solid rgba(214, 186, 148, 0.1);
  cursor: pointer;
}
.man .card {
  position: relative;
  display: block;
  align-self: center;
  flex: 0 0 auto;
  width: 86px;
  height: calc(86px * 4 / 3);
  aspect-ratio: 3 / 4;
  box-sizing: border-box;
  padding: 0;
  background: #120e16;
  isolation: isolate;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.48);
}
.man .card::before {
  content: none;
}
.man .card::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
/* 直接绑到这一张卡，不跟当前聊天对象的等级走 */
.man.rank-n > .card::after { background-image: url("/portraits/frames/frame-n.png"); }
.man.rank-r > .card::after { background-image: url("/portraits/frames/frame-r.png"); }
.man.rank-sr > .card::after { background-image: url("/portraits/frames/frame-sr.png"); }
.man.rank-ssr > .card::after { background-image: url("/portraits/frames/frame-ssr.png"); }
.man.rank-sp > .card::after { background-image: url("/portraits/frames/frame-sp.png"); }
.man.rank-myth > .card::after { background-image: url("/portraits/frames/frame-myth.png"); }
.man > .card > img {
  position: absolute;
  z-index: 1;
  top: 7%;
  left: 9%;
  width: 82%;
  height: 86%;
  max-width: none;
  object-fit: cover;
  object-position: center 16%;
  background: #120e16;
}
/* 框图自带的角标会被整框缩放拉扁，改贴正圆徽记盖住 */
.man > .card > .rank-tag {
  position: absolute;
  z-index: 6;
  top: 1px;
  left: 1px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: block !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
  background-color: transparent !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  box-shadow: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}
.man.rank-n > .card > .rank-tag { background-image: url("/portraits/frames/emblem-n.png") !important; }
.man.rank-r > .card > .rank-tag { background-image: url("/portraits/frames/emblem-r.png") !important; }
.man.rank-sr > .card > .rank-tag { background-image: url("/portraits/frames/emblem-sr.png") !important; }
.man.rank-ssr > .card > .rank-tag { background-image: url("/portraits/frames/emblem-ssr.png") !important; }
.man.rank-sp > .card > .rank-tag { background-image: url("/portraits/frames/emblem-sp.png") !important; }
.man.rank-myth > .card > .rank-tag { background-image: url("/portraits/frames/emblem-myth.png") !important; }
.man.on {
  border-color: color-mix(in srgb, var(--ink) 55%, transparent);
  background: rgba(232, 210, 168, 0.07);
}
.man.on .card {
  outline: 1px solid color-mix(in srgb, var(--ink) 70%, #fff);
  outline-offset: 3px;
}
.man.on .meta > .man-top > b {
  color: #fff;
}
.man.on .man-bond {
  color: var(--heat, var(--ink));
  opacity: 1;
}
.man.on .man-gauge i {
  background: linear-gradient(90deg, color-mix(in srgb, var(--heat, var(--ink)) 55%, #fff), var(--heat, var(--ink)));
}
.man .meta {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 2px 2px 2px 0;
}
.man-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.man .meta > .man-top > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.18em;
}
.heat-n { --heat: #c5d2e0; }
.heat-r { --heat: #d4c4f0; }
.heat-sr { --heat: #f0a8bc; }
.heat-ssr { --heat: #f0c078; }
.heat-sp { --heat: #ee7d68; }
.heat-myth { --heat: #ef4f4f; }
.man-bond {
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1.2;
  color: var(--heat, var(--ink));
  opacity: 0.92;
  white-space: nowrap;
}
.man-bond > b {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--heat, var(--ink));
  opacity: 1;
}
.man-bond > span {
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--heat, var(--ink)) 82%, #fff);
  opacity: 1;
}
.man-rare {
  margin: -2px 0 0;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: color-mix(in srgb, var(--ink) 78%, #fff);
}
.man-gauge {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.man-gauge i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--heat, #e8d2a8) 50%, transparent), var(--heat, #e8d2a8));
}
.man-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.man-hint {
  display: block;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: rgba(246, 240, 232, 0.72);
}
.man-chip {
  flex: none;
  margin: 0;
  padding: 2px 7px;
  border: 1px solid rgba(232, 210, 168, 0.28);
  border-radius: 6px;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(232, 210, 168, 0.88);
  background: rgba(232, 210, 168, 0.08);
  white-space: nowrap;
}
.man-chip.ready {
  border-color: rgba(240, 212, 164, 0.55);
  color: #f0d4a4;
  background: rgba(240, 212, 164, 0.14);
}
.man.preview { opacity: 0.72; }
.man.preview .card { filter: saturate(0.88); }

/* —— 封面：夜路灯下 · 隐约男主 + 动效 —— */
.cover {
  --cover-ink: #f7efe6;
  --cover-mute: rgba(247, 239, 230, 0.7);
  --cover-faint: rgba(247, 239, 230, 0.38);
  --cover-line: rgba(236, 206, 164, 0.48);
  --cover-lamp: #efd2a8;
  --cover-night: #06070b;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  color: var(--cover-ink);
  background: var(--cover-night);
}
.cover-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.cover-hero {
  position: absolute;
  inset: -4% -6% -2%;
  width: 112%;
  height: 108%;
  object-fit: cover;
  object-position: 55% 18%;
  filter: saturate(1.05) contrast(1.04) brightness(0.92);
  transform-origin: 55% 30%;
  animation: hero-drift 18s ease-in-out infinite alternate;
}
.cover-figure {
  position: absolute;
  right: -8%;
  bottom: 8%;
  width: 78%;
  height: 78%;
  object-fit: cover;
  object-position: center 12%;
  opacity: 0.34;
  mix-blend-mode: soft-light;
  filter: brightness(0.85) saturate(0.9) contrast(1.05);
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 62%, transparent 92%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 62%, transparent 92%);
  animation: figure-breathe 7.5s ease-in-out infinite alternate;
}
.cover-fog {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 40%, rgba(236, 206, 164, 0.14), transparent 60%),
    radial-gradient(ellipse 70% 45% at 20% 70%, rgba(80, 100, 140, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(6, 7, 11, 0.15) 0%, transparent 28%, rgba(6, 7, 11, 0.45) 72%, rgba(6, 7, 11, 0.88) 100%);
  animation: fog-drift 12s ease-in-out infinite alternate;
}
.cover-rain {
  position: absolute;
  inset: -20% 0 0;
  opacity: 0.28;
  background-image:
    repeating-linear-gradient(
      -12deg,
      transparent 0,
      transparent 14px,
      rgba(255, 240, 220, 0.09) 14px,
      rgba(255, 240, 220, 0.09) 15px
    );
  animation: rain-fall 1.1s linear infinite;
}
.cover-street {
  position: absolute;
  inset: 0;
}
.cover-street .pole {
  position: absolute;
  top: 8%;
  width: 2px;
  height: 42%;
  background: linear-gradient(180deg, rgba(236, 206, 164, 0.55), rgba(236, 206, 164, 0.05));
}
.cover-street .pole::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 18px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 200, 0.95), rgba(236, 206, 164, 0.2) 70%, transparent);
  box-shadow: 0 0 18px rgba(236, 206, 164, 0.7);
}
.cover-street .pole-l { left: 14%; }
.cover-street .pole-r { right: 18%; top: 14%; height: 36%; opacity: 0.7; }
.cover-street .glow {
  position: absolute;
  width: 46%;
  height: 40%;
  border-radius: 50%;
  filter: blur(2px);
  animation: lamp-pulse 3.6s ease-in-out infinite alternate;
}
.cover-street .glow-l {
  left: -4%;
  top: 4%;
  background: radial-gradient(ellipse at 40% 20%, rgba(255, 220, 170, 0.35), transparent 70%);
}
.cover-street .glow-r {
  right: -6%;
  top: 10%;
  width: 40%;
  background: radial-gradient(ellipse at 60% 25%, rgba(255, 210, 160, 0.22), transparent 68%);
  animation-delay: 0.8s;
}
.cover-street .flare {
  position: absolute;
  left: 8%;
  top: 6%;
  width: 28%;
  height: 28%;
  background: radial-gradient(circle, rgba(255, 240, 210, 0.35), transparent 62%);
  animation: flare-twinkle 4.2s ease-in-out infinite;
}
.cover-motes {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 16% 30%, rgba(255, 236, 210, 0.75), transparent),
    radial-gradient(1px 1px at 74% 24%, rgba(255, 220, 190, 0.55), transparent),
    radial-gradient(1.6px 1.6px at 48% 42%, rgba(255, 240, 220, 0.5), transparent),
    radial-gradient(1px 1px at 86% 48%, rgba(255, 230, 200, 0.4), transparent),
    radial-gradient(1.2px 1.2px at 28% 58%, rgba(255, 236, 210, 0.45), transparent),
    radial-gradient(1px 1px at 62% 66%, rgba(255, 228, 200, 0.35), transparent);
  animation: mote-drift 10s linear infinite alternate;
}
.cover-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 7, 11, 0.28) 0%, transparent 22%, transparent 48%, rgba(6, 7, 11, 0.55) 70%, rgba(6, 7, 11, 0.9) 100%),
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(6, 7, 11, 0.75), transparent 70%);
}
.cover .brand {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 24px;
  top: calc(12px + var(--safe-top));
  text-align: center;
  pointer-events: none;
  animation: cover-rise 1.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cover .brand::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, rgba(239, 210, 168, 0.75), transparent);
  animation: line-glow 3.2s ease-in-out infinite alternate;
}
.cover .brand .mark {
  margin: 0;
  font-family: "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.48em;
  text-indent: 0.48em;
  color: var(--cover-lamp);
  text-shadow: 0 0 18px rgba(239, 210, 168, 0.35);
  animation: mark-shimmer 5s ease-in-out infinite;
}
.cover h1 {
  margin: 10px 0 0;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: clamp(42px, 12.5vw, 54px);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  line-height: 1.05;
  color: #fffaf3;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(239, 210, 168, 0.22);
}
.cover .lede {
  margin: 12px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  line-height: 1.65;
  color: var(--cover-mute);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}
.cover .gate {
  position: absolute;
  z-index: 3;
  left: 16px;
  right: 16px;
  /* 用 bottom 顶起，避免和入场动画抢 transform；overlays-content 下 vv 不缩也可靠 */
  bottom: calc(14px + var(--safe-bottom) + var(--kb, 0px));
  max-height: 46%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 14px;
  background: linear-gradient(180deg, rgba(12, 12, 18, 0.42), rgba(8, 8, 12, 0.78));
  border: 1px solid rgba(239, 210, 168, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  transition: bottom 0.18s cubic-bezier(0.22, 1, 0.36, 1), max-height 0.18s ease-out;
  animation: cover-rise 1.15s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cover .field {
  color: var(--cover-ink);
  caret-color: var(--cover-lamp);
  border: 0;
  border-bottom: 1px solid rgba(239, 210, 168, 0.3);
  background: transparent;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.1em;
  height: 48px;
  margin-top: 4px;
}
.cover .field::placeholder {
  color: rgba(247, 239, 230, 0.34);
  letter-spacing: 0.18em;
}
.cover .field:focus {
  border-bottom-color: rgba(239, 210, 168, 0.9);
}
.cover .rowline { gap: 12px; }
.cover .text-btn {
  color: var(--cover-lamp);
  letter-spacing: 0.12em;
  font-size: 13px;
  font-weight: 500;
  font-family: "Noto Serif SC", "Songti SC", serif;
  height: 48px;
  margin-top: 4px;
  padding: 0 2px;
  border-bottom: 1px solid transparent;
  flex: none;
}
.cover .text-btn:hover,
.cover .text-btn:focus-visible {
  border-bottom-color: rgba(239, 210, 168, 0.55);
}
.cover .check {
  margin: 16px 0 12px;
  color: rgba(247, 239, 230, 0.68);
  font-size: 13px;
  letter-spacing: 0.06em;
  gap: 10px;
  align-items: center;
}
.cover .check input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  border: 1px solid rgba(239, 210, 168, 0.55);
  background: transparent;
  position: relative;
  cursor: pointer;
}
.cover .check input:checked {
  background: rgba(239, 210, 168, 0.2);
  border-color: var(--cover-lamp);
}
.cover .check input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--cover-lamp);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.cover .primary {
  background: linear-gradient(180deg, rgba(239, 210, 168, 0.28), rgba(239, 210, 168, 0.1));
  color: #fffaf3;
  border: 1px solid rgba(239, 210, 168, 0.78);
  border-radius: 0;
  letter-spacing: 0.38em;
  text-indent: 0.18em;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
  font-weight: 500;
  height: 50px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 240, 220, 0.22);
  animation: cta-pulse 3.8s ease-in-out infinite;
}
.cover .primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 240, 220, 0.28), transparent 80%);
  transform: translateX(-130%);
  animation: cta-sheen 4.5s ease-in-out infinite;
}
.cover .lede-en {
  margin: 12px 0 0;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: rgba(247, 239, 230, 0.4);
}
.cover .tip {
  margin: 12px 0 0;
  padding: 0 0 0 10px;
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: var(--cover-lamp);
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(239, 210, 168, 0.5);
}
.cover .tip[hidden] { display: none; }
.cover .text-btn:disabled,
.cover .primary:disabled {
  opacity: 0.42;
  cursor: default;
  animation: none;
}
.cover .primary:disabled::before { animation: none; }
.cover .error {
  min-height: 18px;
  margin-top: 10px;
  text-align: center;
  color: #e8b4a8;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.meet-welcome {
  position: relative;
  overflow: hidden;
  background: #07060f;
  color: #f6f0e8;
}
.meet-welcome-live {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.meet-welcome-live img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: saturate(0.92) contrast(1.05);
  opacity: 0;
  transform: scale(1.08);
  animation: meet-welcome-drift 8s ease both;
}
.meet-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.meet-ring,
.meet-tide,
.meet-moon,
.meet-flash,
.meet-shaft,
.meet-mote,
.meet-bubble,
.meet-star {
  position: absolute;
  display: none;
  pointer-events: none;
}
.meet-welcome-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 6, 15, 0.2) 0%, rgba(7, 6, 15, 0.28) 36%, rgba(7, 6, 15, 0.82) 68%, #07060f 100%);
}
.meet-welcome-copy {
  position: absolute;
  z-index: 3;
  left: 28px;
  right: 28px;
  bottom: 118px;
}
.meet-welcome-kicker,
.meet-welcome-rare,
.meet-welcome-lines p,
.meet-welcome-name,
.meet-welcome .realm-enter {
  opacity: 0;
  animation: realm-line-in 0.7s ease forwards;
}
.meet-welcome-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: rgba(246, 240, 232, 0.62);
  animation-delay: 0.15s;
}
.meet-welcome-rare {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--ink, #f0d4a4);
  animation-delay: 0.35s;
}
.meet-welcome-lines p {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.12em;
}
.meet-welcome-name {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.32em;
}
.meet-welcome .realm-enter {
  position: absolute;
  z-index: 4;
  left: 28px;
  right: 28px;
  bottom: calc(28px + var(--safe-bottom));
}

/* 浮影：一闪而过 */
.grade-n .meet-welcome-live img {
  animation: fx-ghost 1.5s ease both, fx-drift 8s ease 1.2s both;
}
.grade-n .meet-flash {
  display: block;
  inset: 0;
  background: rgba(246, 240, 232, 0.55);
  animation: fx-blink 1.1s ease both;
}
.grade-n .meet-mote {
  display: block;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(236, 228, 216, 0.8);
  animation-name: fx-mote-out;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
}
.grade-n .meet-welcome-rare {
  animation-name: fx-ghost-word;
  animation-duration: 1.1s;
}

/* 澜客：涟漪踏浪 */
.grade-r .meet-welcome-live img {
  animation: fx-rise 1.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.grade-r .meet-ring {
  display: block;
  left: 50%;
  top: 34%;
  width: 140px;
  height: 46px;
  margin-left: -70px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink) 70%, #fff);
  opacity: 0;
  animation: fx-ripple 2.1s ease-out both;
}
.grade-r .meet-ring:nth-child(2) { animation-delay: 0.38s; }
.grade-r .meet-ring:nth-child(3) { animation-delay: 0.76s; }
.grade-r .meet-mote {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 80%, #fff);
  animation-name: fx-float;
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
}
.grade-r .meet-welcome-rare { animation-name: fx-rise-word; animation-duration: 0.9s; }

/* 汐晤：暮汐漫上来 */
.grade-sr .meet-welcome-live img {
  animation: fx-tide-reveal 2.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.grade-sr .meet-tide {
  display: block;
  left: 0;
  right: 0;
  height: 28%;
  bottom: -10%;
  background: linear-gradient(180deg, transparent, rgba(232, 156, 104, 0.28), rgba(120, 48, 36, 0.15));
  animation: fx-tide 2.4s ease both;
}
.grade-sr .meet-welcome-rare {
  animation-name: fx-dusk-word;
  animation-duration: 1.2s;
  text-shadow: 0 0 16px rgba(232, 156, 104, 0.45);
}

/* 溟缘：从深海里浮出 */
.grade-ssr .meet-welcome-live img {
  animation: fx-abyss 2.6s ease both;
}
.grade-ssr .meet-shaft {
  display: block;
  left: 18%;
  top: -10%;
  width: 34%;
  height: 80%;
  background: linear-gradient(180deg, transparent, rgba(120, 190, 210, 0.16), transparent);
  filter: blur(8px);
  transform: rotate(8deg);
  animation: fx-shaft 2.8s ease both;
}
.grade-ssr .meet-bubble {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(180, 220, 230, 0.55);
  background: rgba(180, 220, 230, 0.08);
  animation-name: fx-bubble;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
}
.grade-ssr .meet-welcome-rare { animation-name: fx-rise-word; animation-duration: 1.3s; }

/* 星羁：星河落下 */
.grade-sp .meet-welcome-live img {
  animation: fx-star-reveal 2.2s ease both;
}
.grade-sp .meet-star {
  display: block;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(220, 200, 255, 0.9);
  animation-name: fx-starfall;
  animation-timing-function: linear;
  animation-fill-mode: both;
}
.grade-sp .meet-star:nth-child(odd) { width: 3px; height: 3px; }
.grade-sp .meet-welcome-rare {
  animation-name: fx-star-word;
  animation-duration: 1.4s;
  text-shadow: 0 0 18px var(--glow);
}

/* 月契：月环合上 */
.grade-myth .meet-welcome-live img {
  animation: fx-moon-reveal 2.8s ease both;
}
.grade-myth .meet-moon {
  display: block;
  left: 50%;
  top: 30%;
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 50%;
  border: 1px solid rgba(255, 228, 170, 0.85);
  box-shadow:
    0 0 32px rgba(255, 210, 140, 0.45),
    inset 0 0 24px rgba(255, 236, 200, 0.25);
  animation: fx-seal 2.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.grade-myth .meet-flash {
  display: block;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 236, 200, 0.45), transparent 46%);
  animation: fx-moonflash 2.4s ease both;
}
.grade-myth .meet-star {
  display: block;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(255, 236, 200, 0.9);
  box-shadow: 0 0 8px rgba(255, 210, 140, 0.8);
  animation-name: fx-twinkle;
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
}
.grade-myth .meet-welcome-rare {
  animation-name: fx-seal-word;
  animation-duration: 1.6s;
  text-shadow: 0 0 22px var(--glow);
}
.grade-myth .meet-welcome-name {
  animation-name: fx-seal-word;
}

@keyframes meet-welcome-drift {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
@keyframes fx-drift {
  from { transform: scale(1.04); }
  to { transform: scale(1); }
}
@keyframes fx-ghost {
  0% { opacity: 0; filter: blur(14px); }
  28% { opacity: 0.75; filter: blur(1px); }
  46% { opacity: 0.2; filter: blur(6px); }
  100% { opacity: 1; filter: none; }
}
@keyframes fx-ghost-word {
  0% { opacity: 0; letter-spacing: 0.6em; }
  40% { opacity: 0.3; }
  100% { opacity: 1; letter-spacing: 0.28em; }
}
@keyframes fx-blink {
  0% { opacity: 0; }
  18% { opacity: 0.7; }
  100% { opacity: 0; }
}
@keyframes fx-mote-out {
  0% { opacity: 0; transform: translateY(8px); }
  30% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-28px); }
}
@keyframes fx-rise {
  from { opacity: 0; transform: translateY(10%) scale(1.06); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes fx-rise-word {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes fx-ripple {
  from { opacity: 0.65; transform: scale(0.35); }
  to { opacity: 0; transform: scale(2.6); }
}
@keyframes fx-float {
  0% { opacity: 0; transform: translateY(12px); }
  30% { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-36px); }
}
@keyframes fx-tide-reveal {
  from { opacity: 0; clip-path: inset(46% 0 0 0); filter: saturate(0.5) brightness(0.7); }
  to { opacity: 1; clip-path: inset(0 0 0 0); filter: none; }
}
@keyframes fx-tide {
  from { transform: translateY(40%); opacity: 0; }
  40% { opacity: 1; }
  to { transform: translateY(-8%); opacity: 0.35; }
}
@keyframes fx-dusk-word {
  from { opacity: 0; filter: blur(4px); color: #f0c0a0; }
  to { opacity: 1; filter: none; }
}
@keyframes fx-abyss {
  from { opacity: 0; filter: brightness(0.12) blur(10px); transform: scale(1.14); }
  to { opacity: 1; filter: brightness(0.92) contrast(1.05); transform: scale(1); }
}
@keyframes fx-shaft {
  from { opacity: 0; transform: rotate(8deg) translateY(12%); }
  to { opacity: 1; transform: rotate(8deg) translateY(0); }
}
@keyframes fx-bubble {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-46vh) scale(1.15); }
}
@keyframes fx-star-reveal {
  from { opacity: 0; filter: brightness(1.8) blur(8px); transform: scale(1.08); }
  to { opacity: 1; filter: none; transform: scale(1); }
}
@keyframes fx-starfall {
  0% { opacity: 0; transform: translateY(-12vh); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(70vh); }
}
@keyframes fx-star-word {
  0% { opacity: 0; letter-spacing: 0.7em; filter: blur(4px); }
  100% { opacity: 1; letter-spacing: 0.28em; filter: none; }
}
@keyframes fx-moon-reveal {
  0% { opacity: 0; filter: brightness(0.2) blur(12px); transform: scale(1.12); }
  55% { opacity: 1; filter: brightness(1.2) blur(0); }
  100% { opacity: 1; filter: none; transform: scale(1); }
}
@keyframes fx-seal {
  0% { opacity: 0; transform: scale(1.85); }
  45% { opacity: 0.95; }
  100% { opacity: 0.55; transform: scale(0.92); }
}
@keyframes fx-moonflash {
  0% { opacity: 0; }
  42% { opacity: 0; }
  58% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fx-twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.3); }
}
@keyframes fx-seal-word {
  0% { opacity: 0; letter-spacing: 0.72em; filter: blur(6px); }
  100% { opacity: 1; letter-spacing: 0.28em; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .meet-welcome-live img,
  .meet-welcome-kicker,
  .meet-welcome-rare,
  .meet-welcome-lines p,
  .meet-welcome-name,
  .meet-welcome .realm-enter {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
    clip-path: none;
  }
  .meet-fx { display: none; }
}
.realm {
  position: relative;
  overflow: hidden;
  background: #07060f;
}
.realm-live {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.realm-live img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(0.94) contrast(1.04);
  transform: none;
}
.realm-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.realm-dust {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 22%, rgba(255, 236, 210, 0.55), transparent),
    radial-gradient(1px 1px at 42% 16%, rgba(220, 210, 255, 0.4), transparent),
    radial-gradient(1.6px 1.6px at 70% 28%, rgba(255, 246, 230, 0.35), transparent),
    radial-gradient(1px 1px at 86% 18%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.2px 1.2px at 28% 48%, rgba(255, 230, 200, 0.3), transparent);
  animation: realm-dust 12s linear infinite;
}
.realm-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(6, 5, 14, 0.72), transparent 62%),
    linear-gradient(180deg, rgba(6, 5, 14, 0.55) 0%, transparent 24%, transparent 46%, rgba(6, 5, 14, 0.5) 72%, rgba(6, 5, 14, 0.88) 100%);
}
.realm-brand {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: calc(22px + var(--safe-top));
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  color: rgba(240, 212, 164, 0.72);
  animation: realm-brand 1.6s ease both;
}
.realm-stage {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 22%;
  min-height: 104px;
  text-align: center;
}
.realm-mark {
  margin: 0 0 12px;
  min-height: 16px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: rgba(240, 212, 164, 0.55);
  opacity: 0;
}
.realm-mark.in { animation: realm-mark 0.8s ease both; }
.realm-line {
  margin: 0 auto;
  width: 100%;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: #f7f0e6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}
.realm-line.in {
  animation: realm-line-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* 每行独立、禁止再折行，从根上消除「末行一个字」 */
.realm-line .realm-run {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
  opacity: 0;
}
.realm-line.in .realm-run {
  animation: realm-glyph 0.5s ease both;
}
.realm-line.out {
  animation: realm-line-out 0.4s ease both;
}
.realm-measure {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.03em;
}
.realm-enter {
  position: absolute;
  z-index: 3;
  left: 36px;
  right: 36px;
  bottom: calc(28px + var(--safe-bottom));
  height: 48px;
  border: 0;
  border-top: 1px solid rgba(240, 212, 164, 0.35);
  background: transparent;
  color: #f0d4a4;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.36em;
  text-indent: 0.18em;
  animation: realm-enter 0.9s ease both;
}
.realm-enter[hidden] { display: none; }
@keyframes realm-dust {
  from { transform: translateY(0); opacity: 0.7; }
  to { transform: translateY(-8%); opacity: 1; }
}
@keyframes realm-brand {
  from { opacity: 0; letter-spacing: 0.9em; }
  to { opacity: 1; letter-spacing: 0.62em; }
}
@keyframes realm-mark {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes realm-line-in {
  from { opacity: 0.35; transform: translateY(6px); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes realm-glyph {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes realm-line-out {
  to { opacity: 0; filter: blur(6px); transform: translateY(-8px); }
}
@keyframes realm-enter {
  from { opacity: 0; letter-spacing: 0.56em; }
  to { opacity: 1; letter-spacing: 0.36em; }
}
.phone.keyboard .cover .brand,
.phone.keyboard .cover-scene .cover-street,
.phone.keyboard .cover-scene .cover-motes,
.phone.keyboard .cover-scene .cover-rain,
.phone.keyboard .cover-scene .cover-figure {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
.phone.keyboard .cover .gate {
  bottom: calc(8px + var(--safe-bottom) + var(--kb, 0px));
  max-height: min(72%, calc(100% - 24px - var(--kb, 0px)));
  background: rgba(8, 8, 12, 0.94);
  animation: none;
}
.phone.keyboard .cover-hero {
  filter: brightness(0.55) saturate(0.85);
  animation: none;
}
.phone.keyboard .cover-scene {
  /* 背景钉死，不随键盘位移 */
  transform: none !important;
}

@keyframes hero-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.07) translate3d(-1.2%, -0.8%, 0); }
}
@keyframes figure-breathe {
  from { opacity: 0.28; transform: translate3d(0, 6px, 0) scale(1); }
  to { opacity: 0.4; transform: translate3d(-1.5%, -4px, 0) scale(1.03); }
}
@keyframes fog-drift {
  from { opacity: 0.85; transform: translateX(0); }
  to { opacity: 1; transform: translateX(2%); }
}
@keyframes rain-fall {
  from { transform: translateY(-8%); }
  to { transform: translateY(8%); }
}
@keyframes lamp-pulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}
@keyframes flare-twinkle {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  40% { opacity: 0.9; transform: scale(1.08); }
  70% { opacity: 0.55; transform: scale(0.98); }
}
@keyframes mote-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(1%, -2.2%, 0); }
}
@keyframes cover-rise {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mark-shimmer {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}
@keyframes line-glow {
  from { opacity: 0.45; width: 36px; }
  to { opacity: 1; width: 64px; }
}
@keyframes cta-pulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 240, 220, 0.22), 0 0 0 rgba(239, 210, 168, 0); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 240, 220, 0.28), 0 0 22px rgba(239, 210, 168, 0.18); }
}
@keyframes cta-sheen {
  0%, 55% { transform: translateX(-130%); }
  75%, 100% { transform: translateX(130%); }
}
@media (prefers-reduced-motion: reduce) {
  .cover-hero,
  .cover-figure,
  .cover-fog,
  .cover-rain,
  .cover-motes,
  .cover-street .glow,
  .cover-street .flare,
  .cover .brand,
  .cover .brand .mark,
  .cover .brand::after,
  .cover .gate,
  .cover .primary,
  .cover .primary::before {
    animation: none !important;
  }
}
.cover-mark { letter-spacing: 0.42em; font-size: 12px; color: var(--warm); }
.lede { margin: 14px 0 28px; color: var(--dim); line-height: 1.7; font-size: 15px; }
.field {
  width: 100%;
  height: 48px;
  margin-top: 10px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  outline: none;
  border-radius: 0;
}
.rowline { display: flex; gap: 8px; align-items: center; }
.rowline .field { flex: 1; }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--warm);
  height: 48px;
  margin-top: 10px;
  white-space: nowrap;
  letter-spacing: 0.08em;
}
.text-btn.block { width: 100%; margin-top: 4px; }
#lamp-use {
  height: 48px;
  margin-top: 8px;
  border: 1px solid rgba(232, 210, 168, 0.45);
  background: rgba(232, 210, 168, 0.12);
  color: #f0d4a4;
  letter-spacing: 0.28em;
  font-family: var(--serif);
  font-size: 15px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 16px 0;
  color: var(--dim);
  font-size: 13px;
}
.primary {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 2px;
  background: var(--warm);
  color: #1a140e;
  font-size: 15px;
  letter-spacing: 0.18em;
}
.fine { min-height: 18px; margin-top: 8px; color: var(--faint); font-size: 12px; }
.error { min-height: 18px; margin-top: 8px; color: var(--warm); font-size: 13px; }

.page { flex: 1; overflow: auto; padding: 4px 20px 8px; scrollbar-width: none; }
.page::-webkit-scrollbar { display: none; }

.book.paper {
  background: #f4efe6;
  color: #2a241c;
  --ink: #2a241c;
  --dim: rgba(42, 36, 28, 0.62);
  --faint: rgba(42, 36, 28, 0.42);
  --rule: rgba(42, 36, 28, 0.12);
  --warm: #8a5a3c;
}
.book.paper .thread { position: relative; z-index: 1; }
.book.stage {
  background-color: #100e14;
  color: #fff;
  font-family: var(--sans);
}
.live {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: #100e14;
  /* 键盘时也不位移、不缩放；始终铺满外壳 */
  transform: none !important;
}
.live img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  transform: scale(1.05);
  animation: drift 14s ease-in-out infinite alternate;
  will-change: transform;
}
.phone.keyboard .live img {
  /* 输入时停漂移动效，避免感觉背景在动 */
  animation: none;
  transform: scale(1.05);
}
.live img.file-motion { animation: none; transform: none; }
.live::after {
  content: "";
  position: absolute;
  inset: -30% 0;
  background: repeating-linear-gradient(
    105deg,
    transparent 0 18px,
    rgba(255, 255, 255, 0.04) 18px 19px
  );
  animation: rain 1.1s linear infinite;
  opacity: 0.5;
}
@keyframes drift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-2%, -1.2%, 0); }
}
@keyframes rain {
  from { transform: translateY(-8%); }
  to { transform: translateY(8%); }
}
.book.stage.awaken .live img,
.book.stage.awaken .live img.file-motion {
  animation: wake 1.65s cubic-bezier(0.16, 0.84, 0.24, 1) both;
}
.book.stage.awaken .thread { animation: none; }
.book.stage.awaken::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 40%, rgba(255, 236, 214, 0.92) 50%, transparent 60%);
  animation: slit 0.8s ease both;
}
@keyframes wake {
  0% { transform: scale(1.24); filter: blur(18px) brightness(0.2); }
  42% { filter: blur(0) brightness(1.45); }
  100% { transform: scale(1.05); filter: none; }
}
@keyframes slit {
  0% { transform: scaleX(0.04); opacity: 1; }
  100% { transform: scaleX(7); opacity: 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
.veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.book.stage .veil {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0) 16%,
    rgba(0, 0, 0, 0) 44%,
    rgba(12, 10, 16, 0.55) 66%,
    rgba(12, 10, 16, 0.92) 100%
  );
}
.book.paper .bar img,
.book.paper .avatar { display: none; }
.book.stage .paper-only { display: none; }
.who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.who-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.who-main b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who-sub {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: rgba(246, 240, 232, 0.55);
  white-space: normal;
}
.who-sub b {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--heat, rgba(246, 240, 232, 0.8));
}
.rank-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-style: normal;
  font-size: 0;
  line-height: 0;
  color: transparent;
  background: var(--emblem) center / contain no-repeat;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}
.book.paper .rank-pill { display: none; }
.book.paper .who-sub { color: rgba(42, 36, 28, 0.45); }
.bonds {
  flex: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  letter-spacing: 0.28em;
  font-size: 12px;
  padding: 6px 2px;
}
.book.paper .bonds { color: #2a241c; }
.book.stage .bonds {
  color: rgba(246, 240, 232, 0.92);
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid rgba(214, 186, 148, 0.28);
  background: rgba(8, 6, 12, 0.35);
  letter-spacing: 0.18em;
  font-size: 11px;
  backdrop-filter: blur(10px);
}
.book.stage .bonds:active {
  border-color: rgba(214, 186, 148, 0.5);
  background: rgba(214, 186, 148, 0.1);
}
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: linear-gradient(180deg, rgba(6, 5, 10, 0.55) 0%, rgba(6, 5, 10, 0.18) 70%, transparent 100%);
}
.bar img,
.avatar {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  overflow: hidden;
}
.avatar img,
.bar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}
.book.paper .bar { align-items: flex-start; padding: calc(28px + var(--safe-top)) 26px 0; background: none; }
.book.paper .bar img { display: none; }
.book.paper .who { gap: 0; }
.book.paper .bar b {
  display: block;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
}
.book.stage .bar img,
.book.stage .avatar {
  width: 44px;
  height: 44px;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 70%, transparent);
}
.book.stage .who-main b {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.book.stage .who-sub b {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--heat, rgba(246, 240, 232, 0.8));
  text-shadow: none;
}
.book.stage .rank-pill {
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--emblem) center / contain no-repeat;
  color: transparent;
  box-shadow: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
}
.book.stage .rank-pill::before { content: none; }
.book.paper .panel { display: contents; }
.book.stage .thread {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.book.stage .panel {
  position: relative;
  width: 100%;
  margin: auto 0 0;
  padding: 10px 0 2px;
  border-radius: 0;
  border: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42));
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(46% + 100px);
  /* 整块聊天区随键盘上移；立绘层不动 */
  transform: translate3d(0, calc(-1 * var(--kb, 0px)), 0);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.phone.keyboard .book.stage .panel {
  /* 键盘态给输入条留出可视高度，避免首焦时仍贴底被挡 */
  max-height: min(62vh, calc(var(--shell-h, 100dvh) - var(--kb, 0px) - 56px));
  padding-bottom: 2px;
  transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1);
}
.book.stage.rank-n .panel {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.42));
}
.book.stage.rank-ssr .panel,
.book.stage.rank-sp .panel,
.book.stage.rank-myth .panel {
  box-shadow: none;
}
.book.stage .page {
  flex: 1 1 auto;
  height: auto;
  min-height: 120px;
  max-height: none;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 14px 4px;
}
.book.stage.overture-open .panel {
  max-height: min(68%, calc(100% - 86px));
  border-top: 0;
  box-shadow: none;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 5, 12, 0.12) 16%, rgba(6, 5, 12, 0.62) 100%);
}
.book.stage.overture-open .page {
  justify-content: flex-end;
  min-height: 220px;
  padding: 12px 22px 10px;
  gap: 0;
}
.book.stage .overture {
  width: 100%;
  padding: 6px 2px 8px;
  text-align: center;
}
.book.stage.overture-open .overture > * {
  animation: rise 0.7s ease both;
}
.book.stage.overture-open .overture > *:nth-child(1) { animation-delay: 0.04s; }
.book.stage.overture-open .overture > *:nth-child(2) { animation-delay: 0.14s; }
.book.stage.overture-open .overture > *:nth-child(3) { animation-delay: 0.24s; }
.book.stage.overture-open .overture > *:nth-child(4) { animation-delay: 0.34s; }
.book.stage.overture-open .overture > *:nth-child(5) { animation-delay: 0.5s; }
.book.stage.overture-open .overture > *:nth-child(6) { animation-delay: 0.62s; }
.book.stage .overture-scene {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.64em;
  text-indent: 0.64em;
  color: #e8d2a8;
}
.book.stage .overture-mark {
  display: block;
  width: 6px;
  height: 6px;
  margin: 0 auto 16px;
  border: 1px solid rgba(232, 210, 168, 0.7);
  transform: rotate(45deg);
}
.book.stage .overture-narration {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.08em;
  color: rgba(255, 246, 230, 0.94);
}
.book.stage .overture-rule {
  display: block;
  width: 36px;
  height: 1px;
  margin: 18px auto 16px;
  background: linear-gradient(90deg, transparent, rgba(232, 210, 168, 0.85), transparent);
}
.book.stage .overture-line {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.06em;
  color: #f3e6c8;
}
.book.stage .overture-name {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: rgba(232, 210, 168, 0.72);
}
.book.stage:not(.overture-open) .overture {
  padding: 2px 0 12px;
}
.book.stage:not(.overture-open) .overture-narration {
  font-size: 15px;
  margin-bottom: 8px;
}
.book.stage:not(.overture-open) .overture-line {
  font-size: 17px;
}
.book.stage .narration {
  margin: 0 20px;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: center;
}
.book.stage .say {
  align-self: flex-start;
  max-width: 78%;
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  background: var(--bubble, rgba(18, 16, 22, 0.72));
  border-radius: 4px 12px 12px 12px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--bubble-line, rgba(255, 255, 255, 0.06));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.book.stage.rank-ssr .say,
.book.stage.rank-sp .say,
.book.stage.rank-myth .say {
  box-shadow: 0 0 14px var(--glow), 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.book.stage.rank-myth .say { border-width: 1.5px; }
.book.stage .say + .say { margin-top: 2px; }
.book.stage .say b { display: none; }
.book.stage .say span {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  color: #fff;
}
.book.stage .gift {
  margin: 4px 36px 8px 0;
  max-width: min(78%, 280px);
  align-self: flex-start;
}
.book.stage .gift b { display: none; }
.book.stage .gift-image,
.book.stage .gift-video {
  margin: 4px 36px 8px 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(214, 186, 148, 0.22);
  background: rgba(8, 6, 12, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  flex: 0 0 auto;
  width: min(78%, 280px);
  max-width: min(78%, 280px);
}
.book.stage .gift-image img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 160px;
  object-fit: cover;
  background: #120e16;
}
.book.stage .video-inline {
  position: relative;
  display: block;
  cursor: pointer;
  background: #120e16;
}
.book.stage .video-inline video {
  display: block;
  width: 100%;
  height: auto;
  min-height: 160px;
  max-height: 280px;
  object-fit: contain;
  pointer-events: none;
  background: #120e16;
}
.book.stage .video-play-fab {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.book.stage .video-play-fab::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 16px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
}
.book.stage .gift-image figcaption,
.book.stage .gift-video figcaption {
  margin: 0;
  padding: 8px 12px 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(246, 240, 232, 0.62);
}
.book.stage .gift-voice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 36px 8px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(214, 186, 148, 0.22);
  background: rgba(18, 16, 22, 0.72);
}
.book.stage .gift-voice .voice-play {
  align-self: flex-start;
  border: 1px solid rgba(214, 186, 148, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(232, 210, 168, 0.1);
  color: #f0d4a4;
  letter-spacing: 0.18em;
  font-size: 12px;
}
.book.stage .gift-voice .voice-play:active {
  background: rgba(232, 210, 168, 0.18);
}
.book.stage .gift-voice audio { display: none; }
.book.stage .gift-voice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(246, 240, 232, 0.78);
}
.book.stage .you {
  align-self: flex-end;
  margin: 0;
  max-width: 78%;
  width: fit-content;
  padding: 8px 12px;
  background: var(--you-bg, var(--rose));
  color: #2a2114;
  border: 0;
  border-radius: 12px 4px 12px 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
}
.book.stage .write {
  margin: 4px 12px calc(10px + var(--safe-bottom));
  height: 48px;
  padding: 0 4px;
  border: 0;
  border-radius: 24px;
  background: var(--composer, rgba(14, 12, 18, 0.76));
  backdrop-filter: blur(14px);
  border: 1px solid var(--bubble-line, rgba(214, 186, 148, 0.18));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  width: auto;
}
.book.stage.rank-ssr .write,
.book.stage.rank-sp .write,
.book.stage.rank-myth .write {
  box-shadow: 0 0 16px var(--glow), 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.phone.keyboard .book.stage .page {
  height: auto;
  flex: 1 1 auto;
  min-height: 72px;
}
.book.stage .write input {
  color: #fff;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
}
.book.stage .write input::placeholder { color: rgba(255, 255, 255, 0.5); }
.book.stage .mic,
.book.stage .send { color: var(--ink, rgba(246, 240, 232, 0.88)); }
.book.stage .avatar {
  box-shadow: 0 0 0 2px var(--ink, rgba(214, 186, 148, 0.55));
}
.book.stage.rank-ssr .avatar,
.book.stage.rank-sp .avatar,
.book.stage.rank-myth .avatar {
  box-shadow: 0 0 0 2px var(--ink), 0 0 12px var(--glow);
}
.book.stage .bonds {
  border-color: var(--bubble-line, rgba(214, 186, 148, 0.35));
  color: var(--ink, rgba(246, 240, 232, 0.92));
}
.book.stage .rank-pill {
  color: transparent;
  background: var(--emblem) center / contain no-repeat;
  border: 0;
}
.write .tool {
  flex: none;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--bubble-line, rgba(214, 186, 148, 0.35));
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink, rgba(246, 240, 232, 0.88));
  font-size: 11px;
  letter-spacing: 0.08em;
}
.write .tool[hidden] { display: none; }
.mic, .send {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--warm);
  padding: 0;
}
.mic.on { color: #c4564a; }
.book.paper .page { padding: 8px 26px 12px; }
.book.paper .narration {
  margin: 18px 0;
  color: rgba(42, 36, 28, 0.62);
  font-size: 16px;
  line-height: 1.85;
  text-align: left;
}
.book.paper .say { margin: 16px 0; padding: 0; background: none; max-width: none; }
.book.paper .say span { font-size: 17px; line-height: 1.8; }
.book.paper .you {
  margin: 16px 0 16px 18%;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(42, 36, 28, 0.62);
  text-align: left;
}
.book.paper .cue { background: transparent; border: 0; padding: 0; border-radius: 0; }
.book.paper .cues {
  position: relative;
  z-index: 2;
  transform: translate3d(0, calc(-1 * var(--kb, 0px)), 0);
  transition: transform 0.12s ease-out;
  will-change: transform;
}
.book.paper .write {
  position: relative;
  z-index: 2;
  border-top-color: rgba(42, 36, 28, 0.12);
  margin: 0 18px calc(14px + var(--safe-bottom));
  transform: translate3d(0, calc(-1 * var(--kb, 0px)), 0);
  transition: transform 0.12s ease-out;
  will-change: transform;
  background: #f4efe6;
}
.phone.keyboard .book.paper .page {
  padding-bottom: calc(8px + var(--kb, 0px));
}
.phone.keyboard .book.paper .cues,
.phone.keyboard .book.paper .write {
  /* 确保动画不会盖掉顶起 */
  animation: none;
}
.narration {
  margin: 14px 12px;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}
.say { margin: 14px 48px 14px 0; }
.say b {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 500;
  color: var(--warm);
}
.say span { display: block; font-size: 16px; line-height: 1.75; }
.you {
  margin: 14px 0 14px 22%;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 16px 16px 4px 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}
.cues { display: flex; gap: 8px; overflow: auto; padding: 8px 16px 10px; }
.book.stage .cues { flex: none; padding: 0 16px 8px; }
.book.stage .cue {
  border-color: rgba(247, 240, 230, 0.28);
  background: rgba(14, 12, 18, 0.45);
  color: #f7f0e6;
}
.cue {
  border: 1px solid var(--rule);
  background: rgba(214, 186, 148, 0.08);
  color: var(--warm);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  padding: 8px 12px;
}
.write {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 18px calc(14px + var(--safe-bottom));
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.write input {
  flex: 1;
  height: 44px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
}
.write button {
  height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--warm);
  letter-spacing: 0.12em;
}

.sheet {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 4;
  display: flex;
  align-items: flex-end;
}
.slip {
  width: 100%;
  background: linear-gradient(180deg, #2a2430, #1a1620);
  color: var(--ink);
  border-radius: 16px 16px 0 0;
  padding: 22px 22px calc(18px + var(--safe-bottom));
  border-top: 1px solid rgba(214, 186, 148, 0.28);
}
.slip .cover-mark { color: var(--warm); }
.slip h2 { margin: 10px 0 0; font-size: 28px; letter-spacing: 0.12em; }
.slip > p { margin-top: 10px; color: var(--dim); line-height: 1.7; }
.pack-sheet .pack-blurb {
  margin-top: 12px;
  color: rgba(246, 240, 232, 0.72);
  line-height: 1.7;
  letter-spacing: 0.04em;
}
.unlock-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(246, 240, 232, 0.14);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: none;
}
.unlock-card.sealed {
  /* 解锁前强制中性，不继承当前角色等级色 */
  --chip: transparent;
  --glow: transparent;
  border-color: rgba(246, 240, 232, 0.12);
  background: linear-gradient(135deg, rgba(18, 15, 22, 0.92), rgba(8, 7, 12, 0.96));
}
.unlock-face {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(246, 240, 232, 0.16);
  background: #0c0a10;
  position: relative;
}
.unlock-face.sealed {
  box-shadow: 0 0 0 1px rgba(246, 240, 232, 0.12);
  background:
    radial-gradient(circle at 50% 42%, rgba(60, 54, 72, 0.55), transparent 42%),
    #0a0810;
}
.unlock-silhouette {
  position: absolute;
  inset: 18% 28% 14%;
  border-radius: 48% 48% 42% 42%;
  background: rgba(246, 240, 232, 0.06);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.55);
}
.unlock-silhouette::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -28%;
  width: 42%;
  height: 38%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(246, 240, 232, 0.07);
}
.unlock-face img { display: none; }
.unlock-meta { min-width: 0; flex: 1; }
.unlock-meta .rank-pill { display: none; }
.unlock-tease {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(246, 240, 232, 0.78);
}
.price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 18px 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.price[hidden],
.primary[hidden],
#lamp-use[hidden] { display: none !important; }
.price b small { font-size: 16px; margin-right: 2px; }

/* —— 角色主页：立绘占屏，信息沉底 —— */
.profile {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #100e14;
  color: #fff;
  font-family: var(--sans);
  overflow: hidden;
}
.profile .live img {
  object-position: center 8%;
  transform: none;
  animation: none;
}
.profile .live::after {
  opacity: 0.12;
  animation: none;
}
.profile .veil {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0) 16%,
    rgba(0, 0, 0, 0) 58%,
    rgba(12, 10, 16, 0.4) 78%,
    rgba(12, 10, 16, 0.96) 100%
  );
}
/* 四角金属线，不拉满框压脸 */
.profile .frame {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  top: calc(58px + var(--safe-top));
  bottom: 32%;
  pointer-events: none;
  border: 0;
  box-shadow: none;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 26px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 2px 26px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 26px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 2px 26px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 26px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 2px 26px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 26px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 2px 26px no-repeat;
  filter: drop-shadow(0 0 12px var(--glow));
  opacity: 0.95;
}
.profile.rank-n .frame,
.profile.rank-r .frame {
  background-size: 24px 1.5px, 1.5px 24px, 24px 1.5px, 1.5px 24px, 24px 1.5px, 1.5px 24px, 24px 1.5px, 1.5px 24px;
  opacity: 0.9;
}
.profile.rank-ssr .frame,
.profile.rank-sp .frame {
  background-size: 28px 2.5px, 2.5px 28px, 28px 2.5px, 2.5px 28px, 28px 2.5px, 2.5px 28px, 28px 2.5px, 2.5px 28px;
}
.profile.rank-myth .frame {
  background-size: 32px 3px, 3px 32px, 32px 3px, 3px 32px, 32px 3px, 3px 32px, 32px 3px, 3px 32px;
  filter: drop-shadow(0 0 18px var(--glow));
}
.profile .back {
  position: absolute;
  z-index: 3;
  top: calc(8px + var(--safe-top));
  left: 6px;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 0;
  background: transparent;
  color: #fff;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
}
.rank-float {
  position: absolute;
  z-index: 3;
  top: calc(14px + var(--safe-top));
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  color: var(--chip-fg);
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}
.rank-float b {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-size: 0;
  line-height: 0;
  color: transparent;
  background: var(--emblem) center / contain no-repeat;
}
.rank-float span {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(246, 240, 232, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
.profile-body {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 48%;
  overflow: auto;
  scrollbar-width: none;
  padding: 20px 22px calc(16px + var(--safe-bottom));
  background: linear-gradient(
    180deg,
    rgba(16, 14, 20, 0) 0%,
    rgba(16, 14, 20, 0.5) 18%,
    #100e14 44%
  );
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--chip-solid) 35%, transparent);
}
.profile-body::-webkit-scrollbar { display: none; }
.profile-body .standing {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.profile-body .rarity-line {
  margin: 6px 0 0;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--ink);
}
.profile-body h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}
.profile.rank-ssr .profile-body h2,
.profile.rank-myth .profile-body h2 { color: var(--ink); }
.profile-body .line {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}
.bond-next {
  margin-top: 12px;
  padding: 10px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--chip-solid) 40%, transparent);
}
.bond-next-now {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(246, 240, 232, 0.72);
}
.bond-next-now b {
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--heat, #f0d4a4);
}
.bond-next-target {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.18em;
  color: #f7f0e6;
}
.bond-next-need {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.65;
  color: rgba(246, 240, 232, 0.62);
}
.profile-blocks {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--chip-solid) 48%, transparent);
}
.profile-blocks section + section { margin-top: 10px; }
.profile-blocks h3 {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--ink);
}
.profile-blocks p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(246, 240, 232, 0.86);
}
.companion-tools {
  display: flex;
  gap: 8px;
  margin: 0 12px 6px;
}
.tool-chip {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(214, 186, 148, 0.28);
  background: rgba(14, 12, 18, 0.45);
  color: rgba(246, 240, 232, 0.78);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.tool-chip.on {
  color: #f0d4a4;
  border-color: rgba(240, 212, 164, 0.55);
}
.book.whisper .write {
  border-color: rgba(240, 212, 164, 0.35);
}
.dream-choice {
  margin: 0 12px 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(14, 12, 18, 0.62);
  border: 1px solid rgba(214, 186, 148, 0.22);
}
.dream-choice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(247, 240, 230, 0.9);
}
.dream-choice div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.dream-choice button {
  flex: 1;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(214, 186, 148, 0.28);
  background: transparent;
  color: #f7f0e6;
  font: inherit;
  font-size: 13px;
}
.book.stage .panel:has(.dream-choice) {
  max-height: calc(62% + 40px);
}
.echo-sheet {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: rgba(12, 10, 16, 0.94);
  color: #f7f0e6;
}
.echo-sheet .back {
  position: absolute;
  top: calc(12px + var(--safe-top, 0px));
  left: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #f7f0e6;
}
.echo-body {
  margin-top: 64px;
  padding: 8px 22px 24px;
  overflow: auto;
}
.echo-body h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.18em;
}
.echo-lead,
.echo-empty {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(246, 240, 232, 0.62);
}
.echo-line {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(214, 186, 148, 0.16);
}
.echo-line p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
}
.echo-line .voice-play {
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(214, 186, 148, 0.35);
  background: transparent;
  color: #f0d4a4;
  font: inherit;
  font-size: 13px;
}
body.photo-open {
  overflow: hidden;
}
.book.stage .gift-image img {
  cursor: pointer;
  -webkit-touch-callout: none;
  user-select: none;
}
/* 微信式全屏看图 / 看片 */
.wx-media-view {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #000;
}
.wx-media-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.wx-media-photo,
.wx-media-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
.wx-media-view.is-video .wx-media-stage {
  padding-bottom: calc(52px + env(safe-area-inset-bottom));
}
.wx-media-top,
.wx-media-bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.wx-media-top {
  top: 0;
  display: flex;
  align-items: flex-start;
  padding: calc(6px + env(safe-area-inset-top)) 4px 28px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}
.wx-media-back {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
}
.wx-media-bar {
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), transparent);
}
.wx-media-play {
  pointer-events: auto;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  position: relative;
}
.wx-media-play.is-paused::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #fff;
}
.wx-media-play:not(.is-paused)::before,
.wx-media-play:not(.is-paused)::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 4px;
  height: 16px;
  border-radius: 1px;
  background: #fff;
}
.wx-media-play:not(.is-paused)::before {
  left: 10px;
}
.wx-media-play:not(.is-paused)::after {
  left: 18px;
}
.wx-media-seek {
  pointer-events: auto;
  flex: 1;
  height: 3px;
  margin: 0;
  accent-color: #fff;
  background: transparent;
}
.wx-media-time {
  pointer-events: none;
  flex: 0 0 auto;
  min-width: 72px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.wx-media-view.chrome-hidden .wx-media-top,
.wx-media-view.chrome-hidden .wx-media-bar {
  opacity: 0;
  pointer-events: none;
}
.photo-sheet {
  position: fixed;
  inset: 0;
  z-index: 121;
}
.photo-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
}
.wx-sheet-wrap {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  animation: wx-sheet-up 0.22s ease-out;
}
.wx-sheet-group {
  overflow: hidden;
  border-radius: 12px;
  background: rgba(44, 44, 46, 0.98);
}
.wx-sheet-btn {
  display: block;
  width: 100%;
  height: 56px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 17px;
}
.wx-sheet-group .wx-sheet-btn:first-child {
  border-top: 0;
}
.wx-sheet-cancel {
  margin-top: 8px;
  border-radius: 12px;
  border: 0;
  background: rgba(44, 44, 46, 0.98);
  color: #fff;
  font-weight: 500;
}
@keyframes wx-sheet-up {
  from {
    transform: translateY(100%);
    opacity: 0.55;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
