:root {
    /* === 深色底 + 柔和莫兰迪发光 === */
    --bg-deep: #1A1A22;
    --bg-mid: #22222E;
    --bg-surface: #2A2A38;

    --text-main: #E8E4DF;
    --text-secondary: #9A9A9A;
    --text-dim: #6A6A7A;

    /* 莫兰迪调 - 但更鲜明 */
    --morandi-rose: #D4A0A0;
    --morandi-peach: #E2B8A0;
    --morandi-gold: #D4C9A0;
    --morandi-sage: #A0C4A0;
    --morandi-teal: #8ABCBC;
    --morandi-blue: #9AAED4;
    --morandi-lavender: #B8A0D4;
    --morandi-mauve: #C4A0C4;

    /* 发光色 */
    --glow-rose: rgba(212, 160, 160, 0.4);
    --glow-peach: rgba(226, 184, 160, 0.4);
    --glow-gold: rgba(212, 201, 160, 0.4);
    --glow-sage: rgba(160, 196, 160, 0.4);
    --glow-teal: rgba(138, 188, 188, 0.4);
    --glow-blue: rgba(154, 174, 212, 0.4);
    --glow-lavender: rgba(184, 160, 212, 0.4);
    --glow-mauve: rgba(196, 160, 196, 0.4);

    --glass-bg: rgba(38, 38, 52, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);

    --font-primary: 'Outfit', 'Noto Sans SC', -apple-system, sans-serif;

    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-primary);
}

/* ===== App Container ===== */
#app {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ===== Particle Background ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* moved above image layer */
    pointer-events: none;
}

/* ===== Immersive Background Layer ===== */
#bg-image-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 2s var(--transition-smooth), transform 15s linear;
    /* 【图象清晰度调节】亮度(brightness)、对比度(contrast)、模糊度(blur) */
    filter: brightness(0.4) contrast(1.1) saturate(1.1) blur(1px);
    /* 遮罩边缘融合范围调节 */
    -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
    transform: scale(1.05);
}

#bg-image-layer.active {
    /* 【核心透明度调节】范围 0 (不可见) 到 1 (完全不透明) */
    opacity: 1;
    transform: scale(1);
}

/* ===== Header ===== */
#ui-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    height: 80px;
    padding: 0 36px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: linear-gradient(to bottom, rgba(26, 26, 34, 0.9) 0%, rgba(26, 26, 34, 0) 100%);
    pointer-events: none;
    /* 让中间区域可以透传点击 */
}

#ui-header>* {
    pointer-events: auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-self: start;
}

.logo-mark {
    width: 20px;
    height: 20px;
    background-image: url('imgs/five.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 6px rgba(255, 77, 77, 0.8));
    animation: pulse-soft 3s ease-in-out infinite;
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1.5px;
}

.crumb {
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.3s;
    white-space: nowrap;
}

.crumb:hover {
    color: var(--text-secondary);
}

.crumb.active {
    color: var(--text-main);
    cursor: default;
}

.crumb-separator {
    color: var(--text-dim);
    font-size: 10px;
    margin: 0 2px;
}

.actions {
    display: flex;
    gap: 12px;
    justify-self: end;
}

/* ===== Mode Switcher ===== */
#mode-switcher {
    display: flex;
    gap: 4px;
    background: rgba(40, 40, 56, 0.4);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 24px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.mode-btn svg {
    width: 16px;
    height: 16px;
}

.mode-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    color: var(--text-main);
    background: var(--glass-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
}

.btn-nav {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s var(--transition-smooth);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-nav:hover {
    border-color: var(--glass-border-hover);
    color: var(--text-main);
    background: rgba(50, 50, 70, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Level Indicator ===== */
#level-indicator {
    position: absolute;
    bottom: 36px;
    right: 36px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 300;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.level-ring {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--morandi-teal);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin-slow 8s linear infinite;
    box-shadow: 0 0 10px var(--glow-teal);
}

@keyframes spin-slow {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Main Canvas ===== */
#graph-container {
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: grab;
}

#graph-container:active {
    cursor: grabbing;
}

#canvas {
    width: 100%;
    height: 100%;
}

/* ===== Node Styles (SVG) ===== */
.node-group {
    cursor: pointer;
}

.node-outer-ring {
    fill: none;
    stroke-dasharray: 4 6;
    opacity: 0;
    transition: opacity 0.4s;
}

.node-group:hover .node-outer-ring {
    opacity: 1;
}

.node-glow {
    pointer-events: none;
}

.node-circle {
    transition: filter 0.3s, transform 0.3s;
}

.node-group:hover .node-circle {
    filter: brightness(1.25);
}

.node-label {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    font-size: 15px;
    font-weight: 500;
    fill: #ffffff;
    text-anchor: middle;
    pointer-events: none;
    letter-spacing: 0.5px;
    /* 高级文字暗影，保障高亮背景下的绝佳辨识度 */
    text-shadow: 0px 2px 6px rgba(0, 0, 0, 0.9), 0px 4px 12px rgba(0, 0, 0, 0.9);
}

.node-sublabel {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 11px;
    font-weight: 400;
    fill: #E8E4DF;
    text-anchor: middle;
    pointer-events: none;
    letter-spacing: 0.5px;
    text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.9);
}

.drill-icon {
    fill: none;
    stroke: var(--text-dim);
    stroke-width: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.node-group:hover .drill-icon {
    opacity: 1;
}

/* ===== Connection Lines ===== */
.connection-line {
    stroke-dasharray: 3 8;
    stroke-linecap: round;
}

/* ===== Zoom Controls ===== */
#zoom-controls {
    position: absolute;
    bottom: 36px;
    left: 36px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

#zoom-controls button {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

#zoom-controls button:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.zoom-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0 10px;
}

/* ===== Detail Panel (Grand Split Layout) ===== */
#detail-panel {
    position: absolute;
    right: 32px;
    top: 100px;
    bottom: 32px;
    width: 45%; 
    z-index: 40;
    border-radius: 36px;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    transform: translateX(0);
    opacity: 1;
}

#detail-panel.hidden {
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
}

/* 地图模式：详情面板收起时不遮挡右侧知识点列表 */
#map-view.active ~ #detail-panel.hidden,
#app:has(#map-view.active) #detail-panel.hidden {
    pointer-events: none !important;
}

.panel-glow {
    position: absolute;
    inset: -2px;
    border-radius: 38px;
    background: conic-gradient(from 0deg, var(--morandi-rose), var(--morandi-peach), var(--morandi-gold), var(--morandi-sage), var(--morandi-teal), var(--morandi-blue), var(--morandi-lavender), var(--morandi-rose));
    opacity: 0.15;
    animation: glow-rotate 12s linear infinite;
    z-index: -1;
    filter: blur(6px);
}

.panel-content {
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 42, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 36px;
    padding: 64px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
}

.btn-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.4s var(--transition-bounce);
}

.btn-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 8px;
}

.panel-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.badge {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--morandi-teal);
    letter-spacing: 2px;
    border: 1px solid rgba(138, 188, 188, 0.25);
}

.panel-color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-top: 10px;
    flex-shrink: 0;
}

#node-title {
    font-size: 46px;
    font-weight: 600;
    letter-spacing: 2px;
    line-height: 1.2;
    color: var(--text-main);
}

.intro {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 300;
}

.separator {
    height: 1px;
    background: var(--glass-border);
    width: 60px;
    position: relative;
    margin: 4px 0;
}

.sep-glow {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--morandi-teal), transparent);
    filter: blur(2px);
}

.description {
    font-size: 17px;
    line-height: 2;
    color: var(--text-main);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.panel-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 24px;
    margin-top: auto;
}

.meta {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 300;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

/* ===== Toast Container ===== */
#toast-container {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 30px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 300;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s var(--transition-smooth);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Transition Overlay ===== */
#transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-deep) 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

#transition-overlay.active {
    opacity: 1;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ===== Global Animations ===== */
@keyframes node-enter {
    0% {
        opacity: 0;
        transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(0.3);
    }

    60% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.6);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes dash-flow {
    to {
        stroke-dashoffset: -20;
    }
}

/* ===== View Panels (SPA Switching) ===== */
.view-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--transition-smooth);
    overflow: hidden;
}

.view-panel.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Outline Mode Styles ===== */
.outline-container {
    display: flex;
    width: calc(100% - 64px);
    height: calc(100% - 140px);
    margin: 100px 32px 40px;
    background: rgba(18, 18, 28, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    overflow: hidden;  /* 保留，防止圆角穿透 */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.outline-sidebar {
    width: 260px;
    background: rgba(10, 10, 15, 0.5);
    border-right: 1px solid var(--glass-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.outline-sidebar-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.outline-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s var(--transition-smooth);
}

.outline-tab i {
    width: 18px;
    height: 18px;
}

.outline-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.outline-tab.active {
    color: var(--text-main);
    background: var(--glass-bg);
    border-color: var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.outline-sidebar-contact {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.outline-contact-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.outline-contact-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-all;
}

.outline-main-content {
    flex: 1;
    min-width: 0;         /* 防止 flex 子项溢出压缩 */
    height: 100%;
    overflow: hidden;     /* 让内层 wrapper 负责滚动 */
    padding: 30px;
    box-sizing: border-box;
}

.outline-scroll-wrapper {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
    padding-bottom: 24px;  /* 底部留白，防止最后一张卡片贴边 */
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.outline-scroll-wrapper::-webkit-scrollbar {
    width: 5px;
}

.outline-scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.outline-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.outline-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.outline-course-card {
    background: rgba(30, 30, 45, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: visible;   /* 改为 visible，防止展开内容被裁切 */
    flex-shrink: 0;      /* 禁止 flex 压缩卡片高度 */
    transition: border-color 0.4s var(--transition-smooth),
                background   0.4s var(--transition-smooth),
                box-shadow   0.4s var(--transition-smooth);
}

.outline-course-card:hover {
    border-color: var(--glass-border-hover);
    background: rgba(30, 30, 45, 0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.outline-course-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;                        /* 默认四角都圆 */
    transition: background 0.2s;
}

/* 展开时，header 只保留上方圆角 */
.outline-course-card.expanded .outline-course-header {
    border-radius: 20px 20px 0 0;
}


.outline-course-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.outline-course-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.outline-course-title h4 {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.outline-course-subtitle {
    font-size: 13px;
    color: var(--text-dim);
    margin-left: 12px;
    font-weight: 300;
}

.outline-course-arrow {
    transition: transform 0.4s var(--transition-smooth);
    color: var(--text-secondary);
}

.outline-course-card.expanded .outline-course-arrow {
    transform: rotate(180deg);
}

.outline-course-body {
    display: none;
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    background: rgba(10, 10, 15, 0.2);
    border-radius: 0 0 20px 20px;  /* 与卡片圆角对齐 */
    animation: slide-down 0.35s ease;
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.outline-course-card.expanded .outline-course-body {
    display: block;
}

.outline-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    /* 确保网格高度由内容撑开，不被裁切 */
    overflow: visible;
}

.outline-section-box {
    background: rgba(45, 45, 60, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.3s;
}

.outline-section-box:hover {
    border-color: var(--glass-border-hover);
    background: rgba(45, 45, 60, 0.4);
}

.outline-section-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.outline-leaves-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.outline-leaf-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
}

.outline-leaf-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.outline-leaf-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    border-color: var(--morandi-teal);
    box-shadow: 0 0 10px rgba(138, 188, 188, 0.3);
}

.outline-direct-leaf {
    width: 100%;
    margin-top: 4px;
}

/* ===== Mindmap Mode Styles ===== */
.mindmap-control-bar {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    gap: 8px;
    background: rgba(30, 30, 45, 0.6);
    padding: 6px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mindmap-tab {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.mindmap-tab:hover {
    color: var(--text-secondary);
}

.mindmap-tab.active {
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mindmap-canvas-container {
    width: 100%;
    height: 100%;
}

#mindmap-canvas {
    width: 100%;
    height: 100%;
}

.mindmap-tip {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 12px;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* D3 Mindmap SVG styles */
.mindmap-link {
    fill: none;
    stroke-width: 1.5px;
    transition: stroke-width 0.3s;
}

.mindmap-node {
    cursor: pointer;
}

.mindmap-node rect {
    rx: 8px;
    ry: 8px;
    transition: all 0.3s;
}

.mindmap-node:hover rect {
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(255,255,255,0.15));
}

.mindmap-node text {
    font-family: var(--font-primary);
    font-size: 12px;
    fill: #ffffff;
    pointer-events: none;
    text-anchor: start;
}

/* ===== Globe / Map Mode — 全屏星云知识图谱 ===== */
#map-view.active {
    display: block;
}

#app:has(#map-view.active) #bg-image-layer {
    opacity: 0 !important;
    pointer-events: none;
}

#app:has(#map-view.active) #particle-canvas {
    opacity: 0;
}

.globe-layout--fullscreen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #04060f;
}

#map-view .globe-level-badge {
    position: absolute;
    top: 92px;
    right: 36px;
    z-index: 12;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(12, 14, 28, 0.65);
    border: 1px solid rgba(140, 160, 220, 0.22);
    color: var(--morandi-teal);
    letter-spacing: 0.5px;
    backdrop-filter: blur(12px);
    pointer-events: none;
}

#globe-canvas-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.globe-load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 360px;
    padding: 32px;
    text-align: center;
    color: var(--morandi-rose);
    font-size: 14px;
    line-height: 1.6;
}

#globe-canvas-container canvas {
    display: block;
    position: relative;
    z-index: 2;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    filter: saturate(1.15) contrast(1.05);
}

.globe-labels-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.globe-node-label {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    max-width: 160px;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(10, 13, 26, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    line-height: 1.4;
    white-space: normal;
    pointer-events: none;
    letter-spacing: 0.6px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.globe-node-label.is-center {
    font-size: 17px;
    font-weight: 600;
    max-width: 220px;
    padding: 8px 18px;
    background: rgba(14, 18, 36, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
}

#map-view.active ~ #detail-panel {
    z-index: 45;
}

#map-view.active ~ #detail-panel.hidden {
    z-index: 1;
}

.globe-node-label.is-clickable {
    pointer-events: auto;
    cursor: pointer;
}

.globe-node-label.is-clickable:hover {
    color: #ffffff;
    background: rgba(15, 20, 42, 0.88);
}

.globe-info-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-dim);
    gap: 16px;
    padding: 24px;
}

.globe-info-placeholder h4 {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.globe-info-placeholder p {
    font-size: 13px;
    line-height: 1.6;
}

.globe-info-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
}

.globe-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.globe-panel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.globe-panel-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.35;
}

.globe-panel-intro {
    font-size: 13px;
    color: var(--morandi-teal);
    margin-bottom: 12px;
}

.globe-panel-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 3px solid var(--morandi-teal);
    margin-bottom: 14px;
}

.globe-panel-hint {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.globe-leaf-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.globe-leaf-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.25s var(--transition-smooth);
    font-family: var(--font-primary);
}

.globe-leaf-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border-hover);
    transform: translateX(4px);
}

/* ===== Legacy Map Styles (shared panels) ===== */
.map-layout {
    display: flex;
    width: calc(100% - 64px);
    height: calc(100% - 140px);
    margin: 100px 32px 40px;
    gap: 24px;
}

.map-left {
    flex: 1.3;
    background: rgba(18, 18, 28, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.map-title-bar {
    margin-bottom: 16px;
}

.map-title-bar h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.map-title-bar p {
    font-size: 12px;
    color: var(--text-dim);
}

.map-svg-wrapper {
    flex: 1;
    width: 100%;
    position: relative;
    background: radial-gradient(circle at center, rgba(30,30,45,0.15) 0%, rgba(10,10,15,0.35) 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

#map-svg {
    width: 100%;
    height: 100%;
}

.map-right-panel {
    flex: 0.8;
    background: rgba(18, 18, 28, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.map-card-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    background: var(--morandi-rose);
    filter: blur(100px);
    opacity: 0.15;
    top: -50px;
    right: -50px;
    pointer-events: none;
}

.map-info-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-dim);
    gap: 16px;
    padding: 40px;
}

.map-info-placeholder h4 {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.map-info-placeholder p {
    font-size: 13px;
    line-height: 1.6;
}

.pulse-icon {
    width: 48px;
    height: 48px;
    color: var(--morandi-rose);
    filter: drop-shadow(0 0 10px var(--glow-rose));
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

.map-info-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

.map-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.map-checkpoint-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 12px rgba(255, 77, 77, 0.8);
}

.map-info-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-main);
}

.map-info-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border-left: 3px solid #ff4d4d;
}

.map-linkage-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map-linkage-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

.map-linkage-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-linkage-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.map-linkage-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.map-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.map-card-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    color: #fff !important;
}

.map-card-top h5 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.map-card-p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.map-card-link-text {
    font-size: 11px;
    color: var(--morandi-teal);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 300;
}

/* Map SVG specific style */
.map-checkpoint-marker {
    cursor: pointer;
}

.map-checkpoint-marker circle.core {
    fill: #ff4d4d;
    transition: all 0.3s;
}

.map-checkpoint-marker:hover circle.core {
    r: 9px;
    fill: #ffd93d;
}

.map-checkpoint-marker circle.ring {
    fill: none;
    stroke: #ff4d4d;
    stroke-width: 1.5;
    transform-origin: 0px 0px;
}

.map-checkpoint-marker.active circle.core {
    fill: #ffd93d;
    r: 9px;
    filter: drop-shadow(0 0 8px #ffd93d);
}

.map-grid line {
    stroke: rgba(255,255,255,0.02);
    stroke-width: 0.5;
}

/* ==========================================================================
   AWWWARDS-LEVEL INTERACTIVE HUD & DYNAMIC MAGNETIC CURSOR STYLING
   ========================================================================== */

/* 1. 磁性液体智能光标 (Magnetic Fluid Cursor) */
#custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    z-index: 99999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}

#custom-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    z-index: 99998;
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease,
                background-color 0.4s ease;
}

.cursor-ring-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
    z-index: 1;
}

#custom-cursor-ring .cursor-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-family: var(--font-primary);
    font-size: 9px;
    font-weight: 600;
    color: transparent;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
    transition: color 0.3s ease;
    white-space: nowrap;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 光标 Hover 交互状态 */
body.cursor-hover #custom-cursor-dot {
    width: 4px;
    height: 4px;
    background-color: var(--morandi-teal);
}

body.cursor-hover #custom-cursor-ring {
    width: 64px;
    height: 64px;
    border-color: rgba(138, 188, 188, 0.8);
    background-color: rgba(10, 13, 26, 0.45);
}

body.cursor-hover #custom-cursor-ring .cursor-ring-bg {
    background-color: rgba(10, 13, 26, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

body.cursor-hover #custom-cursor-ring .cursor-text {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* 隐藏真实鼠标 (仅在支持指针设备上激活，避免移动设备触控异常) */
@media (pointer: fine) {
    #map-view,
    #map-view * {
        cursor: none !important;
    }
}

/* 2. 科幻全息 HUD 视口 (Holographic HUD Viewport) */
.hud-frame-corners {
    position: absolute;
    inset: 20px;
    pointer-events: none;
    z-index: 10;
}

.hud-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: rgba(138, 188, 188, 0.35);
    border-style: solid;
    transition: border-color 0.5s ease;
}

.hud-corner.top-left { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.hud-corner.top-right { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; }
.hud-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; }
.hud-corner.bottom-right { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

#map-view.active:hover .hud-corner {
    border-color: var(--morandi-teal);
    filter: drop-shadow(0 0 4px var(--glow-teal));
}

/* 全息横向扫描光幕 */
.hud-scanning-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom, rgba(138, 188, 188, 0) 0%, rgba(138, 188, 188, 0.15) 50%, rgba(138, 188, 188, 0) 100%);
    box-shadow: 0 0 12px rgba(138, 188, 188, 0.12);
    z-index: 9;
    pointer-events: none;
    animation: hud-scan 8s linear infinite;
}

@keyframes hud-scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* 顶部系统遥测条 */
.hud-top-bar {
    position: absolute;
    top: 36px;
    left: 36px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(12, 14, 28, 0.5);
    border: 1px solid rgba(138, 188, 188, 0.15);
    padding: 6px 16px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    font-family: var(--font-primary);
}

.hud-sys-item {
    font-size: 10.5px;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-label {
    color: var(--text-dim);
}

.hud-val {
    color: var(--text-secondary);
    font-weight: 500;
}

.hud-val.glow-cyan {
    color: var(--morandi-teal);
    text-shadow: 0 0 6px var(--glow-teal);
}

.hud-divider {
    width: 1px;
    height: 12px;
    background-color: rgba(138, 188, 188, 0.15);
}

/* 左侧遥测数值面板 */
.hud-telemetry-panel {
    position: absolute;
    left: 36px;
    top: 100px;
    z-index: 12;
    background: rgba(12, 14, 28, 0.5);
    border: 1px solid rgba(138, 188, 188, 0.12);
    border-radius: 16px;
    padding: 16px 20px;
    width: 200px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    font-family: var(--font-primary);
}

.telemetry-title {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(138, 188, 188, 0.12);
    padding-bottom: 6px;
}

.telemetry-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 6px;
}

.telemetry-row:last-child {
    margin-bottom: 0;
}

.telemetry-row .lbl {
    color: var(--text-dim);
}

.telemetry-row .val {
    color: var(--text-main);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 左下角旋转罗盘盘 */
.hud-compass-panel {
    position: absolute;
    left: 36px;
    bottom: 36px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.hud-compass-svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 4px var(--glow-teal));
}

.hud-compass-needle {
    transform-origin: 50px 50px;
    animation: compass-spin 12s linear infinite;
}

@keyframes compass-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.compass-label {
    font-family: var(--font-primary);
    font-size: 8.5px;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* 全局右下角音乐控制面板 */
.hud-audio-panel {
    position: fixed;
    right: 36px;
    bottom: 36px;
    z-index: 99999;
}

.hud-audio-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(12, 14, 28, 0.65);
    border: 1px solid rgba(138, 188, 188, 0.22);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s var(--transition-smooth);
}

.hud-audio-btn:hover {
    border-color: var(--morandi-teal);
    color: var(--text-main);
    background: rgba(12, 14, 28, 0.85);
    box-shadow: 0 4px 16px var(--glow-teal);
}

.sound-wave-bars {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    width: 14px;
    height: 12px;
}

.sound-wave-bars .bar {
    width: 1.5px;
    height: 100%;
    background-color: var(--morandi-teal);
    transform-origin: bottom;
    transform: scaleY(0.15);
    transition: transform 0.3s ease;
}

/* 激活音效时的声波动画 */
.hud-audio-btn.active .sound-wave-bars .bar-1 { animation: sound-bounce 1.0s ease-in-out infinite alternate; }
.hud-audio-btn.active .sound-wave-bars .bar-2 { animation: sound-bounce 0.7s ease-in-out infinite alternate 0.15s; }
.hud-audio-btn.active .sound-wave-bars .bar-3 { animation: sound-bounce 1.2s ease-in-out infinite alternate 0.3s; }
.hud-audio-btn.active .sound-wave-bars .bar-4 { animation: sound-bounce 0.9s ease-in-out infinite alternate 0.05s; }

@keyframes sound-bounce {
    0% { transform: scaleY(0.15); }
    100% { transform: scaleY(1.0); }
}

.hud-audio-text {
    letter-spacing: 0.8px;
}

/* 星体漂浮动画 */
@keyframes planet-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
