/* ========== 全局样式 ========== */
body {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, #1a1a2e, #16213e);
    font-family: 'Microsoft YaHei', sans-serif;
}

/* ========== 标题 ========== */
.title {
    color: #fff;
    font-size: 28px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 200, 100, 0.5);
}

/* ========== 蜡烛容器 ========== */
.candle-container {
    position: relative;
    width: 200px;
    height: 400px;
    cursor: pointer;
    user-select: none;
}

/* ========== 蜡烛主体 ========== */
.candle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 250px;
    background: linear-gradient(to right, #f5e6d3, #fff5e6, #f5e6d3);
    border-radius: 8px 8px 4px 4px;
    box-shadow:
        inset -10px 0 20px rgba(0, 0, 0, 0.1),
        inset 10px 0 20px rgba(0, 0, 0, 0.05),
        0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 蜡烛纹理 */
.candle::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 15px;
    right: 15px;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        rgba(255, 230, 200, 0.3) 5px,
        transparent 10px
    );
}

/* ========== 蜡烛底部 ========== */
.candle-base {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 15px;
    background: linear-gradient(to bottom, #e8d5b5, #d4c4a8);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* ========== 烛芯 ========== */
.wick {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 25px;
    background: linear-gradient(to bottom, #4a4a4a, #2a2a2a);
    border-radius: 2px;
    z-index: 10;
    transition: background 0.3s, box-shadow 0.3s;
}

/* 点燃状态下的烛芯 */
.candle-container.lit .wick {
    background: linear-gradient(to bottom, #ff4500, #cc3700, #2a2a2a);
    box-shadow: 0 0 5px rgba(255, 69, 0, 0.5);
}

/* ========== 火焰容器 ========== */
.flame-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 80px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 显示火焰 */
.candle-container.lit .flame-container {
    opacity: 1;
}

/* ========== 火焰外层 ========== */
.flame-outer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 60px;
    background: linear-gradient(
        to top,
        rgba(255, 120, 0, 1) 0%,
        rgba(255, 220, 50, 0.9) 40%,
        rgba(255, 255, 180, 0.6) 70%,
        transparent 100%
    );
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker-outer 0.5s ease-in-out infinite alternate;
}

/* ========== 火焰内层 ========== */
.flame-inner {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 40px;
    background: linear-gradient(
        to top,
        rgba(255, 230, 100, 1) 0%,
        rgba(255, 255, 220, 1) 50%,
        rgba(255, 255, 255, 0.9) 100%
    );
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker-inner 0.3s ease-in-out infinite alternate;
}

/* ========== 火焰动画 ========== */
@keyframes flicker-outer {
    0% {
        transform: translateX(-50%) scale(1) rotate(-2deg);
    }
    100% {
        transform: translateX(-50%) scale(1.05) rotate(2deg);
    }
}

@keyframes flicker-inner {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.9;
    }
    100% {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
    }
}

/* ========== 烛光光晕 ========== */
.glow {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 160px;
    background: radial-gradient(
        circle,
        rgba(255, 210, 120, 0.55) 0%,
        rgba(255, 160, 60, 0.3) 40%,
        transparent 70%
    );
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.candle-container.lit .glow {
    opacity: 1;
}

/* ========== 点击区域提示 ========== */
.click-zone {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 80px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.candle-container:hover .click-zone {
    opacity: 1;
}

/* ========== 状态文字 ========== */
.status {
    color: #fff;
    font-size: 20px;
    margin-top: 15px;
    min-height: 30px;
    transition: color 0.3s, text-shadow 0.3s;
}

.status.lit {
    color: #ffdd57;
    text-shadow: 0 0 10px rgba(255, 200, 100, 0.8);
}

/* ========== 提示文字 ========== */
.hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin-top: 10px;
    text-align: center;
}
