/**
 * 帮助中心 / API 文档 Hub 样式
 */

.help-hub-page {
    background: #f5f7fa;
    min-height: 100%;
    /* 顶栏留白放在 hero 内，避免头部与内容之间出现白条 */
    padding-top: 0;
    margin-top: 0;
}

/* Hero：参考 HOME 帮助中心深色背景图 */
.hub-hero {
    position: relative;
    box-sizing: border-box;
    min-height: calc(300px + var(--plat-nav-h, 95px));
    padding-top: var(--plat-nav-h, 95px);
    padding-bottom: 32px;
    background-color: #131720;
    background-image: url('/static/home/images/help/help-hero-bg.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.hub-hero .container {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hub-hero--docs {
    background-color: #131720;
    background-image: url('/static/home/images/help/docs-hero-bg.png');
}

.hub-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(19, 23, 32, 0.15) 0%, rgba(19, 23, 32, 0.35) 100%);
    pointer-events: none;
}

.hub-hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 56px;
}

.hub-hero-title {
    font-size: 40px;
    font-weight: 400;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.3;
}

.hub-hero-desc {
    font-size: 16px;
    color: rgba(255,255,255,0.88);
    margin: 0 0 28px;
    line-height: 1.6;
}

/* Search */
.hub-search-box {
    max-width: 640px;
    margin: 0 auto 16px;
}

.hub-search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    gap: 8px;
}

.hub-search-icon {
    flex-shrink: 0;
    color: #86909c;
}

.hub-search-input {
    flex: 1;
    height: 44px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #1f2329;
    background: transparent;
}

.hub-search-btn {
    height: 44px;
    padding: 0 24px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hub-hot-keywords {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.hub-hot-label {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
}

.hub-keyword-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.95);
    border-radius: 14px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s;
}

.hub-keyword-tag:hover {
    background: rgba(255,255,255,0.28);
    color: #fff;
}

/* Tabs */
.hub-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 4px;
    max-width: 560px;
    margin: 0 auto;
}

.hub-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
    white-space: nowrap;
}

.hub-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.hub-tab.is-active {
    background: #fff;
    color: #0052d9;
    font-weight: 500;
}

.hub-hero--docs .hub-tab.is-active {
    color: #0f3460;
}

/* Hub body */
.hub-body {
    padding: 24px 0 48px;
}

.hub-section {
    margin-bottom: 32px;
}

.hub-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2329;
    margin: 0 0 20px;
}

.hub-section-desc {
    font-size: 14px;
    color: #86909c;
    margin: -12px 0 20px;
}

/* Cards grid */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.hub-grid--4 {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.hub-grid--6 {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.hub-card {
    background: #fff;
    border-radius: 2px;
    border: 1px solid #e5e8ed;
    box-shadow: 0 2px 4px rgba(3, 27, 78, 0.06);
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.hub-card:hover {
    box-shadow: 0 4px 16px rgba(0,82,217,0.12);
    transform: translateY(-2px);
}

.hub-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f3ff;
    color: #0052d9;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 22px;
}

.hub-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2329;
    margin: 0 0 6px;
}

.hub-card-desc {
    font-size: 13px;
    color: #86909c;
    margin: 0;
    line-height: 1.5;
}

.hub-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 12px;
    color: #86909c;
}

.hub-card-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f3ff;
    color: #0052d9;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

/* Service grid */
.hub-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.hub-service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: #fff;
    border-radius: 2px;
    border: 1px solid #e5e8ed;
    box-shadow: 0 2px 4px rgba(3, 27, 78, 0.06);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.hub-service-item:hover {
    box-shadow: 0 4px 12px rgba(0,82,217,0.12);
    transform: translateY(-2px);
}

.hub-service-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f3ff;
    color: #0052d9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.hub-service-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2329;
    text-align: center;
}

.hub-service-desc {
    font-size: 12px;
    color: #86909c;
    text-align: center;
    margin-top: 4px;
}

/* Two-column layout */
.hub-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.hub-layout-main {
    flex: 1;
    min-width: 0;
}

.hub-layout-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin-bottom: 16px;
}

/* Sidebar */
.hub-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.hub-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.hub-sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2329;
}

.hub-sidebar-close {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #86909c;
}

.hub-sidebar-nav {
    padding: 8px;
}

.hub-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s;
}

.hub-sidebar-link:hover {
    background: #f5f5f5;
    color: #0052d9;
}

.hub-sidebar-link.is-active {
    background: #e8f3ff;
    color: #0052d9;
    font-weight: 500;
}

.hub-sidebar-count {
    font-style: normal;
    font-size: 12px;
    color: #86909c;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 10px;
}

.hub-sidebar-link.is-active .hub-sidebar-count {
    background: rgba(0,82,217,0.15);
    color: #0052d9;
}

/* Content panel */
.hub-panel {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    padding: 24px;
}

.hub-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #86909c;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hub-breadcrumb a {
    color: #0052d9;
    text-decoration: none;
}

.hub-breadcrumb a:hover {
    text-decoration: underline;
}

.hub-breadcrumb-sep {
    color: #c9cdd4;
}

/* Article list */
.hub-article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hub-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.hub-article-item:hover {
    background: #fff;
    border-color: rgba(0,82,217,0.2);
    box-shadow: 0 2px 8px rgba(0,82,217,0.08);
}

.hub-article-item-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 6px;
}

.hub-article-item-title a {
    color: #1f2329;
    text-decoration: none;
}

.hub-article-item-title a:hover {
    color: #0052d9;
}

.hub-article-item-summary {
    font-size: 13px;
    color: #86909c;
    margin: 0 0 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hub-article-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #86909c;
}

/* Detail layout */
.hub-detail-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.hub-detail-main {
    flex: 1;
    min-width: 0;
}

.hub-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2329;
    margin: 0 0 16px;
    line-height: 1.4;
}

.hub-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #86909c;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

/* TOC */
.hub-toc {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    padding: 16px;
}

.hub-toc-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.hub-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hub-toc-link {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 2px solid transparent;
    line-height: 1.4;
    transition: all 0.15s;
}

.hub-toc-link:hover {
    color: #0052d9;
    background: #f5f7fa;
}

.hub-toc-link.is-active {
    color: #0052d9;
    border-left-color: #0052d9;
    background: #e8f3ff;
    font-weight: 500;
}

.hub-toc-level-3 {
    padding-left: 20px;
    font-size: 12px;
}

/* Adjacent nav */
.hub-adjacent {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.hub-adjacent-item {
    flex: 1;
    max-width: 48%;
}

.hub-adjacent-label {
    font-size: 12px;
    color: #86909c;
    margin-bottom: 6px;
}

.hub-adjacent-link {
    font-size: 14px;
    color: #0052d9;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-adjacent-link:hover {
    text-decoration: underline;
}

.hub-adjacent-item--next {
    text-align: right;
}

/* API docs code style */
.hub-hero--docs + .hub-body .article-body pre,
.docs-page .article-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.docs-page .article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.docs-page .article-body code {
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
}

/* Quick start (API) */
.hub-quickstart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.hub-quickstart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.hub-quickstart-item:hover {
    box-shadow: 0 4px 12px rgba(0,82,217,0.12);
    transform: translateY(-1px);
}

.hub-quickstart-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    color: #fff;
    border-radius: 8px;
    font-size: 18px;
    flex-shrink: 0;
}

.hub-quickstart-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2329;
}

/* Search results */
.hub-results-header {
    margin-bottom: 20px;
}

.hub-results-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2329;
    margin: 0 0 8px;
}

.hub-results-count {
    font-size: 13px;
    color: #86909c;
}

.hub-results-count strong {
    color: #0052d9;
}

.hub-keyword-highlight {
    color: #0052d9;
}

/* Empty state */
.hub-empty {
    text-align: center;
    padding: 60px 20px;
}

.hub-empty-icon {
    font-size: 48px;
    opacity: 0.4;
    margin-bottom: 16px;
}

.hub-empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #1f2329;
    margin-bottom: 8px;
}

.hub-empty-text {
    font-size: 13px;
    color: #86909c;
    margin-bottom: 24px;
}

/* Feedback */
.hub-feedback {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.hub-feedback-title {
    font-size: 16px;
    font-weight: 500;
    color: #1f2329;
    margin-bottom: 16px;
}

.hub-feedback textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    font-family: inherit;
}

.hub-feedback textarea:focus {
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0,82,217,0.1);
}

.hub-feedback-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.hub-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* 产品文档双栏布局 */
.hub-product-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.hub-product-nav {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    padding: 12px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.hub-product-nav-title {
    font-size: 13px;
    font-weight: 600;
    color: #86909c;
    padding: 8px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hub-product-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.hub-product-nav-item:hover {
    background: #f5f5f5;
    color: #0052d9;
}

.hub-product-nav-item.is-active {
    background: #e8f3ff;
    color: #0052d9;
    font-weight: 500;
}

.hub-product-nav-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.hub-product-nav-name {
    line-height: 1.4;
}

.hub-product-main {
    flex: 1;
    min-width: 0;
}

.hub-product-main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.hub-section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.hub-section-header-row .hub-section-title {
    margin-bottom: 0;
}

.hub-section-more {
    font-size: 13px;
    color: #0052d9;
    text-decoration: none;
}

.hub-section-more:hover {
    text-decoration: underline;
}

/* 文档紧凑列表 */
.hub-doc-table {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.hub-doc-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.hub-doc-row:last-child {
    border-bottom: none;
}

.hub-doc-row:hover {
    background: #f5f7fa;
}

.hub-doc-row-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1f2329;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-doc-row:hover .hub-doc-row-title {
    color: #0052d9;
}

.hub-doc-row-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    font-size: 12px;
    color: #86909c;
}

.hub-doc-row-views {
    white-space: nowrap;
}

.hub-doc-row-summary {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #86909c;
}

.hub-doc-row-arrow {
    flex-shrink: 0;
    color: #c9cdd4;
    transition: transform 0.15s, color 0.15s;
}

.hub-doc-row:hover .hub-doc-row-arrow {
    color: #0052d9;
    transform: translateX(2px);
}

/* Overlay */
.hub-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1999;
}

.hub-sidebar-overlay.is-visible {
    display: block;
}

/* Fade in */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s, transform 0.5s;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .hub-toc {
        display: none;
    }

    .hub-detail-layout {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .hub-hero {
        min-height: calc(240px + var(--plat-nav-h, 55px));
        padding-top: var(--plat-nav-h, 55px);
        padding-bottom: 24px;
    }

    .hub-hero-inner {
        padding-top: 40px;
    }

    .hub-hero-title {
        font-size: 28px;
    }

    .hub-search-form {
        flex-wrap: wrap;
        padding: 8px;
    }

    .hub-search-input {
        width: 100%;
        flex: none;
    }

    .hub-search-btn {
        width: 100%;
    }

    .hub-tabs {
        max-width: 100%;
    }

    .hub-tab {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 60px;
    }

    .hub-layout-toggle {
        display: inline-flex;
    }

    .hub-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 2000;
        width: 280px;
        max-height: 100vh;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .hub-sidebar.is-open {
        transform: translateX(0);
    }

    .hub-sidebar-close {
        display: block;
    }

    .hub-layout {
        flex-direction: column;
    }

    .hub-article-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .hub-adjacent {
        flex-direction: column;
    }

    .hub-adjacent-item {
        max-width: 100%;
    }

    .hub-adjacent-item--next {
        text-align: left;
    }

    .hub-product-layout {
        flex-direction: column;
    }

    .hub-product-nav {
        width: 100%;
        position: static;
        max-height: none;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .hub-product-nav-title {
        display: none;
    }

    .hub-product-nav-item {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 14px;
        border: 1px solid #f0f0f0;
    }

    .hub-product-nav-item.is-active {
        border-color: #0052d9;
    }

    .hub-doc-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hub-doc-row-meta {
        width: 100%;
        order: 3;
    }

    .hub-doc-row-summary {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hub-grid--6 {
        grid-template-columns: repeat(2, 1fr);
    }
}
