/* 页面标题区域 */

.api-header {
  margin-top: 80px;
  background: linear-gradient(135deg, #165dff 0%, #0a3ca0 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}

.api-header h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
}

.api-header p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 30px;
}

.api-btns {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* API对接优势 */
.api-advantage {
  padding: 100px 0;
}

.advantage-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.advantage-item {
  background-color: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: all 0.3s ease;
}

.advantage-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(22, 93, 255, 0.12);
}

.advantage-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #EEF2FF;
  color: #165dff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 20px;
}

.advantage-item h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.advantage-item p {
  font-size: 14px;
  color: #64748b;
}

/* API对接流程 */
.api-process {
  padding: 80px 0;
  background-color: #f9fafb;
}

.process-list {
  display: flex;
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

/* 流程连接线 */
.process-list::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 50px;
  right: 50px;
  height: 2px;
  background-color: #e2e8f0;
  z-index: 1;
}

.process-item {
  flex: 1;
  position: relative;
  z-index: 2;
  padding: 0 15px;
}

/* 步骤节点 */
.process-step {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #165dff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto 20px;
}

.process-content {
  text-align: center;
}

.process-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 10px;
}

.process-content p {
  font-size: 14px;
  color: #64748b;
}

/* 最后一步隐藏连接线 */
.process-item.last .process-line {
  display: none;
}

/* 技术文档展示 */
.api-docs {
  padding: 100px 0;
}

.docs-container {
  display: flex;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* 文档导航 */
.docs-nav {
  width: 260px;
  background-color: #f8fafc;
  border-right: 1px solid #f1f5f9;
}

.docs-nav ul {
  display: flex;
  flex-direction: column;
}

.docs-nav .nav-item {
  padding: 14px 20px;
  font-size: 15px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid #fff;
}

.docs-nav .nav-item.active {
  color: #165dff;
  background-color: #EEF2FF;
  border-left-color: #165dff;
  font-weight: 500;
}

.docs-nav .nav-item:hover:not(.active) {
  color: #1e293b;
  background-color: #f1f5f9;
}

/* 文档内容 */
.docs-content {
  flex: 1;
  padding: 30px;
  min-height: 500px;
}

.docs-panel {
  display: none;
  animation: fadeIn 0.5s ease;
}

.docs-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.docs-panel h3 {
  font-size: 22px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.docs-panel p {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* 代码块样式 */
.code-block {
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  font-size: 14px;
  color: #334155;
  font-family: "Consolas", "Monaco", monospace;
}

/* SDK下载列表 */
.sdk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.sdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background-color: #EEF2FF;
  color: #165dff;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.sdk-item:hover {
  background-color: #165dff;
  color: #fff;
}

/* 常见问题 */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-item h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.faq-item p {
  margin-bottom: 0;
  padding-left: 10px;
  border-left: 2px solid #165dff;
}

/* 对接案例展示 */
.api-case {
  padding: 100px 0;
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.case-item {
  display: flex;
  gap: 30px;
  background-color: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  align-items: center;
}

.case-img {
  flex: 0 0 400px;
}

.case-img img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
}

.case-content {
  flex: 1;
}

.case-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.case-content p {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 20px;
  line-height: 1.6;
}

.case-tag {
  display: flex;
  gap: 10px;
}

.case-tag span {
  font-size: 12px;
  color: #165dff;
  background-color: #EEF2FF;
  padding: 4px 12px;
  border-radius: 20px;
}

/* 申请对接区域 */
.api-apply {
  padding: 80px 0;
  background-color: #f9fafb;
}

.apply-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  display: flex;
  overflow: hidden;
}

.apply-text {
  flex: 1;
  background: linear-gradient(135deg, #165dff 0%, #0a3ca0 100%);
  color: #fff;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.apply-text h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}

.apply-text p {
  font-size: 16px;
  opacity: 0.9;
  line-height: 1.6;
}

.apply-form {
  flex: 1;
  padding: 60px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: #64748b;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 15px;
  color: #1e293b;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #fff;
}

.apply-btn {
  width: 100%;
  padding: 14px 0;
  font-size: 16px;
}

/* 响应式适配 */
@media (max-width: 992px) {
  .advantage-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .docs-container {
    flex-direction: column;
  }

  .docs-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #f1f5f9;
  }

  .case-item {
    flex-direction: column;
  }

  .case-img {
    flex: 0 0 auto;
    width: 100%;
  }

  .apply-card {
    flex-direction: column;
  }

  .apply-text,
  .apply-form {
    padding: 40px;
  }
}

@media (max-width: 768px) {
  .api-header h1 {
    font-size: 32px;
  }

  .advantage-list {
    grid-template-columns: 1fr;
  }

  .process-list {
    flex-direction: column;
  }

  .process-list::before {
    display: none;
  }

  .process-item {
    margin-bottom: 30px;
  }

  .case-content h3 {
    font-size: 18px;
  }

  .apply-text h2 {
    font-size: 24px;
  }
}
