/* ===== 蓝藻魔法故事馆 · 样式圣典 ===== */

:root {
    /* 核心色谱 */
    --color-deep-sea: #0a1128;
    --color-abyssal-blue: #162447;
    --color-bioluminescent: #00d2ff;
    --color-bioluminescent-soft: rgba(0, 210, 255, 0.15);
    --color-moss-glow: #2af598;
    --color-moonlight: #c0c0ff;
    --color-laboratory-silver: #e0e0ff;
    
    /* 呼吸节奏 */
    --breath-duration: 5s;
}

/* === 基础重置 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: var(--color-deep-sea);
    color: var(--color-laboratory-silver);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* === 深海背景层 === */
.deep-sea-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, var(--color-bioluminescent-soft) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(42, 245, 152, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, var(--color-deep-sea) 0%, var(--color-abyssal-blue) 100%);
    z-index: -2;
    animation: deepCurrent 30s ease-in-out infinite alternate;
}

@keyframes deepCurrent {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* === 呼吸光点 === */
.breathing-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.7;
}

.breathing-lights::before {
    content: '';
    position: absolute;
    width: 300vw;
    height: 300vh;
    background-image: 
        radial-gradient(circle at 10% 20%, var(--color-bioluminescent) 1px, transparent 1px),
        radial-gradient(circle at 30% 50%, var(--color-moss-glow) 1px, transparent 1px),
        radial-gradient(circle at 70% 80%, var(--color-moonlight) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 120px 120px;
    animation: breathLight var(--breath-duration) ease-in-out infinite;
}

@keyframes breathLight {
    0%, 100% { opacity: 0.3; transform: translate(0, 0); }
    50% { opacity: 1; transform: translate(10px, -5px); }
}

/* === 主容器 === */
.story-sanctuary {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* === 页眉样式 === */
.sanctuary-header {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 3rem;
}

.main-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.title-chinese {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--color-bioluminescent), var(--color-moss-glow));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.title-english {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-moonlight);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-moonlight);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.header-quote {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 210, 255, 0.3);
    border-bottom: 1px solid rgba(0, 210, 255, 0.3);
}

.header-quote p {
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-laboratory-silver);
}

/* === 三重奏培养皿区域 === */
.trio-chamber {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin: 6rem 0;
    position: relative;
    flex-wrap: wrap;
}

.petri-dish {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
    position: relative;
}

.dish-circle {
    background: 
        radial-gradient(circle at center, 
            rgba(10, 17, 40, 0.8) 0%,
            rgba(22, 36, 71, 0.9) 70%,
            rgba(0, 210, 255, 0.1) 100%);
    border-radius: 50%;
    padding: 2rem;
    box-shadow: 
        0 0 60px rgba(0, 210, 255, 0.2),
        inset 0 0 40px rgba(42, 245, 152, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.3);
    transition: all 0.6s ease;
    height: 100%;
}

.petri-dish:hover .dish-circle {
    transform: translateY(-10px);
    box-shadow: 
        0 0 80px rgba(0, 210, 255, 0.4),
        inset 0 0 60px rgba(42, 245, 152, 0.2);
}

.dish-content {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dish-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.8rem;
    color: var(--color-bioluminescent);
    margin-bottom: 0.5rem;
}

.dish-subtitle {
    font-size: 1.1rem;
    color: var(--color-moonlight);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.dish-image-wrapper {
    width: 200px;
    height: 200px;
    margin: 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dish-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.5));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.dish-text {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(224, 224, 255, 0.9);
    margin: 1.5rem 0;
    flex-grow: 1;
}

.dish-quote {
    font-style: italic;
    color: var(--color-moss-glow);
    padding: 1rem;
    border-top: 1px solid rgba(42, 245, 152, 0.3);
    font-size: 1.1rem;
    width: 100%;
}

/* === 连接导管 === */
.connecting-tube {
    position: absolute;
    top: 50%;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--color-bioluminescent),
        var(--color-moss-glow),
        var(--color-bioluminescent),
        transparent
    );
    transform: translateY(-50%);
    z-index: -1;
    animation: tubeFlow 3s linear infinite;
}

@keyframes tubeFlow {
    0% { background-position: 0% center; }
    100% { background-position: 100% center; }
}

/* === 理论注解 === */
.theory-footnote {
    max-width: 800px;
    margin: 8rem auto 4rem;
    padding: 2.5rem;
    background: rgba(22, 36, 71, 0.6);
    border-left: 4px solid var(--color-bioluminescent);
    border-radius: 0 20px 20px 0;
    position: relative;
    overflow: hidden;
}

.footnote-content {
    position: relative;
    z-index: 2;
}

.footnote-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
    color: var(--color-moss-glow);
    margin-bottom: 1rem;
}

.footnote-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--color-laboratory-silver);
    margin-bottom: 2rem;
}

.footnote-text em {
    color: var(--color-bioluminescent);
    font-style: italic;
}

.loop-symbol {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    color: rgba(0, 210, 255, 0.1);
    animation: rotateLoop 20s linear infinite;
}

@keyframes rotateLoop {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* === 隐藏魔法提示 === */
.secret-hint {
    text-align: center;
    margin: 3rem 0;
    padding: 1rem;
    background: rgba(0, 210, 255, 0.05);
    border-radius: 10px;
    opacity: 0;
    animation: fadeInHint 5s ease-in-out 3s forwards;
}

@keyframes fadeInHint {
    to { opacity: 0.7; }
}

.secret-hint p {
    color: var(--color-moonlight);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

/* === 返回罗盘 === */
.compass-return {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(22, 36, 71, 0.8);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--color-bioluminescent);
    transition: all 0.3s ease;
    z-index: 100;
}

.compass-return:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.4);
}

.compass-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.compass-text {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

/* === 呼吸魔法激活样式 === */
body.breath-activated .deep-sea-bg {
    animation-duration: 10s;
}

body.breath-activated .dish-image {
    animation: breathGlow 2s ease-in-out infinite;
}

@keyframes breathGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 30px rgba(0, 210, 255, 0.9)); }
}

/* === 响应式设计 === */
@media (max-width: 1100px) {
    .trio-chamber {
        flex-direction: column;
        align-items: center;
    }
    
    .petri-dish {
        max-width: 500px;
        margin-bottom: 3rem;
    }
    
    .connecting-tube {
        width: 2px;
        height: 80%;
        left: 50%;
        top: 10%;
        right: auto;
        background: linear-gradient(
            180deg,
            transparent,
            var(--color-bioluminescent),
            var(--color-moss-glow),
            var(--color-bioluminescent),
            transparent
        );
    }
}

@media (max-width: 768px) {
    .title-chinese {
        font-size: 2.5rem;
    }
    
    .story-sanctuary {
        padding: 1rem;
    }
    
    .trio-chamber {
        gap: 2rem;
    }
}