:root {
  --primary: #1677FF;
  --primary-hover: #4096FF;
  --bg: #0a0e17;
  --bg-secondary: #111827;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --border: rgba(255,255,255,0.08);
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled { background: rgba(10,14,23,0.95); box-shadow: 0 1px 0 var(--border); backdrop-filter: blur(10px); }
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-size: 20px; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 1px; transition: all 0.3s; }
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: rgba(10,14,23,0.98); padding: 16px 24px; gap: 12px; backdrop-filter: blur(10px); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
.hero canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.hero-content { position: relative; z-index: 1; max-width: 700px; padding: 0 24px; }
.hero-title {
  font-size: 52px; font-weight: 800; color: #fff;
  letter-spacing: -1px; margin-bottom: 20px; line-height: 1.2;
}
.hero-subtitle { font-size: 18px; color: var(--text-secondary); margin-bottom: 40px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 12px;
}
.scroll-dot { animation: scrollDot 2s ease-in-out infinite; }
@keyframes scrollDot { 0%,100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(8px); } }

@media (max-width: 768px) {
  .hero-title { font-size: 34px; }
  .hero-subtitle { font-size: 16px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 28px; border-radius: var(--radius);
  font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: all 0.2s; border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(22,119,255,0.4); }
.btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-outline:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-secondary); }
.section-title { font-size: 30px; font-weight: 700; text-align: center; color: #fff; margin-bottom: 12px; }
.section-desc { text-align: center; color: var(--text-secondary); font-size: 15px; margin-bottom: 56px; }

@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-title { font-size: 24px; }
}

/* ---------- Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 768px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 24px; transition: all 0.3s;
}
.card:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-icon { color: var(--primary); margin-bottom: 20px; }
.card h3 { font-size: 17px; font-weight: 600; color: #fff; margin-bottom: 10px; }
.card p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }

/* ---------- Workflow ---------- */
.steps { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.step {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px; text-align: center;
  min-width: 160px; flex: 1; max-width: 200px;
  transition: all 0.3s;
}
.step:hover { background: rgba(255,255,255,0.06); }
.step-num { font-size: 28px; font-weight: 800; color: var(--primary); opacity: 0.3; margin-bottom: 8px; }
.step-icon { color: var(--primary); margin-bottom: 12px; }
.step h4 { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.step p { color: var(--text-secondary); font-size: 13px; }
.step-arrow { color: var(--text-secondary); flex-shrink: 0; opacity: 0.4; }
@media (max-width: 768px) { .step-arrow { display: none; } .steps { gap: 16px; } .step { max-width: 100%; flex: 0 0 100%; } }

/* ---------- Tech ---------- */
.tech-group { margin-bottom: 28px; }
.tech-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tag {
  display: inline-block; padding: 6px 16px;
  background: rgba(22,119,255,0.1); border: 1px solid rgba(22,119,255,0.2);
  border-radius: 20px; font-size: 13px; color: var(--primary); font-weight: 500;
}

/* ---------- Scenarios ---------- */
.scenario-card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px; text-align: center;
  transition: all 0.3s;
}
.scenario-card:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); }
.scenario-card svg { color: var(--primary); margin-bottom: 14px; }
.scenario-card h4 { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.scenario-card p { color: var(--text-secondary); font-size: 13px; }

/* ---------- Changelog ---------- */
.changelog-card {
  max-width: 640px; margin: 0 auto;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.version-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.version-tag {
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 600;
  padding: 3px 12px; border-radius: 4px;
}
.version-date { color: var(--text-secondary); font-size: 13px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.feature-list li {
  position: relative; padding-left: 24px; color: var(--text-secondary); font-size: 14px;
}
.feature-list li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: 0.5;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 48px 0; text-align: center;
}
.footer-brand { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-text { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.footer-copy { color: var(--text-secondary); font-size: 12px; opacity: 0.5; }

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

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 800px; margin: 0 auto; }
@media (max-width: 768px) { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  transition: all 0.3s; text-align: center; position: relative;
}
.pricing-card:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); box-shadow: var(--shadow); }
.pricing-card.featured { border-color: rgba(22,119,255,0.4); background: rgba(22,119,255,0.05); }

.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
  padding: 3px 14px; border-radius: 12px;
}
.pricing-header { margin-bottom: 24px; }
.pricing-header h3 { font-size: 20px; color: #fff; margin-bottom: 8px; }
.pricing-desc { color: var(--text-secondary); font-size: 13px; }
.pricing-price { font-size: 32px; font-weight: 800; color: var(--primary); margin-top: 16px; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.pricing-features li {
  color: var(--text-secondary); font-size: 14px; position: relative; padding-left: 20px; text-align: left;
}
.pricing-features li::before { content: '\2713'; position: absolute; left: 0; color: var(--primary); font-weight: 600; }
.pricing-btn { width: 100%; text-align: center; }

.custom-card {
  max-width: 800px; margin: 0 auto;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.custom-content h3 { font-size: 20px; color: #fff; margin-bottom: 8px; }
.custom-content p { color: var(--text-secondary); font-size: 14px; }
.custom-note { color: var(--primary) !important; font-weight: 500; margin-top: 4px; }
@media (max-width: 768px) { .custom-card { flex-direction: column; text-align: center; } }

.license-notice {
  text-align: center; color: var(--text-secondary); font-size: 13px;
  margin-top: 24px; padding: 10px 16px;
  background: rgba(255,255,255,0.03); border-radius: var(--radius);
  max-width: 800px; margin-left: auto; margin-right: auto;
}

/* ---------- Docs ---------- */
.docs-layout { display: flex; gap: 40px; }
@media (max-width: 768px) { .docs-layout { flex-direction: column; } }

.docs-sidebar { flex-shrink: 0; width: 200px; }
.version-switcher { margin-bottom: 20px; }
.version-switcher-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.version-select {
  width: 100%; padding: 8px 12px; font-size: 14px;
  background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; cursor: pointer;
}
.version-select:focus { border-color: var(--primary); }
.version-select option { background: var(--bg-secondary); color: #fff; }

.docs-nav { list-style: none; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 100px; }
.docs-nav a {
  display: block; padding: 8px 12px; color: var(--text-secondary); text-decoration: none;
  font-size: 14px; border-radius: var(--radius); transition: all 0.15s;
}
.docs-nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.docs-nav a.active { color: var(--primary); background: rgba(22,119,255,0.1); }
.docs-nav-group {
  font-size: 11px; color: rgba(255,255,255,0.3); text-transform: uppercase;
  letter-spacing: 1px; padding: 16px 12px 6px; font-weight: 600;
}
.docs-nav-group:first-child { padding-top: 0; }
.docs-part-title {
  font-size: 18px; color: var(--primary); margin: 0 0 24px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.docs-content { flex: 1; min-width: 0; }
.doc-section { margin-bottom: 48px; }
.doc-section h3 { font-size: 22px; color: #fff; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.doc-section h4 { font-size: 16px; color: #fff; margin: 20px 0 10px; }
.doc-section p { color: var(--text-secondary); margin-bottom: 12px; line-height: 1.7; }
.doc-section ul { color: var(--text-secondary); padding-left: 20px; margin-bottom: 12px; }
.doc-section ul li { margin-bottom: 6px; line-height: 1.6; }
.doc-section strong { color: var(--text); }

.code-block {
  background: rgba(0,0,0,0.4); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 16px; overflow-x: auto;
}
.code-block code { color: #a5d6ff; font-family: "SF Mono", "Fira Code", monospace; font-size: 13px; line-height: 1.7; }

.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.doc-table th, .doc-table td {
  padding: 10px 14px; text-align: left; font-size: 14px;
  border: 1px solid var(--border); color: var(--text-secondary);
}
.doc-table th { color: #fff; background: rgba(255,255,255,0.04); font-weight: 500; }

.faq-item { margin-bottom: 20px; }
.faq-item h4 { color: var(--primary); font-size: 14px; margin-bottom: 6px; }
.faq-item p { color: var(--text-secondary); font-size: 14px; }

.arch-layers { margin-bottom: 16px; }
.arch-layer {
  padding: 12px 16px; margin-bottom: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; color: var(--text-secondary);
  border-left: 3px solid var(--primary);
}
.arch-layer strong { color: #fff; }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200;
  background: rgba(0,0,0,0.7); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; width: 420px; max-width: 90vw;
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-secondary);
  font-size: 24px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: #fff; }
.modal-field { margin-bottom: 16px; }
.modal-field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.modal-field input, .modal-field textarea {
  width: 100%; padding: 10px 12px; font-size: 14px;
  background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; font-family: inherit; resize: vertical;
}
.modal-field input:focus, .modal-field textarea:focus { border-color: var(--primary); }
.modal-toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 300;
  background: var(--primary); color: #fff; padding: 12px 24px; border-radius: var(--radius);
  font-size: 14px; opacity: 0; transition: opacity 0.3s;
}
.modal-toast.show { opacity: 1; }

/* ---------- Carousel ---------- */
.carousel {
  position: relative; max-width: 900px; margin: 0 auto;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}
.carousel-track { display: flex; transition: transform 0.5s ease; }
.carousel-slide {
  flex: 0 0 100%; position: relative;
  background: rgba(0,0,0,0.3);
}
.carousel-slide img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16 / 9; object-fit: contain;
}
.carousel-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 20px; font-size: 14px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  text-align: center;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; z-index: 2;
}
.carousel-btn:hover { background: rgba(0,0,0,0.75); border-color: rgba(255,255,255,0.3); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.4); border: none; cursor: pointer;
  padding: 0; transition: all 0.2s;
}
.carousel-dot.active { background: var(--primary); width: 20px; border-radius: 4px; }

@media (max-width: 768px) {
  .carousel-slide img { aspect-ratio: 4 / 3; }
  .carousel-btn { width: 32px; height: 32px; }
}
