/*!
 * StoryChart · 星轨故事星图 — 样式
 * 作用域：所有选择器以 #story-chart 或 .sc- 开头，不写任何全局样式。
 * 颜色 / 字体 / 缓动全部走页面 tokens，并带 DESIGN.md 的兜底值。
 * 视觉纪律：无卡片边框、无背景色块；只有星、线、极细刻度、mono 标注。
 */

/* 组件占位尺寸：JS 挂载前也先占好比例，避免布局跳动。
   align-self:start 保证在 grid 里不会被拉伸，SVG 与百分比覆盖层永远同比例。 */
#story-chart {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 560;
  align-self: start;
}

.sc-root {
  /* 由 JS 更新的度量：1 个 SVG 单位 = 多少 px；SVG 文字反缩放系数 */
  --sc-u: 1px;
  --sc-tscale: 1;

  /* 星光色温：优先用 tokens.css，缺失时回落到 DESIGN.md 色值 */
  --sc-white: var(--star-white, #ffffff);
  --sc-cool: var(--star-blue, #cfdcff);
  --sc-warm: var(--star-warm, #ffe8c2);
  --sc-line: rgba(207, 220, 255, 0.34);
  --sc-line-soft: rgba(160, 178, 235, 0.075);
  --sc-hit: 44px;

  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 560;
  align-self: start;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--serif, "Noto Serif SC", "Songti SC", "SimSun", serif);
  color: var(--ink, #efedf8);
  -webkit-tap-highlight-color: transparent;
}

.sc-root *,
.sc-root *::before,
.sc-root *::after {
  box-sizing: border-box;
}

/* 屏幕阅读器文本 */
.sc-root .sc-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------- SVG 底板 ------------------------------- */

.sc-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

/* 极细网格：低到只提供「坐标感」，不形成边框 */
.sc-grid-line {
  fill: none;
  stroke: var(--hair, rgba(180, 168, 232, 0.14));
  stroke-opacity: 0.34;
  stroke-dasharray: 1 6;
  vector-effect: non-scaling-stroke;
}

.sc-grid-corner {
  fill: none;
  stroke: var(--hair-bright, rgba(216, 199, 255, 0.3));
  stroke-opacity: 0.42;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* 网格坐标注 / 角落星座 / 散星 / FIG 注：全部只读底图，不参与交互 */
.sc-coord-label {
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: calc(9.2px * var(--sc-tscale));
  letter-spacing: 0.18em;
  fill: var(--ink-ghost, #7f7aa2);
  opacity: 0.55;
}

.sc-fig-label {
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: calc(9.4px * var(--sc-tscale));
  letter-spacing: 0.18em;
  fill: var(--ink-ghost, #7f7aa2);
  opacity: 0.5;
}

.sc-dust {
  fill: var(--star-blue, #cfdcff);
}

.sc-const-line {
  fill: none;
  stroke: var(--star-blue, #cfdcff);
  stroke-opacity: 0.13;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.sc-constellation--orion .sc-const-line {
  stroke-opacity: 0.11;
}

.sc-const-star {
  fill: var(--star-blue, #cfdcff);
  opacity: 0.55;
}

.sc-constellation--orion .sc-const-star {
  opacity: 0.45;
}

.sc-const-label {
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: calc(8px * var(--sc-tscale));
  letter-spacing: 0.2em;
  fill: var(--ink-ghost, #7f7aa2);
  opacity: 0.5;
}

/* 星轨：两层柔光 + 1px 冷白曲线；pathLength=1，dashoffset 1 → 0 即「画完」
   柔光宽度按 viewBox 比例缩放（mobile 更细），芯线永远 1px 级 */
.sc-trail-haze,
.sc-trail-glow,
.sc-trail {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1800ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-trail-haze {
  stroke: var(--star-blue, #cfdcff);
  stroke-opacity: 0.04;
  stroke-width: 8;
}

.sc-trail-glow {
  stroke: var(--star-blue, #cfdcff);
  stroke-opacity: 0.12;
  stroke-width: 2.4;
}

.sc-trail {
  stroke-width: 1.05;
  vector-effect: non-scaling-stroke;
}

.sc-root.is-in .sc-trail-haze,
.sc-root.is-in .sc-trail-glow,
.sc-root.is-in .sc-trail {
  stroke-dashoffset: 0;
}

/* 未连上的路：从亮星引向幽灵星的虚线，缓慢流动 */
.sc-branch {
  fill: none;
  stroke: var(--star-blue, #cfdcff);
  stroke-opacity: 0.3;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 3.2 7;
  vector-effect: non-scaling-stroke;
  animation: sc-branch-flow 9s linear infinite;
}

@keyframes sc-branch-flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -18; }
}

/* 幽灵星：虚线圆环 + mono「未点亮」，不承载交互 */
.sc-ghost-ring {
  fill: none;
  stroke: rgba(198, 189, 240, 0.55);
  stroke-width: 1;
  stroke-dasharray: 2.4 3.6;
  vector-effect: non-scaling-stroke;
}

.sc-ghost-label {
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: calc(8.4px * var(--sc-tscale));
  letter-spacing: 0.14em;
  fill: var(--ink-ghost, #7f7aa2);
}

/* 底部刻度尺 + 仪表注解 */
.sc-axis-base,
.sc-axis-tick {
  stroke: var(--hair, rgba(180, 168, 232, 0.14));
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.sc-axis-base {
  stroke-opacity: 0.75;
}

.sc-axis-tick {
  stroke-opacity: 0.9;
}

.sc-axis-label {
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: calc(9.4px * var(--sc-tscale));
  letter-spacing: 0.16em;
  fill: var(--ink-ghost, #7f7aa2);
}

/* 入场：星轨先画，网格 / 幽灵星 / 刻度依次淡入（只播一次） */
.sc-grid-line,
.sc-grid-corner,
.sc-ghost,
.sc-axis-base,
.sc-axis-tick,
.sc-axis-label {
  opacity: 0;
  transition: opacity 1000ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-grid-line,
.sc-grid-corner {
  transition-delay: 100ms;
}

.sc-ghost {
  transition-delay: 820ms;
}

.sc-axis-base,
.sc-axis-tick {
  transition-delay: 1240ms;
}

.sc-axis-label {
  transition-delay: 1280ms;
}

.sc-root.is-in .sc-grid-line,
.sc-root.is-in .sc-grid-corner,
.sc-root.is-in .sc-ghost,
.sc-root.is-in .sc-axis-base,
.sc-root.is-in .sc-axis-tick,
.sc-root.is-in .sc-axis-label,
.sc-root.is-in .sc-coords,
.sc-root.is-in .sc-dust-field,
.sc-root.is-in .sc-constellation,
.sc-root.is-in .sc-fig-label,
.sc-root.is-in .sc-branches,
.sc-root.is-in .sc-wanderer {
  opacity: 1;
}

/* 新增底图层的依次淡入（只播一次） */
.sc-coords,
.sc-dust-field,
.sc-constellation,
.sc-fig-label,
.sc-branches,
.sc-wanderer {
  opacity: 0;
  transition: opacity 1100ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-dust-field {
  transition-delay: 240ms;
}

.sc-coords {
  transition-delay: 520ms;
}

.sc-constellation--cass {
  transition-delay: 620ms;
}

.sc-constellation--orion {
  transition-delay: 780ms;
}

.sc-fig-label {
  transition-delay: 880ms;
}

.sc-branches {
  transition-delay: 1080ms;
}

.sc-wanderer {
  transition-delay: 1250ms;
}

/* ------------------------------- 星点按钮 ------------------------------- */

.sc-field {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.sc-star {
  /* 当前星等对应的直径（px）：与 SVG 同比例缩放，最小可见 4px */
  --sc-d: max(4px, calc(var(--r, 4) * var(--sc-u) * 2));

  position: absolute;
  left: var(--x, 0%);
  top: var(--y, 0%);
  width: var(--sc-hit);
  height: var(--sc-hit);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  transform: translate(-50%, -50%);
  overflow: visible;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  color: inherit;
  font: inherit;
  transition: opacity 260ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-star:focus {
  outline: none;
}

.sc-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--r, 4) * var(--sc-u) * var(--sc-halo, 4.6));
  height: calc(var(--r, 4) * var(--sc-u) * var(--sc-halo, 4.6));
  border-radius: 50%;
  background: radial-gradient(circle, var(--sc-tint, var(--sc-cool)) 0%, transparent 68%);
  opacity: var(--sc-halo-o, 0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 320ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
              transform 320ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--sc-d);
  height: var(--sc-d);
  border-radius: 50%;
  background: var(--sc-tint, var(--sc-cool));
  opacity: var(--sc-dot-o, 1);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 260ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
              opacity 260ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

/* 色温与亮度：暖白最亮，蓝白稍收，金色单独成体系 */
.sc-star--warm {
  --sc-tint: var(--sc-warm);
  --sc-halo: 6;
  --sc-halo-o: 0.24;
}

.sc-star--white {
  --sc-tint: var(--sc-white);
  --sc-halo: 5.2;
  --sc-halo-o: 0.21;
  --sc-dot-o: 0.96;
}

.sc-star--cool {
  --sc-tint: var(--sc-cool);
  --sc-halo: 4.4;
  --sc-halo-o: 0.18;
  --sc-dot-o: 0.92;
}

.sc-star--gold {
  --sc-tint: var(--gold-bright, #f0dcae);
  --sc-halo: 9;
  --sc-halo-o: 0.5;
}

/* 关键星更「重」：外圈极淡光晕 + 两圈极细同心环（全图仍只有这一颗金色） */
.sc-gold-aura {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--r, 4) * var(--sc-u) * 17);
  height: calc(var(--r, 4) * var(--sc-u) * 17);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold, #d8bd86) 0%, transparent 64%);
  opacity: 0.055;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sc-gold-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid var(--gold, #d8bd86);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 320ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-gold-ring--inner {
  width: calc(var(--r, 4) * var(--sc-u) * 5.4);
  height: calc(var(--r, 4) * var(--sc-u) * 5.4);
  opacity: 0.22;
}

.sc-gold-ring--outer {
  width: calc(var(--r, 4) * var(--sc-u) * 8.4);
  height: calc(var(--r, 4) * var(--sc-u) * 8.4);
  opacity: 0.13;
}

.sc-star.is-active .sc-gold-ring--inner {
  opacity: 0.32;
}

.sc-star.is-active .sc-gold-ring--outer {
  opacity: 0.2;
}

/* 金色十字衍射：全图只有这一颗 */
.sc-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--r, 4) * var(--sc-u) * 15);
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold-bright, #f0dcae) 50%,
    transparent 100%);
  opacity: 0.45;
  pointer-events: none;
  animation: sc-gold-breath 5.8s ease-in-out infinite;
}

.sc-rays::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: calc(var(--r, 4) * var(--sc-u) * 11.5);
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg,
    transparent 0%,
    var(--gold-bright, #f0dcae) 50%,
    transparent 100%);
}

.sc-star--gold .sc-halo {
  animation: sc-gold-breath 5.8s ease-in-out infinite;
}

.sc-star--gold .sc-rays {
  animation-delay: -2.4s;
}

@keyframes sc-gold-breath {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.66; }
}

/* 选中：外圈细环 + 标签提亮 */
.sc-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--sc-d) + 13px);
  height: calc(var(--sc-d) + 13px);
  border: 1px solid rgba(207, 220, 255, 0.5);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.82);
  pointer-events: none;
  transition: opacity 300ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
              transform 300ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-star--gold .sc-ring {
  border-color: var(--gold-dim, #8f7a52);
}

.sc-star.is-selected .sc-ring {
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(1);
}

/* 焦点环：清楚、细、冷白；鼠标点击不显示 */
.sc-focus {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--sc-d) + 18px);
  height: calc(var(--sc-d) + 18px);
  border: 1px solid rgba(226, 220, 255, 0.85);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 3px rgba(180, 168, 232, 0.1);
  transition: opacity 160ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-star:focus .sc-focus {
  opacity: 1;
}

.sc-star:focus:not(:focus-visible) .sc-focus {
  opacity: 0;
}

/* hover / 键盘聚焦：星点放大 1.4×，光晕张开 */
.sc-star.is-active .sc-dot {
  transform: translate(-50%, -50%) scale(1.4);
}

.sc-star.is-active .sc-halo {
  transform: translate(-50%, -50%) scale(1.38);
}

.sc-star.is-active .sc-focus {
  opacity: 1;
}

.sc-star.is-selected .sc-dot {
  transform: translate(-50%, -50%) scale(1.12);
}

.sc-star.is-active .sc-ring {
  opacity: 0.95;
}

/* 有聚焦星时其余星变暗，形成阅读焦点 */
.sc-root.has-active .sc-star:not(.is-active) {
  opacity: 0.42;
}

.sc-star.is-active,
.sc-star:focus-visible {
  z-index: 3;
}

/* ------------------------------- 常驻标签 ------------------------------- */

.sc-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  line-height: 1.25;
  pointer-events: none;
  text-shadow:
    0 0 10px rgba(7, 5, 14, 0.95),
    0 1px 2px rgba(7, 5, 14, 0.9);
}

.sc-label-code {
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dim, #8f7a52);
}

.sc-label-name {
  font-family: var(--serif, "Noto Serif SC", "Songti SC", "SimSun", serif);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-faint, #9a94bd);
  transition: color 220ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
              opacity 220ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.sc-star--gold .sc-label-name {
  color: var(--gold-bright, #f0dcae);
}

.sc-star.is-selected .sc-label-name {
  color: var(--ink, #efedf8);
}

.sc-star--gold.is-selected .sc-label-name {
  color: var(--gold-bright, #f0dcae);
}

/* 浮层出现时，常驻标签让位（信息交给浮层，避免重复） */
.sc-star.is-active .sc-label {
  opacity: 0;
}

.sc-label {
  transition: opacity 180ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}

/* 标签方位：r / l / t / b / tr / bl / br */
.sc-star[data-lpos="r"] .sc-label {
  left: calc(50% + 20px);
  top: 50%;
  transform: translateY(-50%);
  align-items: flex-start;
  text-align: left;
}

.sc-star[data-lpos="l"] .sc-label {
  right: calc(50% + 20px);
  top: 50%;
  transform: translateY(-50%);
  align-items: flex-end;
  text-align: right;
}

.sc-star[data-lpos="t"] .sc-label {
  left: 50%;
  bottom: calc(50% + 18px);
  transform: translateX(-50%);
  align-items: center;
  text-align: center;
}

.sc-star[data-lpos="b"] .sc-label {
  left: 50%;
  top: calc(50% + 18px);
  transform: translateX(-50%);
  align-items: center;
  text-align: center;
}

.sc-star[data-lpos="tr"] .sc-label {
  left: calc(50% + 6px);
  bottom: calc(50% + 18px);
  align-items: flex-start;
  text-align: left;
}

.sc-star[data-lpos="bl"] .sc-label {
  right: calc(50% + 14px);
  bottom: calc(50% + 16px);
  align-items: flex-end;
  text-align: right;
}

.sc-star[data-lpos="br"] .sc-label {
  left: calc(50% + 14px);
  top: calc(50% + 16px);
  align-items: flex-start;
  text-align: left;
}

/* ------------------------------- hover / focus 浮层 ------------------------------- */

.sc-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: max-content;
  max-width: min(210px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  text-align: left;
  text-shadow:
    0 0 14px rgba(7, 5, 14, 0.96),
    0 1px 3px rgba(7, 5, 14, 0.92);
  transition:
    opacity 180ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
    visibility 0s linear 180ms;
}

.sc-tip.is-visible {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 180ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
    visibility 0s linear 0s;
}

/* hidden 属性优先：meta 行是 flex，需要显式盖掉 UA 规则 */
.sc-tip [hidden] {
  display: none;
}

.sc-tip-code {
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-ghost, #7f7aa2);
}

.sc-tip--gold .sc-tip-code {
  color: var(--gold, #d9bd82);
}

.sc-tip-title {
  font-family: var(--serif, "Noto Serif SC", "Songti SC", "SimSun", serif);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--ink, #efedf8);
  white-space: normal;
}

.sc-tip-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  font-family: var(--mono, "JetBrains Mono", "SFMono-Regular", Consolas, monospace);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft, #bcb6d3);
}

.sc-tip-sep {
  color: var(--ink-ghost, #7f7aa2);
}

/* --------------------------- 沿星轨巡游的小光点 --------------------------- */

.sc-wanderer-head {
  fill: var(--star-white, #ffffff);
}

.sc-wanderer-halo {
  fill: var(--star-blue, #cfdcff);
}

.sc-wanderer-tail {
  fill: var(--star-blue, #cfdcff);
}

/* ------------------------------- 小屏 ------------------------------- */

/* root 宽度 < 560px（≈ 页面 640px 视口下的组件宽度）：
   只留金色星和当前选中星的常驻标签，避免拥挤 */
.sc-root[data-narrow="true"] {
  --sc-hit: 36px;
}

.sc-root[data-narrow="true"] .sc-star:not(.sc-star--gold):not(.is-selected) .sc-label {
  opacity: 0;
  visibility: hidden;
}

.sc-root[data-narrow="true"] .sc-svg .sc-ghost-label {
  opacity: 0;
}

.sc-root[data-narrow="true"] .sc-svg .sc-axis-label {
  opacity: 0;
}

/* 移动端只留网格 + 星轨 + 巡游点 + 金色星环：隐藏角落星座与小注 */
.sc-root[data-narrow="true"] .sc-constellations,
.sc-root[data-narrow="true"] .sc-coords,
.sc-root[data-narrow="true"] .sc-fig-label {
  display: none;
}

.sc-root[data-narrow="true"] .sc-star .sc-label-name {
  font-size: 0.68rem;
}

.sc-root[data-narrow="true"] .sc-tip {
  max-width: min(190px, calc(100% - 20px));
}

.sc-root[data-narrow="true"] .sc-tip-title {
  font-size: 0.88rem;
}

/* 触屏 / 无 hover：不弹 hover 浮层，点击即选中，标签常驻 */
@media (hover: none) {
  .sc-tip {
    display: none;
  }

  .sc-root.has-active .sc-star {
    opacity: 1;
  }

  .sc-star.is-active .sc-dot,
  .sc-star.is-selected .sc-dot {
    transform: translate(-50%, -50%);
  }

  .sc-star.is-active .sc-halo {
    transform: translate(-50%, -50%);
  }
}

/* --------------------------- 减少动态 --------------------------- */

.sc-root[data-motion="off"] .sc-trail-haze,
.sc-root[data-motion="off"] .sc-trail,
.sc-root[data-motion="off"] .sc-trail-glow {
  transition: none;
  stroke-dashoffset: 0;
}

.sc-root[data-motion="off"] .sc-grid-line,
.sc-root[data-motion="off"] .sc-grid-corner,
.sc-root[data-motion="off"] .sc-ghost,
.sc-root[data-motion="off"] .sc-axis-base,
.sc-root[data-motion="off"] .sc-axis-tick,
.sc-root[data-motion="off"] .sc-axis-label,
.sc-root[data-motion="off"] .sc-coords,
.sc-root[data-motion="off"] .sc-dust-field,
.sc-root[data-motion="off"] .sc-constellation,
.sc-root[data-motion="off"] .sc-fig-label,
.sc-root[data-motion="off"] .sc-branches {
  transition: none;
  opacity: 1;
}

.sc-root[data-motion="off"] .sc-halo,
.sc-root[data-motion="off"] .sc-rays {
  animation: none;
}

.sc-root[data-motion="off"] .sc-branch {
  animation: none;
}

.sc-root[data-motion="off"] .sc-wanderer {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .sc-root .sc-trail-haze,
  .sc-root .sc-trail,
  .sc-root .sc-trail-glow {
    transition: none;
    stroke-dashoffset: 0;
  }

  .sc-root .sc-grid-line,
  .sc-root .sc-grid-corner,
  .sc-root .sc-ghost,
  .sc-root .sc-axis-base,
  .sc-root .sc-axis-tick,
  .sc-root .sc-axis-label,
  .sc-root .sc-coords,
  .sc-root .sc-dust-field,
  .sc-root .sc-constellation,
  .sc-root .sc-fig-label,
  .sc-root .sc-branches {
    transition: none;
    opacity: 1;
  }

  .sc-root .sc-halo,
  .sc-root .sc-rays {
    animation: none;
  }

  .sc-root .sc-branch {
    animation: none;
  }

  .sc-root .sc-wanderer {
    display: none;
  }
}

/* 视口 < 640px：与组件宽度判断互补，小屏只留金色星 / 选中星的常驻标签 */
@media (max-width: 640px) {
  .sc-root .sc-star:not(.sc-star--gold):not(.is-selected) .sc-label {
    opacity: 0;
    visibility: hidden;
  }

  .sc-root .sc-svg .sc-ghost-label,
  .sc-root .sc-svg .sc-axis-label {
    opacity: 0;
  }

  .sc-root .sc-constellations,
  .sc-root .sc-coords,
  .sc-root .sc-svg .sc-fig-label {
    display: none;
  }
}
