:root {
  --bg-deep: #080a0f;
  --bg-surface: #11141d;
  --bg-card: #161b27;
  --border: #2a3140;
  --border-hover: #3a4558;
  --accent: #25d366;
  --accent-glow: rgba(37, 211, 102, 0.25);
  --text-primary: #f0f2f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --font-base: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.4);
  --transition-fast: 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography & Base */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  line-height: 1.2;
}

h1 { font-size: clamp(2.2rem, 1.8rem + 3vw, 3.8rem); color: var(--text-primary); }
h2 { font-size: clamp(1.8rem, 1.5rem + 2vw, 2.6rem); margin-bottom: 1.5rem; color: var(--text-primary); }
h3 { font-size: clamp(1.2rem, 1rem + 1.2vw, 1.5rem); margin-bottom: 0.75rem; color: var(--text-primary); }
p { font-size: clamp(1rem, 0.92rem + 0.5vw, 1.125rem); color: var(--text-secondary); max-width: 65ch; margin-bottom: 1rem; }
strong { color: var(--text-primary); font-weight: 600; }
small { font-size: 0.875rem; color: var(--text-muted); }

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition-fast); }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

img { max-width: 100%; height: auto; display: block; }

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header p {
  margin: 0 auto;
  max-width: 600px;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 8px 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #080a0f;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37, 211, 102, 0.05);
}

/* Hero */
.hero {
  padding: 120px 0 100px;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero-desc {
  font-size: clamp(1.1rem, 0.95rem + 0.8vw, 1.35rem);
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-bg-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  height: auto;
  opacity: 0.18;
  z-index: 1;
  pointer-events: none;
}

/* Cards & Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
}

.card-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Interface Mockup */
.interface-mockup {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 24px;
  height: 420px;
  overflow: hidden;
  position: relative;
  margin-top: 40px;
}

.mock-sidebar {
  width: 28%;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mock-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border-radius: 50%;
  flex-shrink: 0;
}

.mock-bar {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
}

.mock-bar.short { width: 60%; }
.mock-bar.medium { width: 80%; }

.mock-chat {
  flex: 1;
  background: var(--bg-deep);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
}

.msg-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.msg-in {
  background: var(--bg-card);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.msg-out {
  background: var(--accent);
  color: #080a0f;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* Scenarios & Steps */
.scenario-block {
  margin-bottom: 32px;
  padding: 24px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(37, 211, 102, 0.05) 0%, transparent 100%);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

/* Table */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  margin: 24px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

td {
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

/* Blog Cards */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--accent);
}

.blog-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.blog-card p {
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex-grow: 1;
}

.blog-link {
  align-self: flex-start;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Related */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.related-item {
  display: block;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.related-item:hover {
  border-color: var(--accent);
}

.related-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: block;
}

.related-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

details {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

details:hover {
  border-color: var(--border-hover);
}

summary {
  padding: 18px 24px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform var(--transition-fast);
}

details[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 16px;
}

/* Footer */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* SVG Animation System */
.anim-draw {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes drawStroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.anim-float {
  animation: floatNode 6s ease-in-out infinite;
}

@keyframes floatNode {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

svg[aria-hidden="true"] {
  pointer-events: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim-draw, .anim-float {
    animation: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .interface-mockup { flex-direction: column; height: auto; }
  .mock-sidebar { width: 100%; }
  section { padding: 60px 0; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
