/* ============================================================
   元范式·起航 MetaPara — 宇宙主页样式
   深色星空 + 玻璃拟态面板 + 响应式（横屏右栏 / 竖屏底栏）
   ============================================================ */

:root {
  --bg-deep: #05060f;
  --text-main: #eef1ff;
  --text-dim: rgba(238, 241, 255, 0.62);
  --text-faint: rgba(238, 241, 255, 0.38);
  --glass-bg: rgba(16, 20, 42, 0.55);
  --glass-border: rgba(140, 160, 255, 0.18);
  --accent: #8fb4ff;
  --accent-warm: #ffd489;
  --panel-radius: 16px;
  --font-main: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-main);
}

#universe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#universe.dragging { cursor: grabbing; }
#universe.hovering { cursor: pointer; }

/* ---------------- 顶部标题 ---------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 28px 40px 0;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  transition: opacity 0.4s;
}
.site-header.dim { opacity: 0.25; }

.brand-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: 0.14em;
  background: linear-gradient(120deg, #dfe8ff 20%, #8fb4ff 55%, #d8b4fe 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(140, 170, 255, 0.25);
}

.brand-dot { -webkit-text-fill-color: #ffd489; }

.brand-sub {
  margin-top: 6px;
  font-size: clamp(11px, 1.3vw, 14px);
  letter-spacing: 0.22em;
  color: var(--text-dim);
  font-style: italic;
}

.brand-sub-cn {
  margin-top: 4px;
  font-size: clamp(12px, 1.4vw, 15px);
  letter-spacing: 0.34em;
  color: var(--text-faint);
}

/* ---------------- 星系图鉴 ---------------- */

.atlas {
  position: fixed;
  top: 110px;
  left: 20px;
  z-index: 20;
  max-width: 220px;
}

.atlas-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-main);
  font-size: 14px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.atlas-toggle:hover {
  border-color: rgba(160, 180, 255, 0.45);
  box-shadow: 0 0 24px rgba(120, 150, 255, 0.18);
}
.atlas-toggle-icon { color: var(--accent-warm); }

.atlas-list {
  list-style: none;
  margin-top: 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--panel-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  pointer-events: none;
}
.atlas.open .atlas-list {
  max-height: 60vh;
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
}

/* 隐藏原生滚动条（保留滚动能力） */
.atlas-list,
.focusbar-chips {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.atlas-list::-webkit-scrollbar,
.focusbar-chips::-webkit-scrollbar {
  display: none;
}

.atlas-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid rgba(140, 160, 255, 0.07);
}
.atlas-list li:last-child { border-bottom: none; }
.atlas-list li:hover { background: rgba(120, 150, 255, 0.1); color: var(--text-main); }

.atlas-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 8px currentColor;
}
.atlas-lock { margin-left: auto; opacity: 0.55; }

/* ---------------- 我的基站 ---------------- */

.bases {
  position: fixed;
  z-index: 20;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 250px;
  padding: 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--panel-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.bases-title {
  font-size: 16px;
  letter-spacing: 0.28em;
  color: var(--text-main);
}
.bases-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

/* 收起按钮 */
.bases-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(140, 160, 255, 0.12);
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}
.bases-x:hover { background: rgba(140, 160, 255, 0.3); color: var(--text-main); }

/* 收起后的迷你入口 */
.bases-dock {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  padding: 9px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-dim);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: all 0.25s;
}
.bases-dock.show { display: block; }
.bases-dock:hover { color: var(--text-main); border-color: rgba(160, 190, 255, 0.5); }

.bases-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

.base-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(140, 160, 255, 0.22);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.12), rgba(140, 100, 255, 0.08));
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.base-card:hover {
  transform: translateX(-4px);
  border-color: rgba(160, 190, 255, 0.55);
  box-shadow: 0 0 28px rgba(90, 140, 255, 0.25);
}

.base-card-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(20, 32, 68, 0.9), rgba(8, 12, 30, 0.95) 75%);
  border: 1px solid rgba(140, 170, 255, 0.35);
  box-shadow: 0 0 16px rgba(90, 150, 255, 0.4), inset 0 0 10px rgba(90, 140, 255, 0.15);
}

.base-card-name { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; }
.base-card-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.base-card-go { margin-left: auto; color: var(--accent); font-size: 13px; }

.bases-demo-tag {
  margin-top: 14px;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-align: center;
}

/* ---------------- 聚焦栏 ---------------- */

.focusbar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 64px;
  transform: translate(-50%, 20px);
  width: min(680px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  border: 1px solid var(--glass-border);
  border-radius: var(--panel-radius);
  background: rgba(12, 15, 34, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.focusbar.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.focusbar-info { flex: 1; min-width: 0; }

.focusbar-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.focusbar-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--accent-warm);
  letter-spacing: 0.06em;
}

.focusbar-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 64px;
  overflow-y: auto;
}
.chip {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(140, 160, 255, 0.25);
  background: rgba(120, 150, 255, 0.08);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-main);
  white-space: nowrap;
}

.focusbar-enter {
  flex: none;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #4da3ff, #8a6bff);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-family: var(--font-main);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 6px 24px rgba(90, 130, 255, 0.35);
}
.focusbar-enter:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(90, 130, 255, 0.5); }
.focusbar-enter.locked {
  background: rgba(140, 160, 255, 0.12);
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
}
.focusbar-enter.locked:hover { transform: none; filter: brightness(1.2); }

/* ---------------- 身份按钮 & 注册登录弹层 ---------------- */

.idbtn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  padding: 9px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.08em;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.25s;
}
.idbtn:hover { border-color: rgba(160, 180, 255, 0.5); color: var(--text-main); }
.idbtn.resident {
  color: #cfe2ff;
  border-color: rgba(76, 154, 255, 0.55);
  box-shadow: 0 0 18px rgba(76, 154, 255, 0.25);
}

.authmask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 15, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.authmask.show { opacity: 1; pointer-events: auto; }

.authcard {
  position: relative;
  width: min(400px, calc(100vw - 40px));
  padding: 30px 26px 24px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(26, 30, 62, 0.95), rgba(12, 15, 34, 0.95) 70%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(120, 150, 255, 0.12);
  text-align: center;
}

.auth-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(140, 160, 255, 0.12);
  color: var(--text-dim);
  font-size: 17px;
  cursor: pointer;
}
.auth-x:hover { background: rgba(140, 160, 255, 0.28); color: var(--text-main); }

.auth-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  background: linear-gradient(120deg, #dfe8ff, #8fb4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-sub {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.auth-inp {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(8, 10, 24, 0.6);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.2s;
}
.auth-inp:focus { border-color: rgba(143, 180, 255, 0.6); box-shadow: 0 0 14px rgba(120, 150, 255, 0.18); }

.auth-err { color: #ff8d9a; font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }

.auth-go {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #4da3ff, #8a6bff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(90, 130, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.auth-go:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(90, 130, 255, 0.5); }

.auth-guest {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(140, 160, 255, 0.2);
  color: var(--accent);
  font-size: 12.5px;
  cursor: pointer;
}
.auth-guest:hover { text-decoration: underline; }

/* ---------------- 我的基站 · 空态 ---------------- */

.bases-empty { text-align: center; padding: 10px 0 4px; }
.bases-empty-star {
  font-size: 34px;
  color: var(--text-faint);
  text-shadow: 0 0 18px rgba(140, 160, 255, 0.3);
}
.bases-empty-title { margin-top: 8px; font-size: 14px; color: var(--text-dim); letter-spacing: 0.12em; }
.bases-empty-sub { margin-top: 6px; font-size: 11.5px; line-height: 1.8; color: var(--text-faint); }
.bases-join {
  margin-top: 12px;
  padding: 9px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #4da3ff, #8a6bff);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(90, 130, 255, 0.3);
  transition: transform 0.2s;
}
.bases-join:hover { transform: translateY(-2px); }

/* ---------------- 提示浮层 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -10px);
  z-index: 60;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(12, 15, 34, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--text-main);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: min(560px, 86vw);
  text-align: center;
  line-height: 1.8;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- 操作提示 ---------------- */

.hints {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 22px;
  z-index: 10;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------------- 响应式：竖屏时基站移到底部 ---------------- */

@media (orientation: portrait) {
  .bases {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    transform: none;
    padding: 10px 14px;
    max-height: 20vh;          /* 只占手机屏幕约 1/5 高度 */
    overflow: hidden;
  }
  .bases-title { font-size: 13px; letter-spacing: 0.2em; }
  .bases-hint { display: none; }
  .bases-list { margin-top: 8px; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .bases-list::-webkit-scrollbar { display: none; }
  .base-card { flex: 0 0 auto; padding: 8px 12px; }
  .base-card:hover { transform: translateY(-3px); }
  .base-card-icon { width: 30px; height: 30px; }
  .base-card-sub { display: none; }
  .bases-empty { padding: 2px 0; display: flex; align-items: center; gap: 10px; text-align: left; }
  .bases-empty-star { font-size: 20px; }
  .bases-empty-title { margin-top: 0; font-size: 12.5px; }
  .bases-empty-sub { display: none; }
  .bases-join { margin-top: 0; margin-left: auto; padding: 7px 14px; font-size: 11.5px; }
  .bases-demo-tag { display: none; }
  .hints { display: none; }
  .focusbar { bottom: auto; top: 88px; transform: translate(-50%, -12px); }
  .focusbar.show { transform: translate(-50%, 0); }
  .atlas { top: 150px; left: 12px; }
  .site-header { padding: 18px 16px 0; }
}

@media (max-width: 560px) {
  .focusbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .focusbar-enter { width: 100%; }
}
