/* ==================== CSS 变量 ==================== */
:root {
    --bg-deep: #08111F;
    --bg-mid: #0D1627;
    --bg-light: #141C31;
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.45);
    --outlined-text: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(120, 140, 255, 0.25);
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==================== 重置基础样式 ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ==================== Landing 布局 ==================== */
.landing {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: #0D0D1A;
    overflow: hidden;
}

/* ==================== 背景动画画布层 ==================== */
/* 所有背景画布绝对定位，不响应鼠标事件，避免遮挡交互 */
.landing-bg-canvas,
.landing-grain,
.landing-noise,
.pixel-cursor-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 主画布：承载聚光灯、尘埃、环境光 */
.landing-bg-canvas {
    z-index: 0;
}

/* 电影颗粒画布：小尺寸放大，保留像素颗粒感 */
.landing-grain {
    z-index: 1;
    opacity: 0.05;
    image-rendering: pixelated;
}

/* 噪点纹理画布：Canvas 生成纹理，缓慢滚动 */
.landing-noise {
    z-index: 1;
    opacity: 0.04;
}

/* 像素光标画布：位于最上层 */
.pixel-cursor-canvas {
    z-index: 999;
}

/* ==================== Header / Logo ==================== */
.landing-header {
    width: 100%;
    padding: 32px clamp(24px, 5vw, 64px);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.logo-icon svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

/* ==================== Main / Book ==================== */
.landing-main {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(24px, 6vw, 80px);
    position: relative;
    z-index: 10;
}

.book-wrapper {
    position: relative;
    width: min(840px, 80vw);/*封面图片*/
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px; /* 为书本倾斜提供 3D 透视 */
    transform: translateY(60px);/*调整书本图片和封面 Reflection的位置*/
}

.book-image {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(120, 140, 255, 0));
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
}

.book-shadow {
    position: absolute;
    left: 50%;
    bottom: -6%;
    width: 70%;
    height: 22px;
    transform: translateX(-50%);
    z-index: 1;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(6px);
    opacity: 0.8;
    transition:
        width 0.4s ease,
        opacity 0.4s ease,
        filter 0.4s ease;
}

.book-wrapper.is-hovered .book-shadow {
    width: 55%;
    opacity: 0.55;
    filter: blur(10px);
}

.book-bloom {
    position: absolute;
    inset: -10%;
    z-index: 4;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    filter: blur(18px);
}

.book-title-enter {
    position: absolute;
    z-index: 6;
    pointer-events: auto;
    font-family: var(--font-family);
    font-size: clamp(18px, 3.2vw, 36px);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: clamp(8px, 1.2vw, 12px) clamp(16px, 2.4vw, 24px);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

.book-wrapper.is-hovered .book-ambient {
    opacity: 0.85;
}

/* ==================== Footer / CTA ==================== */
.landing-footer {
    width: 100%;
    padding: 0 clamp(24px, 5vw, 64px) clamp(28px, 5vh, 48px);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.enter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;/*调整click picture to start的大小*/
    font-size: 0.6rem;/*调整click picture to start的大小*/
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(42px);/*click标签位置*/
}

/* ==================== Oversized Outlined Text ==================== */
.outlined-text {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.outlined-text__item {
    position: absolute;
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--outlined-text);
    white-space: nowrap;
    user-select: none;
}

.outlined-text__item--top-left {
    top: clamp(16px, 3vh, 40px);
    left: clamp(16px, 3vw, 48px);
    font-size: clamp(64px, 14vw, 220px);
}

.outlined-text__item--top-right {
    top: clamp(16px, 3vh, 40px);
    right: clamp(16px, 3vw, 48px);
    font-size: clamp(64px, 14vw, 220px);
}

.outlined-text__item--bottom-left {
    bottom: clamp(16px, 3vh, 40px);
    left: clamp(16px, 3vw, 48px);
    font-size: clamp(64px, 14vw, 220px);
}

.outlined-text__item--bottom-right {
    bottom: clamp(16px, 3vh, 40px);
    right: clamp(16px, 3vw, 48px);
    font-size: clamp(64px, 14vw, 220px);
}

.outlined-text__item--bottom-center {
    bottom: clamp(16px, 3vh, 40px);
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(64px, 14vw, 220px);
}

/* ==================== 响应式适配 ==================== */
@media screen and (max-width: 768px) {
    .logo-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .logo-icon svg {
        width: 22px;
        height: 22px;
    }

    .logo-text {
        font-size: 1.35rem;
    }

    .book-wrapper {
        width: min(520px, 78vw);
    }

    .enter-btn {
        width: 100%;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .landing-header {
        padding: 24px 20px;
    }

    .landing-main {
        padding: 0 20px;
    }

    .landing-footer {
        padding: 0 20px 24px;
    }

    .outlined-text__item {
        -webkit-text-stroke: 1px rgba(255, 255, 255, 0.07);
    }
}

/* ==================== 全局光标隐藏 ==================== */
html,
body,
.landing {
    cursor: none;
}

/* ==================== 减少动画偏好 ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html,
    body,
    .landing {
        cursor: auto;
    }
}

/* ==================== 焦点无障碍样式 ==================== */
.enter-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
}

.logo:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
    border-radius: 12px;
}
