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

:root {
  --bg-primary: #060a14;
  --bg-secondary: #0c1220;
  --bg-card: #111a2e;
  --bg-card-hover: #162040;
  --text-primary: #e8edf5;
  --text-secondary: #94a3b8;
  --text-muted: #546380;
  --accent-blue: #00d4ff;
  --accent-green: #00ff88;
  --accent-pink: #ff6b9d;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --border-color: #1a2744;
  --border-glow: rgba(0, 212, 255, 0.2);
  --glow-blue: rgba(0, 212, 255, 0.12);
  --glow-green: rgba(0, 255, 136, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.08);
}

html { scroll-behavior: smooth; }

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

a { color: var(--accent-blue); text-decoration: none; transition: color 0.25s, transform 0.25s; }
a:hover { color: var(--accent-green); }

img { max-width: 100%; height: auto; }

::selection { background: rgba(0, 212, 255, 0.25); color: #fff; }

/* ===== Grid Background Pattern ===== */
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(6, 10, 20, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  transition: background 0.3s;
}
.navbar.scrolled {
  background: rgba(6, 10, 20, 0.95);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.nav-container {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo { display: flex; align-items: center; transition: opacity 0.2s; }
.nav-logo:hover { opacity: 0.85; }
.logo-img { height: 36px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links > a {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  padding: 4px 0; position: relative; transition: color 0.2s;
}
.nav-links > a:hover, .nav-links > a.active { color: var(--accent-blue); }
.nav-links > a.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--accent-blue); border-radius: 1px;
}

/* Nav Search */
.nav-search { position: relative; }
.nav-search input {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  color: var(--text-primary); padding: 8px 14px 8px 34px; border-radius: 20px;
  font-size: 0.85rem; width: 180px; outline: none;
  transition: border-color 0.3s, width 0.3s, box-shadow 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23546380' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
.nav-search input:focus {
  border-color: var(--accent-blue); width: 240px;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.1);
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); display: none;
  max-height: 380px; overflow-y: auto; box-shadow: var(--shadow);
}
.search-results.active { display: block; }
.search-result-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border-color);
  display: block; color: inherit; transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); color: inherit; }
.search-result-item h4 { font-size: 0.9rem; color: var(--text-primary); }
.search-result-item p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Language Toggle */
.lang-toggle {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  color: var(--text-secondary); padding: 6px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-sans);
  letter-spacing: 0.5px;
}
.lang-toggle:hover {
  border-color: var(--accent-blue); color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.1);
}

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 200px; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 8px 0; display: none;
  box-shadow: var(--shadow), var(--shadow-glow); z-index: 100;
  animation: dropIn 0.2s ease-out;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 8px 16px; font-size: 0.85rem;
  color: var(--text-secondary); white-space: nowrap; transition: all 0.15s;
}
.dropdown-menu a:hover {
  color: var(--accent-blue); background: rgba(0, 212, 255, 0.06);
  padding-left: 20px;
}

/* Mobile Toggle */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--text-secondary);
  border-radius: 2px; transition: all 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 6rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0, 212, 255, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 255, 136, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 20% 70%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
}
.hero-particles {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1;
}
.hero-particle {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: var(--accent-blue); opacity: 0;
  animation: particleFloat 10s infinite ease-in-out;
}
@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  15% { opacity: 0.7; transform: translateY(60vh) scale(1); }
  85% { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-10vh) scale(0.5); }
}
.hero-content { text-align: center; max-width: 860px; position: relative; z-index: 2; }
.hero-logo { display: block; margin-bottom: 1rem; }
.hero-logo img { height: 56px; width: auto; margin: 0 auto; display: block; }
.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 0.75rem;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.4rem); color: var(--text-secondary);
  margin-bottom: 0.75rem; font-weight: 400;
}
.hero-desc {
  font-size: 0.95rem; color: var(--text-muted); max-width: 620px;
  margin: 0 auto 2.5rem; line-height: 1.8;
}
.hero-stats {
  display: flex; justify-content: center; gap: 3rem; margin-bottom: 2.5rem;
}
.stat { text-align: center; }
.stat-num {
  display: block; font-size: 2.2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.82rem; color: var(--text-muted); letter-spacing: 0.5px; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 10px; font-size: 0.95rem;
  font-weight: 600; cursor: pointer; transition: all 0.25s; border: none;
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.btn:hover::before { opacity: 1; }
.btn-primary {
  background: linear-gradient(135deg, #00a0cc, #00c8f0);
  color: #fff; box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.35);
  color: #fff;
}
.btn-outline {
  background: transparent; color: var(--accent-blue);
  border: 1px solid rgba(0, 212, 255, 0.4);
}
.btn-outline:hover {
  background: rgba(0, 212, 255, 0.08); transform: translateY(-2px);
  color: var(--accent-blue);
}

/* ===== Sections ===== */
.section { padding: 5rem 1.5rem; }
.section-dark { background: var(--bg-secondary); }
.container { max-width: 1200px; margin: 0 auto; }
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700;
  text-align: center; margin-bottom: 0.5rem;
}
.section-desc {
  text-align: center; color: var(--text-muted); margin-bottom: 3rem;
  font-size: 1rem; max-width: 600px; margin-left: auto; margin-right: auto;
}
.page-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff, var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-desc { color: var(--text-muted); margin-bottom: 3rem; font-size: 1.05rem; }

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}
.processor-card-link {
  text-decoration: none; color: inherit; display: block;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.processor-card-link:hover {
  transform: translateY(-6px) scale(1.02); color: inherit;
}
.processor-card {
  position: relative; background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.5rem;
  overflow: hidden; transition: all 0.35s;
  height: 100%;
}
.processor-card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.08), inset 0 0 30px rgba(0, 212, 255, 0.02);
}
.card-glow {
  position: absolute; top: -80%; left: -80%; width: 260%; height: 260%;
  background: radial-gradient(circle at center, var(--glow-blue), transparent 60%);
  opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
.processor-card:hover .card-glow { opacity: 1; }
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-icon { font-size: 2rem; }
.card-title { font-size: 1.25rem; font-weight: 700; }
.card-fullname {
  font-size: 0.75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.card-desc {
  font-size: 0.88rem; color: var(--text-secondary);
  margin-bottom: 12px; line-height: 1.6;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 0.72rem; background: rgba(0, 212, 255, 0.08);
  color: var(--accent-blue); border: 1px solid rgba(0, 212, 255, 0.15);
  transition: all 0.2s;
}
.processor-card:hover .tag {
  background: rgba(0, 212, 255, 0.14);
  border-color: rgba(0, 212, 255, 0.3);
}
.card-arrow {
  display: inline-block; font-size: 1.1rem;
  color: var(--accent-blue); transition: transform 0.3s;
  opacity: 0.6;
}
.processor-card:hover .card-arrow { transform: translateX(6px); opacity: 1; }

/* ===== Article List ===== */
.article-list { display: flex; flex-direction: column; gap: 0.75rem; }
.article-item {
  display: block; padding: 1.25rem 1.5rem; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius);
  transition: all 0.25s; color: inherit;
}
.article-item:hover {
  border-color: var(--border-glow); color: inherit;
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.06);
  transform: translateX(6px);
}
.article-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.article-meta time { font-size: 0.78rem; color: var(--text-muted); }
.article-item h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }
.article-item p { font-size: 0.88rem; color: var(--text-secondary); }

/* ===== Knowledge Grid ===== */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.knowledge-card {
  display: block; padding: 2rem; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  text-align: center; transition: all 0.35s; color: inherit;
  position: relative; overflow: hidden;
}
.knowledge-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.knowledge-card:hover::before { opacity: 1; }
.knowledge-card:hover {
  border-color: rgba(0, 255, 136, 0.3); color: inherit;
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 255, 136, 0.06);
}
.knowledge-icon { font-size: 2.8rem; display: block; margin-bottom: 0.75rem; }
.knowledge-card h3 { font-size: 1.2rem; margin-bottom: 0.4rem; font-weight: 700; }
.knowledge-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }
.coming-soon { opacity: 0.45; cursor: default; }
.coming-soon:hover { transform: none !important; border-color: var(--border-color) !important; box-shadow: none !important; }
.coming-soon::before { display: none !important; }

/* ===== Content Pages (MD rendered) ===== */
main { padding-top: 64px; min-height: calc(100vh - 64px); }
main h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800;
  margin-bottom: 1rem; padding-top: 3rem;
  background: linear-gradient(135deg, #fff 20%, var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
main h2 {
  font-size: 1.4rem; font-weight: 700; margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
main h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.6rem; color: var(--text-primary); }
main h4 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
main p { margin-bottom: 1rem; color: var(--text-secondary); line-height: 1.8; }
main ul, main ol { margin-bottom: 1rem; padding-left: 1.5rem; }
main li { margin-bottom: 0.4rem; color: var(--text-secondary); line-height: 1.7; }
main strong { color: var(--text-primary); font-weight: 600; }
main code {
  font-family: var(--font-mono); background: rgba(0, 212, 255, 0.08);
  padding: 2px 7px; border-radius: 5px; font-size: 0.88em;
  color: var(--accent-blue); border: 1px solid rgba(0, 212, 255, 0.1);
}
main pre {
  background: #0a0f1c; border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
  overflow-x: auto; position: relative;
}
main pre code {
  background: none; padding: 0; color: #c8d4e6; border: none; font-size: 0.85em;
  line-height: 1.6;
}
main table {
  width: 100%; border-collapse: collapse; margin-bottom: 1.5rem;
  border: 1px solid var(--border-color); border-radius: var(--radius);
  overflow: hidden; font-size: 0.9rem;
}
main th {
  background: var(--bg-secondary); padding: 10px 14px;
  text-align: left; font-weight: 600; font-size: 0.85rem;
  color: var(--text-primary); border-bottom: 2px solid var(--border-color);
}
main td {
  padding: 9px 14px; border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
main tr:hover td { background: rgba(0, 212, 255, 0.03); }
main blockquote {
  border-left: 3px solid var(--accent-blue);
  padding: 1rem 1.25rem; margin: 1.5rem 0;
  background: rgba(0, 212, 255, 0.04); border-radius: 0 var(--radius) var(--radius) 0;
}
main blockquote p { color: var(--text-secondary); margin-bottom: 0; }

/* Content page wrapper */
main > .container, main > section > .container {
  max-width: 880px; margin: 0 auto; padding: 0 1.5rem 4rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem; text-align: center;
  position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}
.footer-container { max-width: 800px; margin: 0 auto; }
.footer-brand {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.5rem;
}
.footer-logo-img { height: 32px; }
.footer-desc { color: var(--text-muted); margin-bottom: 1.25rem; font-size: 0.9rem; }
.footer-links {
  display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.25rem;
}
.footer-links a { color: var(--text-secondary); font-size: 0.88rem; }
.footer-links a:hover { color: var(--accent-blue); }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); }

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-color);
  color: var(--accent-blue); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(20px);
  transition: all 0.3s; box-shadow: var(--shadow);
}
.back-to-top.visible {
  opacity: 1; transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
  transform: translateY(-2px);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: rgba(6, 10, 20, 0.98); backdrop-filter: blur(20px);
    flex-direction: column; padding: 2rem; gap: 1.25rem;
    align-items: flex-start; overflow-y: auto;
  }
  .nav-links.active { display: flex; }
  .nav-toggle { display: flex; }
  .nav-search input { width: 100%; }
  .nav-search input:focus { width: 100%; }
  .dropdown-menu {
    position: static; transform: none; box-shadow: none;
    background: transparent; border: none; padding-left: 1rem;
    display: block !important;
  }
  .hero-stats { gap: 1.5rem; }
  .stat-num { font-size: 1.6rem; }
  .card-grid { grid-template-columns: 1fr; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .footer-links { flex-direction: column; gap: 0.75rem; }
  .lang-toggle { position: absolute; top: 2rem; right: 2rem; }
}

@media (max-width: 480px) {
  .hero { padding: 5rem 1rem 3rem; }
  .section { padding: 3rem 1rem; }
  .hero-stats { flex-direction: column; gap: 0.75rem; }
  .hero-logo img { height: 40px; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.processor-card-link, .article-item, .knowledge-card {
  animation: fadeInUp 0.5s ease-out both;
}
.processor-card-link:nth-child(1) { animation-delay: 0.05s; }
.processor-card-link:nth-child(2) { animation-delay: 0.1s; }
.processor-card-link:nth-child(3) { animation-delay: 0.15s; }
.processor-card-link:nth-child(4) { animation-delay: 0.2s; }
.processor-card-link:nth-child(5) { animation-delay: 0.25s; }
.processor-card-link:nth-child(6) { animation-delay: 0.3s; }
.processor-card-link:nth-child(7) { animation-delay: 0.35s; }
.processor-card-link:nth-child(8) { animation-delay: 0.4s; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-color); border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #2a3a5c; }

/* Print */
@media print {
  .navbar, .back-to-top, .hero-particles { display: none; }
  body { background: #fff; color: #000; }
  main { padding-top: 0; }
}
