/**
 * API市场平台 - 前端展示样式
 */

/* ==================== 全局样式 ==================== */
.api-market-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.api-market-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== Hero区域 ==================== */
.api-market-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.api-market-hero h1 {
    font-size: 48px;
    margin: 0 0 20px 0;
    font-weight: 700;
}

.api-market-hero .subtitle {
    font-size: 20px;
    margin: 0 0 40px 0;
    opacity: 0.9;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-box input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-box button {
    padding: 15px 25px;
    background: #667eea;
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #5568d3;
}

/* ==================== 统计栏 ==================== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* ==================== 分类筛选 ==================== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.filter-btn .count {
    margin-left: 5px;
    background: rgba(102, 126, 234, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== 服务卡片网格 ==================== */
.category-section {
    margin: 50px 0;
}

.category-title {
    font-size: 28px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 32px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.service-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.service-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.badge-ai_model {
    background: #e0f7fa;
    color: #006064;
}

.badge-weather {
    background: #fff3e0;
    color: #e65100;
}

.badge-data_query {
    background: #e8eaf6;
    color: #283593;
}

.badge-image_processing {
    background: #fce4ec;
    color: #880e4f;
}

.badge-text_analysis {
    background: #f3e5f5;
    color: #4a148c;
}

.badge-other {
    background: #f5f5f5;
    color: #424242;
}

.service-description {
    color: #666;
    margin: 15px 0;
    line-height: 1.6;
}

.service-meta {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: 2px solid #667eea;
}

.btn-primary:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #f0f4ff;
}

.btn-block {
    width: 100%;
}

/* ==================== 快速开始 ==================== */
.quick-start-section {
    margin: 60px 0;
    padding: 50px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    text-align: center;
}

.quick-start-section h2 {
    font-size: 32px;
    margin-bottom: 40px;
}

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

.step-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px;
}

.step-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.step-card p {
    margin: 0;
    color: #666;
}

/* ==================== 服务详情页 ==================== */
.api-service-detail .service-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb span {
    margin: 0 10px;
    opacity: 0.6;
}

.service-hero h1 {
    font-size: 42px;
    margin: 0 0 15px 0;
}

.service-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.service-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin: 50px 0;
}

.main-content {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
}

.content-section:last-child {
    border-bottom: none;
}

.content-section h2 {
    font-size: 28px;
    margin: 0 0 20px 0;
    color: #333;
}

.features-list ul {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 10px 0;
    font-size: 16px;
}

.endpoint-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.endpoint-method {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
}

.endpoint-url code {
    font-size: 16px;
    color: #333;
}

.copy-btn {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #f0f0f0;
}

.params-table {
    overflow-x: auto;
}

.params-table table {
    width: 100%;
    border-collapse: collapse;
}

.params-table th,
.params-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.params-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.params-table code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.code-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.code-examples {
    position: relative;
}

.code-panel {
    display: none;
}

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

.code-panel pre {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
}

.code-panel code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.response-example h4 {
    margin: 20px 0 10px 0;
    color: #333;
}

.response-example pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.cta-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cta-card h3 {
    color: white;
}

.cta-card p {
    opacity: 0.9;
    margin-bottom: 20px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-list .label {
    color: #666;
}

.info-list .value {
    font-weight: 600;
    color: #333;
}

.status-online {
    color: #27ae60;
}

.package-item {
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 8px;
}

.package-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.package-price {
    color: #667eea;
    font-size: 18px;
    font-weight: bold;
    margin: 5px 0;
}

.package-quota {
    font-size: 14px;
    color: #666;
}

.view-all-packages {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.links-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-card li {
    margin: 10px 0;
}

.links-card a {
    color: #667eea;
    text-decoration: none;
    display: block;
    padding: 8px 0;
    transition: color 0.3s;
}

.links-card a:hover {
    color: #5568d3;
}

/* ==================== API文档页 ==================== */
.api-docs-page .docs-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
}

.docs-header h1 {
    font-size: 36px;
    margin: 20px 0 0 0;
}

.docs-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    margin: 50px 0;
}

.docs-nav {
    position: sticky;
    top: 20px;
    height: fit-content;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.docs-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav li {
    margin: 5px 0;
}

.docs-nav a {
    display: block;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.docs-nav a:hover {
    background: #f0f4ff;
    color: #667eea;
}

.docs-nav a.active {
    background: #667eea;
    color: white;
}

.docs-main {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.doc-section {
    margin-bottom: 50px;
    padding-bottom: 50px;
    border-bottom: 1px solid #e0e0e0;
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section h2 {
    font-size: 32px;
    margin: 0 0 20px 0;
    color: #333;
}

.doc-section h3 {
    font-size: 24px;
    margin: 30px 0 15px 0;
    color: #333;
}

.info-box {
    padding: 15px 20px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 5px;
    margin: 20px 0;
}

.endpoint-box.large {
    padding: 25px;
}

.placeholder-note {
    padding: 20px;
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
}

.placeholder-note ul {
    margin: 10px 0 0 20px;
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.limit-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.limit-item h4 {
    margin: 0 0 10px 0;
    color: #667eea;
}

.limit-item p {
    margin: 0;
    color: #666;
}

/* ==================== 短代码样式 ==================== */
.api-market-shortcode {
    margin: 30px 0;
}

.services-grid .service-card-mini {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    transition: all 0.3s;
}

.services-grid .service-card-mini:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.service-card-mini h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.service-card-mini p {
    margin: 0 0 15px 0;
    color: #666;
}

.service-card-mini a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.api-service-detail-shortcode {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .content-layout,
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .docs-nav {
        position: static;
    }
}

@media (max-width: 768px) {
    .api-market-hero h1 {
        font-size: 32px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .api-market-hero {
        padding: 40px 0;
    }
    
    .api-market-hero h1 {
        font-size: 28px;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: 10px;
    }
    
    .search-box button {
        border-radius: 0 0 10px 10px;
    }
    
    .category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }
    
    .filter-btn {
        white-space: nowrap;
    }
}
