/* ==========================================================================
   《物理 OL：火种重燃》第一章《机械运动》专属关卡样式表 (css/chapters/ch01-motion.css)
   仅存放八年级上册·第一章 5 个关卡 (#view-stage1 ~ #view-stage5) 的局部样式
   ========================================================================== */

/* ==================== STAGE 1: 精密测绘工作台 ==================== */
#view-stage1 {
    position: relative;
    background: #C89D66;
}
#stage1-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* ==================== STAGE 2: 钟表匠桦木台面 + 机械停表 + 放大镜 + 单摆 ==================== */
#view-stage2 {
    background:
        radial-gradient(circle at 42% 48%, #FFFDF9 0%, #EDE5D2 65%, #DFD3BC 100%);
    align-items: center;
    justify-content: space-around;
    padding: 16px 24px;
    gap: 16px;
}

.sw-stage-left {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1.15;
    min-width: 0;
}

.mech-wrap {
    position: relative;
    height: min(92%, 500px);
    max-width: 100%;
    aspect-ratio: 460 / 540;
}

.mech-svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(5px 8px 0px rgba(34, 38, 41, 0.22));
}

.mech-hit {
    position: absolute;
    background: rgba(254, 243, 199, 0.92);
    border: 2px solid var(--ink);
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--ink);
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.mech-hit:hover {
    background: var(--mustard);
    transform: scale(1.05);
}
.mech-hit.crown {
    width: 28%;
    height: 7.5%;
    left: 36%;
    top: 2%;
    border-radius: 999px;
}
.mech-hit.side {
    width: 16%;
    height: 7%;
    left: 10%;
    top: 15%;
    border-radius: 999px;
}

.sw-right-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 100%;
    flex: 0.95;
    min-width: 0;
}

.mag-card {
    position: relative;
    width: 196px;
    height: 196px;
    border-radius: 50%;
    border: 4px solid var(--ink);
    box-shadow: 5px 5px 0px var(--ink);
    overflow: visible;
    background: #ffffff;
    flex-shrink: 0;
}

.mag-card svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    overflow: hidden;
}

.mag-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mustard);
    border: 2px solid var(--ink);
    box-shadow: 2px 2px 0px var(--ink);
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    padding: 3px 11px;
    border-radius: 999px;
    white-space: nowrap;
    z-index: 5;
}

.pendulum-box {
    width: 100%;
    max-width: 310px;
    flex: 1;
    min-height: 160px;
    max-height: 250px;
    background: #FFFDF9;
    border: 2.5px solid var(--ink);
    border-radius: 16px;
    box-shadow: 4px 4px 0px var(--ink);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pendulum-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==================== STAGE 3: 1800x1050 参照物与相对静止全景世界 ==================== */
#view-stage3 {
    position: relative;
    background: #bae6fd;
}

#scene {
    width: 100%;
    height: 100%;
    display: block;
}

.s3-overlay-bar {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    z-index: 10;
    flex-wrap: wrap;
}

.s3-chip {
    pointer-events: auto;
    background: #FFFDF9;
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0px var(--ink);
    color: var(--ink);
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.s3-chip.accent {
    background: var(--mustard-light);
}

.ringEl {
    fill: rgba(254, 243, 199, 0.32);
    stroke: #E05A47;
    stroke-width: 4;
    stroke-dasharray: 12 9;
    animation: dashmv 8s linear infinite;
}
@keyframes dashmv { to { stroke-dashoffset: -420; } }
.ringTxt {
    font-size: 17px;
    font-weight: 900;
    fill: #222629;
    paint-order: stroke;
    stroke: #FFFDF9;
    stroke-width: 4.5;
    text-anchor: middle;
}
.spk {
    fill: #fff;
    opacity: 0.45;
}

.arrow-text {
    paint-order: stroke;
    stroke: #0f172a;
    stroke-width: 3.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    font-family: var(--font-mono);
}

/* ==================== STAGE 4: 双车竞速跑道 + 手绘坐标纸 s-t / v-t 图像 ==================== */
#view-stage4 {
    flex-direction: column;
    padding: 12px 16px;
    gap: 12px;
    background: #F4EFE4;
}

.s4-track-card {
    height: 176px;
    flex-shrink: 0;
    background: #FFFDF9;
    border: 2px solid var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-hard);
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.s4-track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 900;
    color: var(--ink);
    gap: 8px;
}

.s4-lanes {
    position: relative;
    flex: 1;
    margin: 6px 0;
    background: linear-gradient(180deg, #475569 0%, #334155 50%, #475569 100%);
    border-radius: 12px;
    border: 2px solid var(--ink);
    overflow: hidden;
}

.s4-lane-divider {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    border-top: 2.5px dashed #FDE047;
}

.s4-ruler-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.s4-car-unit {
    position: absolute;
    width: 108px;
    height: 38px;
    transition: none;
    pointer-events: none;
}

.s4-car-unit svg {
    width: 100%;
    height: 100%;
    display: block;
}

.s4-car-unit.ghost-car {
    top: 7px;
}

.s4-car-unit.player-car {
    bottom: 7px;
}

.s4-charts-row {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.s4-chart-card {
    background: #FFFDF9;
    border: 2px solid var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-hard);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.s4-chart-title {
    font-size: 12.5px;
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.s4-chart-svg {
    flex: 1;
    width: 100%;
    height: 100%;
    display: block;
    background: #FAF7F0;
    border-radius: 10px;
    border: 1.5px solid #D6CFC2;
}

/* ==================== STAGE 5: 斜面小车测量平均速度实验台（八上第一章第4节） ==================== */
#view-stage5 {
    position: relative;
    background: #EAE2CE;
    padding: 0;
}

#stage5-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* ==================== STAGE 6: 第一章终极 BOSS 战（失控重载列车·三阶公式齿轮破盾战） ==================== */
#view-stage6 {
    position: relative;
    background: #EAE3D2;
    padding: 0;
}

#stage6-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

