/* ============================================================
   张三的魔方小站 — Global Stylesheet
   Dark Tech Theme: particles + glassmorphism + neon accents
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-deep: #06060e;
  --bg-primary: #0a0a14;
  --bg-secondary: #0f0f1c;
  --bg-card: rgba(14, 14, 30, 0.72);
  --bg-card-hover: rgba(18, 18, 40, 0.82);
  --text-primary: #e4e8f1;
  --text-secondary: #8892b0;
  --text-muted: #5a6380;
  --accent-cyan: #00e5ff;
  --accent-green: #00ff88;
  --accent-purple: #8b5cf6;
  --accent-pink: #f43f5e;
  --accent-amber: #f59e0b;
  --border-dim: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 229, 255, 0.28);
  --border-glow-green: rgba(0, 255, 136, 0.28);
  --shadow-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.15), 0 0 60px rgba(0, 229, 255, 0.05);
  --shadow-glow-green: 0 0 20px rgba(0, 255, 136, 0.15), 0 0 60px rgba(0, 255, 136, 0.05);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Canvas Particle Background ---------- */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header / Navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 20, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border-dim);
  transition: var(--transition-smooth);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: var(--transition-fast);
}

.site-logo:hover { color: var(--accent-cyan); }

.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
  flex-shrink: 0;
}

.logo-icon svg { width: 20px; height: 20px; }

/* Desktop Nav */
.desktop-nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.06);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Dropdown */
.dropdown { position: relative; }

.dropdown-toggle { cursor: pointer; }

.dropdown-toggle::after {
  content: '▾';
  font-size: 0.7rem;
  margin-left: 2px;
  transition: var(--transition-fast);
}

.dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: rgba(14, 14, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition-fast);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow-cyan);
  z-index: 200;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: var(--transition-fast);
}

.dropdown-menu a:hover {
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.06);
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 300;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text-primary);
  margin: 6px 0;
  transition: var(--transition-smooth);
  border-radius: 2px;
}

.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* Mobile Sidebar */
.mobile-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  background: rgba(8, 8, 20, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-dim);
  padding: 16px 0;
  transform: translateY(-110%);
  transition: var(--transition-smooth);
  z-index: 99;
  display: none;
}

.mobile-sidebar.open { transform: translateY(0); }

.mobile-sidebar a {
  display: block;
  padding: 14px 32px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.mobile-sidebar a:hover,
.mobile-sidebar a.active {
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.04);
}

.mobile-sidebar .sidebar-sub {
  padding-left: 48px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ---------- Page Title ---------- */
.page-title-section {
  text-align: center;
  margin-bottom: 48px;
  padding-top: 20px;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-green) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.glass-card:hover::before { opacity: 1; }
.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

/* ---------- Timeline Card (for a.html) ---------- */
.timeline-item {
  display: flex;
  gap: 20px;
  margin-bottom: 0;
}

.timeline-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
  margin-top: 6px;
  position: relative;
}

.timeline-dot::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 5px;
  width: 2px;
  height: calc(100% + 20px);
  background: linear-gradient(to bottom, var(--accent-cyan), transparent);
  opacity: 0.4;
}

.timeline-content { flex: 1; }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.timeline-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ---------- Table Styles ---------- */
.tech-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dim);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.tech-table thead th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.04);
  border-bottom: 2px solid var(--border-glow);
}

.tech-table tbody td {
  padding: 14px 20px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-dim);
  transition: var(--transition-fast);
}

.tech-table tbody tr:last-child td { border-bottom: none; }

.tech-table tbody tr:hover td {
  background: rgba(0, 229, 255, 0.03);
  color: var(--text-primary);
}

.tech-table .highlight {
  color: var(--accent-green);
  font-weight: 600;
  font-family: var(--font-mono);
}

.tech-table .highlight-best {
  color: var(--accent-amber);
  font-weight: 700;
  font-family: var(--font-mono);
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* ---------- Homepage Hero ---------- */
.hero-card {
  text-align: center;
  padding: 48px 32px;
}

.hero-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-glow);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.2), 0 0 80px rgba(139, 92, 246, 0.1);
  margin-bottom: 28px;
  transition: var(--transition-smooth);
}

.hero-image:hover {
  box-shadow: 0 0 60px rgba(0, 229, 255, 0.35), 0 0 120px rgba(139, 92, 246, 0.2);
  transform: scale(1.03);
}

.hero-greeting {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.hero-welcome {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.retired-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-pink);
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  margin-bottom: 24px;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border-dim);
  color: var(--text-muted);
  font-size: 0.82rem;
  position: relative;
  z-index: 1;
}

.site-footer a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition-fast);
}

.site-footer a:hover { color: var(--accent-green); }

/* ---------- Scroll Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays */
.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.1s; }
.reveal-delay-3 { transition-delay: 0.15s; }
.reveal-delay-4 { transition-delay: 0.2s; }
.reveal-delay-5 { transition-delay: 0.25s; }

/* ---------- Decorative Section Divider ---------- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 32px;
  opacity: 0.5;
}

.section-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.section-divider .icon {
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

/* ---------- Status Pills ---------- */
.status-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-green);
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.status-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

.status-offline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(90, 99, 128, 0.08);
  border: 1px solid rgba(90, 99, 128, 0.2);
}

/* ---------- Keyframes ---------- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes borderGlow {
  0%, 100% { border-color: var(--border-glow); }
  50% { border-color: var(--border-glow-green); }
}

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

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: block; }
  .mobile-sidebar { display: block; }

  .header-inner { height: 56px; padding: 0 16px; }
  .mobile-sidebar { top: 56px; }

  .page-title { font-size: 1.6rem; }
  .hero-welcome { font-size: 1.6rem; }
  .hero-image { width: 150px; height: 150px; }
  .hero-card { padding: 32px 20px; }

  .glass-card { padding: 24px 20px; }

  .tech-table thead { display: none; }
  .tech-table tbody td {
    display: block;
    padding: 10px 16px;
  }
  .tech-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 4px;
  }
  .tech-table tbody tr {
    display: block;
    border-bottom: 1px solid var(--border-dim);
    padding: 4px 0;
  }
  .tech-table tbody tr:last-child { border-bottom: none; }

  .main-content { padding: 24px 16px 60px; }

  .timeline-dot::after { display: none; }
}
