/* csdoc.html — blog page aligned with site / Ke styles */

/* Match other pages: white main nav bar */
.header-bottom,
.header-bottom.is-sticky {
    background: #fff;
}

.cs-main {
    padding-bottom: 48px;
}

.cs-panel {
    padding-bottom: 28px;
}

/* Alias: csdoc 早期类名，样式已并入 ke.css 的 .ke-tabs-scroller */
.cs-tabs-scroller {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cs-tabs-viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.cs-tabs-viewport::before,
.cs-tabs-viewport::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cs-tabs-viewport::before {
    left: 0;
    background: linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0));
}

.cs-tabs-viewport::after {
    right: 0;
    background: linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0));
}

.cs-tabs-scroller.can-scroll-left .cs-tabs-viewport::before,
.cs-tabs-scroller.can-scroll-right .cs-tabs-viewport::after {
    opacity: 1;
}

.cs-tabs-arrow {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ke-line, #d9e4ea);
    border-radius: 999px;
    background: #fff;
    color: var(--ke-accent, #1f7a8c);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.cs-tabs-arrow svg {
    width: 16px;
    height: 16px;
}

.cs-tabs-arrow:hover {
    background: var(--ke-accent-soft, #d7eef2);
    border-color: #b7d4dc;
}

.cs-tabs-arrow:disabled {
    opacity: 0.35;
    cursor: default;
    background: #fff;
}

.cs-tabs-arrow[hidden] {
    display: none !important;
}

.cs-search-bar {
    background: #f8fbfc;
    border-bottom: 0;
    padding: 16px 0 12px;
    margin-bottom: 0;
}

.cs-search-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cs-search-bar .search-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.cs-search-bar .search-input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--ke-line, #d9e4ea);
    border-radius: 8px;
    background: #fff;
    color: var(--ke-text, #243447);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cs-search-bar .search-input::placeholder {
    color: #9aabba;
}

.cs-search-bar .search-input:focus {
    border-color: var(--ke-accent, #1f7a8c);
    box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.12);
}

.cs-search-bar .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #8aa0b2;
    pointer-events: none;
}

.cs-legend {
    flex-shrink: 0;
    color: var(--ke-muted, #6b7c8f);
    font-size: 13px;
}

.cs-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.icon-focus {
    width: 14px;
    height: 14px;
    color: var(--ke-feature, #fc7418);
}

.search-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--ke-line, #d9e4ea);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(36, 52, 71, 0.12);
    max-height: 420px;
    overflow-y: auto;
    z-index: 200;
}

.search-dropdown.is-open {
    display: block;
}

.suggest-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid #eef3f6;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--ke-text, #243447);
}

.suggest-item:last-child {
    border-bottom: 0;
}

.suggest-item:hover,
.suggest-item.is-active {
    background: var(--ke-accent-soft, #d7eef2);
}

.suggest-path {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ke-muted, #6b7c8f);
    font-size: 12px;
    margin-bottom: 2px;
}

.suggest-sep {
    opacity: 0.5;
}

.suggest-title {
    font-weight: 500;
}

.suggest-title mark,
.content-link-title mark,
.root-title mark {
    background: #fff3cd;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.suggest-empty,
.suggest-hint {
    padding: 12px 14px;
    color: var(--ke-muted, #6b7c8f);
    font-size: 13px;
}

.cs-panel .ke-tabs.cs-cat-tabs {
    margin: 0;
    padding: 0 0 16px;
    background: transparent;
    border-bottom: 0;
}

.cs-panel .ke-tabs-inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 12px 4px;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.cs-panel .ke-tabs-inner::-webkit-scrollbar {
    display: none;
}

.cs-panel .ke-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ke-muted, #6b7c8f);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.cs-panel .ke-tab:hover,
.cs-panel .ke-tab.is-active {
    background: var(--ke-accent-soft, #d7eef2);
    color: var(--ke-accent, #1f7a8c);
}

.cs-panel .ke-tab .cs-tab-count {
    display: inline-block;
    margin-left: 5px;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(31, 122, 140, 0.1);
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.cs-panel .ke-tab.is-active .cs-tab-count {
    background: rgba(31, 122, 140, 0.18);
}

.cs-tab-panel .ke-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cs-tab-panel .ke-section-head-main {
    min-width: 0;
    flex: 1 1 240px;
}

.cs-tab-panel .ke-section-head strong {
    color: var(--ke-accent, #1f7a8c);
}

.cs-range-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 0 0 auto;
}

.cs-range-btn {
    margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--ke-line, #d9e4ea);
    border-radius: 999px;
    background: #fff;
    color: var(--ke-muted, #6b7c8f);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cs-range-btn:hover {
    color: var(--ke-accent, #1f7a8c);
    border-color: #b7d4dc;
    background: #f7fbfc;
}

.cs-range-btn.is-active {
    background: var(--ke-accent-soft, #d7eef2);
    color: var(--ke-accent, #1f7a8c);
    border-color: #b7d4dc;
}

.cs-tree {
    padding-bottom: 8px;
}

.cs-tree .tree-empty {
    padding: 28px 0;
    text-align: center;
    line-height: 1.7;
}

.root-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 0 0 12px;
    padding: 0 0 8px;
    border: 0;
    border-bottom: 2px solid var(--ke-accent-soft, #d7eef2);
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    color: #1b2b3a;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease;
}

.root-title:hover {
    color: var(--ke-accent, #1f7a8c);
}

.root-title-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.root-toggle {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--ke-accent, #1f7a8c);
    transition: transform 0.2s ease;
}

.root-block.is-collapsed .root-toggle {
    transform: rotate(-90deg);
}

.root-block.is-collapsed .root-title {
    margin-bottom: 0;
}

.root-block.is-collapsed .root-body {
    display: none;
}

.root-count {
    color: var(--ke-muted, #6b7c8f);
    font-weight: 500;
    font-size: 13px;
}

.group-block {
    margin: 0 0 16px;
    padding-left: 2px;
}

.group-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1b2b3a;
}

.content-link.is-deprecated .content-link-title {
    color: #94a3b8;
    text-decoration: line-through;
}

.cs-legend-item + .cs-legend-item {
    margin-left: 14px;
}

.content-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ke-line, #d9e4ea);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.content-head,
.content-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px 110px;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
}

.content-grid.is-no-cat .content-head,
.content-grid.is-no-cat .content-link {
    grid-template-columns: minmax(0, 1fr) 110px;
}

.content-grid.is-title-only .content-head,
.content-grid.is-title-only .content-link {
    grid-template-columns: minmax(0, 1fr);
}

.content-grid.is-help-two-col .content-head,
.content-grid.is-help-two-col .content-link {
    grid-template-columns: minmax(0, 1fr) 160px;
}

.content-head {
    background: #f3f7f9;
    border-bottom: 1px solid var(--ke-line, #d9e4ea);
    color: var(--ke-muted, #6b7c8f);
    font-size: 13px;
    font-weight: 600;
}

.content-link {
    min-height: 48px;
    padding: 14px 18px;
    color: var(--ke-text, #243447) !important;
    text-decoration: none !important;
    border-bottom: 1px solid var(--ke-line, #d9e4ea);
    transition: background 0.2s ease;
}

.content-link:last-child {
    border-bottom: 0;
}

.content-link:hover {
    background: #f7fbfc;
}

.content-link.is-match {
    background: #f7fbfc;
}

.content-link-main {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.content-link-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.content-col-cat,
.content-col-date,
.content-link-cat,
.content-link-date {
    text-align: center;
}

.content-link-cat {
    font-size: 13px;
    color: var(--ke-muted, #6b7c8f);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-link-date {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--ke-muted, #6b7c8f);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tree-empty,
.cs-filter-tip {
    margin: 0 0 12px;
    color: var(--ke-muted, #6b7c8f);
    font-size: 13px;
}

.tree-empty {
    padding: 40px 0;
    text-align: center;
}

.cs-filter-tip strong {
    color: var(--ke-accent, #1f7a8c);
}

@media (max-width: 900px) {
    .cs-legend {
        display: none;
    }
}

@media (max-width: 640px) {
    .content-head {
        display: none;
    }

    .content-link,
    .content-grid.is-no-cat .content-link,
    .content-grid.is-title-only .content-link,
    .content-grid.is-help-two-col .content-link {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .content-link-cat,
    .content-link-date {
        text-align: left;
    }

    .content-link-cat::before {
        content: "类别：";
    }

    .content-link-date::before {
        content: "时间：";
    }

    .cs-tab-panel .ke-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .cs-range-bar {
        width: 100%;
    }
}
