
/* CSS变量定义 - ReGenStitch 紫粉黄主题 */
:root {
    --content-primary: #6B5B95;        /* 深紫 - 主色调 */
    --content-primary-dark: #4B2C4B;   /* 更深的紫 */
    --content-accent: #681b75;         /* 粉色 - 强调色 */
    --content-accent-light: #FFB6C1;   /* 浅粉 */
    --content-highlight: #f3db94;      /* 荧光黄 - 高亮色 */
    --content-light-purple: #D8B5E8;   /* 浅紫 - 背景装饰 */
    --content-surface: #ffffff;        /* 白色底 */
    --content-bg: #F8F6FB;             /* 浅紫灰背景 */
    --content-border: #E8D8F0;         /* 浅紫边框 */
    --content-text: #2d2d2d;           /* 深灰文字 */
    --content-muted: #6b6b6b;          /* 次要文字 */
}

.pdf_preview {
    width: 100%;
    height: 30vw;
    overflow: hidden;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.pdf_preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* smpt 加粗字体样式 - 荧光黄背景高亮 */
smpt {
    color: var(--content-primary-dark);
    font-weight: bold;
    font-size: 1.05em;
    letter-spacing: 0.02em;
    background: linear-gradient(180deg, transparent 50%, var(--content-highlight) 50%);
    display: contents;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
}


/* em 斜体样式 - 简洁版，用于专业术语 */
em {
    font-style: italic;
    display: contents;
}

/* 侧边栏中的斜体保持紧凑 */
.wiki-sidebar em {
    font-style: italic;
    display: inline !important;
}

.cover_title {
    position: absolute;
    top: 40%;
    font-size: 5vw;
    font-family: 'title-font';
    color: white;
    /* text-decoration: underline; */
    transform: translateY(-50%);
}

.section-header::before {
    /* content: "◆"; */
    font-size: 1.8rem;
    color: var(--content-accent);
    flex-shrink: 0;
    margin-right: 4px;
}

.section-header::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--content-border);
    margin-left: 20px;
}

/* a 超链接样式 */
p a {
    color: var(--content-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    font-weight: 500;
    text-decoration: underline;
}

.content-card p a::after {
    content: "↗";
    font-size: 0.8em;
    margin-left: 4px;
}

.content-card p a:hover {
    text-decoration: none;
    background-color: var(--content-primary);
    color: white !important;
    padding: 4px 8px;
    border-radius: 4px;
}

p a:active {
    color: var(--content-primary);
    transform: translateY(0);
}

p a:visited {
    color: var(--content-primary-dark);
    opacity: 0.8;
}

/* 主内容区域布局 */
.wiki-content-wrapper {
    max-width: none;
    margin: 0;
    padding: 60px 18vw 60px 10vw; /* 调整右侧边距，与增加的内容宽度保持平衡 */
    position: relative;
    /* background: linear-gradient(135deg, var(--content-bg) 0%, rgba(255,255,255,1) 100%); */
    min-height: 100vh;
}

.wiki-main-content {
    padding-left: 0;
    min-height: 100vh;
}


.sidebar-title img {
    width: 100%;
    height: auto;
    max-width: 100% !important;
}

/* =============================
   侧边栏目录设计
   ============================= */
.page_content {
    display: flex;
    gap: 2vw;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    align-items: flex-start; /* 确保子元素从顶部对齐 */
}

.wiki-sidebar {
    position: sticky;
    top: 40px;
    align-self: flex-start; /* 关键：确保sticky定位正常工作 */
    flex-shrink: 0;
    width: 17vw;
    max-height: calc(100vh - 100px);
    background: linear-gradient(135deg, rgba(248, 246, 251, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    border: 2px solid transparent;
    border-image: linear-gradient(180deg, var(--content-accent) 0%, var(--content-primary) 50%, var(--content-highlight) 100%) 1;
    border-radius: 20px;
    padding: 28px 20px;
    box-shadow: 
        0 8px 32px rgba(107, 91, 149, 0.12),
        inset 0 0 0 1px rgba(255, 143, 179, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    margin-left: -2vw;
    backdrop-filter: blur(10px);
}

/* 侧边栏背景网格装饰 */
.wiki-sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(107, 91, 149, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 91, 149, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 18px;
    pointer-events: none;
    z-index: 0;
}

/* 侧边栏顶部DNA螺旋装饰 */
.wiki-sidebar::after {
    /* content: "⬢"; */
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--content-accent);
    background: linear-gradient(135deg, var(--content-surface) 0%, #fff 100%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 
        0 4px 12px rgba(255, 143, 179, 0.3),
        0 0 0 3px var(--content-surface),
        0 0 0 5px var(--content-accent);
    animation: pulse-glow 3s ease-in-out infinite;
    z-index: 10;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            0 4px 12px rgba(255, 143, 179, 0.3),
            0 0 0 3px var(--content-surface),
            0 0 0 5px var(--content-accent);
    }
    50% {
        box-shadow: 
            0 6px 20px rgba(255, 143, 179, 0.5),
            0 0 0 3px var(--content-surface),
            0 0 0 5px var(--content-accent),
            0 0 20px rgba(223, 255, 0, 0.4);
    }
}

.wiki-content-wrapper {
    flex: 1;
    max-width: 72vw; /* 调整为更小的宽度 */
    margin: 0;
    padding: 0 !important;
}

.sidebar-title {
    color: transparent;
    background: linear-gradient(135deg, var(--content-primary) 0%, var(--content-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.85rem;
    font-weight: 900;
    margin-bottom: 32px;
    margin-top: 16px;
    padding: 18px 20px;
    letter-spacing: 3px;
    position: relative;
    text-align: center;
    text-transform: uppercase;
    border: none;
    background-color: rgba(216, 181, 232, 0.15);
    background-image: 
        linear-gradient(135deg, var(--content-primary) 0%, var(--content-accent) 100%),
        linear-gradient(135deg, rgba(216, 181, 232, 0.15) 0%, rgba(255, 143, 179, 0.1) 100%);
    background-origin: border-box;
    background-clip: text, padding-box;
    border-radius: 12px;
    box-shadow: 
        0 4px 12px rgba(107, 91, 149, 0.1),
        inset 0 2px 8px rgba(255, 143, 179, 0.1);
    z-index: 1;
}

.sidebar-title img {
    width: 100%;
    height: auto;
    max-width: 200px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.2);
}

/* 标题装饰 - DNA螺旋分子 */
.sidebar-title::before {
    content: "⚛";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--content-accent);
    animation: rotate-atom 4s linear infinite;
    filter: drop-shadow(0 0 4px rgba(255, 143, 179, 0.5));
}

@keyframes rotate-atom {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.sidebar-title::after {
    content: "⚛";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--content-primary);
    animation: rotate-atom 4s linear infinite reverse;
    filter: drop-shadow(0 0 4px rgba(107, 91, 149, 0.5));
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: sidebar-counter;
    position: relative;
    z-index: 1;
}

/* 一级导航项 - 生物科技胶囊卡片设计 */
.sidebar-item-level1 {
    margin-bottom: 14px;
    counter-increment: sidebar-counter;
    position: relative;
}

.sidebar-item-level1 > .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 14px 48px;
    text-decoration: none;
    color: var(--content-text);
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.4;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 246, 251, 0.8) 100%);
    border: 2px solid rgba(216, 181, 232, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    word-break: break-word;
    box-shadow: 
        0 2px 8px rgba(107, 91, 149, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}

/* 六边形编号装饰 */
.sidebar-item-level1 > .nav-link::before {
    content: "⬢";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 400;
    color: var(--content-accent);
    opacity: 0.6;
    transition: all 0.3s ease;
    line-height: 1;
}

/* 右侧脉冲点装饰 */
.sidebar-item-level1 > .nav-link::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--content-accent);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(255, 143, 179, 0.4);
}

.sidebar-item-level1 > .nav-link:hover {
    background: linear-gradient(135deg, rgba(216, 181, 232, 0.25) 0%, rgba(255, 143, 179, 0.15) 100%);
    border-color: var(--content-accent);
    color: var(--content-primary);
    text-decoration: none;
    transform: translateX(4px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(107, 91, 149, 0.15),
        0 0 0 2px rgba(255, 143, 179, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.sidebar-item-level1 > .nav-link:hover::before {
    color: var(--content-accent);
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 143, 179, 0.6));
}

.sidebar-item-level1 > .nav-link:hover::after {
    opacity: 1;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 143, 179, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 143, 179, 0);
    }
}

.sidebar-item-level1 > .nav-link.active {
    background: linear-gradient(135deg, var(--content-primary) 0%, rgba(107, 91, 149, 0.95) 100%);
    color: white;
    border-color: var(--content-highlight);
    box-shadow: 
        0 8px 24px rgba(107, 91, 149, 0.35),
        0 0 0 3px rgba(223, 255, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.sidebar-item-level1 > .nav-link.active::before {
    color: var(--content-highlight);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    filter: drop-shadow(0 0 12px rgba(223, 255, 0, 0.8));
    animation: glow-hexagon 2s ease-in-out infinite;
}

@keyframes glow-hexagon {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(223, 255, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(223, 255, 0, 1));
    }
}

.sidebar-item-level1 > .nav-link.active::after {
    background: var(--content-highlight);
    opacity: 1;
    animation: pulse-dot-active 1.5s ease-in-out infinite;
}

@keyframes pulse-dot-active {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(223, 255, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(223, 255, 0, 0);
    }
}

/* 二级导航项 - 分子链式胶囊设计 */
.sidebar-item-level2 {
    margin-bottom: 8px;
    margin-left: 20px;
    position: relative;
}

/* 无连接线，使用点阵装饰 */
.sidebar-item-level2::before {
    content: "•";
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--content-accent);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.sidebar-item-level2 > .nav-link {
    display: block;
    padding: 10px 16px 10px 36px;
    text-decoration: none;
    color: var(--content-muted);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: rgba(248, 246, 251, 0.5);
    border: 1px solid rgba(216, 181, 232, 0.2);
}

/* 分子装饰 - 小圆圈 */
.sidebar-item-level2 > .nav-link::before {
    content: "○";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--content-accent);
    opacity: 0.5;
    transition: all 0.3s ease;
    line-height: 1;
}

/* 右侧微粒装饰 */
.sidebar-item-level2 > .nav-link::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--content-accent);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.sidebar-item-level2:hover::before {
    color: var(--content-accent);
    opacity: 0.8;
    transform: translateY(-50%) scale(1.5);
}

.sidebar-item-level2 > .nav-link:hover {
    color: var(--content-primary);
    background: linear-gradient(135deg, rgba(216, 181, 232, 0.3) 0%, rgba(255, 143, 179, 0.2) 100%);
    border-color: var(--content-accent);
    text-decoration: none;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.12);
}

.sidebar-item-level2 > .nav-link:hover::before {
    color: var(--content-accent);
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

.sidebar-item-level2 > .nav-link:hover::after {
    opacity: 1;
    animation: blink-particle 1s ease-in-out infinite;
}

@keyframes blink-particle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.sidebar-item-level2 > .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--content-accent) 0%, var(--content-primary) 100%);
    border-color: var(--content-highlight);
    font-weight: 600;
    box-shadow: 
        0 4px 16px rgba(255, 143, 179, 0.35),
        0 0 0 2px rgba(223, 255, 0, 0.3);
    transform: translateX(4px);
}

.sidebar-item-level2 > .nav-link.active::before {
    content: "●";
    color: var(--content-highlight);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    filter: drop-shadow(0 0 6px rgba(223, 255, 0, 0.8));
}

.sidebar-item-level2 > .nav-link.active::after {
    background: var(--content-highlight);
    opacity: 1;
    width: 6px;
    height: 6px;
    box-shadow: 0 0 8px rgba(223, 255, 0, 0.6);
    animation: pulse-particle 2s ease-in-out infinite;
}

@keyframes pulse-particle {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 8px rgba(223, 255, 0, 0.6);
    }
    50% {
        transform: translateY(-50%) scale(1.5);
        box-shadow: 0 0 12px rgba(223, 255, 0, 1);
    }
}

/* 滚动条样式 - 独特的细线设计 */
.wiki-sidebar::-webkit-scrollbar {
    width: 5px;
}

.wiki-sidebar::-webkit-scrollbar-track {
    background: rgba(216, 181, 232, 0.2);
    margin: 10px 0;
    border-radius: 3px;
}

.wiki-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--content-accent) 0%, var(--content-primary) 100%);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.wiki-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--content-highlight) 0%, var(--content-accent) 100%);
    box-shadow: 0 0 6px rgba(223, 255, 0, 0.5);
}

/* =============================
   现代块状标题栏设计
   ============================= */
.section-header {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 50px 0 30px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.section-title {
    color: var(--content-primary);
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    font-family: 'Orbitron', serif;
    letter-spacing: 0.5px;
}

/* =============================
   扁平卡片式内容区域设计
   ============================= */
.content-card {
    background: var(--content-surface);
    border-radius: 12px;
    padding: 40px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(53, 49, 118, 0.06);
    border: 1px solid var(--content-border);
    line-height: 1.8;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    box-shadow: 0 4px 20px rgba(107, 91, 149, 0.15), 0 0 0 1px var(--content-accent);
    border-color: var(--content-accent);
    transform: translateY(-2px);
}

/* =============================
   标题样式设计（1-6级）
   ============================= */
.content-title {
    color: var(--content-text);
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    scroll-margin-top: 120px;
}

.content-title:first-child {
    margin-top: 0;
}

/* H1 - 主标题 */
.content-title.h1 {
    font-size: 2.4rem;
    color: var(--content-primary);
    margin-top: 3rem;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 20px;
    text-shadow: 2px 2px 0px rgba(107, 91, 149, 0.1);
}

th {
    color: #000 !important;
}

.content-title.h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 5px;
    background: linear-gradient(90deg, var(--content-accent) 0%, var(--content-highlight) 100%);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(255, 143, 179, 0.4);
}

/* H2 - 主要章节 */
.content-title.h2 {
    font-size: 2rem;
    color: var(--content-primary);
    margin-top: 3rem;
    border-left: 5px solid var(--content-accent);
    padding-left: 20px;
    position: relative;
    background: linear-gradient(90deg, rgba(216, 181, 232, 0.15) 0%, transparent 100%);
    padding: 12px 20px;
    border-radius: 0 8px 8px 0;
    /* box-shadow: -3px 0 0 0 var(--content-highlight); */
}

/* H3 - 子章节 */
.content-title.h3 {
    font-size: 1.6rem;
    color: var(--content-text);
    margin-top: 2.5rem;
}

/* H4 - 小节 */
.content-title.h4 {
    font-size: 1.4rem;
    color: var(--content-text);
    margin-top: 2rem;
}

/* H5 - 子小节 */
.content-title.h5 {
    font-size: 1.2rem;
    color: var(--content-text);
    margin-top: 1.8rem;
}

/* H6 - 细分项 */
.content-title.h6 {
    font-size: 1.1rem;
    color: var(--content-muted);
    font-weight: 600;
    margin-top: 1.5rem;
}

/* =============================
   内容元素样式
   ============================= */

/* 段落和文本 */
.content-card p {
    font-size: 1.15rem;
    color: var(--content-text);
    text-align: justify;
    line-height: 1.8;
    margin-bottom: 0;
}

.content-card ul, .content-card ol {
    margin-bottom: 2rem;
    padding-left: 2.5rem;
}

.content-card li {
    font-size: 1.1rem;
    color: var(--content-text);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-card li strong {
    color: var(--content-primary);
    font-weight: 600;
}

/* Strong标签 - 粉色加粗强调 */
.content-card strong {
    color: var(--content-primary);
    font-weight: 700;
    position: relative;
    padding: 0 4px;
}

/* 特殊高亮标签 - 使用mark标签 */
.content-card mark {
    background: linear-gradient(180deg, transparent 50%, var(--content-highlight) 50%);
    color: var(--content-primary-dark);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}

/* 图片和媒体 */
.content-image {
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    /* box-shadow:
        0 12px 32px rgba(179, 66, 159, 0.12),
        0 4px 16px rgba(179, 66, 159, 0.08); */
    /* border: 1px solid rgba(179, 66, 159, 0.1); */
    margin: 0 auto;
    /* cursor: pointer; */
}

/* iframe 视频样式 */
.content-card iframe {
    display: block;
    margin: 2.5rem auto;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(107, 91, 149, 0.15),
        0 4px 16px rgba(107, 91, 149, 0.1);
    border: 3px solid transparent;
    background-image: 
        linear-gradient(white, white),
        linear-gradient(135deg, var(--content-accent) 0%, var(--content-primary) 50%, var(--content-highlight) 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: all 0.3s ease;
}

.content-card iframe:hover {
    box-shadow: 
        0 12px 48px rgba(107, 91, 149, 0.2),
        0 6px 24px rgba(107, 91, 149, 0.15);
    transform: translateY(-4px);
}

/* iframe 容器包装 */
.content-card .iframe-wrapper {
    text-align: center;
    margin: 2.5rem 0;
}

.content-card .iframe-wrapper iframe {
    margin: 0 auto;
}

/* 响应式 iframe */
@media (max-width: 768px) {
    .content-card iframe {
        margin: 2rem auto;
        border-radius: 12px;
        border-width: 2px;
    }
}

/* 图片放大遮罩层 */
.image-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    animation: fadeIn 0.3s ease;
    overflow: auto;
}

.image-lightbox-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.image-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.image-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: bold;
    /* cursor: pointer; */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 100000;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 滚动条样式优化 */
.image-lightbox-overlay::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.image-lightbox-overlay::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.image-lightbox-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.image-lightbox-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

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

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-caption {
    text-align: center !important;
    font-size: 0.95rem !important;
    color: var(--content-muted) !important;
    margin-top: 1rem !important;
}

/* 引用块 */
.content-quote {
    background: linear-gradient(135deg, var(--content-light-purple) 0%, rgba(216, 181, 232, 0.5) 100%);
    border-left: 5px solid var(--content-accent);
    padding: 20px 30px 20px 45px;
    margin: 3rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--content-text);
    font-size: 1.1rem;
    line-height: 1.7;
    position: relative;
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.15);
}

.content-quote::before {
    content: "\"";
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 3rem;
    color: var(--content-accent);
    font-weight: bold;
    line-height: 1;
    opacity: 0.4;
    text-shadow: 2px 2px 4px rgba(255, 143, 179, 0.2);
}

/* 代码块 */
.content-code {
    background: var(--content-bg);
    border: 1px solid var(--content-border);
    border-left: 4px solid var(--content-primary);
    border-radius: 8px;
    padding: 24px;
    margin: 2.5rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.95rem;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(53, 49, 118, 0.05);
}

/* =============================
   表格样式设计
   ============================= */
.content-card table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2.5rem 0;
    background: var(--content-surface);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(53, 49, 118, 0.08);
    border: 1px solid var(--content-border);
}

/* 表格标题行 - 流动渐变动画 */
.content-card table thead {
    background: linear-gradient(
        90deg, 
        var(--content-primary) 0%, 
        rgba(107, 91, 149, 0.9) 25%, 
        var(--content-accent) 50%, 
        rgba(107, 91, 149, 0.9) 75%, 
        var(--content-primary) 100%
    );
    background-size: 200% 100%;
    animation: gradient-flow 8s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradient-flow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 表头发光效果层 */
.content-card table thead::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: shine-sweep 6s ease-in-out infinite;
}

@keyframes shine-sweep {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

/* 底部装饰条 - 波浪动画 */
.content-card table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--content-accent) 0%,
        var(--content-highlight) 50%,
        var(--content-accent) 100%
    );
    background-size: 200% 100%;
    animation: wave-flow 4s linear infinite;
    box-shadow: 0 2px 8px rgba(255, 143, 179, 0.5);
}

@keyframes wave-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.content-card table thead th {
    padding: 20px 24px;
    text-align: left;
    font-weight: 700;
    font-size: 0.88rem;
    color: white;
    letter-spacing: 0.8px;
    border: none;
    position: relative;
    text-transform: uppercase;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.content-card table thead th:first-child {
    padding-left: 32px;
}

.content-card table thead th:last-child {
    padding-right: 32px;
}

.content-card table thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 30%;
    height: 40%;
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
}

/* 表头文字图标 - 闪烁动画 */
.content-card table thead th::before {
    content: '◆';
    margin-right: 8px;
    color: var(--content-highlight);
    font-size: 0.75rem;
    display: inline-block;
    animation: icon-pulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(223, 255, 0, 0.6));
}

@keyframes icon-pulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* 表格主体 - 简洁设计 */
.content-card table tbody tr {
    transition: background-color 0.2s ease;
}

.content-card table tbody tr:nth-child(even) {
    background: var(--content-bg);
}

.content-card table tbody tr:hover {
    background: rgba(216, 181, 232, 0.15);
}

.content-card table tbody td {
    padding: 16px 24px;
    color: var(--content-text);
    font-size: 0.92rem;
    line-height: 1.7;
    border-bottom: 1px solid var(--content-border);
    vertical-align: middle;
}

.content-card table tbody td:first-child {
    padding-left: 32px;
}

.content-card table tbody td:last-child {
    padding-right: 32px;
}

.content-card table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格内的强调文本 */
.content-card table td strong,
.content-card table th strong {
    color: var(--content-primary);
    font-weight: 600;
}


/* 表格分类列样式 - 仅针对有rowspan的单元格 */
.content-card table tbody td[rowspan] {
    font-weight: 700;
    color: var(--content-primary) !important;
    background: linear-gradient(135deg, rgba(248, 246, 251, 0.8) 0%, rgba(216, 181, 232, 0.1) 100%) !important;
    position: relative;
    vertical-align: middle !important;
    text-align: center;
    font-size: 0.95rem !important;
    min-width: 140px;
    padding: 18px !important;
    border-right: 3px solid var(--content-accent);
}

.content-card table tbody td[rowspan]::before {
    content: '◈';
    display: block;
    font-size: 1.5rem;
    color: var(--content-accent);
    margin-bottom: 8px;
    opacity: 0.6;
}

/* 表格第二列样式 - Specific measure 列 */
.content-card table tbody tr td:first-child:not([rowspan]),
.content-card table tbody tr:has(td[rowspan]) td:nth-child(2) {
    color: var(--content-primary);
    font-weight: 600;
}

/* 针对带有rowspan的行，调整hover效果 */
.content-card table tbody tr:has(td[rowspan]):hover td[rowspan] {
    background: linear-gradient(135deg, rgba(216, 181, 232, 0.3) 0%, rgba(255, 143, 179, 0.15) 100%) !important;
}

/* 表格内的链接 */
.content-card table a {
    color: var(--content-primary);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.content-card table a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--content-accent);
    transition: width 0.3s ease;
}

.content-card table a:hover {
    background: var(--content-light-purple);
    color: var(--content-primary-dark);
}

.content-card table a:hover::after {
    width: 100%;
}

/* 表格容器 - 支持横向滚动 */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 2.5rem 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(53, 49, 118, 0.08);
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--content-bg);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--content-primary);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--content-primary-dark);
}

/* 表格标题 */
.table-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--content-primary);
    margin-bottom: 1.5rem;
    font-family: 'Orbitron', serif;
    position: relative;
    padding-bottom: 12px;
}

.table-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--content-accent);
    border-radius: 2px;
}

/* 表格说明 */
.table-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--content-muted);
    margin-top: 1rem;
    font-style: italic;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .content-card table {
        font-size: 0.88rem;
        margin: 2rem 0;
        border-radius: 8px;
    }
    
    .content-card table thead th {
        padding: 16px 14px;
        font-size: 0.78rem;
        letter-spacing: 0.5px;
    }
    
    .content-card table thead th:first-child {
        padding-left: 16px;
    }
    
    .content-card table thead th:last-child {
        padding-right: 16px;
    }
    
    .content-card table thead th::before {
        font-size: 0.7rem;
        margin-right: 6px;
    }
    
    .content-card table tbody td {
        padding: 14px 14px;
        font-size: 0.86rem;
        line-height: 1.6;
    }
    
    .content-card table tbody td:first-child {
        padding-left: 16px;
    }
    
    .content-card table tbody td:last-child {
        padding-right: 16px;
    }
    
    /* 移动端可选：堆叠显示 */
    .content-card table.stack-on-mobile {
        border: none;
        box-shadow: none;
    }
    
    .content-card table.stack-on-mobile thead {
        display: none;
    }
    
    .content-card table.stack-on-mobile tbody tr {
        display: block;
        margin-bottom: 20px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(179, 66, 159, 0.15);
    }
    
    .content-card table.stack-on-mobile tbody td {
        display: block;
        text-align: right;
        padding: 12px;
        border-bottom: 1px solid rgba(179, 66, 159, 0.1);
        position: relative;
        padding-left: 50%;
    }
    
    .content-card table.stack-on-mobile tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--content-primary);
    }
    
    .content-card table.stack-on-mobile tbody td:last-child {
        border-bottom: none;
    }
}

/* =============================
   响应式设计
   注意：按照从大到小的顺序排列，更具体的规则（如平板横屏）放在最后
   ============================= */

@media (max-width: 1400px) {
    .wiki-content-wrapper {
        padding: 60px 15vw 60px 10vw;
    }

    .page_content {
        gap: 2vw;
    }

    .wiki-sidebar {
        width: 22vw;
    }

    .wiki-content-wrapper {
        max-width: 60vw;
    }
}

@media (max-width: 1200px) {
    .wiki-content-wrapper {
        padding: 50px 10vw 50px 8vw;
    }

    .page_content {
        gap: 2.5vw;
    }

    .wiki-sidebar {
        width: 26vw; /* 调整为更大的宽度 */
    }

    .wiki-content-wrapper {
        max-width: 56vw; /* 调整为更小的宽度 */
    }

    .section-header {
        padding: 18px 35px;
        margin: 35px 0 25px 0;
    }

    .section-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .wiki-content-wrapper {
        padding: 30px 5vw 30px 5vw;
    }

    .page_content {
        flex-direction: column;
        gap: 30px;
    }

    .wiki-sidebar {
        position: relative;
        top: auto;
        width: 100%;
        max-height: none;
        margin-right: 0;
        margin-left: 0;
        padding: 24px 20px;
    }
    
    /* 移动端侧边栏调整 */
    .wiki-sidebar::after {
        top: -10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .sidebar-title {
        font-size: 0.8rem;
        padding: 14px 16px;
        margin-bottom: 24px;
    }
    
    .sidebar-title::before,
    .sidebar-title::after {
        font-size: 16px;
    }
    
    .sidebar-item-level1 > .nav-link {
        padding: 12px 14px 12px 40px;
        font-size: 0.78rem;
    }
    
    .sidebar-item-level1 > .nav-link::before {
        left: 12px;
        font-size: 20px;
    }
    
    .sidebar-item-level2 {
        margin-left: 16px;
    }
    
    .sidebar-item-level2 > .nav-link {
        padding: 9px 14px 9px 32px;
        font-size: 0.7rem;
    }

    .wiki-content-wrapper {
        max-width: 100%;
    }

    .section-header {
        padding: 16px 30px;
        margin: 30px 0 20px 0;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .content-card {
        padding: 30px 25px;
        margin: 25px 0;
    }

    .content-title.h1 {
        font-size: 2rem;
    }

    .content-title.h2 {
        font-size: 1.7rem;
    }

    .content-title.h3 {
        font-size: 1.4rem;
    }

    .content-title.h4 {
        font-size: 1.2rem;
    }

    .content-card p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .wiki-content-wrapper {
        padding: 20px 3vw 20px 3vw;
    }

    .section-header {
        padding: 14px 25px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .content-card {
        padding: 25px 20px;
    }

    .content-title.h1 {
        font-size: 1.8rem;
    }

    .content-title.h2 {
        font-size: 1.5rem;
    }

    .content-quote {
        padding: 20px 24px;
        margin: 2rem 0;
    }
}

.page_content {
    background: var(--content-surface);
}

/* 确保文本可以被选择且可见 */
* {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* 自定义文本选择样式 */
::selection {
    background-color: var(--content-light-purple) !important;
    color: var(--content-primary) !important;
    opacity: 1;
}

::-moz-selection {
    background-color: var(--content-light-purple) !important;
    color: var(--content-primary) !important;
    opacity: 1;
}

::-webkit-selection {
    background-color: var(--content-light-purple) !important;
    color: var(--content-primary) !important;
    opacity: 1;
}

/* 确保内容区域的文本选择正常工作 */
.content-card ::selection,
.content-card ::-moz-selection,
.content-card ::-webkit-selection {
    background-color: var(--content-light-purple) !important;
    color: var(--content-text) !important;
}

/* 确保标题的文本选择正常工作 */
.content-title ::selection,
.content-title ::-moz-selection,
.content-title ::-webkit-selection {
    background-color: rgba(242, 136, 78, 0.3) !important;
    color: inherit !important;
}

/* 简洁的设计完成 */

/* =============================
   防止页面加载时的闪烁和跳动
   ============================= */

/* 关键修复：始终为滚动条预留空间，防止滚动条出现时的布局偏移 */
html {
    scrollbar-gutter: stable;
    overflow-y: scroll; /* 降级方案：强制显示滚动条槽位 */
}

/* 现代浏览器支持 scrollbar-gutter */
@supports (scrollbar-gutter: stable) {
    html {
        overflow-y: auto;
        scrollbar-gutter: stable;
    }
}

/* 页面加载时保持内容可见但稍微透明，避免突然出现的效果 */
body:not(.page-loaded) .page_content {
    opacity: 0.98;
    transform: translateY(0);
}

/* 页面加载完成后平滑过渡到完全可见 */
body.page-loaded .page_content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 确保表格在初始加载时就是可见的，避免GSAP动画导致的跳动 */
.content-card table {
    opacity: 1 !important;
    transform: none !important;
    will-change: auto;
}

/* 防止layout shift - 为图片容器预留空间 */
.content-image {
    min-height: 200px;
    background-color: var(--content-bg);
}

/* 减少重绘和重排 */
/* 注意：contain属性会影响sticky定位，已移除 */
/* .wiki-sidebar,
.wiki-content-wrapper {
    contain: layout style;
} */

/* 优化动画性能 - 已禁用表格动画 */
/* .content-card table,
.content-card table tbody tr {
    will-change: transform, opacity;
} */

@media (prefers-reduced-motion: reduce) {
    /* 如果用户偏好减少动画，完全禁用所有动画效果 */
    * {
        animation: none !important;
        transition: none !important;
    }
    
    body:not(.page-loaded) .page_content {
        opacity: 1;
    }
}



/* PDF 卡片样式 */
.pdf_card {
    width: 100%;
    max-width: 500px;
    margin: 20px 0;
    padding: 24px;
    border-radius: 12px;
    background: var(--content-surface);
    border: 1px solid var(--content-border);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 2px 6px rgba(53, 49, 118, 0.06);
}

.pdf_card:hover {
    border-color: var(--content-primary);
    box-shadow: 0 4px 12px rgba(53, 49, 118, 0.15);
    transform: translateY(-2px);
}

.pdf_card_content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 60%;
}

.pdf_card_info {
    flex: 1;
    width: 100%;
}

.pdf_card_name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf_card:hover .pdf_card_name {
    color: var(--content-primary);
}

.pdf_card_size {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

/* 下载链接样式 */
.pdf_download_link {
    background: var(--content-primary);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    outline: none;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 2px 6px rgba(53, 49, 118, 0.2);
}

.pdf_download_link:hover {
    background: var(--content-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(53, 49, 118, 0.3);
}

.pdf_download_link:active {
    transform: translateY(0);
}

/* 段落中的下载链接特殊样式 */
p .pdf_download_link {
    padding: 4px 8px;
    font-size: 13px;
    margin: 0 2px;
}

p .pdf_download_link:hover {
    transform: none;
    box-shadow: none;
}

/* 上标和下标样式 */
.top-symbol {
    vertical-align: super;
    font-size: 0.8em;
    line-height: 0;
}

.bottom-symbol {
    vertical-align: sub;
    font-size: 0.8em;
    line-height: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .pdf_card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .pdf_card_content {
        width: 100%;
        gap: 12px;
    }

    .pdf_card_name {
        font-size: 15px;
    }

    .pdf_card_size {
        font-size: 12px;
    }

    .pdf_download_link {
        align-self: stretch;
        text-align: center;
        margin-top: 8px;
    }
}

/* =============================
   平板横屏适配 (iPad Pro, iPad Air 等 4:3 或 10:9 比例)
   注意：此规则放在最后，以覆盖之前的通用响应式规则
   ============================= */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .page_content {
        gap: 1.5vw !important;
    }

    .wiki-sidebar {
        width: 21vw !important;
        padding: 24px 18px !important;
        margin-left: -1.5vw !important;
    }

    .wiki-content-wrapper {
        max-width: 72vw !important;
        padding: 0 !important;
    }
    
    .wiki-sidebar::after {
        width: 36px !important;
        height: 36px !important;
        font-size: 22px !important;
        top: -11px !important;
    }

    .sidebar-title {
        font-size: 0.82rem !important;
        margin-bottom: 24px !important;
        padding: 16px 18px !important;
    }
    
    .sidebar-title::before,
    .sidebar-title::after {
        font-size: 18px !important;
    }

    .sidebar-item-level1 > .nav-link {
        padding: 12px 14px 12px 44px !important;
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
    }

    .sidebar-item-level1 > .nav-link::before {
        left: 13px !important;
        font-size: 20px !important;
    }

    .sidebar-item-level2 {
        margin-left: 18px !important;
    }

    .sidebar-item-level2 > .nav-link {
        padding: 9px 14px 9px 34px !important;
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
    }

    .sidebar-item-level2 > .nav-link::before {
        left: 11px !important;
        font-size: 13px !important;
    }

    .content-card {
        padding: 35px !important;
    }
}