/* =========================================
   FONTS & RESET
   ========================================= */
@font-face {
    font-family: 'Alibaba-HY-Smart';
    src: local('Alibaba HY Smart'),
        url('./AlibabaHY-Smart.woff2') format('woff2'),
        url('./AlibabaHY-Smart.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    overflow: hidden;
    font-family: 'Alibaba-HY-Smart', "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    /* HDR 文本渲染优化 */
    text-rendering: optimizeLegibility;
}

/* =========================================
   LAYOUT & CANVAS
   ========================================= */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    /* CSS Fallback for non-WebGL */
    background: radial-gradient(ellipse at 50% 50%, #1a0a3e 0%, #0a0a1a 60%, #000 100%);
}

.content-layer {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    mix-blend-mode: difference;
    text-align: center;
    padding: 2rem;
}

/* =========================================
   TYPOGRAPHY & GLITCH
   ========================================= */
h1 {
    font-size: clamp(3.5rem, 10vw, 9rem);
    font-weight: 900;
    letter-spacing: -0.08em;
    line-height: 0.85;
    text-transform: uppercase;
    position: relative;
    /* HDR 文字发光增强 */
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

h1::before,
h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

h1::before {
    color: #0ff;
    z-index: -1;
    animation: glitch-1 3s infinite linear alternate-reverse;
}

h1::after {
    color: #f0f;
    z-index: -2;
    animation: glitch-2 2.5s infinite linear alternate-reverse;
}

.credit-line {
    font-family: 'Alibaba-HY-Smart', monospace;
    font-size: clamp(0.6rem, 1vw, 0.8rem);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 1.2rem;
    display: inline-block;
}

.credit-line::before,
.credit-line::after {
    content: '';
    display: inline-block;
    width: clamp(20px, 4vw, 60px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3), transparent);
    vertical-align: middle;
    margin: 0 0.8em;
}

p.subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 2rem;
    opacity: 0.9;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* =========================================
   FOOTER & STATUS
   ========================================= */
.footer-status {
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    z-index: 20;
    text-align: center;
    pointer-events: auto;
    mix-blend-mode: difference;
}

.beian-code {
    font-family: 'Alibaba-HY-Smart', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.4s ease;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    backdrop-filter: blur(10px);
}

.beian-code:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(100, 200, 255, 0.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.status-indicator {
    width: 6px;
    height: 6px;
    background: #0f0;
    border-radius: 50%;
    box-shadow: 0 0 8px #0f0;
    animation: blink 2s infinite;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 15;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.1) 51%);
    background-size: 100% 4px;
    opacity: 0.3;
}

/* =========================================
   LOADER
   ========================================= */
#loader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.loader-ring {
    width: 80px;
    height: 80px;
    position: relative;
}

.loader-ring::before,
.loader-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.loader-ring::before {
    border-top-color: #0ff;
    border-right-color: #0ff;
    animation: spin-cw 1.2s linear infinite;
}

.loader-ring::after {
    inset: 8px;
    border-bottom-color: #f0f;
    border-left-color: #f0f;
    animation: spin-ccw 0.9s linear infinite;
}

.loader-core {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.15) 0%, transparent 70%);
    animation: core-pulse 1.5s ease-in-out infinite;
}

.loader-text {
    font-family: 'Alibaba-HY-Smart', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.5em;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.loader-text::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: #0ff;
    animation: cursor-blink 0.8s step-end infinite;
}

.loader-progress {
    width: 180px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.loader-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0ff, #f0f);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: width 0.3s ease;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes glitch-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
        transform: translate(-3px, 2px);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(3px, -2px);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
        transform: translate(-2px, 3px);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(2px, -3px);
    }

    80% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(-3px, 1px);
    }

    100% {
        clip-path: inset(30% 0 20% 0);
        transform: translate(1px, -1px);
    }
}

@keyframes glitch-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(3px, -2px);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(-2px, 3px);
    }

    40% {
        clip-path: inset(30% 0 20% 0);
        transform: translate(2px, -1px);
    }

    60% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(-3px, 2px);
    }

    80% {
        clip-path: inset(5% 0 80% 0);
        transform: translate(1px, -3px);
    }

    100% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(-1px, 1px);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes spin-cw {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-ccw {
    to {
        transform: rotate(-360deg);
    }
}

@keyframes core-pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes cursor-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}