/* ========================================
   BLINDBABY.TOP - 星空科幻主题全局样式
   ======================================== */

/* 字体通过 common.js 异步加载，避免 @import 阻塞渲染 */

:root {
  --primary: #00d4ff;
  --primary-dark: #0099cc;
  --secondary: #7b2fff;
  --secondary-dark: #5500cc;
  --accent: #ff6b35;
  --accent2: #00ff9d;
  --bg-deep: #02040a;
  --bg-dark: #05091a;
  --bg-mid: #0a0f2e;
  --bg-card: rgba(10, 20, 50, 0.75);
  --bg-card-hover: rgba(15, 30, 70, 0.9);
  --text-primary: #e8f4ff;
  --text-secondary: #8ab4d4;
  --text-dim: #4a6a8a;
  --border-glow: rgba(0, 212, 255, 0.3);
  --border-active: rgba(0, 212, 255, 0.8);
  --sidebar-width: 260px;
  --sidebar-collapsed: 0px;
  --header-height: 60px;
  --glow-primary: 0 0 20px rgba(0, 212, 255, 0.5);
  --glow-secondary: 0 0 20px rgba(123, 47, 255, 0.5);
  --glow-accent: 0 0 20px rgba(255, 107, 53, 0.4);
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ========================================
   星空背景动画
   ======================================== */

#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--min-opacity, 0.2); transform: scale(1); }
  50% { opacity: var(--max-opacity, 1); transform: scale(1.3); }
}

.nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: nebulaPulse 8s ease-in-out infinite alternate;
}

.nebula-1 {
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(0, 100, 255, 0.08) 0%, transparent 70%);
  top: -200px; left: -150px;
}
.nebula-2 {
  width: 500px; height: 500px;
  background: radial-gradient(ellipse, rgba(123, 47, 255, 0.07) 0%, transparent 70%);
  bottom: -150px; right: -100px;
  animation-delay: -4s;
}
.nebula-3 {
  width: 400px; height: 400px;
  background: radial-gradient(ellipse, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
  top: 40%; left: 40%;
  animation-delay: -2s;
}

@keyframes nebulaPulse {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(20px, -20px); }
}

/* 扫光线条 */
.scan-line {
  position: fixed;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.15), transparent);
  pointer-events: none;
  z-index: 1;
  animation: scanDown 8s linear infinite;
}

@keyframes scanDown {
  0% { top: -1px; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { top: 100vh; opacity: 0; }
}

/* ========================================
   顶部导航栏
   ======================================== */

.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(2, 4, 10, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.top-nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: navGlow 3s ease-in-out infinite;
}

@keyframes navGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-glow);
  object-fit: cover;
  filter: brightness(1.2);
}

.nav-title {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.nav-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.nav-menu a:hover, .nav-menu a.active {
  color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: var(--glow-primary);
}

/* ── 导航下拉菜单 ─────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  user-select: none;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.active > .nav-dropdown-toggle {
  color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
}

.nav-arrow {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.nav-dropdown:hover > .nav-dropdown-toggle .nav-arrow,
.nav-dropdown.open > .nav-dropdown-toggle .nav-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 140px;
  background: rgba(5, 10, 25, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

.nav-dropdown:hover > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
}

.nav-icon {
  width: 16px; height: 16px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.3s;
}

.hamburger:hover { background: rgba(0, 212, 255, 0.08); }
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── 导航栏用户按钮 ─────────────────────────── */
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(100, 180, 255, 0.05));
  border: 1px solid rgba(0, 212, 255, 0.15);
  transition: all .3s;
  white-space: nowrap;
}
.nav-user-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-user-btn:hover {
  color: var(--primary);
  border-color: rgba(0, 212, 255, 0.4);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(100, 180, 255, 0.1));
}
.nav-user-label { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }

/* ========================================
   主内容区
   ======================================== */

.main-content {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--header-height) + 24px);
  min-height: 100vh;
}

/* ========================================
   卡片组件
   ======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
}

.card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  box-shadow: var(--glow-primary);
  transform: translateY(-2px);
}

/* ========================================
   按钮系统
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before { left: 100%; }

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 150, 200, 0.3));
  border: 1px solid var(--primary);
  color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 150, 200, 0.4));
  box-shadow: var(--glow-primary);
  color: #fff;
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(123, 47, 255, 0.2), rgba(80, 20, 200, 0.3));
  border: 1px solid var(--secondary);
  color: var(--secondary);
  box-shadow: 0 0 15px rgba(123, 47, 255, 0.2);
}

.btn-secondary:hover {
  box-shadow: var(--glow-secondary);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(200, 60, 20, 0.3));
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-accent:hover {
  box-shadow: var(--glow-accent);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, rgba(0, 255, 157, 0.15), rgba(0, 200, 100, 0.25));
  border: 1px solid var(--accent2);
  color: var(--accent2);
}

.btn-success:hover {
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.4);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-glow);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 212, 255, 0.05);
}

.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ========================================
   分区标题
   ======================================== */

.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-title::before, .section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.section-title::after {
  background: linear-gradient(90deg, transparent, var(--primary));
}

.section-title.left::before { display: none; }
.section-title.left::after { flex: 0.3; }

/* ========================================
   标签 Badge
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 20px;
}

.badge-primary { background: rgba(0, 212, 255, 0.15); color: var(--primary); border: 1px solid rgba(0, 212, 255, 0.3); }
.badge-secondary { background: rgba(123, 47, 255, 0.15); color: #a06dff; border: 1px solid rgba(123, 47, 255, 0.3); }
.badge-accent { background: rgba(255, 107, 53, 0.15); color: var(--accent); border: 1px solid rgba(255, 107, 53, 0.3); }
.badge-success { background: rgba(0, 255, 157, 0.15); color: var(--accent2); border: 1px solid rgba(0, 255, 157, 0.3); }

/* ========================================
   表单元素
   ======================================== */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(5, 10, 30, 0.8);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.form-control option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ========================================
   通知/Toast
   ======================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  animation: toastIn 0.3s ease;
  pointer-events: all;
  max-width: 320px;
}

.toast-success {
  background: rgba(0, 255, 157, 0.15);
  border: 1px solid var(--accent2);
  color: var(--accent2);
}

.toast-error {
  background: rgba(255, 80, 80, 0.15);
  border: 1px solid #ff5050;
  color: #ff5050;
}

.toast-info {
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid var(--primary);
  color: var(--primary);
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========================================
   加载动画
   ======================================== */

.loading {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: loadingBounce 1.2s ease-in-out infinite;
}

.loading span:nth-child(2) { animation-delay: 0.2s; }
.loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ========================================
   分页/进度条
   ======================================== */

.progress-bar {
  height: 4px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* ========================================
   滚动条
   ======================================== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.6); }

/* ========================================
   分割线
   ======================================== */

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
  margin: 24px 0;
}

/* ========================================
   图标包装
   ======================================== */

.icon-box {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  flex-shrink: 0;
}

.icon-box svg { color: var(--primary); }
.icon-box.purple { background: rgba(123, 47, 255, 0.1); border-color: rgba(123, 47, 255, 0.2); }
.icon-box.purple svg { color: #a06dff; }
.icon-box.orange { background: rgba(255, 107, 53, 0.1); border-color: rgba(255, 107, 53, 0.2); }
.icon-box.orange svg { color: var(--accent); }
.icon-box.green { background: rgba(0, 255, 157, 0.1); border-color: rgba(0, 255, 157, 0.2); }
.icon-box.green svg { color: var(--accent2); }

/* ========================================
   文本工具类
   ======================================== */

.text-primary { color: var(--primary); }
.text-secondary-color { color: var(--secondary); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-secondary); }
.text-glow { text-shadow: 0 0 10px currentColor; }
.font-orbitron { font-family: 'Orbitron', monospace; }

/* ========================================
   响应式移动端
   ======================================== */

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    background: rgba(2, 4, 10, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px;
    flex-direction: column;
    border-bottom: 1px solid var(--border-glow);
    z-index: 999;
  }

  .nav-menu.open { display: flex; }
  .hamburger { display: flex; }
  .nav-user-btn { padding: 6px 8px; }
  .nav-user-label { display: none; }
  
  .nav-menu a,
  .nav-dropdown-toggle {
    padding: 12px 16px;
    border-radius: 8px;
    justify-content: flex-start;
  }

  /* 移动端下拉菜单：内联展开 */
  .nav-dropdown-menu {
    position: static;
    transform: none !important;
    opacity: 1;
    visibility: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0 0 0 18px;
    display: none;
    gap: 2px;
  }

  .nav-dropdown.open > .nav-dropdown-menu {
    display: flex;
  }

  .nav-dropdown-menu a {
    padding: 10px 16px;
    font-size: 13px;
  }

  .main-content {
    padding-top: calc(var(--header-height) + 16px);
  }
}

@media (max-width: 480px) {
  .nav-title { font-size: 13px; }
  .nav-subtitle { display: none; }
}

/* ========================================
   动画工具类
   ======================================== */

.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.7); }
}

.animate-spin-slow {
  animation: spinSlow 20s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========================================
   页脚
   ======================================== */

.site-footer {
  position: relative;
  z-index: 2;
  margin-top: 60px;
  padding: 30px 24px;
  border-top: 1px solid var(--border-glow);
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  transition: text-shadow 0.3s;
}

.site-footer a:hover { text-shadow: 0 0 8px var(--primary); }

/* ========================================
   Glassmorphism 面板
   ======================================== */

.glass-panel {
  background: rgba(5, 10, 30, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 16px;
}

/* ========================================
   数字/数据显示
   ======================================== */

.data-display {
  font-family: 'Orbitron', monospace;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* ========================================
   容器
   ======================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-lg {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
