/* 夜间 Liquid Glass
   - 折射：边缘 1.5–2px 的环上叠一层位移贴图（SVG feDisplacementMap），模拟玻璃把背景折弯
   - 高光：顶部一抹镜面反光 + 内侧 1px 亮边，标出材质厚度
   - 底：半透明色 + 背景模糊 + 轻微提亮，颜色随背景渗透
   - 只作用于夜间；白天仍是新拟态
   - 玻璃不叠玻璃；一屏最多三块玻璃面（见 .lg / .lg--panel） */

:root[data-theme="dark"] {
  --lg-blur: 16px;
  --lg-bright: 1.06;
  --lg-rim: 2px;
  --lg-edge: rgba(255, 255, 255, .16);
  --lg-sheen: .5;
}

:root[data-theme="dark"] .lg {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .14) 0%,
      rgba(255, 255, 255, .025) 46%,
      rgba(255, 255, 255, .07) 100%
    );
  border: 1px solid var(--lg-edge);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(190%) brightness(var(--lg-bright));
  backdrop-filter: blur(var(--lg-blur)) saturate(190%) brightness(var(--lg-bright));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 -1px 0 rgba(0, 0, 0, .42),
    inset 1px 0 0 rgba(255, 255, 255, .07),
    0 16px 34px rgba(0, 0, 0, .42),
    0 2px 8px rgba(0, 0, 0, .28);
  transition:
    transform 140ms var(--ease),
    box-shadow 220ms var(--ease),
    background-color 220ms var(--ease);
}

/* 边缘折射环：只在环上做模糊 + 位移 + 提亮 */
:root[data-theme="dark"] .lg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: var(--lg-rim);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  /* 折射带：把背景折弯、提亮，再叠一层由上往下的方向光 */
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .07) 0%,
    rgba(255, 255, 255, .008) 42%,
    rgba(255, 255, 255, 0) 62%,
    rgba(255, 255, 255, .02) 100%
  );
  -webkit-backdrop-filter: blur(1px) brightness(1.3) saturate(150%);
  backdrop-filter: blur(1px) brightness(1.1) saturate(140%) url(#lg-refract);
  pointer-events: none;
}

/* 顶部镜面高光：压在最底层，不盖文字 */
:root[data-theme="dark"] .lg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(
      120% 58% at 50% -16%,
      rgba(255, 255, 255, .38),
      rgba(255, 255, 255, .07) 44%,
      transparent 64%
    );
  opacity: var(--lg-sheen);
  pointer-events: none;
}

:root[data-theme="dark"] .lg:active {
  transform: scale(.96);
}

/* 大面板：更厚的玻璃 —— 更深的模糊、更宽的边、更重的阴影 */
:root[data-theme="dark"] .lg--panel {
  --lg-blur: 24px;
  --lg-rim: 5px;
  --lg-bright: 1.03;
  --lg-sheen: .34;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .07) 0%,
      rgba(255, 255, 255, .012) 40%,
      rgba(255, 255, 255, .03) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -1px 0 rgba(0, 0, 0, .5),
    0 28px 60px rgba(0, 0, 0, .55),
    0 4px 14px rgba(0, 0, 0, .32);
}

.lg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* 降低透明度 / 提高对比：退化成磨砂实底 */
@media (prefers-reduced-transparency: reduce) {
  :root[data-theme="dark"] .lg {
    background: rgba(18, 22, 32, .94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  :root[data-theme="dark"] .lg::before,
  :root[data-theme="dark"] .lg::after {
    display: none;
  }
}

@media (prefers-contrast: more) {
  :root[data-theme="dark"] .lg {
    background: rgba(8, 10, 16, .96);
    border-color: rgba(255, 255, 255, .55);
  }
}

/* ---------- 星图操作条：玻璃滑块在按钮之间流动 ---------- */
.galaxy-hud-actions {
  position: relative;
  isolation: isolate;
}
.galaxy-hud-actions .galaxy-glide {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  transform: translateX(0);
  border-radius: 6px;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .10) 0%,
      rgba(255, 255, 255, .015) 46%,
      rgba(255, 255, 255, .05) 100%
    );
  border: 1px solid rgba(255, 255, 255, .14);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -1px 0 rgba(0, 0, 0, .45),
    inset 0 0 12px rgba(255, 255, 255, .06),
    0 8px 20px rgba(0, 0, 0, .38),
    0 0 0 1px rgba(255, 255, 255, .04);
  transition:
    transform .38s cubic-bezier(.32, .72, 0, 1),
    width .38s cubic-bezier(.32, .72, 0, 1),
    opacity .16s ease;
}
.galaxy-glide::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 1px 0 0 rgba(255, 255, 255, .12),
    inset 0 -1px 0 rgba(0, 0, 0, .30);
}
.galaxy-hud-actions.is-gliding .galaxy-glide { opacity: 1; }


/* 滑过时，只有边缘一圈像镜片一样把下面的字折弯；中心保持透传 */

.galaxy-hud-actions .galaxy-reset {
  position: relative;
  z-index: 1;
  transition: color .18s var(--ease);
}
@media (hover: hover) {
  .galaxy-hud-actions .galaxy-reset:hover:enabled { background: transparent; }
}
/* 开拓新域：只保留金色文字，底与边交给滑块 */
.galaxy-hud-actions .galaxy-reset.primary-pill {
  background: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* 操作条内的四个按钮统一成纯文字，材质只由滑块提供 */
.galaxy-hud-actions .galaxy-reset {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.galaxy-hud-actions .galaxy-reset:focus-visible {
  outline: 1px solid rgba(255, 210, 122, .8);
  outline-offset: -3px;
}

/* 星史未启 · 液态玻璃提示窗（与夜间液态玻璃体系一脉相承） */
.story-notice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: radial-gradient(circle at 50% 44%, rgba(14, 20, 38, .44), rgba(4, 6, 14, .72));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .26s ease;
}
.story-notice-backdrop.on { opacity: 1; }
.story-notice-backdrop[hidden] { display: none; }

.story-notice-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 45;
  width: min(430px, calc(100vw - 36px));
  padding: 28px 28px 24px;
  border-radius: 22px;
  transform: translate(-50%, -46%) scale(.96);
  opacity: 0;
  color: #eef1f7;
  text-align: center;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, .11) 0%, rgba(18, 24, 42, .42) 48%, rgba(255, 214, 150, .06) 100%);
  border: 1px solid rgba(255, 255, 255, .20);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .52),
    inset 0 -1px 0 rgba(0, 0, 0, .42),
    inset 0 0 26px rgba(255, 210, 122, .05),
    0 24px 64px rgba(0, 0, 0, .58);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1), opacity .26s ease;
}
.story-notice-modal.on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.story-notice-modal[hidden] { display: none; }

.story-notice-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: rgba(235, 240, 250, .75);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.story-notice-close:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 210, 122, .45);
  color: #ffd27a;
}

.story-notice-kicker {
  margin: 0 0 10px;
  font-size: 10.5px;
  letter-spacing: .24em;
  color: rgba(255, 214, 138, .82);
  font-family: var(--font-mono, ui-monospace, monospace);
}
.story-notice-title {
  margin: 0 0 10px;
  font-family: var(--font-serif, serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: .04em;
  color: #fff6e6;
  text-shadow: 0 2px 18px rgba(255, 210, 122, .22);
}
.story-notice-desc {
  margin: 0 auto 18px;
  max-width: 368px;
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(226, 232, 244, .82);
}

.story-notice-pips {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
}
.story-notice-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.story-notice-pip.lit {
  background: #ffd27a;
  box-shadow: 0 0 10px rgba(255, 210, 122, .85);
}
.story-notice-pip-label {
  margin-left: 4px;
  font-size: 11.5px;
  color: rgba(235, 240, 250, .72);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.story-notice-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.story-notice-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .03));
  color: rgba(240, 244, 252, .9);
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .36),
    0 8px 20px rgba(0, 0, 0, .32);
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}
.story-notice-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, .36);
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
}
.story-notice-btn.primary {
  border-color: rgba(255, 210, 122, .45);
  color: #ffe2a4;
  background: linear-gradient(180deg, rgba(255, 210, 122, .18), rgba(255, 210, 122, .05));
}
.story-notice-btn.primary:hover {
  border-color: rgba(255, 210, 122, .78);
  color: #fff3d2;
}
