/* ══════════════════════════════════════════════════════════
   入口页 · Across the Great Wall
   独立样式，不复用主站 tokens —— 这页要有自己的呼吸
   ══════════════════════════════════════════════════════════ */

:root {
  --ink:        #05060a;   /* 底 */
  --ink-2:      #0a0e17;
  --bronze:     #c9a227;   /* 青铜 */
  --bronze-hi:  #f2d377;   /* 青铜高光 */
  --jade:       #3fd6b0;   /* 青玉 */
  --azure:      #6aa9ff;   /* 远天 */
  --paper:      #eef3fb;   /* 主文字 */
  --paper-dim:  #7f8da3;   /* 次文字 */
  --line:       rgba(150, 180, 230, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── 画布层 ── */
#stage {
  position: fixed; inset: 0;
  display: block;
  z-index: 1;
  cursor: crosshair;
}

/* ── 背景：极光 + 网格 + 暗角，全部在画布之下 ── */
.veil {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
}

.veil--grid {
  background-image:
    linear-gradient(to right,  var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 78% 68% at 50% 46%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 46%, #000 20%, transparent 100%);
  opacity: .55;
}

.veil--aurora {
  background:
    radial-gradient(ellipse 62% 44% at 22% 18%, rgba(106,169,255,.16), transparent 62%),
    radial-gradient(ellipse 54% 40% at 82% 76%, rgba(201,162,39,.13), transparent 64%),
    radial-gradient(ellipse 46% 36% at 62% 26%, rgba(63,214,176,.09), transparent 66%);
  filter: blur(28px);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-2.5%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(2%, -2.5%, 0) scale(1.02); }
}

.veil--vignette {
  background: radial-gradient(ellipse 74% 66% at 50% 48%, transparent 42%, rgba(0,0,0,.72) 100%);
}

/* 颗粒感，压住渐变的塑料味 */
.veil--grain {
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ══ 文字层 ══ */
.hud {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 4.2vh, 46px) clamp(22px, 4.2vw, 62px);
}

.hud__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--paper-dim);
  opacity: 0;
  animation: fadeDown 1.1s .3s cubic-bezier(.16,1,.3,1) forwards;
}

.hud__top b {
  color: var(--bronze);
  font-weight: 500;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}

/* ── 中央铭牌 ── */
.core {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 8px;
  /* 上移：让出画面下三分之一给长城，避免文案被烽火台穿过 */
  padding-bottom: clamp(90px, 17vh, 190px);
}

.core__quote {
  margin: 0;
  /* 两行排版：第一行 "Across the Great Wall,"，第二行 "we can reach every
     corner in the world."。最长行 22 个字符，字号由它反推，所以这里放宽
     容器宽度，不再用 ch 单位限制 —— 换行位置由 <br class="q-br"> 强制。 */
  max-width: 100%;
  /* min(4.15vw, 6vh)：保证第二行（约 22 字符）恰好占满容器 */
  font-size: clamp(1.15rem, min(4.15vw, 6vh), 3.05rem);
  font-weight: 250;
  line-height: 1.22;
  letter-spacing: -.018em;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  /* 不用 text-wrap: balance —— 它会按容器宽度重新权衡分行位置，
     与显式 <br> 冲突时会多出一行 */
  text-wrap: nowrap;
}

/* 硬断行：只在需要时占位，不额外制造间距 */
.q-br { display: block; content: ""; }

/* 逐词升起 */
.core__quote .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.42em) rotate(1.2deg);
  animation: riseIn .95s cubic-bezier(.16,1,.3,1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes riseIn {
  to { opacity: 1; transform: none; }
}

.core__quote em {
  font-style: normal;
  background: linear-gradient(102deg, var(--bronze-hi) 8%, var(--bronze) 46%, var(--jade) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 让渐变缓慢流动 */
  background-size: 220% auto;
  animation: sheen 9s linear infinite;
}

@keyframes sheen {
  to { background-position: 220% center; }
}

.core__cn {
  margin: clamp(13px, 2.1vh, 24px) 0 0;
  font-size: clamp(.76rem, 1.5vw, .95rem);
  letter-spacing: .34em;
  color: var(--paper-dim);
  opacity: 0;
  animation: fadeDown 1.2s 1.5s cubic-bezier(.16,1,.3,1) forwards;
}

/* ── 入口按钮 ── */
.core__enter {
  margin-top: clamp(20px, 3.2vh, 38px);
  pointer-events: auto;
  opacity: 0;
  animation: fadeDown 1.1s 1.85s cubic-bezier(.16,1,.3,1) forwards;
}

.enter {
  --glow: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .72em;
  padding: 1.02em 2.1em;
  border: 1px solid rgba(201,162,39,.42);
  border-radius: 2px;
  background: rgba(201,162,39,.05);
  color: var(--paper);
  font-size: clamp(.78rem, 1.4vw, .9rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .45s, background .45s, box-shadow .55s, transform .35s;
  box-shadow: 0 0 0 rgba(201,162,39,0);
}

.enter::before {
  /* 扫光 */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 22%, rgba(242,211,119,.16) 50%, transparent 78%);
  transform: translateX(-130%);
  transition: transform .95s cubic-bezier(.16,1,.3,1);
}

.enter:hover {
  border-color: var(--bronze);
  background: rgba(201,162,39,.1);
  transform: translateY(-2px);
  box-shadow: 0 0 34px -6px rgba(201,162,39,.42), inset 0 0 22px -10px rgba(242,211,119,.5);
}

.enter:hover::before { transform: translateX(130%); }

.enter:active { transform: translateY(0); }

.enter__arrow {
  display: inline-block;
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}

.enter:hover .enter__arrow { transform: translateX(5px); }

/* ── 底部状态 ── */
.hud__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  font-size: .7rem;
  letter-spacing: .18em;
  color: var(--paper-dim);
  opacity: 0;
  animation: fadeDown 1.1s 2.1s cubic-bezier(.16,1,.3,1) forwards;
}

.hud__bottom .hint {
  display: flex;
  align-items: center;
  gap: .6em;
}

.hud__bottom .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 10px var(--jade);
  animation: beat 2.4s ease-in-out infinite;
}

@keyframes beat {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ── 无障碍 / 降级 ── */
@media (prefers-reduced-motion: reduce) {
  .veil--aurora, .core__quote em, .hud__bottom .pulse, .enter::before { animation: none; }
  .core__quote .w, .hud__top, .core__cn, .core__enter, .hud__bottom {
    opacity: 1; transform: none; animation: none;
  }
}

@media (max-width: 640px) {
  html, body { overflow: auto; }
  .hud { position: absolute; min-height: 100vh; }
  /* 竖屏：标题略缩、行距收紧，给长城留出下三分之一 */
  .core__quote { max-width: 100%; font-size: clamp(1.05rem, 4.55vw, 1.95rem); line-height: 1.26; }
  .hud__top span:last-child, .hud__bottom .lat { display: none; }
  /* 副标题不许折行：字号跟着视口缩 */
  .core__cn {
    font-size: clamp(0.62rem, 2.9vw, 0.86rem);
    letter-spacing: 0.18em;
    white-space: nowrap;
  }
  .core { padding-bottom: clamp(70px, 15vh, 150px); }
  .core__enter { margin-top: clamp(16px, 2.6vh, 28px); }
}

/* 屏幕很矮（横屏手机等）：文字整体上提，别压住长城 */
@media (max-height: 520px) {
  .core { padding-bottom: clamp(40px, 9vh, 90px); }
  .core__quote { font-size: clamp(0.95rem, 3.1vw, 1.55rem); }
  .core__cn { font-size: clamp(0.55rem, 1.5vw, 0.75rem); }
}


/* ── 触屏设备：把「移动鼠标」换成「轻触屏幕」 ── */
.hint__touch { display: none; font-weight: inherit; }
@media (hover: none), (pointer: coarse) {
  .hint__mouse { display: none; }
  .hint__touch { display: inline; }
}
/* 触屏上的鼠标提示语在竖屏也收紧一点 */
@media (max-width: 640px) {
  .hud__bottom .hint { letter-spacing: 0.06em; }
}

/* ══════════════════════════════════════════════════════════
   白天主题：蓝天 + 白云 + 太阳
   ──────────────────────────────────────────────────────────
   做法：body.theme-day 一挂上，就把暗色变量整体替换成
   浅色一套，再额外点亮三个只在白天用的图层（天空渐变、
   太阳、云）。画布里的星星和月亮由 JS 负责停掉。
   ══════════════════════════════════════════════════════════ */

body.theme-day {
  --ink:        #bfe0f5;
  --ink-2:      #a8d0ec;
  --bronze:     #b8860b;   /* 青铜在白底上要压深，否则看不见 */
  --bronze-hi:  #d9a520;
  --jade:       #1a8f78;   /* 青玉同理，深一档保对比度 */
  --azure:      #2f6bbf;
  --paper:      #16303f;   /* 主文字反过来：深色 */
  --paper-dim:  #4a6577;
  --line:       rgba(40, 90, 140, .14);
}

/* ── 天空：从上到下的蓝，底部压一层暖光（像下午四点） ── */
.sky-day {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity .8s ease;
  background:
    linear-gradient(180deg,
      #4a90c8 0%,
      #6aa8d8 26%,
      #8fc2e4 52%,
      #bcdcf0 74%,
      #e6f1f6 100%);
}
body.theme-day .sky-day { opacity: 1; }

/* ── 太阳：右上角，带两层柔光 ── */
.sun {
  position: fixed;
  top: 9%;
  right: 9%;
  width: 112px; height: 112px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .9s ease, transform .9s ease;
  background: radial-gradient(circle at 42% 40%,
    #fffdf2 0%, #ffe9a8 34%, #ffd166 58%, rgba(255,196,80,.30) 74%, transparent 78%);
  box-shadow:
    0 0 44px 14px rgba(255, 214, 120, .55),
    0 0 110px 44px rgba(255, 208, 110, .26),
    0 0 220px 120px rgba(255, 220, 150, .14);
}
body.theme-day .sun { opacity: 1; transform: scale(1); }

/* ── 云 ──
   用多层「圆 + 一个扁底」叠出来。单个 border-radius:50% 是个鹅卵石，
   叠四五颗大小不一的圆才像云。整朵云再用 drop-shadow 打一点体积感。 */
.clouds {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
  overflow: hidden;
}
body.theme-day .clouds { opacity: 1; }

.cloud-layer {
  position: absolute;
  /* 从 8% 处开始：顶部要留给 logo 和右上角的经纬度/主题按钮，
     云飘过去压住文字，比云本身好不好看更显眼 */
  top: 8%; left: 0;
  width: 200%;
  height: 92%;
  will-change: transform;
}

/* 每朵云用一个 span 当容器，内部用 box-shadow 叠出多个球体。
   比堆 DOM 节点省事：一个元素就能表达整朵云的轮廓。 */
.cloud {
  position: absolute;
  width: var(--w, 220px);
  height: var(--h, 70px);
  border-radius: 100px;
  background: rgba(255, 255, 255, .93);
  /* 叠 4 个球：左右两个肩、顶上一个大包、底下一个扁底 */
  box-shadow:
    26px -22px 0 -4px rgba(255,255,255,.93),
    -30px -14px 0 -6px rgba(255,255,255,.90),
    62px -10px 0 -14px rgba(255,255,255,.86),
    0 6px 0 -2px rgba(255,255,255,.96);
  filter: blur(.7px);
}

.cl-1 .cloud:nth-child(1) { top: 17%; left: 22%;  --w: 190px; --h: 56px; opacity: .82; }
.cl-1 .cloud:nth-child(2) { top: 19%; left: 44%;  --w: 150px; --h: 44px; opacity: .66; }
.cl-1 .cloud:nth-child(3) { top: 6%;  left: 78%;  --w: 170px; --h: 50px; opacity: .72; }

.cl-2 .cloud:nth-child(1) { top: 26%; left: 20%;  --w: 330px; --h: 90px; opacity: .95; }
.cl-2 .cloud:nth-child(2) { top: 33%; left: 60%;  --w: 260px; --h: 76px; opacity: .88; }
.cl-2 .cloud:nth-child(3) { top: 15%; left: 88%;  --w: 240px; --h: 70px; opacity: .80; }

.cl-3 .cloud:nth-child(1) { top: 46%; left: 4%;   --w: 420px; --h: 62px; opacity: .62; }
.cl-3 .cloud:nth-child(2) { top: 54%; left: 52%;  --w: 350px; --h: 54px; opacity: .52; }

/* 三层不同速度，造成视差 */
.cl-1 { animation: cloud-drift 110s linear infinite; }
.cl-2 { animation: cloud-drift 74s linear infinite; }
.cl-3 { animation: cloud-drift 138s linear infinite; }

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* 两倍宽里平移一半，循环无缝 */
}

.veil--vignette {
  background: radial-gradient(ellipse 74% 66% at 50% 48%, transparent 42%, rgba(0,0,0,.72) 100%);
}

/* 颗粒感，压住渐变的塑料味 */
.veil--grain {
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ══ 文字层 ══ */
.hud {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 4.2vh, 46px) clamp(22px, 4.2vw, 62px);
}

.hud__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--paper-dim);
  opacity: 0;
  animation: fadeDown 1.1s .3s cubic-bezier(.16,1,.3,1) forwards;
}

.hud__top b {
  color: var(--bronze);
  font-weight: 500;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}

/* ── 中央铭牌 ── */
.core {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 8px;
  /* 上移：让出画面下三分之一给长城，避免文案被烽火台穿过 */
  padding-bottom: clamp(90px, 17vh, 190px);
}

.core__quote {
  margin: 0;
  /* 两行排版：第一行 "Across the Great Wall,"，第二行 "we can reach every
     corner in the world."。最长行 22 个字符，字号由它反推，所以这里放宽
     容器宽度，不再用 ch 单位限制 —— 换行位置由 <br class="q-br"> 强制。 */
  max-width: 100%;
  /* min(4.15vw, 6vh)：保证第二行（约 22 字符）恰好占满容器 */
  font-size: clamp(1.15rem, min(4.15vw, 6vh), 3.05rem);
  font-weight: 250;
  line-height: 1.22;
  letter-spacing: -.018em;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  /* 不用 text-wrap: balance —— 它会按容器宽度重新权衡分行位置，
     与显式 <br> 冲突时会多出一行 */
  text-wrap: nowrap;
}

/* 硬断行：只在需要时占位，不额外制造间距 */
.q-br { display: block; content: ""; }

/* 逐词升起 */
.core__quote .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.42em) rotate(1.2deg);
  animation: riseIn .95s cubic-bezier(.16,1,.3,1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes riseIn {
  to { opacity: 1; transform: none; }
}

.core__quote em {
  font-style: normal;
  background: linear-gradient(102deg, var(--bronze-hi) 8%, var(--bronze) 46%, var(--jade) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 让渐变缓慢流动 */
  background-size: 220% auto;
  animation: sheen 9s linear infinite;
}

@keyframes sheen {
  to { background-position: 220% center; }
}

.core__cn {
  margin: clamp(13px, 2.1vh, 24px) 0 0;
  font-size: clamp(.76rem, 1.5vw, .95rem);
  letter-spacing: .34em;
  color: var(--paper-dim);
  opacity: 0;
  animation: fadeDown 1.2s 1.5s cubic-bezier(.16,1,.3,1) forwards;
}

/* ── 入口按钮 ── */
.core__enter {
  margin-top: clamp(20px, 3.2vh, 38px);
  pointer-events: auto;
  opacity: 0;
  animation: fadeDown 1.1s 1.85s cubic-bezier(.16,1,.3,1) forwards;
}

.enter {
  --glow: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .72em;
  padding: 1.02em 2.1em;
  border: 1px solid rgba(201,162,39,.42);
  border-radius: 2px;
  background: rgba(201,162,39,.05);
  color: var(--paper);
  font-size: clamp(.78rem, 1.4vw, .9rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .45s, background .45s, box-shadow .55s, transform .35s;
  box-shadow: 0 0 0 rgba(201,162,39,0);
}

.enter::before {
  /* 扫光 */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 22%, rgba(242,211,119,.16) 50%, transparent 78%);
  transform: translateX(-130%);
  transition: transform .95s cubic-bezier(.16,1,.3,1);
}

.enter:hover {
  border-color: var(--bronze);
  background: rgba(201,162,39,.1);
  transform: translateY(-2px);
  box-shadow: 0 0 34px -6px rgba(201,162,39,.42), inset 0 0 22px -10px rgba(242,211,119,.5);
}

.enter:hover::before { transform: translateX(130%); }

.enter:active { transform: translateY(0); }

.enter__arrow {
  display: inline-block;
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}

.enter:hover .enter__arrow { transform: translateX(5px); }

/* ── 底部状态 ── */
.hud__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  font-size: .7rem;
  letter-spacing: .18em;
  color: var(--paper-dim);
  opacity: 0;
  animation: fadeDown 1.1s 2.1s cubic-bezier(.16,1,.3,1) forwards;
}

.hud__bottom .hint {
  display: flex;
  align-items: center;
  gap: .6em;
}

.hud__bottom .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 10px var(--jade);
  animation: beat 2.4s ease-in-out infinite;
}

@keyframes beat {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ── 无障碍 / 降级 ── */
@media (prefers-reduced-motion: reduce) {
  .veil--aurora, .core__quote em, .hud__bottom .pulse, .enter::before { animation: none; }
  .core__quote .w, .hud__top, .core__cn, .core__enter, .hud__bottom {
    opacity: 1; transform: none; animation: none;
  }
}

@media (max-width: 640px) {
  html, body { overflow: auto; }
  .hud { position: absolute; min-height: 100vh; }
  /* 竖屏：标题略缩、行距收紧，给长城留出下三分之一 */
  .core__quote { max-width: 100%; font-size: clamp(1.05rem, 4.55vw, 1.95rem); line-height: 1.26; }
  .hud__top span:last-child, .hud__bottom .lat { display: none; }
  /* 副标题不许折行：字号跟着视口缩 */
  .core__cn {
    font-size: clamp(0.62rem, 2.9vw, 0.86rem);
    letter-spacing: 0.18em;
    white-space: nowrap;
  }
  .core { padding-bottom: clamp(70px, 15vh, 150px); }
  .core__enter { margin-top: clamp(16px, 2.6vh, 28px); }
}

/* 屏幕很矮（横屏手机等）：文字整体上提，别压住长城 */
@media (max-height: 520px) {
  .core { padding-bottom: clamp(40px, 9vh, 90px); }
  .core__quote { font-size: clamp(0.95rem, 3.1vw, 1.55rem); }
  .core__cn { font-size: clamp(0.55rem, 1.5vw, 0.75rem); }
}


/* ── 触屏设备：把「移动鼠标」换成「轻触屏幕」 ── */
.hint__touch { display: none; font-weight: inherit; }
@media (hover: none), (pointer: coarse) {
  .hint__mouse { display: none; }
  .hint__touch { display: inline; }
}
/* 触屏上的鼠标提示语在竖屏也收紧一点 */
@media (max-width: 640px) {
  .hud__bottom .hint { letter-spacing: 0.06em; }
}

/* ══════════════════════════════════════════════════════════
   白天主题：蓝天 + 白云 + 太阳
   ──────────────────────────────────────────────────────────
   做法：body.theme-day 一挂上，就把暗色变量整体替换成
   浅色一套，再额外点亮三个只在白天用的图层（天空渐变、
   太阳、云）。画布里的星星和月亮由 JS 负责停掉。
   ══════════════════════════════════════════════════════════ */

body.theme-day {
  --ink:        #bfe0f5;
  --ink-2:      #a8d0ec;
  --bronze:     #b8860b;   /* 青铜在白底上要压深，否则看不见 */
  --bronze-hi:  #d9a520;
  --jade:       #1a8f78;   /* 青玉同理，深一档保对比度 */
  --azure:      #2f6bbf;
  --paper:      #16303f;   /* 主文字反过来：深色 */
  --paper-dim:  #4a6577;
  --line:       rgba(40, 90, 140, .14);
}

/* 白天时把夜间的几层压掉 */
body.theme-day .veil--aurora  { opacity: 0; }
body.theme-day .veil--vignette { opacity: 0; }
body.theme-day .veil--grid { opacity: .28; }
body.theme-day .veil--grain { opacity: .18; }

/* 画布上的粒子在白天换成更深的青铜色（JS 里同步改了颜色），
   这块只是兜底：万一画布没跑起来，别让文字压在白底上看不清 */
/* 不用 mix-blend-mode：multiply 会把亮色粒子在白底上直接压没，
   而深墨绿粒子本来就够沉，正常叠加即可。 */

/* ── 主题切换按钮 ── */
.theme-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(150, 180, 230, .22);
  background: rgba(10, 14, 23, .5);
  color: var(--paper-dim);
  font: inherit;
  font-size: .7rem;
  letter-spacing: .12em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .3s, color .3s, background .3s, transform .2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.theme-btn:hover {
  color: var(--bronze-hi);
  border-color: rgba(201, 162, 39, .5);
}
.theme-btn:active { transform: scale(.95); }
.theme-btn.is-locked { border-color: rgba(201, 162, 39, .45); color: var(--bronze-hi); }
.theme-ico { font-size: .95rem; line-height: 1; }

body.theme-day .theme-btn {
  border-color: rgba(40, 90, 140, .25);
  background: rgba(255, 255, 255, .55);
  color: #2b4a5e;
}
body.theme-day .theme-btn:hover {
  color: #b8860b;
  border-color: rgba(184, 134, 11, .45);
}

/* 提示气泡 */
.theme-hint {
  position: fixed;
  right: clamp(22px, 4.2vw, 62px);
  top: calc(clamp(22px, 4.2vh, 46px) + 46px);
  z-index: 5;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: .72rem;
  letter-spacing: .1em;
  background: rgba(10, 14, 23, .85);
  color: var(--bronze-hi);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.theme-hint.show { opacity: 1; transform: translateY(0); }
body.theme-day .theme-hint {
  background: rgba(255, 255, 255, .9);
  color: #8a6a00;
}

/* 窄屏把按钮收成一个圆 */
@media (max-width: 620px) {
  .theme-btn { padding: 8px; border-radius: 50%; }
  .theme-txt { display: none; }
  .sun { width: 74px; height: 74px; top: 7%; right: 8%; }
}

/* 右上角：经纬度 + 主题按钮 并排 */
.hud__top-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
@media (max-width: 620px) {
  .hud__top-right > span:first-child { display: none; }
}

.cloud { display: block; }

/* 白天：按钮在浅蓝天上必须给实底，否则边框和字一起淡掉 */
body.theme-day .enter {
  background: rgba(14, 42, 54, .86);
  border-color: rgba(14, 42, 54, .86);
  color: #f2f7fa;
}
body.theme-day .enter:hover {
  background: rgba(14, 42, 54, .95);
  border-color: rgba(14, 42, 54, .95);
}

/* ═══════════════ 城墙上的灯 ═══════════════
   夜宵摊的灯火：一排小灯笼挂在长城脊线上方。
   单开一层 DOM 而不是画进 canvas —— 要的是真实辉光和缓慢摇摆，
   这两件事用 canvas 逐像素做反而更贵、更假。
   z-index 与 canvas 同为 1，靠 DOM 顺序压在它上面、hud 下面。 */
.lanterns {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity .7s ease;
}

.lantern {
  position: absolute;
  width: var(--w, 8px);
  height: var(--h, 11px);
  margin-left: calc(var(--w, 8px) / -2);
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 34%,
    #fff0c8 0%, #ffc266 36%, #f08c2c 70%, #b4501c 100%);
  box-shadow:
    0 0 5px 1px rgba(255, 176, 82, .58),
    0 0 16px 5px rgba(255, 128, 42, .24),
    0 0 40px 15px rgba(255, 96, 24, .09);
  opacity: var(--lit, .9);
  transform: scale(var(--scale, .95));
  transform-origin: 50% -12px;
  animation: lanternSway var(--dur, 5s) ease-in-out var(--delay, 0s) infinite;
  will-change: transform, opacity;
}

/* 挂绳：从灯顶往上收的一根细线，暗示它挂在哪里 */
.lantern::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: var(--rope, 12px);
  transform: translateX(-.5px);
  /* 靠近灯那头亮，靠近城墙那头淡出 —— 像一根被灯照着的细竿 */
  background: linear-gradient(to top,
    rgba(255, 176, 92, .62), rgba(255, 176, 92, .06));
}

/* 灯芯：中心一点更亮的高光，灯才像在发光，而不是一块色块 */
.lantern::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: 2px;
  height: 2px;
  margin: -1px 0 0 -1px;
  border-radius: 50%;
  background: #fffaf0;
  box-shadow: 0 0 4px 1px rgba(255, 244, 210, .85);
  opacity: .9;
}

@keyframes lanternSway {
  0%, 100% { transform: scale(var(--scale, .95)) rotate(-2.4deg); }
  50%      { transform: scale(var(--scale, .95)) rotate(2.4deg); }
}

/* 白天没有夜宵可吃 */
body.theme-day .lanterns { opacity: 0; }

/* 减少动态效果：不摇，但灯还亮着 */
@media (prefers-reduced-motion: reduce) {
  .lantern { animation: none; transform: scale(var(--scale, .95)); }
}

/* ═══════════════ 进入按钮下面那行小字 ═══════════════ */
.core__note {
  margin: clamp(16px, 2.6vh, 26px) 0 0;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: clamp(.7rem, 1.25vw, .84rem);
  letter-spacing: .26em;
  color: rgba(246, 216, 132, .62);
  white-space: nowrap;
  opacity: 0;
  animation: fadeDown 1.4s 1.9s cubic-bezier(.16, 1, .3, 1) forwards;
  transition: color .6s ease;
}

body.theme-day .core__note {
  color: rgba(18, 44, 64, .52);
}

@media (prefers-reduced-motion: reduce) {
  .core__note { opacity: 1; animation: none; }
}

@media (max-width: 640px) {
  .core__note { letter-spacing: .16em; font-size: .64rem; }
}

/* ═══════════════ 白天主题的文字可见性 ═══════════════
   浅蓝天空上，原来那几处次级文字用的是 --paper-dim(#4a6577)，
   在 #7ab8e0 背景上只有 2.7:1 —— 基本读不出来。
   这里把它们压到 #22414f（约 5:1），层级关系仍在（仍比主文字浅）。 */
body.theme-day .hud__top,
body.theme-day .hud__bottom { color: #22414f; }

body.theme-day .core__cn {
  color: #22414f;
  /* 天空是蓝的，中文那行的字距大，颜色再实一点也不显重 */
  opacity: .92;
}

/* 小字那行：原打算比正文淡一档（#2f4f60 只有 3.9:1），
   但天空底色太亮，只能压到和正文同一个深度，层级靠字号和字距区分。 */
body.theme-day .core__note { color: #22414f; }
