/* 智兔 API 文档：左侧「搜索 + 分类」一体卡片 */

.api-doc-page {
    margin-bottom: 2rem;
}

.api-doc-side-card {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 110px);
    background: #ffffff;
    border: 1px solid #e8eef5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(35, 55, 85, 0.04);
}

/* 搜索区 = 卡片顶栏（贴边一体，背景恒定） */
.api-doc-search-head {
    position: relative;
    flex: 0 0 auto;
    z-index: 3;
    display: flex;
    align-items: stretch;
    height: 48px;
    margin: 0;
    padding: 0;
    background: #edf5ff;
    border-bottom: 1px solid #d6e6fb;
}

.api-doc-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 12px;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 13px;
    line-height: 1.4;
    color: #232323;
    -webkit-appearance: none;
    appearance: none;
}

.api-doc-search-input::placeholder {
    color: #9aabbc;
}

.api-doc-search-input::-webkit-search-decoration,
.api-doc-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* 搜索按钮在右侧，贴合顶栏 */
.api-doc-search-btn {
    flex: 0 0 48px;
    width: 48px;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid #d6e6fb;
    border-radius: 0;
    background: #edf5ff;
    color: #437eeb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.api-doc-search-btn:hover {
    color: #ffffff;
    background: #437eeb;
}

.api-doc-search-btn .fa {
    font-size: 15px;
    line-height: 1;
}

.api-doc-search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1100;
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e8eef5;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(35, 55, 85, 0.14);
    max-height: 300px;
    min-width: 100%;
}

@media (min-width: 768px) {
    .api-doc-search-dropdown {
        width: 320px;
        right: auto;
    }
}

.api-doc-search-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #f0f4f8;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.api-doc-search-item:last-child {
    border-bottom: 0;
}

.api-doc-search-item:hover,
.api-doc-search-item.is-active {
    background: #edf5ff;
}

.api-doc-search-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #232323;
    line-height: 1.35;
}

.api-doc-search-item-meta {
    margin-top: 3px;
    font-size: 11px;
    color: #7a8da3;
    line-height: 1.45;
    word-break: break-all;
}

.api-doc-search-item:hover .api-doc-search-item-name,
.api-doc-search-item.is-active .api-doc-search-item-name {
    color: #437eeb;
}

.api-doc-search-empty {
    padding: 12px;
    font-size: 12px;
    color: #7a8da3;
    text-align: center;
}

.api-doc-nav {
    flex: 1 1 auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.api-doc-nav .list-group-item {
    border-left: 0;
    border-right: 0;
    border-color: #eef2f7;
    font-size: 14px;
    padding: 0.7rem 1rem;
    border-radius: 0 !important;
}

.api-doc-nav .list-group-item:first-child {
    border-top: 0;
}

.api-doc-nav .list-group-item:last-child {
    border-bottom: 0;
}

.api-doc-section {
    scroll-margin-top: 96px;
}

.api-doc-section.is-highlight {
    animation: apiDocFlash 1.5s ease;
    border-radius: 6px;
}

@keyframes apiDocFlash {
    0% { background: #edf5ff; }
    100% { background: transparent; }
}

@media (max-width: 767px) {
    .api-doc-side-card {
        position: static;
        max-height: none;
    }

    .api-doc-search-dropdown {
        width: auto;
        left: 0;
        right: 0;
    }
}
