/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* body 样式 */
body {
    background: #333;
    display: flex;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
}

/* 主容器样式 */
.main {
    width: 25vw;
    height: 25vw;
    position: relative; /* 改为 relative 以便内部元素相对定位 */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 滑动条样式 */
input[type="range"] {
    --c: #1e90ff;
    width: 25vw;
    height: 1vw;
    position: absolute;
    top: 50%; /* 滑动条垂直居中 */
    transform: translateY(-50%);
    appearance: none;
    background: linear-gradient(var(--c), var(--c)) no-repeat, black;
    background-size: 0% 100%;
    border-radius: 0.5vw;
    transition: background-size 0.3s;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 2vw;
    height: 2vw;
    background: var(--c);
    border-radius: 50%;
    box-shadow: 0 0 1vw white, 0 0 2vw white;
}

/* 显示百分比的文本样式 */
#pc {
    color: white;
    font-size: 6vw; /* 调整字体大小使其与滑动条更协调 */
    font-family: Arial, Helvetica, sans-serif;
    text-shadow: 0.2vw 0.2vw 0 gray, 0 0 1vw #1e90ff, 0 0 2vw #1e90ff, 0 0 4vw #1e90ff;
    position: absolute;
    top: 40%; /* 调整位置，使百分比文本靠近滑动条 */
    transform: translateY(-50%);
}

/* span 包裹元素样式 */
.main span {
    --bg: black;
    --sg: transparent;
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: start;
}

.main span::after {
    content: "";
    width: 0.5vw;
    height: 2vw;
    position: absolute;
    background: var(--bg);
    box-shadow: 0 0 0.5vw var(--sg), 0 0 1vw var(--sg), 0 0 2vw var(--sg);
    transition: 0.8s linear;
}
