/* -------- 横幅区（产品介绍） -------- */
.api-hero {
    background: radial-gradient(ellipse at 50% 0%, #e8f0fe 0%, #f8faff 80%);
    padding: 3.2rem 0 2.8rem;
    border-radius: 0 0 3rem 3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.api-hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    color: #0b1a33;
    letter-spacing: -0.3px;
    margin-bottom: 0.3rem;
}
.api-hero .divider {
    width: 60px;
    height: 3px;
    background: #006ACD;
    margin: 0.6rem auto 0.8rem;
    border-radius: 3px;
}
.api-hero .sub-text {
    font-size: 1.05rem;
    color: #6c7a8a;
    max-width: 620px;
    margin: 0 auto;
}

/* -------- API 商城主体 -------- */
.api-section {
    padding: 10px 0 60px;
    background: #f8faff;
}

/* 产品优势卡片 */
.advantage-card {
    background: #fff;
    border-radius: 1.2rem;
    padding: 2rem 1.5rem;
    text-align: center;
    height: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.advantage-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(0, 106, 205, 0.08);
    border-color: rgba(0, 106, 205, 0.12);
}
.advantage-card .icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(0, 106, 205, 0.08);
    color: #006ACD;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}
.advantage-card h5 {
    font-weight: 600;
    color: #0b1a33;
}
.advantage-card p {
    color: #6c7a8a;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* -------- 搜索框（位于优势卡片下方） -------- */
.search-wrapper {
    max-width: 580px;
    margin: 3.5rem auto 2.5rem;
}
.search-wrapper .input-group {
    background: #fff;
    border-radius: 60px;
    box-shadow: 0 4px 20px rgba(0, 106, 205, 0.06);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.search-wrapper .input-group:focus-within {
    box-shadow: 0 8px 30px rgba(0, 106, 205, 0.12);
}
.search-wrapper .form-control {
    border: none;
    padding: 0.85rem 1.8rem;
    font-size: 1rem;
    border-radius: 60px 0 0 60px;
    background: transparent;
}
.search-wrapper .form-control:focus {
    box-shadow: none;
    border-color: transparent;
}
.search-wrapper .btn-search {
    border: none;
    background: #006ACD;
    color: #fff;
    padding: 0 2rem;
    border-radius: 0 60px 60px 0;
    font-weight: 500;
    transition: background 0.2s;
}
.search-wrapper .btn-search:hover {
    background: #0052a3;
}
.search-wrapper .btn-search i {
    font-size: 1.1rem;
}

/* 搜索无结果提示 */
.no-result {
    display: none;
    text-align: center;
    padding: 3rem 0;
    color: #8a98a8;
}
.no-result i {
    font-size: 3rem;
    color: #dde2eb;
    display: block;
    margin-bottom: 1rem;
}

/* -------- API 列表（一行 4 个） -------- */
.api-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}
.api-card {
    background: #fff;
    border-radius: 1.2rem;
    padding: 1.5rem 1.2rem 1.2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}
.api-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 106, 205, 0.07);
    border-color: rgba(0, 106, 205, 0.10);
}
.api-card .api-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}
.api-card .api-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0b1a33;
}
.api-card .api-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.7rem;
    border-radius: 20px;
    background: rgba(0, 106, 205, 0.08);
    color: #006ACD;
    flex-shrink: 0;
    margin-left: 0.5rem;
}
.api-card .api-badge.free {
    background: rgba(34, 197, 94, 0.10);
    color: #16a34a;
}
.api-card .api-badge.paid {
    background: rgba(234, 179, 8, 0.10);
    color: #ca8a04;
}
.api-card .api-desc {
    color: #4b5a6a;
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
    margin: 0.2rem 0 0.8rem;
}
.api-card .api-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #8a98a8;
    border-top: 1px solid #f0f4fa;
    padding-top: 0.8rem;
    margin-top: auto;
}
.api-card .api-meta .price {
    font-weight: 600;
    color: #006ACD;
    font-size: 0.95rem;
}
.api-card .api-meta .price .free-text {
    color: #16a34a;
}
.api-card .api-meta .calls i {
    margin-right: 4px;
}

/* 分类标题（含右侧展开图标） */
.category-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #0b1a33;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.category-title .cat-line {
    flex: 1;
    height: 1px;
    background: #e9edf4;
}
.category-title i:first-child {
    color: #006ACD;
    font-size: 1.2rem;
}

/* 右侧展开图标 */
.category-expand-icon {
    font-size: 1.3rem;
    color: #006ACD;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.2s ease;
    margin-left: auto;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    background: rgba(0, 106, 205, 0.05);
    line-height: 1;
}
.category-expand-icon:hover {
    background: rgba(0, 106, 205, 0.12);
}
.category-expand-icon.expanded {
    transform: rotate(180deg);
}

/* 默认隐藏第 5 个及之后的卡片（折叠状态） */
.category-wrap .api-card:nth-child(n+5) {
    display: none;
}
/* 展开状态：显示所有卡片 */
.category-wrap.expanded .api-card {
    display: flex !important;
}
/* 搜索时覆盖展开状态 */
.category-wrap.searching .api-card {
    display: flex !important;
}
.category-wrap.searching .api-card[style*="display: none"] {
    display: none !important;
}

/* 响应式 */
@media (max-width: 1199.98px) {
    .api-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 991.98px) {
    .api-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 575.98px) {
    .api-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .api-hero h1 {
        font-size: 1.8rem;
    }
    .api-hero {
        padding: 2rem 0 1.8rem;
    }
    .api-hero .sub-text {
        font-size: 0.95rem;
    }
    .search-wrapper .form-control {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    .search-wrapper .btn-search {
        padding: 0 1.2rem;
        font-size: 0.95rem;
    }
    .api-card .api-header {
        flex-wrap: wrap;
    }
}