/* ==========================================================================
   LAYOUT — 顶栏 / 中央规划大厅三栏 / 页脚 / 弹层
   大厅是一个完整画面：三栏之间只用极细分隔线与光晕过渡，不做卡片套卡片。
   ========================================================================== */

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  background: linear-gradient(
    180deg,
    rgba(4, 6, 10, 0.92) 0%,
    rgba(4, 6, 10, 0.7) 62%,
    rgba(4, 6, 10, 0) 100%
  );
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.topbar::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--line) 12%,
    var(--line) 88%,
    transparent
  );
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand-cn {
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--ink-0);
  white-space: nowrap;
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.3em;
  color: var(--ink-3);
  white-space: nowrap;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 2px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.35s var(--ease-out);
}

.nav-link span {
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  transition: color 0.35s var(--ease-out);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--orange);
}
.nav-link:hover span,
.nav-link.is-active span {
  color: color-mix(in srgb, var(--orange) 62%, var(--ink-1));
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: linear-gradient(90deg, var(--orange), transparent);
  opacity: 0.95;
}

.nav-link--locked {
  color: var(--ink-3);
}
.nav-link--locked::before {
  content: "◇";
  font-size: 9.5px;
  margin-right: 2px;
  color: var(--line-hi);
}

.topbar__status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.demo-badge {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.2em;
  color: #d9b06a;
  border: var(--hair) solid rgba(217, 176, 106, 0.36);
  border-radius: 1px;
  padding: 3px 7px;
  white-space: nowrap;
}

.demo-badge.is-local {
  color: var(--ink-2);
  border-color: var(--line-mid);
}

.clock {
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

/* ---------------- 中央规划大厅 ---------------- */

.hall {
  position: relative;
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(10px, 1.8vh, 20px) var(--gutter) clamp(12px, 2vh, 22px);
}

/* 极缓的横向扫描光带：让大厅有"在运转"的感觉，但不抢信息 */
.hall::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 42vh;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(138, 189, 228, 0.10) 48%,
    rgba(170, 214, 248, 0.22) 50%,
    rgba(138, 189, 228, 0.10) 52%,
    transparent
  );
  pointer-events: none;
  z-index: 0;
  transform: translateY(var(--sweep-y, -32vh));
  will-change: transform;
}

.hall > * {
  position: relative;
  z-index: 1;
}

.hall-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(430px, 1.82fr) minmax(
      320px,
      1fr
    );
  align-items: stretch;
  gap: clamp(15px, 2.4vw, 44px);
  margin: clamp(6px, 1.2vh, 14px) 0 clamp(16px, 2.6vh, 30px);
}

.col {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 栏间分隔：极细竖线 + 两端渐隐 */
.col--core::before,
.col--side::before {
  content: "";
  position: absolute;
  top: 6%;
  bottom: 6%;
  left: calc(var(--col-gap-half, 18px) * -1);
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--line-mid) 22%,
    var(--line-mid) 78%,
    transparent
  );
}

/* 大厅底部：滚入展厅的引导 */
.scroll-cue {
  margin-top: auto;
  padding-top: clamp(16px, 2.6vh, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-decoration: none;
}

.scroll-cue__text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.4s var(--ease-out);
}

.scroll-cue__line {
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi));
  position: relative;
  overflow: hidden;
}

.scroll-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent));
  animation: cueSlide 3.4s var(--ease-inout) infinite;
  opacity: 0.7;
}

@keyframes cueSlide {
  0% {
    transform: translateX(-100%);
  }
  55%,
  100% {
    transform: translateX(100%);
  }
}

.scroll-cue:hover .scroll-cue__text {
  color: var(--ink-1);
}

/* ---------------- 页脚 ---------------- */

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px var(--gutter) 34px;
  border-top: var(--hair) solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.site-foot b {
  color: var(--ink-2);
  font-weight: 500;
}

/* ---------------- 任务详情弹层 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 9, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay.is-open {
  display: grid;
  animation: fadeIn 0.28s var(--ease-out);
}

.overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: auto;
  position: relative;
  padding: 30px clamp(22px, 3vw, 38px) 26px;
  background: linear-gradient(
    160deg,
    rgba(14, 22, 34, 0.98),
    rgba(8, 12, 19, 0.99)
  );
  border: var(--hair) solid var(--line-mid);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.4);
  animation: sheetIn 0.36s var(--ease-out);
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 62px;
  height: 1px;
  background: var(--accent);
  opacity: 0.8;
}

.sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
  transition: color 0.3s var(--ease-out);
}
.sheet__close:hover {
  color: var(--ink-0);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1320px) {
  .brand-sub {
    display: none;
  }
}

@media (max-width: 1180px) {
  /* 中窄屏：先摘掉中文小字，避免品牌与导航打架 */
  .nav-link span {
    display: none;
  }
  .nav-link {
    gap: 0;
  }
  .topbar__cta {
    display: none;
  }
  .hall-grid {
    grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr);
  }
  .col--ship {
    display: none;
  }
  .topbar {
    grid-template-columns: auto 1fr auto;
  }
  .topbar__nav {
    justify-content: center;
    gap: clamp(10px, 1.6vw, 20px);
  }
  .topbar__status {
    gap: 10px;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-h: 58px;
  }
  .brand-en {
    display: none;
  }
  .topbar__brand {
    gap: 0;
  }
  .brand-cn {
    font-size: 17px;
  }
  .topbar__status {
    gap: 8px;
  }
  .demo-badge {
    font-size: 9px;
    letter-spacing: 0.12em;
    padding: 2px 6px;
  }
  .clock {
    font-size: 11px;
    letter-spacing: 0.06em;
  }
  body {
    /* 给底部悬浮委托条留出空间，避免压住正文 */
    padding-bottom: 52px;
  }
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .topbar__nav {
    display: none;
  }
  .hall-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
  .col--core::before,
  .col--side::before {
    display: none;
  }
  .col--side {
    border-top: var(--hair) solid var(--line);
    padding-top: 22px;
  }
  .hall {
    justify-content: flex-start;
  }
  .site-foot {
    font-size: 10px;
    letter-spacing: 0.12em;
  }
}

/* ---------------- 补充：待开放导航 / 页脚结构 / 滚动提示 ---------------- */

.nav-link--soon {
  opacity: 0.88;
}
.nav-link--soon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--line-hi) 0 2px,
    transparent 2px 5px
  );
  opacity: 0.5;
}

.nav-link--locked {
  cursor: default;
}

.scroll-cue__text--cn {
  font-family: var(--font-cn);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--ink-3);
}

.site-foot__left,
.site-foot__mid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-foot__sep {
  color: var(--line-hi);
}

.site-foot__note {
  width: 100%;
  margin: 4px 0 0;
  font-family: var(--font-cn);
  font-size: 11.5px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--ink-3);
  max-width: 720px;
}


/* 中栏背后的极淡旋转刻度环（中控台的空间暗示） */
.col--core::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(48vw, 660px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(138, 189, 228, 0.14);
  border-radius: 50%;
  box-shadow:
    inset 0 0 90px rgba(138, 189, 228, 0.05),
    0 0 60px rgba(138, 189, 228, 0.04);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%) rotate(var(--ring-rot, 0deg));
  will-change: transform;
}

.core-panel {
  position: relative;
  z-index: 1;
}

/* ---------- 中栏的旋转刻度环（有方向感的那个） ---------- */

.core-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(48vw, 660px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.core-ring__orbit {
  position: absolute;
  inset: 0;
  transform: rotate(var(--ring-rot, 0deg));
  will-change: transform;
}

/* 一道很窄的扇形扫光，转到哪里哪里亮 */
.core-ring__sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(150, 200, 238, 0) 0deg,
    rgba(150, 200, 238, 0.72) 20deg,
    rgba(150, 200, 238, 0) 48deg
  );
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
}

/* 环上的小光点，绕圈走 */
.core-ring__dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #b7dcfb;
  box-shadow: 0 0 14px rgba(150, 200, 238, 0.9), 0 0 30px rgba(150, 200, 238, 0.45);
}

/* ---------- 空白处的动态破折号 ---------- */

.ticker {
  height: 1px;
  width: 100%;
  margin: clamp(10px, 1.6vh, 18px) 0 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(150, 200, 238, 0.42) 0 16px,
    transparent 16px 40px,
    rgba(150, 200, 238, 0.16) 40px 54px,
    transparent 54px 92px
  );
  background-repeat: repeat-x;
  opacity: 0.65;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  pointer-events: none;
}

.ticker--foot {
  margin: auto 0 clamp(10px, 1.6vh, 18px);
  opacity: 0.45;
}

.to-top {
  position: fixed;
  right: clamp(14px, 2vw, 26px);
  bottom: clamp(18px, 3vh, 30px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 15px 11px 13px;
  border: var(--hair) solid var(--line-mid);
  background: rgba(10, 16, 25, 0.8);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out),
    border-color 0.3s, color 0.3s;
}

.to-top.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  border-color: rgba(232, 88, 42, 0.5);
  color: var(--orange);
}

@media (max-width: 900px) {
  .to-top {
    right: 12px;
    bottom: 62px;
    padding: 10px 12px;
  }
}

.topbar__brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.brand-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-sub {
  display: block;
  font-family: var(--font-cn);
  font-size: 11.5px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .brand-sub {
    display: none;
  }
}

/* ------------------------------------------------------------------ *
 * 主人模式口令门
 * ------------------------------------------------------------------ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 9, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.gate__panel {
  width: min(380px, 100%);
  padding: 28px clamp(20px, 3vw, 32px) 26px;
  border: var(--hair) solid rgba(146, 178, 219, 0.22);
  background: linear-gradient(160deg, rgba(14, 22, 34, 0.98), rgba(8, 12, 19, 0.99));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}

.gate__eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.gate__title {
  margin: 10px 0 0;
  font-family: var(--font-cn);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-0);
}

.gate__sub {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.gate__input {
  width: 100%;
  margin-top: 18px;
  padding: 11px 12px;
  border: var(--hair) solid var(--line-mid);
  background: rgba(6, 10, 16, 0.6);
  color: var(--ink-0);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.28em;
}

.gate__input:focus {
  outline: none;
  border-color: rgba(232, 88, 42, 0.6);
}

.gate__err {
  min-height: 18px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #e86b5a;
}

.gate__btn {
  margin-top: 6px;
  padding: 10px 22px;
  border: var(--hair) solid rgba(232, 88, 42, 0.55);
  background: rgba(232, 88, 42, 0.12);
  color: var(--orange);
  font-family: var(--font-cn);
  font-size: 13px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.gate__btn:hover {
  background: var(--orange);
  color: #0a0f16;
}

.gate.is-shake .gate__panel {
  animation: gateShake 0.32s ease;
}

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
