/* ============================================================
   实色卡片仪表盘风格 - 参考医疗/工业科技UI
   特点：浅灰背景 + 纯白实色卡片 + 超大圆角 + 柔和阴影
   ============================================================ */

/* ---------- 基础背景 ---------- */
body {
    background: #eef0f4;
}

.md-main {
    background: transparent;
}

/* ---------- Header 改为白色浮动卡片 ---------- */
.md-header {
    background: #ffffff !important;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.02),
        0 8px 24px rgba(0,0,0,0.04) !important;
    border-bottom: none !important;
    color: #1a1a1a !important;
}

.md-header__inner {
    color: #1a1a1a;
}

.md-header__button {
    color: #1a1a1a !important;
}

.md-header__title,
.md-header__topic {
    color: #1a1a1a !important;
}

/* 搜索框 */
.md-search__form {
    background: #f5f6f8;
    border-radius: 14px;
}

.md-search__input {
    color: #1a1a1a;
}

.md-search__input::placeholder {
    color: #999;
}

/* ---------- 主内容区 ---------- */
.md-main__inner {
    padding-top: 28px;
    padding-bottom: 48px;
    max-width: 1480px;
    margin: 0 auto;
}

/* 中间内容卡片 */
.md-content {
    background: #ffffff;
    border-radius: 28px;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.02),
        0 8px 24px rgba(0,0,0,0.04),
        0 24px 64px rgba(0,0,0,0.06);
    padding: 44px 52px;
    margin: 0 16px;
    min-height: calc(100vh - 220px);
    flex: 1 1 auto;
    max-width: none;
}

.md-content__inner {
    max-width: none;
    margin: 0 auto;
}

/* ---------- 左侧导航栏 ---------- */
.md-sidebar--primary {
    margin: 0 8px 0 16px;
    padding: 20px 12px;
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* 默认 align-self: stretch，让高度随中间内容区自适应 */
}

.md-sidebar--primary .md-sidebar__inner,
.md-sidebar--primary .md-sidebar__scrollwrap,
.md-sidebar--primary .md-nav,
.md-sidebar--primary .md-nav__list,
.md-sidebar--primary .md-nav__item,
.md-sidebar--primary .md-nav__title,
.md-sidebar--primary .md-nav__link {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.md-sidebar--primary .md-sidebar__inner {
    position: sticky;
    top: 80px;
}

.md-sidebar--primary .md-sidebar__scrollwrap {
    overflow-y: auto;
    scrollbar-width: thin;
    max-height: calc(100vh - 140px);
}

/* ---------- 右侧目录 ---------- */
.md-sidebar--secondary {
    margin: 0 16px 0 8px;
    padding: 20px 12px;
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* 默认 align-self: stretch，让高度随中间内容区自适应 */
}

.md-sidebar--secondary .md-sidebar__inner,
.md-sidebar--secondary .md-sidebar__scrollwrap,
.md-sidebar--secondary .md-nav,
.md-sidebar--secondary .md-nav__list,
.md-sidebar--secondary .md-nav__item,
.md-sidebar--secondary .md-nav__title {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.md-sidebar--secondary .md-sidebar__inner {
    position: sticky;
    top: 80px;
}

.md-sidebar--secondary .md-sidebar__scrollwrap {
    overflow-y: auto;
    scrollbar-width: thin;
    max-height: calc(100vh - 140px);
}

/* ---------- Tab 导航栏 ---------- */
.md-tabs {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border-bottom: none;
    color: #666;
}

.md-tabs__item {
    color: #888;
}

.md-tabs__link {
    color: #888 !important;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.md-tabs__link--active,
.md-tabs__link:hover {
    color: #1a1a1a !important;
}

/* ---------- 内容文字样式 ---------- */
.md-content h1 {
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: -0.5px;
    color: #1a1a1a;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.md-content h2 {
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -0.3px;
    color: #1a1a1a;
    margin-top: 40px;
}

.md-content h3 {
    font-weight: 600;
    color: #333;
    font-size: 1.15rem;
    margin-top: 32px;
}

.md-content p,
.md-content li {
    color: #555;
    line-height: 1.7;
    font-size: 15px;
}

/* ---------- 代码块 ---------- */
.md-typeset pre {
    background: #f5f6f8;
    border-radius: 16px;
    border: none;
    padding: 20px 24px;
}

.md-typeset code {
    background: #f0f1f3;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.85em;
    color: #d93025;
}

.md-typeset pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* ---------- 表格 ---------- */
.md-typeset table:not([class]) {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: none;
}

.md-typeset table:not([class]) th {
    background: #f5f6f8;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e8e9ec;
    padding: 14px 20px;
}

.md-typeset table:not([class]) td {
    border-top: 1px solid #f0f0f0;
    padding: 12px 20px;
}

/* ---------- 引用块 ---------- */
.md-typeset blockquote {
    background: #f8f9fb;
    border-left: 3px solid #1a1a1a;
    border-radius: 0 16px 16px 0;
    padding: 16px 24px;
    color: #666;
}

/* ---------- 导航折叠 ---------- */
.md-nav__toggle:not(:checked) ~ .md-nav {
    grid-template-rows: minmax(.4rem, 0fr) !important;
    opacity: 0 !important;
    visibility: collapse !important;
}

.md-nav__toggle:checked ~ .md-nav,
.md-nav__toggle.md-toggle--indeterminate ~ .md-nav {
    grid-template-rows: minmax(.4rem, 1fr) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ---------- 导航链接 ---------- */
.md-nav__link {
    color: #777;
    margin: 2px 8px;
    padding: 7px 14px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.md-nav__link:hover {
    color: #1a1a1a;
}

.md-nav__link--active {
    color: #1a1a1a;
    font-weight: 600;
}

/* 目录 */
.md-nav--secondary .md-nav__link {
    font-size: 13px;
    line-height: 1.5;
    padding: 4px 12px;
    white-space: normal;
    word-break: break-word;
}

/* ---------- 分割线 ---------- */
.md-typeset hr {
    border: none;
    border-top: 1px solid #e8e9ec;
    margin: 40px 0;
}

/* ---------- 列表 ---------- */
.md-typeset ul li {
    margin-bottom: 8px;
}

.md-typeset ol li {
    margin-bottom: 8px;
}

/* ---------- 滚动条 ---------- */
.md-sidebar__scrollwrap::-webkit-scrollbar {
    width: 4px;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-track {
    background: transparent;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* ---------- 暗色模式适配 ---------- */
body[data-md-color-scheme="slate"] {
    background: #121212 !important;
}

[data-md-color-scheme="slate"] .md-header {
    background: #1e1e1e !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    color: #ffffff !important;
}

[data-md-color-scheme="slate"] .md-header__inner {
    color: #ffffff;
}

[data-md-color-scheme="slate"] .md-header__button {
    color: #ffffff !important;
}

[data-md-color-scheme="slate"] .md-header__title,
[data-md-color-scheme="slate"] .md-header__topic {
    color: #ffffff !important;
}

[data-md-color-scheme="slate"] .md-content {
    background: #1e1e1e;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-md-color-scheme="slate"] .md-sidebar--primary,
[data-md-color-scheme="slate"] .md-sidebar--secondary {
    background: transparent !important;
    box-shadow: none !important;
}

[data-md-color-scheme="slate"] .md-tabs {
    background: #1e1e1e;
}

[data-md-color-scheme="slate"] .md-typeset pre {
    background: #2a2a2a;
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
    background: #2a2a2a;
}

[data-md-color-scheme="slate"] .md-nav__link {
    color: #aaa;
}

[data-md-color-scheme="slate"] .md-nav__link:hover {
    color: #ffffff;
}

[data-md-color-scheme="slate"] .md-nav__link--active {
    color: #ffffff;
}

/* ---------- 内容文字暗色模式 ---------- */
[data-md-color-scheme="slate"] .md-content h1 {
    color: #eee;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

[data-md-color-scheme="slate"] .md-content h2 {
    color: #eee;
}

[data-md-color-scheme="slate"] .md-content h3 {
    color: #ddd;
}

[data-md-color-scheme="slate"] .md-content p,
[data-md-color-scheme="slate"] .md-content li {
    color: #bbb;
}

/* ---------- 表格暗色模式 ---------- */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
    background: #2a2a2a;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
    background: #333;
    color: #eee;
    border-bottom: 1px solid #444;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
    border-top: 1px solid #3a3a3a;
    color: #ccc;
}

/* ---------- 引用块暗色模式 ---------- */
[data-md-color-scheme="slate"] .md-typeset blockquote {
    background: #2a2a2a;
    border-left-color: #555;
    color: #aaa;
}

/* ---------- 分割线暗色模式 ---------- */
[data-md-color-scheme="slate"] .md-typeset hr {
    border-top: 1px solid #333;
}



[data-md-color-scheme="slate"] .md-tabs__link {
    color: #aaa !important;
}

[data-md-color-scheme="slate"] .md-tabs__link--active,
[data-md-color-scheme="slate"] .md-tabs__link:hover {
    color: #ffffff !important;
}

/* ---------- 回到顶部按钮 ---------- */
#back-to-top {
    position: fixed;
    right: calc(32px + 300px);
    bottom: 32px;
    z-index: 999;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 52px;
    text-align: center;
    cursor: pointer;
    /* 多层阴影营造悬浮感 */
    box-shadow:
        0 1px 2px rgba(0,0,0,0.05),
        0 4px 8px rgba(0,0,0,0.08),
        0 8px 16px rgba(0,0,0,0.1),
        0 16px 32px rgba(0,0,0,0.12),
        0 2px 4px rgba(0,0,0,0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

#back-to-top:hover {
    background: #1a1a1a;
    color: #ffffff;
    transform: translateY(-4px);
    /* 悬停时阴影更强，悬浮感更明显 */
    box-shadow:
        0 2px 4px rgba(0,0,0,0.06),
        0 8px 16px rgba(0,0,0,0.1),
        0 16px 32px rgba(0,0,0,0.14),
        0 24px 48px rgba(0,0,0,0.18),
        0 4px 8px rgba(0,0,0,0.08);
}

#back-to-top:active {
    transform: translateY(-1px) scale(0.96);
    box-shadow:
        0 1px 2px rgba(0,0,0,0.05),
        0 4px 8px rgba(0,0,0,0.08),
        0 8px 16px rgba(0,0,0,0.1);
}

/* 暗色模式 */
[data-md-color-scheme="slate"] #back-to-top {
    background: #2a2a2a;
    color: #ffffff;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.2),
        0 4px 8px rgba(0,0,0,0.25),
        0 8px 16px rgba(0,0,0,0.3),
        0 16px 32px rgba(0,0,0,0.35),
        0 2px 4px rgba(0,0,0,0.2);
}

[data-md-color-scheme="slate"] #back-to-top:hover {
    background: #ffffff;
    color: #1a1a1a;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.15),
        0 8px 16px rgba(0,0,0,0.2),
        0 16px 32px rgba(0,0,0,0.25),
        0 24px 48px rgba(0,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.15);
}

/* 移动端适配 */
@media (max-width: 768px) {
    #back-to-top {
        right: calc(16px + 600px);
        bottom: 16px;
        width: 46px;
        height: 46px;
        line-height: 46px;
        font-size: 11px;
    }
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 768px) {
    .md-content {
        margin: 0 8px;
        padding: 28px 24px;
        border-radius: 20px;
    }

    .md-sidebar--primary,
    .md-sidebar--secondary {
        margin: 0;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    [data-md-color-scheme="slate"] .md-sidebar--primary,
    [data-md-color-scheme="slate"] .md-sidebar--secondary {
        background: transparent !important;
        box-shadow: none !important;
    }
}

/* ---------- 备案信息 ---------- */
.md-copyright__icp {
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

.md-copyright__icp a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.md-copyright__icp a:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

[data-md-color-scheme="slate"] .md-copyright__icp a {
    color: #777;
}

[data-md-color-scheme="slate"] .md-copyright__icp a:hover {
    color: #ffffff;
}
