/* ============================================================
   恐怖惊魂风格 · 纯黑底色版
   只替换CSS，HTML结构不变
   设计方向：纯黑凶宅 / 诅咒录像带 / 心理恐怖
   ============================================================ */

/* 卡片容器 —— 纯黑凶宅面板 */
.topic_wrap {
    position: relative;
    /* 纯黑底 + 暗红光晕 + 暗绿光晕 */
    background:
        radial-gradient(ellipse at 15% 20%, rgba(80, 0, 0, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 80%, rgba(0, 40, 20, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(10, 5, 5, 0.8) 0%, transparent 70%),
        linear-gradient(175deg, #000000 0%, #050202 40%, #020101 70%, #000000 100%);

    /* 暗红 + 暗绿双层边框，像旧铁门/锈迹 */
    border: 2px solid #4a1010;
    box-shadow:
        inset 0 0 60px rgba(60, 0, 0, 0.12),
        inset 0 0 140px rgba(0, 0, 0, 0.98);
    margin: 0 auto;
    transition: all 0.4s ease;
    perspective: 1000px;
    /* 背景中隐约的血渍/霉斑 */
    background-image:
        radial-gradient(circle at 18% 28%, rgba(80, 0, 0, 0.1) 0%, transparent 12%),
        radial-gradient(circle at 72% 68%, rgba(60, 0, 0, 0.08) 0%, transparent 10%),
        radial-gradient(circle at 45% 85%, rgba(0, 40, 20, 0.06) 0%, transparent 15%),
        radial-gradient(circle at 88% 22%, rgba(60, 0, 0, 0.06) 0%, transparent 8%);
    /* 轻微的倾斜，像歪斜的旧相框 */
    transform: rotate(-0.3deg);
}

/* 标题 —— 恐怖惊魂标题 */
.topic_wrap .title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    /* 衬线字体，像旧报纸/遗书 */
    font-family: 'Times New Roman', 'Songti SC', 'SimSun', serif;
    color: #a02020;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow:
        0 0 10px rgba(160, 32, 32, 0.8),
        0 0 30px rgba(120, 0, 0, 0.5),
        0 0 60px rgba(60, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.95);
    /* 底部暗红线，像血痕 */
    padding-bottom: 8px;
    border-bottom: 1px solid #4a1010;
    position: relative;
    animation: horror-title-flicker 4s ease-in-out infinite;
}

/* 标题下方的暗绿装饰线，像霉斑/腐蚀 */
.topic_wrap .title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 25%;
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #2a4a2a, #4a6a4a, #2a4a2a, transparent);
    opacity: 0.6;
    box-shadow: 0 0 8px rgba(42, 74, 42, 0.5);
}

@keyframes horror-title-flicker {
    0%, 100% {
        opacity: 1;
        text-shadow:
            0 0 10px rgba(160, 32, 32, 0.8),
            0 0 30px rgba(120, 0, 0, 0.5),
            0 0 60px rgba(60, 0, 0, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.95);
    }
    5% { opacity: 0.7; }
    7% { opacity: 1; }
    52% { opacity: 1; }
    53% { opacity: 0.5; }
    54% { opacity: 1; }
    84% { opacity: 1; }
    85% { opacity: 0.75; }
    86% { opacity: 1; }
}

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

/* 顶部装饰 —— 血迹/警戒线 */
.typewriter-container::before {
    content: '';
    display: block;
    height: 3px;
    background:
        repeating-linear-gradient(
            90deg,
            #4a1010 0px,
            #4a1010 6px,
            transparent 6px,
            transparent 10px
        );
    margin-bottom: 10px;
    opacity: 0.7;
    box-shadow: 0 0 8px rgba(74, 16, 16, 0.5);
}

/* 打字机核心 —— 恐怖惊魂文字 */
.typewriter {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2em;
    /* 衬线字体，像旧报纸/遗书 */
    font-family: 'Times New Roman', 'Songti SC', 'SimSun', serif;
    color: #b0a8a0;
    text-shadow:
        0 0 5px rgba(160, 32, 32, 0.5),
        0 0 15px rgba(120, 0, 0, 0.3),
        0 0 30px rgba(60, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.12em solid #8a1a1a; /* 暗红光标，像血线 */
    width: 0;

    animation:
        typing 4s steps(10, end) forwards,
        blink-caret 1.2s step-end infinite,
        horror-flicker 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: #8a1a1a; }
}

/* 恐怖闪烁 —— 像接触不良的灯/电压不稳 */
@keyframes horror-flicker {
    0%, 100% {
        opacity: 1;
        text-shadow:
            0 0 5px rgba(160, 32, 32, 0.5),
            0 0 15px rgba(120, 0, 0, 0.3),
            0 0 30px rgba(60, 0, 0, 0.2),
            0 2px 4px rgba(0, 0, 0, 0.95);
    }
    3% { opacity: 0.75; }
    5% { opacity: 1; }
    48% { opacity: 1; }
    49% { opacity: 0.6; }
    50% { opacity: 1; }
    51% { opacity: 0.8; }
    52% { opacity: 1; }
    82% { opacity: 1; }
    83% { opacity: 0.55; }
    84% { opacity: 1; }
}

/* 伪元素 —— 右上角"DO NOT ENTER"警告 */
.topic_wrap::before {
    content: 'DO NOT ENTER';
    position: absolute;
    top: 10px;
    right: 16px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #8a1a1a;
    pointer-events: none;
    z-index: 0;
    border: 1px solid rgba(138, 26, 26, 0.5);
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.85);
    box-shadow:
        0 0 10px rgba(138, 26, 26, 0.3),
        inset 0 0 10px rgba(138, 26, 26, 0.1);
    text-shadow: 0 0 8px rgba(138, 26, 26, 0.8);
    animation: warning-pulse 2s ease-in-out infinite;
}

@keyframes warning-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 伪元素 —— 左下角"TAPE · 00:00:00"诅咒录像带 */
.topic_wrap::after {
    content: 'TAPE · 00:00:00';
    position: absolute;
    bottom: 10px;
    left: 16px;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: rgba(138, 26, 26, 0.45);
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 6px rgba(138, 26, 26, 0.4);
}

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