* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── 可动画的自定义属性：用于收束轨迹 ── */
@property --cx {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}
@property --cy {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}

body {
    background-color: #000000;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* 欢迎页 */
#landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

.landing-content {
    text-align: center;
    color: #ffffff;
    z-index: 10;
}

.logo-text {
    font-size: 4rem;
    letter-spacing: 10px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.1rem;
    letter-spacing: 3px;
    color: #bdc3c7;
    margin-bottom: 3rem;
}

.explore-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1rem 3rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.explore-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 星空与轨道 */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.orbit-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 1.5;
    stroke-linecap: round;
    transition: opacity 0.5s;
}

.mizi-star {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: center;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    cursor: help;
}

.star-visual {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
}

.star-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.mizi-star:hover .star-label {
    opacity: 1;
    visibility: visible;
    top: -40px;
}

.mizi-star .line {
    position: absolute;
    background: #ffffff;
    width: 100%;
    height: 4px;
    clip-path: polygon(0% 50%, 50% 0%, 100% 50%, 50% 100%);
    box-shadow: 0 0 10px #fff;
}

.mizi-star .line:nth-child(1) { transform: rotate(0deg); width: 100%; height: 3px; }
.mizi-star .line:nth-child(2) { transform: rotate(90deg); width: 100%; height: 3px; }
.mizi-star .line:nth-child(3) { transform: rotate(45deg); width: 55%; height: 2px; }
.mizi-star .line:nth-child(4) { transform: rotate(-45deg); width: 55%; height: 2px; }

.mizi-star::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px 2px #fff;
    z-index: 2;
}

.mizi-star::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    filter: blur(4px);
    border-radius: 50%;
}

.tiny-star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.3;
    filter: blur(0.5px);
}

.twinkle {
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

/* ============================================================
   百科页 — 容器
   ============================================================ */
.wiki-portal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: hidden;
    overflow-x: hidden;
    padding-top: clamp(36px, 6.5vh, 66px);
    padding-bottom: clamp(36px, 6.5vh, 66px);
}

/* 下半部 — 原档案馆暖光渐变已移除 */

/* ============================================================
   百科页 — 入场动画
   ============================================================ */

/* 页面整体从奇点展开 */
.wiki-portal.entering {
    animation: portalFadeIn 1.0s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes portalFadeIn {
    0%   { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.wiki-portal.entering .wiki-core-dot {
    animation: coreEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wiki-portal.entering .wiki-core-ring {
    animation: coreRingEnter 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wiki-portal.entering .wiki-core-halo {
    animation: coreHaloEnter 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wiki-portal.entering .wiki-axis-line {
    animation: axisLineEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.15s;
    opacity: 0;
}

.wiki-portal.entering .wiki-upper .wiki-section-header {
    animation: sectionFadeIn 0.5s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.wiki-portal.entering .wiki-lower .wiki-section-header {
    animation: sectionFadeIn 0.5s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

/* 上层节点：从中心向外（中间的 2、3 先出现，两边 1、4 后出现） */
.wiki-portal.entering .wiki-upper .wiki-node {
    animation: nodeEnterUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    transform: translateY(14px);
}

.wiki-portal.entering .wiki-upper .wiki-node:nth-child(1) { animation-delay: 0.55s; }
.wiki-portal.entering .wiki-upper .wiki-node:nth-child(2) { animation-delay: 0.35s; }
.wiki-portal.entering .wiki-upper .wiki-node:nth-child(3) { animation-delay: 0.35s; }
.wiki-portal.entering .wiki-upper .wiki-node:nth-child(4) { animation-delay: 0.55s; }

/* 下层节点：从中心向外（中间 3 先，2/4 次，1/5 最后） */
.wiki-portal.entering .wiki-lower .wiki-node {
    animation: nodeEnterDown 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    transform: translateY(-14px);
}

.wiki-portal.entering .wiki-lower .wiki-node:nth-child(1) { animation-delay: 0.7s; }
.wiki-portal.entering .wiki-lower .wiki-node:nth-child(2) { animation-delay: 0.5s; }
.wiki-portal.entering .wiki-lower .wiki-node:nth-child(3) { animation-delay: 0.35s; }
.wiki-portal.entering .wiki-lower .wiki-node:nth-child(4) { animation-delay: 0.5s; }
.wiki-portal.entering .wiki-lower .wiki-node:nth-child(5) { animation-delay: 0.7s; }

.wiki-portal.entering .wiki-conn-line {
    animation: connLineEnter 0.5s ease forwards;
    opacity: 0;
}

.wiki-portal.entering .wiki-conn-line.conn-upper { animation-delay: 0.8s; }
.wiki-portal.entering .wiki-conn-line.conn-lower { animation-delay: 0.9s; }

.wiki-portal.leaving {
    animation: wikiCollapseOut 0.6s cubic-bezier(0.55, 0, 0.65, 0.3) forwards;
    pointer-events: none;
    background: transparent;
}

/* 上层向下收缩到线 */
.wiki-portal.leaving .wiki-upper {
    animation: wikiUpperCollapse 0.5s cubic-bezier(0.55, 0, 0.65, 0.3) forwards;
    transform-origin: center bottom;
}

/* 下层向上收缩到线 */
.wiki-portal.leaving .wiki-lower {
    animation: wikiLowerCollapse 0.5s cubic-bezier(0.55, 0, 0.65, 0.3) forwards;
    transform-origin: center top;
}

/* 节点和标题缩小 */
.wiki-portal.leaving .wiki-node,
.wiki-portal.leaving .wiki-section-header {
    animation: wikiContentCollapse 0.5s cubic-bezier(0.55, 0, 0.65, 0.3) forwards;
}

/* 横线收缩成点 */
.wiki-portal.leaving .wiki-axis-line {
    animation: axisToDot 0.35s cubic-bezier(0.55, 0, 0.65, 0.3) forwards;
    animation-delay: 0.3s;
    transform-origin: center;
}

/* SVG连线和背景淡出 */
.wiki-portal.leaving .wiki-svg,
.wiki-portal.leaving .wiki-bg-frame {
    animation: wikiFadeOut 0.3s ease forwards;
}

.wiki-back-btn {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(220, 220, 240, 0.28);
    border-radius: 4px;
    background: rgba(5, 7, 12, 0.58);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    letter-spacing: 1px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 18px rgba(210, 205, 230, 0.08);
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.wiki-back-btn::before {
    content: '<';
    color: rgba(220, 220, 240, 0.78);
    font-size: 1rem;
    line-height: 1;
}

.wiki-back-btn:hover {
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(220, 220, 240, 0.52);
    background: rgba(18, 20, 26, 0.72);
    transform: translateX(-2px);
}

.wiki-back-btn:focus-visible {
    outline: 1px solid rgba(220, 220, 240, 0.7);
    outline-offset: 3px;
}

@keyframes wikiCollapseOut {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.6); }
}

@keyframes wikiContentCollapse {
    0%   { opacity: 1; filter: blur(0); transform: scale(1); }
    100% { opacity: 0; filter: blur(3px); transform: scale(0.25); }
}

@keyframes wikiUpperCollapse {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(40px) scaleY(0.5); }
}

@keyframes wikiLowerCollapse {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-40px) scaleY(0.5); }
}

@keyframes axisToDot {
    0%   { opacity: 1; transform: translate(-50%, -50%) scaleX(1) scaleY(1); filter: brightness(1); }
    60%  { opacity: 1; transform: translate(-50%, -50%) scaleX(0.04) scaleY(2); filter: brightness(6); background: #fff; }
    100% { opacity: 0; transform: translate(-50%, -50%) scaleX(0) scaleY(2.5); filter: brightness(8); background: #fff; }
}

@keyframes wikiFadeOut {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes coreEnter {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
    40%  { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes coreRingEnter {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.25); }
    50%  { opacity: 0.5; }
    100% { opacity: 0.35; transform: translate(-50%, -50%) scale(1); }
}

@keyframes coreHaloEnter {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 0.25; transform: translate(-50%, -50%) scale(1); }
}

@keyframes axisLineEnter {
    0%   { opacity: 0; transform: translate(-50%, -50%) scaleX(0); filter: brightness(1); }
    35%  { opacity: 1; transform: translate(-50%, -50%) scaleX(0.04); filter: brightness(6); background: rgba(255, 255, 255, 0.9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); filter: brightness(1); }
}

@keyframes sectionFadeIn {
    0%   { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes nodeEnterUp {
    0%   { opacity: 0; transform: translateY(24px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes nodeEnterDown {
    0%   { opacity: 0; transform: translateY(-24px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes connLineEnter {
    0%   { opacity: 0; }
    100% { opacity: 0.22; }
}

.hidden {
    display: none !important;
}

#landing-page.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   欢迎页 — 过渡动画状态
   ============================================================ */
#landing-page.animating {
    transition: none;
    pointer-events: none;
}

#landing-page.returning .landing-content {
    animation: landingContentReturn 0.55s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

@keyframes landingContentReturn {
    0%   { opacity: 0; transform: scale(0.02); filter: blur(20px); }
    45%  { opacity: 1; transform: scale(0.5); filter: blur(10px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes landingStarsReturn {
    0%   { opacity: 0; transform: scale(0.02); filter: blur(15px); }
    50%  { opacity: 0.6; transform: scale(0.6); filter: blur(6px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ============================================================
   收束动画 — 预计算个性轨迹
   --cx / --cy 由 @property 注册为可动画 <length>
   JS 在动画前写入 --cx / --cy / --collapse-* CSS 变量
   动画完全由 CSS keyframes 驱动，无 requestAnimationFrame
   ============================================================ */

/* ── 装饰元素（星空容器 / 米字星）：向中心收缩 ── */
.collapse-decor {
    animation: collapseDecor 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: var(--collapse-delay, 0ms);
    pointer-events: none;
}

@keyframes collapseDecor {
    0%   { opacity: 0.6; transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0;   transform: translate(var(--cx), var(--cy)) scale(0.04) rotate(var(--collapse-rotate, 8deg)); }
}

/* ── 标语：向中心收缩 ── */
.collapse-tagline {
    animation: collapseTagline 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: var(--collapse-delay, 0ms);
    pointer-events: none;
}

@keyframes collapseTagline {
    0%   { opacity: 1; transform: translate(0, 0) scaleX(1) scale(1); }
    100% { opacity: 0; transform: translate(var(--cx), var(--cy)) scaleX(0.05) scale(0.04); }
}

/* ── 标题字符：向中心收缩 ── */
.collapse-title-char {
    animation: collapseTitleChar 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: var(--collapse-delay, 0ms);
    pointer-events: none;
}

.title-collapsing {
    pointer-events: none;
}

@keyframes collapseTitleChar {
    0%   { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--cx), var(--cy)) scale(0.04) rotate(var(--collapse-rotate, 0deg)); }
}

/* ── 按钮：向中心收缩 ── */
.collapse-button {
    animation: collapseButton 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: var(--collapse-delay, 0ms);
    pointer-events: none;
}

@keyframes collapseButton {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--cx), var(--cy)) scale(0.06); }
}

/* ── 星点/小装饰：向中心收缩 ── */
.collapse-star {
    animation: collapseStar 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: var(--collapse-delay, 0ms);
    pointer-events: none;
}

@keyframes collapseStar {
    0%   { opacity: 0.5; transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0;   transform: translate(var(--cx), var(--cy)) scale(0.03) rotate(var(--collapse-rotate, 15deg)); }
}

/* ============================================================
   奇点光点 — 收束后的中心能量核心
   ============================================================ */
.transition-core {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(240, 230, 200, 1);
    box-shadow:
        0 0 12px 4px rgba(220, 220, 240, 0.9),
        0 0 30px 10px rgba(220, 220, 240, 0.5),
        0 0 60px 20px rgba(210, 207, 230, 0.25);
    z-index: 1001;
    pointer-events: none;
    animation: corePointPulse 0.8s ease-in-out infinite alternate;
}

@keyframes corePointPulse {
    0%   { width: 8px;  height: 8px;  box-shadow: 0 0 12px 4px rgba(220, 220, 240, 0.9), 0 0 30px 10px rgba(220, 220, 240, 0.5), 0 0 60px 20px rgba(210, 207, 230, 0.25); }
    100% { width: 10px; height: 10px; box-shadow: 0 0 16px 6px rgba(220, 220, 240, 1), 0 0 40px 14px rgba(220, 220, 240, 0.6), 0 0 80px 28px rgba(210, 207, 230, 0.3); }
}

/* ============================================================
   过渡 — 收束 → 中心闪光 → 展开
   ============================================================ */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    background: #000;
}

.transition-overlay.visible {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.transition-overlay.fading {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* 中心光晕：收束结束后在中心闪一下 */
.transition-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 0 16px 4px rgba(255, 255, 255, 0.7),
        0 0 48px 12px rgba(255, 250, 240, 0.25),
        0 0 100px 32px rgba(255, 250, 240, 0.08);
    animation: glowPulse 0.6s ease-out forwards;
}

@keyframes glowPulse {
    0%   { width: 6px;   height: 6px;   opacity: 1; }
    40%  { width: 14px;  height: 14px;  opacity: 1; }
    100% { width: 10px;  height: 10px;  opacity: 0.6; }
}

/* ============================================================
   百科页 — SVG 连线层
   ============================================================ */
.wiki-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.wiki-conn-line {
    stroke-width: 0.5;
    stroke-dasharray: 3 7;
    opacity: 0.22;
    transition: opacity 0.5s, stroke 0.5s, stroke-width 0.5s;
}

.wiki-conn-line.conn-upper {
    stroke: #c9a558;
    animation: flowLine 8s linear infinite;
    animation-delay: var(--delay, 0s);
}

.wiki-conn-line.conn-lower {
    stroke: #b08850;
    animation: flowLine 9s linear infinite;
    animation-delay: var(--delay, 0s);
}

.wiki-conn-line.active {
    opacity: 0.65;
    stroke-width: 0.8;
}

.wiki-conn-line.active.conn-upper {
    stroke: rgba(240, 210, 115, 0.85);
    filter: drop-shadow(0 0 4px rgba(200, 195, 220, 0.5));
}

.wiki-conn-line.active.conn-lower {
    stroke: rgba(200, 195, 220, 0.8);
    filter: drop-shadow(0 0 4px rgba(160, 155, 185, 0.45));
}

@keyframes flowLine {
    0%   { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -20; }
}

/* ============================================================
   百科页 — 上下区域
   ============================================================ */
.wiki-upper,
.wiki-lower {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}
.wiki-upper::-webkit-scrollbar,
.wiki-lower::-webkit-scrollbar {
    display: none;
}

.wiki-upper {
    padding: clamp(24px, 5vh, 48px) 0 clamp(36px, 5vh, 52px) 0;
    justify-content: flex-end;
}

.wiki-lower {
    padding: clamp(36px, 5vh, 52px) 0 clamp(24px, 5vh, 48px) 0;
    justify-content: flex-start;
}

/* ============================================================
   百科页 — 区块标题
   ============================================================ */
.wiki-section-header {
    text-align: center;
    margin-bottom: clamp(36px, 5vh, 54px);
}

.wiki-section-title {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 12px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.wiki-upper .wiki-section-title {
    color: rgba(210, 200, 235, 0.9);
}
.wiki-lower .wiki-section-title {
    color: rgba(235, 210, 215, 0.9);
}

.wiki-section-sub {
    font-size: 0.65rem;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.14);
}

/* ============================================================
   百科页 — 背景（Canvas 粒子星云）
   ============================================================ */
.wiki-bg-canvas,
.wiki-bg-frame {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    z-index: 0;
    border: 0;
}

.wiki-fluid-canvas {
    opacity: 0;
    background: #000;
    filter: none;
    transition: opacity 0.7s ease;
}

.wiki-fluid-canvas.is-ready {
    opacity: 1;
}

.wiki-fluid-canvas.is-fallback {
    opacity: 1;
    background:
        radial-gradient(circle at 24% 28%, rgba(255, 91, 214, 0.22), transparent 18%),
        radial-gradient(circle at 70% 34%, rgba(50, 217, 255, 0.2), transparent 20%),
        radial-gradient(circle at 44% 72%, rgba(53, 255, 179, 0.16), transparent 22%),
        #000;
}

/* ============================================================
   百科页 — 中央轴
   ============================================================ */
.wiki-axis {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 0;
}

.wiki-axis-line {
    width: min(900px, 85vw);
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(240, 235, 220, 0.3) 15%,
        rgba(255, 252, 245, 0.5) 50%,
        rgba(240, 235, 220, 0.3) 85%,
        transparent 100%);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================================
   百科页 — 星核
   ============================================================ */
.wiki-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
}

.wiki-core-dot,
.wiki-core-ring,
.wiki-core-halo,
.wiki-core-pulse-ring {
    display: none;
}

/* 星核激活态 */
.wiki-core.active .wiki-core-dot {
    background: #eaeaf8;
    box-shadow:
        0 0 16px 5px rgba(250, 220, 135, 1),
        0 0 40px 12px rgba(220, 217, 240, 0.55),
        0 0 75px 24px rgba(180, 175, 200, 0.28);
}

.wiki-core.active .wiki-core-halo {
    opacity: 0.8;
}

/* 星核脉冲环 */
.wiki-core-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0.5px solid rgba(205, 200, 225, 0.35);
    pointer-events: none;
    animation: corePulseRingOut 1.6s ease-out forwards;
    z-index: 1;
}

@keyframes corePulseRingOut {
    0%   { width: 8px; height: 8px; opacity: 0.5; }
    100% { width: 100px; height: 100px; opacity: 0; }
}

@keyframes coreRing {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 0.5; transform: translate(-50%, -50%) scale(1.4); }
}


/* ============================================================
   百科页 — 节点行
   ============================================================ */
.wiki-nodes {
    display: flex;
    justify-content: center;
    gap: 100px;
    flex-wrap: wrap;
}

/* ============================================================
   百科页 — 单个节点
   ============================================================ */
.wiki-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    min-width: 100px;
    position: relative;
}

/* 上方短连接线（节点 → 向下/上到轴线） */
.wiki-node-conn {
    display: none;
}

.wiki-upper .wiki-node-conn {
    background: rgba(210, 205, 230, 0.2);
}
.wiki-lower .wiki-node-conn {
    background: rgba(160, 155, 185, 0.22);
}

/* 符号 */
.wiki-node-sym {
    width: 108px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.4s;
}

.wiki-icon {
    width: 60px;
    height: 60px;
    fill: none;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.4s, filter 0.4s;
}

.wiki-icon-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: filter 0.4s;
}

.wiki-lower .wiki-node-sym {
    width: 128px;
    height: 128px;
}

.wiki-lower .wiki-icon-img {
    width: 120px;
    height: 120px;
}

.wiki-upper .wiki-icon {
    stroke: rgba(210, 205, 230, 0.65);
}

.wiki-lower .wiki-icon {
    stroke: rgba(180, 175, 200, 0.68);
}

/* 符号下短横线 */
.wiki-node-line {
    width: 24px;
    height: 1px;
    margin: 10px 0 8px;
    transition: background 0.4s, box-shadow 0.4s, width 0.4s;
}

.wiki-upper .wiki-node-line {
    background: rgba(185, 180, 205, 0.35);
}
.wiki-lower .wiki-node-line {
    background: rgba(165, 160, 190, 0.3);
}

/* 标题 */
.wiki-node-title {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.4s;
    white-space: nowrap;
}

/* 描述 */
.wiki-node-desc {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.15);
    margin-top: 2px;
    white-space: nowrap;
    transition: color 0.4s;
}

/* ============================================================
   百科页 — 节点 hover
   ============================================================ */
.wiki-upper .wiki-node:hover .wiki-icon-img {
    filter: drop-shadow(0 0 10px rgba(210, 205, 230, 0.5));
}

.wiki-lower .wiki-node:hover .wiki-icon-img {
    filter: drop-shadow(0 0 10px rgba(170, 165, 195, 0.5));
}

.wiki-upper .wiki-node:hover .wiki-node-line {
    background: rgba(205, 200, 225, 0.6);
    box-shadow: 0 0 8px rgba(195, 190, 215, 0.25);
    width: 36px;
}

.wiki-lower .wiki-node:hover .wiki-node-line {
    background: rgba(175, 170, 195, 0.5);
    box-shadow: 0 0 8px rgba(165, 160, 190, 0.25);
    width: 36px;
}

.wiki-node:hover .wiki-node-title {
    color: rgba(255, 255, 255, 0.9);
}

.wiki-node:hover .wiki-node-desc {
    color: rgba(255, 255, 255, 0.38);
}

.wiki-node {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wiki-node:hover {
    transform: translateY(-3px);
}


/* ============================================================
   百科页 — 详情面板
   ============================================================ */
.wiki-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.wiki-detail-panel {
    position: relative;
    max-width: 480px;
    width: 90%;
    padding: 36px 32px;
    text-align: center;
    border: 0.5px solid rgba(255, 255, 255, 0.06);
    background: rgba(6, 6, 16, 0.9);
}

.wiki-detail-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.wiki-detail-close:hover {
    color: rgba(255, 255, 255, 0.6);
}

.wiki-detail-sym {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiki-detail-sym .wiki-icon {
    width: 36px;
    height: 36px;
    stroke: rgba(210, 205, 230, 0.8);
}

.wiki-detail-sym .wiki-icon-img {
    width: 42px;
    height: 42px;
}

.wiki-detail-panel h2 {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
}

.wiki-detail-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.wiki-detail-body {
    font-size: 0.88rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.65);
    text-align: left;
}

.wiki-detail-body code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.85em;
}

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

/* ============================================================
   百科页 — 响应式：平板
   ============================================================ */
@media (max-width: 1023px) {
    .wiki-nodes {
        gap: 48px;
    }
    .wiki-section-header {
        margin-bottom: 32px;
    }
}

/* ============================================================
   百科页 — 响应式：手机
   ============================================================ */
@media (max-width: 767px) {
    .wiki-portal {
        padding-top: clamp(36px, 6.5vh, 66px);
        padding-bottom: clamp(36px, 6.5vh, 66px);
    }

    /* 节点区：2 列网格 */
    .wiki-nodes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 24px;
        max-width: 320px;
        width: 100%;
    }

    .wiki-node {
        min-width: 0;
        align-items: center;
    }

    .wiki-node-title {
        font-size: 0.8rem;
    }

    .wiki-node-desc {
        font-size: 0.62rem;
    }

    .wiki-icon {
        width: 34px;
        height: 34px;
    }

    .wiki-node-sym {
        width: 68px;
        height: 68px;
    }

    .wiki-icon-img {
        width: 64px;
        height: 64px;
    }

    .wiki-lower .wiki-node-sym {
        width: 84px;
        height: 84px;
    }

    .wiki-lower .wiki-icon-img {
        width: 80px;
        height: 80px;
    }

    /* 区块标题 */
    .wiki-section-header {
        margin-bottom: 24px;
    }

    .wiki-section-title {
        font-size: 1.0rem;
        letter-spacing: 6px;
    }

    .wiki-upper,
    .wiki-lower {
        padding: 20px 0;
    }

    /* 中轴缩短 */
    .wiki-axis {
        max-width: 60%;
        padding: 10px 0;
    }

    .wiki-core-halo {
        width: 200px;
        height: 200px;
    }

    /* 上下层标题 */
    .wiki-upper .wiki-section-title { color: rgba(210, 200, 235, 0.9); }
    .wiki-lower .wiki-section-title { color: rgba(235, 210, 215, 0.9); }
}

/* ============================================================
   百科页 — 响应式：小手机
   ============================================================ */
@media (max-width: 480px) {
    .wiki-nodes {
        gap: 22px 18px;
        max-width: 280px;
    }

    .wiki-node-title {
        font-size: 0.72rem;
        letter-spacing: 1px;
    }

    .wiki-node-desc {
        font-size: 0.58rem;
    }

    .wiki-icon {
        width: 30px;
        height: 30px;
    }

    .wiki-node-sym {
        width: 64px;
        height: 64px;
    }

    .wiki-icon-img {
        width: 60px;
        height: 60px;
    }

    .wiki-lower .wiki-node-sym {
        width: 76px;
        height: 76px;
    }

    .wiki-lower .wiki-icon-img {
        width: 72px;
        height: 72px;
    }

    .wiki-section-title {
        font-size: 0.9rem;
        letter-spacing: 4px;
    }

    .wiki-section-sub {
        font-size: 0.65rem;
    }

    .wiki-axis {
        max-width: 50%;
    }
}

/* ============================================================
   百科页 — 移动端点击激活
   ============================================================ */
@media (hover: none) {
    .wiki-node:hover {
        transform: none;
    }

    .wiki-node.touch-active .wiki-icon {
        stroke: rgba(215, 210, 235, 1);
        filter: drop-shadow(0 0 6px rgba(210, 205, 230, 0.5));
    }

    .wiki-lower .wiki-node.touch-active .wiki-icon {
        stroke: rgba(200, 195, 220, 0.92);
        filter: drop-shadow(0 0 7px rgba(160, 155, 185, 0.5));
    }

    .wiki-node.touch-active .wiki-node-title {
        color: rgba(255, 255, 255, 0.95);
    }
}

/* ============================================================
   减弱动效 — prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .collapse-decor,
    .collapse-tagline,
    .collapse-title-char,
    .collapse-button,
    .collapse-star {
        animation: none !important;
        opacity: 0 !important;
    }

    .gate-core,
    .gate-ring,
    .gate-ring-outer,
    .transition-core {
        animation: none !important;
        display: none !important;
    }

    .wiki-portal.entering {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .wiki-portal.leaving,
    .wiki-portal.leaving .wiki-node,
    .wiki-portal.leaving .wiki-section-header,
    .wiki-portal.leaving .wiki-axis,
    .wiki-portal.leaving .wiki-svg,
    .wiki-portal.leaving .wiki-bg-canvas,
    .wiki-portal.leaving .wiki-upper,
    .wiki-portal.leaving .wiki-lower,
    .wiki-portal.leaving .wiki-axis-line,
    #landing-page.returning .landing-content {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .wiki-portal.entering .wiki-core-dot,
    .wiki-portal.entering .wiki-core-ring,
    .wiki-portal.entering .wiki-core-halo,
    .wiki-portal.entering .wiki-axis-line,
    .wiki-portal.entering .wiki-node,
    .wiki-portal.entering .wiki-conn-line,
    .wiki-portal.entering .wiki-upper .wiki-section-header,
    .wiki-portal.entering .wiki-lower .wiki-section-header {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
