/* ===================== 全局重置 ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    /* 暗色主题（空岛星空） */
    --dark-bg: #02020c;
    --dark-bg-secondary: rgba(255,255,255,0.05);
    --dark-text: #e6edf7;
    --dark-text-sub: #a2b2d8;
    --dark-border: rgba(120, 90, 255, 0.2);
    --dark-card-bg: rgba(255,255,255,0.04);
    /* 亮色主题（Shark Wiki） */
    --light-bg: #ffffff;
    --light-bg-secondary: #f6f8fa;
    --light-text: #1f2937;
    --light-text-sub: #6b7280;
    --light-border: #e5e7eb;
    --light-card-bg: #ffffff;
    /* 跳转胶囊按钮统一变量 */
    --btn-bg: #e9f1ff;
    --btn-color: #60a5fa;
    --btn-hover-bg: #d0e7ff;
    --btn-hover-border: #94b8ff;
    --btn-height: 28px;
    /* logo 文字：参考 kongdaokeji.top 的 .logo 用蓝紫渐变，
       暗色模式用亮渐变，亮色模式用深渐变以保证可读性 */
    --logo-gradient: linear-gradient(90deg, #64d0ff, #b89cff);
}
body {
    font-family: system-ui, -apple-system, "Microsoft YaHei", sans-serif;
    overflow: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}
/* 暗色默认 */
body[data-theme="dark"] {
    background: var(--dark-bg);
    color: var(--dark-text);
}
body[data-theme="light"] {
    background: var(--light-bg);
    color: var(--light-text);
    --logo-gradient: linear-gradient(90deg, #7c3aed, #2563eb);
}
/* 星空画布（全局背景层） */
#starCanvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.82;
    transition: opacity 0.4s ease;
}

body[data-theme="dark"]::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at center, rgba(2, 2, 12, 0.50) 0%, rgba(2, 2, 12, 0.85) 100%);
    pointer-events: none;
}
body[data-theme="light"] #starCanvas {
    opacity: 0;
}
/* ===================== 三栏布局容器 ===================== */
.wiki-container {
    display: grid;
    grid-template-columns: 260px 1fr 240px;
    height: 100vh;
}
/* 左侧导航栏 */
.sidebar-left {
    border-right: 1px solid;
    font-size: 14px; /* 新增：缩小整体字号 */
    overflow-y: auto;
    padding: 20px 14px;
    position: relative;
    display: flex;
    flex-direction: column;
}
body[data-theme="dark"] .sidebar-left {
    border-color: var(--dark-border);
    background: rgba(0,0,0,0.25);
}
body[data-theme="light"] .sidebar-left {
    border-color: var(--light-border);
    background: var(--light-bg-secondary);
}
/* 修复：侧边栏 logo 下方「空岛＆wiki」渐变文字。
   旧的 HTML 用了一层写死 #000 的黑色描边，在亮色背景会糊成黑块；
   这里隐藏黑色描边层，并统一改成青→粉高饱和渐变，无描边、无外发光，
   靠颜色本身在明暗背景下都清晰。 */
.sidebar-left div[style*="text-shadow:2px 2px 0 #000"] {
    display: none !important;
}
.sidebar-left div[style*="-webkit-background-clip:text"] {
    background: linear-gradient(90deg, #22d3ee, #f472b6) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
    filter: none !important;
}
/* 新写法：直接用 class，避免旧 HTML 描边层残留 */
.kd-logo-text {
    margin-top: 8px;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    background: linear-gradient(90deg, #22d3ee, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 0;
    text-shadow: none;
    filter: none;
}
/* 中间内容区 */
.content-main {
    overflow-y: auto;
    padding: 28px 36px;
    max-width: 900px;
    width: 100%;
    justify-self: center;
}
/* 首页引导与引用块（参考 docs.menu.wiki / docs.ggcheats.top） */
.home-lead {
    margin: 12px 0 24px;
    line-height: 1.7;
    color: var(--dark-text-sub);
}
body[data-theme="light"] .home-lead {
    color: var(--light-text-sub);
}
.wiki-home-note {
    margin: 20px 0 28px;
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid #60a5fa;
    font-size: 15px;
    line-height: 1.8;
}
body[data-theme="dark"] .wiki-home-note {
    background: rgba(96, 165, 250, 0.08);
    color: #dbeafe;
}
body[data-theme="light"] .wiki-home-note {
    background: #eff6ff;
    color: #1e3a8a;
}
.wiki-home-note p {
    margin: 6px 0;
}
.wiki-home-note p:first-child { margin-top: 0; }
.wiki-home-note p:last-child { margin-bottom: 0; }
.wiki-home-note ul {
    margin: 8px 0 0;
    padding-left: 20px;
}
.wiki-home-note li {
    margin: 4px 0;
}
/* 绿色使用建议卡 */
.wiki-home-note-success {
    border-left-color: #22c55e;
}
body[data-theme="dark"] .wiki-home-note-success {
    background: rgba(34, 197, 94, 0.08);
    color: #bbf7d0;
}
body[data-theme="light"] .wiki-home-note-success {
    background: #f0fdf4;
    color: #14532d;
}
/* 红色重要提醒卡 */
.wiki-home-note-danger {
    border-left-color: #ef4444;
}
body[data-theme="dark"] .wiki-home-note-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #fecaca;
}
body[data-theme="light"] .wiki-home-note-danger {
    background: #fef2f2;
    color: #7f1d1d;
}
/* 黄色/橙色警告卡 */
.wiki-home-note-warning {
    border-left-color: #f59e0b;
}
body[data-theme="dark"] .wiki-home-note-warning {
    background: rgba(245, 158, 11, 0.08);
    color: #fde68a;
}
body[data-theme="light"] .wiki-home-note-warning {
    background: #fffbeb;
    color: #78350f;
}
/* 引用块后的段落间距 */
.wiki-home-note + p {
    margin-top: 18px;
}

/* ===================== 全站内容文字统一美化 ===================== */
/* 目标：消除正文大大小小、影响阅读的问题（参考 Docusaurus 默认排版） */
.content-main {
    font-size: 15px;
    line-height: 1.75;
    color: var(--dark-text);
}
body[data-theme="light"] .content-main {
    color: var(--light-text);
}

/* 标题层级 */
.content-main h1,
.content-main header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 20px;
}
.content-main h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 36px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid;
    scroll-margin-top: 90px;
}
body[data-theme="dark"] .content-main h2 {
    border-color: rgba(120, 90, 255, 0.18);
}
body[data-theme="light"] .content-main h2 {
    border-color: #e5e7eb;
}
.content-main h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 28px 0 12px;
    scroll-margin-top: 90px;
}
.content-main h4 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.45;
    margin: 22px 0 10px;
}

/* 段落与文字 */
.content-main p,
.content-main > p {
    line-height: 1.75;
    margin: 12px 0;
}
.content-main strong,
.content-main b {
    font-weight: 600;
    color: inherit;
}

/* 列表 */
.content-main ul,
.content-main ol {
    padding-left: 26px;
    margin: 12px 0;
}
.content-main li {
    margin: 8px 0;
    line-height: 1.75;
}
.content-main li > ul,
.content-main li > ol {
    margin: 6px 0;
}

/* 引用块：添加左边框与背景，像目标站一样有层次感 */
.content-main blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 15px;
    line-height: 1.7;
}
body[data-theme="dark"] .content-main blockquote {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(120, 90, 255, 0.35);
    color: var(--dark-text-sub);
}
body[data-theme="light"] .content-main blockquote {
    background: #f9fafb;
    border-color: #c7d2fe;
    color: var(--light-text-sub);
}
.content-main blockquote p:first-child {
    margin-top: 0;
}
.content-main blockquote p:last-child {
    margin-bottom: 0;
}
/* 引用块中作为小标题的 strong 加大一点，形成视觉层级 */
.content-main blockquote > p:first-child > strong:only-child,
.content-main blockquote > p:first-child > strong:first-child {
    font-size: 1.05em;
    color: inherit;
}

/* 行内代码 */
.content-main code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
    padding: 2px 6px;
    border-radius: 5px;
    vertical-align: baseline;
}
body[data-theme="dark"] .content-main code {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}
body[data-theme="light"] .content-main code {
    background: #f3f4f6;
    color: #4b5563;
}

/* 代码块 */
.content-main pre {
    margin: 16px 0;
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}
body[data-theme="dark"] .content-main pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(120, 90, 255, 0.2);
}
body[data-theme="light"] .content-main pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.content-main pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
}

/* 图片与媒体 */
.content-main img,
.content-main video {
    max-width: 100%;
    border-radius: 8px;
    margin: 14px 0;
}

/* 分隔线 */
.content-main hr {
    border: none;
    border-top: 1px solid;
    margin: 32px 0;
}
body[data-theme="dark"] .content-main hr {
    border-color: rgba(120, 90, 255, 0.18);
}
body[data-theme="light"] .content-main hr {
    border-color: #e5e7eb;
}

/* 表格 */
.content-main table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.content-main th,
.content-main td {
    padding: 10px 12px;
    border: 1px solid;
    text-align: left;
}
body[data-theme="dark"] .content-main th,
body[data-theme="dark"] .content-main td {
    border-color: rgba(120, 90, 255, 0.2);
}
body[data-theme="light"] .content-main th,
body[data-theme="light"] .content-main td {
    border-color: #e5e7eb;
}
body[data-theme="dark"] .content-main th {
    background: rgba(255, 255, 255, 0.05);
}
body[data-theme="light"] .content-main th {
    background: #f9fafb;
}
/* 右侧目录栏 */
.sidebar-right {
    border-left: 1px solid;
    overflow-y: auto;
    padding: 20px 14px;
}
body[data-theme="dark"] .sidebar-right {
    border-color: var(--dark-border);
    background: rgba(0,0,0,0.25);
}
body[data-theme="light"] .sidebar-right {
    border-color: var(--light-border);
    background: var(--light-bg-secondary);
}
/* ===================== 统一滚动条美化（适配明暗双主题，全站一致） ===================== */
/* 作用于全部可滚动区域：左栏、内容区、右栏、侧边栏内滚动容器 */
.sidebar-left,
.content-main,
.sidebar-right,
.sidebar-scroll {
    scrollbar-width: thin;                 /* Firefox 细滚动条 */
}
body[data-theme="dark"] .sidebar-left,
body[data-theme="dark"] .content-main,
body[data-theme="dark"] .sidebar-right,
body[data-theme="dark"] .sidebar-scroll {
    scrollbar-color: rgba(139, 124, 246, 0.5) transparent;   /* 滑块 / 轨道 */
}
body[data-theme="light"] .sidebar-left,
body[data-theme="light"] .content-main,
body[data-theme="light"] .sidebar-right,
body[data-theme="light"] .sidebar-scroll {
    scrollbar-color: rgba(96, 165, 250, 0.55) transparent;
}

/* WebKit 内核滚动条（Chrome / Edge / Safari） */
.sidebar-left::-webkit-scrollbar,
.content-main::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar,
.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.sidebar-left::-webkit-scrollbar-track,
.content-main::-webkit-scrollbar-track,
.sidebar-right::-webkit-scrollbar-track,
.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 99px;
}
/* 暗色主题滑块：紫蓝渐变 + 悬浮内边距 + 悬停高亮 */
body[data-theme="dark"] .sidebar-left::-webkit-scrollbar-thumb,
body[data-theme="dark"] .content-main::-webkit-scrollbar-thumb,
body[data-theme="dark"] .sidebar-right::-webkit-scrollbar-thumb,
body[data-theme="dark"] .sidebar-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6, #60a5fa);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
body[data-theme="dark"] .sidebar-left::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .content-main::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .sidebar-right::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a78bfa, #7cc0ff);
    border-color: rgba(167, 139, 250, 0.3);
    background-clip: padding-box;
}
/* 亮色主题滑块：蓝调渐变 */
body[data-theme="light"] .sidebar-left::-webkit-scrollbar-thumb,
body[data-theme="light"] .content-main::-webkit-scrollbar-thumb,
body[data-theme="light"] .sidebar-right::-webkit-scrollbar-thumb,
body[data-theme="light"] .sidebar-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #93c5fd, #60a5fa);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
body[data-theme="light"] .sidebar-left::-webkit-scrollbar-thumb:hover,
body[data-theme="light"] .content-main::-webkit-scrollbar-thumb:hover,
body[data-theme="light"] .sidebar-right::-webkit-scrollbar-thumb:hover,
body[data-theme="light"] .sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #60a5fa, #3b82f6);
    border-color: rgba(96, 165, 250, 0.3);
    background-clip: padding-box;
}
/* 全站兜底：任意滚动元素（如搜索层、代码块）统一风格 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6, #60a5fa);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
body[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #93c5fd, #60a5fa);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
/* ===================== 顶部全局工具栏（主题切换+搜索） ===================== */
.global-cn-bar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 240px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid;
    z-index: 99;
}
body[data-theme="dark"] .global-cn-bar {
    border-color: var(--dark-border);
    background: rgba(2,2,12,0.75);
    backdrop-filter: blur(8px);
}
body[data-theme="light"] .global-cn-bar {
    border-color: var(--light-border);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
}
/* 顶部占位，避免内容被顶栏遮挡 */
.content-main {
    padding-top: 72px;
}
/* 主题切换按钮 */
.theme-switch-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
body[data-theme="dark"] .theme-switch-btn {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
body[data-theme="light"] .theme-switch-btn {
    background: #f3f4f6;
    color: #1f2937;
}
/* 顶部下载安装器按钮（位于主题切换右侧） */
.global-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: 0.2s;
    white-space: nowrap;
}
body[data-theme="dark"] .global-download-btn {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.35);
}
body[data-theme="dark"] .global-download-btn:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.55);
}
body[data-theme="light"] .global-download-btn {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}
body[data-theme="light"] .global-download-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}
/* 全局搜索框 */
.global-search-wrap {
    flex: 0 1 420px;
    position: relative;
    display: flex;
    align-items: center;
}
.global-search {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    padding: 0 38px 0 14px;
    border: 1px solid;
    outline: none;
    transition: 0.2s;
}
body[data-theme="dark"] .global-search {
    background: rgba(255,255,255,0.06);
    border-color: rgba(120,90,255,0.25);
    color: #fff;
}
body[data-theme="dark"] .global-search:focus {
    border-color: rgba(120,90,255,0.65);
    background: rgba(255,255,255,0.09);
}
body[data-theme="light"] .global-search {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #1f2937;
}
body[data-theme="light"] .global-search:focus {
    border-color: #a5b4fc;
    background: #fff;
}
.global-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}
body[data-theme="dark"] .global-search-btn {
    background: rgba(120,90,255,0.2);
    color: #c4b5fd;
}
body[data-theme="dark"] .global-search-btn:hover {
    background: rgba(120,90,255,0.4);
    color: #fff;
}
body[data-theme="light"] .global-search-btn {
    background: #eef2ff;
    color: #6366f1;
}
body[data-theme="light"] .global-search-btn:hover {
    background: #e0e7ff;
    color: #4f46e5;
}

/* ===================== 搜索结果页 ===================== */
.search-results-count {
    margin-bottom: 16px;
    font-size: 14px;
    opacity: 0.85;
}
.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.search-results-list li {
    margin: 0;
}
.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid;
}
body[data-theme="dark"] .search-result-item {
    background: var(--dark-card-bg);
    border-color: var(--dark-border);
    color: #e6edf7;
}
body[data-theme="dark"] .search-result-item:hover {
    background: rgba(120,90,255,0.12);
    border-color: rgba(120,90,255,0.45);
}
body[data-theme="light"] .search-result-item {
    background: var(--light-card-bg);
    border-color: var(--light-border);
    color: #1f2937;
}
body[data-theme="light"] .search-result-item:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.search-result-title {
    font-size: 15px;
    font-weight: 500;
}
.search-result-url {
    font-size: 12px;
    opacity: 0.65;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
}

/* ===================== Logo 旋转样式 无跳转首页 ===================== */
.logo-rotate-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto;
}
.logo-rotate-img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    animation: logoSpin 8s linear infinite;
}
@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===================== 播放器修改：固定在左侧侧边栏最底部 ===================== */
.music-mini-player {
    margin-top: auto;
    width: 100%;
    padding: 10px 10px;
    border-radius: 12px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    transition: all 0.24s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
body[data-theme="dark"] .music-mini-player {
    background: rgba(25, 20, 45, 0.65);
    border: 1px solid rgba(130, 100, 255, 0.22);
}
body[data-theme="light"] .music-mini-player {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(200, 200, 220, 0.5);
}
/* 播放器头部：歌曲名 + 控制行 */
.music-player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.music-song-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body[data-theme="dark"] .music-song-name {
    color: #e6edf7;
}
body[data-theme="light"] .music-song-name {
    color: #222;
}
/* 播放控制按钮组 */
.music-control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}
.music-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.2s;
}
body[data-theme="dark"] .music-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
body[data-theme="light"] .music-btn {
    background: #f0f0f5;
    color: #222;
}
.music-btn:hover {
    background: #60a5fa;
    color: #fff;
}
.music-play-btn {
    width: 32px;
    height: 32px;
}
.music-btn svg {
    width: 13px;
    height: 13px;
}
.music-play-btn svg {
    width: 15px;
    height: 15px;
}
/* 进度条区域 */
.music-progress-wrap {
    width: 100%;
}
.music-progress-bar {
    width: 100%;
    height: 4px;
    border-radius: 99px;
    cursor: pointer;
    position: relative;
}
body[data-theme="dark"] .music-progress-bar {
    background: rgba(255,255,255,0.15);
}
body[data-theme="light"] .music-progress-bar {
    background: #e2e2eb;
}
.music-progress-inner {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #8b5cf6, #60a5fa);
    width: 0%;
    transition: width 0.1s linear;
}
/* 时间文本 */
.music-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.7;
}
/* 音量控制行 */
.music-volume-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}
.music-volume {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}
body[data-theme="light"] .music-volume {
    background: #e2e2eb;
}
.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(90deg, #8b5cf6, #60a5fa);
    cursor: pointer;
}
.music-volume::-moz-range-thumb {
    width: 9px;
    height: 9px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(90deg, #8b5cf6, #60a5fa);
    cursor: pointer;
}
.music-volume-val {
    font-size: 10px;
    opacity: 0.7;
    min-width: 20px;
    text-align: right;
}
/* 循环按钮激活态 */
.music-loop-btn.active {
    background: #8b5cf6;
    color: #fff;
}
.music-loop-btn.active:hover {
    background: #7c4ddb;
}
/* 静音按钮字号（emoji 图标） */
.music-mute-btn {
    font-size: 12px;
}

/* ===================== 全局跳转胶囊按钮 ===================== */
.jump-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--btn-height);
    padding: 0 14px;
    background: var(--btn-bg);
    color: var(--btn-color);
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.jump-btn:hover {
    background: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
}
.jump-btn svg {
    width: 14px;
    height: 14px;
}

/* ===================== 段落内可跳转链接：小胶囊样式 ===================== */
/* 与截图「点此快速添加」一致：inline-block 胶囊，贴合段落文字 */
.content-main p a,
.content-main li a,
.content-main blockquote a,
.content-main .tab-content-panel a,
.content-main .wiki-home-note a {
    display: inline-block;
    vertical-align: middle;
    height: 26px;
    line-height: 24px;
    padding: 0 10px;
    margin: 0 2px;
    border-radius: 999px;
    border: 1px solid;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}
body[data-theme="dark"] .content-main p a,
body[data-theme="dark"] .content-main li a,
body[data-theme="dark"] .content-main blockquote a,
body[data-theme="dark"] .content-main .tab-content-panel a,
body[data-theme="dark"] .content-main .wiki-home-note a {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.10);
    border-color: rgba(96, 165, 250, 0.35);
}
body[data-theme="light"] .content-main p a,
body[data-theme="light"] .content-main li a,
body[data-theme="light"] .content-main blockquote a,
body[data-theme="light"] .content-main .tab-content-panel a,
body[data-theme="light"] .content-main .wiki-home-note a {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}
body[data-theme="dark"] .content-main p a:hover,
body[data-theme="dark"] .content-main li a:hover,
body[data-theme="dark"] .content-main blockquote a:hover,
body[data-theme="dark"] .content-main .tab-content-panel a:hover,
body[data-theme="dark"] .content-main .wiki-home-note a:hover {
    background: rgba(59, 130, 246, 0.20);
    border-color: rgba(96, 165, 250, 0.55);
}
body[data-theme="light"] .content-main p a:hover,
body[data-theme="light"] .content-main li a:hover,
body[data-theme="light"] .content-main blockquote a:hover,
body[data-theme="light"] .content-main .tab-content-panel a:hover,
body[data-theme="light"] .content-main .wiki-home-note a:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* 排除不需要胶囊化的组件链接 */
.content-main a.tab-switch,
.content-main a.kd-link-card,
.content-main a.kd-pagination-next,
.content-main a.kd-pagination-prev,
.content-main a.toc-item,
.content-main a.hash-link,
.content-main a.global-download-btn,
.content-main a.sidebar-nav-item,
.content-main a.music-upload-btn,
.content-main a.music-mute-btn,
.content-main a.music-loop-btn {
    display: initial;
    vertical-align: initial;
    height: auto;
    line-height: inherit;
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    background: transparent;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* ===================== Tab 组件（与目标文档 Docusaurus Tabs 保持一致） ===================== */
/* 规则：多 tab 默认激活第一项，点击互斥切换，只显示一个面板；单 tab 直接显示内容 */
.tab-wrap {
    margin: 22px 0;
}

/* tab 切换条：小胶囊样式，贴合段落 */
.tab-switch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tab-switch {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}
body[data-theme="dark"] .tab-switch {
    color: var(--dark-text-sub);
    border-color: rgba(120, 90, 255, 0.25);
    background: rgba(255,255,255,0.03);
}
body[data-theme="light"] .tab-switch {
    color: #6b7280;
    border-color: #d1d5db;
    background: #f9fafb;
}
body[data-theme="dark"] .tab-switch:hover {
    color: #e6edf7;
    background: rgba(255,255,255,0.08);
    border-color: rgba(139, 92, 246, 0.45);
}
body[data-theme="light"] .tab-switch:hover {
    color: #1f2937;
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* active：蓝色胶囊 */
.tab-switch.active {
    color: #fff !important;
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

/* tab 内容面板 */
.tab-content-panel {
    display: none;
    padding: 18px;
    border-radius: 10px;
    animation: tabFadeIn 0.2s ease;
}
body[data-theme="dark"] .tab-content-panel {
    background: var(--dark-card-bg);
    border: 1px solid var(--dark-border);
}
body[data-theme="light"] .tab-content-panel {
    background: var(--light-card-bg);
    border: 1px solid var(--light-border);
}
.tab-content-panel.open {
    display: block;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 单 tab 不显示切换条，只显示内容 */
.tab-wrap.single-tab .tab-switch-group {
    display: none;
}
.tab-wrap.single-tab .tab-content-panel {
    display: block;
}

/* tab 内信息提示框（如"点击上方标签查看更多内容"） */
.tab-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.6;
}
body[data-theme="dark"] .tab-info {
    background: rgba(59,130,246,0.10);
    border-left: 3px solid #3b82f6;
    color: #93c5fd;
}
body[data-theme="light"] .tab-info {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    color: #1d4ed8;
}
.tab-info svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* tab 内勾选列表项 */
.tab-check {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 7px 0;
    font-size: 14px;
}
.tab-check-icon {
    color: #22c55e;
    font-weight: bold;
}
.tab-check-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
}
body[data-theme="dark"] .tab-check-tag {
    background: rgba(59,130,246,0.14);
    color: #60a5fa;
}
body[data-theme="light"] .tab-check-tag {
    background: #dbeafe;
    color: #2563eb;
}
/* ===================== 媒体样式 ===================== */
/* 图片灯箱类 */
.lightbox-img {
    max-width: 100%;
    border-radius: 8px;
    cursor: zoom-in;
    transition: 0.2s;
}
.lightbox-img:hover {
    opacity: 0.9;
}
/* 视频全局样式 */
video {
    max-width: 650px;
    width: min(650px, 100%);
    border-radius: 8px;
    display: block;
    margin: 12px 0;
}
video.limit-450 {
    max-width: 450px;
}
/* 灯箱遮罩 */
.lightbox-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.lightbox-mask.show {
    display: flex;
}
.lightbox-inner-img {
    max-width: 96vw;
    max-height: 96vh;
    width: auto;
    height: auto;
    cursor: grab;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.6);
}
.lightbox-inner-img:active { cursor: grabbing; }
/* 灯箱全屏模式：双击或按钮切换 */
.lightbox-mask.fullscreen .lightbox-inner-img {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
}
/* ===================== 提示色块 ===================== */
.alert-block {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid;
}
.alert-info {
    background: rgba(96, 165, 250, 0.12);
    border-left-color: #60a5fa;
}
.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-left-color: #10b981;
}
.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-left-color: #f59e0b;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-left-color: #ef4444;
}
body[data-theme="light"] .alert-info { color: #1e40af; }
body[data-theme="light"] .alert-success { color: #047857; }
body[data-theme="light"] .alert-warning { color: #92400e; }
body[data-theme="light"] .alert-danger { color: #b91c1c; }
/* ===================== 左侧侧边栏导航样式 ===================== */
.sidebar-nav-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 22px 0 10px;
    opacity: 0.6;
}
.sidebar-nav-item {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    margin: 4px 0;
    font-size: 14px;
    transition: 0.2s;
}
body[data-theme="dark"] .sidebar-nav-item {
    color: var(--dark-text-sub);
}
body[data-theme="light"] .sidebar-nav-item {
    color: var(--light-text-sub);
}
.sidebar-nav-item:hover, .sidebar-nav-item.active {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}
/* ===================== 右侧目录锚点 ===================== */
.toc-item {
    display: block;
    padding: 6px 8px;
    text-decoration: none;
    font-size: 13px;
    margin: 3px 0;
    border-radius: 5px;
    transition: 0.2s;
}
body[data-theme="dark"] .toc-item {
    color: var(--dark-text-sub);
}
body[data-theme="light"] .toc-item {
    color: var(--light-text-sub);
}
.toc-item:hover, .toc-item.active-toc {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}
.toc-level-2 { padding-left: 12px; }
.toc-level-3 { padding-left: 22px; }
/* ===================== 页面底部备案 ===================== */
.wiki-footer {
    margin-top: 80px;
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    border-top: 1px solid;
}
body[data-theme="dark"] .wiki-footer {
    border-color: var(--dark-border);
    color: var(--dark-text-sub);
}
body[data-theme="light"] .wiki-footer {
    border-color: var(--light-border);
    color: var(--light-text-sub);
}
/* ===================== 分类卡片网格（教程首页新增） ===================== */
.kd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 18px 0 24px;
}
.kd-card {
    display: block;
    padding: 18px;
    border-radius: 12px;
    text-decoration: none;
    transition: 0.2s;
}
body[data-theme="dark"] .kd-card {
    background: var(--dark-card-bg);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
}
body[data-theme="light"] .kd-card {
    background: var(--light-card-bg);
    border: 1px solid var(--light-border);
    color: var(--light-text);
}
.kd-card:hover {
    border-color: #94b8ff;
    transform: translateY(-2px);
}
.kd-card h3 { margin-bottom: 6px; color: #60a5fa; }
.kd-card p { font-size: 13px; opacity: 0.8; line-height: 1.6; }

/* ===================== 主页相关链接 / 快速开始卡片（圆润玻璃态） ===================== */
.kd-home-divider {
    border: none;
    height: 1px;
    margin: 40px 0 32px;
    background: linear-gradient(90deg, transparent, rgba(128,128,140,0.18), transparent);
}
body[data-theme="dark"] .kd-home-divider {
    background: linear-gradient(90deg, transparent, rgba(160,170,200,0.12), transparent);
}

.kd-link-grid,
.content-main .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 24px 0 38px;
}
@media (max-width: 768px) {
    .kd-link-grid,
    .content-main .row { grid-template-columns: 1fr; }
}
.content-main .row .col--6 {
    width: 100%; padding: 0; flex: none; max-width: none;
}

/* ====== 首页卡片：圆润玻璃态（与斜切角跳转卡片完全不同风格） ====== */
.kd-link-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 28px 24px;
    border-radius: 20px;
    text-decoration: none;
    min-height: 108px;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(.23,1,.32,1),
                box-shadow 0.35s ease,
                background 0.35s ease;
    /* 无边框、纯背景 + 柔光阴影 */
    border: none;
}
/* 内部柔光渐变 */
.kd-link-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: 0;
}
/* 底部微光条 */
.kd-link-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease, width 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

/* ====== 暗色模式：深灰蓝玻璃 ====== */
body[data-theme="dark"] .kd-link-card {
    background:
        radial-gradient(ellipse at 30% 10%, rgba(99,102,241,0.08) 0%, transparent 55%),
        linear-gradient(180deg, rgba(30,30,48,0.92) 0%, rgba(24,24,42,0.96) 100%);
    color: #e8ecf4;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.25),
        0 1px 3px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.03);
}
body[data-theme="dark"] .kd-link-card::after {
    background: linear-gradient(90deg, transparent, rgba(167,139,250,0.45), transparent);
}
body[data-theme="dark"] .kd-link-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 14px 36px rgba(0,0,0,0.35),
        0 6px 20px rgba(88,68,196,0.12),
        inset 0 1px 0 rgba(255,255,255,0.05);
}
body[data-theme="dark"] .kd-link-card:hover::after {
    opacity: 1;
    left: 8%;
    right: 8%;
}

/* ====== 亮色模式：浅灰白玻璃 ====== */
body[data-theme="light"] .kd-link-card {
    background:
        radial-gradient(ellipse at 70% 0%, rgba(99,102,241,0.05) 0%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    color: #1e293b;
    box-shadow:
        0 2px 10px rgba(15,23,42,0.06),
        0 1px 3px rgba(15,23,42,0.04);
}
body[data-theme="light"] .kd-link-card::after {
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.35), transparent);
}
body[data-theme="light"] .kd-link-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 14px 34px rgba(15,23,42,0.10),
        0 6px 18px rgba(99,102,247,0.06);
}
body[data-theme="light"] .kd-link-card:hover::after {
    opacity: 1;
    left: 8%;
    right: 8%;
}

/* 卡片文字层 */
.kd-link-card h2,
.kd-link-card p,
.kd-link-card > * { position: relative; z-index: 1; }

.kd-link-card h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    margin: 0 0 8px;
    color: inherit;
    transition: color 0.25s ease;
}
.kd-link-card p {
    font-size: 13.5px;
    line-height: 1.55;
    text-align: center;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}
body[data-theme="dark"] .kd-link-card p { color: rgba(180,190,210,0.65); }
body[data-theme="light"] .kd-link-card p { color: rgba(71,85,105,0.72); }

/* 主页手工卡片：横向排列（图标+标题） */
.kd-link-card.kd-link-card-row {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 74px;
    padding: 18px 22px;
}
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.28s ease, background 0.28s ease;
}
body[data-theme="light"] .kd-link-card.kd-link-card-row > .kd-link-icon {
    background: rgba(59,130,246,0.10);
}
body[data-theme="dark"] .kd-link-card.kd-link-card-row > .kd-link-icon {
    background: rgba(96,165,250,0.15);
}
.kd-link-card.kd-link-card-row:hover > .kd-link-icon {
    transform: scale(1.12) rotate(-4deg);
}
.kd-link-card.kd-link-card-row > .kd-link-title {
    font-size: 15.5px;
    font-weight: 500;
    text-align: center;
}

/* 覆盖之前对 .content-main a.kd-link-card 的重置，避免被通用链接胶囊样式覆盖 */
.content-main a.kd-link-card {
    display: flex;
}

/* ===================== 主页底部翻页 ===================== */
.kd-pagination {
    display: flex;
    justify-content: flex-end;
    margin: 40px 0 20px;
}
.kd-pagination-next {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 14px 18px;
    border-radius: 10px;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid;
}
body[data-theme="dark"] .kd-pagination-next {
    background: rgba(255,255,255,0.04);
    border-color: rgba(120,90,255,0.2);
    color: var(--dark-text);
}
body[data-theme="light"] .kd-pagination-next {
    background: #ffffff;
    border-color: #e5e7eb;
    color: var(--light-text);
}
.kd-pagination-next:hover {
    border-color: #94b8ff;
}
.kd-pagination-label {
    font-size: 12px;
    opacity: 0.7;
}
.kd-pagination-target {
    font-size: 15px;
    font-weight: 500;
    color: #60a5fa;
}

/* ===================== Phase 1 优化：移动端响应式 + 无障碍 ===================== */
/* 汉堡按钮：默认隐藏，仅小屏显示（JS 注入到顶部工具栏） */
.kd-menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}
body[data-theme="dark"] .kd-menu-toggle { background: rgba(255,255,255,0.08); color: #fff; }
body[data-theme="light"] .kd-menu-toggle { background: #f3f4f6; color: #1f2937; }
.kd-menu-toggle:hover { background: #60a5fa; color: #fff; }

/* 抽屉遮罩 */
.kd-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.kd-nav-overlay.show { opacity: 1; visibility: visible; }

@media (max-width: 1024px) {
    .kd-menu-toggle { display: inline-flex; }
    .wiki-container { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
    .global-cn-bar { left: 0; right: 0; padding: 0 14px; }
    .global-search-wrap { flex: 1 1 auto; min-width: 0; }
    .sidebar-left {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 284px;
        max-width: 84vw;
        z-index: 95;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        padding-top: 64px;
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }
    body.kd-nav-open .sidebar-left { transform: translateX(0); }
    /* 右侧栏：窄屏不隐藏，改为可滚动浮层（保留目录跳转功能） */
    .sidebar-right {
        position: fixed;
        top: 64px;
        bottom: 0;
        right: 0;
        width: 220px;
        max-width: 80vw;
        z-index: 94;
        background: var(--dark-bg, rgba(18,18,22,0.97));
        border-left: 1px solid var(--dark-border, rgba(255,255,255,0.08));
        box-shadow: -4px 0 24px rgba(0,0,0,0.45);
        transform: translateX(100%);
        transition: transform 0.28s ease;
        padding: 16px 12px;
    }
    body[data-theme="light"] .sidebar-right {
        background: var(--light-bg-secondary, rgba(255,255,255,0.97));
        border-color: var(--light-border, rgba(0,0,0,0.08));
        box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    }
    .sidebar-right.show { transform: translateX(0); }
    .content-main { padding: 72px 18px 48px; max-width: 100%; }
    /* 缩小首页卡片网格在手机上的内边距 */
    .kd-link-card { padding: 18px; }
}

/* 键盘焦点可见性（无障碍） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.tab-switch:focus-visible,
.kd-cat-toggle:focus-visible,
.kd-menu-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
    border-radius: 6px;
}

/* 尊重系统“减少动态效果”偏好（性能 + 无障碍） */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .logo-rotate-img { animation: none !important; }
    #starCanvas { display: none; }
}

/* 极窄屏：顶栏下载按钮仅保留图标，避免与搜索框拥挤 */
@media (max-width: 640px) {
    .global-download-btn span { display: none; }
    .global-download-btn { padding: 0 10px; }
}

/* ===================== Phase 3 视觉复刻补充：打印样式 ===================== */
/* 教程页打印时隐藏导航/顶栏/音乐/星空，正文明暗主题统一为黑字白底，便于留存 */
@media print {
    #starCanvas, .global-cn-bar, .sidebar-left, .sidebar-right,
    .music-mini-player, .lightbox-mask, .kd-nav-overlay, .kd-menu-toggle {
        display: none !important;
    }
    html, body { background: #fff !important; color: #000 !important; }
    body { overflow: visible !important; }
    .wiki-container { display: block !important; height: auto !important; }
    .content-main {
        max-width: 100% !important;
        padding: 0 !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.5;
    }
    .content-main a { color: #000 !important; text-decoration: underline; }
    .kd-link-card, .wiki-home-note, .alert-block, .tab-content-panel,
    .search-result-item, .kd-pagination-next {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: #fff !important;
        color: #000 !important;
        break-inside: avoid;
    }
    .content-main h1, .content-main h2, .content-main h3, .content-main h4 {
        color: #000 !important;
        border-color: #999 !important;
        page-break-after: avoid;
    }
    .content-main img, .content-main video { max-width: 100% !important; }
    a[href]:after { content: ""; }
}

/* ===================== Docusaurus 组件兼容样式 ===================== */

/* --- Markdown 正文容器 --- */
.theme-doc-markdown.markdown {
    line-height: 1.75;
    font-size: 15px;
    word-wrap: break-word;
}
.theme-doc-markdown.markdown > header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
}
body[data-theme="dark"] .theme-doc-markdown.markdown { color: var(--dark-text); }
body[data-theme="light"] .theme-doc-markdown.markdown { color: var(--light-text); }

/* --- 标题锚点 (321+ 页) --- */
.anchor.anchorTargetStickyNavbar_Vzrq {
    position: relative;
    scroll-margin-top: 72px;
}
.hash-link {
    opacity: 0;
    margin-left: 8px;
    color: inherit;
    text-decoration: none;
    font-weight: 400;
    transition: opacity 0.15s;
    font-size: 0.85em;
}
h2:hover .hash-link,
h3:hover .hash-link,
h4:hover .hash-link {
    opacity: 0.65;
}
.hash-link:hover { opacity: 1 !important; }

/* --- 标签页 Tabs (321 页，最关键) --- */
.theme-tabs-container.tabs-container.tabList__CuJ {
    margin: 16px 0;
    border: 1px solid var(--dark-border, rgba(120,90,255,0.18));
    border-radius: 10px;
    overflow: hidden;
}
body[data-theme="light"] .theme-tabs-container.tabs-container.tabList__CuJ {
    border-color: var(--light-border, #e5e7eb);
}
.theme-tabs-container .tabs {
    display: flex;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--dark-border, rgba(120,90,255,0.18));
    flex-wrap: wrap;
    gap: 0;
}
body[data-theme="light"] .theme-tabs-container .tabs {
    background: #f8fafc;
    border-bottom-color: var(--light-border, #e5e7eb);
}
.theme-tabs-container .tabs__item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-text-sub, #a2b2d8);
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    list-style: none !important;
    display: inline-block;
}
body[data-theme="light"] .theme-tabs-container .tabs__item {
    color: var(--light-text-sub, #6b7280);
}
.theme-tabs-container .tabs__item:hover {
    color: var(--dark-text, #e6edf7);
    background: rgba(255,255,255,0.05);
}
body[data-theme="light"] .theme-tabs-container .tabs__item:hover {
    color: var(--light-text, #1f2937);
    background: rgba(0,0,0,0.04);
}
.theme-tabs-container .tabs__item.tabs__item--active {
    color: #64d0ff;
    border-bottom-color: #64d0ff;
    background: rgba(100,208,255,0.06);
}
body[data-theme="light"] .theme-tabs-container .tabs__item.tabs__item--active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: rgba(37,99,235,0.06);
}
/* Tab panels - show active, hide inactive */
.theme-tabs-container .tabItem_Ymn6[hidden] {
    display: none !important;
}
.theme-tabs-container .tabItem_Ymn6 {
    padding: 16px 20px;
    display: block;
}
.theme-tabs-container .margin-top--md {
    margin-top: 12px;
}

/* --- 提示框 Admonitions (248 页) --- */
/* ====== Admonition 提示框（圆润柔和玻璃态，与斜切角卡片完全不同） ====== */
.theme-admonition.admonition_xJq3 {
    margin: 18px 0;
    border-radius: 16px;
    border: none;
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
    overflow: hidden;
}
/* 左侧装饰条（圆角） */
.theme-admonition.admonition_xJq3::before {
    content: '';
    position: absolute;
    left: 0; top: 16px; bottom: 16px;
    width: 4px;
    border-radius: 4px;
    pointer-events: none;
}

/* 暗色模式 */
.theme-admonition.alert--danger {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(239,68,68,0.08) 0%, transparent 60%),
        rgba(40,28,32,0.85);
    color: #fca5a5;
}
.theme-admonition.alert--danger::before { background: #ef4444; }

.theme-admonition.alert--info {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(59,130,246,0.07) 0%, transparent 60%),
        rgba(26,32,48,0.85);
    color: #93c5fd;
}
.theme-admonition.alert--info::before { background: #3b82f6; }

.theme-admonition.alert--warning {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(245,158,11,0.07) 0%, transparent 60%),
        rgba(42,36,24,0.85);
    color: #fcd34d;
}
.theme-admonition.alert--warning::before { background: #f59e0b; }

.theme-admonition.alert--success {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(34,197,94,0.06) 0%, transparent 60%),
        rgba(22,38,30,0.85);
    color: #86efac;
}
.theme-admonition.alert--success::before { background: #22c55e; }

/* 亮色模式 */
body[data-theme="light"] .theme-admonition.alert--danger {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(239,68,68,0.05) 0%, transparent 55%),
        #fef2f2;
    color: #991b1b;
}
body[data-theme="light"] .theme-admonition.alert--info {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(59,130,246,0.04) 0%, transparent 55%),
        #eff6ff;
    color: #1e40af;
}
body[data-theme="light"] .theme-admonition.alert--warning {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(245,158,11,0.04) 0%, transparent 55%),
        #fffbeb;
    color: #92400e;
}
body[data-theme="light"] .theme-admonition.alert--success {
    background:
        radial-gradient(ellipse at 0% 50%, rgba(34,197,94,0.03) 0%, transparent 55%),
        #f0fdf4;
    color: #166534;
}

.admonitionHeading_Gvgb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}
.admonitionIcon_Rf37 svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
}
.admonitionIcon_Rf37 {
    display: inline-flex;
    align-items: center;
}
.admonitionContent_BuS1 {
    padding: 0;
}
.admonitionContent_BuS1 ul {
    padding-left: 20px;
    margin: 4px 0;
}
.admonitionContent_BuS1 li {
    margin: 4px 0;
}
.admonitionContent_BuS1 p {
    margin: 4px 0;
}
.admonitionContent_BuS1 strong {
    font-weight: 600;
}
.admonitionContent_BuS1 code {
    background: rgba(128,128,128,0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}
body[data-theme="light"] .admonitionContent_BuS1 code {
    background: rgba(0,0,0,0.06);
}

/* --- 代码块 Prism (37 页) --- */
.prism-code {
    display: block;
    background: #0d1117 !important;
    color: #c9d1d9;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    margin: 12px 0;
    border: 1px solid rgba(120,90,255,0.15);
}
body[data-theme="light"] .prism-code {
    background: #f6f8fa !important;
    color: #24292f;
    border-color: #d0d7de;
}
code[class*="language-"],
pre[class*="language-"] {
    font-family: inherit;
    font-size: inherit;
}

/* --- 卡片列表 docCardListItem (斜切角·流光·非矩形) --- */
.docCardListItem_W1sv {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.custom-link-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
    margin: 26px 0;
    padding: 0;
    list-style: none;
}

/* 双切角：右上 + 左下，彻底打破方形 */
.docCardListItem_W1sv a {
    --cut: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 30px;
    min-height: 104px;
    /* a 自身背景 = 渐变边框色 */
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 35%, #3b82f6 70%, #6366f1 100%);
    clip-path: polygon(
        0 0,
        calc(100% - var(--cut)) 0,
        100% var(--cut),
        100% 100%,
        var(--cut) 100%,
        0 calc(100% - var(--cut))
    );
    text-decoration: none;
    color: #e8eaf0;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(.23,1,.32,1),
                filter 0.4s cubic-bezier(.23,1,.32,1);
    will-change: transform, filter;
}
/* 内层实色背景（留出 1.5px 露渐变边框）—— 暗色用亮灰调 */
.docCardListItem_W1sv a::before {
    content: '';
    position: absolute;
    inset: 1.5px;
    z-index: 1;
    background: linear-gradient(135deg, #2a2840 0%, #302d48 100%);
    clip-path: polygon(
        0 0,
        calc(100% - var(--cut)) 0,
        100% var(--cut),
        100% 100%,
        var(--cut) 100%,
        0 calc(100% - var(--cut))
    );
    transition: inset 0.35s ease;
    pointer-events: none;
}
/* 流光扫过（hover 触发） */
.docCardListItem_W1sv a::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -60%;
    width: 220%;
    height: 220%;
    z-index: 3;
    background: linear-gradient(
        115deg,
        transparent 40%,
        rgba(255,255,255,0.14) 50%,
        transparent 60%
    );
    transform: translateX(-130%);
    transition: transform 0.65s cubic-bezier(.45,.05,.55,.95);
    pointer-events: none;
}
/* 文字置于内层之上 */
.docCardListItem_W1sv a h2,
.docCardListItem_W1sv a p {
    position: relative;
    z-index: 2;
}

/* 标题（暗色） */
.docCardListItem_W1sv a h2 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.42;
    color: #f0f0f8;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: color 0.3s ease, transform 0.3s ease;
}
/* 标题前缀渐变圆点 */
.docCardListItem_W1sv a h2::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    flex-shrink: 0;
    box-shadow: 0 0 0 rgba(99,102,241,0);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* 描述文字（暗色） */
.docCardListItem_W1sv a p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.68;
    color: rgba(180,185,200,0.66);
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

/* ====== 暗色 Hover ====== */
.docCardListItem_W1sv a:hover {
    transform: translateY(-6px);
    /* drop-shadow 沿切角轮廓投影，不被 clip-path 裁 */
    filter: drop-shadow(0 14px 30px rgba(99,102,241,0.38));
}
.docCardListItem_W1sv a:hover::before { inset: 2.5px; }
.docCardListItem_W1sv a:hover::after  { transform: translateX(130%); }
.docCardListItem_W1sv a:hover h2 {
    color: #ffffff;
    transform: translateX(2px);
}
.docCardListItem_W1sv a:hover h2::before {
    transform: scale(1.25);
    box-shadow: 0 0 12px rgba(99,102,241,0.55);
}
.docCardListItem_W1sv a:hover p { color: rgba(212,216,232,0.85); }

/* ====== 亮色模式 ====== */
body[data-theme="light"] .docCardListItem_W1sv a {
    /* 低饱和度淡紫灰渐变边框 */
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 35%, #93c5fd 70%, #a5b4fc 100%);
    color: #1f2937;
}
body[data-theme="light"] .docCardListItem_W1sv a::before {
    background: linear-gradient(135deg, #f8f9fb 0%, #f4f5fa 100%);
}
body[data-theme="light"] .docCardListItem_W1sv a h2 { color: #312e81; }
body[data-theme="light"] .docCardListItem_W1sv a h2::before {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
body[data-theme="light"] .docCardListItem_W1sv a p { color: rgba(71,85,105,0.72); }

/* ====== 亮色 Hover ====== */
body[data-theme="light"] .docCardListItem_W1sv a:hover {
    transform: translateY(-6px);
    filter: drop-shadow(0 14px 30px rgba(99,102,241,0.12));
}
body[data-theme="light"] .docCardListItem_W1sv a:hover h2 { color: #312e81; }
body[data-theme="light"] .docCardListItem_W1sv a:hover p { color: rgba(51,65,85,0.9); }

/* --- 图片 img_ev3q (401 处) --- */
.img_ev3q {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--dark-border, rgba(120,90,255,0.15));
    margin: 12px 0;
}
body[data-theme="light"] .img_ev3q {
    border-color: var(--light-border, #e5e7eb);
}

/* --- 排版间距工具类 --- */
.margin-top--lg { margin-top: 24px; }
.margin-top--md { margin-top: 16px; }
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* --- 正文内通用排版 --- */
.content-main hr {
    border: none;
    height: 1px;
    background: var(--dark-border, rgba(120,90,255,0.18));
    margin: 24px 0;
}
body[data-theme="light"] .content-main hr {
    background: var(--light-border, #e5e7eb);
}
.content-main table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.content-main th, .content-main td {
    padding: 10px 14px;
    border: 1px solid var(--dark-border, rgba(120,90,255,0.18));
    text-align: left;
}
body[data-theme="light"] .content-main th,
body[data-theme="light"] .content-main td {
    border-color: var(--light-border, #e5e7eb);
}
.content-main th {
    background: rgba(255,255,255,0.05);
    font-weight: 600;
}
body[data-theme="light"] .content-main th {
    background: #f8fafc;
}
.content-main blockquote {
    border-left: 3px solid #64d0ff;
    padding: 8px 16px;
    margin: 12px 0;
    color: var(--dark-text-sub, #a2b2d8);
    background: rgba(100,208,255,0.04);
    border-radius: 0 6px 6px 0;
}
body[data-theme="light"] .content-main blockquote {
    color: var(--light-text-sub, #6b7280);
    background: rgba(37,99,235,0.03);
    border-left-color: #2563eb;
}
.content-main ul, .content-main ol {
    padding-left: 24px;
    margin: 8px 0;
}
.content-main li {
    margin: 4px 0;
}
.content-main li > p {
    margin: 4px 0;
}
.content-main strong {
    font-weight: 600;
}
.content-main em {
    font-style: italic;
}
.text-blue { color: #60a5fa; }
.text-orange { color: #fb923c; }
.text-grey { color: var(--dark-text-sub, #a2b2d8); }
body[data-theme="light"] .text-grey { color: var(--light-text-sub, #6b7280); }

/* --- Tab JS 切换支持（无 JS 时默认显示第一个面板） --- */
.theme-tabs-container .tabItem_Ymn6:not([hidden]) {
    display: block;
}
