/* ==========================================
   OpenSpec 文档样式 — AI 科技风格
   ========================================== */

:root {
  --bg-primary: #050814;
  --bg-secondary: #0a0f1e;
  --bg-card: #0d1526;
  --bg-card-hover: #111d35;
  --border: rgba(99, 102, 241, 0.15);
  --border-hover: rgba(99, 102, 241, 0.4);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --code-bg: #0d1526;
  --code-border: rgba(99, 102, 241, 0.2);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-width: 260px;
  --topnav-height: 60px;
}

/* ==========================================
   重置和基础
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topnav-height) + 20px);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================
   粒子背景
   ========================================== */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ==========================================
   顶部导航
   ========================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-height);
  background: rgba(5, 8, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 1000;
  gap: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-logo {
  width: 28px;
  height: 28px;
}

.nav-title {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.nav-version {
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px;
  border-radius: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  overflow: hidden;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav-link-github {
  margin-left: auto;
  border: 1px solid var(--border);
}

/* 动态加载区域 */
.dynamic-section { min-height: 2rem; }
.section-loading {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 4rem 0;
}
.loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: loadingPulse 1.2s infinite ease-in-out;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes loadingPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.nav-link-upstream {
  margin-left: 0;
  opacity: 0.65;
  font-size: 0.8rem;
}

.nav-link-upstream:hover {
  opacity: 1;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ==========================================
   侧边栏
   ========================================== */
.sidebar {
  position: fixed;
  top: var(--topnav-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topnav-height));
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 2px;
}

.sidebar-content {
  padding: 1.25rem 0.75rem;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}

.sidebar-link {
  display: block;
  padding: 0.35rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}

.sidebar-link.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
}

.sidebar-link code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  background: none;
  padding: 0;
  color: inherit;
}

.sidebar-link-sub {
  padding-left: 1.2rem;
  font-size: 0.78rem;
  opacity: 0.85;
  position: relative;
}

.sidebar-link-sub::before {
  content: '└';
  position: absolute;
  left: 0.4rem;
  color: var(--border);
  font-size: 0.72rem;
  line-height: 1.8;
}

/* ==========================================
   主内容区
   ========================================== */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topnav-height);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ==========================================
   Hero 区域
   ========================================== */
.hero-section {
  padding: 5rem 4rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-logo {
  width: min(400px, 80%);
  margin: 0 auto 1.5rem;
  display: block;
  filter: drop-shadow(0 0 40px rgba(99, 102, 241, 0.3));
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

.hero-philosophy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.philosophy-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

.phi-arrow {
  color: var(--accent);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: #5254cc;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ==========================================
   内容区块
   ========================================== */
.content-section {
  padding: 4rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.05);
  max-width: 1100px;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.subsection {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(99, 102, 241, 0.05);
}

.subsection:first-child {
  border-top: none;
  padding-top: 0;
}

.subsection h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* ==========================================
   终端演示
   ========================================== */
.demo-terminal {
  background: #080d1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.terminal-header {
  background: #0d1526;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

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

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.terminal-body {
  padding: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
}

.term-line {
  display: block;
}

.term-prompt {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.5rem;
}

.term-cmd {
  color: #e2e8f0;
}

.term-output {
  color: var(--text-secondary);
  padding-left: 0;
}

.term-success {
  color: var(--success);
}

.term-blank {
  height: 0.5rem;
}

/* Dashboard 预览 */
.dashboard-preview {
  margin-top: 2rem;
  text-align: center;
}

.preview-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dashboard-img {
  width: 100%;
  max-width: 900px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   卡片网格
   ========================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.1);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 比较区块 */
.compare-section {
  margin-top: 2.5rem;
}

.compare-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.compare-vs {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.compare-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================
   安装选项卡
   ========================================== */
.install-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.tab-btn.active {
  background: var(--code-bg);
  border-bottom-color: var(--code-bg);
  color: var(--accent);
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ==========================================
   代码块
   ========================================== */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--code-border);
  background: rgba(13, 21, 38, 0.5);
}

.code-header span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.copy-btn {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.5);
}

.code-block pre {
  padding: 1.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #a5b4fc;
  white-space: pre;
  display: block;
}

/* ==========================================
   信息框
   ========================================== */
.info-box {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  margin: 1rem 0;
}

.info-box.info-tip {
  background: rgba(6, 182, 212, 0.05);
  border-color: rgba(6, 182, 212, 0.2);
}

.info-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.info-box p, .info-box div {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-box strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.info-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent-3);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.tip-box {
  padding: 0.85rem 1rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 1rem 0;
}

.tip-box strong {
  color: var(--success);
}

.tip-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent-3);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================
   步骤指南
   ========================================== */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.steps-container::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 38px;
  bottom: 38px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  z-index: 0;
}

.step {
  display: flex;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
  padding-bottom: 1.5rem;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.step-content {
  flex: 1;
  padding-top: 0.5rem;
}

.step-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* ==========================================
   核心概念样式
   ========================================== */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.phi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.phi-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.phi-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.phi-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.phi-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 架构图 */
.arch-diagram {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

.arch-box {
  padding: 1.5rem 2rem;
  border-radius: 10px;
  text-align: center;
  min-width: 160px;
}

.arch-specs {
  background: rgba(99, 102, 241, 0.1);
  border: 2px solid rgba(99, 102, 241, 0.4);
}

.arch-changes {
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.4);
}

.arch-label {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

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

.arch-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.arch-arrow-label {
  font-size: 0.7rem;
  color: var(--accent);
}

/* 产物流 */
.artifact-flow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1rem 0;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.af-node {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: center;
  flex-shrink: 0;
}

.af-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.af-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.af-arrow {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* 依赖图 */
.dependency-graph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1rem 0;
}

.dep-row {
  display: flex;
  gap: 2rem;
}

.dep-node {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.dep-node small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.dep-root {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
}

.dep-leaf {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

/* 流程图 */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1rem 0;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  width: 100%;
}

.flow-step-final {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
}

.flow-num {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.flow-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.flow-text strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.15rem;
}

.flow-text code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent-3);
  background: rgba(6, 182, 212, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

.flow-arrow-v {
  color: var(--accent);
  font-size: 1.2rem;
  padding: 0.25rem 0;
  padding-left: 0.9rem;
}

/* ==========================================
   折叠面板
   ========================================== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: var(--bg-card-hover);
}

.accordion-icon {
  color: var(--accent);
  font-size: 1.25rem;
  transition: transform 0.3s;
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}

.accordion-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.accordion-body p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* ==========================================
   表格
   ========================================== */
.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.doc-table thead {
  background: rgba(99, 102, 241, 0.08);
}

.doc-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.doc-table td {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(99, 102, 241, 0.05);
  vertical-align: top;
  line-height: 1.6;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table tr:hover td {
  background: rgba(99, 102, 241, 0.03);
}

.doc-table td strong {
  color: var(--text-primary);
}

.doc-table code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-3);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ==========================================
   命令参考样式
   ========================================== */
.cmd-quick-ref {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.qr-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.qr-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
}

.qr-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(99, 102, 241, 0.04);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.qr-item:hover {
  border-color: var(--border);
  background: rgba(99, 102, 241, 0.08);
}

.qr-item code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.qr-item span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cmd-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.3s;
}

.cmd-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.cmd-name code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  background: none;
}

.cmd-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.badge-core {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent);
}

.badge-expanded {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-2);
}

.cmd-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.cmd-syntax {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.syntax-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.cmd-syntax code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: none;
}

/* ==========================================
   CLI 命令样式
   ========================================== */
.cli-cmd-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
}

.cli-cmd-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(99, 102, 241, 0.05);
  border-bottom: 1px solid var(--border);
}

.cli-cmd-header code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

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

.cli-cmd-body {
  padding: 1rem 1.25rem;
}

/* ==========================================
   工作流模式
   ========================================== */
.workflow-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.wf-mode {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.wf-mode-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wf-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wf-flow code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
}

.wf-flow span {
  color: var(--text-muted);
}

.wf-mode p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.workflow-patterns {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.wf-pattern {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.wf-pattern-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wf-pattern-icon {
  font-size: 1.1rem;
}

.wf-flow-compact {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

.wf-flow-compact code {
  color: var(--accent);
  background: none;
}

.wf-use-when {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.best-practices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bp-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s;
}

.bp-item:hover {
  border-color: var(--border-hover);
}

.bp-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bp-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.bp-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bp-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-3);
  background: rgba(6, 182, 212, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ==========================================
   工具网格
   ========================================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  cursor: default;
}

.tool-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-1px);
}

/* ==========================================
   列表样式
   ========================================== */
.styled-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.styled-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.styled-list li::before {
  content: '→';
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.styled-list code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent-3);
  background: rgba(6, 182, 212, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ==========================================
   页脚
   ========================================== */
.page-footer {
  padding: 2.5rem 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.footer-logo {
  width: 20px;
  height: 20px;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================
   返回顶部按钮
   ========================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* ==========================================
   代码内联
   ========================================== */
:not(.code-block) code:not(.cmd-name code):not(.cmd-syntax code):not(.cli-cmd-header code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  color: var(--accent-3);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ==========================================
   响应式布局
   ========================================== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 1.5rem;
  }

  .content-section {
    padding: 2.5rem 1.5rem;
  }

  .page-footer {
    padding: 2rem 1.5rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .stat-divider {
    display: none;
  }

  .terminal-body {
    font-size: 0.75rem;
    padding: 1rem;
  }

  .artifact-flow {
    flex-direction: column;
  }

  .af-arrow {
    transform: rotate(90deg);
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-copy {
    margin-left: 0;
  }

  .arch-diagram {
    flex-direction: column;
  }
}

/* ==========================================
   关于本文档样式
   ========================================== */
.about-card {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1.5rem;
  transition: border-color 0.3s;
}

.about-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.about-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 0.2rem;
}

.about-body {
  flex: 1;
}

.about-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

.about-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.about-body p:last-of-type {
  margin-bottom: 1.25rem;
}

.about-body strong {
  color: var(--accent);
}

.about-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.4);
  transition: border-color 0.2s;
}

.about-link:hover {
  border-bottom-color: var(--accent);
}

.about-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.about-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s;
}

.about-btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.about-btn-primary:hover {
  background: #5254cc;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.about-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.about-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.about-contribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.about-contribute-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1rem;
  transition: all 0.25s;
}

.about-contribute-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.08);
}

.aci-icon {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.about-contribute-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.about-contribute-item p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .about-card {
    flex-direction: column;
    gap: 1rem;
  }
}

/* ==========================================
   滚动条样式
   ========================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ==========================================
   选中文本颜色
   ========================================== */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ==========================================
   更新历史时间轴样式
   ========================================== */
.changelog-timeline {
  position: relative;
  padding-left: 2rem;
}

.changelog-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 1px;
}

.changelog-item {
  position: relative;
  margin-bottom: 2rem;
}

.changelog-item:last-child {
  margin-bottom: 0;
}

.changelog-marker {
  position: absolute;
  left: -1.85rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
  transition: box-shadow 0.3s;
}

.changelog-item:hover .changelog-marker {
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.9);
}

.changelog-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.3s;
}

.changelog-item:hover .changelog-content {
  border-color: rgba(99, 102, 241, 0.4);
}

.changelog-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.changelog-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  letter-spacing: 0.04em;
}

.changelog-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.changelog-summary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
  line-height: 1.5;
}

/* 详情折叠区域 */
.changelog-details {
  display: none;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.changelog-details.expanded {
  display: block;
  animation: fadeInDown 0.25s ease;
}

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

.changelog-details ul {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.changelog-details li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.changelog-details li::marker {
  color: var(--accent);
}

/* 展开/收起按钮 */
.changelog-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.75rem;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.changelog-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.changelog-toggle svg {
  transition: transform 0.25s;
}

.changelog-toggle.open svg {
  transform: rotate(180deg);
}

.changelog-toggle.open {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent);
}
