* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gothic-black: #0c0814;
    --dark-purple: #1a0f2e;
    --mid-purple: #2d1b4d;
    --light-purple: #4a2d7c;
    --accent-purple: #6b46c1;
    --soft-purple: #9f7aea;
    --parchment: #e9e4f0;
    --metal: #b8b2c9;
    --fog: rgba(159, 122, 234, 0.05);
    --crack: rgba(100, 100, 120, 0.3);
    --blood: #5c2a3a;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background-color: var(--gothic-black);
    color: var(--parchment);
    overflow: hidden;
    position: relative;
    height: 100vh;
    width: 100vw;
}

/* 动态雾效果 */
.fog-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.fog {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--fog) 0%, transparent 70%);
    animation: fog-move 40s infinite linear;
    opacity: 0.3;
}

.fog2 {
    animation: fog-move 60s infinite linear reverse;
    opacity: 0.2;
}

/* 蜘蛛网纹理 */
.spiderweb {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, transparent 98%, rgba(159, 122, 234, 0.03) 100%),
        radial-gradient(circle at 90% 80%, transparent 98%, rgba(159, 122, 234, 0.03) 100%),
        radial-gradient(circle at 50% 50%, transparent 98%, rgba(159, 122, 234, 0.03) 100%);
    background-size: 300px 300px, 400px 400px, 500px 500px;
    z-index: 2;
    opacity: 0.4;
}

/* 边缘烧灼效果 */
.vignette {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 60%, rgba(12, 8, 20, 0.9) 100%);
    z-index: 3;
    pointer-events: none;
}

/* 闪电/幻象效果 */
.lightning {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 30%, rgba(107, 70, 193, 0.1) 50%, transparent 70%);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    animation: lightning-flash 15s infinite;
}

/* 初始页面 */
.landing-page {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background-color: rgba(12, 8, 20, 0.95);
    transition: opacity 1.5s ease;
}

.landing-page.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 初始页面背景图样式 - 确保在最底层 */
.landing-background {
    position: fixed; /* 改为 fixed 确保覆盖整个视口 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/nevermore-academy.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1; /* 负值确保在最底层 */
    opacity: 0.7; /* 增加透明度 */
    filter: brightness(0.8) contrast(1.1);
}

/* 确保初始页面有透明背景 */
.landing-page {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background-color: rgba(12, 8, 20, 0.4); /* 减少遮罩不透明度 */
    transition: opacity 1.5s ease;
}

/* 修改雾效果，降低不透明度 */
.fog {
    opacity: 0.15; /* 从 0.3 降低到 0.15 */
}

.fog2 {
    opacity: 0.1; /* 从 0.2 降低到 0.1 */
}

/* 修改边缘烧灼效果，只在主页面显示 */
.vignette {
    display: none; /* 默认隐藏 */
}

.main-container.visible ~ .vignette {
    display: block; /* 主页面显示时才显示 */
}

.academy-title {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 6rem;
    color: var(--soft-purple);
    text-shadow: 0 0 10px rgba(159, 122, 234, 0.5);
    margin-bottom: 2rem;
    letter-spacing: 3px;
    animation: title-pulse 4s infinite;
}

.enter-button {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.8rem;
    background: linear-gradient(to bottom, var(--mid-purple), var(--dark-purple));
    color: var(--metal);
    border: 2px solid var(--accent-purple);
    padding: 1rem 3rem;
    border-radius: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(107, 70, 193, 0.3);
    margin-top: 2rem;
}

.enter-button:hover {
    color: var(--parchment);
    border-color: var(--soft-purple);
    box-shadow: 0 0 25px rgba(159, 122, 234, 0.5);
    transform: scale(1.05);
}

.enter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(159, 122, 234, 0.2), transparent);
    transition: left 0.7s ease;
}

.enter-button:hover::before {
    left: 100%;
}

/* 主页面 */
.main-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    z-index: 5;
}

.main-container.visible {
    display: flex;
}

/* 标题栏 */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background-color: rgba(26, 15, 46, 0.8);
    border-bottom: 2px solid var(--accent-purple);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 6;
    position: relative;
}

.main-title {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 3.5rem;
    color: var(--soft-purple);
    text-shadow: 0 0 8px rgba(159, 122, 234, 0.5);
    letter-spacing: 2px;
    animation: text-shake 10s infinite;
}

/* 内容区域 */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧筛选面板 */
.filter-panel {
    width: 280px;
    background-color: rgba(26, 15, 46, 0.85);
    border-right: 1px solid var(--accent-purple);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 7;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%236b46c1' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.panel-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.5rem;
    color: var(--soft-purple);
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--accent-purple);
    padding-bottom: 0.5rem;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h3 {
    font-size: 1.2rem;
    color: var(--metal);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    background-color: rgba(45, 27, 77, 0.5);
    color: var(--metal);
    border: 1px solid var(--mid-purple);
    padding: 0.5rem 0.8rem;
    border-radius: 2px;
    cursor: pointer;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    background-color: rgba(107, 70, 193, 0.3);
    border-color: var(--accent-purple);
    color: var(--parchment);
}

.filter-btn.active {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
    color: var(--parchment);
    box-shadow: 0 0 8px rgba(107, 70, 193, 0.5);
}

.search-box {
    width: 100%;
    padding: 0.7rem;
    background-color: rgba(12, 8, 20, 0.7);
    border: 1px solid var(--mid-purple);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 5px rgba(107, 70, 193, 0.5);
}

/* 关系图区域 */
.graph-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#relationship-graph {
    width: 100%;
    height: 100%;
}

/* 右侧人物介绍面板 */
.character-panel {
    width: 320px;
    background-color: rgba(26, 15, 46, 0.85);
    border-left: 1px solid var(--accent-purple);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 7;
    display: none;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%236b46c1' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.character-panel.visible {
    display: block;
}

.character-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--accent-purple);
    padding-bottom: 1rem;
}

.character-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 1rem;
}

.character-name {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.8rem;
    color: var(--soft-purple);
}

.character-details h3 {
    font-size: 1.2rem;
    color: var(--metal);
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.character-details p {
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.ability-list, .secret-list {
    list-style-type: none;
    padding-left: 1rem;
}

.ability-list li, .secret-list li {
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 1.2rem;
}

.ability-list li::before {
    content: '★';
    position: absolute;
    left: 0;
    color: var(--soft-purple);
}

.secret-list li::before {
    content: '🕵️';
    position: absolute;
    left: 0;
}

/* 关闭按钮样式 */
.character-close-btn {
    margin-left: auto; /* 将按钮推到右侧 */
    background: none;
    border: none;
    color: var(--metal);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    padding: 0;
}

.character-close-btn:hover {
    color: var(--parchment);
    background-color: rgba(107, 70, 193, 0.3);
    transform: scale(1.1);
}

.character-close-btn:active {
    transform: scale(0.95);
}

/* 节点样式 */
:root {
  --soft-purple: #9f7eea;
}

/* 节点样式 */
.node {
  cursor: pointer;
  pointer-events: all;
  transition: filter 0.3s ease;
}

.node circle {
  stroke-width: 3;
  stroke: transparent;
  transition: stroke 0.3s ease;
  vector-effect: non-scaling-stroke;
}

.node:hover {
  filter: drop-shadow(0 0 8px rgba(159, 122, 234, 0.4));
}

.node:hover circle {
  stroke: var(--soft-purple);
}

.node.wednesday {
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
}

.node.dead {
  filter: grayscale(0.7) brightness(0.7);
  position: relative;
}

.node.dead::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 45%, var(--crack) 50%, transparent 55%);
    background-size: 10px 10px;
}


/* 关系线样式 */
.link {
    stroke-width: 2;
    stroke-opacity: 0.6;
    transition: stroke-opacity 0.3s ease;
}

.link.active {
    stroke-opacity: 1;
    animation: blood-flow 2s infinite;
}

/* 切换形态按钮 */
.form-toggle {
    position: absolute;
    top: -25px;
    right: -25px;
    width: 25px;
    height: 25px;
    background-color: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: white;
    z-index: 100;
    border: 2px solid var(--soft-purple);
}



/* 墨水波纹效果 */
.ink-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 70, 193, 0.3) 10%, transparent 70%);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
    z-index: 9;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .filter-panel, .character-panel {
        width: 250px;
    }
}

@media (max-width: 900px) {
    .content {
        flex-direction: column;
    }
    
    .filter-panel {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--accent-purple);
    }
    
    .character-panel {
        width: 100%;
        height: 300px;
        border-left: none;
        border-top: 1px solid var(--accent-purple);
    }
    
    .graph-container {
        flex: 1;
        min-height: 400px;
    }
    
    .academy-title {
        font-size: 4rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
}


/* 角色选择器样式 */
.character-selector {
    margin-bottom: 1.5rem;
}

.selector-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.8rem;
}

.selector-row label {
    font-size: 0.9rem;
    color: var(--metal);
    margin-bottom: 0.3rem;
}

.character-select {
    width: 100%;
    padding: 0.5rem;
    background-color: rgba(12, 8, 20, 0.7);
    border: 1px solid var(--mid-purple);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    border-radius: 2px;
    cursor: pointer;
}

.character-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 5px rgba(107, 70, 193, 0.5);
}

.character-select option {
    background-color: var(--dark-purple);
    color: var(--parchment);
}

/* 优化节点点击效果 */
.node.clicked circle {
    animation: node-click-pulse 0.8s ease-out;
    stroke-width: 4;
    stroke-opacity: 0.8;
}

@keyframes node-click-pulse {
    0% {
        stroke-width: 2;
        stroke-opacity: 1;
    }
    50% {
        stroke-width: 5;
        stroke-opacity: 0.8;
        filter: drop-shadow(0 0 8px var(--accent-purple));
    }
    100% {
        stroke-width: 2;
        stroke-opacity: 1;
    }
}

/* 优化墨水波纹效果 */
.ink-ripple {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 70, 193, 0.3) 10%, transparent 70%);
    transform: scale(0);
    animation: ripple 0.8s ease-out;
    pointer-events: none;
    z-index: 9;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.7;
    }
    70% {
        opacity: 0.3;
    }
    100% {
        transform: scale(10);
        opacity: 0;
    }
}

/* 节点固定效果 */
.node.fixed circle {
    stroke-dasharray: 5, 3;
    stroke-dashoffset: 0;
    animation: fixed-pulse 2s infinite linear;
}

@keyframes fixed-pulse {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 8;
    }
}