/* ===================== XAPI · API Market 基础样式 ===================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --dark: #0f172a;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f6f8fb;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
    --shadow-hover: 0 6px 16px rgba(37, 99, 235, .12), 0 16px 40px rgba(15, 23, 42, .08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================== Header ===================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--dark);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: 40px;
}

.nav-menu a {
    font-size: 15px;
    color: var(--text-muted);
    transition: color .2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .32);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-lg {
    height: 46px;
    padding: 0 26px;
    font-size: 15px;
}

/* ===================== Hero ===================== */

.hero {
    position: relative;
    padding: 84px 0 72px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: 13px;
    margin-bottom: 22px;
}

.hero-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
}

.hero h1 {
    font-size: 44px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.5px;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #93c5fd, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    margin: 18px auto 0;
    max-width: 640px;
    font-size: 16px;
    color: rgba(255, 255, 255, .82);
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 620px;
    margin: 34px auto 0;
    padding: 8px;
    background: rgba(255, 255, 255, .96);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(2, 6, 23, .28);
}

.search-box input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text);
    background: transparent;
}

.search-box input::placeholder {
    color: #9ca3af;
}

.hot-words {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, .72);
}

.hot-words a:hover {
    color: #fff;
    text-decoration: underline;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 820px;
    margin: 52px auto 0;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, .16);
}

.hero-stats .stat-value {
    font-size: 26px;
    font-weight: 700;
}

.hero-stats .stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
}

/* ===================== Section ===================== */

.section {
    padding: 64px 0;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 26px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.section-desc {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-muted);
}

.section-more {
    font-size: 14px;
    color: var(--primary);
}

/* 分类 chips */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.chip {
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
    transition: all .2s;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===================== API 卡片 ===================== */

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.api-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.api-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, .4);
    box-shadow: var(--shadow-hover);
}

.api-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--primary-light);
    font-size: 20px;
}

.api-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.api-category {
    font-size: 12px;
    color: var(--text-muted);
}

.badge-hot {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #fef3c7;
    color: #b45309;
    font-size: 12px;
}

.api-summary {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.api-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag {
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 12px;
}

.api-meta {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.api-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.price-free {
    color: var(--success);
    font-size: 16px;
    font-weight: 700;
}

.price-paid {
    color: #dc2626;
    font-size: 16px;
    font-weight: 700;
}

.price-unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ===================== 接入流程 ===================== */

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.step-card {
    padding: 28px 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    margin-bottom: 14px;
}

.step-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.step-desc {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===================== CTA ===================== */

.cta {
    padding: 56px 0;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    text-align: center;
}

.cta h2 {
    font-size: 28px;
    font-weight: 700;
}

.cta p {
    margin: 10px 0 26px;
    color: rgba(255, 255, 255, .82);
    font-size: 15px;
}

.cta .btn-primary {
    background: #fff;
    color: var(--primary);
}

.cta .btn-primary:hover {
    background: #eff6ff;
}

/* ===================== Footer ===================== */

.site-footer {
    background: var(--dark);
    color: rgba(255, 255, 255, .68);
    padding: 48px 0 28px;
    font-size: 13.5px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.footer-brand .logo {
    color: #fff;
    margin-bottom: 12px;
}

.footer-brand p {
    max-width: 320px;
    line-height: 1.8;
}

.footer-col h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 14px;
    font-weight: 600;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a:hover {
    color: #93c5fd;
}

.footer-bottom {
    padding-top: 22px;
    text-align: center;
    line-height: 2;
}

.footer-bottom a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.beian-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 18px;
}

/* ===================== 首页：接口清单 / 调用约定 / 计费 ===================== */

.section-white {
    background: var(--white);
}

.section-note {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.9;
}

.section-more.muted {
    color: var(--text-muted);
}

.stat-value-text {
    font-size: 20px !important;
    letter-spacing: .5px;
}

/* 分类 chips 数量角标 */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip-count {
    min-width: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

.chip.active .chip-count {
    background: rgba(255, 255, 255, .24);
    color: #fff;
}

/* 接口卡片 */
.api-card .api-summary {
    -webkit-line-clamp: 3;
    min-height: 58px;
    margin-top: 16px;
}

.api-card code {
    font-family: "JetBrains Mono", Consolas, Menlo, monospace;
}

.api-card-top {
    padding-right: 52px;
}

.api-category {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.api-category code {
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 4px;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.method-tag {
    padding: 2px 7px;
    border-radius: 4px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
}

.api-endpoint code {
    font-size: 12.5px;
    color: var(--dark);
    word-break: break-all;
}

.api-params {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.7;
}

.params-label {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f3f4f6;
    font-size: 11px;
    color: var(--text-muted);
    vertical-align: 1px;
}

.api-charge {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.charge-type {
    font-size: 12px;
    color: var(--text-muted);
}

.badge-auth {
    padding: 1px 6px;
    border-radius: 4px;
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
}

.empty-block {
    padding: 70px 0;
    text-align: center;
    color: var(--text-muted);
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-block p {
    margin-bottom: 16px;
}

.price-table {
    background: var(--white);
}

.price-table a {
    color: var(--primary);
}

.price-table a:hover {
    text-decoration: underline;
}

.price-table .price-free,
.price-table .price-paid {
    font-size: 14px;
    white-space: nowrap;
}

/* 调用约定代码块 */
#protocol .doc-table {
    background: var(--white);
    max-width: 100%;
}

#protocol .code-block {
    max-width: 860px;
}

/* 常见问答 */
.faq-item p {
    margin: 10px 0 2px;
}

/* ===================== 悬浮联系方式 ===================== */

.float-dock {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.float-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 46px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .34);
    transition: transform .2s, box-shadow .2s;
}

.float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(37, 99, 235, .46);
}

.float-panel {
    width: 220px;
    margin-bottom: 12px;
    padding: 14px 14px 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .2s, transform .2s, visibility .2s;
}

.float-dock.open .float-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.float-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.float-close {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.float-close:hover {
    background: #e5e7eb;
    color: var(--text);
}

.float-qr {
    display: block;
    width: 168px;
    height: 168px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    object-fit: cover;
    background: #f8fafc;
}

.float-wx {
    margin-top: 10px;
    font-size: 13px;
    color: var(--dark);
}

.float-wx b {
    color: var(--primary);
    user-select: all;
}

.float-tip {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ===================== 响应式 ===================== */

@media (max-width: 900px) {
    .nav-menu {
        display: none;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .footer-top {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 56px 0 48px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .api-card .api-summary {
        -webkit-line-clamp: 4;
        min-height: 0;
    }

    .api-card-top {
        padding-right: 0;
    }

    .price-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .price-table th,
    .price-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .float-dock {
        right: 12px;
        bottom: 16px;
    }

    .float-btn {
        height: 44px;
        padding: 0 14px;
    }

    .float-btn-text {
        display: none;
    }

    .float-panel {
        width: 200px;
    }

    .float-qr {
        width: 150px;
        height: 150px;
    }
}
