/* ============================================================
   Shared Global Navigation & Theme System — rzpt.tech
   Mobile-first, all subdomain sites reference this single file.
   ============================================================ */

/* --- Theme Variables --- */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --nav-bg: rgba(255,255,255,0.85);
  --nav-border: rgba(0,0,0,0.06);
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-soft: rgba(37,99,235,0.08);
  --footer-text: rgba(0,0,0,0.3);
  --footer-border: rgba(0,0,0,0.06);
  --dot-glow: rgba(37,99,235,0.5);
  --beian-color: rgba(0,0,0,0.35);
  --divider-color: rgba(0,0,0,0.08);
  --input-bg: #ffffff;
  --input-border: #d1d5db;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #090d17;
    --bg-secondary: #0f131e;
    --bg-tertiary: #131927;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --card-bg: rgba(15,19,30,0.7);
    --card-shadow: 0 0 0 transparent;
    --nav-bg: rgba(9,13,23,0.95);
    --nav-border: rgba(255,255,255,0.06);
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-soft: rgba(59,130,246,0.12);
    --footer-text: rgba(255,255,255,0.12);
    --footer-border: rgba(255,255,255,0.03);
    --dot-glow: rgba(59,130,246,0.4);
    --beian-color: rgba(255,255,255,0.3);
    --divider-color: rgba(255,255,255,0.08);
    --input-bg: rgba(15,19,30,0.8);
    --input-border: rgba(255,255,255,0.1);
  }
}

html[data-theme="dark"] {
  --bg-primary: #090d17;
  --bg-secondary: #0f131e;
  --bg-tertiary: #131927;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --card-bg: rgba(15,19,30,0.7);
  --card-shadow: 0 0 0 transparent;
  --nav-bg: rgba(9,13,23,0.95);
  --nav-border: rgba(255,255,255,0.06);
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-soft: rgba(59,130,246,0.12);
  --footer-text: rgba(255,255,255,0.12);
  --footer-border: rgba(255,255,255,0.03);
  --dot-glow: rgba(59,130,246,0.4);
  --beian-color: rgba(255,255,255,0.3);
  --divider-color: rgba(255,255,255,0.08);
  --input-bg: rgba(15,19,30,0.8);
  --input-border: rgba(255,255,255,0.1);
}

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

html { background: var(--bg-primary); }

body {
  font-family: "PingFang SC","Microsoft YaHei",-apple-system,sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-top: 44px;
  transition: background 0.4s, color 0.4s;
}

/* --- Global Nav --- */
.global-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10000;
  height: 44px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  transition: background 0.4s, border-color 0.4s;
}

.global-nav .gn-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: color 0.3s;
  flex-shrink: 0;
}

.global-nav .gn-brand:hover { color: var(--text-primary); }

.global-nav .gn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--dot-glow);
}

.global-nav .gn-right { display: flex; align-items: center; gap: 2px; }

.global-nav .gn-links { display: flex; align-items: center; gap: 2px; }

.global-nav .gn-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 13px;
  border-radius: 7px;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.global-nav .gn-links a:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.global-nav .gn-links a.gn-active {
  color: var(--accent-light);
  background: var(--accent-soft);
  font-weight: 500;
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  margin-left: 8px;
  transition: all 0.3s;
  color: var(--text-muted);
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  background: var(--accent-soft);
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 20px 24px;
  font-size: 12px;
  color: var(--footer-text);
  letter-spacing: 0.5px;
  border-top: 1px solid var(--footer-border);
  position: relative;
  z-index: 1;
  transition: all 0.4s;
}

.footer-content {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; margin-bottom: 6px; flex-wrap: wrap;
}

.footer-link {
  color: var(--beian-color);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
  font-size: 12px;
}

.footer-link:hover { color: var(--accent-light); }

.footer-divider { color: var(--divider-color); }

.beian-icon { width: 14px; height: 14px; margin-right: 2px; vertical-align: middle; }

.footer-copy { margin: 0; color: var(--footer-text); }

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

/* --- Mobile: Tablet (≤768px) --- */
@media (max-width: 768px) {
  .global-nav { padding: 0 16px; }
  .global-nav .gn-links a { padding: 4px 10px; font-size: 11.5px; }
  .theme-toggle { font-size: 15px; padding: 3px 7px; }
}

/* --- Mobile: Phone (≤480px) --- */
@media (max-width: 480px) {
  body { padding-top: 40px; }
  .global-nav {
    height: 40px;
    padding: 0 10px;
  }
  .global-nav .gn-brand { gap: 5px; font-size: 11px; letter-spacing: 0.2px; }
  .global-nav .gn-dot { width: 6px; height: 6px; }
  .global-nav .gn-links a { padding: 3px 7px; font-size: 10.5px; border-radius: 6px; letter-spacing: 0; }
  .theme-toggle { font-size: 14px; padding: 2px 6px; margin-left: 4px; border-radius: 6px; }

  .site-footer { padding: 14px 12px; font-size: 10px; }
  .footer-content { gap: 4px; }
  .footer-link { font-size: 10px; }
  .beian-icon { width: 12px; height: 12px; }
}

/* --- Tiny screens (≤380px): collapse nav further --- */
@media (max-width: 380px) {
  .global-nav .gn-brand { font-size: 10px; gap: 4px; }
  .global-nav .gn-dot { width: 5px; height: 5px; }
  .global-nav .gn-links a { padding: 2px 5px; font-size: 10px; border-radius: 5px; }
  .global-nav .gn-links a:last-of-type { display: none; }
  .theme-toggle { font-size: 13px; padding: 2px 4px; margin-left: 2px; }
}