/* ========================================
   OpenTheDoor 自定义样式
   GitHub 风格设计
   ======================================== */

/* 📌 1. 首页标题优化 - GitHub 风格 */
.md-content h1 {
    background: linear-gradient(135deg, #0969da 0%, #1f6feb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 3rem !important;
    margin-bottom: 2rem;
    text-align: center;
}

/* 📌 2. Admonition 美化 - GitHub 风格 */
.md-typeset .admonition {
    border-radius: 0.6rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border-left: 0.4rem solid;
    transition: all 0.3s ease;
}

.md-typeset .admonition:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* Success 提示框 */
.md-typeset .admonition.success {
    border-left-color: #1a7f37;
}

/* Tip 提示框 */
.md-typeset .admonition.tip {
    border-left-color: #0969da;
}

/* Info 提示框 */
.md-typeset .admonition.info {
    border-left-color: #0969da;
}

/* Quote 引用框 */
.md-typeset .admonition.quote {
    border-left-color: #6e7781;
    background: rgba(175, 184, 193, 0.05);
}

/* 📌 3. 按钮美化 - GitHub 风格 */
.md-button {
    border-radius: 0.4rem !important;
    padding: 0.6rem 1.2rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

.md-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.md-button--primary {
    background: linear-gradient(135deg, #0969da 0%, #1f6feb 100%) !important;
    color: white !important;
}

/* 📌 4. 表格优化 - GitHub 风格 */
.md-typeset table:not([class]) {
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-size: 0.9rem;
    border: 1px solid #d0d7de;
}

.md-typeset table:not([class]) thead {
    background: #f6f8fa;
    color: #24292f;
    border-bottom: 2px solid #d0d7de;
}

.md-typeset table:not([class]) th {
    color: #24292f !important;
    font-weight: 700;
    padding: 0.75rem 1rem !important;
}

.md-typeset table:not([class]) td {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #d0d7de;
}

.md-typeset table:not([class]) tbody tr:hover {
    background-color: #f6f8fa;
}

/* 📌 5. 代码块优化 - GitHub 风格 */
.md-typeset pre > code {
    border-radius: 0.6rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* 📌 6. 链接优化 - GitHub 蓝色 */
.md-typeset a {
    color: #0969da;
    font-weight: 500;
    transition: all 0.2s ease;
}

.md-typeset a:hover {
    color: #0550ae;
    text-decoration: underline;
}

/* 📌 7. 分隔线美化 - GitHub 风格 */
.md-typeset hr {
    border: none;
    height: 1px;
    background: #d0d7de;
    margin: 2rem 0;
}

/* 📌 8. 侧边栏优化 - GitHub 风格 */
.md-sidebar {
    background: #f6f8fa;
}

/* 📌 9. 导航标签优化 - GitHub 风格 */
.md-tabs {
    background: #24292f;
}

/* 📌 10. 内容卡片化 */
.md-content__inner {
    padding: 2rem;
}

/* 📌 11. 徽章美化 */
.md-typeset img[src*="shields.io"],
.md-typeset img[src*="badge"] {
    border-radius: 0.4rem;
    transition: transform 0.2s ease;
}

.md-typeset img[src*="shields.io"]:hover,
.md-typeset img[src*="badge"]:hover {
    transform: scale(1.05);
}

/* 📌 12. Details 折叠块美化 - GitHub 风格 */
.md-typeset details {
    border-radius: 0.6rem;
    border: 1px solid #d0d7de;
    padding: 0;
    margin: 1rem 0;
    background: #ffffff;
    transition: all 0.2s ease;
}

.md-typeset details:hover {
    border-color: #0969da;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.md-typeset details summary {
    font-weight: 700;
    font-size: 1rem;
    color: #24292f;
    cursor: pointer;
    padding: 1rem;
    border-radius: 0.6rem 0.6rem 0 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    background: #f6f8fa;
}

.md-typeset details summary:hover {
    background: #e7ecf0;
}

.md-typeset details[open] summary {
    border-bottom: 1px solid #d0d7de;
}

.md-typeset details[open] > *:not(summary) {
    padding: 1rem;
}

/* 📌 13. 响应式优化 */
@media screen and (max-width: 768px) {
    .md-content h1 {
        font-size: 2rem !important;
    }
    
    .md-button {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* 📌 14. 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.md-content__inner > * {
    animation: fadeInUp 0.4s ease-out;
}

/* 📌 15. 滚动条美化 - GitHub 风格 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f6f8fa;
}

::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #afb8c1;
}

/* 📌 16. 页脚优化 - GitHub 风格 */
.md-footer {
    background: #24292f;
}

/* 📌 17. 搜索框优化 */
.md-search__input {
    border-radius: 0.4rem;
}

/* 📌 18. 高亮文本 - GitHub 风格 */
.md-typeset mark {
    background: rgba(255, 223, 93, 0.4);
    border-radius: 0.2rem;
    padding: 0.1rem 0.3rem;
}

/* 📌 19. 引用块 - GitHub 风格 */
.md-typeset blockquote {
    border-left: 0.25rem solid #d0d7de;
    padding-left: 1rem;
    color: #57606a;
}

/* 📌 20. 深色模式适配 */
[data-md-color-scheme="slate"] .md-typeset details {
    background: #161b22;
    border-color: #30363d;
}

[data-md-color-scheme="slate"] .md-typeset details summary {
    background: #0d1117;
    color: #c9d1d9;
}

[data-md-color-scheme="slate"] .md-typeset details summary:hover {
    background: #161b22;
}

[data-md-color-scheme="slate"] .md-typeset details[open] summary {
    border-bottom-color: #30363d;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
    border-color: #30363d;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) thead {
    background: #161b22;
    color: #c9d1d9;
    border-bottom-color: #30363d;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
    color: #c9d1d9 !important;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
    border-bottom-color: #30363d;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:hover {
    background-color: #161b22;
}
