/* ============================================
   Lingma IDE 入门指南 — Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+SC:wght@300;400;500;600;700;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand palette — inspired by Lingma's blue-purple tech aesthetic */
  --color-bg-deep: #0a0e1a;
  --color-bg-main: #0f1526;
  --color-bg-card: rgba(18, 26, 50, 0.7);
  --color-bg-card-solid: #121a32;
  --color-bg-hover: rgba(30, 42, 80, 0.6);
  --color-surface: rgba(25, 35, 65, 0.5);

  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-primary-dark: #4f46e5;
  --color-accent: #06b6d4;
  --color-accent-2: #8b5cf6;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #06b6d4 50%, #8b5cf6 100%);
  --gradient-hero: linear-gradient(160deg, #0a0e1a 0%, #1a1040 35%, #0f1526 70%, #0a1628 100%);
  --gradient-card: linear-gradient(145deg, rgba(99,102,241,0.08) 0%, rgba(6,182,212,0.05) 100%);
  --gradient-text: linear-gradient(90deg, #818cf8, #06b6d4);

  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  --color-text-bright: #f8fafc;

  --color-border: rgba(99, 102, 241, 0.15);
  --color-border-active: rgba(99, 102, 241, 0.4);

  --font-body: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px var(--color-border);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.15);
  --shadow-btn: 0 4px 15px rgba(99,102,241,0.4);

  --max-width: 1100px;
  --section-gap: 100px;
}

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

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

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

/* Animated background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(99,102,241,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(6,182,212,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-bright);
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5em;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5em;
  max-width: 700px;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 2rem;
  transition: box-shadow 0.3s;
}
.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text-bright);
}
.nav-brand svg {
  width: 28px;
  height: 28px;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 6px;
}
.nav-links a {
  display: block;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text-bright);
  background: var(--color-bg-hover);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--gradient-hero);
  padding: 8rem 2rem 4rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 60%);
  pointer-events: none;
}

/* Floating code particles */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(99, 102, 241, 0.15);
  animation: float 20s linear infinite;
}
@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-primary-light);
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.8s ease-out;
}
.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  margin-bottom: 0.5em;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}
.hero h1 .gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .tagline {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99,102,241,0.5);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border-active);
}
.btn-outline:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary-light);
  color: var(--color-text-bright);
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-gap) 2rem;
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-alt {
  background: var(--color-bg-main);
}

/* ---------- Feature Cards Grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--color-border-active);
}
.feature-card:hover::before {
  opacity: 1;
}
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(99,102,241,0.1);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}
.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ---------- Steps / Guide Layout ---------- */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.step-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.step-number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.step-content {
  flex: 1;
  padding-top: 6px;
}
.step-content h4 {
  font-size: 1.1rem;
  margin-bottom: 0.4em;
}
.step-content p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------- Code Blocks ---------- */
.code-block {
  background: #0d1117;
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  overflow-x: auto;
  position: relative;
}
.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.7rem;
  color: var(--color-text-dim);
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: #e6edf3;
  white-space: pre-wrap;
  word-break: break-word;
}
.code-block .kw { color: #ff7b72; }
.code-block .fn { color: #d2a8ff; }
.code-block .str { color: #a5d6ff; }
.code-block .cm { color: #8b949e; }
.code-block .num { color: #79c0ff; }
.code-block .op { color: #c9d1d9; }

/* ---------- Info Box ---------- */
.info-box {
  display: flex;
  gap: 14px;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 3px solid;
}
.info-box.tip {
  background: rgba(16,185,129,0.08);
  border-color: var(--color-success);
}
.info-box.note {
  background: rgba(99,102,241,0.08);
  border-color: var(--color-primary);
}
.info-box.warning {
  background: rgba(245,158,11,0.08);
  border-color: var(--color-warning);
}
.info-box-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1.5;
}
.info-box p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ---------- Keyboard Shortcuts Table ---------- */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.shortcuts-table th,
.shortcuts-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.shortcuts-table th {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.shortcuts-table tr:hover td {
  background: var(--color-bg-hover);
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-bright);
  white-space: nowrap;
}

/* ---------- System Requirements ---------- */
.sys-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 1.5rem 0;
}
.sys-req-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}
.sys-req-card .os-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.sys-req-card h4 {
  font-size: 1rem;
  margin-bottom: 0.3em;
}
.sys-req-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------- Illustration / Image Panels ---------- */
.illustration-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  overflow: hidden;
}
.illustration-panel img {
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.illustration-panel figcaption {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-top: 1rem;
}

/* ---------- SVG Diagram ---------- */
.ide-diagram {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  display: block;
}

/* ---------- Two Column Layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.two-col.reverse {
  direction: rtl;
}
.two-col.reverse > * {
  direction: ltr;
}

/* ---------- AI Feature Showcase ---------- */
.ai-showcase {
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}
.ai-showcase::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(99,102,241,0.15);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary-light);
  margin-bottom: 1rem;
}

/* ---------- Resource Links ---------- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 0.3s;
  text-decoration: none;
  color: var(--color-text);
}
.resource-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-active);
  box-shadow: var(--shadow-glow);
  color: var(--color-text-bright);
}
.resource-card .res-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(99,102,241,0.1);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.resource-card .res-text h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2em;
}
.resource-card .res-text p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

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

/* ---------- Scroll Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .two-col.reverse {
    direction: ltr;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
  :root {
    --section-gap: 60px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 6rem 1.5rem 3rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .sys-req-grid {
    grid-template-columns: 1fr;
  }
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .ai-showcase {
    padding: 1.5rem;
  }
}
