/* ============================================================
   最终幻想游戏风格 · 水晶序曲 / 白魔法奇幻
   只替换CSS，HTML结构不变
   设计方向：水晶光芒 / 白魔法 / 神圣治愈
   ============================================================ */

/* 卡片容器 —— FF水晶序曲面板 */
.topic_wrap {
    position: relative;
    /* 深蓝紫到水晶青的渐变，像水晶序曲的星空 */
    background:
        radial-gradient(ellipse at 20% 15%, rgba(180, 220, 255, 0.2) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 85%, rgba(200, 180, 255, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(100, 140, 220, 0.3) 0%, transparent 70%),
        linear-gradient(175deg, #1a2050 0%, #2a3080 40%, #1e2868 70%, #101840 100%);

    /* 水晶白 + 淡紫双层边框，像水晶的光芒 */
    border: 2px solid #d0e0ff;
    box-shadow:
        inset 0 0 60px rgba(180, 220, 255, 0.1),
        inset 0 0 120px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    transition: all 0.4s ease;
    perspective: 1000px;
    /* 背景中隐约的水晶光芒 */
    background-image:
        radial-gradient(circle at 15% 25%, rgba(200, 220, 255, 0.08) 0%, transparent 20%),
        radial-gradient(circle at 85% 75%, rgba(200, 180, 255, 0.08) 0%, transparent 20%),
        radial-gradient(circle at 50% 50%, rgba(180, 220, 255, 0.06) 0%, transparent 30%);
}

/* 标题 —— FF水晶序曲标题 */
.topic_wrap .title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    /* 优雅衬线，像FF的标题 */
    font-family: 'Cinzel', 'Trajan Pro', 'Georgia', 'Songti SC', 'SimSun', serif;
    color: #ffffff;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow:
        0 0 10px rgba(180, 220, 255, 0.8),
        0 0 30px rgba(180, 220, 255, 0.5),
        0 0 60px rgba(200, 180, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.7);
    /* 底部水晶线，像水晶的光芒 */
    padding-bottom: 10px;
    border-bottom: 2px solid #d0e0ff;
    position: relative;
    animation: ff-crystal-glow 3.5s ease-in-out infinite;
}

/* 标题下方的淡紫装饰线，像魔法光芒 */
.topic_wrap .title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d0e0ff, #e8d8ff, #d0e0ff, transparent);
    opacity: 0.9;
    box-shadow: 0 0 15px rgba(208, 224, 255, 0.8);
}

@keyframes ff-crystal-glow {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(180, 220, 255, 0.8),
            0 0 30px rgba(180, 220, 255, 0.5),
            0 0 60px rgba(200, 180, 255, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.7);
    }
    50% {
        text-shadow:
            0 0 15px rgba(200, 230, 255, 1),
            0 0 40px rgba(180, 220, 255, 0.7),
            0 0 80px rgba(200, 180, 255, 0.5),
            0 2px 4px rgba(0, 0, 0, 0.7);
    }
}

/* 打字机容器 */
.typewriter-container {
    width: fit-content;
    margin: 0 auto;
    position: relative;
}

/* 顶部装饰 —— 水晶光芒条 */
.typewriter-container::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(208, 224, 255, 0.5) 15%,
        #d0e0ff 35%,
        #e8d8ff 50%,
        #d0e0ff 65%,
        rgba(208, 224, 255, 0.5) 85%,
        transparent 100%);
    margin-bottom: 12px;
    border-radius: 2px;
    opacity: 0.9;
    box-shadow:
        0 0 12px rgba(208, 224, 255, 0.6),
        0 0 24px rgba(200, 180, 255, 0.4);
    background-size: 200% 100%;
    animation: ff-crystal-flow 4s linear infinite;
}

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

/* 打字机核心 —— FF水晶序曲文字 */
.typewriter {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.15em;
    /* 优雅衬线，像FF的对话 */
    font-family: 'Cinzel', 'Trajan Pro', 'Georgia', 'Songti SC', 'SimSun', serif;
    color: #ffffff;
    text-shadow:
        0 0 5px rgba(180, 220, 255, 0.8),
        0 0 15px rgba(180, 220, 255, 0.5),
        0 0 30px rgba(200, 180, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.12em solid #d0e0ff; /* 水晶白光标 */
    width: 0;

    animation:
        typing 2.5s steps(10, end) forwards,
        blink-caret 0.8s step-end infinite,
        ff-crystal-flicker 4.5s ease-in-out infinite;
}

/* 打字动画 */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* 光标闪烁 —— 水晶白 */
@keyframes blink-caret {
    from, to { border-right-color: transparent; }
    50% { border-right-color: #d0e0ff; }
}

/* 水晶闪烁 —— 像水晶序曲的光芒 */
@keyframes ff-crystal-flicker {
    0%, 100% {
        opacity: 1;
        text-shadow:
            0 0 5px rgba(180, 220, 255, 0.8),
            0 0 15px rgba(180, 220, 255, 0.5),
            0 0 30px rgba(200, 180, 255, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.7);
    }
    50% {
        opacity: 0.96;
        text-shadow:
            0 0 8px rgba(200, 230, 255, 1),
            0 0 20px rgba(180, 220, 255, 0.7),
            0 0 40px rgba(200, 180, 255, 0.5),
            0 2px 4px rgba(0, 0, 0, 0.7);
    }
}

/* 伪元素 —— 右上角"CRYSTAL"水晶标识 */
.topic_wrap::before {
    content: 'CRYSTAL';
    position: absolute;
    top: 10px;
    right: 16px;
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: #d0e0ff;
    pointer-events: none;
    z-index: 0;
    border: 1px solid rgba(208, 224, 255, 0.5);
    padding: 2px 8px;
    background: rgba(26, 32, 80, 0.85);
    border-radius: 4px;
    box-shadow:
        0 0 12px rgba(208, 224, 255, 0.3),
        inset 0 0 10px rgba(208, 224, 255, 0.15);
    text-shadow: 0 0 10px rgba(208, 224, 255, 0.9);
    animation: crystal-pulse 2.5s ease-in-out infinite;
}

@keyframes crystal-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 伪元素 —— 左下角"WHITE MAGIC · FF"状态 */
.topic_wrap::after {
    content: 'WHITE MAGIC · FINAL FANTASY';
    position: absolute;
    bottom: 10px;
    left: 16px;
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: rgba(208, 224, 255, 0.6);
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 8px rgba(208, 224, 255, 0.5);
}

/* 确保内容在伪元素之上 */
.topic_wrap > * {
    position: relative;
    z-index: 1;
}