/* ==========================================================================
   星际信号站 · 绘本星夜设计系统（UI 规范见 DESIGN.md）
   1 设计变量  2 基础元素  3 背景与顶栏  4 按钮  5 标签与进度
   6 弹窗与提示  7 加载  8 光标
   ========================================================================== */

/* 1 设计变量 ------------------------------------------------------------- */
:root {
  color-scheme: dark;
  /* 夜空底色：取自背景画 galaxy-pastel 的钴蓝 */
  --night-950: #070c2a;
  --night-900: #0b1236;
  --night-800: #111a4a;
  --night-700: #17235e;
  --night-600: #1f2e74;
  --night-500: #2b3d8e;
  --night-400: #3d52a6;
  /* 文字：暖白纸色，层级依次减弱 */
  --ink: #fff6e2;
  --ink-soft: #d3daf6;
  --ink-mute: #a7b0da;
  --ink-faint: #7f89bb;
  /* 强调色：月牙金为主，小兔红丝带表示错误，嫩叶绿表示正确 */
  --moon: #f6d98a;
  --moon-bright: #ffeab2;
  --moon-deep: #e0ad4e;
  --moon-ink: #3b2a0c;
  --leaf: #95e6b5;
  --leaf-ink: #0f3a25;
  --ribbon: #f07a70;
  --ribbon-ink: #3d0d0b;
  --sky: #9ec5ff;
  /* 线与阴影 */
  --line: rgba(214, 222, 255, 0.16);
  --line-strong: rgba(246, 217, 138, 0.48);
  --shadow-sm: 0 6px 14px -6px rgba(3, 6, 28, 0.6);
  --shadow-md: 0 16px 36px -14px rgba(3, 6, 28, 0.75);
  --shadow-lg: 0 34px 80px -24px rgba(2, 4, 22, 0.85);
  /* 纸面：蜡笔颗粒 + 夜空渐变 */
  --grain: url("../assets/paper-grain.webp");
  --paper: linear-gradient(165deg, rgba(36, 53, 132, 0.95), rgba(19, 28, 84, 0.97));
  --paper-deep: linear-gradient(170deg, rgba(25, 37, 102, 0.94), rgba(14, 21, 66, 0.96));
  --glass: rgba(15, 23, 70, 0.78);
  /* 装饰：四角星（与背景画里的手绘星星一致） */
  --sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1q1 9.4 11 11-10 1.6-11 11-1-9.4-11-11 10-1.6 11-11z'/%3E%3C/svg%3E");
  --swash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13C38 6 70 5 104 8s62 3 93-3' fill='none' stroke='%23f6d98a' stroke-width='5' stroke-linecap='round' opacity='.85'/%3E%3Cpath d='M22 17c30-4 62-5 96-2' fill='none' stroke='%23f6d98a' stroke-width='2.5' stroke-linecap='round' opacity='.45'/%3E%3C/svg%3E");
  /* 字体：正文系统黑体；标题优先圆体；数字优先圆润字形 */
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-display: "Yuanti SC", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  /* 字号：儿童阅读，最小 13px；随屏幕短边从手机到平板、电脑逐级放大 */
  --fs-xs: clamp(13px, 12.5px + 0.14vmin, 14px);
  --fs-sm: clamp(14px, 13.2px + 0.21vmin, 15.5px);
  --fs-md: clamp(15px, 13.9px + 0.29vmin, 17px);
  --fs-lg: clamp(17px, 15.7px + 0.35vmin, 19.5px);
  --fs-xl: clamp(21px, 19.4px + 0.43vmin, 24px);
  --fs-2xl: clamp(23px, 2.2vw, 28px);
  --fs-3xl: clamp(27px, 2.9vw, 38px);
  --fs-hero: clamp(36px, 4.4vw, 60px);
  /* 形状与间距 */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;
  --gutter: max(20px, calc((100% - 1200px) / 2));
  --header: 76px;
  /* 可点区域：手机上最小 44px，关卡进行中的按键 48px，主按钮 52px；平板和电脑上随屏幕短边再放大 */
  --tap: clamp(44px, 40.2px + 1vmin, 52px);
  --tap-play: clamp(48px, 44.2px + 1vmin, 56px);
  --tap-main: clamp(52px, 48.2px + 1vmin, 60px);
  /* 动效 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 0.16s;
  --t-med: 0.28s;
  --t-slow: 0.52s;
  /* 当前章节色（由脚本按关卡写入） */
  --chapter: #85dce9;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--night-900);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* 2 基础元素 ------------------------------------------------------------- */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background: var(--night-900);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
button,
main {
  user-select: none;
  -webkit-user-select: none;
}
button svg,
[data-icon] > svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
[data-icon] {
  display: inline-grid;
  place-items: center;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--moon);
  outline-offset: 3px;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
}
summary {
  cursor: pointer;
}
.overline,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--chapter);
}
.overline::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--sparkle) center / contain no-repeat;
  mask: var(--sparkle) center / contain no-repeat;
}
.overline:empty {
  display: none;
}

/* 3 背景与顶栏 ----------------------------------------------------------- */
#game-root {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
}
#game-root:not([data-screen="game"]) {
  min-height: 0;
}
.space-backdrop {
  position: absolute;
  inset: -3%;
  z-index: -4;
  background: var(--night-800) url("../assets/galaxy-pastel.webp") center 38% / cover no-repeat;
  filter: brightness(0.86) saturate(1.04);
  transition:
    filter 1.2s var(--ease-out),
    transform 2.4s var(--ease-out);
}
.space-vignette {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(130% 95% at 50% 42%, transparent 45%, rgba(5, 9, 34, 0.6) 100%),
    linear-gradient(180deg, rgba(7, 12, 42, 0.5), transparent 20% 72%, rgba(7, 12, 42, 0.62));
}
#world-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.screen {
  position: absolute;
  inset: 0;
  z-index: 4;
}
.global-hud {
  position: absolute;
  inset: 0 0 auto;
  height: var(--header);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 60;
  transition:
    background var(--t-med),
    box-shadow var(--t-med),
    backdrop-filter var(--t-med);
}
#game-root.scrolled .global-hud {
  background: rgba(10, 16, 50, 0.84);
  box-shadow: 0 1px 0 var(--line), 0 12px 30px -18px rgba(2, 4, 22, 0.9);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}
#game-root[data-screen="game"] .global-hud {
  display: none;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: var(--tap);
  min-height: var(--tap);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-shadow: 0 2px 10px rgba(3, 6, 28, 0.6);
}
.brand .brand-mark {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 10px rgba(246, 217, 138, 0.45));
  transition: transform var(--t-med) var(--ease-spring);
}
.brand:hover .brand-mark {
  transform: rotate(-10deg) scale(1.06);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.star-total {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--tap);
  padding: 0 16px 0 12px;
  margin-right: 4px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--line);
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 800;
  color: var(--moon);
  white-space: nowrap;
}
.star-total svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px rgba(246, 217, 138, 0.6));
}
.star-total small {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
}
.star-total em {
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: 3px;
}
.icon-button {
  width: var(--tap);
  height: var(--tap);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition:
    background var(--t-fast),
    color var(--t-fast),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast);
}
.icon-button:hover {
  background: var(--night-600);
  color: var(--ink);
  box-shadow: 0 0 0 4px rgba(246, 217, 138, 0.12);
}
.icon-button:active {
  transform: scale(0.93);
}
.icon-button svg {
  width: 21px;
  height: 21px;
}
.storage-note {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 70;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(59, 42, 12, 0.85);
  font-size: var(--fs-xs);
  color: var(--moon-bright);
}

/* 4 按钮 ----------------------------------------------------------------- */
.action-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--tap-main);
  padding: 11px 12px 11px 22px;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition:
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast),
    filter var(--t-fast),
    background var(--t-fast);
}
.action-button > b,
.action-button .button-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 400;
}
.action-button > b svg {
  width: 18px;
  height: 18px;
}
.action-button:not(:has(> b)) {
  justify-content: center;
  padding-right: 22px;
}
.action-button.gold {
  color: var(--moon-ink);
  background: linear-gradient(180deg, #ffedb8, #f6cd6a 58%, #eab452);
  box-shadow:
    0 4px 0 #b88332,
    0 12px 26px -10px rgba(246, 200, 90, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.action-button.gold > b {
  background: rgba(59, 42, 12, 0.12);
}
.action-button.outline {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(50, 70, 156, 0.94), rgba(31, 45, 115, 0.96));
  box-shadow:
    0 4px 0 rgba(8, 13, 46, 0.92),
    inset 0 0 0 1px rgba(214, 222, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.action-button.outline > b {
  background: rgba(255, 255, 255, 0.09);
}
.action-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.action-button.gold:hover:not(:disabled) {
  box-shadow:
    0 6px 0 #b88332,
    0 16px 32px -10px rgba(246, 200, 90, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.action-button:active:not(:disabled) {
  transform: translateY(3px);
  filter: brightness(0.98);
}
.action-button.gold:active:not(:disabled) {
  box-shadow:
    0 1px 0 #b88332,
    0 6px 14px -8px rgba(246, 200, 90, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.action-button.outline:active:not(:disabled) {
  box-shadow:
    0 1px 0 rgba(8, 13, 46, 0.92),
    inset 0 0 0 1px rgba(214, 222, 255, 0.2);
}
.action-button:disabled {
  opacity: 0.55;
  filter: saturate(0.35);
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  transition:
    color var(--t-fast),
    background var(--t-fast);
}
.text-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}
.text-button svg {
  width: 19px;
  height: 19px;
}
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 18px 8px 12px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  transition:
    background var(--t-fast),
    color var(--t-fast);
}
.back-button:hover {
  background: var(--night-600);
  color: var(--ink);
}
.back-button svg {
  width: 19px;
  height: 19px;
}

/* 5 标签与进度 ----------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip svg {
  width: 14px;
  height: 14px;
}
.chip.gold {
  color: var(--moon-ink);
  background: var(--moon);
  border-color: transparent;
}
progress {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 8px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  color: var(--moon);
}
progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--moon-deep), var(--moon-bright));
  border-radius: 8px;
}
progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--moon-deep), var(--moon-bright));
  border-radius: 8px;
}
.rule-details {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  line-height: 1.8;
}
.rule-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 4px;
  list-style: none;
  font-weight: 700;
  color: var(--ink-mute);
}
.rule-details summary::-webkit-details-marker {
  display: none;
}
.rule-details summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--t-fast);
}
.rule-details[open] summary::before {
  transform: rotate(45deg);
}
.rule-details > p {
  margin: 6px 0;
}
.rule-details > p:empty {
  display: none;
}

/* 6 弹窗与提示 ----------------------------------------------------------- */
dialog {
  color: var(--ink);
}
dialog#modal {
  width: min(480px, calc(100% - 32px));
  max-height: 86dvh;
  overflow: auto;
  padding: 26px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(246, 217, 138, 0.3);
  background: var(--grain) 0 0 / 360px, var(--paper);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
dialog::backdrop {
  background: rgba(5, 9, 34, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.modal-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.modal-heading h2::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: var(--moon);
  -webkit-mask: var(--sparkle) center / contain no-repeat;
  mask: var(--sparkle) center / contain no-repeat;
}
.modal-heading button {
  width: var(--tap);
  height: var(--tap);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-soft);
  transition: background var(--t-fast);
}
.modal-heading button:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
}
dialog p {
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--ink-soft);
}
dialog .action-button {
  width: 100%;
  margin-top: 12px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin-bottom: 6px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-md);
  font-weight: 700;
}
.setting-row button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 4px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-mute);
}
.setting-row button::after {
  content: "";
  width: 52px;
  height: 30px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14) radial-gradient(circle at 15px 50%, #fff 0 11px, transparent 12px);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background var(--t-med) var(--ease-out);
}
.setting-row button[aria-pressed="true"] {
  color: var(--leaf);
}
.setting-row button[aria-pressed="true"]::after {
  background: var(--leaf-ink) radial-gradient(circle at 37px 50%, var(--leaf) 0 11px, transparent 12px);
  box-shadow: inset 0 0 0 1px rgba(149, 230, 181, 0.5);
}
/* The switches under the main sound switch; they wait while everything is muted. */
.setting-row.sub {
  min-height: 52px;
  padding-left: 18px;
  font-weight: 600;
  color: var(--ink-soft);
}
.setting-row button:disabled {
  opacity: 0.45;
  cursor: default;
}
.settings-note {
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}
.help-target {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(246, 217, 138, 0.1);
  border: 1.5px solid var(--line-strong);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--ink) !important;
}
.signal-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 4px;
}
.signal-guide-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border-radius: var(--r-md);
  background: rgba(8, 12, 42, 0.45);
  border: 1.5px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.signal-guide-item.target {
  color: var(--leaf);
  border-color: rgba(149, 230, 181, 0.42);
  background: rgba(47, 138, 92, 0.14);
}
.signal-guide-item.ignore {
  color: var(--ink-mute);
}
.signal-guide-art {
  width: 66px;
  height: 66px;
}
.signal-guide-art > svg {
  width: 100%;
  height: 100%;
}
.signal-guide-item > svg {
  width: 24px;
  height: 24px;
}
.log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--r-md);
  background: rgba(10, 16, 52, 0.45);
  border: 1px solid var(--line);
  font-size: var(--fs-md);
  font-weight: 700;
}
.log-row small {
  display: block;
  margin-top: 5px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-mute);
}
.log-row > span {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 800;
  color: var(--moon);
}
.log-row.passed > span::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  background: var(--leaf);
  -webkit-mask: var(--sparkle) center / contain no-repeat;
  mask: var(--sparkle) center / contain no-repeat;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  max-width: calc(100% - 32px);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: rgba(20, 30, 84, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition:
    opacity var(--t-med),
    transform var(--t-med) var(--ease-spring);
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 7 加载 ----------------------------------------------------------------- */
.loading {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(circle at 50% 44%, #1d2d78, var(--night-900) 68%);
  transition:
    opacity 0.45s var(--ease-out),
    visibility 0.45s;
}
.loading .brand-mark {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 0 24px rgba(246, 217, 138, 0.5));
}
.loading strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
}
.loading i {
  width: 128px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--moon), transparent) 0 0 / 50% 100% no-repeat, rgba(255, 255, 255, 0.1);
}
.loading.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 8 光标：原生 SVG 光标，点击点与箭头尖端对齐 --------------------------- */
@media (hover: hover) and (pointer: fine) {
  :root {
    --star-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M3 2L25 17L15 19L10 28Z' fill='%23fff1c9' stroke='%230b1236' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M24 2q.7 5.3 6 6-5.3.7-6 6-.7-5.3-6-6 5.3-.7 6-6z' fill='%23f6d98a' stroke='%230b1236' stroke-width='1.1'/%3E%3C/svg%3E") 3 2;
    --star-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='13' fill='%230b1236' fill-opacity='.5' stroke='%23f6d98a' stroke-width='1.5'/%3E%3Cpath d='M16 3.5q1.4 10.5 12.5 12.5-11.1 1.4-12.5 12.5-1.4-11.1-12.5-12.5 11.1-2 12.5-12.5z' fill='%23fff1c9' stroke='%230b1236' stroke-width='1.2'/%3E%3C/svg%3E") 16 16;
  }
  body,
  button:disabled {
    cursor: var(--star-cursor), default;
  }
  button:not(:disabled),
  a,
  summary,
  [role="button"],
  .knowledge-photo button.photo-original,
  .photo-text-button {
    cursor: var(--star-pointer), pointer;
  }
}
/* A double tap no longer zooms the page (only buttons and links had this); pinching still zooms. */
html,body,body *{touch-action:manipulation}
