/* ============================================
   异环攻略站 — 共享样式 (common.css)
   所有页面通用的 CSS：变量、重置、背景、导航、页头、页脚
   ============================================ */

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

:root {
  --bg-deep: #06060e;
  --bg-primary: #0a0a18;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(168, 85, 247, 0.3);
  --text-primary: #e8eaf0;
  --text-secondary: #9599a8;
  --text-muted: #5c6072;
  --accent-purple: #a855f7;
  --accent-purple-light: #c084fc;
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-red: #ef4444;
  --gradient-hero: linear-gradient(135deg, #a855f7 0%, #06b6d4 50%, #ec4899 100%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ----- Animated Background ----- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 30%, transparent 70%);
}

.bg-orb { position: fixed; border-radius: 50%; filter: blur(120px); opacity: 0.12; pointer-events: none; z-index: 0; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.9); }
}

.container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ----- Navbar (shared) ----- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(6, 6, 14, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle); transition: var(--transition);
}
.navbar.scrolled { background: rgba(6, 6, 14, 0.95); border-bottom-color: var(--border-glow); }
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-size: 1.25rem; font-weight: 700; color: var(--text-primary); flex-shrink: 0;
}
.nav-logo-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--gradient-hero); display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; color: #fff; font-weight: 900;
}
.nav-links {
  display: flex; gap: 4px; list-style: none;
  flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  padding: 4px 0;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block; padding: 8px 16px; color: var(--text-secondary);
  text-decoration: none; font-size: 0.9rem; border-radius: var(--radius-sm);
  transition: var(--transition); white-space: nowrap;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-links a.active { color: var(--accent-purple-light); background: var(--bg-card); }

/* Nav CTA (search button, index only) */
.nav-cta {
  padding: 8px 20px; background: var(--gradient-hero); color: #fff;
  border: none; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.9rem; cursor: pointer; transition: var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* Mobile menu button (index only) */
.mobile-menu-btn {
  display: none; background: none; border: none; color: var(--text-primary);
  font-size: 1.5rem; cursor: pointer; padding: 4px; flex-shrink: 0;
}

/* ----- Page Header (sub-pages) ----- */
.page-header { padding: 120px 0 40px; text-align: center; }
.page-tag {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em;
  background: rgba(168, 85, 247, 0.15); color: var(--accent-purple-light); margin-bottom: 16px;
}
.page-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e8eaf0 0%, #9599a8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-subtitle { margin-top: 12px; color: var(--text-secondary); font-size: 1rem; }

/* ----- Back Link (sub-pages) ----- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary);
  text-decoration: none; font-size: 0.9rem; margin-bottom: 16px; transition: var(--transition);
}
.back-link:hover { color: var(--accent-purple-light); }

/* ----- Footer (shared) ----- */
.footer {
  padding: 60px 0 40px; border-top: 1px solid var(--border-subtle);
  position: relative; z-index: 1;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 24px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-text { color: var(--text-muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: var(--transition);
}
.footer-links a:hover { color: var(--text-primary); }
.footer-copy { color: var(--text-muted); font-size: 0.8rem; }

/* ----- Tags (shared across characters & equipment) ----- */
.tag { padding: 4px 12px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.tag-dps { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.tag-sup { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan-light); }
.tag-util { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.tag-tank { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }
.tag-cc { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple-light); }

/* ----- Cards common hover effect ----- */
.card-hover { transition: var(--transition); }
.card-hover:hover { border-color: var(--border-glow); background: var(--bg-card-hover); transform: translateY(-2px); }

/* ----- Responsive: Shared ----- */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 12px; }
  .nav-links a { padding: 8px 12px; font-size: 0.82rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 480px) {
  .nav-links a { padding: 6px 10px; font-size: 0.78rem; }
  .container { padding: 0 16px; }
}
