/* 
 * 文件名: api.css
 * 功能说明: GROK API页面专用样式表
 * 创建日期: 2024-12-19
 * 更新日期: 2025-12-31
 * 作者: GROK官网开发团队
 * 版权: grok-4.top
 */

/* API页面标题区域 */
.api-hero {
  background: transparent;
  padding: 160px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.api-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, rgba(59, 130, 246, 0.05) 30%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.api-hero h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 3rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.feature-badge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.feature-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.badge-icon {
  font-size: 1.2rem;
}

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

/* API概览 */
.api-overview {
  padding: 100px 0;
  position: relative;
}

.api-overview h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 4rem;
  color: var(--text-primary);
}

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

.overview-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.overview-card:hover {
  transform: translateY(-10px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.overview-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: block;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.overview-card h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.overview-card > p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  color: var(--text-secondary);
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  padding-left: 2rem;
  display: flex;
  align-items: center;
}

.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #38bdf8;
  font-weight: bold;
  font-size: 1.1rem;
}

.feature-list li:last-child {
  border-bottom: none;
}

/* 快速开始 */
.quick-start {
  padding: 100px 0;
  background: rgba(0, 0, 0, 0.2);
}

.quick-start h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 4rem;
  color: var(--text-primary);
}

.start-steps {
  max-width: 900px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 4rem;
  align-items: flex-start;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 70px;
  bottom: -50px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(56, 189, 248, 0.5), rgba(56, 189, 248, 0));
}

.step-number {
  flex: 0 0 60px;
  height: 60px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  z-index: 1;
}

.step-content {
  flex: 1;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.step-content h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

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

/* 代码块样式 */
.code-block {
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
}

.code-block code {
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 代码标签页 */
.code-tabs {
  background: #0f172a;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.tab-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.05);
  color: #38bdf8;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-panel pre {
  margin: 0;
  padding: 1.5rem;
  background: transparent;
  color: #e2e8f0;
  overflow-x: auto;
}

/* API文档 */
.api-docs {
  padding: 100px 0;
}

.api-docs h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 4rem;
  color: var(--text-primary);
}

.docs-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.nav-item {
  padding: 0.8rem 1.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.nav-item.active:hover {
  background: var(--gradient-primary);
  color: white;
}

.docs-content {
  max-width: 900px;
  margin: 0 auto;
}

.doc-section h3 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.doc-section h4 {
  color: #38bdf8;
  font-size: 1.4rem;
  margin: 3rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-section h4::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: #38bdf8;
  border-radius: 2px;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #0f172a;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem 0;
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.method {
  background: #3b82f6;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.url {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

/* 参数表格 */
.params-table {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.params-table table {
  width: 100%;
  border-collapse: collapse;
  background: #0f172a;
}

.params-table th {
  background: rgba(255, 255, 255, 0.05);
  color: #38bdf8;
  padding: 1.2rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.params-table td {
  padding: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
  color: var(--text-secondary);
}

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

.params-table code {
  background: rgba(56, 189, 248, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: #38bdf8;
}

/* API价格 */
.api-pricing {
  padding: 100px 0;
  background: rgba(0, 0, 0, 0.2);
}

.api-pricing h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.pricing-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 4rem;
}

.pricing-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.pricing-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 3rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  position: relative;
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
}

.pricing-card.featured {
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
  transform: scale(1.05);
  z-index: 1;
}

.pricing-card:hover {
  transform: translateY(-10px);
  border-color: rgba(56, 189, 248, 0.3);
}

.pricing-card.featured:hover {
  transform: translateY(-10px) scale(1.05);
}

.popular-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  letter-spacing: 1px;
}

.pricing-card h3 {
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

.price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.currency {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.amount {
  font-size: 3.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.unit {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pricing-card .features {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0;
  text-align: left;
}

.pricing-card .features li {
  padding: 0.8rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pricing-card .features li::before {
  content: '✓';
  color: #38bdf8;
  font-weight: bold;
}

.pricing-card .features li:last-child {
  border-bottom: none;
}

.pricing-note {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-note p {
  color: #fbbf24;
  margin: 0;
}

/* SDK和工具 */
.sdk-tools {
  padding: 100px 0;
}

.sdk-tools h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 4rem;
  color: var(--text-primary);
}

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

.tool-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: var(--shadow-glow);
}

.tool-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: block;
}

.tool-card h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.tool-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.tool-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.tool-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.tool-link:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: #38bdf8;
  color: #fff;
}

/* CTA区域 */
.cta-section {
  padding: 100px 0;
  background: linear-gradient(180deg, transparent 0%, rgba(56, 189, 248, 0.05) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 2;
}

.cta-content h2 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.cta-content p {
  font-size: 1.3rem;
  margin-bottom: 3rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .api-hero h1 {
    font-size: 2.8rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .hero-features {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .overview-grid {
    grid-template-columns: 1fr;
  }
  
  .step {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .step:not(:last-child)::after {
    display: none;
  }
  
  .step-number {
    align-self: center;
    margin-bottom: 0.5rem;
  }
  
  .docs-nav {
    flex-direction: column;
    align-items: center;
  }
  
  .pricing-table {
    grid-template-columns: 1fr;
  }
  
  .pricing-card.featured {
    transform: none;
  }
  
  .pricing-card.featured:hover {
    transform: translateY(-10px);
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .cta-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .api-hero {
    padding: 120px 0 60px;
  }
  
  .api-hero h1 {
    font-size: 2.2rem;
  }
  
  .overview-card, .pricing-card, .tool-card {
    padding: 1.5rem;
  }
  
  .price .amount {
    font-size: 2.8rem;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overview-card,
.step,
.pricing-card,
.tool-card {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.overview-card:nth-child(1) { animation-delay: 0.1s; }
.overview-card:nth-child(2) { animation-delay: 0.2s; }
.overview-card:nth-child(3) { animation-delay: 0.3s; }
.overview-card:nth-child(4) { animation-delay: 0.4s; }

.step:nth-child(1) { animation-delay: 0.2s; }
.step:nth-child(2) { animation-delay: 0.4s; }
.step:nth-child(3) { animation-delay: 0.6s; }

.pricing-card:nth-child(1) { animation-delay: 0.1s; }
.pricing-card:nth-child(2) { animation-delay: 0.3s; }
.pricing-card:nth-child(3) { animation-delay: 0.5s; }

/* 代码复制按钮 */
.code-block {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.copy-button.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}