:root {
    --primary-color: #FFD700;
    /* 主颜色 */
    --btn-color: #3e13af;
    /* 按钮颜色 */
    --secondary-color: #2ecc71;
    /* 绿色 */
    --text-color: #333333;
    /* 文字颜色 */
    --background-color: #f4f4f4;
    /* 背景颜色 */
}

html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
}

/* 侧边栏样式 */
.sidebar {
    height: 100%;
    width: 25%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    padding: 1rem;
    transition: all 0.3s;
}

.sidebar .nav-link {
    color: #fff;
}

.sidebar .nav-link:hover {
    color: #ddd;
}

.sidebar .nav-item {
    margin-bottom: 15px;
}

.top-nav-bg {
    background-color: var(--primary-color) !important;
}

/* 页面主体内容 */
.content {
    min-height: 100%;
    margin-left: 25%;
    /* 给侧边栏留出空间 */
    padding: 1rem;
}

/* 在小屏幕时隐藏左侧菜单，顶部导航栏代替 */
@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
    }
}

a {
    text-decoration: none;
}

.home-left-column {
    display: flex;
    /* 启用 flexbox 布局 */
    flex-direction: column;
    /* 使子元素垂直排列 */
    justify-content: space-between;
    /* 在容器中使内容分布在顶部和底部 */
    height: 100%;
    /* 使容器占满父元素的高度 */
}

.home-left-column .title {
    text-align: center;
    padding: 20px;
    margin: 0;
    /* 去除默认的 margin 使标题紧贴顶部 */
}

.vertical-text {
    writing-mode: vertical-rl;
    /* 竖向排列，右到左 */
    text-align: center;
    /* 文本居中对齐 */
    display: inline-block;
    /* 确保它是行内块级元素 */
    font-size: 4rem;
    color: #000;
    letter-spacing: 0.2em;
    /* 设置字间距 */
    white-space: nowrap;
    /* 防止文本换行 */
}

.logo {
    margin-top: auto;
    /* 使图片保持在容器的底部 */
    margin: auto;
}

canvas {
    display: block;
}

.container {
    height: 100vh;
}

.left-column {
    background-color: var(--primary-color);
}

/* Ensure the upper part has proper height */
.upper-part {
    height: 30vh;
    /* 30% of the viewport height */
}

.main-part {
    height: 70vh;
    /* 70% of the viewport height */
    overflow: auto;
}

.main-title {
    font-weight: bold;
    letter-spacing: .25rem;
    padding: .5rem;
    /* border-bottom: .3rem solid var(--primary-color); */
    max-width: 100%;
    display: inline-block;
    white-space: nowrap;
    overflow-x: auto;
    text-overflow: ellipsis;
}

.main-title-no-border {
    font-weight: bold;
    letter-spacing: .25rem;
}

/* 搜索结果列表 */
ul {
    list-style-type: none;
    padding-left: 0;
}

.search-results h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #495057;
}

.search-results h3,
.search-results h4 {
    color: #495057;
}

.search-results .h6 {
    font-size: 1.2rem;
}

.sentence {
    cursor: pointer;
    font-size: 1.1rem;
    font-family: Arial, Helvetica, sans-serif;
    color: #495057;
}

.sentence:hover {
    font-weight: bold;
    color: #000;
}

.sentence-content {
    /* 设置行高 - 推荐1.5-2倍字体大小 */
    line-height: 2;
    
    /* 添加段落间距 */
    /* margin-bottom: 1.5em; */
    
    /* 确保元素作为块级元素显示 */
    display: block;
}

.srt {
    cursor: pointer;
    font-size: 1.1rem;
    font-family: Arial, Helvetica, sans-serif;
    color: #495057;
    line-height: 2;
}

.srt:hover {
    font-weight: bold;
    color: #000;
}

.srt-start-time {
    min-width: 4rem;
}

.gap-separator {
    list-style: none;
    color: #999;
    position: relative;
}

.gap-separator-srt {
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    color: #495057;
}

.gap-separator-start-time {
    display: inline-block;
    min-width: 4rem;
}

/* 当 srt 元素被悬停时，srt-start-time 也会触发 hover 样式 */
.srt:hover .srt-start-time {
    background-color: var(--primary-color);
    color: #fff;
    margin-top: -0.25em !important;
    padding-top: 0.25em !important;
    margin-bottom: -0.25em !important;
    padding-bottom: 0.25em !important;
}

@supports not (text-decoration-style: solid) {
    .highlight {
        text-decoration-line: underline;
        text-decoration-style: solid;
        text-decoration-color: var(--primary-color);
        text-decoration-thickness: 4px;
        margin: 0 5px;
    }

    /* 使用 border-bottom 模拟下划线 */
    .highlight {
        display: inline;
        border-bottom: 4px solid #ffd700;
        text-decoration: none;
        position: relative;
    }

    /* 使用伪元素创建波浪效果 */
    /* .highlight:after {
        content: "";
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 100%;
        height: 2px;
        background: repeating-linear-gradient(90deg, #ffd700 0%, #ffd700 5%, transparent 5%, transparent 10%);
        animation: wave 1.5s ease-in-out infinite;
    } */

    @keyframes wave {
        0% {
            background-position: 0;
        }

        100% {
            background-position: 100%;
        }
    }
}

@supports (text-decoration-style: solid) {
    .highlight {
        /* 设置波浪线和颜色 */
        text-decoration-line: underline;
        text-decoration-style: solid;
        text-decoration-color: var(--primary-color);
        text-decoration-thickness: 4px;
        /* 调整波浪线的厚度 */
        margin: 0 5px;
    }
}

em {
    background-color: var(--primary-color);
    text-decoration: underline;
    margin: 0 5px;
}

/* 双下划线样式 */
.double-underline {
    position: relative;
    display: inline-block;
    font-size: 20px;
    /* 设置字体大小 */
}

.double-underline::before,
.double-underline::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    /* 下划线的宽度与文字一致 */
    height: 1px;
    /* 下划线的厚度 */
    background-color: black;
    /* 下划线的颜色 */
}

.double-underline::before {
    bottom: 0;
    /* 第一条下划线紧挨文字的底部 */
}

.double-underline::after {
    bottom: -4px;
    /* 设置与文字之间的距离 */
}

/* 文章内容区域 */
.article-content {
    overflow-y: auto;
    /* 只对文章内容区域启用滚动条 */
    padding: 20px;
}

.p {
    margin-bottom: 5px !important;
    display: inline-block;
    /* 使 p 标签的宽度根据内容自动调整 */
}

/* 优化高亮部分 */
.highlight-text {
    background-color: var(--primary-color);
    padding: 0 5px;
    font-weight: bold;
}

.no-results {
    font-size: 18px;
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .left-column {
        display: none;
    }

    .col-10 {
        padding: 20px;
    }

    h2 {
        font-size: 20px;
    }
}

.hot-search-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /* 每个项之间的间距 */
}

.hot-search-item,
.group-list {
    display: block;
    margin-right: 10px;
    /* 右边的间距 */
    color: #007bff;
    /* 设置链接颜色 */
    text-decoration: none;
    /* 去掉下划线 */
}

.hot-search-list a:not(:last-child)::after {
    content: "；"
}

.more-info {
    font-style: italic;
    color: gray;
}

.introduction {
    padding: 1rem 2rem;
}

.select-regular {
    cursor: pointer;
    padding-right: 1em;
    max-width: 100%;
    color: #fff;
    background-image: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMDAnIGhlaWdodD0nMjAwJz48cGF0aCBkPSdNNzIxLjc5NCAzODQuMTE2bC02MC45NDMgNjAuOTQ0LTIxMS4xOS0yMTEuMTkgNjAuOTQ0LTYwLjk0M3onIGZpbGw9JyNmZmYnLz48cGF0aCBkPSdNMjk5LjMxNyAzODMuOTg4bDYwLjk0MyA2MC45NDMgMjExLjE5LTIxMS4xOS02MC45NDQtNjAuOTQyek0zMDEuOSA2MzkuNTk0bDYwLjk0NC02MC45NDQgMjExLjE4OSAyMTEuMTktNjAuOTQzIDYwLjk0M3onIGZpbGw9JyNmZmYnLz48cGF0aCBkPSdNNzI0LjM5MSA2MzkuNzNsLTYwLjk0My02MC45NDMtMjExLjE5IDIxMS4xODkgNjAuOTQ0IDYwLjk0M3onIGZpbGw9JyNmZmYnLz48L3N2Zz4=);
    background-repeat: no-repeat;
    background-position: center right;
    background-size: 1em;
    margin-right: .5em;
}

.select-regular:hover,
.select-regular:focus {
    font-weight: bolder;
}

select {
    border-style: none;
    border-radius: .25em;
    background-color: #fff;
    line-height: 200%;
    font-size: 100%;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

select:focus {
    outline: none;
    /* 去掉焦点时的默认边框 */
}

.search-main>*:not(:last-child) {
    margin-right: .5em;
}

#search input {
    /* width: 20em; */
    /* max-width: calc(100% - 16rem); */
    background: #e1e2e1;
}

/* #nav-search-input {
    max-width: calc(100% - 16rem);
} */

/* #searchNav {
    padding: .5rem 0;
} */

input:not([type=radio]),
button,
textarea {
    border-style: none;
    border-radius: .25rem;
    /* background-color: #e1e2e1; */
    padding: 0 .5rem;
    line-height: 200%;
    font-size: 100%;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

input {
    border: 1px rgba(0, 0, 0, .1) solid !important;
    line-height: calc(2em - 2px) !important;
}

.search-main .search-main-item {
    width: 100%;
}

#search button:hover {
    font-weight: bold;
}

#search button {
    color: #fff;
    background-color: var(--btn-color);
    position: relative;
    white-space: nowrap;
    /* 防止文字换行 */
    /* min-width: 120px; */
}

#search-video-btn {
    margin-left: 2rem;
}

/* 移动端屏幕时按钮和输入框分为两行 */
@media (max-width: 576px) {
    .search-main {
        flex-direction: column;
        /* 让输入框和按钮垂直排列 */
    }

    #search-input {
        width: 100%;
        /* 确保搜索输入框占满宽度 */
    }

    .search-main .btn {
        width: 100%;
        /* 让按钮充满宽度 */
    }

    /* 第二行按钮的布局 */
    .flex {
        display: flex;
        justify-content: space-between;
        /* 确保按钮在第二行左右对齐 */
        gap: 10px;
    }

    .flex .btn {
        width: 48%;
        /* 给每个按钮留出一些空隙 */
    }
}

input:not([type=radio]),
button,
textarea {
    border-style: none;
    border-radius: .25rem;
    /* background-color: #e1e2e1; */
    padding: 0 .5rem;
    line-height: 200%;
    font-size: 100%;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

.flex {
    display: flex;
}

.main-part .others a:not(:last-of-type) {
    padding-right: 1rem;
}

.main-part .external_links a:not(:last-of-type) {
    padding-right: 1rem;
}

.main-part a {
    line-height: 200%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    letter-spacing: .25rem;
    font-family: 'Hei';
    text-decoration: none;
    color: var(--btn-color);
}

.main-part a:visited {
    color: #24096b
}

.main-part a:hover {
    font-weight: 600;
}

.nav-list a {
    line-height: 200%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    letter-spacing: .25rem;
    font-family: 'Hei';
    text-decoration: none;
    color: var(--btn-color);
    word-wrap: break-word;  /* 允许长单词或 URL 自动换行 */
    overflow-wrap: break-word;  /* 确保文本不会溢出容器 */
    /* white-space: normal; */
}

/* .nav-list a:visited {
    color: #24096b
} */

.nav-list a:hover {
    font-weight: 600;
}

.icp {
    color: #f44336 !important;
    display: block;
    width: 100%;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    letter-spacing: 0 !important;
    font-size: 80%;
    border-radius: .5rem;
    margin: .15rem 0 0 -0.25rem;
    padding: .25rem
}

.text-right {
    text-align: right;
}

#download * a {
    text-decoration: none;
    color: var(--btn-color);
    cursor: pointer;
    border-radius: 0.25em;
    display: inline-block;
}

#download * a:hover {
    background-color: #f5f5f6;
    margin-top: -0.25em !important;
    padding-top: 0.25em !important;
    margin-bottom: -0.25em !important;
    padding-bottom: 0.25em !important;
}

#download * a:active {
    background-color: var(--primary-color);
    color: #ffffff;
}

.article-title {
    display: inline;
    font-family: Arial, sans-serif;
    margin-right: 10px;
    font-size: 1.2rem;
}

.video-title {
    font-size: 1.2rem;
}

.more-items,
.collapse-items {
    cursor: pointer;
    font-size: 1.1rem;
    font-family: Arial, Helvetica, sans-serif;
}

.more-items:hover,
.collapse-items:hover {
    font-weight: bold;
    color: #000;
}

.more-items,
.collapse-items span {
    margin-left: .5rem;
    color: var(--btn-color);
}


/* 新增分页响应式样式 */
.pagination {
    display: flex;
    flex-wrap: wrap;
    /* 允许换行 */
    gap: 4px;
    /* 元素间距 */
    justify-content: center;
    align-items: center;
    padding: 8px;
}

/* .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    font-family: Arial, sans-serif;
} */

.pagination a {
    padding: .25rem 1rem;
    margin: 0 .25rem;
    text-decoration: none;
    color: var(--btn-color);
    border: 1px solid #ccc;
    border-radius: .25rem;
    transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover {
    background-color: var(--btn-color);
    color: white;
}

.pagination .current {
    background-color: var(--btn-color);
    color: white;
    font-weight: bold;
}

.pagination .first,
.pagination .previous,
.pagination .next,
.pagination .last {
    font-weight: bold;
}

.pagination .disabled {
    pointer-events: none;
    color: #ccc;
    border-color: #ccc;
    background-color: #f5f5f5;
}

/* 移动端优化 */
@media (max-width: 767px) {
    .pagination {
        justify-content: space-between;
        /* 两端对齐 */
        gap: 2px;
    }

    .pagination a {
        padding: 6px 8px;
        margin: 0 2px;
        font-size: 14px;
        min-width: 36px;
        /* 保持可点击区域 */
        text-align: center;
    }

    /* 隐藏首尾文字 */
    .pagination .page-link:not(.previous):not(.next) span.long-text {
        display: none;
    }

    /* 显示短文本/图标 */
    .pagination .first::after {
        content: "««";
    }

    .pagination .first span {
        display: none;
    }

    .pagination .last::after {
        content: "»»";
    }

    .pagination .last span {
        display: none;
    }

    .pagination .previous::after {
        content: "«";
    }

    .pagination .previous span {
        display: none;
    }

    .pagination .next::after {
        content: "»";
    }

    .pagination .next span {
        display: none;
    }

    /* 总页数换行显示 */
    .total-pages {
        flex-basis: 100%;
        text-align: center;
        margin-top: 8px;
    }

    /* 当前页突出显示 */
    .current {
        order: -1;
        /* 当前页前置 */
        flex: 1;
        /* background-color: #007bff !important; */
        background-color: var(--btn-color) !important;
    }
}

/* PC端保持原有样式 */
@media (min-width: 768px) {
    .pagination {
        flex-wrap: nowrap;
        gap: 8px;
    }

    /* .pagination a {
        padding: 8px 12px;
    } */
}

.subgroup {
    display: block;
    padding: 1rem;
    color: var(--btn-color);
    border-radius: .5rem;
}

.subgroup:hover {
    background-color: rgb(225, 226, 225);
}

.subgroup img {
    width: 100%;
}

.group_detail_article span {
    font-size: .7rem;
}