:root {
  --bg: #04060c;
  --bg-2: #070a12;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-2: rgba(255, 255, 255, 0.025);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #dfe5f2;
  --text-dim: rgba(223, 229, 242, 0.55);
  --text-faint: rgba(223, 229, 242, 0.32);
  --accent: #5aa9e6;
  --accent-2: #8a7fd0;
  --cyan: #46d6c8;
  --beacon: #e8b06a;
  --glow: rgba(90, 169, 230, 0.42);
  --ok: #34d399;
  --err: #f87171;
  --warn: #e8b06a;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }

/* ===== Ambient deep-space background ===== */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* 隔离混合组：让 .earth 的 screen 混合只作用于背景层内部 */
  isolation: isolate;
  background:
    radial-gradient(120% 120% at 50% 38%, #0a0f1c 0%, #05070e 55%, #020306 100%);
}
.nebula {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(42% 40% at 22% 28%, rgba(58, 47, 107, 0.30), transparent 60%),
    radial-gradient(40% 38% at 80% 66%, rgba(18, 58, 82, 0.26), transparent 62%);
  filter: blur(46px);
  animation: nebDrift 34s ease-in-out infinite alternate;
}
@keyframes nebDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.06); }
}

/* ----- 真实地球夜景（Earth at Night）-----
   1) background-position: center top → 地平线辉光弧落在视口约 1/3 高，
      Hero 文案落在地球暗面（云层区），上方留出干净的虚空；
   2) screen 混合 → 地球的纯黑变透明、溶进星云与深渊，只有城市灯火与
      大气辉光「浮」出来，成为虚空里文明的余温（而非一张贴图）；
   3) 极慢呼吸缩放 → 像从轨道上缓缓漂近，虚空里没有任何快的东西。 */
.earth {
  position: absolute;
  inset: 0;
  background-image: url("../assets/earth.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  opacity: 0.88;
  /* 关键：饱和度不要压太低 —— 灯火要留住暖金（文明最后的余温），
     只靠 brightness 把它压低；压太狠会把灯火褪成土黄的「沙漠感」。
     但饱和度一高，照片深空的偏蓝底色也会泛出来，故顶部靠 veil 压回纯黑。 */
  filter: brightness(0.8) saturate(0.7) contrast(1.08);
  transform-origin: 50% 30%;
  animation: earthDrift 140s ease-in-out infinite alternate;
}
@keyframes earthDrift {
  0%   { transform: scale(1.004); }
  100% { transform: scale(1.05); }
}

/* 地球之上的压暗幕（独立层、普通混合，才能真正压暗 —— screen 层里的黑色遮罩是无效的）*/
.earth-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 46% at 50% 42%, rgba(3, 5, 10, 0.82) 0%, rgba(3, 5, 10, 0.44) 50%, rgba(3, 5, 10, 0) 76%),
    linear-gradient(180deg, rgba(3, 5, 10, 0.8) 0%, rgba(3, 5, 10, 0.32) 24%, rgba(3, 5, 10, 0) 48%, rgba(3, 5, 10, 0.74) 100%);
  pointer-events: none;
}
.stars { position: absolute; inset: 0; }
.stars span {
  position: absolute;
  border-radius: 50%;
  background: #cdd6f4;
  animation: tw 5s ease-in-out infinite;
}
@keyframes tw { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.95; } }
.planet { position: absolute; top: 9%; right: 7%; width: 72px; height: 72px; }
.planet .body {
  position: absolute; inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 34%, #28304a, #0a0d16 78%);
  box-shadow: inset -6px -6px 14px rgba(0, 0, 0, 0.6);
}
.planet .ring {
  position: absolute; inset: 0;
  border: 1px solid rgba(120, 140, 180, 0.35);
  border-radius: 50%;
  transform: rotate(-18deg) scaleY(0.34);
}
.beacon {
  position: absolute; left: 11%; bottom: 17%;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--beacon);
  box-shadow: 0 0 9px var(--beacon);
}
.beacon::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border: 1px solid var(--beacon);
  border-radius: 50%;
  animation: ping 3.4s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(6); opacity: 0; } }
.comet {
  position: absolute; top: 0; left: 0;
  width: 130px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(205, 214, 244, 0.85));
  opacity: 0;
  transform: translate(-220px, 40px) rotate(18deg);
}
.comet.go { animation: streak 1.7s ease-in forwards; }
@keyframes streak {
  0%   { opacity: 0; transform: translate(-220px, 30px) rotate(18deg); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(120vw, 82vh) rotate(18deg); }
}

/* ===== Glass primitive ===== */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ===== Page switching ===== */
.page { display: none; }
html.guest #home { display: flex; }
html.authed #dashboard { display: flex; }

/* ===== HOME ===== */
.home {
  position: fixed;
  inset: 0;
  z-index: 1;
  flex-direction: column;
  animation: pageIn 0.7s var(--ease);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  color: var(--accent);
  background: rgba(90, 169, 230, 0.12);
  border: 1px solid rgba(90, 169, 230, 0.28);
  box-shadow: 0 0 18px rgba(90, 169, 230, 0.16);
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.12em; }
.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--panel);
}
.topbar-status .sig-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--err);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
  animation: sigFlicker 3s ease-in-out infinite;
}
@keyframes sigFlicker { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.7; } }

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  z-index: 1;
}
.hero-core {
  width: 100%;
  max-width: 520px;
  text-align: center;
  position: relative;
  animation: coreIn 0.9s var(--ease);
}
@keyframes coreIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--text-dim);
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 30px;
  background: var(--panel-2);
}
.hero-title {
  font-size: clamp(60px, 11vw, 120px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: 0.06em;
  background: linear-gradient(120deg, #eef2fb 0%, #9fb6d8 55%, #7fd8cf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 26px;
}
.hero-desc {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  margin-bottom: 44px;
}
.cta-row { margin-bottom: 0; }

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(90, 169, 230, 0.32);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  overflow: hidden;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(90, 169, 230, 0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.sm { padding: 0 22px; height: 44px; font-size: 13px; }
.btn-arrow { transition: transform 0.25s var(--ease); font-size: 16px; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ===== 进入节点：打破按钮印象，化作虚空里一处呼吸的信号源 ===== */
.enter-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: transparent;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-faint);
  -webkit-tap-highlight-color: transparent;
}
.enter-node .node-core {
  position: relative;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--cyan) 0%, rgba(90, 169, 230, 0.22) 66%, transparent 100%);
  box-shadow: 0 0 14px var(--glow);
  animation: nodeBreath 4.6s ease-in-out infinite;
}
.enter-node .node-core::before,
.enter-node .node-core::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  border: 1px solid rgba(120, 200, 220, 0.7);
  border-radius: 50%;
  opacity: 0;
  animation: nodePing 4.6s ease-out infinite;
}
.enter-node .node-core::after { animation-delay: 2.3s; }
@keyframes nodeBreath {
  0%, 100% { transform: scale(0.82); opacity: 0.6; }
  50%      { transform: scale(1.18); opacity: 1; }
}
@keyframes nodePing {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(8); opacity: 0; }
}
.enter-node .btn-label {
  font-size: 13px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--text-faint);
  transition: color 0.5s var(--ease), text-shadow 0.5s var(--ease), letter-spacing 0.5s var(--ease);
}
.enter-node:hover .btn-label,
.enter-node:focus-visible .btn-label {
  color: var(--text);
  text-shadow: 0 0 14px rgba(120, 200, 220, 0.55);
  letter-spacing: 0.48em;
}
.enter-node:hover .node-core { box-shadow: 0 0 26px var(--glow); }
.enter-node:focus-visible { outline: none; }
.enter-node:focus-visible .node-core { box-shadow: 0 0 26px var(--glow); }

.home-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  z-index: 2;
}
.home-foot b { color: var(--text-dim); font-weight: 600; }
.home-foot .sep { opacity: 0.4; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-layer {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 9, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fadeIn 0.3s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

.auth-card {
  position: relative;
  width: 420px;
  max-width: calc(100vw - 32px);
  border-radius: 22px;
  padding: 34px 34px 26px;
  animation: cardIn 0.45s var(--ease);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.auth-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 30px; height: 30px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 22px; line-height: 1;
  border-radius: 8px; cursor: pointer;
  transition: all 0.2s;
}
.auth-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

.auth-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: rgba(90, 169, 230, 0.12);
  border: 1px solid rgba(90, 169, 230, 0.28);
  box-shadow: 0 0 18px rgba(90, 169, 230, 0.16);
  flex-shrink: 0;
}
.auth-heading h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.auth-heading p { font-size: 13px; color: var(--text-dim); margin-top: 3px; }

.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.input-row {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(90, 169, 230, 0.16);
}
#passInput {
  flex: 1;
  background: transparent; border: none; outline: none;
  color: var(--text);
  padding: 0 16px; height: 50px;
  font-size: 15px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
}
.field-indicator {
  padding-right: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}
.field-indicator.ok { color: var(--ok); }
.field-indicator.err { color: var(--err); }
.field-progress {
  margin-top: 10px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.field-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.35s var(--ease);
}

.actions { display: flex; justify-content: flex-end; gap: 12px; }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  height: 44px; padding: 0 22px;
  border-radius: 12px;
  font-size: 13px; cursor: pointer;
  font-family: var(--font);
  transition: all 0.25s var(--ease);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.auth-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
}
.af-row { display: flex; flex-direction: column; gap: 4px; }
.af-row span { color: var(--text-faint); letter-spacing: 0.16em; font-size: 9px; text-transform: uppercase; }
.af-row b { color: var(--text); font-weight: 600; font-size: 12px; }
.af-row b.warn { color: var(--warn); }

/* ===== DASHBOARD ===== */
.dashboard {
  position: fixed;
  inset: 0;
  z-index: 1;
  gap: 18px;
  padding: 18px;
  flex-direction: row;
  animation: pageIn 0.5s var(--ease);
}
.nav-pane {
  width: 244px;
  flex-shrink: 0;
  border-radius: var(--radius);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.nav-pane .brand { padding: 0 8px 22px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.nav-pane .brand-name { display: flex; flex-direction: column; }
.nav-pane .brand-name strong { font-size: 15px; font-weight: 700; letter-spacing: 0.1em; }
.nav-pane .brand-name em { font-style: normal; font-size: 10px; color: var(--text-dim); letter-spacing: 0.2em; }

.nav-list { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 13px;
  transition: all 0.2s var(--ease);
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active {
  background: rgba(90, 169, 230, 0.14);
  color: var(--text);
  border: 1px solid rgba(90, 169, 230, 0.3);
}
.nav-item.active .ni-idx { color: var(--accent); }
.ni-idx { font-family: var(--mono); font-size: 10px; color: var(--text-faint); min-width: 18px; }

.nav-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.nf-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  padding: 9px 12px;
  background: rgba(52, 211, 153, 0.1);
  color: var(--text);
  border-radius: 9px;
  border: 1px solid rgba(52, 211, 153, 0.24);
}
.nf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.nf-logout {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  padding: 10px;
  border-radius: 9px;
  font-size: 12px; cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}
.nf-logout:hover { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.32); color: #f87171; }

.dash-body { flex: 1; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
}
.crumb-row { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }
.crumb { color: var(--text-dim); }
.crumb.active { color: var(--text); }
.crumb-sep { color: var(--text-faint); }
.dt-clock { font-family: var(--mono); font-size: 13px; color: var(--text-dim); letter-spacing: 0.05em; }

.dash-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(0, auto);
  gap: 18px;
  align-content: start;
  padding-right: 4px;
}
.dash-grid::-webkit-scrollbar { width: 6px; }
.dash-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 6px; }

.card {
  position: relative;
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.09); }
.card.span-2 { grid-column: span 2; }

.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.005em; }
.card-sub { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.18em; }

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 13px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s var(--ease);
  font-family: var(--font);
}
.tile:hover {
  background: rgba(90, 169, 230, 0.1);
  border-color: rgba(90, 169, 230, 0.32);
  transform: translateY(-2px);
}
.tile-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--accent);
  background: rgba(90, 169, 230, 0.12);
  border: 1px solid rgba(90, 169, 230, 0.22);
  flex-shrink: 0;
}
.tile-body { flex: 1; min-width: 0; }
.tile-body strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.tile-body span { font-size: 11px; color: var(--text-dim); }
.tile-arrow { font-size: 14px; color: var(--text-faint); transition: transform 0.25s var(--ease), color 0.25s var(--ease); }
.tile:hover .tile-arrow { color: var(--accent); transform: translateX(3px); }

a.env-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
a.env-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.env-staging { background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(255, 255, 255, 0.02) 60%); }
.env-staging::before { background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 60%); }
.env-staging:hover { border-color: rgba(251, 191, 36, 0.5); }
.env-staging:hover::before { opacity: 1; }
.env-prod { background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(255, 255, 255, 0.02) 60%); }
.env-prod::before { background: radial-gradient(circle at top right, rgba(52, 211, 153, 0.18), transparent 60%); }
.env-prod:hover { border-color: rgba(52, 211, 153, 0.5); }
.env-prod:hover::before { opacity: 1; }
.env-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  padding: 3px 10px;
  border-radius: 5px;
  align-self: flex-start;
}
.env-staging .env-tag { background: rgba(251, 191, 36, 0.15); color: var(--warn); border: 1px solid rgba(251, 191, 36, 0.3); }
.env-prod .env-tag { background: rgba(52, 211, 153, 0.15); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.3); }
.env-icon { font-size: 26px; }
.env-info h3 { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.env-info p { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.env-url { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.env-arrow { position: absolute; top: 20px; right: 20px; font-size: 22px; color: var(--text-dim); transition: transform 0.25s var(--ease), color 0.25s var(--ease); }
a.env-card:hover .env-arrow { transform: translate(2px, -2px); color: var(--text); }

/* ===== Warp transition (跃迁进入) ===== */
.warp {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  pointer-events: none;
  overflow: hidden;
}
.warp.active { display: block; }
.warp-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--wx, 50%) var(--wy, 50%),
    rgba(255, 255, 255, 0.95), rgba(150, 180, 255, 0.5) 22%, rgba(90, 169, 230, 0.15) 45%, transparent 70%);
  opacity: 0;
  transform: scale(0.2);
}
.warp.active .warp-flash { animation: warpFlash 0.78s var(--ease) forwards; }
@keyframes warpFlash {
  0%   { opacity: 0;   transform: scale(0.2); }
  35%  { opacity: 1; }
  100% { opacity: 0;   transform: scale(2.6); }
}
.warp-rings { position: absolute; top: var(--wy, 50%); left: var(--wx, 50%); width: 0; height: 0; }
.warp-rings span {
  position: absolute; top: 0; left: 0;
  width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  opacity: 0;
}
.warp.active .warp-rings span { animation: warpRing 0.72s var(--ease) forwards; }
.warp.active .warp-rings span:nth-child(2) { animation-delay: 0.06s; border-color: var(--accent); }
.warp.active .warp-rings span:nth-child(3) { animation-delay: 0.12s; border-color: var(--accent-2); }
@keyframes warpRing {
  0%   { opacity: 0.9; transform: scale(0.2); }
  100% { opacity: 0;   transform: scale(28); }
}
.warp-streaks {
  position: absolute; inset: 0;
  opacity: 0;
  background: repeating-conic-gradient(from 0deg at var(--wx, 50%) var(--wy, 50%),
    rgba(190, 210, 255, 0) 0deg, rgba(190, 210, 255, 0.6) 0.35deg, rgba(190, 210, 255, 0) 1.1deg);
  -webkit-mask: radial-gradient(circle at var(--wx, 50%) var(--wy, 50%), #000 0%, transparent 62%);
          mask: radial-gradient(circle at var(--wx, 50%) var(--wy, 50%), #000 0%, transparent 62%);
  transform: scale(0.4);
}
.warp.active .warp-streaks { animation: warpStreaks 0.72s var(--ease) forwards; }
@keyframes warpStreaks {
  0%   { opacity: 0;   transform: scale(0.4) rotate(0deg); }
  30%  { opacity: 0.9; }
  100% { opacity: 0;   transform: scale(1.9) rotate(10deg); }
}

/* ===== RESPONSIVE ===== */
/* 窄屏：地球被横向裁切更多、叠加后亮度更明显，故再压暗一档 */
@media (max-width: 720px) {
  .earth { opacity: 0.75; filter: brightness(0.76) saturate(0.72) contrast(1.08); }
  .earth-veil {
    background:
      radial-gradient(80% 34% at 50% 46%, rgba(3, 5, 10, 0.9) 0%, rgba(3, 5, 10, 0.5) 55%, rgba(3, 5, 10, 0) 82%),
      linear-gradient(180deg, rgba(3, 5, 10, 0.66) 0%, rgba(3, 5, 10, 0.16) 26%, rgba(3, 5, 10, 0) 44%, rgba(3, 5, 10, 0.78) 100%);
  }
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .card.span-2 { grid-column: span 1; }
}
@media (max-width: 720px) {
  .topbar { padding: 18px 20px; }
  .dashboard { flex-direction: column; padding: 14px; gap: 14px; }
  .nav-pane { width: 100%; flex-direction: row; align-items: center; padding: 14px 16px; }
  .nav-pane .brand { border: none; padding: 0; margin: 0 14px 0 0; }
  .nav-list { flex-direction: row; flex: 1; gap: 4px; overflow-x: auto; }
  .nav-item { padding: 9px 11px; }
  .ni-label { display: none; }
  .nav-foot { flex-direction: row; border: none; padding: 0; }
  .nf-chip { display: none; }
  .tile-grid { grid-template-columns: 1fr; }
  .home-foot { font-size: 9px; letter-spacing: 0.14em; }
}
