@charset "utf-8";

/* ============================================================
   恐怖氛围风格 · 只替换CSS，HTML结构不变
   ============================================================ */

/* 卡片容器 —— 阴森压抑的暗色面板 */
.topic_wrap {
    position: relative;
    /* 极深的红黑色，像干涸的血迹 */
    background: #ccc;

    /* 多层暗色描边 + 暗红光晕，像陈旧的铁框 */
    border: 1px solid #2a1515;
    margin: 0 auto;
    transition: box-shadow 0.3s ease;

    /* 轻微的倾斜，增加不安感 */
    
    /* 背景中隐约的血渍纹理 */
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(60, 0, 0, 0.2) 0%, transparent 30%),
        radial-gradient(ellipse at 80% 70%, rgba(50, 0, 0, 0.15) 0%, transparent 25%),
        radial-gradient(ellipse at 60% 20%, rgba(40, 0, 0, 0.1) 0%, transparent 20%);
}

/* 标题 —— 暗红色的诡异标题 */
.topic_wrap .title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    /* 衬线字体，像旧报纸或遗书 */
    font-family: 'Times New Roman', 'Songti SC', 'SimSun', serif;
    color: #8a1a1a;                    /* 暗红色，像干涸的血 */
    letter-spacing: 0.12em;            /* 较宽字距，像颤抖的手写体 */
    text-shadow:
        0 0 8px rgba(138, 26, 26, 0.6),
        0 0 20px rgba(100, 0, 0, 0.4),
        0 0 40px rgba(60, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.9);
    /* 随机闪烁，像接触不良的灯 */
    animation: horror-flicker 4s ease-in-out infinite;
}

/* 打字机容器 —— 保持居中 */
.typewriter-container {
    width: fit-content;
    margin: 0 auto;
}

/* 打字机容器顶部装饰 —— 改成暗红色的裂纹/警戒线 */
.typewriter-container::before {
    content: '';
    display: block;
    height: 2px;
    /* 暗红到透明的渐变，像一道血迹 */
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(80, 0, 0, 0.2) 15%,
        rgba(138, 26, 26, 0.5) 50%,
        rgba(80, 0, 0, 0.2) 85%,
        transparent 100%);
    margin-bottom: 10px;
    border-radius: 0;
    opacity: 0.8;
    /* 缓慢脉动，像呼吸 */
    animation: horror-pulse 3s ease-in-out infinite;
}

/* 打字机核心 —— 恐怖文字 */
.typewriter {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.12em;            /* 较宽字距，像颤抖的手写体 */
    /* 衬线字体，像旧报纸或遗书 */
    font-family: 'Times New Roman', 'Songti SC', 'SimSun', serif;
    color: #8a1a1a;                    /* 暗红色，像干涸的血 */
    text-shadow:
        0 0 8px rgba(138, 26, 26, 0.6),
        0 0 20px rgba(100, 0, 0, 0.4),
        0 0 40px rgba(60, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;               /* 保持单行，防止换行破坏打字动画 */
    overflow: hidden;                  /* 隐藏未打出的部分 */
    border-right: 0.12em solid #8a1a1a; /* 暗红色光标 */
    width: 0;

    /* 打字动画：宽度从0到100%，步骤数等于字符数 */
    animation:
        typing 4s steps(10, end) forwards,      /* 放慢到4秒，营造不安 */
        blink-caret 1.2s step-end infinite,      /* 光标慢闪，像垂死挣扎 */
        horror-flicker 4s ease-in-out infinite;  /* 整体闪烁，像接触不良的灯 */
}

/* 打字动画：从宽度0到100% */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* 光标闪烁动画：border-right 颜色透明/暗红交替 */
@keyframes blink-caret {
    from, to { border-right-color: transparent; }
    50% { border-right-color: #8a1a1a; }
}

/* 恐怖闪烁动画：模拟电压不稳的灯光 */
@keyframes horror-flicker {
    0%, 100% { opacity: 1; }
    3% { opacity: 0.8; }
    6% { opacity: 1; }
    7% { opacity: 0.6; }
    8% { opacity: 1; }
    45% { opacity: 1; }
    46% { opacity: 0.7; }
    47% { opacity: 1; }
    78% { opacity: 1; }
    79% { opacity: 0.5; }
    80% { opacity: 1; }
}

/* 顶部装饰线的脉动动画 */
@keyframes horror-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
