/* 全局样式 */
/* html, */

body{
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-family: Arial, sans-serif;
    overflow-x: hidden; /* 防止水平滚动条 */
    background-color: #f9f9f9;
    /* margin-bottom: 120px; 根据#site-footer的高度调整 */
}

code {
    background: #4caf5066;
}



/* 主要内容容器，最大宽度限制 */
#container {
    max-width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    padding: 0;
}

#title {
    background-color: #4CAF50bf;
    color: white;
    text-align: center;
    padding: 1rem;
    margin: 0;
}

/* 面包屑导航 */
#breadcrumb {
    margin: 2rem;
    font-size: 1.8rem;
}

#breadcrumb a {
    color: #007BFF;
    text-decoration: none;
}

#breadcrumb a:hover {
    text-decoration: underline;
}

#site-footer {
    /* position: fixed; 固定定位 */
    bottom: 0; /* 固定在底部 */
    left: 0; /* 从左边开始（如果需要的话，可以调整为其他值） */
    width: 100%; /* 宽度设置为100%，覆盖整个页面宽度 */
    background-color: #5c775d; /* 背景色（可选，为了视觉效果） */
    padding: 1rem; /* 内边距（可选，为了视觉效果和可读性） */
    text-align: center; /* 文本居中（可选，根据设计需求） */
    box-shadow: 0 -1rem 5rem rgba(0, 0, 0, 0.1); /* 底部阴影（可选，为了视觉效果） */
    z-index: 999; /* 确保页脚在所有内容之上（可选，根据需要调整） */
}


/* 标题样式 */
h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

a {
    text-decoration: none;
}

blockquote {
    background-color: #4caf502e;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 1rem;
    text-align: left;
}

th {
    background-color: #f0f0f0;
}

/* 文件/目录链接样式 */
.directory {
    font-weight: bold;
    cursor: pointer;
    color: #FF7F50;
}

.file {
    cursor: pointer;
    color: #007BFF;
}

.directory:hover, .file:hover {
    text-decoration: underline;
}

/* 返回链接样式 */
.back-link {
    font-weight: bold;
    cursor: pointer;
    color: #FF6347;
}

.back-link:hover {
    text-decoration: underline;
}



/* Readme 渲染区域 */
#readme-content {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #4caf5021;
    border-radius: 0.5rem;
    /* white-space: pre-wrap; */
    display: none;
    margin-bottom: 1.5rem;
}

#readme-content img {
    max-width: 100%; /* 最大宽度限制为 100% */
    height: auto;    /* 保持纵横比 */
    display: block;  /* 使图片为块级元素，防止和文本并排 */
    margin: 0 auto;  /* 如果图片比容器小，则居中显示 */
}



/* 单位选择菜单 */
#unit-menu {
    display: none;
    position: absolute;
    bottom: 4rem;
    right: 0;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0 10rem rgba(0, 0, 0, 0.1);
    padding: 1rem;
    font-size: 1.4rem;
}

#unit-menu button {
    display: block;
    background: none;
    border: none;
    color: #4CAF50;
    text-align: left;
    padding: 0.5rem 1rem;
    width: 100%;
    cursor: pointer;
}


#unit-menu button:hover {
    background-color: #f0f0f0;
}



/* 打印样式 */
@media print {
    .readme-content {
        border: none;
        box-shadow: none;
    }

    /* 确保每页最多显示两张 sheet */
    .readme-content:nth-child(odd) {
        page-break-after: auto;
    }
}

#container {
    /* margin: 2rem; */
    min-height: 50rem;
}

/* 媒体查询：当页面高度大于 时 */
@media (min-height: 550px) {

}

/* 媒体查询：当页面高度大于 时 */
@media (min-height: 800px) {

}



/* 微信提示遮罩层样式 */
#wechat-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

.wechat-alert {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    width: 80%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.wechat-alert h2 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 2rem;
}

.wechat-alert p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1rem;
}

.wechat-alert .icon-wechat {
    font-size: 50px;
    color: #07C160;
    margin-bottom: 15px;
}

.wechat-alert .steps {
    text-align: left;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 0.8rem;
}

.wechat-alert .steps ol {
    padding-left: 20px;
    margin: 0;
}

.wechat-alert .steps li {
    margin-bottom: 8px;
}

.wechat-alert .close-btn {
    background: #07C160;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    font-weight: 500;
}

.wechat-alert .close-btn:hover {
    background: #06AE56;
}

/* 弹窗的 */

/* 预览弹窗样式 */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.preview-content {
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.preview-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.preview-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.preview-close:hover {
    background: #e9ecef;
    color: #333;
}

.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
    border-radius: 0 0 12px 12px;
}

#preview-markdown-content {
    line-height: 1.6;
    color: #333;
}

#preview-markdown-content h1,
#preview-markdown-content h2,
#preview-markdown-content h3,
#preview-markdown-content h4,
#preview-markdown-content h5,
#preview-markdown-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #2c3e50;
}

#preview-markdown-content h1 {
    border-bottom: 2px solid #eee;
    padding-bottom: 0.3em;
}

#preview-markdown-content h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

#preview-markdown-content p {
    margin-bottom: 1em;
}

#preview-markdown-content code {
    background: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

#preview-markdown-content pre {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

#preview-markdown-content pre code {
    background: none;
    padding: 0;
}

#preview-markdown-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1em;
    margin-left: 0;
    color: #666;
    font-style: italic;
}

#preview-markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

#preview-markdown-content table th,
#preview-markdown-content table td {
    border: 1px solid #ddd;
    padding: 0.5em;
    text-align: left;
}

#preview-markdown-content table th {
    background: #f8f9fa;
    font-weight: bold;
}

#preview-markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .preview-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .preview-header {
        padding: 0.8rem 1rem;
    }
    
    .preview-body {
        padding: 1rem;
    }
}

/* 预览按钮样式 - 背景色方案 */
#file-list .js-preview {
    background-color: #c2935a;
    color: white;
    border: 1px solid #c2935a;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 4px;
}

#file-list .js-preview:hover {
    background-color: #c2935a;
    border-color: #c2935a;
}
