:root {
    --app-sidebar-width: 0px;
    --app-header-height: 70px;
    --index-header-height: 70px;
}

.index-public-page .header-con {
    --index-header-height: 70px;
    min-height: 70px !important;
    height: 70px !important;
    padding: 0 !important;
    overflow: visible !important;
}

.index-public-page {
    background-color: #fdfdfd;
    overflow-x: hidden;
    max-width: 100%;
}

.index-public-page .header-con,
.index-public-page .footer-con,
.index-public-page .index-public-main {
    float: none !important;
    width: 100%;
}

.index-public-page .index-public-main {
    display: block;
    clear: both;
    position: relative;
    z-index: 1;
    margin-left: 0 !important;
    min-height: auto;
    padding: 0;
    background-color: #fdfdfd;
}

.index-public-page .wiki-toc-card {
    background: #fff;
}

.public-content-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .public-content-wrap {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.public-content-wrap--page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Wiki */
.wiki-page {
    padding-bottom: 3rem;
}

.wiki-banner {
    position: relative;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: 100vw;
    padding: 8rem 0;
    background:
        linear-gradient(90deg, rgba(0, 48, 140, 0.42) 0%, rgba(0, 48, 140, 0.12) 42%, transparent 68%),
        url(../public/wiki-banner.jpg) center/cover no-repeat;
    color: #fff;
    text-align: left;
}

.wiki-banner .container {
    width: 100%;
    max-width: 1417px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    display: flex;
    justify-content: flex-start;
}

.wiki-banner__inner {
    max-width: 560px;
    margin: 0;
    text-align: left;
}

.wiki-banner__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.wiki-banner__title-gradient {
    background: #fff;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.wiki-banner__title-rest {
    color: #fff;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.18);
}

.wiki-banner__desc {
    max-width: 520px;
    margin: 0;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

.wiki-layout {
    margin-top: 2rem;
}

.wiki-toc-card {
    position: sticky;
    top: calc(var(--app-header-height, 70px) + 1rem);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: #fff;
    overflow: hidden;
}

.wiki-toc-card__head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    font-size: 0.9375rem;
}

.wiki-toc-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0.75rem;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.wiki-toc-list li + li {
    margin-top: 0;
}

.wiki-toc-list__group {
    padding: 0.125rem 0;
}

.wiki-toc-list__group + .wiki-toc-list__group {
    margin-top: 0.125rem;
}

.wiki-toc-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: background-color 0.15s, color 0.15s;
}

.wiki-toc-list a:hover {
    color: var(--bs-primary);
}

.wiki-toc-list__article {
    font-weight: 600;
}

.wiki-toc-list__article:hover {
    background: rgba(var(--bs-primary-rgb), 0.05);
}

.wiki-toc-list__article.is-active {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.wiki-toc-list--sub {
    display: none;
    max-height: none;
    overflow: visible;
    margin: 0.25rem 0 0.375rem 0.875rem;
    padding: 0.125rem 0 0.125rem 0.875rem;
    border-left: 1px solid var(--bs-border-color);
}

.wiki-toc-list__group.is-expanded > .wiki-toc-list--sub {
    display: block;
}

.wiki-toc-list--sub a {
    padding: 0.35rem 0.5rem;
    font-weight: 400;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--bs-secondary-color);
    border-radius: 0.375rem;
}

.wiki-toc-list--sub a:hover {
    color: var(--bs-body-color);
    background: transparent;
}

.wiki-toc-list__sub--level-3 a {
    padding-left: 0.625rem;
}

.wiki-toc-list__sub--level-4 a {
    padding-left: 0.875rem;
}

.wiki-section {
    scroll-margin-top: calc(var(--app-header-height, 70px) + 1rem);
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    display: none;
}

.wiki-section.is-current {
    display: block;
}

.wiki-section__title-card {
    scroll-margin-top: calc(var(--app-header-height, 70px) + 1rem);
}

.wiki-section + .wiki-section {
    margin-top: 0;
}

.wiki-article-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}

.wiki-article-nav__btn {
    display: inline-flex;
    flex: 0 1 auto;
    width: auto;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: calc(25% - 0.5rem);
    padding: 0.75rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.625rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    font-size: 0.875rem;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.wiki-article-nav__btn--next {
    justify-content: flex-end;
    margin-left: auto;
}

.wiki-article-nav__icon {
    flex: 0 0 auto;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--bs-secondary-color);
}

.wiki-article-nav__text {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.wiki-article-nav__btn--next .wiki-article-nav__text {
    justify-content: flex-end;
}

.wiki-article-nav__label {
    flex: 0 0 auto;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.wiki-article-nav__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bs-body-color);
}

.wiki-article-nav__btn:hover:not(:disabled) {
    border-color: rgba(var(--bs-primary-rgb), 0.35);
    background: rgba(var(--bs-primary-rgb), 0.04);
}

.wiki-article-nav__btn:hover:not(:disabled) .wiki-article-nav__icon,
.wiki-article-nav__btn:hover:not(:disabled) .wiki-article-nav__label,
.wiki-article-nav__btn:hover:not(:disabled) .wiki-article-nav__title {
    color: var(--bs-primary);
}

.wiki-article-nav__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 767.98px) {
    .wiki-article-nav__btn {
        max-width: calc(50% - 0.5rem);
    }
}

.wiki-section__title-card {
    margin: 0 0 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.06) 0%, rgba(var(--bs-primary-rgb), 0.02) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wiki-section__title {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--bs-heading-color);
    line-height: 1.4;
}

.wiki-section__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

.wiki-section__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: rgb(107 114 128 / var(--tw-text-opacity, 1));
}

.wiki-section__meta-icon {
    font-size: 0.875rem;
    line-height: 1;
    color: var(--bs-primary);
}

.wiki-section__body {
    padding: 0 0 0.5rem;
    color: var(--bs-body-color);
    line-height: 1.8;
    font-size: 0.9375rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wiki-section__body > p,
.wiki-section__body > ul,
.wiki-section__body > ol {
    margin-bottom: 1rem;
}

.wiki-section__body > p:last-child,
.wiki-section__body > ul:last-child,
.wiki-section__body > ol:last-child {
    margin-bottom: 0;
}

.wiki-block {
    margin-bottom: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    scroll-margin-top: calc(var(--app-header-height, 70px) + 1.25rem);
}

.wiki-block:last-child {
    margin-bottom: 0;
}

.wiki-block__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wiki-block__icon {
    flex: 0 0 auto;
    font-size: 1.125rem;
    line-height: 1;
    color: rgba(var(--bs-primary-rgb), 0.85);
}

.wiki-block__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--bs-heading-color);
    scroll-margin-top: calc(var(--app-header-height, 70px) + 1rem);
}

.wiki-block--level-3 .wiki-block__title {
    font-size: 1rem;
}

.wiki-block--level-4 .wiki-block__title {
    font-size: 0.9375rem;
}

.wiki-block__divider {
    height: 1px;
    margin: 0.875rem 0 1rem;
    background: var(--bs-border-color);
}

.wiki-block__body {
    color: var(--bs-body-color);
    line-height: 1.85;
    font-size: 0.9375rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wiki-block__body p {
    margin-bottom: 0.875rem;
}

.wiki-block__body p:last-child {
    margin-bottom: 0;
}

.wiki-block__body a {
    color: var(--bs-primary);
    text-decoration: none;
}

.wiki-block__body a:hover {
    text-decoration: underline;
}

.wiki-section__body a {
    color: var(--bs-primary);
    text-decoration: none;
}

.wiki-section__body a:hover {
    text-decoration: underline;
}

/* 富文本表格：Bootstrap reboot 将 td/th border 置 0，需显式还原 */
.wiki-section__body table,
.wiki-block__body table {
    width: 100% !important;
    max-width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    border: 1px solid var(--bs-border-color);
    font-size: 0.875rem;
    line-height: 1.55;
    background: var(--bs-body-bg);
}

.wiki-section__body th,
.wiki-section__body td,
.wiki-block__body th,
.wiki-block__body td {
    border: 1px solid var(--bs-border-color) !important;
    padding: 0.55rem 0.75rem;
    vertical-align: top;
    word-break: break-word;
}

.wiki-section__body th,
.wiki-block__body th,
.wiki-section__body tr:first-child td,
.wiki-block__body tr:first-child td {
    background: rgba(var(--bs-primary-rgb), 0.06);
    font-weight: 600;
    color: var(--bs-heading-color);
}

@media (max-width: 991.98px) {
    .wiki-toc-card {
        position: static;
        max-height: none;
        margin-bottom: 1.25rem;
    }

    .wiki-toc-list {
        max-height: none;
    }
}
