/* =========================================================
   现代风页面内容样式
   适用页面：developer/index.php、developer/api-list.php
   前置依赖：style.css、header-nav.css
            （主题变量、主题基底与顶部导航样式统一放在 header-nav.css）
   ========================================================= */

/* ================= 页面容器 ================= */
.dev-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 40px 24px 24px;
}

/* ================= 首屏 Hero ================= */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--dev-radius-xl);
    padding: 72px 56px 56px;
    color: #fff;
    background:
        radial-gradient(720px 380px at 12% -20%, rgba(124, 58, 237, .55), transparent 62%),
        radial-gradient(620px 360px at 88% 0%, rgba(6, 182, 212, .42), transparent 60%),
        linear-gradient(140deg, #0b1020 0%, #121a33 55%, #0d1526 100%);
    box-shadow: var(--dev-shadow-lg);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(620px 420px at 68% 18%, #000, transparent 78%);
    mask-image: radial-gradient(620px 420px at 68% 18%, #000, transparent 78%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #c7d2fe;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
}

.hero-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .18);
}

.hero h1 {
    margin: 22px 0 18px;
    font-size: clamp(30px, 4.2vw, 50px);
    line-height: 1.16;
    font-weight: 800;
    letter-spacing: -.03em;
}

.hero h1 .grad {
    background: linear-gradient(100deg, #a5b4fc, #67e8f9 58%, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 640px;
    font-size: 16px;
    line-height: 1.8;
    color: rgba(226, 232, 240, .78);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 46px;
    padding: 0 22px;
    border-radius: var(--dev-radius);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform .28s, box-shadow .28s, background .28s, border-color .28s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 18px 34px -16px rgba(99, 102, 241, .9);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 46px -16px rgba(99, 102, 241, 1);
}

.btn-ghost {
    color: #e2e8f0;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .3);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 46px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.hero-stat strong {
    display: block;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}

.hero-stat span {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    color: rgba(226, 232, 240, .6);
}

/* ================= 通用区块头 ================= */
.dev-section {
    margin-top: 76px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dev-brand);
}

.dev-section-head {
    max-width: 720px;
    margin-bottom: 34px;
}

.dev-section-head h2 {
    margin: 10px 0 10px;
    font-size: clamp(22px, 2.6vw, 30px);
    font-weight: 800;
    letter-spacing: -.025em;
}

.dev-section-head p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--dev-text-soft);
}

/* ================= 核心接口速览 ================= */
.mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.mini-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
    border-radius: var(--dev-radius-lg);
    background: var(--dev-surface);
    border: 1px solid var(--dev-border);
    box-shadow: var(--dev-shadow-xs);
    text-decoration: none;
    color: inherit;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}

.mini-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--dev-shadow-sm);
    border-color: #d5dff1;
}

.mini-icon {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 10px 22px -12px var(--accent);
}

.mini-body {
    min-width: 0;
    flex: 1;
}

.mini-body h3 {
    font-size: 15.5px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -.01em;
}

.mini-body .mini-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--dev-text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-arrow {
    flex: none;
    align-self: center;
    color: #c3cee0;
    font-size: 14px;
    transition: transform .3s, color .3s;
}

.mini-card:hover .mini-arrow {
    color: var(--dev-brand);
    transform: translateX(3px);
}

/* ================= 接入流程 ================= */
.flow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.step-card {
    position: relative;
    padding: 30px 22px 24px;
    border-radius: var(--dev-radius-lg);
    background: var(--dev-surface);
    border: 1px solid var(--dev-border);
    box-shadow: var(--dev-shadow-xs);
}

.step-num {
    position: absolute;
    top: -14px;
    left: 22px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--dev-brand), var(--dev-brand-2));
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, .8);
}

.step-card h3 {
    font-size: 15.5px;
    font-weight: 700;
    margin: 6px 0 8px;
}

.step-card p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--dev-text-soft);
}

/* ================= 快速开始代码块 ================= */
.quickstart-grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 22px;
    align-items: stretch;
}

.code-card {
    border-radius: var(--dev-radius-lg);
    overflow: hidden;
    background: #0b1020;
    box-shadow: var(--dev-shadow-md);
    display: flex;
    flex-direction: column;
}

.code-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.code-head .d {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-head .d1 { background: #ff5f57; }
.code-head .d2 { background: #febc2e; }
.code-head .d3 { background: #28c840; }

.code-head span {
    margin-left: 8px;
    font-size: 12px;
    color: rgba(226, 232, 240, .5);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code-body {
    padding: 22px;
    margin: 0;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.9;
    color: #cbd5e1;
    white-space: pre;
}

.code-body .k { color: #c4b5fd; }
.code-body .s { color: #86efac; }
.code-body .c { color: #64748b; }

.quickstart-notes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-card {
    padding: 18px 20px;
    border-radius: var(--dev-radius);
    background: var(--dev-surface);
    border: 1px solid var(--dev-border);
    box-shadow: var(--dev-shadow-xs);
}

.note-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.note-card h4 i {
    color: var(--dev-brand);
    font-size: 14px;
}

.note-card p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--dev-text-soft);
}

/* ================= 底部 CTA ================= */
.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 84px;
    padding: 40px 44px;
    border-radius: var(--dev-radius-xl);
    background: linear-gradient(135deg, #eef2ff, #e6f7fb);
    border: 1px solid #dbe4f7;
}

.cta-band h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 8px;
}

.cta-band p {
    font-size: 14px;
    color: var(--dev-text-soft);
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 46px;
    padding: 0 24px;
    border-radius: var(--dev-radius);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    box-shadow: 0 16px 30px -16px rgba(15, 23, 42, .9);
    transition: transform .28s, box-shadow .28s;
}

.btn-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px -16px rgba(15, 23, 42, 1);
}

/* ================= 接口列表页 ================= */
.page-head {
    padding: 6px 0 30px;
}

.page-head h1 {
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -.03em;
}

.page-head p {
    margin-top: 10px;
    max-width: 680px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--dev-text-soft);
}

.dev-toolbar {
    position: sticky;
    top: 78px;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--dev-radius-lg);
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--dev-border);
    box-shadow: var(--dev-shadow-sm);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 240px;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--dev-border);
    transition: border-color .25s, box-shadow .25s;
}

.search-box:focus-within {
    border-color: var(--dev-brand);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

.search-box i {
    color: #9aa9bf;
    font-size: 14px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    height: 100%;
    font-size: 14px;
    color: var(--dev-text);
}

.search-box input::placeholder {
    color: #9aa9bf;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--dev-border);
    background: #fff;
    color: var(--dev-text-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
}

.chip:hover {
    border-color: #cdd8ea;
    color: var(--dev-text);
}

.chip.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--dev-brand), #6366f1);
    box-shadow: 0 10px 20px -12px rgba(79, 70, 229, .9);
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(348px, 1fr));
    gap: 20px;
    margin-top: 26px;
}

.api-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 26px;
    border-radius: var(--dev-radius-xl);
    background: var(--dev-surface);
    border: 1px solid var(--dev-border);
    box-shadow: var(--dev-shadow-xs);
    overflow: hidden;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, border-color .35s;
}

.api-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), transparent);
    opacity: 0;
    transition: opacity .35s;
}

.api-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--dev-shadow-md);
    border-color: #d5dff1;
}

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

.api-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.api-card-icon {
    flex: none;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 21px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 14px 26px -14px var(--accent);
}

.api-card-heading {
    min-width: 0;
    flex: 1;
}

.api-card-heading h3 {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -.015em;
    line-height: 1.35;
}

.api-path {
    display: inline-block;
    margin-top: 7px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--dev-soft);
    color: #4b5b75;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
}

.api-card-desc {
    font-size: 13.5px;
    line-height: 1.72;
    color: var(--dev-text-soft);
}

.api-card-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.method {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
}

.method-get    { background: rgba(56, 189, 248, .15); color: #0284c7; }
.method-post   { background: rgba(16, 185, 129, .15); color: #059669; }
.method-put    { background: rgba(245, 158, 11, .16); color: #b45309; }
.method-delete { background: rgba(239, 68, 68, .14); color: #dc2626; }
.method-patch  { background: rgba(20, 184, 166, .15); color: #0f766e; }

.api-ops {
    list-style: none;
    margin: 0;
    padding: 14px;
    border-radius: var(--dev-radius);
    background: var(--dev-soft);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-ops li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.api-ops li .method {
    flex: none;
    margin-top: 2px;
}

.api-ops li strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.api-ops li small {
    display: block;
    font-size: 12px;
    line-height: 1.6;
    color: var(--dev-text-soft);
}

.api-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    margin-top: auto;
    border-top: 1px solid var(--dev-border);
}

.api-count {
    font-size: 12.5px;
    color: #8fa0b8;
    font-weight: 600;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--dev-brand);
    text-decoration: none;
    transition: gap .25s, color .25s;
}

.btn-link:hover {
    gap: 11px;
    color: #4338ca;
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 80px 20px;
    text-align: center;
    color: var(--dev-text-soft);
}

.empty-state.show {
    display: flex;
}

.empty-state i {
    font-size: 34px;
    color: #c3cee0;
}

.empty-state p {
    font-size: 14px;
}

/* ================= 页脚 ================= */
.api-footer {
    margin-top: 84px;
    padding: 46px 24px;
    background: #0b1020;
    color: #8ea0b8;
}

.footer-content {
    max-width: 1240px;
    font-size: 13px;
    letter-spacing: .01em;
}

/* ================= 入场动画（无 JS 依赖，失败也不会隐藏内容） ================= */
@keyframes devFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-up {
    animation: devFadeUp .7s cubic-bezier(.2, .8, .2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .animate-up,
    .api-card,
    .mini-card,
    .btn,
    .btn-dark {
        animation: none !important;
        transition: none !important;
    }
}

/* ================= 响应式 ================= */
@media (max-width: 1024px) {
    .flow-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quickstart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dev-shell {
        padding: 24px 16px 16px;
    }

    .hero {
        padding: 48px 26px 40px;
        border-radius: 20px;
    }

    .hero-stats {
        gap: 26px;
    }

    .dev-section {
        margin-top: 56px;
    }

    .flow-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .dev-toolbar {
        position: static;
    }

    .api-grid {
        grid-template-columns: 1fr;
    }

    .cta-band {
        padding: 30px 24px;
        margin-top: 60px;
    }

    .api-footer {
        margin-top: 60px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 27px;
    }

    .hero p {
        font-size: 14.5px;
    }

    .btn,
    .btn-dark {
        width: 100%;
        justify-content: center;
    }

    .hero-actions .btn {
        flex: 1;
    }

    .api-card {
        padding: 20px;
    }
}
