@charset "UTF-8";
/*!
 * api.css —— API 开放文档页样式（延续首页的圆角 / 红色点缀 / 黄色装饰风格）
 */

.api-wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 26px 16px 10px;
}

/* ---------------- 头部 ---------------- */
.api-hero {
    position: relative;
    padding: 30px 26px 26px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.api-hero:after {
    content: "";
    position: absolute;
    left: -10%;
    bottom: -86px;
    width: 120%;
    height: 140px;
    background: var(--c-yellow);
    border-radius: 50%;
    pointer-events: none;
}

.api-hero > * {
    position: relative;
    z-index: 1;
}

.api-hero h1 {
    display: inline-block;
    font-size: 24px;
    font-weight: 900;
}

.api-hero h1:before {
    content: "";
    position: absolute;
    left: -5px;
    bottom: 4px;
    width: 74px;
    height: 14px;
    background: var(--c-pink);
    border-radius: 4px;
    transform: skewX(-15deg);
    z-index: -1;
}

.api-hero p {
    margin-top: 10px;
    color: #5b6373;
}

.api-hero .base-url {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--c-red-deep);
    word-break: break-all;
    background: var(--c-field);
    border-radius: 10px;
}

/* ---------------- 卡片 ---------------- */
.api-card {
    padding: 22px 24px;
    margin-bottom: 18px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.api-card > h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 900;
}

.api-card > h2 .idx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--c-red), var(--c-red-deep));
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(255, 78, 78, .3);
}

.api-card > p,
.api-card .muted {
    margin-top: 10px;
    color: #5b6373;
    font-size: 14px;
}

.api-card code {
    padding: 2px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--c-red-deep);
    background: #fff1f1;
    border-radius: 5px;
    word-break: break-all;
}

/* ---------------- 端点列表 ---------------- */
.endpoint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--c-line);
}

.endpoint:first-of-type {
    border-top: none;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    border-radius: 999px;
    letter-spacing: .5px;
}

.badge.get {
    background: linear-gradient(135deg, #34c38f, #1d9e72);
}

.badge.post {
    background: linear-gradient(135deg, #ff9f43, #f07216);
}

.badge.path {
    color: var(--c-red-deep);
    background: #fff1f1;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
}

.endpoint .desc {
    flex: 1 1 100%;
    color: #5b6373;
    font-size: 14px;
}

/* ---------------- 表格 ---------------- */
.table-scroll {
    margin-top: 14px;
    overflow-x: auto;
}

.api-table {
    width: 100%;
    min-width: 460px;
    border-collapse: collapse;
    font-size: 14px;
}

.api-table th,
.api-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--c-line);
}

.api-table th {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.api-table td:first-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--c-red-deep);
    white-space: nowrap;
}

.api-table tr:last-child td {
    border-bottom: none;
}

/* ---------------- 代码块 ---------------- */
.code-block {
    position: relative;
    margin-top: 14px;
}

.code-block pre {
    padding: 14px 16px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #e6edf3;
    background: #21252e;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

.code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 12px;
    color: #cfd6e4;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    transition: background-color .25s, color .25s;
}

.code-copy:hover {
    color: #fff;
    background: rgba(255, 78, 78, .75);
}

/* 代码示例切换 */
.tabs {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.tab {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #5b6373;
    background: var(--c-field);
    border-radius: 999px;
    transition: color .25s, background-color .25s;
}

.tab:hover {
    color: var(--c-red-deep);
}

.tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--c-red), var(--c-red-deep));
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

/* ---------------- 在线调试面板 ---------------- */
.try-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.try-form select,
.try-form input {
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--c-text);
    background: var(--c-field);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: border-color .25s, background-color .25s;
}

.try-form select:focus,
.try-form input:focus {
    background: #fff;
    border-color: var(--c-red);
}

.try-form select {
    min-width: 130px;
}

.try-form input[type="date"] {
    min-width: 150px;
}

.btn-primary {
    height: 40px;
    padding: 0 22px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--c-red), var(--c-red-deep));
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(255, 78, 78, .3);
    transition: transform .2s, box-shadow .2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(255, 78, 78, .38);
}

.btn-primary:active {
    transform: translateY(0);
}

.try-out {
    margin-top: 14px;
}

.try-out pre {
    max-height: 320px;
    overflow: auto;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #cfe3d4;
    white-space: pre-wrap;
    word-break: break-all;
    background: #21252e;
    border-radius: 12px;
}

.api-foot {
    padding: 6px 0 26px;
    text-align: center;
    font-size: 13px;
    color: #7b8290;
}

/* ---------------- 手机端 ---------------- */
@media (max-width: 700px) {
    .api-wrap {
        padding: 12px 12px 10px;
    }

    .api-hero {
        padding: 22px 18px 20px;
    }

    .api-hero h1 {
        font-size: 21px;
    }

    .api-card {
        padding: 18px 16px;
    }

    .api-card > h2 {
        font-size: 16px;
    }

    .try-form > * {
        flex: 1 1 100%;
    }

    .try-form .btn-primary {
        flex: 1 1 100%;
    }

    .api-foot {
        padding-bottom: 20px;
    }
}
