/* ===================== XAPI · 技术博客 / 发布接口 样式 ===================== */

/* ---------- 博客 Hero ---------- */
.blog-hero {
    position: relative;
    padding: 64px 0 54px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
    overflow: hidden;
}

.blog-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%);
}

.blog-hero .container {
    position: relative;
    z-index: 1;
}

.blog-crumb {
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    margin-bottom: 14px;
}

.blog-crumb a:hover {
    color: #fff;
}

.blog-crumb span {
    margin: 0 6px;
}

.blog-hero h1 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.blog-hero .blog-sub {
    margin: 14px 0 0;
    max-width: 640px;
    font-size: 15px;
    color: rgba(255, 255, 255, .82);
}

.blog-search {
    display: flex;
    gap: 10px;
    max-width: 560px;
    margin-top: 26px;
    padding: 7px;
    background: rgba(255, 255, 255, .96);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(2, 6, 23, .28);
}

.blog-search input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text);
    background: transparent;
}

/* ---------- 博客列表卡片 ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, .4);
    box-shadow: var(--shadow-hover);
}

.blog-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.blog-card-cover {
    height: 132px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    display: flex;
    align-items: flex-end;
    padding: 14px 16px;
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-cover .cover-cat {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, .35);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .3);
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
}

.blog-cat {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
}

.blog-card-summary {
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 12.5px;
    color: var(--text-muted);
}

.blog-card-meta .read-more {
    color: var(--primary);
    font-weight: 600;
}

/* ---------- 博客文章详情 ---------- */
.blog-article {
    max-width: 820px;
    margin: 0 auto;
}

.blog-article .doc-main {
    padding: 8px 4px 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 16px 0 22px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 4px;
}

.article-tags .tag {
    padding: 3px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 12px;
}

/* ---------- 推荐区（相关文章 / 本系统接口） ---------- */
.blog-recommend {
    margin-top: 48px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

.blog-recommend h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.blog-recommend .rec-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.rec-card {
    display: block;
    padding: 16px 18px;
    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;
    color: inherit;
}

.rec-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, .4);
    box-shadow: var(--shadow-hover);
}

.rec-card .rec-cat {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.rec-card .rec-title {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.5;
}

.rec-card .rec-summary {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-card .rec-api-code {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-family: "JetBrains Mono", Consolas, monospace;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---------- 发布接口页 ---------- */
.publish-hero {
    position: relative;
    padding: 72px 0 60px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
    overflow: hidden;
    text-align: center;
}

.publish-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%);
}

.publish-hero .container {
    position: relative;
    z-index: 1;
}

.publish-hero .blog-crumb {
    text-align: left;
}

.publish-hero h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.publish-hero .publish-sub {
    margin: 16px auto 0;
    max-width: 680px;
    font-size: 16px;
    color: rgba(255, 255, 255, .85);
}

.commission-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 28px;
    padding: 14px 30px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
}

.commission-badge .big {
    font-size: 30px;
    font-weight: 800;
}

.commission-badge .split {
    font-size: 14px;
    color: rgba(255, 255, 255, .85);
}

.adv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.adv-card {
    padding: 30px 28px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.adv-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.adv-card h3 .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
}

.adv-card ul {
    margin-top: 14px;
    list-style: none;
}

.adv-card li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
}

.adv-card li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.publish-contact {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: center;
    padding: 32px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.publish-contact .qr {
    width: 200px;
    height: 200px;
    border: 1px solid var(--border);
    border-radius: 12px;
    object-fit: cover;
    background: #f8fafc;
}

.publish-contact h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.publish-contact p {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
}

.contact-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 15px;
    color: var(--text);
}

.contact-line b {
    color: var(--primary);
}

.copy-btn-inline {
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.copy-btn-inline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    .adv-grid,
    .publish-contact {
        grid-template-columns: 1fr;
    }

    .publish-contact {
        justify-items: center;
        text-align: center;
    }

    .blog-hero h1,
    .publish-hero h1 {
        font-size: 30px;
    }
}
