/* ============================================================
   摩托车竞速 · 机车风格
   只替换CSS，HTML结构不变
   设计方向：摩托赛事转播 / 机车仪表盘 / 机械硬核
   ============================================================ */

/* 卡片容器 —— 机车仪表盘面板 */
.topic_wrap {
    position: relative;
    /* 深铁灰到黑铁的渐变，像摩托车油箱/车架 */
    background:
        radial-gradient(ellipse at 20% 15%, rgba(255, 120, 0, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 85%, rgba(200, 40, 20, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(60, 60, 70, 0.5) 0%, transparent 70%),
        linear-gradient(175deg, #0e0e12 0%, #16161c 40%, #101014 70%, #08080a 100%);

    /* 金属橙边框，像机车排气管/车架 */
    border: 2px solid #e86010;
    box-shadow:
        inset 0 0 40px rgba(255, 120, 0, 0.06),
        inset 0 0 100px rgba(0, 0, 0, 0.85);
    margin: 0 auto;
    transition: all 0.35s ease;
    perspective: 1000px;
    /* 背景中隐约的金属拉丝纹理 */
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(255, 255, 255, 0.01) 3px,
            rgba(255, 255, 255, 0.01) 6px
        );
}

/* 标题 —— 摩托车赛事标题 */
.topic_wrap .title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    /* 粗黑斜体，像机车赛事的粗犷字体 */
    font-family: 'Impact', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-style: italic;
    color: #f0f0f0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-shadow:
        0 0 8px rgba(255, 120, 0, 0.7),
        0 0 20px rgba(255, 120, 0, 0.35),
        2px 2px 0 #1a1a20,
        0 2px 4px rgba(0, 0, 0, 0.9);
    /* 底部金属橙线，像机车装饰条 */
    padding-bottom: 8px;
    border-bottom: 2px solid #e86010;
    position: relative;
    transform: skewX(-6deg);
    animation: moto-title-pulse 2s ease-in-out infinite;
}

/* 标题下方的红线装饰，像转速红线 */
.topic_wrap .title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff2020, #ff4040, #ff2020, transparent);
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(255, 40, 40, 0.7);
}

@keyframes moto-title-pulse {
    0%, 100% {
        text-shadow:
            0 0 8px rgba(255, 120, 0, 0.7),
            0 0 20px rgba(255, 120, 0, 0.35),
            2px 2px 0 #1a1a20,
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
    50% {
        text-shadow:
            0 0 12px rgba(255, 140, 20, 0.9),
            0 0 30px rgba(255, 120, 0, 0.5),
            2px 2px 0 #1a1a20,
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
}

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

/* 顶部装饰 —— 链条/传动带纹理 */
.typewriter-container::before {
    content: '';
    display: block;
    height: 4px;
    background:
        repeating-linear-gradient(
            90deg,
            #e86010 0px,
            #e86010 4px,
            #1a1a20 4px,
            #1a1a20 8px
        );
    margin-bottom: 10px;
    opacity: 0.8;
    box-shadow: 0 0 8px rgba(255, 120, 0, 0.3);
    border-radius: 2px;
}

/* 打字机核心 —— 机车仪表盘文字 */
.typewriter {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    /* 粗黑斜体，像机车仪表盘数字 */
    font-family: 'Impact', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-style: italic;
    color: #f0f0f0;
    text-shadow:
        0 0 5px rgba(255, 120, 0, 0.6),
        0 0 15px rgba(255, 120, 0, 0.3),
        1px 1px 0 #1a1a20,
        0 2px 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.12em solid #ff7820; /* 金属橙光标，像尾灯 */
    width: 0;
    transform: skewX(-4deg);

    animation:
        typing 2.5s steps(10, end) forwards,
        blink-caret 0.7s step-end infinite,
        moto-flicker 3.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: #ff7820; }
}

/* 仪表闪烁 —— 像转速表跳动 */
@keyframes moto-flicker {
    0%, 100% {
        opacity: 1;
    }
    3% { opacity: 0.82; }
    5% { opacity: 1; }
    52% { opacity: 1; }
    53% { opacity: 0.78; }
    54% { opacity: 1; }
    85% { opacity: 1; }
    86% { opacity: 0.88; }
    87% { opacity: 1; }
}

/* 伪元素 —— 右上角"GP 500"赛事标识 */
.topic_wrap::before {
    content: 'GP 500';
    position: absolute;
    top: 10px;
    right: 16px;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #ff7820;
    transform: skewX(-6deg);
    pointer-events: none;
    z-index: 0;
    border: 2px solid #e86010;
    padding: 2px 8px;
    background: rgba(14, 14, 18, 0.8);
    box-shadow:
        0 0 10px rgba(255, 120, 0, 0.3),
        inset 0 0 10px rgba(255, 120, 0, 0.1);
    text-shadow: 0 0 8px rgba(255, 120, 0, 0.8);
}

/* 伪元素 —— 左下角"LEAN · THROTTLE"遥测 */
.topic_wrap::after {
    content: 'LEAN 42° · THROTTLE 87%';
    position: absolute;
    bottom: 10px;
    left: 16px;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    color: rgba(255, 120, 0, 0.5);
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 6px rgba(255, 120, 0, 0.4);
}

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