/* ===== EduBuddy 帮助文档样式 ===== */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --sidebar-width: 260px;
  --header-height: 60px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --transition: .2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-dark); }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.top-nav { display: flex; gap: 8px; }
.top-nav a {
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}
.top-nav a:hover, .top-nav a.active {
  background: var(--bg-muted);
  color: var(--primary);
  text-decoration: none;
}

/* ===== 英雄区 ===== */
.hero {
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 50%, #ecfdf5 100%);
  padding: 80px 24px 72px;
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: .04em;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 20px;
}
.hero h1 span { color: var(--primary); }
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.8;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; border: 2px solid var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--bg-muted); text-decoration: none; }
.hero-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.badge {
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== 功能卡片 ===== */
.features { padding: 72px 24px; background: var(--bg); }
.features-inner, .ql-inner { max-width: 1100px; margin: 0 auto; }
.features h2, .ql-inner h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 48px;
  color: var(--text);
}
.feature-grid, .ql-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  transition: var(--transition);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }

/* ===== 快速导航 ===== */
.quick-links { padding: 72px 24px; background: var(--bg-soft); }
.ql-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
}
.ql-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); text-decoration: none; }
.ql-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.ql-card p { color: var(--text-muted); font-size: .88rem; }

/* ===== 页脚 ===== */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .88rem;
}
.site-footer a { color: var(--primary); }

/* ===== 文档页面布局 ===== */
.doc-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 24px 0;
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-title {
  padding: 4px 20px 8px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
}
.sidebar a {
  display: block;
  padding: 7px 20px;
  font-size: .88rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}
.sidebar a:hover { color: var(--primary); background: var(--bg-muted); text-decoration: none; }
.sidebar a.active {
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
  background: #eef2ff;
}

/* 主内容 */
.doc-content {
  flex: 1;
  min-width: 0;
  padding: 48px 60px;
  max-width: 860px;
}
.doc-content h1 { font-size: 2.1rem; font-weight: 800; margin-bottom: 12px; }
.doc-content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.doc-content h3 { font-size: 1.15rem; font-weight: 700; margin-top: 32px; margin-bottom: 12px; }
.doc-content h4 { font-size: 1rem; font-weight: 700; margin-top: 24px; margin-bottom: 8px; }
.doc-content p { margin-bottom: 16px; color: var(--text); line-height: 1.8; }
.doc-content ul, .doc-content ol { margin: 12px 0 16px 24px; }
.doc-content li { margin-bottom: 6px; line-height: 1.7; }
.doc-content strong { font-weight: 700; color: var(--text); }
.doc-content em { color: var(--text-muted); }

/* 代码 */
.doc-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: .85em;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: #d63031;
}
.doc-content pre {
  background: #1e293b;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.doc-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: .88rem;
  line-height: 1.7;
}

/* 表格 */
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: .9rem;
}
.doc-content th {
  background: var(--bg-muted);
  font-weight: 700;
  text-align: left;
  padding: 10px 16px;
  border: 1px solid var(--border);
}
.doc-content td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.doc-content tr:nth-child(even) td { background: var(--bg-soft); }

/* 提示框 */
.tip, .warning, .danger, .info {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
  border-left: 4px solid;
  font-size: .93rem;
}
.tip { background: #f0fdf4; border-color: var(--success); }
.tip::before { content: '✅ '; font-weight: 700; }
.warning { background: #fffbeb; border-color: var(--warning); }
.warning::before { content: '⚠️ '; font-weight: 700; }
.danger { background: #fef2f2; border-color: var(--danger); }
.danger::before { content: '🚫 '; font-weight: 700; }
.info { background: #eff6ff; border-color: var(--primary); }
.info::before { content: 'ℹ️ '; font-weight: 700; }

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-size: .85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }

/* 页面标签 */
.page-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* API方法标签 */
.method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
  font-family: monospace;
  margin-right: 8px;
}
.method.get { background: #dcfce7; color: #16a34a; }
.method.post { background: #dbeafe; color: #2563eb; }
.method.put { background: #fef9c3; color: #ca8a04; }
.method.delete { background: #fee2e2; color: #dc2626; }

/* API端点块 */
.api-endpoint {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin: 16px 0;
  font-family: monospace;
  font-size: .9rem;
}
.api-endpoint strong { color: var(--text); font-size: .95rem; }

/* 步骤 */
.steps { counter-reset: step; margin: 20px 0; }
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  margin-top: 2px;
}
.step-content h4 { margin-top: 0; }

/* 分页导航 */
.doc-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.doc-nav a {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
}
.doc-nav a:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.doc-nav .nav-label { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.doc-nav .nav-title { font-size: .95rem; font-weight: 600; color: var(--primary); }
.doc-nav .prev { text-align: left; }
.doc-nav .next { text-align: right; margin-left: auto; }

/* 响应式 */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .doc-content { padding: 32px 24px; }
  .hero h1 { font-size: 2rem; }
  .doc-nav { flex-direction: column; }
}
@media (max-width: 600px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .feature-grid, .ql-grid { grid-template-columns: 1fr; }
  .top-nav { display: none; }
}

/* 架构图 */
.arch-diagram {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  font-family: monospace;
  font-size: .85rem;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.card h4 { margin-top: 0; font-size: .95rem; }
.card p { margin: 0; font-size: .85rem; color: var(--text-muted); }
