/* ==========================================================================
   TIAN 品牌视觉系统 —— 深空 / 金属 / 静谧
   色彩关键词: Future · Space · Depth · Light · Silence
   ========================================================================== */

:root {
  --bg: #050816;
  --card: #0d1323;
  --card-hover: #121a30;
  --blue: #4a8bff;
  --blue-bright: #6fa6ff;
  --purple: #7b61ff;
  --white: #f5f7fa;
  --dim: #9aa3b8;
  --dimmer: #5b6479;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --danger: #ff5c5c;
  --success: #35d488;

  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: #fff; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------------- 五层宇宙背景 ---------------- */

.cosmic-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

/* 第2/3层: 蓝色 + 紫色辉光,缓慢漂移(20s) */
.cosmic-bg .glow-layer {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(700px 600px at 22% 28%, rgba(74, 139, 255, 0.30), transparent 62%),
    radial-gradient(800px 700px at 82% 75%, rgba(123, 97, 255, 0.24), transparent 60%);
  animation: glowDrift 20s ease-in-out infinite;
  will-change: transform;
}

/* 第4层: 噪点纹理 */
.cosmic-bg .noise-layer {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* 第5层: 暗角 */
.cosmic-bg .vignette-layer {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(2, 3, 10, 0.65) 100%);
}

/* 整体缓慢呼吸(60s) */
.cosmic-bg {
  animation: breathe 60s ease-in-out infinite;
}

/* 边缘玻璃雾化(Vision Pro 风格) */
.glass-fog {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 160px 40px rgba(5, 8, 22, 0.55);
}

@keyframes glowDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2.5%, -2%) scale(1.04); }
}
@keyframes breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

/* ---------------- 导航栏 ---------------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
.nav.scrolled {
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.nav-brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 12px 2px var(--blue);
}
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--dim); }
.nav-links a { transition: color 0.2s ease; }
.nav-links a:hover { color: var(--white); }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: var(--font-body);
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  box-shadow: 0 6px 24px rgba(74, 139, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(74, 139, 255, 0.5); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-color: var(--border-strong);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.28); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-block { width: 100%; }

/* ---------------- 玻璃卡片 / 表单控件(登录页复用) ---------------- */

.glass-card {
  background: rgba(13, 19, 35, 0.6);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 7px; letter-spacing: 0.02em; }
.field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input::placeholder { color: var(--dimmer); }
.field input:focus {
  outline: none;
  border-color: var(--blue);
  background: rgba(74, 139, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(74, 139, 255, 0.14);
}
.field-hint { font-size: 12px; color: var(--dimmer); margin-top: 6px; }
.field-error { font-size: 12.5px; color: var(--danger); margin-top: 8px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.form-switch { text-align: center; font-size: 13.5px; color: var(--dim); margin-top: 18px; }
.form-switch button { background: none; border: none; color: var(--blue-bright); cursor: pointer; font-size: 13.5px; padding: 0; font-family: inherit; }
.form-switch button:hover { text-decoration: underline; }

/* ---------------- 排版 ---------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-bright);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* ---------------- 工具类 ---------------- */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 300; display: flex; flex-direction: column; gap: 9px; }
.toast {
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px; max-width: 320px;
  background: rgba(13, 19, 35, 0.9); backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong); color: var(--white);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.25s var(--ease-spring);
}
.toast.error { border-color: rgba(255, 92, 92, 0.4); }
.toast.success { border-color: rgba(53, 212, 136, 0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
