@font-face {
    font-family: 'LiciumFont2022';
    src: url('./LiciumFont2022-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'LiciumFont2022';
    src: url('./LiciumFont2022-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'LiciumFont2022';
    src: url('./LiciumFont2022-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

html,
body {
    background: #fff;
}
* {
    touch-action: manipulation;
}

.icon {
    font-family: 'iconfont' !important;
    font-style: normal;
    /* line-height: 1; */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
    vertical-align: middle;
}

:root {
    font-size: calc(14px);
    --content-padding: 20px;
    --max-width: 100%;
    --icon-color: #8e8e93;
    --border-color: #eee;
    --header-height: 0px; /* 如果header隐藏，那么这里设置为0 */
}

.header {
    display: none !important;
}

body {
    font-family: 'LiciumFont2022', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* 标题栏 */
.header {
    background-color: #fff;
    color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px var(--content-padding);
    width: 100%;
    max-width: var(--max-width);
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0 auto;
}

.header a.back-button {
    color: rgba(0, 0, 0, 0.9);
    text-decoration: none !important;
    font-size: 2rem;
    display: flex;
    align-items: center;
    width: 24px;
    height: 24px;
    justify-content: center;
}

.header h2 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
    font-size: 1.143rem;
    padding: 0 10px;
    font-weight: 500;
    line-height: 1.714rem;
}

.header .spacer {
    width: 24px;
}

/* 内容区域 */
.content {
    padding: var(--content-padding);
    width: 100%;
    max-width: var(--max-width);
    box-sizing: border-box;
    margin: 0 auto;
}

/* 搜索框 */
.search-wrapper {
    width: calc(100% - 2 * var(--content-padding));
    max-width: var(--max-width);
    display: flex;
    align-items: center;
    height: 3.14285rem;
    margin: 0rem auto 0;
    box-sizing: border-box;
    position: sticky;
    top: var(--header-height);
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(248, 248, 248, 1);
    border-radius: 100px;
    padding: 0 0.75rem;
    height: 2.57rem;
}

/* 目录列表 */
.directory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.directory-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15.7px 0;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.5714rem;
}

.directory-list li a {
    flex-grow: 1;
    color: #000;
    text-decoration: none;
}

/* 箭头图标 */
.arrow-icon {
    color: var(--icon-color);
    font-size: 1.42rem;
    /* width: 24px;
    height: 24px; */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 返回按钮 */
/* #back-button {
    display: flex;
    align-items: center;
    padding: 10.6px 0;
    margin: 0;
    width: 100%;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0px;
    z-index: 99;
    background: white;
    line-height:1.5714rem;
} */

#back-button {
    display: flex;
    align-items: flex-end;
    padding: 0;
    margin: 0;
    width: 100%;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0px;
    z-index: 99;
    background: white;
    line-height: 1.5714rem;
    height: 70px;
}

#back-button span {
    padding-bottom: 1.1428rem;
}

#back-button .icon {
    color: var(--icon-color);
    font-size: 1.42rem;
    vertical-align: middle;
}

/* 详情页专用 */
body > .content {
    padding: var(--content-padding);
    padding-top: 0rem;
    max-width: var(--max-width);
    margin: 0 auto;
    max-height: calc(100vh - var(--content-padding));
    overflow: auto;
}

#back-button:hover,
.directory-list li:hover {
    background-color: #f5f5f5;
}

.search-icon {
    /* width: 1.75rem;
    height: 1.75rem; */
    margin-right: 0.5rem;
    font-size: 1.75rem;
    color: rgba(198, 198, 199, 1);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: #000;
    padding: 0.7rem 0;
}

::placeholder {
    color: rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.clear-btn {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: rgba(198, 198, 199, 1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.search-input:not(:placeholder-shown) + .clear-btn {
    opacity: 1;
}

.cancel-btn {
    color: rgba(0, 0, 0, 0.6);
    font-size: 1.14rem;
    margin-left: 0.75rem;
    display: none;
    white-space: nowrap;
    background: transparent;
    border: none;
    padding: 0.25rem 0;
    cursor: pointer;
}

.highlight {
    background-color: yellow;
}

#search-results {
    color: black;
    margin: 0;
    padding: 0;
    list-style-type: none;
    overflow-x: hidden;
}

#search-results li {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    padding-bottom: 10px;
}

#search-results p {
    margin: 5px 0px 0px 0px;
    padding: 0;
}

.search-result-title {
    font-size: 1rem;
    font-weight: bold;
    color: rgb(0, 114, 109);
    margin: 0;
    padding-bottom: 0px;
}

@media (max-width: 375px) {
    :root {
        --content-padding: 12px;
    }

    .header {
        padding: 8px var(--content-padding);
    }
}

/* 标签页样式 */
.tab-nav {
    display: flex;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    position: sticky;
    top: 88px;
    z-index: 90;
    color: rgba(0, 0, 0, 0.9);
}

.tab-btn {
    /* flex: 1;
    padding: 10px 0; */
    margin: 18px 20px 0px 20px;
    background: none;
    border: none;
    font-size: 1.143rem;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    position: relative;
    line-height: 1.5;
    /* button需要强制，不然浏览器可能会用别的字体，而不是继承body的 */
    font-family: 'LiciumFont2022', sans-serif;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 标签页样式 */
.tab-nav-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    background-color: #fff;
    position: sticky;
    top: calc(44px + var(--header-height)); /* 根据header和search高度调整 */
    padding: 0 var(--content-padding);
    box-sizing: border-box;
}

.tab-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px; /* 为滚动条留空间 */
    margin: 18px 0 0;
    scroll-padding: 0 var(--content-padding);
}

/* 隐藏滚动条 */
.tab-nav::-webkit-scrollbar {
    display: none;
}

/* 标签按钮样式 */
.tab-btn {
    flex: 0 0 auto;
    background: none;
    border: none;
    font-size: 1.143rem;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    position: relative;
    line-height: 1.5;
    font-family: 'LiciumFont2022', sans-serif;
    padding: 0 20px;
    margin: 0;
}

.tab-btn:first-child {
    padding-left: 0;
}

.tab-btn:last-child {
    padding-right: 0;
}

.tab-btn.active {
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
}

/*        .tab-btn.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 12%;
            right: 12%;
            height: 2px;
            background-color: rgba(5, 117, 104, 1);
        }*/

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 25px;
    right: 25px;
    height: 2px;
    background-color: rgba(5, 117, 104, 1);
}

/* 添加右侧填充确保最后一个标签后有空间 */
.tab-nav::after {
    content: '';
    display: inline-block;
    width: var(--content-padding);
    height: 1px;
}

@media (max-width: 375px) {
    .tab-btn {
        font-size: 1rem;
        padding: 0 15px;
    }

    .tab-btn.active::after {
        left: 15%;
        right: 15%;
    }
}

.tab-btn:first-child.active::after {
    margin-left: -20px;
}

.tab-btn:last-child.active::after {
    margin-right: -20px;
}

/* 目录滚动的问题 */

.content.menu-content {
    margin-top: 0rem;
    height: calc(100vh - 132px); /* 视口高度 - 所有固定元素高度 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding-top: 0px;
}

.content.menu-content.level1 {
    margin-top: 1.1428rem !important;
}
