/* 自定义响应式样式 */

/* 确保内容容器在不同设备上都能良好显示 */
.wy-nav-content {
    max-width: 100%;
    padding: 1.618em 3.236em;
}

@media screen and (max-width: 768px) {

    /* 移动设备上调整内容边距 */
    .wy-nav-content {
        padding: 1.618em;
    }

    /* 确保表格在移动设备上可以水平滚动 */
    .wy-table-responsive table td,
    .wy-table-responsive table th {
        white-space: normal !important;
    }

    .wy-table-responsive {
        overflow-x: auto;
        display: block;
    }
}

/* 优化代码块在小屏幕上的显示 */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 确保图片自适应容器宽度 */
img {
    max-width: 100%;
    height: auto;
}

/* 项目链接样式 */
.project-links {
    margin-top: 15px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.project-link {
    display: inline-block;
    padding: 8px 12px;
    background-color: #2980b9;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.project-link:hover {
    background-color: #1f618d;
    color: white !important;
}

.project-link i {
    margin-right: 5px;
}

/* 自定义响应式右侧目录 */
.right-toc {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 250px;
    background-color: #f8f8f8;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    padding: 15px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.right-toc.visible {
    display: block;
}

.right-toc-title {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e7e7e7;
}

.right-toc ul {
    list-style-type: none;
    padding-left: 10px;
    margin: 0;
}

.right-toc li {
    margin-bottom: 5px;
}

.right-toc a {
    color: #2980b9;
    text-decoration: none;
    font-size: 14px;
}

.right-toc a:hover {
    color: #1f618d;
    text-decoration: underline;
}

.right-toc-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.right-toc-toggle:hover {
    background-color: #1f618d;
}

/* 响应式设计 */
@media screen and (max-width: 1200px) {
    .right-toc {
        width: 200px;
    }
}

@media screen and (max-width: 992px) {
    .right-toc {
        width: 100%;
        right: 0;
        left: 0;
        transform: none;
        top: auto;
        bottom: 0;
        max-height: 50vh;
    }
}

/* 确保主内容区域不会被右侧目录遮挡 */
@media screen and (min-width: 993px) {
    .wy-nav-content {
        margin-right: 270px;
    }
}

.wy-menu {
    ul>li>a:nth-child(2) {
        display: none;
    }
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

td>p {
    line-height: 24px !important;
}

/* 折叠内容样式 */
details {
    margin: 12px 0 !important;
    border: 1px solid #d9dee7 !important;
    border-radius: 6px !important;
    background: #fff !important;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

details summary {
    display: flex !important;
    align-items: center;
    min-height: 42px;
    padding: 10px 14px !important;
    color: #1f2937 !important;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    background: #f5f7fa !important;
    border-radius: 6px;
    list-style: none;
}

details[open] summary {
    border-bottom: 1px solid #d9dee7 !important;
    border-radius: 6px 6px 0 0;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: '›';
    margin-right: 8px;
    color: #607085;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s ease;
}

details[open] summary::before {
    transform: rotate(90deg);
}

details summary:hover {
    background: #eef2f7 !important;
}

details > :not(summary) {
    margin-left: 16px !important;
    margin-right: 16px !important;
}

details > :nth-child(2) {
    margin-top: 16px !important;
}

details > :last-child {
    margin-bottom: 16px !important;
}