* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 0;
}

.layout {
    display: flex;
    width: 100%;
    position: relative;
}

.sidebar {
    width: 220px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: transparent;
    box-shadow: none;
    overflow-y: auto;
    padding: 20px 5px 20px 15px;
    border-right: none;
    z-index: 10;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 900px;
    width: 100%;
    padding: 20px 40px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.toc {
    padding: 0;
    margin-top: 30px;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
}

.toc h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: none;
    font-weight: 500;
}

.toc ul {
    list-style-type: none;
    margin: 0 0 8px 0;
    padding-left: 5px;
    border: none;
}

.toc li {
    margin-bottom: 4px;
    font-size: 14px;
    position: relative;
    padding-left: 0;
    border: none;
}

.toc a {
    color: #666;
    text-decoration: none;
    display: block;
    padding: 4px 8px 4px 10px;
    border-radius: 0;
    transition: color 0.2s;
    border-left: 2px solid transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-color: transparent;
}

.toc a:hover {
    background-color: transparent;
    color: #3370ff;
    text-decoration: none;
    border-left: 2px solid #3370ff;
}

.toc a.active {
    background-color: transparent;
    color: #3370ff;
    font-weight: normal;
    border-left: 2px solid #3370ff;
}

/* 父级菜单项 */
.toc > ul > li > a {
    font-weight: 500;
    color: #333;
}

/* 子菜单缩进样式 */
.toc > ul > li > ul {
    padding-left: 10px;
}

/* 折叠指示器 */
.toc > ul > li > a:before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
    margin-right: 6px;
    transform: rotate(-45deg);
    position: relative;
    top: -2px;
    transition: transform 0.2s;
}

.toc > ul > li.collapsed > a:before {
    transform: rotate(45deg);
}

/* 标题样式 */
h1 {
    text-align: center;
    margin: 20px 0 30px;
    color: #333;
    font-size: 28px;
}

h2 {
    color: #333;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 22px;
}

h3 {
    color: #444;
    margin: 25px 0 15px;
    font-size: 20px;
}

h4 {
    color: #555;
    margin: 20px 0 15px;
    font-size: 18px;
}

p {
    margin: 15px 0;
    font-size: 16px;
}

.img-placeholder {
    width: 100%;
    max-width: 600px;
    height: 240px;
    margin: 15px auto;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.manual-img {
    max-width: 100%;
    max-height: 400px;
    margin: 15px auto;
    display: block;
    border-radius: 4px;
    object-fit: contain;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: zoom-in;
}

.manual-img:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.images-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    margin: 15px 0;
    width: 100%;
}

/* 两张图片一行的通用样式 */
.images-row .img-placeholder,
.images-row .manual-img {
    flex: 1;
    min-width: 32%;
    max-width: 33%;
}

/* 专门针对两张图片一行的情况 */
.images-row.two-images .img-placeholder,
.images-row.two-images .manual-img {
    min-width: 48%;
    max-width: 49%;
}

.images-row .img-placeholder {
    height: 220px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.images-row .manual-img {
    height: 220px;
    margin: 0;
    padding: 0;
    object-fit: contain;
}

/* 图片放大灯箱效果 */
.lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    z-index: 99999 !important;
    display: none;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    transition: opacity 0.3s ease;
}

.lightbox-img {
    max-width: 90% !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3) !important;
    display: block !important;
    margin: 0 auto !important;
    /* 强制重置所有可能的样式继承 */
    transform: none !important;
    position: relative !important;
    flex: none !important;
    order: unset !important;
    align-self: unset !important;
    justify-self: unset !important;
}

/* 专门针对lightbox中的问题图片进行额外重置 */
.lightbox .lightbox-img[src*="image_24"],
.lightbox .lightbox-img[src*="image_25"], 
.lightbox .lightbox-img[src*="image_27"],
.lightbox .lightbox-img[src*="image_28"],
.lightbox .lightbox-img[src*="image_30"],
.lightbox .lightbox-img[src*="image_31"],
.lightbox .lightbox-img[src*="image_23"],
.lightbox .lightbox-img[src*="image_26"],
.lightbox .lightbox-img[src*="image_29"],
.lightbox .lightbox-img[src*="image_54"],
.lightbox .lightbox-img[src*="image_55"],
.lightbox .lightbox-img[src*="image_56"],
.lightbox .lightbox-img[src*="image_57"],
.lightbox .lightbox-img[src*="image_58"],
.lightbox .lightbox-img[src*="image_59"],
.lightbox .lightbox-img[src*="image_60"],
.lightbox .lightbox-img[src*="image_61"] {
    max-width: 90% !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    object-fit: contain !important;
    aspect-ratio: unset !important;
    flex: none !important;
    transform: none !important;
    position: relative !important;
}

.lightbox-caption {
    color: #fff;
    margin-top: 15px;
    text-align: center;
    font-size: 16px;
    max-width: 90%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.lightbox-close:hover {
    transform: scale(1.2);
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background-color: #3370ff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: #2860e1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .sidebar {
        width: 180px;
    }
    
    .main-content {
        margin-left: 180px;
    }
    
    .container {
        padding: 15px 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    p {
        font-size: 15px;
    }
    
    .images-row {
        flex-direction: column;
    }
    
    .images-row .img-placeholder,
    .images-row .manual-img {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .lightbox-img {
        max-width: 95%;
        max-height: 80vh;
    }
    
    .lightbox-caption {
        font-size: 14px;
        padding: 6px 12px;
        max-width: 95%;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 36px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 576px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: 300px;
        padding: 10px 15px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar:not(.expanded) .toc ul {
        display: none;
    }
    
    .sidebar.expanded .toc ul {
        display: block;
    }
    
    .toc h3 {
        cursor: pointer;
        position: relative;
    }
    
    .toc h3:after {
        content: "▼";
        position: absolute;
        right: 10px;
        top: 0;
        font-size: 12px;
    }
    
    .sidebar.expanded .toc h3:after {
        content: "▲";
    }
    
    .container {
        padding: 15px;
    }
    
    .back-to-top {
        width: 36px;
        height: 36px;
        bottom: 15px;
        right: 15px;
    }
}

.sidebar.expanded {
    max-height: none;
    height: auto;
}

/* 确保所有密码相关图片的特殊高度，强制内联样式 */
.taller-images .img-placeholder,
.taller-images .manual-img {
    height: 400px !important;
    max-height: 400px !important;
    min-height: 400px !important;
    object-fit: contain !important;
    width: auto !important;
}

/* 特别针对问题图片单独设置 */
#img24, #img25, #img27, #img28, #img30, #img31,
#img54, #img55, #img56, #img57, #img58, #img59, #img60, #img61,
img[src*="image_24"], img[src*="image_25"], 
img[src*="image_27"], img[src*="image_28"],
img[src*="image_30"], img[src*="image_31"],
img[src*="image_54"], img[src*="image_55"], img[src*="image_56"],
img[src*="image_57"], img[src*="image_58"], img[src*="image_59"],
img[src*="image_60"], img[src*="image_61"] {
    height: 400px !important;
    max-height: 400px !important;
    min-height: 400px !important;
    object-fit: contain !important;
    width: auto !important;
}

/* 为图片容器设置高度 */
div[id="img23"], div[id="img24"], div[id="img25"], 
div[id="img26"], div[id="img27"], div[id="img28"], 
div[id="img29"], div[id="img30"], div[id="img31"],
div[id="img54"], div[id="img55"], div[id="img56"],
div[id="img57"], div[id="img58"], div[id="img59"],
div[id="img60"], div[id="img61"] {
    height: 280px !important;
}

/* 这些图片的manual-img类也需要更高 */
#img23 + .manual-img, #img24 + .manual-img, #img25 + .manual-img,
#img26 + .manual-img, #img27 + .manual-img, #img28 + .manual-img,
#img29 + .manual-img, #img30 + .manual-img, #img31 + .manual-img,
#img54 + .manual-img, #img55 + .manual-img, #img56 + .manual-img,
#img57 + .manual-img, #img58 + .manual-img, #img59 + .manual-img,
#img60 + .manual-img, #img61 + .manual-img,
#img23 ~ .manual-img, #img24 ~ .manual-img, #img25 ~ .manual-img,
#img26 ~ .manual-img, #img27 ~ .manual-img, #img28 ~ .manual-img,
#img29 ~ .manual-img, #img30 ~ .manual-img, #img31 ~ .manual-img,
#img54 ~ .manual-img, #img55 ~ .manual-img, #img56 ~ .manual-img,
#img57 ~ .manual-img, #img58 ~ .manual-img, #img59 ~ .manual-img,
#img60 ~ .manual-img, #img61 ~ .manual-img {
    height: 280px !important;
    max-height: 280px !important;
} 