/* ============================================================
   红色年轮 · 数字馆入口
   主色：中国红 / 朱砂红 / 宣纸白 / 墨黑
   ============================================================ */

[hidden] {
  display: none !important;
}

:root {
  --red: #c8102e;
  --red-deep: #8c1c13;
  --red-cinnabar: #9e1b32;
  --red-pomegranate: #e63946;
  --paper: #f5efe6;
  --paper-warm: #ede3d4;
  --ink: #0e0b0b;
  --ink-soft: #181315;
  --ink-panel: #21191b;
  --white: #fffaf5;
  --line: rgba(245, 239, 230, 0.14);
  --portal-serif: "Songti SC", "STSong", "SimSun", serif;
  --portal-kai: "Kaiti SC", "STKaiti", "KaiTi", serif;
  --portal-sans: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

body.portal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  color: var(--white);
  background: var(--red);
}

.portal-home {
  position: fixed;
  inset: 0;
  z-index: 3000;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--paper);
  background:
    radial-gradient(900px 620px at 78% 12%, rgba(200, 16, 46, 0.22), transparent 62%),
    radial-gradient(700px 520px at 10% 72%, rgba(158, 27, 50, 0.13), transparent 70%),
    linear-gradient(128deg, rgba(255, 255, 255, 0.025), transparent 32%),
    #0e0b0b;
  scrollbar-color: rgba(200, 16, 46, 0.7) #0e0b0b;
}

.portal-home::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(245, 239, 230, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 239, 230, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.portal-home::after {
  position: fixed;
  inset: 0;
  z-index: 9;
  opacity: 0.08;
  background-image: repeating-linear-gradient(
    92deg,
    transparent 0 2px,
    rgba(255, 255, 255, 0.09) 2px 3px,
    transparent 3px 7px
  );
  content: "";
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.portal-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.portal-atmosphere i {
  position: absolute;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(200, 16, 46, 0.16);
  border-radius: 50%;
  animation: portalDrift 19s linear infinite;
}

.portal-atmosphere i:nth-child(1) {
  top: 12%;
  right: 4%;
}

.portal-atmosphere i:nth-child(2) {
  right: 22%;
  bottom: -19%;
  width: 620px;
  height: 620px;
  animation-direction: reverse;
  animation-duration: 28s;
}

.portal-atmosphere i:nth-child(3) {
  bottom: 19%;
  left: -12%;
  width: 440px;
  height: 440px;
  border-style: dashed;
  animation-duration: 34s;
}

@keyframes portalDrift {
  to { transform: rotate(360deg); }
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1480px, calc(100% - 72px));
  min-height: 88px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 11, 11, 0.84);
  backdrop-filter: blur(14px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.portal-emblem {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: #ffe9e7;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(200, 16, 46, 0.13);
  font-size: 20px;
  transform: rotate(-5deg);
}

.portal-brand > span:last-child {
  display: grid;
  line-height: 1.1;
}

.portal-brand strong {
  font-family: var(--portal-kai);
  font-size: 22px;
  letter-spacing: 0.12em;
}

.portal-brand small {
  margin-top: 7px;
  color: rgba(245, 239, 230, 0.54);
  font-family: var(--portal-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.portal-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 30px;
}

.portal-nav button {
  position: relative;
  border: 0;
  color: rgba(245, 239, 230, 0.7);
  background: transparent;
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: color 180ms ease;
}

.portal-nav button::after {
  position: absolute;
  right: 50%;
  bottom: 0;
  left: 50%;
  height: 2px;
  background: var(--red);
  content: "";
  transition: inset 180ms ease;
}

.portal-nav button:hover {
  color: var(--white);
}

.portal-nav button:hover::after {
  right: 0;
  left: 0;
}

.portal-user-zone {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.portal-directory-btn,
.portal-user-chip {
  border: 1px solid rgba(245, 239, 230, 0.16);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.portal-directory-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 15px;
  font-size: 13px;
}

.portal-directory-btn:hover,
.portal-user-chip:hover {
  border-color: rgba(230, 57, 70, 0.65);
  background: rgba(200, 16, 46, 0.12);
  transform: translateY(-1px);
}

.portal-user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 136px;
  height: 46px;
  padding: 4px 12px 4px 5px;
  text-align: left;
}

.portal-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--white);
  background: var(--red-deep);
  font-family: var(--portal-kai);
  font-size: 16px;
  border-radius: 50%;
}

.portal-user-chip > span:last-child {
  display: grid;
}

.portal-user-chip small {
  color: rgba(245, 239, 230, 0.48);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.portal-user-chip strong {
  overflow: hidden;
  max-width: 94px;
  margin-top: 2px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-main {
  width: min(1480px, calc(100% - 72px));
  margin: 0 auto;
}

.portal-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(530px, 0.9fr) minmax(520px, 1.1fr);
  align-items: center;
  min-height: calc(100vh - 88px);
  padding: 72px 2vw 92px;
}

.portal-hero-copy {
  position: relative;
  z-index: 3;
}

.portal-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  color: rgba(245, 239, 230, 0.65);
  font-size: 12px;
  letter-spacing: 0.15em;
}

.portal-eyebrow span {
  width: 36px;
  height: 1px;
  background: var(--red);
  box-shadow: 12px 0 0 rgba(200, 16, 46, 0.25);
}

.portal-hero h1 {
  margin: 0;
  font-family: var(--portal-kai);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.portal-hero h1 span,
.portal-hero h1 em {
  display: inline-block;
  color: var(--paper);
  font-size: clamp(55px, 6.4vw, 104px);
  font-style: normal;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.48);
}

.portal-hero h1 strong,
.portal-hero h1 b {
  display: inline-block;
  margin-left: 0.22em;
  color: var(--red);
  font-size: clamp(55px, 6.4vw, 104px);
  font-weight: 400;
  text-shadow: 0 8px 36px rgba(200, 16, 46, 0.25);
}

.portal-hero h1 em {
  margin-top: 11px;
}

.portal-hero h1 b {
  position: relative;
}

.portal-hero h1 b::after {
  position: absolute;
  right: 0;
  bottom: -10px;
  width: 98%;
  height: 5px;
  background: linear-gradient(90deg, var(--red), transparent);
  content: "";
  transform: rotate(-1.8deg);
}

.portal-lead {
  max-width: 640px;
  margin: 40px 0 0;
  color: rgba(245, 239, 230, 0.67);
  font-family: var(--portal-serif);
  font-size: 17px;
  line-height: 2;
  letter-spacing: 0.04em;
}

.portal-hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 38px;
}

.portal-primary,
.portal-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 54px;
  padding: 0 23px;
  overflow: hidden;
  border: 1px solid transparent;
  font-size: 14px;
  letter-spacing: 0.05em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.portal-primary {
  color: var(--white);
  background: var(--red);
  box-shadow: 0 12px 24px rgba(140, 28, 19, 0.23);
}

.portal-primary::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.17) 47%, transparent 66%);
  content: "";
  transform: translateX(-110%);
  transition: transform 480ms ease;
}

.portal-primary:hover::before {
  transform: translateX(110%);
}

.portal-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 17px 34px rgba(200, 16, 46, 0.28);
}

.portal-primary i,
.portal-primary span,
.portal-primary > span {
  position: relative;
}

.portal-secondary {
  color: rgba(245, 239, 230, 0.84);
  border-color: rgba(245, 239, 230, 0.22);
  background: rgba(255, 255, 255, 0.025);
}

.portal-secondary:hover {
  color: var(--white);
  border-color: rgba(230, 57, 70, 0.7);
  background: rgba(200, 16, 46, 0.08);
  transform: translateY(-2px);
}

.portal-facts {
  display: flex;
  gap: 0;
  margin: 52px 0 0;
}

.portal-facts div {
  min-width: 112px;
  padding: 0 24px;
  border-left: 1px solid rgba(245, 239, 230, 0.14);
}

.portal-facts div:first-child {
  padding-left: 0;
  border-left: 0;
}

.portal-facts dt {
  color: var(--paper);
  font-family: var(--portal-serif);
  font-size: 27px;
  line-height: 1;
}

.portal-facts dd {
  margin: 8px 0 0;
  color: rgba(245, 239, 230, 0.42);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.portal-hero-art {
  position: relative;
  display: grid;
  min-height: 650px;
  place-items: center;
  perspective: 1200px;
}

.portal-hero-art::before {
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.2), rgba(200, 16, 46, 0.03) 46%, transparent 68%);
  content: "";
  filter: blur(10px);
}

.portal-hero-art::after {
  position: absolute;
  bottom: 14%;
  width: 52%;
  height: 10%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  content: "";
  filter: blur(26px);
}

.orbit {
  position: absolute;
  width: min(43vw, 600px);
  aspect-ratio: 1;
  border: 1px solid rgba(245, 239, 230, 0.14);
  border-radius: 50%;
  transform: rotateX(66deg) rotateZ(-12deg);
  box-shadow: inset 0 0 60px rgba(200, 16, 46, 0.04);
  animation: orbitSpin 20s linear infinite;
}

.orbit::before {
  position: absolute;
  top: 49.5%;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-pomegranate);
  box-shadow: 0 0 15px var(--red);
  content: "";
}

.orbit-one {
  width: min(37vw, 520px);
  border-color: rgba(200, 16, 46, 0.38);
}

.orbit-two {
  width: min(47vw, 660px);
  animation-duration: 34s;
  animation-direction: reverse;
}

.orbit-three {
  width: min(55vw, 760px);
  border-style: dashed;
  opacity: 0.52;
  animation-duration: 48s;
}

@keyframes orbitSpin {
  to { transform: rotateX(66deg) rotateZ(348deg); }
}

.portal-star-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(24vw, 320px);
  aspect-ratio: 1;
  place-items: center;
  transform-style: preserve-3d;
  animation: starBreathe 5s ease-in-out infinite;
}

@keyframes starBreathe {
  0%, 100% { transform: translateY(0) rotateZ(-2deg) scale(1); }
  50% { transform: translateY(-13px) rotateZ(1deg) scale(1.035); }
}

.portal-star {
  position: relative;
  z-index: 2;
  color: var(--red);
  font-size: clamp(150px, 17vw, 270px);
  line-height: 1;
  filter: drop-shadow(0 0 28px rgba(200, 16, 46, 0.38));
  transform: rotate(-8deg);
}

.portal-star-shadow {
  position: absolute;
  color: rgba(140, 28, 19, 0.45);
  font-size: clamp(150px, 17vw, 270px);
  line-height: 1;
  transform: translate(14px, 15px) rotate(-8deg);
  filter: blur(2px);
}

.orbit-label {
  position: absolute;
  z-index: 3;
  padding: 5px 9px;
  color: rgba(245, 239, 230, 0.68);
  border: 1px solid rgba(245, 239, 230, 0.13);
  background: rgba(14, 11, 11, 0.7);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.label-one { top: 22%; left: 15%; }
.label-two { right: 11%; bottom: 29%; }
.label-three { bottom: 16%; left: 22%; }

.portal-art-caption {
  position: absolute;
  right: 1%;
  bottom: 14%;
  z-index: 4;
  display: grid;
  padding-left: 17px;
  border-left: 2px solid var(--red);
  text-align: right;
}

.portal-art-caption span {
  color: rgba(245, 239, 230, 0.43);
  font-size: 10px;
  letter-spacing: 0.3em;
}

.portal-art-caption strong {
  margin-top: 6px;
  color: var(--paper);
  font-family: var(--portal-kai);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.17em;
}

.portal-scroll-hint {
  position: absolute;
  bottom: 25px;
  left: 2vw;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  color: rgba(245, 239, 230, 0.38);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.portal-scroll-hint i {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(245, 239, 230, 0.15);
  border-radius: 50%;
}

.portal-scroll-hint i::after {
  position: absolute;
  top: 9px;
  left: 15px;
  width: 4px;
  height: 8px;
  border-right: 1px solid var(--red);
  border-bottom: 1px solid var(--red);
  content: "";
  transform: rotate(45deg);
  animation: scrollNudge 1.8s ease-in-out infinite;
}

@keyframes scrollNudge {
  50% { transform: translateY(5px) rotate(45deg); }
}

/* 历史影像墙：参考展陈式深红织锦与错落相框 */
.memory-gallery-section {
  position: relative;
  margin: 0 -2vw;
  padding: 88px max(4vw, 36px) 96px;
  overflow: hidden;
  border-top: 1px solid rgba(245, 239, 230, 0.12);
  border-bottom: 1px solid rgba(245, 239, 230, 0.12);
  background:
    radial-gradient(circle at 50% 4%, rgba(255, 199, 169, 0.08), transparent 27%),
    radial-gradient(ellipse at 50% 110%, rgba(32, 4, 9, 0.72), transparent 60%),
    repeating-radial-gradient(circle at 0 0, transparent 0 23px, rgba(245, 220, 203, 0.025) 24px 25px),
    linear-gradient(115deg, rgba(85, 5, 18, 0.94), rgba(115, 12, 29, 0.93) 44%, rgba(67, 5, 16, 0.98));
}

.memory-gallery-section::before,
.memory-gallery-section::after {
  position: absolute;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(245, 219, 204, 0.06);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.memory-gallery-section::before {
  top: 37px;
  left: -172px;
  box-shadow:
    0 0 0 26px rgba(245, 219, 204, 0.012),
    0 0 0 54px rgba(245, 219, 204, 0.01),
    0 0 0 82px rgba(245, 219, 204, 0.008);
}

.memory-gallery-section::after {
  right: -150px;
  bottom: -130px;
  box-shadow:
    0 0 0 34px rgba(245, 219, 204, 0.012),
    0 0 0 70px rgba(245, 219, 204, 0.009);
}

.memory-gallery-head {
  position: relative;
  z-index: 2;
  max-width: 1480px;
  margin: 0 auto;
  text-align: center;
}

.memory-gallery-head p {
  margin: 0;
  color: rgba(255, 226, 216, 0.43);
  font-size: 9px;
  letter-spacing: 0.23em;
}

.memory-gallery-head h2 {
  margin: 12px 0 8px;
  color: #fff4eb;
  font-family: var(--portal-kai);
  font-size: clamp(37px, 4vw, 60px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-shadow: 0 5px 34px rgba(0, 0, 0, 0.48);
}

.memory-gallery-head > span {
  color: rgba(255, 232, 221, 0.36);
  font-family: var(--portal-serif);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.memory-gallery-wall {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 0.78fr 1.12fr 0.86fr 1.08fr 0.74fr;
  align-items: center;
  gap: 13px;
  width: min(1450px, 100%);
  min-height: 470px;
  margin: 34px auto 0;
  padding: 0 12px;
}

.memory-frame {
  position: relative;
  margin: 0;
  padding: 9px;
  background: #f3ece2;
  box-shadow:
    0 3px 0 rgba(48, 20, 17, 0.38),
    0 22px 42px rgba(28, 4, 8, 0.48);
  transition: transform 320ms cubic-bezier(0.18, 0.75, 0.23, 1), box-shadow 320ms ease;
}

.memory-frame::before {
  position: absolute;
  inset: 9px;
  z-index: 1;
  border: 1px solid rgba(255, 243, 232, 0.26);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.08), transparent 40%, rgba(73, 2, 12, 0.15));
  content: "";
  pointer-events: none;
}

.memory-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.35) saturate(0.66) contrast(1.08) brightness(0.84);
}

.memory-frame figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  padding: 0 4px;
  color: #4d2522;
  background: #f3ece2;
  font-family: var(--portal-serif);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.memory-frame figcaption::after {
  color: var(--red-deep);
  font-size: 10px;
  content: "◆";
}

.frame-one {
  height: 276px;
  transform: translateY(20px) rotate(-2.3deg);
}

.frame-two {
  height: 376px;
  transform: translateY(-19px) rotate(0.7deg);
}

.frame-three {
  height: 326px;
  transform: translateY(17px) rotate(-1.2deg);
}

.frame-four {
  height: 390px;
  transform: translateY(-23px) rotate(1.4deg);
}

.frame-five {
  height: 260px;
  transform: translateY(28px) rotate(2.2deg);
}

.frame-one:hover,
.frame-three:hover,
.frame-five:hover {
  z-index: 3;
  box-shadow: 0 5px 0 rgba(48, 20, 17, 0.3), 0 35px 58px rgba(22, 2, 6, 0.6);
  transform: translateY(-3px) rotate(0deg) scale(1.035);
}

.frame-two:hover,
.frame-four:hover {
  z-index: 3;
  box-shadow: 0 5px 0 rgba(48, 20, 17, 0.3), 0 35px 58px rgba(22, 2, 6, 0.6);
  transform: translateY(-8px) rotate(0deg) scale(1.025);
}

.memory-story-card {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 34px;
  width: min(980px, 88%);
  margin: -12px auto 0;
  padding: 28px 32px 28px 42px;
  color: #321c1a;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 47%),
    #f6efe6;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 -18px 34px rgba(125, 85, 67, 0.04),
    0 5px 0 rgba(64, 27, 25, 0.24),
    0 20px 50px rgba(25, 3, 8, 0.38);
}

.memory-story-card::before {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(128, 61, 52, 0.16);
  content: "";
  pointer-events: none;
}

.story-stamp {
  position: absolute;
  top: -22px;
  left: 30px;
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  color: #fff5ec;
  border: 1px solid rgba(255, 235, 225, 0.34);
  background: #a4161a;
  font-family: var(--portal-kai);
  font-size: 22px;
  box-shadow: 0 5px 15px rgba(58, 2, 10, 0.4);
  transform: rotate(-4deg);
}

.memory-story-card p {
  margin: 0;
  color: rgba(77, 39, 34, 0.66);
  font-family: var(--portal-serif);
  font-size: 11px;
  line-height: 1.85;
}

.memory-story-card h3 {
  margin: 6px 0 8px;
  font-family: var(--portal-kai);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.memory-story-card button {
  min-width: 145px;
  height: 42px;
  border: 0;
  color: #fff7f1;
  background: #8c1c13;
  font-size: 11px;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 0 #54100b;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.memory-story-card button:hover {
  box-shadow: 0 7px 0 #54100b;
  transform: translateY(-3px);
}

.portal-exhibitions,
.red-thread-section {
  padding: 100px 2vw 110px;
  border-top: 1px solid var(--line);
}

.portal-section-head {
  display: grid;
  grid-template-columns: minmax(440px, 0.9fr) minmax(340px, 0.65fr);
  align-items: end;
  gap: 40px;
  margin-bottom: 48px;
}

.portal-section-head p {
  margin: 0 0 14px;
  color: rgba(230, 57, 70, 0.9);
  font-family: var(--portal-sans);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.portal-section-head h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--portal-kai);
  font-size: clamp(33px, 3.4vw, 54px);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.portal-section-head > p {
  justify-self: end;
  max-width: 560px;
  margin-bottom: 5px;
  color: rgba(245, 239, 230, 0.46);
  font-family: var(--portal-serif);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.03em;
}

.exhibition-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.exhibition-card {
  position: relative;
  display: flex;
  min-height: 320px;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 27px;
  overflow: hidden;
  border: 1px solid rgba(245, 239, 230, 0.14);
  color: var(--paper);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 42%),
    #171214;
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 240ms ease, border-color 240ms ease, background 240ms ease, box-shadow 240ms ease;
}

.exhibition-card::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(360px 260px at 20% 15%, rgba(200, 16, 46, 0.16), transparent 72%);
  content: "";
  opacity: 0;
  transition: opacity 260ms ease;
}

.exhibition-card::after {
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(200, 16, 46, 0.16);
  border-radius: 50%;
  content: "";
  transition: transform 500ms ease;
}

.exhibition-card:hover {
  z-index: 2;
  border-color: rgba(230, 57, 70, 0.55);
  background:
    linear-gradient(145deg, rgba(200, 16, 46, 0.12), transparent 52%),
    #1a1315;
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.34);
  transform: translateY(-6px);
}

.exhibition-card:hover::before {
  opacity: 1;
}

.exhibition-card:hover::after {
  transform: scale(1.22);
}

.exhibition-sand,
.exhibition-stars {
  grid-column: span 6;
  min-height: 390px;
}

.exhibition-chronicle,
.exhibition-archive {
  grid-column: span 6;
  min-height: 300px;
}

.exhibition-spirit,
.exhibition-study,
.exhibition-today {
  grid-column: span 4;
  min-height: 285px;
}

.exhibition-sand {
  background:
    linear-gradient(90deg, rgba(14, 11, 11, 0.97), rgba(14, 11, 11, 0.46)),
    repeating-linear-gradient(66deg, transparent 0 30px, rgba(200, 16, 46, 0.06) 31px 32px),
    #201318;
}

.exhibition-sand::after {
  right: 2%;
  bottom: -18%;
  width: 360px;
  height: 240px;
  border-color: transparent;
  border-top-color: rgba(200, 16, 46, 0.42);
  border-bottom-color: rgba(245, 239, 230, 0.12);
  border-radius: 50%;
  transform: rotate(-14deg) skewX(-18deg);
}

.exhibition-stars {
  background:
    radial-gradient(1px 1px at 22% 22%, #fff 0 1px, transparent 1.5px),
    radial-gradient(1px 1px at 68% 35%, #fff 0 1px, transparent 1.5px),
    radial-gradient(1px 1px at 80% 72%, #ffd7db 0 1px, transparent 1.5px),
    radial-gradient(1px 1px at 35% 78%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 30%, rgba(200, 16, 46, 0.27), transparent 44%),
    #120d10;
}

.exhibition-chronicle {
  background:
    linear-gradient(100deg, rgba(14, 11, 11, 0.94), rgba(14, 11, 11, 0.55)),
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(245, 239, 230, 0.06) 22px),
    #211416;
}

.exhibition-archive {
  background:
    linear-gradient(105deg, rgba(14, 11, 11, 0.94), rgba(14, 11, 11, 0.62)),
    repeating-linear-gradient(90deg, transparent 0 80px, rgba(245, 239, 230, 0.05) 81px),
    #181113;
}

.exhibition-spirit {
  background:
    radial-gradient(circle at 82% 83%, rgba(230, 57, 70, 0.17), transparent 34%),
    linear-gradient(145deg, #171012, #100c0d);
}

.exhibition-study {
  background:
    linear-gradient(145deg, rgba(200, 16, 46, 0.12), transparent 58%),
    #171112;
}

.exhibition-today {
  background:
    linear-gradient(145deg, rgba(245, 239, 230, 0.055), transparent 52%),
    #171214;
}

.card-number {
  position: absolute;
  top: 22px;
  right: 24px;
  color: rgba(245, 239, 230, 0.16);
  font-family: var(--portal-serif);
  font-size: 41px;
  line-height: 1;
}

.card-seal {
  position: absolute;
  right: 28px;
  bottom: 27px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: rgba(245, 239, 230, 0.47);
  border: 1px solid rgba(200, 16, 46, 0.42);
  font-family: var(--portal-kai);
  font-size: 17px;
  writing-mode: vertical-rl;
  letter-spacing: 0.08em;
  transform: rotate(2deg);
}

.card-kicker {
  position: relative;
  z-index: 2;
  color: rgba(230, 57, 70, 0.88);
  font-size: 10px;
  letter-spacing: 0.19em;
}

.exhibition-card > strong {
  position: relative;
  z-index: 2;
  max-width: 75%;
  margin-top: 42px;
  color: var(--paper);
  font-family: var(--portal-kai);
  font-size: clamp(27px, 2.55vw, 40px);
  font-weight: 400;
  line-height: 1.28;
}

.exhibition-card:not(.exhibition-sand):not(.exhibition-stars) > strong {
  margin-top: 32px;
  font-size: clamp(24px, 2.05vw, 33px);
}

.card-desc {
  position: relative;
  z-index: 2;
  max-width: 76%;
  margin-top: 17px;
  color: rgba(245, 239, 230, 0.48);
  font-family: var(--portal-serif);
  font-size: 13px;
  line-height: 1.85;
}

.card-enter {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
  color: rgba(245, 239, 230, 0.76);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.card-enter i {
  color: var(--red-pomegranate);
  font-style: normal;
  transition: transform 180ms ease;
}

.exhibition-card:hover .card-enter i {
  transform: translate(4px, -4px);
}

.card-gallery {
  position: absolute;
  right: 18px;
  bottom: 54px;
  display: flex;
  align-items: end;
  gap: 7px;
  pointer-events: none;
}

.card-gallery img {
  display: block;
  width: 86px;
  height: 120px;
  object-fit: cover;
  border: 4px solid rgba(242, 232, 217, 0.88);
  box-shadow: 0 11px 22px rgba(0, 0, 0, 0.36);
  filter: sepia(0.24) saturate(0.72) contrast(1.06) brightness(0.8);
  transition: transform 260ms ease;
}

.card-gallery img:nth-child(1) {
  height: 88px;
  transform: rotate(-3deg);
}

.card-gallery img:nth-child(2) {
  height: 112px;
  transform: translateY(-13px);
}

.card-gallery img:nth-child(3) {
  transform: rotate(3deg);
}

.exhibition-card:hover .card-gallery img:nth-child(1) {
  transform: translateY(-4px) rotate(-5deg);
}

.exhibition-card:hover .card-gallery img:nth-child(2) {
  transform: translateY(-20px) rotate(1deg);
}

.exhibition-card:hover .card-gallery img:nth-child(3) {
  transform: translateY(-4px) rotate(5deg);
}

.exhibition-sand .card-gallery {
  right: 4%;
  bottom: 66px;
}

.exhibition-stars .card-gallery {
  right: 6%;
  bottom: 65px;
}

.exhibition-stars .card-gallery img {
  width: 78px;
  border-color: rgba(245, 230, 214, 0.8);
  border-radius: 49% 49% 4px 4px;
}

.card-gallery-chronicle,
.card-gallery-archive {
  right: 35px;
  bottom: 60px;
  opacity: 0.7;
}

.card-gallery-chronicle img,
.card-gallery-archive img {
  width: 100px;
  height: 105px;
  border-width: 3px;
}

.card-glyph {
  position: absolute;
  right: 37px;
  bottom: 45px;
  color: rgba(230, 57, 70, 0.18);
  font-family: var(--portal-kai);
  font-size: 98px;
  line-height: 1;
  text-shadow: 0 0 30px rgba(200, 16, 46, 0.18);
  transition: color 260ms ease, transform 360ms ease;
}

.exhibition-card:hover .card-glyph {
  color: rgba(230, 57, 70, 0.29);
  transform: rotate(-8deg) scale(1.06);
}

.red-thread-section {
  padding-bottom: 120px;
}

.red-thread-scroll {
  position: relative;
  height: 350px;
  margin: 12px -2vw 0;
  overflow: hidden;
}

.red-thread-scroll::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 239, 230, 0.14) 0.7px, transparent 0.9px);
  background-size: 17px 17px;
  content: "";
  opacity: 0.18;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.red-thread-line {
  position: absolute;
  inset: -15px 0 0;
  width: 100%;
  height: 350px;
  overflow: visible;
}

.thread-shadow,
.thread-draw {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thread-shadow {
  stroke: rgba(200, 16, 46, 0.16);
  stroke-width: 7;
}

.thread-draw {
  stroke: var(--red);
  stroke-width: 2.4;
  filter: drop-shadow(0 0 7px rgba(200, 16, 46, 0.64));
  stroke-dasharray: 1650;
  stroke-dashoffset: 1650;
  transition: stroke-dashoffset 1.9s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.red-thread-section.thread-active .thread-draw {
  stroke-dashoffset: 0;
}

.thread-stop {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 3;
  transform: translate(-50%, -50%);
}

.thread-stop button {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(245, 239, 230, 0.2);
  border-radius: 50%;
  color: var(--paper);
  background: #151011;
  box-shadow: 0 0 0 6px #0e0b0b;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.thread-stop button::before {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(200, 16, 46, 0.35);
  border-radius: 50%;
  content: "";
}

.thread-stop button span {
  position: relative;
  font-family: var(--portal-serif);
  font-size: 14px;
}

.thread-stop button i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 15px var(--red-pomegranate);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.thread-stop button:hover,
.thread-stop.active button {
  color: var(--white);
  border-color: var(--red-pomegranate);
  background: var(--red-deep);
  transform: scale(1.08);
}

.thread-stop > strong {
  position: absolute;
  top: 86px;
  left: 50%;
  width: max-content;
  color: rgba(245, 239, 230, 0.6);
  font-family: var(--portal-kai);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  transform: translateX(-50%);
}

.thread-reading {
  display: grid;
  grid-template-columns: 150px minmax(180px, 0.35fr) 1fr;
  align-items: start;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.thread-reading > span {
  color: rgba(230, 57, 70, 0.82);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.thread-reading h3 {
  margin: 0;
  color: var(--paper);
  font-family: var(--portal-kai);
  font-size: 25px;
  font-weight: 400;
}

.thread-reading p {
  margin: 0;
  color: rgba(245, 239, 230, 0.55);
  font-family: var(--portal-serif);
  font-size: 14px;
  line-height: 1.9;
}

.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, calc(100% - 72px));
  min-height: 100px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.portal-footer p {
  color: rgba(245, 239, 230, 0.38);
  font-family: var(--portal-serif);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.portal-footer p span {
  margin-right: 10px;
  color: var(--red);
}

.portal-footer div {
  display: flex;
  gap: 25px;
}

.portal-footer button {
  border: 0;
  color: rgba(245, 239, 230, 0.52);
  background: transparent;
  font-size: 11px;
}

.portal-footer button:hover {
  color: var(--white);
}

/* ---------- 通用浮层 ---------- */
.portal-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  padding: 26px;
  place-items: center;
  color: var(--paper);
}

.portal-gate-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(200, 16, 46, 0.11), transparent 44%),
    rgba(5, 4, 4, 0.86);
  backdrop-filter: blur(15px);
}

.portal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(245, 239, 230, 0.18);
  color: rgba(245, 239, 230, 0.74);
  background: rgba(255, 255, 255, 0.03);
  font-size: 22px;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
}

.portal-close:hover {
  color: var(--white);
  border-color: var(--red);
  transform: rotate(90deg);
}

.login-card {
  position: relative;
  width: min(480px, 100%);
  padding: 44px 45px 32px;
  border: 1px solid rgba(245, 239, 230, 0.17);
  background:
    linear-gradient(150deg, rgba(200, 16, 46, 0.09), transparent 42%),
    #151011;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.62);
  animation: cardRise 420ms cubic-bezier(0.17, 0.71, 0.18, 1) both;
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
}

.login-stamp {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--white);
  background: var(--red);
  font-size: 18px;
  transform: rotate(-5deg);
}

.login-kicker {
  margin: 22px 0 8px;
  color: rgba(230, 57, 70, 0.84);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.login-card h2 {
  margin: 0;
  font-family: var(--portal-kai);
  font-size: 30px;
  font-weight: 400;
}

.login-intro {
  margin: 14px 0 24px;
  color: rgba(245, 239, 230, 0.47);
  font-family: var(--portal-serif);
  font-size: 12px;
  line-height: 1.75;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(245, 239, 230, 0.12);
}

.login-tabs button {
  height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: rgba(245, 239, 230, 0.43);
  background: transparent;
  font-size: 12px;
}

.login-tabs button.active {
  color: var(--white);
  border-bottom-color: var(--red);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 23px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label > span {
  color: rgba(245, 239, 230, 0.56);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.login-form input,
.letter-field textarea {
  width: 100%;
  border: 1px solid rgba(245, 239, 230, 0.17);
  outline: 0;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input {
  height: 48px;
  padding: 0 14px;
}

.login-form input:focus,
.letter-field textarea:focus {
  border-color: rgba(230, 57, 70, 0.7);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.login-form input::placeholder,
.letter-field textarea::placeholder {
  color: rgba(245, 239, 230, 0.25);
}

.login-error {
  min-height: 17px;
  margin: 0;
  color: #ff8890;
  font-size: 11px;
}

.login-submit {
  width: 100%;
  margin-top: 2px;
}

.login-tip {
  margin: 5px 0 4px;
  color: rgba(245, 239, 230, 0.48);
  font-size: 12px;
  line-height: 1.7;
}

.login-skip {
  display: block;
  margin: 19px auto 0;
  border: 0;
  color: rgba(245, 239, 230, 0.44);
  background: transparent;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.login-skip:hover {
  color: var(--paper);
}

.login-source {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(245, 239, 230, 0.1);
  color: rgba(245, 239, 230, 0.27);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.directory-sheet {
  position: relative;
  width: min(1020px, 100%);
  padding: 38px;
  border: 1px solid rgba(245, 239, 230, 0.16);
  background:
    linear-gradient(145deg, rgba(200, 16, 46, 0.08), transparent 32%),
    #151011;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
  animation: cardRise 380ms cubic-bezier(0.17, 0.71, 0.18, 1) both;
}

.directory-sheet > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.directory-sheet header p {
  margin: 0 0 8px;
  color: rgba(230, 57, 70, 0.82);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.directory-sheet header h2 {
  margin: 0;
  font-family: var(--portal-kai);
  font-size: 34px;
  font-weight: 400;
}

.directory-sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 24px;
}

.directory-sheet-grid button {
  position: relative;
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(245, 239, 230, 0.12);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.directory-sheet-grid button:first-child,
.directory-sheet-grid button:nth-child(2) {
  grid-column: span 2;
}

.directory-sheet-grid button:hover {
  border-color: rgba(230, 57, 70, 0.55);
  background: rgba(200, 16, 46, 0.09);
  transform: translateY(-3px);
}

.directory-sheet-grid button > span {
  color: rgba(230, 57, 70, 0.72);
  font-family: var(--portal-serif);
  font-size: 20px;
}

.directory-sheet-grid button strong {
  margin-top: auto;
  font-family: var(--portal-kai);
  font-size: 21px;
  font-weight: 400;
}

.directory-sheet-grid button small {
  margin-top: 8px;
  color: rgba(245, 239, 230, 0.38);
  font-size: 10px;
  line-height: 1.5;
}

.directory-sheet > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: rgba(245, 239, 230, 0.42);
  font-size: 10px;
}

.directory-sheet > footer b {
  color: rgba(245, 239, 230, 0.72);
  font-weight: 400;
}

.directory-sheet > footer button {
  border: 0;
  color: var(--red-pomegranate);
  background: transparent;
  font-size: 10px;
}

/* ---------- 沉浸式展厅 ---------- */
.immersive-scene {
  position: fixed;
  inset: 0;
  z-index: 4500;
  display: grid;
  grid-template-rows: 75px minmax(0, 1fr) 92px;
  color: var(--paper);
  background:
    radial-gradient(700px 540px at 50% 36%, rgba(200, 16, 46, 0.08), transparent 68%),
    #0e0b0b;
  animation: sceneReveal 400ms cubic-bezier(0.18, 0.74, 0.2, 1) both;
}

@keyframes sceneReveal {
  from { transform: scale(1.008); }
}

.scene-header {
  display: grid;
  grid-template-columns: 190px 1fr 240px;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 11, 11, 0.9);
}

.scene-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  border: 0;
  color: rgba(245, 239, 230, 0.55);
  background: transparent;
  font-size: 11px;
}

.scene-back:hover {
  color: var(--white);
}

.scene-back span {
  color: var(--red-pomegranate);
  font-size: 16px;
}

.scene-header > div:nth-child(2) {
  text-align: center;
}

.scene-header p {
  margin: 0 0 3px;
  color: rgba(230, 57, 70, 0.72);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.scene-header h2 {
  margin: 0;
  font-family: var(--portal-kai);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.scene-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.scene-header-tools > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(245, 239, 230, 0.38);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-pomegranate);
  box-shadow: 0 0 10px var(--red);
  animation: livePulse 1.7s ease-in-out infinite;
}

@keyframes livePulse {
  50% { opacity: 0.42; box-shadow: 0 0 3px var(--red); }
}

.scene-header-tools button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(245, 239, 230, 0.14);
  color: rgba(245, 239, 230, 0.55);
  background: transparent;
  font-size: 9px;
}

.scene-header-tools button:hover {
  color: var(--white);
  border-color: rgba(230, 57, 70, 0.53);
}

.sand-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-height: 0;
}

.sand-stage,
.star-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(200, 16, 46, 0.055), transparent 46%),
    #0a0809;
}

.sand-stage {
  cursor: grab;
  touch-action: none;
}

.sand-stage:active {
  cursor: grabbing;
}

.sand-stage canvas,
.star-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.sand-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.015) 3px 4px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.sand-axis {
  position: absolute;
  top: 24px;
  right: 26px;
  display: grid;
  width: 48px;
  height: 62px;
  place-items: center;
  color: rgba(245, 239, 230, 0.46);
  border: 1px solid rgba(245, 239, 230, 0.13);
  font-family: var(--portal-serif);
  font-size: 10px;
}

.sand-axis i {
  position: absolute;
  bottom: 9px;
  width: 1px;
  height: 23px;
  background: linear-gradient(to bottom, var(--red), transparent);
}

.sand-axis i::before {
  position: absolute;
  top: -2px;
  left: -3px;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--red);
  border-left: 1px solid var(--red);
  content: "";
  transform: rotate(45deg);
}

.sand-hud,
.star-hud {
  position: absolute;
  bottom: 17px;
  left: 22px;
  display: flex;
  gap: 17px;
  color: rgba(245, 239, 230, 0.33);
  font-size: 9px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.sand-hud span::before,
.star-hud span::before {
  margin-right: 5px;
  color: rgba(230, 57, 70, 0.72);
  content: "·";
}

.sand-zoom-tools {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 6px;
}

.sand-zoom-tools button,
.star-controls > button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(245, 239, 230, 0.15);
  color: rgba(245, 239, 230, 0.7);
  background: rgba(16, 11, 12, 0.82);
  font-size: 18px;
}

.sand-zoom-tools button:hover,
.star-controls > button:hover {
  color: var(--white);
  border-color: var(--red);
  background: rgba(140, 28, 19, 0.38);
}

.sand-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(230, 57, 70, 0.22), transparent 58%);
  pointer-events: none;
}

.sand-flash.active {
  animation: sandFlash 680ms ease-out;
}

@keyframes sandFlash {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

.sand-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 13px;
  color: rgba(245, 239, 230, 0.48);
  background: #0a0809;
  text-align: center;
  transition: opacity 400ms ease;
}

.sand-loading.done {
  opacity: 0;
  pointer-events: none;
}

.sand-loader-star {
  color: var(--red);
  font-size: 45px;
  animation: loaderStar 1.6s ease-in-out infinite;
}

@keyframes loaderStar {
  50% { transform: scale(0.83) rotate(22deg); opacity: 0.5; }
}

.sand-loading p {
  margin: 0;
  font-family: var(--portal-serif);
  font-size: 12px;
  letter-spacing: 0.15em;
}

.sand-info {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 26px 25px 20px;
  border-left: 1px solid var(--line);
  background: #121011;
}

.sand-year-block > span {
  color: rgba(245, 239, 230, 0.32);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.sand-year-block strong {
  display: block;
  margin-top: 5px;
  color: var(--paper);
  font-family: var(--portal-serif);
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 0 #2b1d1f, 0 16px 34px rgba(0, 0, 0, 0.6);
}

.sand-year-block small {
  display: block;
  margin-top: 8px;
  color: rgba(230, 57, 70, 0.8);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.sand-event-card {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.sand-event-index {
  position: absolute;
  top: 21px;
  right: 0;
  color: rgba(245, 239, 230, 0.25);
  font-family: var(--portal-serif);
  font-size: 10px;
}

.sand-event-card > p:first-of-type {
  margin: 0;
  color: rgba(245, 239, 230, 0.43);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.sand-event-card h3 {
  margin: 13px 0 6px;
  font-family: var(--portal-kai);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.35;
}

.sand-event-card > strong {
  color: var(--red-pomegranate);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.sand-event-card > p {
  margin: 17px 0 0;
  color: rgba(245, 239, 230, 0.46);
  font-family: var(--portal-serif);
  font-size: 13px;
  line-height: 1.85;
}

.sand-event-card > button {
  width: 100%;
  height: 42px;
  margin-top: 21px;
  border: 1px solid rgba(245, 239, 230, 0.14);
  color: rgba(245, 239, 230, 0.62);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
}

.sand-event-card > button:hover {
  color: var(--white);
  border-color: rgba(230, 57, 70, 0.55);
}

.sand-event-card > button span {
  margin-left: 8px;
  color: var(--red-pomegranate);
}

.sand-progress {
  display: grid;
  grid-template-columns: 58px 1fr 52px;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.sand-progress > span,
.sand-progress > strong {
  color: rgba(245, 239, 230, 0.34);
  font-size: 8px;
  font-weight: 400;
}

.sand-progress > div {
  height: 3px;
  overflow: hidden;
  background: rgba(245, 239, 230, 0.08);
}

.sand-progress > div i {
  display: block;
  width: 6.25%;
  height: 100%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(200, 16, 46, 0.7);
  transition: width 400ms ease;
}

.sand-note {
  margin: 18px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: rgba(245, 239, 230, 0.24);
  font-size: 9px;
  line-height: 1.7;
}

.sand-timeline {
  display: grid;
  grid-template-columns: 44px 120px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 16px;
  padding: 0 27px;
  border-top: 1px solid var(--line);
  background: #100d0e;
}

.sand-step {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(245, 239, 230, 0.14);
  color: rgba(245, 239, 230, 0.65);
  background: transparent;
  font-size: 18px;
}

.sand-play {
  height: 40px;
  border: 1px solid rgba(230, 57, 70, 0.37);
  color: rgba(245, 239, 230, 0.72);
  background: rgba(200, 16, 46, 0.09);
  font-size: 10px;
}

.sand-play span {
  margin-right: 6px;
  color: var(--red-pomegranate);
}

.sand-range-wrap {
  position: relative;
  height: 62px;
}

.sand-range-wrap input {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 0;
  width: 100%;
  height: 22px;
  margin: 0;
  cursor: ew-resize;
  opacity: 0;
}

.sand-range-wrap::before {
  position: absolute;
  top: 24px;
  right: 0;
  left: 0;
  height: 2px;
  background: rgba(245, 239, 230, 0.12);
  content: "";
}

.sand-ticks {
  position: absolute;
  top: 19px;
  right: 5px;
  left: 5px;
  height: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.sand-ticks i {
  width: 1px;
  height: 10px;
  background: rgba(245, 239, 230, 0.25);
}

.sand-ticks i.active {
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--red-pomegranate);
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.8);
}

.sand-years {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: rgba(245, 239, 230, 0.28);
  font-size: 8px;
}

/* ---------- 星图 ---------- */
.star-scene {
  grid-template-rows: 75px minmax(0, 1fr);
}

.star-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
}

.star-stage {
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(1px 1px at 20% 22%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.4px),
    radial-gradient(1px 1px at 72% 28%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1.4px),
    radial-gradient(1px 1px at 64% 74%, rgba(255, 255, 255, 0.48) 0 1px, transparent 1.4px),
    radial-gradient(1px 1px at 32% 66%, rgba(255, 220, 225, 0.45) 0 1px, transparent 1.4px),
    radial-gradient(ellipse at 48% 50%, rgba(200, 16, 46, 0.13), transparent 52%),
    #080607;
}

.star-stage:active {
  cursor: grabbing;
}

.star-nebula {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 37% 42%, rgba(200, 16, 46, 0.06), transparent 24%),
    radial-gradient(ellipse at 67% 64%, rgba(158, 27, 50, 0.08), transparent 25%);
  pointer-events: none;
  filter: blur(12px);
}

.star-center-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 13px;
  opacity: 0.26;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.star-center-mark span {
  color: var(--red);
  font-size: 66px;
  filter: drop-shadow(0 0 18px rgba(200, 16, 46, 0.8));
}

.star-center-mark small {
  color: rgba(245, 239, 230, 0.7);
  font-family: var(--portal-kai);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.09em;
}

.star-controls {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 4;
  display: flex;
  gap: 6px;
}

.star-controls label {
  display: flex;
  align-items: center;
  width: 180px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(245, 239, 230, 0.15);
  background: rgba(16, 11, 12, 0.82);
}

.star-controls label span {
  color: rgba(230, 57, 70, 0.8);
}

.star-controls input {
  width: 100%;
  margin-left: 8px;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-size: 10px;
}

.star-controls input::placeholder {
  color: rgba(245, 239, 230, 0.3);
}

.star-intro {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: min(440px, 75%);
  padding: 30px;
  border: 1px solid rgba(245, 239, 230, 0.13);
  background: rgba(12, 9, 10, 0.82);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(9px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.star-intro.dismissed {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%);
}

.star-intro > span {
  color: var(--red);
  font-size: 27px;
}

.star-intro h3 {
  margin: 11px 0 0;
  font-family: var(--portal-kai);
  font-size: 25px;
  font-weight: 400;
}

.star-intro p {
  margin: 12px auto 18px;
  color: rgba(245, 239, 230, 0.46);
  font-family: var(--portal-serif);
  font-size: 12px;
  line-height: 1.8;
}

.star-intro button {
  height: 38px;
  padding: 0 22px;
  border: 1px solid rgba(230, 57, 70, 0.55);
  color: var(--paper);
  background: rgba(200, 16, 46, 0.15);
  font-size: 10px;
}

.star-profile {
  position: absolute;
  right: 24px;
  bottom: 25px;
  z-index: 5;
  display: grid;
  grid-template-columns: 130px 1fr;
  width: min(540px, calc(100% - 48px));
  min-height: 260px;
  border: 1px solid rgba(230, 57, 70, 0.46);
  background:
    linear-gradient(140deg, rgba(200, 16, 46, 0.12), transparent 46%),
    rgba(18, 13, 15, 0.97);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.76);
  animation: starProfileIn 380ms cubic-bezier(0.16, 0.72, 0.19, 1) both;
  backdrop-filter: blur(14px);
}

@keyframes starProfileIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
}

.star-profile-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(245, 239, 230, 0.15);
  color: rgba(245, 239, 230, 0.65);
  background: transparent;
  font-size: 18px;
}

.star-profile-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid rgba(245, 239, 230, 0.13);
  background:
    radial-gradient(circle, rgba(200, 16, 46, 0.2), transparent 62%),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(245, 239, 230, 0.025) 10px 11px);
}

.profile-initial {
  display: grid;
  width: 74px;
  height: 96px;
  place-items: center;
  color: var(--paper);
  border: 1px solid rgba(245, 239, 230, 0.25);
  background: rgba(0, 0, 0, 0.2);
  font-family: var(--portal-kai);
  font-size: 43px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.32);
}

.star-profile-visual > span {
  position: absolute;
  bottom: 18px;
  color: var(--red);
  font-size: 19px;
}

.star-profile-copy {
  padding: 24px 28px 19px;
}

.star-profile-copy > span {
  color: rgba(245, 239, 230, 0.34);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.star-profile-copy h3 {
  margin: 6px 0 3px;
  font-family: var(--portal-kai);
  font-size: 29px;
  font-weight: 400;
}

.star-profile-copy > strong {
  color: var(--red-pomegranate);
  font-size: 10px;
  font-weight: 400;
}

.star-profile-copy > p {
  margin: 14px 0 0;
  color: rgba(245, 239, 230, 0.53);
  font-family: var(--portal-serif);
  font-size: 12px;
  line-height: 1.85;
}

.star-profile-copy blockquote {
  margin: 13px 0 0;
  padding-left: 11px;
  border-left: 2px solid var(--red);
  color: rgba(245, 239, 230, 0.68);
  font-family: var(--portal-kai);
  font-size: 12px;
  line-height: 1.7;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 239, 230, 0.1);
}

.profile-actions button {
  border: 0;
  color: rgba(245, 239, 230, 0.58);
  background: transparent;
  font-size: 9px;
}

.profile-actions button:hover {
  color: var(--white);
}

.profile-actions span {
  color: rgba(245, 239, 230, 0.26);
  font-size: 8px;
}

.star-index {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 24px 20px 16px;
  border-left: 1px solid var(--line);
  background: #111011;
}

.star-index header {
  position: relative;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.star-index header p {
  margin: 0;
  color: rgba(230, 57, 70, 0.7);
  font-size: 8px;
  letter-spacing: 0.21em;
}

.star-index header h3 {
  margin: 8px 0 0;
  font-family: var(--portal-kai);
  font-size: 25px;
  font-weight: 400;
}

.star-index header > span {
  position: absolute;
  right: 0;
  bottom: 20px;
  color: rgba(245, 239, 230, 0.33);
  font-size: 9px;
}

.star-index-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 14px 0;
}

.star-index-filter button {
  height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(245, 239, 230, 0.12);
  color: rgba(245, 239, 230, 0.4);
  background: transparent;
  font-size: 8px;
}

.star-index-filter button:hover,
.star-index-filter button.active {
  color: var(--white);
  border-color: rgba(230, 57, 70, 0.5);
  background: rgba(200, 16, 46, 0.12);
}

.star-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 16, 46, 0.5) transparent;
}

.star-list button {
  display: grid;
  grid-template-columns: 23px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 49px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid rgba(245, 239, 230, 0.075);
  color: rgba(245, 239, 230, 0.54);
  background: transparent;
  text-align: left;
}

.star-list button:hover,
.star-list button.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.12), transparent);
}

.star-list button > span:first-child {
  color: var(--red);
  font-size: 9px;
}

.star-list button strong {
  font-family: var(--portal-kai);
  font-size: 14px;
  font-weight: 400;
}

.star-list button small {
  color: rgba(245, 239, 230, 0.23);
  font-size: 8px;
}

/* ---------- 精神灯阵与题目 ---------- */
.spirit-room {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100vh - 52px);
  padding: 40px;
  overflow-y: auto;
  border: 1px solid rgba(245, 239, 230, 0.15);
  background:
    radial-gradient(540px 400px at 50% 0%, rgba(200, 16, 46, 0.09), transparent 70%),
    #121011;
  box-shadow: 0 44px 100px rgba(0, 0, 0, 0.68);
  animation: cardRise 390ms ease both;
}

.spirit-room > header {
  text-align: center;
}

.spirit-room header p,
.quiz-card header p {
  margin: 0;
  color: rgba(230, 57, 70, 0.78);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.spirit-room header h2 {
  margin: 11px 0 0;
  font-family: var(--portal-kai);
  font-size: 36px;
  font-weight: 400;
}

.spirit-room header > p:last-child {
  margin-top: 11px;
  color: rgba(245, 239, 230, 0.38);
  font-family: var(--portal-serif);
  font-size: 11px;
}

.spirit-lamps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-top: 32px;
}

.spirit-lamp {
  position: relative;
  display: flex;
  min-height: 155px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 8px;
  border: 1px solid rgba(245, 239, 230, 0.1);
  color: rgba(245, 239, 230, 0.48);
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.spirit-lamp:hover,
.spirit-lamp.active {
  color: var(--white);
  border-color: rgba(230, 57, 70, 0.48);
  background: rgba(200, 16, 46, 0.08);
  transform: translateY(-3px);
}

.spirit-lamp i {
  position: absolute;
  top: 19px;
  display: grid;
  width: 44px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(245, 239, 230, 0.22);
  border-radius: 22px 22px 8px 8px;
  color: var(--red-pomegranate);
  background:
    radial-gradient(circle, rgba(230, 57, 70, 0.37), transparent 62%),
    rgba(0, 0, 0, 0.23);
  font-size: 15px;
  box-shadow: inset 0 0 13px rgba(230, 57, 70, 0.22), 0 10px 28px rgba(200, 16, 46, 0.13);
}

.spirit-lamp i::after {
  position: absolute;
  bottom: -7px;
  width: 28px;
  height: 5px;
  border: 1px solid rgba(245, 239, 230, 0.22);
  background: #121011;
  content: "";
}

.spirit-lamp strong {
  color: inherit;
  font-family: var(--portal-kai);
  font-size: 14px;
  font-weight: 400;
}

.spirit-lamp small {
  margin-top: 5px;
  color: rgba(245, 239, 230, 0.27);
  font-size: 8px;
}

.spirit-reading {
  margin-top: 27px;
  padding: 23px 26px;
  border-left: 3px solid var(--red);
  background: rgba(200, 16, 46, 0.06);
}

.spirit-reading > span {
  color: rgba(245, 239, 230, 0.29);
  font-size: 9px;
}

.spirit-reading h3 {
  margin: 6px 0;
  font-family: var(--portal-kai);
  font-size: 23px;
  font-weight: 400;
}

.spirit-reading > strong {
  color: rgba(230, 57, 70, 0.9);
  font-size: 11px;
  font-weight: 400;
}

.spirit-reading p {
  margin: 13px 0 0;
  color: rgba(245, 239, 230, 0.55);
  font-family: var(--portal-serif);
  font-size: 12px;
  line-height: 1.85;
}

.quiz-card {
  position: relative;
  width: min(690px, 100%);
  padding: 40px;
  border: 1px solid rgba(245, 239, 230, 0.16);
  background:
    linear-gradient(145deg, rgba(200, 16, 46, 0.08), transparent 42%),
    #151011;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.66);
  animation: cardRise 380ms ease both;
}

.quiz-card header > div:nth-child(2) {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 9px;
}

.quiz-card header h2 {
  margin: 0;
  font-family: var(--portal-kai);
  font-size: 35px;
  font-weight: 400;
}

.quiz-card header > div:nth-child(2) > span {
  color: rgba(245, 239, 230, 0.32);
  font-family: var(--portal-serif);
}

.quiz-progress {
  height: 3px;
  margin-top: 18px;
  overflow: hidden;
  background: rgba(245, 239, 230, 0.08);
}

.quiz-progress i {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--red);
  transition: width 300ms ease;
}

.quiz-card #quizBody {
  padding-top: 23px;
}

.quiz-card #quizQuestion {
  min-height: 58px;
  margin: 0;
  font-family: var(--portal-serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.quiz-options button {
  min-height: 48px;
  padding: 9px 14px;
  border: 1px solid rgba(245, 239, 230, 0.13);
  color: rgba(245, 239, 230, 0.61);
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.quiz-options button:hover {
  border-color: rgba(230, 57, 70, 0.46);
  background: rgba(200, 16, 46, 0.07);
}

.quiz-options button.correct {
  color: #fff;
  border-color: rgba(111, 200, 139, 0.65);
  background: rgba(46, 125, 74, 0.18);
}

.quiz-options button.wrong {
  color: #fff;
  border-color: rgba(230, 57, 70, 0.7);
  background: rgba(200, 16, 46, 0.16);
}

.quiz-feedback {
  min-height: 39px;
  margin: 14px 0 0;
  color: rgba(245, 239, 230, 0.46);
  font-size: 11px;
  line-height: 1.7;
}

.quiz-card #quizNextBtn {
  margin-top: 3px;
}

.quiz-result {
  padding: 32px 0 5px;
  text-align: center;
}

.quiz-medal {
  display: inline-grid;
  width: 72px;
  height: 72px;
  place-items: center;
  color: var(--white);
  background: var(--red);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 93%, 50% 71%, 21% 93%, 32% 56%, 2% 35%, 39% 35%);
  font-size: 28px;
}

.quiz-result > p:first-of-type {
  margin: 17px 0 0;
  color: rgba(230, 57, 70, 0.8);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.quiz-result h3 {
  margin: 7px 0;
  font-family: var(--portal-kai);
  font-size: 31px;
  font-weight: 400;
}

.quiz-result > p {
  color: rgba(245, 239, 230, 0.43);
  font-size: 11px;
}

.quiz-result > div {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.letter-card {
  position: relative;
  width: min(730px, 100%);
  padding: 45px 52px;
  border: 1px solid rgba(216, 195, 165, 0.28);
  color: #2b1916;
  background:
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(92, 53, 37, 0.09) 30px),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.46), transparent 33%),
    #d8c3a5;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  animation: letterOpen 520ms cubic-bezier(0.16, 0.7, 0.15, 1) both;
}

@keyframes letterOpen {
  from { opacity: 0; transform: perspective(900px) rotateX(-12deg) translateY(30px); transform-origin: top; }
}

.letter-card .portal-close {
  color: rgba(43, 25, 22, 0.65);
  border-color: rgba(43, 25, 22, 0.22);
}

.letter-head {
  display: grid;
  gap: 13px;
  padding-bottom: 20px;
  border-bottom: 1px dashed rgba(43, 25, 22, 0.28);
}

.letter-head span {
  color: rgba(140, 28, 19, 0.74);
  font-size: 9px;
  letter-spacing: 0.19em;
}

.letter-head strong {
  font-family: var(--portal-kai);
  font-size: 34px;
  font-weight: 400;
}

.letter-field {
  display: grid;
  gap: 11px;
  margin-top: 23px;
}

.letter-field > span {
  color: rgba(43, 25, 22, 0.6);
  font-family: var(--portal-kai);
  font-size: 14px;
}

.letter-field textarea {
  min-height: 155px;
  padding: 15px;
  resize: vertical;
  color: #2b1916;
  border-color: rgba(43, 25, 22, 0.22);
  background: rgba(255, 255, 255, 0.2);
  font-family: var(--portal-kai);
  font-size: 16px;
  line-height: 1.75;
}

.letter-field textarea::placeholder {
  color: rgba(43, 25, 22, 0.35);
}

.letter-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.letter-suggestions button {
  padding: 6px 9px;
  border: 1px solid rgba(43, 25, 22, 0.16);
  color: rgba(43, 25, 22, 0.57);
  background: rgba(255, 255, 255, 0.12);
  font-size: 9px;
}

.letter-suggestions button:hover {
  color: var(--red-deep);
  border-color: rgba(140, 28, 19, 0.38);
}

.letter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}

.letter-actions > span {
  color: rgba(43, 25, 22, 0.45);
  font-size: 9px;
}

.letter-actions .portal-primary {
  min-height: 45px;
  padding: 0 18px;
  border: 0;
  color: #fff8f4;
}

.letter-saved {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 15px;
  border: 1px solid rgba(140, 28, 19, 0.22);
  background: rgba(255, 255, 255, 0.13);
}

.letter-saved > span {
  color: var(--red-deep);
}

.letter-saved p {
  margin: 0;
  color: rgba(43, 25, 22, 0.65);
  font-size: 10px;
}

.guide-card {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 52px);
  padding: 40px;
  overflow-y: auto;
  border: 1px solid rgba(245, 239, 230, 0.15);
  background: #141011;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.64);
  animation: cardRise 380ms ease both;
}

.guide-card header p {
  margin: 0;
  color: rgba(230, 57, 70, 0.76);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.guide-card header h2 {
  margin: 9px 0 0;
  font-family: var(--portal-kai);
  font-size: 34px;
  font-weight: 400;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 25px;
}

.guide-grid article {
  padding: 19px;
  border: 1px solid rgba(245, 239, 230, 0.1);
  background: rgba(255, 255, 255, 0.018);
}

.guide-grid article span {
  color: rgba(230, 57, 70, 0.7);
  font-family: var(--portal-serif);
  font-size: 17px;
}

.guide-grid h3 {
  margin: 9px 0 0;
  font-family: var(--portal-kai);
  font-size: 19px;
  font-weight: 400;
}

.guide-grid p {
  margin: 9px 0 0;
  color: rgba(245, 239, 230, 0.45);
  font-family: var(--portal-serif);
  font-size: 11px;
  line-height: 1.8;
}

.guide-sources {
  margin-top: 18px;
  padding: 18px 20px;
  border-left: 2px solid var(--red);
  background: rgba(200, 16, 46, 0.05);
}

.guide-sources strong {
  color: rgba(245, 239, 230, 0.7);
  font-size: 11px;
}

.guide-sources p {
  margin: 7px 0 0;
  color: rgba(245, 239, 230, 0.4);
  font-size: 10px;
  line-height: 1.8;
}

.scene-help-card {
  position: relative;
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid rgba(245, 239, 230, 0.17);
  background: #171112;
  text-align: center;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.66);
  animation: cardRise 340ms ease both;
}

.scene-help-card > span {
  color: var(--red);
  font-size: 34px;
}

.scene-help-card h2 {
  margin: 12px 0 0;
  font-family: var(--portal-kai);
  font-size: 28px;
  font-weight: 400;
}

.scene-help-card p {
  margin: 14px 0 24px;
  color: rgba(245, 239, 230, 0.49);
  font-size: 12px;
  line-height: 1.8;
}

.scene-help-card .portal-primary {
  width: 100%;
  justify-content: center;
}

/* ---------- 既有战史长卷的红黑白统一 ---------- */
.portal-top-user .top-user-dot {
  margin-right: 5px;
  color: var(--red-pomegranate);
}

.app-shell {
  background:
    radial-gradient(900px 600px at 72% -5%, rgba(200, 16, 46, 0.08), transparent 58%),
    repeating-linear-gradient(32deg, transparent 0 45px, rgba(245, 239, 230, 0.012) 46px),
    #0b0909;
}

.brand-seal,
.event-category,
.lens-symbol {
  background: var(--red-deep);
}

.primary-action,
.enter-button {
  color: #fff8f4;
  background: var(--red);
}

.timeline-fill {
  background: linear-gradient(180deg, #f16975, var(--red) 48%, var(--red-deep));
}

.timeline-head span {
  border-color: #ff9aa2;
  background: radial-gradient(circle at 32% 28%, #fff4ed, #db4a5a 48%, #8c1c13 90%);
}

.intro-content h1 span:nth-child(2) {
  color: var(--red-pomegranate);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .portal-header,
  .portal-main,
  .portal-footer {
    width: min(100% - 40px, 1100px);
  }

  .portal-nav {
    gap: 18px;
  }

  .portal-hero {
    grid-template-columns: minmax(450px, 0.95fr) minmax(400px, 0.85fr);
    padding-right: 0;
    padding-left: 0;
  }

  .portal-hero-art {
    min-height: 540px;
  }

  .portal-facts div {
    min-width: 94px;
    padding: 0 16px;
  }

  .memory-gallery-wall {
    grid-template-columns: 0.8fr 1fr 0.84fr 1fr 0.72fr;
  }

  .frame-one { height: 240px; }
  .frame-two { height: 330px; }
  .frame-three { height: 286px; }
  .frame-four { height: 342px; }
  .frame-five { height: 226px; }

  .exhibition-sand,
  .exhibition-stars {
    min-height: 350px;
  }

  .sand-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .star-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }

  .spirit-lamps {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .portal-header {
    grid-template-columns: 1fr auto;
    min-height: 74px;
  }

  .portal-nav {
    display: none;
  }

  .portal-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 67px;
  }

  .portal-hero-copy {
    max-width: 690px;
  }

  .portal-hero h1 span,
  .portal-hero h1 em,
  .portal-hero h1 strong,
  .portal-hero h1 b {
    font-size: clamp(54px, 11vw, 86px);
  }

  .portal-hero-art {
    min-height: 480px;
  }

  .memory-gallery-section {
    margin-right: -20px;
    margin-left: -20px;
    padding: 70px 30px 78px;
  }

  .memory-gallery-wall {
    grid-template-columns: repeat(6, 1fr);
    align-items: end;
    gap: 16px;
    min-height: 0;
  }

  .memory-frame:nth-child(1),
  .memory-frame:nth-child(2),
  .memory-frame:nth-child(3) {
    grid-column: span 2;
  }

  .memory-frame:nth-child(4),
  .memory-frame:nth-child(5) {
    grid-column: span 3;
  }

  .frame-one,
  .frame-two,
  .frame-three {
    height: 255px;
    transform: none;
  }

  .frame-four,
  .frame-five {
    height: 260px;
    transform: none;
  }

  .memory-story-card {
    width: 100%;
    margin-top: 28px;
  }

  .portal-scroll-hint {
    display: none;
  }

  .portal-section-head {
    grid-template-columns: 1fr;
  }

  .portal-section-head > p {
    justify-self: start;
    margin-top: -14px;
  }

  .exhibition-sand,
  .exhibition-stars,
  .exhibition-chronicle,
  .exhibition-archive {
    grid-column: span 6;
  }

  .exhibition-spirit,
  .exhibition-study,
  .exhibition-today {
    grid-column: span 4;
  }

  .red-thread-scroll {
    height: 310px;
    overflow-x: auto;
  }

  .red-thread-line {
    width: 1200px;
  }

  .thread-stop {
    left: calc(var(--x) * 1.17);
  }

  .thread-reading {
    grid-template-columns: 120px 1fr;
  }

  .thread-reading p {
    grid-column: 2;
  }

  .directory-sheet-grid {
    grid-template-columns: 1fr 1fr;
  }

  .directory-sheet-grid button:first-child,
  .directory-sheet-grid button:nth-child(2) {
    grid-column: span 1;
  }

  .immersive-scene {
    grid-template-rows: 68px minmax(0, 1fr) 78px;
  }

  .scene-header {
    grid-template-columns: 120px 1fr 110px;
    padding: 0 18px;
  }

  .scene-header-tools > span {
    display: none;
  }

  .sand-layout {
    grid-template-columns: 1fr;
  }

  .sand-info {
    display: none;
  }

  .sand-timeline {
    grid-template-columns: 38px 104px minmax(0, 1fr) 38px;
    gap: 8px;
    padding: 0 14px;
  }

  .star-layout {
    grid-template-columns: 1fr;
  }

  .star-index {
    display: none;
  }

  .star-profile {
    right: 14px;
    bottom: 15px;
    width: calc(100% - 28px);
  }

  .portal-gate {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .portal-header,
  .portal-main,
  .portal-footer,
  .portal-hero,
  .portal-hero-copy {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .portal-header,
  .portal-main,
  .portal-footer {
    width: calc(100% - 28px);
  }

  .portal-brand small {
    display: none;
  }

  .portal-directory-btn {
    display: none;
  }

  .portal-user-chip {
    min-width: 45px;
    padding-right: 5px;
  }

  .portal-user-zone {
    min-width: 45px;
    justify-self: end;
  }

  .portal-user-chip > span:last-child {
    display: none;
  }

  .portal-hero {
    padding-top: 48px;
    padding-bottom: 65px;
  }

  .portal-eyebrow {
    font-size: 9px;
    letter-spacing: 0.11em;
  }

  .portal-hero h1 span,
  .portal-hero h1 em,
  .portal-hero h1 strong,
  .portal-hero h1 b {
    display: block;
    margin-left: 0;
    font-size: clamp(37px, 10.5vw, 49px);
    letter-spacing: -0.085em;
  }

  .portal-hero h1 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    column-gap: 4px;
    overflow: hidden;
  }

  .portal-hero h1 span { grid-column: 1; grid-row: 1; }
  .portal-hero h1 strong { grid-column: 2; grid-row: 1; }
  .portal-hero h1 em { grid-column: 1; grid-row: 2; margin-top: 8px; }
  .portal-hero h1 b { grid-column: 2; grid-row: 2; margin-top: 8px; }

  .portal-hero h1 strong,
  .portal-hero h1 b {
    margin-left: 0.05em;
  }

  .portal-lead {
    max-width: 100%;
    margin-top: 28px;
    font-size: 14px;
    line-height: 1.85;
    overflow-wrap: anywhere;
  }

  .portal-hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .portal-primary,
  .portal-secondary {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
  }

  .portal-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 0;
    margin-top: 35px;
  }

  .portal-facts div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .portal-hero-art {
    min-height: 390px;
  }

  .memory-gallery-section {
    margin-right: -14px;
    margin-left: -14px;
    padding: 60px 18px 68px;
  }

  .memory-gallery-head h2 {
    font-size: 33px;
  }

  .memory-gallery-wall {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 26px;
  }

  .memory-frame:nth-child(1),
  .memory-frame:nth-child(2),
  .memory-frame:nth-child(3),
  .memory-frame:nth-child(4) {
    grid-column: span 1;
    height: 230px;
  }

  .memory-frame:nth-child(5) {
    grid-column: span 2;
    height: 245px;
  }

  .memory-frame {
    padding: 6px;
  }

  .memory-frame figcaption {
    min-height: 29px;
    font-size: 8px;
  }

  .memory-story-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 27px 22px 24px;
  }

  .memory-story-card h3 {
    font-size: 24px;
  }

  .memory-story-card button {
    width: 100%;
  }

  .orbit {
    width: 330px;
  }

  .orbit-one { width: 280px; }
  .orbit-two { width: 370px; }
  .orbit-three { width: 430px; }

  .portal-star,
  .portal-star-shadow {
    font-size: 155px;
  }

  .portal-exhibitions,
  .red-thread-section {
    padding: 68px 0;
  }

  .portal-section-head h2 {
    font-size: 34px;
  }

  .exhibition-sand,
  .exhibition-stars,
  .exhibition-chronicle,
  .exhibition-archive,
  .exhibition-spirit,
  .exhibition-study,
  .exhibition-today {
    grid-column: span 12;
    min-height: 280px;
  }

  .exhibition-sand,
  .exhibition-stars {
    min-height: 340px;
  }

  .exhibition-card > strong {
    font-size: 29px;
  }

  .card-gallery {
    opacity: 0.5;
  }

  .card-gallery img {
    width: 60px;
    height: 85px;
  }

  .card-gallery img:nth-child(1) {
    height: 62px;
  }

  .card-gallery img:nth-child(2) {
    height: 80px;
  }

  .card-gallery-chronicle img,
  .card-gallery-archive img {
    width: 68px;
    height: 78px;
  }

  .thread-reading {
    grid-template-columns: 1fr;
  }

  .thread-reading p {
    grid-column: auto;
  }

  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 13px;
  }

  .portal-footer div {
    gap: 13px;
  }

  .login-card,
  .directory-sheet,
  .spirit-room,
  .quiz-card,
  .letter-card,
  .guide-card {
    padding: 27px 21px;
  }

  .login-card h2,
  .spirit-room header h2,
  .guide-card header h2 {
    font-size: 27px;
  }

  .directory-sheet-grid {
    grid-template-columns: 1fr;
  }

  .directory-sheet-grid button {
    min-height: 115px;
  }

  .scene-header {
    grid-template-columns: 82px 1fr 42px;
    padding: 0 12px;
  }

  .scene-back {
    font-size: 0;
  }

  .scene-back span {
    font-size: 21px;
  }

  .scene-header h2 {
    font-size: 17px;
  }

  .scene-header p {
    font-size: 7px;
  }

  .scene-header-tools button {
    width: 35px;
    overflow: hidden;
    padding: 0;
    color: transparent;
  }

  .scene-header-tools button::after {
    color: var(--paper);
    content: "?";
  }

  .sand-axis,
  .sand-hud,
  .star-hud {
    display: none;
  }

  .sand-zoom-tools {
    right: 12px;
    bottom: 12px;
  }

  .sand-timeline {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .sand-play {
    display: none;
  }

  .sand-step {
    width: 32px;
    height: 36px;
  }

  .star-controls {
    top: 13px;
    right: 12px;
    left: 12px;
  }

  .star-controls label {
    width: 100%;
  }

  .star-controls > button {
    flex: 0 0 36px;
  }

  .star-intro {
    width: calc(100% - 36px);
    padding: 23px;
  }

  .star-profile {
    grid-template-columns: 90px 1fr;
    min-height: 236px;
  }

  .star-profile-copy {
    padding: 22px 18px 16px;
  }

  .star-profile-copy h3 {
    font-size: 25px;
  }

  .star-profile-copy > p {
    font-size: 11px;
  }

  .profile-initial {
    width: 58px;
    height: 76px;
    font-size: 34px;
  }

  .spirit-lamps {
    grid-template-columns: repeat(2, 1fr);
  }

  .spirit-lamp {
    min-height: 140px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .letter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .letter-card .portal-close {
    top: 10px;
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .portal-atmosphere i,
  .orbit,
  .portal-star-core,
  .portal-scroll-hint i::after,
  .live-dot,
  .sand-loader-star {
    animation: none !important;
  }

  .portal-primary::before {
    display: none;
  }
}

/* ---------- 精修：艺术标题、展签与影像细节 ---------- */
.portal-hero-copy::before {
  position: absolute;
  top: -34px;
  left: -18px;
  z-index: -1;
  color: rgba(200, 16, 46, 0.035);
  font-family: var(--portal-kai);
  font-size: clamp(180px, 19vw, 310px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.13em;
  content: "百年";
  pointer-events: none;
  transform: rotate(-4deg);
  user-select: none;
}

.portal-hero h1 span,
.portal-hero h1 strong,
.portal-hero h1 em,
.portal-hero h1 b {
  -webkit-text-stroke: 0.35px rgba(255, 247, 241, 0.12);
}

.portal-hero h1 strong,
.portal-hero h1 b {
  -webkit-text-stroke-color: rgba(255, 206, 211, 0.18);
}

.portal-section-head h2 {
  position: relative;
  z-index: 1;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 9px 28px rgba(0, 0, 0, 0.58);
}

.portal-section-head h2::before {
  position: absolute;
  top: 50%;
  left: -29px;
  width: 5px;
  height: 0.72em;
  background: linear-gradient(to bottom, var(--red-pomegranate), rgba(200, 16, 46, 0.12));
  content: "";
  transform: translateY(-50%) skewY(-7deg);
}

.memory-gallery-head h2 {
  -webkit-text-stroke: 0.3px rgba(255, 239, 229, 0.16);
  text-shadow:
    0 2px 0 rgba(87, 3, 14, 0.28),
    0 8px 34px rgba(31, 0, 5, 0.5);
}

.memory-gallery-head h2::before,
.memory-gallery-head h2::after {
  display: inline-block;
  margin: 0 20px;
  color: rgba(255, 235, 225, 0.27);
  font-family: var(--portal-serif);
  font-size: 0.24em;
  vertical-align: middle;
  content: "◆";
}

.memory-frame {
  outline: 0;
  cursor: zoom-in;
}

.memory-frame:focus-visible {
  box-shadow:
    0 0 0 3px var(--red-pomegranate),
    0 5px 0 rgba(48, 20, 17, 0.3),
    0 35px 58px rgba(22, 2, 6, 0.6);
}

.memory-frame::after {
  position: absolute;
  inset: 9px;
  z-index: 2;
  background: linear-gradient(112deg, transparent 26%, rgba(255, 248, 235, 0.13) 42%, transparent 56%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 220ms ease, transform 560ms ease;
}

.memory-frame:hover::after,
.memory-frame:focus-visible::after {
  opacity: 1;
  transform: translateX(42%);
}

.gallery-lightbox {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  width: min(1110px, 100%);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid rgba(245, 239, 230, 0.19);
  color: #2d1a18;
  background: #f1e9df;
  box-shadow: 0 44px 110px rgba(0, 0, 0, 0.78);
  animation: galleryLightboxIn 430ms cubic-bezier(0.17, 0.74, 0.18, 1) both;
}

@keyframes galleryLightboxIn {
  from { opacity: 0; transform: scale(0.965) translateY(18px); }
}

.gallery-lightbox::before {
  position: absolute;
  inset: 12px;
  z-index: 3;
  border: 1px solid rgba(86, 41, 34, 0.14);
  content: "";
  pointer-events: none;
}

.gallery-lightbox .portal-close {
  top: 23px;
  right: 23px;
  z-index: 5;
  color: rgba(245, 239, 230, 0.76);
  border-color: rgba(255, 249, 242, 0.22);
  background: rgba(17, 10, 11, 0.55);
}

.gallery-lightbox > figure {
  position: relative;
  min-height: 610px;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(200, 16, 46, 0.14), transparent 54%),
    #160e10;
}

.gallery-lightbox > figure::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 72%, rgba(241, 233, 223, 0.24)),
    linear-gradient(to top, rgba(9, 5, 6, 0.42), transparent 35%);
  content: "";
  pointer-events: none;
}

.gallery-lightbox > figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.3) saturate(0.73) contrast(1.08) brightness(0.9);
}

.gallery-viewer-index {
  position: absolute;
  bottom: 27px;
  left: 28px;
  z-index: 2;
  color: rgba(255, 244, 235, 0.67);
  font-family: var(--portal-serif);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.gallery-viewer-copy {
  position: relative;
  display: flex;
  min-height: 610px;
  flex-direction: column;
  justify-content: center;
  padding: 58px 52px;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(96, 52, 40, 0.035) 28px),
    radial-gradient(circle at 100% 0, rgba(200, 16, 46, 0.08), transparent 37%),
    #f1e9df;
}

.gallery-viewer-copy > span:first-child {
  color: var(--red-deep);
  font-size: 9px;
  letter-spacing: 0.19em;
}

.gallery-viewer-copy h2 {
  margin: 13px 0 0;
  font-family: var(--portal-kai);
  font-size: clamp(32px, 3.6vw, 49px);
  font-weight: 400;
  line-height: 1.25;
}

.gallery-viewer-copy > p {
  margin: 22px 0 0;
  color: rgba(53, 28, 25, 0.7);
  font-family: var(--portal-serif);
  font-size: 14px;
  line-height: 2;
}

.gallery-viewer-copy blockquote {
  margin: 26px 0 0;
  padding: 17px 0 17px 18px;
  border-left: 2px solid var(--red-deep);
  color: rgba(69, 33, 28, 0.74);
  font-family: var(--portal-kai);
  font-size: 15px;
  line-height: 1.8;
}

.gallery-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 17px;
  border-top: 1px solid rgba(74, 34, 28, 0.16);
}

.gallery-viewer-nav button {
  border: 0;
  color: rgba(51, 27, 24, 0.64);
  background: transparent;
  font-size: 10px;
}

.gallery-viewer-nav button:hover {
  color: var(--red-deep);
}

.gallery-viewer-nav span {
  color: rgba(51, 27, 24, 0.36);
  font-family: var(--portal-serif);
  font-size: 9px;
}

@media (max-width: 760px) {
  .portal-section-head h2::before {
    left: -14px;
    width: 3px;
  }

  .memory-gallery-head h2::before,
  .memory-gallery-head h2::after {
    display: none;
  }

  .gallery-lightbox {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 30px);
    overflow-y: auto;
  }

  .gallery-lightbox > figure {
    min-height: 0;
    height: min(48vh, 390px);
  }

  .gallery-viewer-copy {
    min-height: 0;
    padding: 31px 24px 28px;
  }

  .gallery-viewer-copy h2 {
    font-size: 31px;
  }

  .gallery-viewer-copy > p {
    font-size: 12px;
  }

  .gallery-lightbox .portal-close {
    top: 13px;
    right: 13px;
  }
}

@media (max-width: 640px) {
  .portal-header {
    width: 100%;
    padding: 0 14px;
    box-sizing: border-box;
  }

  .portal-main,
  .portal-footer {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
    box-sizing: border-box;
  }

  .portal-hero {
    width: 100%;
    padding-right: 0;
    padding-left: 0;
    box-sizing: border-box;
  }

  .portal-hero-copy,
  .portal-hero-actions,
  .portal-lead {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .portal-lead {
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .portal-primary,
  .portal-secondary {
    max-width: 100%;
  }
}

/* ============================================================
   第四版追加：传统文化纹样 · 红色精神象征 · 知识问答精修
   ============================================================ */

button,
[role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button.is-pressed {
  transform: translateY(1px) scale(0.985) !important;
}

.button-craft-ripple {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(255, 246, 239, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 239, 0.24), rgba(230, 57, 70, 0.1) 45%, transparent 70%);
  pointer-events: none;
  transform: scale(0);
  animation: buttonCraftRipple 480ms ease-out forwards;
  mix-blend-mode: screen;
}

@keyframes buttonCraftRipple {
  to {
    opacity: 0;
    transform: scale(1);
  }
}

.portal-primary,
.portal-secondary {
  border-radius: 2px;
}

.portal-primary::after,
.portal-secondary::after,
.login-submit::after,
.quiz-next::after {
  position: absolute;
  top: 5px;
  right: 5px;
  color: rgba(255, 246, 239, 0.33);
  font-size: 7px;
  content: "◆";
  pointer-events: none;
}

.portal-secondary::after {
  color: rgba(230, 57, 70, 0.58);
}

.tool-button {
  border-left-color: rgba(230, 57, 70, 0.3);
}

.portal-gate > .login-card,
.portal-gate > .directory-sheet,
.portal-gate > .spirit-room,
.portal-gate > .quiz-card,
.portal-gate > .letter-card,
.portal-gate > .guide-card,
.portal-gate > .scene-help-card {
  z-index: 2;
}

.exhibition-card::before,
.exhibition-card::after,
.thread-stop button::before,
.spirit-lamp i::after {
  pointer-events: none;
}

/* 传统回纹与云雷意象：不做文物复刻，只作为界面纹样 */
.quiz-card {
  width: min(780px, 100%);
  padding: 0;
  overflow: hidden;
  border-color: rgba(230, 57, 70, 0.48);
  background:
    linear-gradient(135deg, rgba(200, 16, 46, 0.12), transparent 32%),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(245, 239, 230, 0.018) 39px),
    #140c0f;
  box-shadow:
    0 40px 110px rgba(0, 0, 0, 0.72),
    inset 0 0 0 5px rgba(255, 255, 255, 0.018);
}

.quiz-card::before {
  position: absolute;
  inset: 11px;
  z-index: 1;
  border: 1px solid rgba(230, 57, 70, 0.13);
  content: "";
  pointer-events: none;
}

.quiz-card > header {
  position: relative;
  padding: 33px 38px 22px;
  border-bottom: 1px solid rgba(230, 57, 70, 0.25);
  background:
    radial-gradient(circle at 14% 30%, rgba(230, 57, 70, 0.17), transparent 27%),
    linear-gradient(110deg, rgba(200, 16, 46, 0.1), transparent 54%);
}

.quiz-card header > p:first-child {
  margin: 0 0 14px;
  color: rgba(230, 57, 70, 0.78);
  font-size: 8px;
  letter-spacing: 0.24em;
}

.quiz-card header > div:nth-child(2) {
  align-items: center;
  margin-top: 0;
}

.quiz-title-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quiz-seal {
  display: grid;
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  place-items: center;
  color: #fff7f2;
  border: 1px solid rgba(255, 245, 238, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent),
    #a4161a;
  font-family: var(--portal-kai);
  font-size: 23px;
  box-shadow: 0 0 0 5px rgba(200, 16, 46, 0.11);
  transform: rotate(-4deg);
}

.quiz-title-lockup h2 {
  font-size: 38px;
  line-height: 1;
}

.quiz-title-lockup p {
  margin: 7px 0 0;
  color: rgba(245, 239, 230, 0.43);
  font-family: var(--portal-serif);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.quiz-card header > div:nth-child(2) > span {
  min-width: 64px;
  color: rgba(245, 239, 230, 0.5);
  font-family: var(--portal-serif);
  font-size: 13px;
  text-align: right;
}

.quiz-progress {
  position: relative;
  height: 4px;
  margin-top: 22px;
  overflow: visible;
  background: rgba(245, 239, 230, 0.09);
}

.quiz-progress i {
  background: linear-gradient(90deg, #9e1b32, #e63946);
  box-shadow: 0 0 12px rgba(230, 57, 70, 0.42);
}

.quiz-star-track {
  position: absolute;
  right: 0;
  bottom: -13px;
  display: flex;
  gap: 4px;
}

.quiz-star-track span {
  color: rgba(245, 239, 230, 0.12);
  font-size: 13px;
  line-height: 1;
  transition: color 220ms ease, transform 220ms ease, filter 220ms ease;
}

.quiz-star-track span.lit {
  color: var(--red-pomegranate);
  filter: drop-shadow(0 0 6px rgba(230, 57, 70, 0.75));
}

.quiz-star-track span.current {
  color: rgba(255, 225, 220, 0.72);
  animation: quizStarCurrent 1.4s ease-in-out infinite;
}

@keyframes quizStarCurrent {
  50% { opacity: 0.35; transform: scale(0.8); }
}

.quiz-card #quizBody {
  position: relative;
  z-index: 2;
  padding: 26px 38px 32px;
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.quiz-meta span:first-child {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(230, 57, 70, 0.34);
  color: rgba(245, 239, 230, 0.63);
  background: rgba(200, 16, 46, 0.11);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.quiz-meta span:first-child::before {
  margin-right: 6px;
  color: var(--red-pomegranate);
  content: "★";
}

.quiz-meta span:last-child {
  color: rgba(245, 239, 230, 0.32);
  font-size: 8px;
}

.quiz-question-frame {
  position: relative;
  padding: 25px 25px 22px;
  color: #3f2020;
  border: 1px solid rgba(245, 232, 218, 0.76);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 44%),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(91, 44, 39, 0.05) 30px),
    #f1e9dc;
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.21),
    0 14px 30px rgba(0, 0, 0, 0.28);
}

.quiz-question-frame::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(140, 28, 19, 0.12);
  content: "";
  pointer-events: none;
}

.quiz-corner {
  position: absolute;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-color: rgba(140, 28, 19, 0.48);
  pointer-events: none;
}

.quiz-corner.corner-a {
  top: 11px;
  left: 11px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.quiz-corner.corner-b {
  right: 11px;
  bottom: 11px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.quiz-card #quizQuestion {
  position: relative;
  z-index: 2;
  min-height: 56px;
  margin: 0;
  color: #3b1b1b;
  font-family: var(--portal-kai);
  font-size: 21px;
  line-height: 1.56;
}

.quiz-options {
  position: relative;
  z-index: 2;
  gap: 7px;
  margin-top: 19px;
}

.quiz-option {
  position: relative;
  display: grid;
  grid-template-columns: 31px 30px 1fr auto;
  align-items: center;
  min-height: 54px;
  gap: 9px;
  padding: 7px 12px 7px 8px;
  overflow: hidden;
  border: 1px solid rgba(81, 36, 33, 0.17);
  color: #4c2b29;
  background:
    linear-gradient(90deg, rgba(140, 28, 19, 0.035), transparent 21%),
    rgba(255, 255, 255, 0.24);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.quiz-option::before,
.quiz-option::after {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(140, 28, 19, 0.22);
  content: "";
  pointer-events: none;
}

.quiz-option::before {
  top: 5px;
  left: 5px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.quiz-option::after {
  right: 5px;
  bottom: 5px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.quiz-option:hover:not(:disabled) {
  z-index: 2;
  border-color: rgba(140, 28, 19, 0.5);
  background:
    linear-gradient(90deg, rgba(140, 28, 19, 0.07), transparent 26%),
    rgba(255, 255, 255, 0.35);
  box-shadow: 0 7px 15px rgba(70, 26, 22, 0.08);
  transform: translateY(-1px);
}

.quiz-option:focus-visible {
  outline-color: #8c1c13;
}

.option-index {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: #fff4eb;
  background: #8c1c13;
  font-family: var(--portal-kai);
  font-size: 13px;
  box-shadow: 0 2px 0 rgba(71, 12, 8, 0.32);
}

.option-symbol {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: rgba(140, 28, 19, 0.74);
  border: 1px solid rgba(140, 28, 19, 0.22);
  border-radius: 50%;
  font-family: var(--portal-kai);
  font-size: 11px;
  font-style: normal;
}

.option-copy {
  position: relative;
  z-index: 2;
  color: #3f2220 !important;
  font-family: var(--portal-serif);
  font-size: 14px;
  line-height: 1.45;
}

.quiz-question-frame .quiz-option {
  color: #3f2220;
}

.quiz-question-frame .quiz-option.correct .option-copy,
.quiz-question-frame .quiz-option.correct {
  color: #fff9f5 !important;
}

.option-state {
  color: rgba(76, 43, 41, 0.28);
  font-family: var(--portal-sans);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.quiz-option.correct {
  color: #fff9f5;
  border-color: #f0ce86;
  background:
    linear-gradient(90deg, rgba(255, 241, 204, 0.14), transparent 45%),
    #8c1c13;
  box-shadow: 0 0 0 2px rgba(240, 206, 134, 0.18), 0 9px 20px rgba(83, 14, 10, 0.19);
}

.quiz-option.correct .option-index {
  color: #6a1510;
  background: #f3dcaa;
}

.quiz-option.correct .option-symbol {
  color: #fff3df;
  border-color: rgba(255, 244, 224, 0.55);
}

.quiz-option.correct .option-state {
  color: #f3dcaa;
}

.quiz-option.wrong {
  border-color: rgba(82, 58, 63, 0.35);
  background: rgba(78, 66, 70, 0.2);
  opacity: 0.68;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-hint-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 13px;
}

.quiz-hint-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  width: 188px;
  min-height: 49px;
  flex: 0 0 188px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid rgba(200, 16, 46, 0.28);
  color: rgba(245, 239, 230, 0.66);
  background:
    radial-gradient(circle at 18% 50%, rgba(230, 57, 70, 0.15), transparent 35%),
    rgba(200, 16, 46, 0.055);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.quiz-hint-btn:hover:not(:disabled) {
  border-color: rgba(230, 57, 70, 0.6);
  background: rgba(200, 16, 46, 0.11);
  transform: translateY(-1px);
}

.quiz-hint-btn i {
  grid-row: 1 / 3;
  display: grid;
  width: 30px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(230, 57, 70, 0.34);
  border-radius: 16px 16px 5px 5px;
  color: #ffc9cd;
  background: rgba(200, 16, 46, 0.12);
  font-family: var(--portal-kai);
  font-size: 11px;
  font-style: normal;
  box-shadow: inset 0 0 12px rgba(230, 57, 70, 0.18);
}

.quiz-hint-btn span {
  align-self: end;
  font-family: var(--portal-kai);
  font-size: 12px;
}

.quiz-hint-btn small {
  align-self: start;
  color: rgba(245, 239, 230, 0.29);
  font-family: var(--portal-sans);
  font-size: 7px;
}

.quiz-hint-btn:disabled {
  cursor: default;
  opacity: 0.52;
}

#quizHintText {
  flex: 1;
  margin: 0;
  padding: 11px 13px;
  border-left: 2px solid rgba(230, 57, 70, 0.6);
  color: rgba(245, 239, 230, 0.52);
  background: rgba(200, 16, 46, 0.055);
  font-family: var(--portal-serif);
  font-size: 11px;
  line-height: 1.7;
  animation: quizHintReveal 280ms ease both;
}

@keyframes quizHintReveal {
  from { opacity: 0; transform: translateX(-6px); }
}

.quiz-feedback-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 239, 230, 0.08);
}

.quiz-feedback-seal {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid rgba(230, 57, 70, 0.34);
  color: rgba(230, 57, 70, 0.74);
  font-family: var(--portal-kai);
  font-size: 11px;
}

.quiz-card .quiz-feedback {
  min-height: 30px;
  margin: 0;
  color: rgba(245, 239, 230, 0.48);
  font-family: var(--portal-serif);
  font-size: 11px;
}

.quiz-card .quiz-next {
  width: 100%;
  margin-top: 5px;
  justify-content: center;
  min-height: 48px;
}

.quiz-card .quiz-next span {
  margin-left: 8px;
}

.quiz-result {
  position: relative;
  z-index: 2;
  padding: 42px 38px 34px;
  overflow: hidden;
}

.quiz-result-shine {
  position: absolute;
  top: -160px;
  left: 50%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.18), transparent 66%);
  pointer-events: none;
  transform: translateX(-50%);
}

.quiz-result .quiz-medal {
  position: relative;
  width: 82px;
  height: 82px;
  font-size: 32px;
  filter: drop-shadow(0 12px 24px rgba(200, 16, 46, 0.26));
  animation: quizMedalIn 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes quizMedalIn {
  from { opacity: 0; transform: scale(0.55) rotate(-28deg); }
}

.quiz-result-stars {
  margin-top: 13px;
  color: var(--red-pomegranate);
  font-size: 18px;
  letter-spacing: 5px;
  text-shadow: 0 0 12px rgba(230, 57, 70, 0.45);
}

.quiz-result > p:first-of-type {
  margin-top: 12px;
}

.quiz-result h3 {
  margin-top: 9px;
  font-size: 35px;
}

.quiz-source-note {
  margin: 24px auto 0;
  padding-top: 14px;
  border-top: 1px solid rgba(245, 239, 230, 0.08);
  color: rgba(245, 239, 230, 0.24) !important;
  font-size: 8px !important;
  line-height: 1.6;
}

.quiz-result > div {
  gap: 9px;
}

.quiz-result .portal-primary,
.quiz-result .portal-secondary {
  min-width: 142px;
  justify-content: center;
}

/* 触屏区域：主要按钮不小于 44px，并避免指针层遮挡 */
@media (pointer: coarse) {
  .portal-primary,
  .portal-secondary,
  .quiz-option,
  .quiz-hint-btn,
  .star-list button,
  .star-index-filter button,
  .spirit-lamp,
  .portal-close,
  .event-panel-close,
  .scene-header-tools button,
  .map-zoom-controls button,
  .war-layer-controls button {
    min-height: 44px;
  }

  .quiz-option {
    grid-template-columns: 34px 31px 1fr;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .option-state {
    display: none;
  }

  .option-copy {
    font-size: 15px;
  }

  .quiz-hint-btn {
    width: 100%;
    flex-basis: 100%;
  }

  .quiz-hint-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .quiz-gate {
    padding: 10px;
  }

  .quiz-card {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    min-width: 0 !important;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .quiz-card > header,
  .quiz-card #quizBody,
  .quiz-question-frame,
  .quiz-options,
  .quiz-option {
    min-width: 0;
    max-width: 100%;
  }

  .quiz-card > header {
    padding: 25px 20px 19px;
  }

  .quiz-card #quizBody {
    padding: 20px 19px 24px;
  }

  .quiz-title-lockup h2 {
    font-size: 29px;
  }

  .quiz-title-lockup p {
    display: none;
  }

  .quiz-question-frame {
    width: 100%;
    padding: 22px 16px 17px;
    overflow: hidden;
  }

  .quiz-card #quizQuestion {
    font-size: 18px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .quiz-option {
    grid-template-columns: 31px 1fr;
    min-height: 53px;
  }

  .option-symbol {
    display: none;
  }

  .quiz-result {
    padding: 34px 20px 28px;
  }

  .quiz-result h3 {
    font-size: 29px;
  }

  .quiz-result > div {
    flex-direction: column;
  }

  .quiz-result .portal-primary,
  .quiz-result .portal-secondary {
    width: 100%;
  }
}

/* ============================================================
   第五版追加：今日回信 · 一封家书的旅程
   ============================================================ */

.today-gate {
  padding: 18px;
  perspective: 1500px;
}

.today-gate .portal-gate-backdrop {
  background:
    radial-gradient(circle at 50% 45%, rgba(200, 16, 46, 0.14), transparent 44%),
    repeating-linear-gradient(38deg, transparent 0 50px, rgba(245, 239, 230, 0.012) 51px),
    rgba(5, 3, 4, 0.91);
}

.today-gate .letter-card {
  width: min(940px, calc(100vw - 36px));
  max-width: 940px;
  max-height: calc(100vh - 36px);
  padding: 18px;
  overflow: hidden;
  color: var(--paper);
  border: 1px solid rgba(230, 57, 70, 0.34);
  background:
    radial-gradient(560px 400px at 50% 0%, rgba(200, 16, 46, 0.14), transparent 65%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(245, 239, 230, 0.014) 47px),
    #130b0e;
  box-shadow:
    0 40px 110px rgba(0, 0, 0, 0.72),
    inset 0 0 0 6px rgba(255, 255, 255, 0.015);
}

.today-gate .letter-card::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(230, 57, 70, 0.12);
  content: "";
  pointer-events: none;
}

.today-gate .letter-card .portal-close {
  z-index: 8;
  color: rgba(245, 239, 230, 0.66);
  border-color: rgba(245, 239, 230, 0.18);
  background: rgba(20, 11, 15, 0.76);
}

.letter-atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.letter-atmosphere span {
  position: absolute;
  color: rgba(230, 57, 70, 0.045);
  font-family: var(--portal-serif);
  font-size: 104px;
  letter-spacing: -0.06em;
}

.letter-atmosphere span:nth-child(1) {
  top: 9%;
  left: 2%;
}

.letter-atmosphere span:nth-child(2) {
  top: 42%;
  right: 1%;
}

.letter-atmosphere span:nth-child(3) {
  bottom: 2%;
  left: 18%;
}

.letter-experience {
  position: relative;
  height: min(600px, calc(100vh - 74px));
  min-height: 560px;
  overflow: hidden;
  perspective: 1600px;
  transform-style: preserve-3d;
}

/* 牛皮纸信封 */
.letter-envelope {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: min(670px, calc(100% - 80px));
  height: 350px;
  transform: translate(-50%, -48%);
  transform-style: preserve-3d;
  transition:
    transform 850ms cubic-bezier(0.2, 0.75, 0.18, 1),
    opacity 600ms ease,
    filter 600ms ease;
}

.letter-envelope::after {
  position: absolute;
  right: 8%;
  bottom: -40px;
  left: 8%;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  content: "";
  filter: blur(24px);
  transform: translateZ(-20px);
}

.envelope-back,
.envelope-front,
.envelope-flap {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(86, 53, 36, 0.36);
  background:
    repeating-radial-gradient(circle at 23% 25%, transparent 0 2px, rgba(92, 57, 41, 0.035) 3px 4px),
    linear-gradient(145deg, #d7c2a2, #c8ad88 56%, #b69771);
  box-shadow:
    inset 0 0 34px rgba(86, 49, 33, 0.15),
    0 24px 55px rgba(0, 0, 0, 0.44);
}

.envelope-back {
  z-index: 1;
}

.envelope-front {
  z-index: 3;
  overflow: hidden;
  background:
    linear-gradient(35deg, transparent 49.7%, rgba(91, 53, 35, 0.16) 50%, transparent 50.4%),
    linear-gradient(-35deg, transparent 49.7%, rgba(91, 53, 35, 0.14) 50%, transparent 50.4%),
    repeating-radial-gradient(circle at 23% 25%, transparent 0 2px, rgba(92, 57, 41, 0.032) 3px 4px),
    linear-gradient(145deg, #d9c4a5, #c6aa83 56%, #b3946d);
}

.envelope-flap {
  z-index: 5;
  height: 56%;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 900ms cubic-bezier(0.19, 0.72, 0.18, 1), z-index 0ms 440ms;
  backface-visibility: visible;
}

.envelope-flap span,
.envelope-flap i {
  position: absolute;
  top: 24px;
  left: 50%;
  z-index: 2;
  color: rgba(77, 39, 29, 0.61);
  font-family: var(--portal-kai);
  font-size: 14px;
  font-style: normal;
  letter-spacing: 0.25em;
  transform: translateX(-50%);
}

.envelope-flap i {
  top: 48px;
  color: rgba(77, 39, 29, 0.34);
  font-family: var(--portal-serif);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.envelope-address {
  position: absolute;
  top: 84px;
  right: 48px;
  left: 48px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(82, 44, 29, 0.2);
  border-bottom: 1px solid rgba(82, 44, 29, 0.2);
  color: #4d2b22;
}

.envelope-address span {
  align-self: center;
  color: rgba(140, 28, 19, 0.74);
  font-family: var(--portal-kai);
  font-size: 15px;
}

.envelope-address strong {
  font-family: var(--portal-kai);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.envelope-address small {
  grid-column: 2;
  color: rgba(77, 43, 34, 0.44);
  font-family: var(--portal-serif);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.envelope-postmark {
  position: absolute;
  right: 28px;
  bottom: 23px;
  z-index: 2;
  display: grid;
  width: 110px;
  height: 93px;
  place-content: center;
  color: rgba(113, 24, 20, 0.6);
  border: 2px double rgba(113, 24, 20, 0.42);
  border-radius: 50%;
  text-align: center;
  transform: rotate(-9deg);
}

.envelope-postmark span,
.envelope-postmark small {
  font-family: var(--portal-sans);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.envelope-postmark strong {
  margin: 2px 0;
  font-family: var(--portal-serif);
  font-size: 21px;
  font-weight: 400;
}

.envelope-fibers {
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background:
    linear-gradient(78deg, transparent 0 45%, rgba(80, 46, 30, 0.12) 45.3%, transparent 45.7%),
    linear-gradient(104deg, transparent 0 68%, rgba(255, 247, 232, 0.16) 68.2%, transparent 68.7%);
  pointer-events: none;
}

.letter-wax-seal {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 7;
  display: grid;
  width: 58px;
  height: 58px;
  padding: 3px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #ffe5d8;
  background:
    radial-gradient(circle at 35% 29%, #e94d55, #a4161a 45%, #690e11 82%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 195, 182, 0.18),
    inset 0 -4px 8px rgba(62, 5, 7, 0.42),
    0 8px 18px rgba(67, 8, 11, 0.5);
  transform: translate(-50%, -50%) rotate(-8deg);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 280ms ease;
}

.letter-wax-seal::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 224, 207, 0.34);
  border-radius: 50%;
  content: "";
}

.letter-wax-seal:hover {
  box-shadow:
    inset 0 0 0 3px rgba(255, 211, 199, 0.24),
    inset 0 -4px 8px rgba(62, 5, 7, 0.42),
    0 12px 25px rgba(100, 8, 15, 0.58),
    0 0 0 8px rgba(200, 16, 46, 0.08);
  transform: translate(-50%, -50%) rotate(-3deg) scale(1.06);
}

.letter-wax-seal span {
  font-family: var(--portal-kai);
  font-size: 21px;
}

.letter-wax-seal small {
  position: absolute;
  top: 67px;
  width: 100px;
  color: rgba(245, 231, 215, 0.58);
  font-family: var(--portal-sans);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.envelope-hint {
  position: absolute;
  bottom: -51px;
  left: 50%;
  width: max-content;
  max-width: 88vw;
  margin: 0;
  color: rgba(245, 231, 215, 0.35);
  font-family: var(--portal-serif);
  font-size: 9px;
  letter-spacing: 0.1em;
  transform: translateX(-50%);
}

/* 宣纸信笺 */
.letter-paper {
  position: absolute;
  inset: 0 18px;
  z-index: 3;
  padding: 34px 46px 30px;
  overflow-y: auto;
  color: #3b211d;
  border: 1px solid rgba(107, 62, 45, 0.26);
  background:
    linear-gradient(90deg, transparent 0 34px, rgba(164, 22, 26, 0.12) 34px 35px, transparent 35px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(91, 53, 43, 0.09) 32px),
    radial-gradient(circle at 15% 9%, rgba(255, 255, 255, 0.75), transparent 27%),
    #e9decc;
  box-shadow:
    0 -4px 0 rgba(202, 186, 160, 0.8),
    0 -8px 0 rgba(245, 239, 230, 0.3),
    0 28px 70px rgba(0, 0, 0, 0.46);
  transform: perspective(1400px) rotateX(-88deg) translateY(-80px) scale(0.9);
  transform-origin: top center;
  opacity: 0;
  pointer-events: none;
  filter: brightness(0.7);
  transition:
    transform 900ms cubic-bezier(0.17, 0.76, 0.16, 1),
    opacity 500ms ease,
    filter 700ms ease;
  scrollbar-color: rgba(140, 28, 19, 0.32) transparent;
}

.letter-paper::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(111, 57, 42, 0.15);
  content: "";
  pointer-events: none;
}

.letter-paper::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 17% 23%, rgba(92, 49, 36, 0.06) 0 1px, transparent 1.5px),
    radial-gradient(circle at 73% 64%, rgba(92, 49, 36, 0.05) 0 1px, transparent 1.5px);
  background-size: 11px 11px, 17px 17px;
  content: "";
  opacity: 0.45;
  pointer-events: none;
}

.paper-corner {
  position: absolute;
  z-index: 2;
  width: 37px;
  height: 37px;
  border-color: rgba(140, 28, 19, 0.42);
}

.paper-corner-a {
  top: 17px;
  left: 17px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.paper-corner-b {
  right: 17px;
  bottom: 17px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.letter-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px dashed rgba(71, 37, 28, 0.27);
}

.letter-head > div {
  display: grid;
  gap: 5px;
}

.letter-head span {
  color: rgba(140, 28, 19, 0.7);
  font-family: var(--portal-sans);
  font-size: 8px;
  letter-spacing: 0.17em;
}

.letter-head strong {
  font-family: var(--portal-kai);
  font-size: 31px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.letter-head small {
  color: rgba(59, 33, 29, 0.42);
  font-family: var(--portal-serif);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.letter-fold-btn {
  min-width: 78px;
  height: 31px;
  border: 1px solid rgba(82, 42, 33, 0.23);
  color: rgba(61, 31, 26, 0.56);
  background: rgba(255, 255, 255, 0.14);
  font-family: var(--portal-sans);
  font-size: 8px;
}

.letter-fold-btn:hover {
  color: #8c1c13;
  border-color: rgba(140, 28, 19, 0.42);
}

.letter-greeting {
  position: relative;
  z-index: 2;
  margin-top: 17px;
}

.letter-greeting span {
  font-family: var(--portal-kai);
  font-size: 16px;
}

.letter-greeting p {
  margin: 7px 0 0;
  color: rgba(58, 31, 26, 0.68);
  font-family: var(--portal-kai);
  font-size: 13px;
  line-height: 1.8;
}

.today-gate .letter-field {
  position: relative;
  z-index: 2;
  gap: 7px;
  margin-top: 14px;
}

.today-gate .letter-field > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(68, 35, 29, 0.66);
  font-family: var(--portal-kai);
  font-size: 13px;
}

.letter-field > span i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #fff4e8;
  background: #8c1c13;
  font-size: 10px;
  font-style: normal;
}

.today-gate .letter-field textarea {
  min-height: 130px;
  padding: 12px 14px;
  resize: vertical;
  color: #3b211d;
  border: 1px solid rgba(69, 36, 27, 0.2);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.27), transparent 38%),
    rgba(255, 255, 255, 0.18);
  font-family: var(--portal-kai);
  font-size: 16px;
  line-height: 1.75;
}

.today-gate .letter-field textarea:focus {
  border-color: rgba(140, 28, 19, 0.55);
  box-shadow: 0 0 0 3px rgba(140, 28, 19, 0.07);
}

.today-gate .letter-field textarea::placeholder {
  color: rgba(58, 31, 26, 0.2);
}

.letter-count {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 2px 5px;
  color: rgba(58, 31, 26, 0.34);
  background: rgba(233, 222, 204, 0.82);
  font-family: var(--portal-sans);
  font-size: 7px;
}

.letter-count b {
  color: rgba(140, 28, 19, 0.68);
  font-weight: 400;
}

.today-gate .letter-suggestions {
  position: relative;
  z-index: 2;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
}

.letter-suggestions > span {
  margin-right: 2px;
  color: rgba(140, 28, 19, 0.62);
  font-family: var(--portal-sans);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.today-gate .letter-suggestions button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(82, 42, 33, 0.17);
  color: rgba(60, 31, 26, 0.55);
  background: rgba(255, 255, 255, 0.12);
  font-family: var(--portal-serif);
  font-size: 8px;
}

.today-gate .letter-suggestions button:hover {
  color: #8c1c13;
  border-color: rgba(140, 28, 19, 0.37);
  background: rgba(255, 255, 255, 0.24);
}

.today-gate .letter-actions {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(70, 37, 27, 0.22);
}

.today-gate .letter-actions > span {
  color: rgba(59, 31, 26, 0.42);
  font-family: var(--portal-sans);
  font-size: 8px;
}

.letter-actions > span i {
  margin-right: 5px;
  color: #a4161a;
  font-style: normal;
}

.today-gate .letter-actions .portal-primary {
  min-height: 43px;
  color: #fff8f2;
  border: 0;
  background: #8c1c13;
  font-family: var(--portal-kai);
}

.letter-signature {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 14px;
  color: rgba(67, 35, 28, 0.53);
  font-family: var(--portal-kai);
}

.letter-signature span {
  color: #6d1b16;
  font-size: 15px;
}

.letter-signature small,
.letter-signature time {
  font-size: 9px;
}

.today-gate .letter-saved {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  padding: 10px 13px;
  border: 1px solid rgba(140, 28, 19, 0.2);
  background: rgba(255, 255, 255, 0.15);
  animation: letterSealed 620ms cubic-bezier(0.18, 0.74, 0.22, 1) both;
}

@keyframes letterSealed {
  from { opacity: 0; transform: scale(0.94); }
}

.saved-seal {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #fff0e3;
  background: #a4161a;
  font-family: var(--portal-kai);
  font-size: 12px;
  transform: rotate(-7deg);
}

.today-gate .letter-saved > div {
  display: grid;
  gap: 2px;
}

.today-gate .letter-saved > div strong {
  color: #5b211b;
  font-family: var(--portal-kai);
  font-size: 11px;
}

.today-gate .letter-saved p {
  margin: 0;
  color: rgba(59, 31, 26, 0.48);
  font-size: 8px;
}

.paper-wax-mark {
  position: absolute;
  right: 42px;
  bottom: 33px;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: rgba(140, 28, 19, 0.23);
  border: 2px solid rgba(140, 28, 19, 0.2);
  border-radius: 50%;
  font-family: var(--portal-kai);
  font-size: 15px;
  transform: rotate(-12deg);
  opacity: 0;
  transition: opacity 300ms ease, transform 420ms ease;
}

/* 状态与展开动作 */
.letter-experience[data-stage="opening"] .envelope-flap,
.letter-experience[data-stage="open"] .envelope-flap {
  z-index: 1;
  transform: rotateX(178deg);
}

.letter-experience[data-stage="opening"] .letter-envelope {
  opacity: 0.5;
  filter: blur(1px) brightness(0.72);
  transform: translate(-50%, 105%) scale(0.78) rotateX(8deg);
  pointer-events: none;
}

.letter-experience[data-stage="open"] .letter-envelope {
  opacity: 0;
  filter: blur(2px) brightness(0.62);
  transform: translate(-50%, 145%) scale(0.72) rotateX(8deg);
  pointer-events: none;
}

.letter-experience[data-stage="opening"] .letter-paper {
  opacity: 1;
  filter: brightness(1);
  transform: perspective(1400px) rotateX(-45deg) translateY(-18px) scale(0.97);
  pointer-events: none;
}

.letter-experience[data-stage="open"] .letter-paper {
  opacity: 1;
  filter: brightness(1);
  transform: perspective(1400px) rotateX(0deg) translateY(0) scale(1);
  pointer-events: auto;
}

.letter-experience[data-stage="open"] .paper-wax-mark,
.letter-experience.sealed .paper-wax-mark {
  opacity: 1;
  transform: rotate(-8deg) scale(1);
}

.letter-experience.sealed .letter-paper {
  animation: sealedPaperGlow 900ms ease;
}

@keyframes sealedPaperGlow {
  45% { box-shadow: 0 -4px 0 rgba(202, 186, 160, 0.8), 0 0 0 4px rgba(164, 22, 26, 0.18), 0 28px 70px rgba(0, 0, 0, 0.46); }
}

@media (max-width: 760px) {
  .today-gate {
    padding: 8px;
  }

  .today-gate .letter-card {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 7px;
  }

  .letter-experience {
    height: calc(100vh - 32px);
    min-height: 580px;
  }

  .letter-envelope {
    width: calc(100% - 28px);
    height: 290px;
  }

  .envelope-address {
    top: 67px;
    right: 25px;
    left: 25px;
    padding: 10px 12px;
  }

  .envelope-address strong {
    font-size: 20px;
  }

  .envelope-postmark {
    right: 18px;
    bottom: 19px;
    width: 88px;
    height: 76px;
  }

  .letter-paper {
    inset: 0;
    padding: 27px 22px 25px;
  }

  .letter-head strong {
    font-size: 25px;
  }

  .letter-head small {
    max-width: 190px;
  }

  .letter-fold-btn {
    min-width: 66px;
    font-size: 7px;
  }

  .today-gate .letter-field textarea {
    min-height: 128px;
    font-size: 15px;
  }

  .today-gate .letter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .today-gate .letter-actions .portal-primary {
    width: 100%;
  }

  .today-gate .letter-suggestions {
    align-items: flex-start;
    flex-direction: column;
  }

  .today-gate .letter-suggestions button {
    width: 100%;
    min-height: 36px;
    text-align: left;
  }

  .letter-greeting p {
    font-size: 12px;
  }

  .letter-signature {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .letter-envelope,
  .envelope-flap,
  .letter-paper {
    transition-duration: 1ms !important;
  }
}
