/* --- Global Styles & Variables --- */
:root {
    --brand-red: #ff4757;
    --brand-blue: #4bcffa;
    --pcb-green: #004d40;
    --trace-gold: #f0b94b;
    --text-light: #dfe6e9;
    --text-secondary: #95a5a6;
    --bg-dark: #fff;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-dark);
    margin: 0;
    font-family: Microsoft YaHei,PingFangSC,notosans;
    color: var(--text-light);
}

/* --- Main Layout Wrapper --- */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* --- 1. Header Text --- */
.header-text {
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    animation: fade-in-up 0.8s ease-out 3.5s forwards;
}
.header-text h1 {
    font-family: Microsoft YaHei,PingFangSC,notosans;
    font-weight: 800;
    font-size: 36px;
    margin: 0;
    letter-spacing: 2px;
}
.header-text .brand-scs {
    color: var(--brand-red);
    /* text-shadow: 0 0 5px var(--brand-red), 0 0 15px var(--brand-red), 0 0 25px var(--brand-red); */
}
.header-text .brand-pcba {
    color: var(--brand-blue);
    /* text-shadow: 0 0 5px var(--brand-blue), 0 0 15px var(--brand-blue), 0 0 25px var(--brand-blue); */
}
.header-text p {
    margin: 5px 0 0;
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* --- 2. PCBA Animation --- */
.pcb-container { perspective: 1000px; }
.pcb {
    width: 240px;
    height: 140px;
    background-color: var(--pcb-green);
    border-radius: 12px;
    position: relative;
    /* <<< 全新辉光效果：更广、更柔和，确保PCB本身清晰不模糊 */
    box-shadow: 0 0 35px rgba(56, 193, 165, 0.2), inset 0 0 10px rgba(0,0,0,0.4);
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(-10deg);
    animation: unfold-pcb 1.5s cubic-bezier(0.23, 1, 0.32, 1) 1.5s forwards;
}

/* --- SVG Trace & Components (Layout updated) --- */
.trace-svg {
    position: absolute;
    width: 100%; height: 100%;
    opacity: 0;
    animation: show-element 0.1s forwards 1s;
}
.trace {
    fill: none;
    stroke: var(--trace-gold);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: draw-trace 1.2s ease-in-out forwards;
}
.trace:nth-child(2) { animation-delay: 1.2s; }

.component {
    position: absolute;
    background-color: #2c3e50;
    border: 1px solid #1a2530;
    border-radius: 4px;
    opacity: 0;
    animation: place-component 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
/* Positions matching the new image */
.ic-1 { top: 60px; left: 40px; width: 60px; height: 50px; animation-delay: 2.5s; }
.ic-2 { top: 60px; right: 40px; width: 60px; height: 50px; animation-delay: 2.7s; }
.smd { width: 10px; height: 10px; border-radius: 2px; }
.smd-1 { top: 35px; left: 130px; animation-delay: 2.9s; }
.smd-2 { top: 35px; left: 150px; animation-delay: 3.0s; }
.smd-3 { top: 95px; left: 130px; animation-delay: 3.1s; }

/* --- 3. Status & Indeterminate Progress Bar --- */
.status-area { width: 240px; }
.status-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 3px;
}
.dots {
    display: inline-block;
    animation: blink-dot 1.4s linear infinite;
}

.progress-bar {
    width: 100%;
    height: 3px;
    background-color: rgba(44, 62, 80, 0.5);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.progress-bar-indeterminate {
    position: absolute;
    width: 40%;
    height: 100%;
    background: var(--brand-blue);
    border-radius: 2px;
    animation: indeterminate-progress 3s ease-in-out infinite;
    animation-delay: 3.5s;
}

/* --- Keyframe Animations --- */
@keyframes unfold-pcb { to { transform: rotateX(0deg) rotateZ(0deg); } }
@keyframes show-element { to { opacity: 1; } }
@keyframes draw-trace { to { stroke-dashoffset: 0; } }
@keyframes place-component {
    from { opacity: 0; transform: translateZ(50px) scale(0.9); }
    to { opacity: 1; transform: translateZ(0) scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
}
@keyframes fade-in-up { to { opacity: 1; transform: translateY(0); } }
@keyframes blink-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes indeterminate-progress {
    from { left: -50%; }
    to { left: 110%; }
}