/* CHM 原版样式 - 100% 还原 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #000;
    background: #D2B48C;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ========================================
   Header - 顶部标题栏
   ======================================== */
.site-header {
    background: #8B4513;
    color: white;
    padding: 10px 0;
}

.site-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.site-title a {
    color: white;
    text-decoration: none;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    font-size: 13px;
}

.search-form button {
    padding: 6px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

/* ========================================
   Main Layout - 主布局
   ======================================== */
.main-container {
    display: flex;
    gap: 10px;
    margin: 10px auto;
}

/* ========================================
   Sidebar - 左侧导航栏
   ======================================== */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.navigation {
    background: #F5DEB3;
    padding: 10px;
    border: 2px solid #D2691E;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 10px;
}

.nav-category {
    margin-bottom: 10px;
}

.nav-category h3 {
    font-size: 13px;
    color: #8B4513;
    font-weight: bold;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid #D2691E;
}

.nav-category ul {
    list-style: none;
}

.nav-category li {
    margin: 2px 0;
}

.nav-category a {
    color: #000;
    text-decoration: none;
    display: block;
    padding: 2px 5px;
    font-size: 12px;
    line-height: 1.4;
}

.nav-category a:hover {
    background: #FFE4B5;
    color: #8B4513;
}

.nav-category a.active {
    background: #4CAF50;
    color: white;
}

/* ========================================
   Content - 右侧内容区域（核心）
   ======================================== */
.content {
    flex: 1;
    background: #FFFAF0;
    border: 2px solid #D2691E;
    padding: 15px 20px;
    min-height: 500px;
    min-width: 0;
}

/* 页面内容容器 */
.page-content {
    color: #000;
}

/* 页面标题 - 深棕色带下划线 */
.page-content h1 {
    color: #8B4513;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #D2691E;
}

.page-content h2 {
    color: #8B4513;
    font-size: 16px;
    font-weight: bold;
    margin: 15px 0 8px 0;
}

.page-content h3 {
    color: #8B4513;
    font-size: 14px;
    font-weight: bold;
    margin: 12px 0 6px 0;
}

/* 段落 */
.page-content p {
    margin: 8px 0;
    line-height: 1.8;
    text-indent: 0;
}

/* 链接 */
.page-content a {
    color: #0000FF;
    text-decoration: underline;
}

.page-content a:hover {
    color: #FF0000;
}

/* ========================================
   面包屑导航 - 浅绿色背景
   ======================================== */
.breadcrumb {
    margin-bottom: 10px;
}

.breadcrumb ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 8px 12px;
    background: #90EE90;
    border: 2px solid #228B22;
    font-size: 13px;
    margin: 0;
}

.breadcrumb li {
    color: #000;
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '>';
    margin: 0 8px;
    color: #000;
    font-weight: normal;
}

.breadcrumb a {
    color: #0000FF;
    text-decoration: underline;
}

.breadcrumb a:hover {
    color: #FF0000;
}

/* ========================================
   代码块 - 黑色背景带语法高亮
   ======================================== */
.page-content pre {
    background: #1E1E1E;
    color: #D4D4D4;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #333;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}

.page-content code {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
}

.page-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    white-space: pre;
}

/* 内联代码 */
.page-content p code,
.page-content li code,
.page-content td code {
    background: #F0F0F0;
    color: #C7254E;
    padding: 2px 4px;
    border: 1px solid #DDD;
    font-size: 12px;
}

/* 语法高亮颜色 - 匹配截图 */
.page-content pre .keyword,
.page-content pre .hljs-keyword {
    color: #569CD6;
}

.page-content pre .function,
.page-content pre .hljs-title {
    color: #DCDCAA;
}

.page-content pre .string,
.page-content pre .hljs-string {
    color: #CE9178;
}

.page-content pre .comment,
.page-content pre .hljs-comment {
    color: #6A9955;
}

.page-content pre .number,
.page-content pre .hljs-number {
    color: #B5CEA8;
}

.page-content pre .variable,
.page-content pre .hljs-variable {
    color: #9CDCFE;
}

.page-content pre .type,
.page-content pre .hljs-type {
    color: #4EC9B0;
}

.page-content pre .operator {
    color: #D4D4D4;
}

/* ========================================
   列表样式
   ======================================== */
.page-content ul,
.page-content ol {
    margin: 8px 0 8px 25px;
    padding: 0;
}

.page-content ul {
    list-style-type: disc;
}

.page-content ol {
    list-style-type: decimal;
}

.page-content li {
    margin: 4px 0;
    line-height: 1.6;
}

.page-content ul ul {
    list-style-type: circle;
    margin: 4px 0 4px 20px;
}

.page-content ul ul ul {
    list-style-type: square;
}

/* ========================================
   表格样式
   ======================================== */
.page-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    font-size: 13px;
    background: white;
}

.page-content th,
.page-content td {
    border: 1px solid #D2691E;
    padding: 6px 10px;
    text-align: left;
}

.page-content th {
    background: #F5DEB3;
    color: #8B4513;
    font-weight: bold;
}

.page-content tr:nth-child(even) {
    background: #FFF8DC;
}

/* ========================================
   图片样式
   ======================================== */
.page-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border: 1px solid #D2691E;
}

/* ========================================
   页脚 - 浅绿色背景（匹配截图）
   ======================================== */
.site-footer {
    background: #90EE90;
    border-top: 2px solid #228B22;
    text-align: center;
    padding: 10px 15px;
    margin-top: 0;
    font-size: 12px;
    color: #000;
}

.site-footer p {
    margin: 3px 0;
}

.site-footer a {
    color: #0000FF;
    text-decoration: underline;
}

.site-footer a:hover {
    color: #FF0000;
}

/* ========================================
   内容页脚信息（页面底部）
   ======================================== */
.page-footer {
    background: #90EE90;
    border: 2px solid #228B22;
    padding: 10px 15px;
    margin-top: 15px;
    text-align: center;
    font-size: 12px;
}

.page-footer a {
    color: #0000FF;
    text-decoration: underline;
}

.page-footer .copyright {
    margin-top: 8px;
    color: #666;
}

/* ========================================
   搜索结果
   ======================================== */
.search-results h1 {
    color: #8B4513;
    margin-bottom: 15px;
}

.result-item {
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #D2691E;
}

.result-item h3 {
    margin-bottom: 5px;
}

.result-item h3 a {
    color: #0000FF;
}

.result-item .snippet {
    color: #333;
    font-size: 13px;
}

.result-item mark {
    background: #FFFF00;
    padding: 1px 2px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* ========================================
   响应式布局
   ======================================== */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .navigation {
        max-height: 250px;
        position: static;
    }
    
    .content {
        padding: 10px 15px;
    }
}

/* ========================================
   滚动条样式
   ======================================== */
.navigation::-webkit-scrollbar {
    width: 8px;
}

.navigation::-webkit-scrollbar-track {
    background: #F5DEB3;
}

.navigation::-webkit-scrollbar-thumb {
    background: #D2691E;
}

.navigation::-webkit-scrollbar-thumb:hover {
    background: #8B4513;
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    .site-header,
    .sidebar,
    .site-footer,
    .breadcrumb {
        display: none;
    }
    
    .content {
        border: none;
        padding: 0;
    }
    
    .page-content pre {
        background: #f5f5f5 !important;
        color: #333 !important;
        border: 1px solid #ccc;
    }
}
