/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-code: #0d1117;
  --border: #30363d;
  --border-light: #21262d;
  --accent: #00d4aa;
  --accent-blue: #58a6ff;
  --accent-hover: #00f5c4;
  --accent-purple: #bc8cff;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --error: #f85149;
  --success: #3fb950;
  --warning: #d29922;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --glow-accent: 0 0 24px rgba(0,212,170,0.15);
  --glow-blue: 0 0 24px rgba(88,166,255,0.15);
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; }

/* ===== READING PROGRESS ===== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(0,212,170,0.6);
}

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ===== HEADER ===== */
.site-header {
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(48,54,61,0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.logo-icon {
  background: var(--accent);
  color: var(--bg-primary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(0,212,170,0.2);
  transition: box-shadow var(--transition);
}

.logo span { color: var(--accent); }
.logo:hover { color: var(--text-primary); }
.logo:hover .logo-icon { box-shadow: 0 0 20px rgba(0,212,170,0.5); }

/* ===== SITE NAVIGATION ===== */
.site-nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: -0.01em;
  position: relative;
}

.site-nav a:hover, .site-nav a.active {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.site-nav a.active {
  color: var(--accent);
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.5;
}

/* ===== SEARCH HOTKEY BADGE ===== */
.search-hotkey {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  opacity: 0.7;
}

.search-hotkey kbd {
  font-family: var(--font-main);
  font-size: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
  transform-origin: center;
}

.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); }

/* ===== MOBILE MENU ===== */
.mobile-menu {
  display: none;
  background: rgba(22,27,34,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px 16px;
}

.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  color: var(--text-secondary);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--accent); }

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0,212,170,0.13) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(48,54,61,0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48,54,61,0.2) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask: radial-gradient(ellipse 80% 100% at 50% 0%, black 20%, transparent 80%);
  mask: radial-gradient(ellipse 80% 100% at 50% 0%, black 20%, transparent 80%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 48px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 20px 56px;
  position: relative;
  z-index: 1;
}

.hero-text { text-align: left; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,212,170,0.08);
  border: 1px solid rgba(0,212,170,0.25);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
  animation: badgePulse 4s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero h1 span {
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-blue) 55%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-text .search-wrap {
  max-width: 100%;
  margin: 0;
}

.hero-links {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.hero-links a:hover { color: var(--accent); }
.hero-links a::after { content: '→'; }

/* ===== TERMINAL MOCKUP ===== */
.hero-terminal {
  background: #0d1117;
  border: 1px solid var(--border);
  border-top: 1px solid rgba(0,212,170,0.2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04), 0 0 60px rgba(0,212,170,0.05);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  animation: terminalFloat 7s ease-in-out infinite;
}

.terminal-chrome {
  background: #1c2128;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.t-dots {
  display: flex;
  gap: 6px;
}

.t-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.t-dots span:nth-child(1) { background: #ff5f57; }
.t-dots span:nth-child(2) { background: #febc2e; }
.t-dots span:nth-child(3) { background: #28c840; }

.t-title {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex: 1;
  text-align: center;
  margin-right: 48px;
}

.terminal-body {
  padding: 20px;
  min-height: 180px;
  position: relative;
}

.t-line {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
  margin-bottom: 2px;
}

.t-arrow { color: var(--accent); }
.t-cmd { color: var(--text-primary); }
.t-blink {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  display: inline-block;
  margin-left: 1px;
}

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

.t-output { margin-top: 4px; }

.t-out {
  color: #8b949e;
  font-size: 0.78rem;
  line-height: 1.5;
  padding-left: 0;
}

.t-out.success { color: var(--success); }
.t-out.error { color: var(--error); }
.t-out.info { color: var(--accent-blue); }

/* ===== SEARCH ===== */
.search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  background: rgba(22,27,34,0.8);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 14px 100px 14px 44px;
  border-radius: var(--radius);
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.1);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 3px;
  pointer-events: none;
}

.search-kbd kbd {
  font-family: var(--font-main);
  font-size: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: none;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all var(--transition);
}

.search-clear:hover { color: var(--text-primary); background: var(--bg-card); }
.search-clear.visible { display: block; }
.search-clear.visible ~ .search-kbd { display: none; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: var(--shadow);
  display: none;
}

.search-results.visible { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
  color: inherit;
  text-decoration: none;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.focused { background: var(--bg-card); }
.search-result-item.focused .search-result-cmd { color: var(--accent-hover); }

.search-result-cmd {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.82rem;
  min-width: 130px;
  white-space: nowrap;
}

.search-result-desc { color: var(--text-secondary); font-size: 0.82rem; }

.search-result-tag {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.search-no-results { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* ===== SECTIONS ===== */
.section { padding: 56px 20px; }
.section + .section { border-top: 1px solid var(--border); }

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-light), transparent);
  margin-left: 4px;
}

.section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.icon-green { background: rgba(0,212,170,0.1); color: var(--accent); }
.icon-blue { background: rgba(88,166,255,0.1); color: var(--accent-blue); }
.icon-yellow { background: rgba(210,153,34,0.1); color: var(--warning); }
.icon-red { background: rgba(248,81,73,0.1); color: var(--error); }
.icon-purple { background: rgba(188,140,255,0.1); color: var(--accent-purple); }

/* ===== CMD CARDS ===== */
.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

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

.cmd-card:hover {
  border-color: rgba(0,212,170,0.4);
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,212,170,0.12), var(--glow-accent);
}

.cmd-card:hover::after { opacity: 1; }

.cmd-name {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

.cmd-desc { color: var(--text-secondary); font-size: 0.84rem; line-height: 1.5; }

.cmd-syntax {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.cmd-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  align-self: flex-start;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tag-admin { background: rgba(248,81,73,0.1); color: var(--error); border: 1px solid rgba(248,81,73,0.2); }
.tag-network { background: rgba(88,166,255,0.1); color: var(--accent-blue); border: 1px solid rgba(88,166,255,0.2); }
.tag-system { background: rgba(0,212,170,0.1); color: var(--accent); border: 1px solid rgba(0,212,170,0.2); }
.tag-python { background: rgba(188,140,255,0.1); color: var(--accent-purple); border: 1px solid rgba(188,140,255,0.2); }
.tag-file { background: rgba(210,153,34,0.1); color: var(--warning); border: 1px solid rgba(210,153,34,0.2); }

/* ===== ARTICLE CARDS ===== */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-slow);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(88,166,255,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.article-card:hover {
  border-color: rgba(88,166,255,0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), var(--glow-blue);
  color: inherit;
}

.article-card:hover::before { opacity: 1; }

.article-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.028), transparent);
  transform: skewX(-12deg);
  pointer-events: none;
}

.article-card:hover::after {
  animation: shimmerSlide 0.65s ease forwards;
}

.article-card-icon { font-size: 1.6rem; }

.article-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.article-card p { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.55; }

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.read-more {
  color: var(--accent-blue);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.read-more::after { content: '→'; }

/* ===== POPULAR COMMANDS LIST ===== */
.popular-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.popular-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.popular-item:hover {
  border-color: rgba(0,212,170,0.3);
  background: rgba(0,212,170,0.04);
  transform: translateX(5px);
}

.popular-num {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  min-width: 22px;
  opacity: 0.7;
}

.popular-cmd {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  flex: 1;
}

.popular-desc { color: var(--text-muted); font-size: 0.78rem; }

/* ===== BEGET BANNER ===== */
.beget-section {
  padding: 56px 20px;
  background: linear-gradient(135deg, rgba(0,212,170,0.03) 0%, rgba(88,166,255,0.04) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.beget-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.beget-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  font-weight: 600;
}

.beget-banner-placeholder {
  background: linear-gradient(135deg, var(--bg-card), rgba(88,166,255,0.04));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(88,166,255,0.06);
}

.beget-banner-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.beget-banner-placeholder .beget-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: -0.02em;
}

.beget-banner-placeholder p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 480px;
  line-height: 1.65;
}

.beget-banner-placeholder .btn-beget {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-blue);
  color: #fff;
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  margin-top: 4px;
}

.beget-banner-placeholder .btn-beget:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 16px rgba(0,212,170,0.3);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 56px 20px 32px;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(48,54,61,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48,54,61,0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask: radial-gradient(ellipse 100% 60% at 50% 0%, black 0%, transparent 100%);
  mask: radial-gradient(ellipse 100% 60% at 50% 0%, black 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.75;
  margin-top: 14px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }

.footer-col ul li a {
  color: var(--text-muted);
  font-size: 0.84rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1100px;
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.footer-bottom p { color: var(--text-muted); font-size: 0.78rem; }

/* ===== CODE BLOCKS (macOS style) ===== */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  transition: border-color var(--transition);
}

.code-block:hover { border-color: rgba(48,54,61,0.9); }

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.code-header::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 19px 0 0 #febc2e, 38px 0 0 #28c840;
}

.code-lang {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
}

.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }

.code-block pre {
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.code-block pre .prompt { color: var(--accent); user-select: none; }
.code-block pre .comment { color: var(--text-muted); font-style: italic; }
.code-block pre .flag { color: var(--accent-blue); }
.code-block pre .str { color: var(--warning); }

/* ===== ARTICLE PAGE ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 36px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 20px;
  align-items: start;
}

.article-main { min-width: 0; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.article-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.article-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 36px 0 16px;
  padding-top: 8px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--accent);
}

.article-body p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.8; }

.article-body ul, .article-body ol {
  color: var(--text-secondary);
  padding-left: 24px;
  margin-bottom: 16px;
}

.article-body li { margin-bottom: 8px; line-height: 1.65; }

.article-body code {
  font-family: var(--font-mono);
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.15);
  color: var(--accent-blue);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.875em;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.875rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-body th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-body td {
  color: var(--text-secondary);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.article-body tr:last-child td { border-bottom: none; }
.article-body tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
.article-body td code { font-size: 0.82rem; }

/* ===== TIP & WARN BOXES ===== */
.tip-box {
  background: rgba(0,212,170,0.05);
  border: 1px solid rgba(0,212,170,0.2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px;
  margin: 24px 0;
}

.tip-box strong { color: var(--accent); display: block; margin-bottom: 6px; font-size: 0.85rem; }
.tip-box p { color: var(--text-secondary); font-size: 0.875rem; margin: 0; line-height: 1.65; }

.warn-box {
  background: rgba(210,153,34,0.05);
  border: 1px solid rgba(210,153,34,0.2);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px;
  margin: 24px 0;
}

.warn-box strong { color: var(--warning); display: block; margin-bottom: 6px; font-size: 0.85rem; }
.warn-box p { color: var(--text-secondary); font-size: 0.875rem; margin: 0; line-height: 1.65; }

/* ===== SIDEBAR ===== */
.sidebar { position: sticky; top: 80px; }

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-widget h4 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.sidebar-links { display: flex; flex-direction: column; gap: 4px; }

.sidebar-links a {
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.sidebar-links a:hover { background: rgba(255,255,255,0.05); color: var(--accent); }
.sidebar-links a::before { content: '›'; color: var(--accent); opacity: 0.6; font-size: 0.9rem; }

.toc-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.toc-list a {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border-left: 2px solid transparent;
}

.toc-list a:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.toc-list a.active { color: var(--accent); border-left-color: var(--accent); background: rgba(0,212,170,0.05); }

/* ===== BEGET SIDEBAR ===== */
.beget-sidebar {
  background: linear-gradient(135deg, var(--bg-card), rgba(88,166,255,0.05));
  border: 1px solid rgba(88,166,255,0.2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.beget-sidebar .beget-logo-sm {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.beget-sidebar p { color: var(--text-muted); font-size: 0.8rem; line-height: 1.55; margin-bottom: 14px; }

.btn-sm {
  display: inline-block;
  background: var(--accent-blue);
  color: #fff;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-sm:hover { background: var(--accent); color: var(--bg-primary); box-shadow: 0 4px 12px rgba(0,212,170,0.25); }

/* ===== RELATED ARTICLES ===== */
.related-section { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--border); }

.related-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.related-card:hover { border-color: rgba(88,166,255,0.3); color: inherit; transform: translateY(-1px); }

.related-card h4 { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.related-card p { font-size: 0.78rem; color: var(--text-muted); }

/* ===== STATS ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 36px 0 0;
  margin-bottom: 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.stat-card:hover { border-color: rgba(0,212,170,0.3); }

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.stat-label { color: var(--text-muted); font-size: 0.78rem; letter-spacing: 0.02em; }

/* ===== FADE-IN ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in:nth-child(2) { transition-delay: 0.07s; }
.fade-in:nth-child(3) { transition-delay: 0.14s; }
.fade-in:nth-child(4) { transition-delay: 0.21s; }
.fade-in:nth-child(5) { transition-delay: 0.28s; }
.fade-in:nth-child(6) { transition-delay: 0.35s; }

/* ===== PREMIUM ANIMATIONS & EFFECTS ===== */

@keyframes heroOrb {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.7; }
  100% { transform: translate(-55px, 60px) scale(1.15); opacity: 1; }
}

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

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,170,0); }
  50%       { box-shadow: 0 0 0 5px rgba(0,212,170,0.07); }
}

@keyframes shimmerSlide {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* Hero floating glow orb */
.hero::after {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  top: -260px;
  right: -160px;
  background: radial-gradient(circle, rgba(0,212,170,0.05) 0%, rgba(88,166,255,0.03) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: heroOrb 10s ease-in-out infinite alternate;
  z-index: 0;
}

/* Terminal scanlines overlay */
.terminal-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* Popular item left accent bar */
.popular-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0;
  transform: scaleY(0.3);
  transition: opacity var(--transition), transform var(--transition);
}

.popular-item:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

/* Stat card bottom glow line */
.stat-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.stat-card:hover::before { opacity: 1; }

/* Footer terminal line */
.footer-terminal-line {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  opacity: 0.4;
  margin-top: 12px;
  letter-spacing: 0.01em;
}

.footer-terminal-line .t-prompt { color: var(--accent); }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .hero-terminal { animation: none; }
  .hero::after   { animation: none; }
  .hero-badge    { animation: none; }
  .fade-in {
    transition-duration: 0.15s;
    transition-delay: 0s !important;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-terminal { display: none; }
  .hero-text { text-align: center; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-text .search-wrap { max-width: 600px; margin: 0 auto; }
  .hero-links { justify-content: center; }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .hero-inner { padding: 40px 16px 36px; }
  .section { padding: 40px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .related-grid { grid-template-columns: 1fr; }
  .sidebar { display: block; }
  .article-layout { padding: 28px 16px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .beget-section { padding: 36px 16px; }
  .hero-badge { font-size: 0.72rem; }
}

@media (max-width: 400px) {
  .grid-4 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 1.6rem; }
}
