/* 星港档案 / STARPORT ARCHIVE — 主题覆写层 (v3)
   1. 严格保护所有弹窗/浮层原有的 fixed / absolute 定位，绝不覆盖 position
   2. 移除液态玻璃折射扭曲与连体滑块，还原预设方案 A 的独立直角细框 + 5px 方点 + 外置 -3px 四角 L 标收拢动效
   3. 统一全站字体、卡片面板与进度条 */

@keyframes starport-blink {
  0% { opacity: .35; }
  50% { opacity: 1; }
}

/* =========================================================
   0. 彻底禁用旧版液态玻璃折射扭曲与连体滑块（消除彩虹重影与黑底条）
   ========================================================= */
.galaxy-glide,
.nc-glide {
  display: none !important;
}

:root[data-theme="dark"] .lg::before,
:root[data-theme="dark"] .lg::after {
  display: none !important;
}

:root[data-theme="dark"] .lg {
  -webkit-backdrop-filter: blur(14px) !important;
  backdrop-filter: blur(14px) !important;
  box-shadow: none !important;
}

/* 彻底禁止 .lg:active 覆盖居中弹窗的 translate(-50%, -50%) 导致点击时窗口跳走躲开鼠标 */
:root[data-theme="dark"] .lg:active,
:root[data-theme="dark"] .lg--panel:active {
  transform: none;
}

.story-notice-modal,
.story-notice-modal.on,
.story-notice-modal:active,
.story-notice-modal.on:active,
.explore-modal,
.explore-modal:active,
.api-gate-modal,
.api-gate-modal:active {
  transform: translate(-50%, -50%) !important;
}

.story-notice-modal:not(.on),
.story-notice-backdrop:not(.on) {
  pointer-events: none !important;
}

/* 星图左上 HUD 操作组：拆掉连体黑壳，还原预设方案 A 的独立按钮间距 */
.galaxy-hud-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 !important;
  margin-top: 14px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  overflow: visible !important;
}

.ks-explore-bar,
.node-card-foot,
.fold-confirm-actions,
.api-gate-actions,
.story-notice-actions,
.reader-topbar-left,
.reader-topbar-right,
.frontier-suggest-actions,
.frontier-quick-chips,
.psurvey-opts,
.pstage-actions {
  overflow: visible !important;
}

.ks-explore-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* =========================================================
   1. 字体体系：Michroma 宽体英文/数字 + 思源黑体轻字重中文
   ========================================================= */
.brand-en,
.galaxy-label,
.intro-kicker,
.auth-panel-kicker,
.auth-kicker,
.api-gate-kicker,
.explore-kicker,
.node-card-kicker,
.cosmic-kicker,
.story-act,
.story-step,
.story-notice-kicker,
.warp-metrics,
.warp-block-label,
.warp-order-index,
.wb-kicker,
.drawer-kicker {
  font-family: var(--font-display) !important;
  letter-spacing: .24em !important;
  text-transform: uppercase;
}

.brand-cn,
.intro-brand,
.auth-title,
.api-gate-title,
.explore-title,
.node-card-title,
.node-card-name,
.warp-card-title,
.cosmic-title,
.story-text,
.story-notice-title,
.about-title,
.wb-title {
  font-family: var(--font-sans) !important;
  font-weight: 300 !important;
  letter-spacing: .12em;
}

/* 封面主标语：无标点、轻字重、光学字距补偿严格居中 */
.cover .intro {
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center !important;
}

#coverTitle,
.intro h1 {
  font-family: var(--font-sans) !important;
  font-weight: 300 !important;
  letter-spacing: .14em !important;
  padding-left: .14em !important;
  text-align: center !important;
  margin-inline: auto !important;
}

.intro-tagline,
.auth-sub,
.api-gate-sub,
.explore-sub,
.warp-block-text,
.node-card-summary {
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: .04em;
}

/* =========================================================
   2. 弹窗与卡片面板（严格保留原 fixed / absolute 定位，不改 position！）
   ========================================================= */
.auth-panel,
.api-gate-modal,
.explore-modal,
.story-notice-modal,
.reader-modal,
.psat-popup,
.about,
.frontier-suggest-banner,
.reader-shell,
.reader-chat-panel,
.wb-card,
.drawer-panel,
.submap-card,
.warp-card,
.frontier-topic-card,
.psurvey-card,
.psat-list-item,
.warp-block,
.filter-rule-box,
.node-card-excerpt,
.auth-qr-box,
.ks-item,
.toast {
  border-radius: 0 !important;
  border: 1px solid var(--line) !important;
}

.ks-item {
  background: rgba(255, 255, 255, .02) !important;
  transition: background .12s step-end, border-color .12s step-end !important;
}
.ks-item:hover {
  background: rgba(255, 255, 255, .06) !important;
  border-color: var(--line-hi) !important;
  animation: starport-blink .12s step-end;
}

:root[data-theme="dark"] .auth-panel,
:root[data-theme="dark"] .api-gate-modal,
:root[data-theme="dark"] .explore-modal,
:root[data-theme="dark"] .story-notice-modal,
:root[data-theme="dark"] .psat-popup,
:root[data-theme="dark"] .about,
:root[data-theme="dark"] .frontier-suggest-banner,
:root[data-theme="dark"] .wb-card,
:root[data-theme="dark"] .drawer-panel {
  background: rgba(7, 9, 16, .88) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .68) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  backdrop-filter: blur(18px) !important;
}

:root[data-theme="dark"] .warp-card,
:root[data-theme="dark"] .frontier-topic-card,
:root[data-theme="dark"] .submap-card,
:root[data-theme="dark"] .psurvey-card {
  background: rgba(255, 255, 255, .02) !important;
}

:root[data-theme="dark"] .warp-block {
  background: rgba(255, 255, 255, .018) !important;
  border-color: var(--line) !important;
}

:root[data-theme="dark"] .warp-block.gain {
  background: rgba(255, 210, 122, .045) !important;
  border-color: rgba(255, 210, 122, .26) !important;
}

/* 大模态面板对角 L 形角标（注意：绝不改这些面板的 position，也绝不碰 .node-card 的伪元素） */
.auth-panel::before,
.api-gate-modal::before,
.explore-modal::before,
.story-notice-modal::before,
.wb-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 9px;
  height: 9px;
  border-top: 1px solid var(--starport-corner);
  border-left: 1px solid var(--starport-corner);
  pointer-events: none;
  z-index: 5;
}

.auth-panel::after,
.api-gate-modal::after,
.explore-modal::after,
.story-notice-modal::after,
.wb-card::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-right: 1px solid var(--starport-corner);
  border-bottom: 1px solid var(--starport-corner);
  pointer-events: none;
  z-index: 5;
}

/* 卡片悬停提亮 + 瞬时闪烁 */
.warp-card,
.frontier-topic-card,
.submap-card {
  transition: background .12s step-end, border-color .12s step-end !important;
}

.warp-card:hover,
.frontier-topic-card:hover,
.submap-card:hover {
  transform: none !important;
  background: rgba(255, 255, 255, .06) !important;
  border-color: var(--line-hi) !important;
  animation: starport-blink .12s step-end;
}

/* =========================================================
   3. 预设方案 A 选项 UI（.sp-opt）：1:1 还原预览页 .a-opt
      直角 1px 细线 + 左侧 5px 实心方点 + 外置 -3px 四角 L 标 80ms 收拢
   ========================================================= */
.sp-opt,
.galaxy-hud-actions .galaxy-reset.sp-opt,
.node-card .node-card-collapse.sp-opt {
  position: relative;
  appearance: none;
  cursor: pointer;
  min-height: 38px !important;
  padding: 8px 16px !important;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px !important;
  font-family: var(--font-sans) !important;
  font-weight: 400 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  letter-spacing: .16em !important;
  color: var(--text-2) !important;
  background: rgba(8, 10, 18, .48) !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  overflow: visible !important;
  transform: none !important;
  transition:
    background .12s step-end,
    border-color .12s step-end,
    color .12s step-end !important;
}

.sp-opt[hidden],
.galaxy-hud-actions .galaxy-reset.sp-opt[hidden],
.node-card .node-card-collapse.sp-opt[hidden] {
  display: none !important;
}

/* 保留原本占满整行的块级大按钮宽度（如星球探索·跃迁、跃迁至此帖、登录主按钮） */
.node-card .node-card-collapse.sp-opt,
.warp-select-btn.sp-opt,
.auth-primary.sp-opt,
.pioneer-primary-btn.sp-opt,
.pioneer-ignite-btn.sp-opt {
  width: 100%;
}

/* 保留固定/绝对定位的独立按钮原有的定位！ */
.galaxy-back.sp-opt,
.intro-skip.sp-opt {
  position: fixed !important;
}
.galaxy .galaxy-back.sp-opt {
  position: absolute !important;
}
.submap-rename-btn.sp-opt {
  position: absolute !important;
  top: auto !important;
  bottom: 10px !important;
  right: 10px !important;
}
.galaxy .node-card .node-card-close {
  position: absolute !important;
  top: 14px !important;
  right: 16px !important;
  z-index: 4 !important;
}

/* 日间模式适配 */
:root:not([data-theme="dark"]) .sp-opt:not(.galaxy-reset):not(.galaxy-motion):not(.galaxy-back):not(.node-card-collapse) {
  background: rgba(38, 44, 53, .03) !important;
  border-color: rgba(38, 44, 53, .18) !important;
  color: var(--text-2) !important;
}

/* 左侧 5px × 5px 实心方点（.sp-dot） */
.sp-opt .sp-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  background: #6d7789;
  transition: background .12s step-end, box-shadow .12s step-end;
}

/* 四角外置 -3px L 形角标容器 */
.sp-opt .sp-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.sp-opt .sp-corners > i {
  position: absolute;
  width: 5px;
  height: 5px;
  opacity: 0;
  transition:
    transform 80ms cubic-bezier(.785, .135, .15, .86),
    opacity 80ms ease;
}

.sp-opt .sp-corners > i:nth-child(1) {
  top: -3px;
  left: -3px;
  border-top: 1px solid var(--starport-corner);
  border-left: 1px solid var(--starport-corner);
  transform: translate(-3px, -3px);
}
.sp-opt .sp-corners > i:nth-child(2) {
  top: -3px;
  right: -3px;
  border-top: 1px solid var(--starport-corner);
  border-right: 1px solid var(--starport-corner);
  transform: translate(3px, -3px);
}
.sp-opt .sp-corners > i:nth-child(3) {
  bottom: -3px;
  left: -3px;
  border-bottom: 1px solid var(--starport-corner);
  border-left: 1px solid var(--starport-corner);
  transform: translate(-3px, 3px);
}
.sp-opt .sp-corners > i:nth-child(4) {
  bottom: -3px;
  right: -3px;
  border-bottom: 1px solid var(--starport-corner);
  border-right: 1px solid var(--starport-corner);
  transform: translate(3px, 3px);
}

/* 星图画布始终是深空背景，星图上的选项角标始终用亮白 */
.galaxy .sp-opt .sp-corners > i {
  border-color: #ffffff;
}

/* 悬停 / 聚焦 / 激活态：底色提亮 + 外置四角 L 标收拢 + 瞬时闪烁 */
.sp-opt:hover:not(:disabled),
.sp-opt:focus-visible:not(:disabled),
.psurvey-opt.sp-opt.active,
.rc-web-opt.sp-opt.is-active {
  outline: none !important;
  background: rgba(255, 255, 255, .10) !important;
  border-color: rgba(255, 255, 255, .22) !important;
  color: #e8ecf4 !important;
  animation: starport-blink .12s step-end;
}

:root:not([data-theme="dark"]) .sp-opt:not(.galaxy-reset):not(.galaxy-motion):not(.galaxy-back):not(.node-card-collapse):hover:not(:disabled) {
  background: rgba(38, 44, 53, .09) !important;
  border-color: rgba(38, 44, 53, .36) !important;
  color: var(--text) !important;
}

.sp-opt:hover:not(:disabled) .sp-dot,
.sp-opt:focus-visible:not(:disabled) .sp-dot {
  background: #e8ecf4;
}

.sp-opt:hover:not(:disabled) .sp-corners > i,
.sp-opt:focus-visible:not(:disabled) .sp-corners > i,
.psurvey-opt.sp-opt.active .sp-corners > i {
  opacity: 1;
  transform: none;
}

/* 重点主选项（开拓新域 / 星球探索·跃迁 / 跃迁此帖 等）：恒星金描边 + 发光金方点 + 金色外置角标 */
.sp-opt.sp-opt--primary,
.galaxy-hud-actions .galaxy-reset.sp-opt.sp-opt--primary,
.node-card .node-card-collapse.sp-opt.sp-opt--primary,
.psurvey-opt.sp-opt.active {
  color: #ffd27a !important;
  border-color: rgba(255, 210, 122, .36) !important;
  background: rgba(255, 210, 122, .04) !important;
}

.sp-opt.sp-opt--primary .sp-dot,
.psurvey-opt.sp-opt.active .sp-dot {
  background: #ffd27a !important;
  box-shadow: 0 0 8px #ffd27a;
}

.sp-opt.sp-opt--primary .sp-corners > i,
.psurvey-opt.sp-opt.active .sp-corners > i {
  border-color: #ffd27a !important;
}

.sp-opt.sp-opt--primary:hover:not(:disabled),
.sp-opt.sp-opt--primary:focus-visible:not(:disabled),
.galaxy-hud-actions .galaxy-reset.sp-opt.sp-opt--primary:hover:not(:disabled),
.node-card .node-card-collapse.sp-opt.sp-opt--primary:hover:not(:disabled) {
  background: rgba(255, 210, 122, .13) !important;
  border-color: rgba(255, 210, 122, .68) !important;
  color: #ffe6b8 !important;
}

:root:not([data-theme="dark"]) .sp-opt.sp-opt--primary:not(.galaxy-reset):not(.node-card-collapse) {
  color: #8a5e14 !important;
  border-color: rgba(169, 119, 34, .45) !important;
  background: rgba(169, 119, 34, .06) !important;
}
:root:not([data-theme="dark"]) .sp-opt.sp-opt--primary:not(.galaxy-reset):not(.node-card-collapse) .sp-dot {
  background: #a97722 !important;
  box-shadow: none;
}
:root:not([data-theme="dark"]) .sp-opt.sp-opt--primary:not(.galaxy-reset):not(.node-card-collapse) .sp-corners > i {
  border-color: #a97722 !important;
}

/* 紧凑小尺寸选项（暂停动态、改名、灵感芯片、伴航预设芯片） */
.galaxy-motion.sp-opt,
.submap-rename-btn.sp-opt,
.frontier-chip-btn.sp-opt,
.rc-preset-chip.sp-opt,
.rc-web-opt.sp-opt,
.rc-copy-btn.sp-opt,
.rc-retry-btn.sp-opt {
  min-height: 30px !important;
  padding: 5px 11px !important;
  font-size: 11px !important;
  letter-spacing: .12em !important;
  gap: 8px !important;
}

/* 跨星域迁移目标行选项 */
.move-target-item.sp-opt {
  width: 100%;
  justify-content: space-between;
  padding: 14px 18px !important;
  text-align: left;
}

/* =========================================================
   4. Tabs、小徽章、关闭方钮与输入框
   ========================================================= */
.auth-tabs,
.frontier-tabs-bar,
.drawer-tabs,
.rc-side-tabs {
  border-radius: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  background: transparent !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

.auth-tab,
.frontier-tab,
.drawer-tab,
.rc-side-tab {
  border-radius: 0 !important;
  border: 0 !important;
  border-right: 1px solid var(--line) !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  letter-spacing: .14em;
}

.auth-tab:last-child,
.frontier-tab:last-child,
.drawer-tab:last-child,
.rc-side-tab:last-child {
  border-right: 0 !important;
}

.auth-tab::before,
.frontier-tab::before,
.drawer-tab::before,
.rc-side-tab::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid var(--text-3);
  flex-shrink: 0;
}

.auth-tab.on,
.frontier-tab.active,
.drawer-tab.active,
.rc-side-tab.active {
  background: var(--starport-fill-hi) !important;
  color: var(--text) !important;
}

.auth-tab.on::before,
.frontier-tab.active::before,
.drawer-tab.active::before,
.rc-side-tab.active::before {
  background: var(--accent);
  border-color: var(--accent);
}

/* 静态展示小标签（# 联想检索、角度徽章、状态徽章） */
.warp-query-chip:not(button),
.warp-angle-badge,
.submap-mode-badge,
.submap-active-badge,
.submap-domain-chip,
.submap-tag,
.galaxy-fog-badge,
.reader-account-chip,
.reader-pipeline-chip,
.pioneer-read-stage-pill,
.pioneer-prereq-chip,
.story-notice-pips {
  border-radius: 0 !important;
  border: 1px solid var(--line) !important;
  background: var(--starport-fill) !important;
  font-family: var(--font-sans);
  letter-spacing: .08em;
}

.warp-angle-badge {
  border-color: rgba(255, 210, 122, .32) !important;
  background: rgba(255, 210, 122, .08) !important;
}

/* 方形图标按钮（× 关闭、日夜切换、星史暂停/退出、改名铅笔） */
.explore-close,
.node-card .node-card-close,
.node-card-close,
.story-notice-close,
.theme-toggle,
.story-close,
.story-pause,
.galaxy-rename-btn,
.rc-head-btn {
  border-radius: 0 !important;
  border: 1px solid var(--line) !important;
  background: rgba(8, 10, 18, .48) !important;
  box-shadow: none !important;
  transition: background .12s step-end, border-color .12s step-end, color .12s step-end !important;
}

:root:not([data-theme="dark"]) .theme-toggle {
  background: rgba(38, 44, 53, .04) !important;
}

.explore-close:hover,
.node-card .node-card-close:hover,
.node-card-close:hover,
.story-notice-close:hover,
.theme-toggle:hover,
.story-close:hover,
.story-pause:hover,
.galaxy-rename-btn:hover,
.rc-head-btn:hover {
  border-color: var(--line-hi) !important;
  background: rgba(255, 255, 255, .12) !important;
  color: #ffffff !important;
  animation: starport-blink .12s step-end;
}

/* 输入框 */
.auth-field input,
.api-gate-field input,
.frontier-input,
.drawer-panel input,
.drawer-panel select,
.drawer-panel textarea {
  border-radius: 0 !important;
  border: 1px solid var(--line) !important;
  background: var(--starport-fill) !important;
}

.auth-field input:focus,
.api-gate-field input:focus,
.frontier-input:focus,
.drawer-panel input:focus,
.drawer-panel select:focus,
.drawer-panel textarea:focus {
  border-color: var(--line-hi) !important;
  background: var(--starport-fill-hi) !important;
  outline: none !important;
}

/* =========================================================
   5. 预设方案 A 进度条 + 宇宙飞船舱门开闭转场（无任何流动星星背景）
   ========================================================= */
@keyframes sp-status-pulse {
  0%, 100% { opacity: .52; }
  50% { opacity: 1; }
}

/* 舱门状态栏电子自检闪烁动画（加载期间闪烁，进度满 100 后由 .hud-stabilized 锁定常亮） */
@keyframes sp-hud-flicker {
  0%   { opacity: .26; }
  18%  { opacity: .88; }
  32%  { opacity: .34; }
  54%  { opacity: .94; }
  72%  { opacity: .45; }
  88%  { opacity: 1; }
  100% { opacity: .38; }
}

@keyframes sp-hud-dot-blink {
  0%, 49% { opacity: .25; }
  50%, 100% { opacity: 1; }
}

.cosmic-transition {
  background: transparent !important;
  clip-path: none !important;
  opacity: 0;
  transition: opacity .16s ease !important;
}

.cosmic-transition.on {
  opacity: 1 !important;
  clip-path: none !important;
}

.cosmic-transition.fade-out {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .28s ease !important;
}

/* 隐藏任何旧版 canvas */
.cosmic-transition-canvas {
  display: none !important;
}

/* 底幕：
   - hatch="open"（进入星图）：舱门滑开前兜底纯黑，开始滑开时立即透明以露出后方星图
   - hatch="close"（返回封面）：压暗静止画面突出进度环，让随后合拢的实心装甲舱门层次分明 */
.sp-hatch-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #05060b;
  transition: opacity .12s ease;
}

.cosmic-transition[data-hatch="open"].hatch-opening .sp-hatch-backdrop {
  opacity: 0;
}

.cosmic-transition[data-hatch="close"] .sp-hatch-backdrop {
  background: rgba(4, 5, 10, .92);
}

/* 宇宙飞船上下装甲观测舱门（放慢至 1.28s 沉稳重型液压阻尼，中央 45° 阴阳梯形机械咬合口） */
.sp-hatch {
  position: absolute;
  left: 0;
  right: 0;
  height: calc(50% + 10px);
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  transition: transform 1.28s cubic-bezier(.50, 0, .14, 1);
}

.sp-hatch--top {
  top: 0;
  background: rgba(255, 255, 255, .30);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 20px),
    calc(50% + 112px) calc(100% - 20px),
    calc(50% + 92px) 100%,
    calc(50% - 92px) 100%,
    calc(50% - 112px) calc(100% - 20px),
    0 calc(100% - 20px)
  );
}
.sp-hatch--top::before {
  content: "";
  position: absolute;
  inset: 0 0 1px 0;
  z-index: 0;
  background: linear-gradient(180deg, #05070d 0%, #090d18 86%, #101728 100%);
  clip-path: inherit;
}

.sp-hatch--bottom {
  bottom: 0;
  background: rgba(255, 255, 255, .30);
  clip-path: polygon(
    0 0,
    calc(50% - 111.5px) 0,
    calc(50% - 91.5px) 20px,
    calc(50% + 91.5px) 20px,
    calc(50% + 111.5px) 0,
    100% 0,
    100% 100%,
    0 100%
  );
}
.sp-hatch--bottom::before {
  content: "";
  position: absolute;
  inset: 1px 0 0 0;
  z-index: 0;
  background: linear-gradient(0deg, #05070d 0%, #090d18 86%, #101728 100%);
  clip-path: inherit;
}

/* 舱门表面精密工程折线、编号铭牌与「星港档案」状态栏 */
.sp-hatch-edge,
.sp-hud-row {
  z-index: 1;
}

.sp-hud-row {
  position: absolute;
  left: clamp(24px, 4vw, 54px);
  right: clamp(24px, 4vw, 54px);
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  pointer-events: none;
  transition: opacity .82s ease .12s;
}

.sp-hud-row--top {
  bottom: 56px;
}

.sp-hud-row--bottom {
  top: 56px;
}

/* 舱门打开时，状态栏随舱门滑开一同平滑消失 */
.cosmic-transition.hatch-opening .sp-hud-row {
  opacity: 0;
}

/* 单块状态栏：严格遵循星港档案 UI 风格（直角 1px 细线 + 对角微角标 + 左侧 5px 方点） */
.sp-hud-box {
  position: relative;
  min-width: clamp(190px, 21vw, 272px);
  max-width: 310px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0;
  /* 默认加载中：电子自检闪烁 */
  animation: sp-hud-flicker .68s steps(2, end) infinite;
  transition:
    opacity .22s ease,
    border-color .22s ease,
    background .22s ease;
}

.sp-hud-row--top .sp-hud-box:nth-child(2) { animation-delay: .11s; }
.sp-hud-row--bottom .sp-hud-box:nth-child(1) { animation-delay: .21s; }
.sp-hud-row--bottom .sp-hud-box:nth-child(2) { animation-delay: .31s; }

/* 状态栏对角 5px 直角微角标 */
.sp-hud-box::before,
.sp-hud-box::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-color: rgba(255, 255, 255, .55);
  border-style: solid;
  pointer-events: none;
}
.sp-hud-box::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.sp-hud-box::after  { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }

.sp-hud-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  background: #8b95a5;
  animation: sp-hud-dot-blink .36s steps(1, end) infinite;
}

.sp-hud-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.sp-hud-key {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: .24em;
  color: rgba(232, 236, 244, .44);
  text-transform: uppercase;
  white-space: nowrap;
}

.sp-hud-val {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: .12em;
  color: #e8ecf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 权限等级栏：恒星金点缀 */
.sp-hud-box--gold {
  border-color: rgba(255, 210, 122, .26);
  background: rgba(255, 210, 122, .03);
}
.sp-hud-box--gold::before,
.sp-hud-box--gold::after {
  border-color: rgba(255, 210, 122, .75);
}
.sp-hud-box--gold .sp-hud-dot {
  background: #ffd27a;
}
.sp-hud-box--gold .sp-hud-val {
  color: #ffe6b8;
}

/* 进度转满 100 时（.hud-stabilized）：所有状态栏停止闪烁，保持稳定常亮锁定！ */
.cosmic-transition.hud-stabilized .sp-hud-box {
  animation: none !important;
  opacity: 1 !important;
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .055);
}

.cosmic-transition.hud-stabilized .sp-hud-box--gold {
  border-color: rgba(255, 210, 122, .52);
  background: rgba(255, 210, 122, .08);
}

.cosmic-transition.hud-stabilized .sp-hud-dot {
  animation: none !important;
  opacity: 1 !important;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, .7);
}

.cosmic-transition.hud-stabilized .sp-hud-box--gold .sp-hud-dot {
  background: #ffd27a;
  box-shadow: 0 0 8px #ffd27a;
}

@media (max-width: 720px) {
  .sp-hud-row--top { bottom: auto; top: 44px; }
  .sp-hud-row--bottom { top: auto; bottom: 44px; }
  .sp-hud-box { min-width: 0; flex: 1; padding: 7px 10px; }
  .sp-hud-val { font-size: 10.5px; letter-spacing: .06em; }
}

.sp-hatch-edge {
  position: absolute;
  left: 36px;
  right: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sp-hatch--top .sp-hatch-edge {
  bottom: 28px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.sp-hatch--bottom .sp-hatch-edge {
  top: 28px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.sp-hatch-code {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: .3em;
  color: rgba(232, 236, 244, .28);
  text-transform: uppercase;
}

/* 舱门位移逻辑：
   1) data-hatch="open"（进入星图）：初始闭合 -> 进度满渐暗后向两侧滑开（打开）
   2) data-hatch="close"（返回封面）：初始停在上下边缘待命 -> 进度满渐暗后向中央合拢（关闭） */
.cosmic-transition[data-hatch="open"] .sp-hatch--top {
  transform: translateY(0);
}
.cosmic-transition[data-hatch="open"] .sp-hatch--bottom {
  transform: translateY(0);
}
.cosmic-transition[data-hatch="open"].hatch-opening .sp-hatch--top {
  transform: translateY(-104%);
}
.cosmic-transition[data-hatch="open"].hatch-opening .sp-hatch--bottom {
  transform: translateY(104%);
}

.cosmic-transition[data-hatch="close"] .sp-hatch--top {
  transform: translateY(calc(-100% + 118px));
}
.cosmic-transition[data-hatch="close"] .sp-hatch--bottom {
  transform: translateY(calc(100% - 118px));
}
.cosmic-transition[data-hatch="close"].hatch-closing .sp-hatch--top,
.cosmic-transition[data-hatch="close"].hatch-sealed .sp-hatch--top {
  transform: translateY(0);
}
.cosmic-transition[data-hatch="close"].hatch-closing .sp-hatch--bottom,
.cosmic-transition[data-hatch="close"].hatch-sealed .sp-hatch--bottom {
  transform: translateY(0);
}

/* 舱门气密接缝解锁 / 闭锁一瞬间的 1px 横向光束 */
.sp-seam-flash {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  margin-top: -.5px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: scaleX(.18);
  background: linear-gradient(
    90deg,
    transparent 4%,
    rgba(255, 255, 255, .55) 28%,
    #ffffff 50%,
    rgba(255, 255, 255, .55) 72%,
    transparent 96%
  );
  box-shadow: 0 0 12px rgba(255, 255, 255, .55);
  transition: opacity .2s ease, transform .38s cubic-bezier(.22, 1, .36, 1);
}

.cosmic-transition[data-hatch="open"].loader-dim:not(.hatch-opening) .sp-seam-flash {
  opacity: .9;
  transform: scaleX(1);
}
.cosmic-transition[data-hatch="open"].hatch-opening .sp-seam-flash {
  opacity: 0;
  transform: scaleX(1);
}
.cosmic-transition[data-hatch="close"].hatch-sealed:not(.fade-out) .sp-seam-flash {
  opacity: .85;
  transform: scaleX(1);
}

/* 预设方案 A 屏幕四角 14px 取景角标 */
.sp-stage-corners {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity .24s ease;
}
.sp-stage-corners > i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(255, 255, 255, .35);
  border-style: solid;
}
.sp-stage-corners > i:nth-child(1) { top: 18px; left: 18px; border-width: 1px 0 0 1px; }
.sp-stage-corners > i:nth-child(2) { top: 18px; right: 18px; border-width: 1px 1px 0 0; }
.sp-stage-corners > i:nth-child(3) { bottom: 18px; left: 18px; border-width: 0 0 1px 1px; }
.sp-stage-corners > i:nth-child(4) { bottom: 18px; right: 18px; border-width: 0 1px 1px 0; }

.cosmic-transition.hatch-opening .sp-stage-corners {
  opacity: 0;
}

/* 中央进度环与状态文案（1:1 复刻预设方案 A，进度满时 loader-dim 渐暗消失） */
.cosmic-transition-center {
  position: relative;
  z-index: 3 !important;
  animation: none !important;
  transition: opacity .24s ease, transform .24s ease !important;
}

.cosmic-transition.loader-dim .cosmic-transition-center {
  opacity: 0 !important;
  transform: scale(.96);
  pointer-events: none;
}

.starport-loader-ring {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
}

.starport-loader-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.starport-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, .10);
  stroke-width: 1.5;
}

.starport-ring-fill {
  fill: none;
  stroke: #e8eaed;
  stroke-width: 1.5;
}

.starport-ring-star {
  fill: #fff;
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px rgba(255, 255, 255, .7));
}

.starport-loader-num {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #e8eaed;
}

.sp-loader-status {
  text-align: center;
  animation: sp-status-pulse 1.6s ease-in-out infinite;
}

.sp-status-zh {
  display: block;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: .3em;
  padding-left: .3em;
  color: #e8ecf4;
}

.sp-status-en {
  display: block;
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .38em;
  padding-left: .38em;
  text-transform: uppercase;
  color: rgba(232, 234, 237, .50);
}

.sp-status-sub {
  display: block;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: rgba(232, 236, 244, .45);
}

.cosmic-orb-loader::after {
  background: #fff !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, .8) !important;
}
.cosmic-orb-loader span:first-child {
  border-color: rgba(255, 255, 255, .14) !important;
  border-top-color: #fff !important;
}
.cosmic-orb-loader span:last-child {
  border-color: rgba(255, 255, 255, .10) !important;
  border-bottom-color: var(--accent) !important;
}

/* 星史进度条：方案 A 方块步进 */
.story-progress {
  height: auto !important;
  margin: 12px 0 18px !important;
  background: transparent !important;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  overflow: visible !important;
}

.story-progress > i:not(.story-step-dot) {
  display: none;
}

.story-progress .story-step-dot {
  display: block;
  width: 12px;
  height: 10px;
  background: rgba(255, 255, 255, .20);
  transition: width .15s steps(3), background .15s steps(3);
}

.story-progress .story-step-dot.past {
  background: rgba(255, 255, 255, .50);
}

.story-progress .story-step-dot.on {
  width: 32px;
  background: #ffffff;
}
