/* ============================================
   数聚DSP · 共享样式
   用于所有子页面的公共样式（含导航下拉菜单）
   ============================================ */

* { font-family: 'Inter', 'Microsoft YaHei', sans-serif; }
body { background: #f8fafc; color: #1e293b; margin: 0; }

/* ===== 导航栏 ===== */
.nav-link {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: #1d4ed8;
  background: #eff6ff;
}
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 9999;
  padding: 6px;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}
.nav-dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: #374151;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.nav-dropdown-arrow {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 3px;
  vertical-align: middle;
  transition: transform 0.2s;
}
.nav-dropdown:hover .nav-dropdown-arrow {
  transform: rotate(180deg);
}

/* ===== 按钮 ===== */
.btn-blue { background: #1d4ed8; color: white; border-radius: 8px; padding: 10px 24px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s; border: none; display: inline-block; text-decoration: none; }
.btn-blue:hover { background: #1e40af; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29,78,216,0.35); }
.btn-outline { background: white; color: #1d4ed8; border: 1.5px solid #1d4ed8; border-radius: 8px; padding: 10px 24px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s; display: inline-block; text-decoration: none; }
.btn-outline:hover { background: #eff6ff; }
.btn-orange { background: #f97316; color: white; border-radius: 8px; padding: 10px 24px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s; border: none; display: inline-block; text-decoration: none; }
.btn-orange:hover { background: #ea6c0a; transform: translateY(-1px); }
.btn-gray { background: white; color: #374151; border: 1.5px solid #e5e7eb; border-radius: 8px; padding: 10px 24px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s; display: inline-block; text-decoration: none; }
.btn-gray:hover { border-color: #3b82f6; color: #1d4ed8; }

/* ===== 卡片 ===== */
.card { background: white; border: 1px solid #e2e8f0; border-radius: 12px; transition: all 0.2s; }
.card:hover { border-color: #93c5fd; box-shadow: 0 8px 24px rgba(29,78,216,0.1); transform: translateY(-3px); }
.product-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; transition: all 0.2s; cursor: pointer; }
.product-card:hover { border-color: #3b82f6; box-shadow: 0 4px 16px rgba(59,130,246,0.15); }

/* ===== 标签 ===== */
.tag-hot { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; }
.tag-new { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; }
.tag-free { background: #fafaf0; color: #854d0e; border: 1px solid #fde047; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; }
.tag-pro { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; }

/* ===== 统计数字 ===== */
.stat-num { font-size: 2.2rem; font-weight: 800; line-height: 1; display: block; font-family: 'Inter', 'Arial', sans-serif; letter-spacing: -0.02em; }
section.bg-blue-700 .stat-num, section[class*="bg-blue-"] .stat-num { color: #ffffff; }

/* ===== 分类格 ===== */
.cat-grid-item { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; }
.cat-grid-item:hover { border-color: #3b82f6; box-shadow: 0 4px 16px rgba(59,130,246,0.12); background: #eff6ff; }
.cat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }

/* ===== 新闻卡 ===== */
.news-card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; transition: all 0.2s; cursor: pointer; }
.news-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }

/* ===== 解决方案卡 ===== */
.sol-card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 28px; transition: all 0.3s; cursor: pointer; }
.sol-card:hover { border-color: #1d4ed8; box-shadow: 0 8px 28px rgba(29,78,216,0.12); transform: translateY(-4px); }

/* ===== 步骤线（第一版：单条绝对定位连接线） ===== */
.step-connector {
  position: absolute;
  top: 24px;
  /* 连接线从步骤1圆圈右侧到步骤4圆圈左侧 */
  /* 4列等宽，每列25%，gap-8=32px，圆圈48px直径 */
  /* 覆盖第2和第3列之间的gap区域 */
  left: calc(25% + 24px);
  right: calc(25% + 24px);
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, #93c5fd 100%);
  pointer-events: none;
}
@media (max-width: 768px) {
  .step-connector { display: none; }
}

/* ===== 代码块 ===== */
.code-block { background: #0f172a; border-radius: 10px; padding: 24px; font-family: 'Fira Code', monospace; font-size: 13px; line-height: 1.7; overflow-x: auto; color: #f1f5f9; }
.code-kw { color: #7dd3fc; }
.code-str { color: #86efac; }
.code-comment { color: #64748b; }
.code-fn { color: #fde68a; }

/* ===== 详情 Modal ===== */
.detail-modal { background: white; border-radius: 16px; max-width: 640px; width: 95%; max-height: 90vh; overflow-y: auto; }

/* ===== 分页 ===== */
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 14px; cursor: pointer; border: 1px solid #e5e7eb; background: white; color: #374151; transition: all 0.15s; flex-shrink: 0; }
.page-btn:hover { border-color: #3b82f6; color: #1d4ed8; }
.page-btn.active { background: #1d4ed8; color: white; border-color: #1d4ed8; }

/* ===== API 产品页 ===== */
.cat-item { cursor: pointer; padding: 10px 16px; border-radius: 8px; font-size: 14px; color: #374151; transition: all 0.15s; display: flex; align-items: center; gap: 8px; }
.cat-item:hover { background: #eff6ff; color: #1d4ed8; }
.cat-item.active { background: #1d4ed8; color: white; }
.sort-btn { padding: 6px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.15s; border: 1px solid #e5e7eb; background: white; color: #374151; }
.sort-btn.active { background: #1d4ed8; color: white; border-color: #1d4ed8; }
.filter-btn { padding: 5px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.15s; border: 1px solid #e5e7eb; background: white; color: #374151; }
.filter-btn.active { background: #eff6ff; color: #1d4ed8; border-color: #3b82f6; }
.api-list-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px 24px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 16px; }
.api-list-card:hover { border-color: #3b82f6; box-shadow: 0 2px 12px rgba(59,130,246,0.12); }

/* ===== FAQ ===== */
.faq-item { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-answer.open { max-height: 200px; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-box { background: white; border-radius: 16px; max-width: 480px; width: 90%; padding: 36px; position: relative; }

/* ===== 面包屑 ===== */
.breadcrumb-item { font-size: 13px; color: #6b7280; }
.breadcrumb-item.current { color: #1d4ed8; font-weight: 500; }

/* ===== 搜索框 ===== */
.search-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

/* ===== 公告滚动栏 ===== */
.ann-bar { background: #1d4ed8; }
.ann-scroll { display: flex; gap: 48px; animation: scrollLeft 30s linear infinite; white-space: nowrap; }
@keyframes scrollLeft { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* ===== Hero ===== */
.hero-bg { background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%); }

/* ===== 展开动画 ===== */
.fade-up { animation: fadeUp 0.5s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ===== 文档中心 ===== */
.doc-sidebar { position: sticky; top: 72px; max-height: calc(100vh - 100px); overflow-y: auto; }
.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.doc-cat { margin-bottom: 4px; }
.doc-cat-title { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; user-select: none; border-radius: 6px; }
.doc-cat-title:hover { background: #f3f4f6; }
.doc-cat-arrow { flex-shrink: 0; transition: transform 0.2s; }
.doc-cat.collapsed .doc-cat-arrow { transform: rotate(-90deg); }
.doc-cat-items { display: block; }
.doc-cat.collapsed .doc-cat-items { display: none; }
.doc-nav-item { padding: 7px 10px 7px 22px; font-size: 13px; color: #6b7280; cursor: pointer; border-radius: 6px; transition: all 0.15s; position: relative; display: flex; align-items: center; }
.doc-nav-item::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 0; background: #1d4ed8; border-radius: 0 2px 2px 0; transition: height 0.15s; }
.doc-nav-item:hover { color: #1d4ed8; background: #eff6ff; }
.doc-nav-item.active { color: #1d4ed8; background: #eff6ff; font-weight: 500; }
.doc-nav-item.active::before { height: 16px; }
.doc-lang-btn { padding: 4px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; border: 1px solid #e5e7eb; background: white; color: #6b7280; transition: all 0.15s; }
.doc-lang-btn:hover { border-color: #3b82f6; color: #1d4ed8; }
.doc-lang-btn.active { background: #1d4ed8; color: white; border-color: #1d4ed8; }
.inline-code { font-family: 'Courier New', monospace; font-size: 12px; background: #f1f5f9; color: #1d4ed8; padding: 1px 6px; border-radius: 4px; border: 1px solid #e2e8f0; }
.doc-step { display: flex; gap: 20px; align-items: flex-start; }
.doc-step-num { width: 36px; height: 36px; border-radius: 50%; background: #1d4ed8; color: white; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: 'Arial', monospace; }
.doc-step-body { flex: 1; }
.doc-step-title { font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.doc-step-text { font-size: 13px; color: #6b7280; line-height: 1.7; }

/* ===== 开发者中心：左侧导航子项 ===== */
.doc-sub-item { display: none; }
.doc-cat:not(.collapsed) .doc-sub-item { display: block; }
.api-group-item { padding-left: 22px; font-weight: 500; color: #374151; }
.api-group-item:hover { color: #1d4ed8; background: #eff6ff; }
.doc-nav-item.pl-4 { padding-left: 34px !important; }

/* ===== 开发者中心：右侧面板标题 ===== */
.doc-panel-header { margin-bottom: 1.5rem; }

/* ===== 代码高亮补充 ===== */
.code-var { color: #f9a8d4; }
