/**
 * LIGHTWINNER CSS ARCHITECTURE V4
 * 0-SETTINGS / VARIABLES
 * 
 * 集中管理全站颜色、间距、层级变量。
 */

:root {
    /* --- 品牌核心色 (Brand Colors) --- */
    --accent-color: #ffaa00;
    --accent-warm: #dba11c;
    --lw-accent: var(--accent-color);

    /* --- 基础面板变量 (Base Panel Variables) --- */
    --lw-text: #ffffff;
    --lw-text-muted: #e0e0e0;
    --lw-bg: transparent;
    /* 允许三维星空 Canvas 穿透 */
    --lw-border: rgba(255, 255, 255, 0.08);
    --lw-panel-bg: rgba(20, 20, 25, 0.6);
    /* Match Product Card style: 10px blur + 0.6 density */
    --lw-glass-blur: blur(10px);
    --lw-glass-saturate: saturate(180%);
    --lw-panel-hover: rgba(40, 40, 60, 0.4);

    /* --- 移动端常数 (Mobile Constants) --- */
    --mobile-nav-height: 80px;

    /* --- 层级管理 (Z-Index Chain) --- */
    --z-index-base: 1;
    --z-index-nav: 10000;
    --z-index-drawer: 10002;
    --z-index-modal: 100000;

    /* --- 搜索专用变量 (Search Pro Max) --- */
    --search-glow: var(--accent-color);
    --search-border: rgba(255, 170, 0, 0.4);
    --search-glass: rgba(15, 15, 20, 0.85);
}

/**
 * LIGHT MODE OVERRIDES
 * 通过变量覆盖实现主题切换，而非冗余样式声明。
 */
body.light-mode {
    --lw-text: #1a1a1a;
    --lw-text-muted: #555555;
    --lw-bg: #ffffff;
    --lw-border: rgba(0, 0, 0, 0.1);
    --lw-panel-bg: rgba(255, 255, 255, 0.75);
    /* Improved readability in light mode while keeping glass feel */
    --lw-panel-hover: rgba(0, 0, 0, 0.05);

    --search-glow: #d67e2e;
    --search-border: rgba(214, 126, 46, 0.3);
    --search-glass: rgba(255, 255, 255, 0.95);
}
/* 
 * ITCSS - Base Layer: Elements
 * ----------------------------
 * 核心目标：为原始 HTML 标签提供默认外观。
 */

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    /* 核心背景与颜色由 _critical.css 定义以保证渲染，此处提供延伸属性 */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 链接基础 */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* 表单元素基础继承 */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    margin: 0;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

/* 列表清理 */
ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}
/* 
 * ITCSS - Generic Layer: Reset
 * ----------------------------
 * 核心目标：消除浏览器默认差异，建立全站统一的盒模型基准。
 */

/* 1. 盒模型统一 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 2. 移除内外边距 */
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
}

/* 3. 媒体元素响应式基准 */
img,
video,
canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 4. 移动端交互优化 */
input,
button,
textarea,
a {
    -webkit-tap-highlight-color: transparent;
}

/* 5. 溢出处理预置 */
.u-overflow-hidden {
    overflow: hidden !important;
}
/* =====================================================
   Layer 1: Base - Utilities & Global Objects
   Origin: lightwinner.css, sections.css
   ===================================================== */

/* --- Animations --- */
@keyframes cyber-breath {
    0% {
        box-shadow: 0 0 10px rgba(var(--cct-raw), 0.2), inset 0 0 0 1px rgba(255, 245, 180, 0.2);
    }

    100% {
        box-shadow: 0 0 25px rgba(var(--cct-raw), 0.60), inset 0 0 0 1px rgba(255, 245, 180, 0.6);
    }
}

/* Global Breathing Glow Containers (Migrated from lightwinner.css) */
.theater-playlist,
.row-timeline,
.atlas-directory,
.atlas-reader,
.atlas-sidebar,
.atlas-list,
.region-content,
.search-dropdown,
.theater-stage,
.atlas-map {
    animation: cyber-breath 4s ease-in-out infinite alternate;
    border: none;
    border-radius: 12px;
}

/* --- Scrollbar Utilities --- */
/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    display: none !important;
}

/* Hide scrollbar for IE, Edge and Firefox */
html,
body,
.section,
main,
.no-scrollbar {
    -ms-overflow-style: none !important;
    /* IE and Edge */
    scrollbar-width: none !important;
    /* Firefox */
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --- Global Layout Objects (SPA Engine) --- */
main {
    position: relative;
    width: 100vw;
    flex: 1 0 auto;
    overflow-x: hidden;
    overflow-y: visible;
    background: transparent;
    /* TRANSPARENT to show Stars/DayMode */
}

/* Base Section Class */
.section,
section[id$="-section"],
section[id="product-container"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: auto;
    height: auto;

    /* SCROLL MECHANISM */
    overflow-y: visible;
    overflow-x: hidden;
    padding-top: 80px;
    padding-bottom: 60px;

    /* VISIBILITY LOGIC (Display Toggle) */
    display: none;
    opacity: 0;
    pointer-events: none;
    background: transparent !important;
    /* Force Transparency */

    transition: opacity 0.4s ease;
    box-sizing: border-box;
    z-index: 10;
}

/* Base Active State (Generic) */
.section.active,
section.active {
    position: relative !important;
    opacity: 1;
    pointer-events: auto;
    z-index: 20;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Global Overlay Utility --- */
.lw-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    /* Transparent overlay to show stars behind */
    background: #000;
    z-index: 99999;
    /* INCREASED: Ensure on top */
    display: flex !important;
    justify-content: center;
    align-items: center;
    overflow: hidden !important;
    /* Prevent scrolling */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.lw-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Lock background scrolling when modal is open */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
}

/* Hide Elements when Modal Open */
.hidden-for-modal {
    opacity: 0;
    filter: blur(10px);
    pointer-events: none;
    transition: opacity 0.5s ease, filter 0.5s ease;
}

/* --- Skeleton Loading States --- */
.skeleton {
    position: relative;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 4px;
}

.skeleton::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%) !important;
    animation: shimmer 1.5s infinite !important;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

body.light-mode .skeleton {
    background: rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .skeleton::after {
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.03) 50%, transparent 100%) !important;
}
/* =====================================================
   Layer 1: Mobile Base - Critical Resets & Typography
   Origin: lightwinner-mobile.css (L8-L136)
   ===================================================== */

@media (max-width: 1024px) {

    :root {
        /* Mobile Layout Constants */
        --mobile-nav-height: 80px;
        --mobile-hero-padding: 140px;

        /* Z-Index Hierarchy (Strict) */
        --z-nav: 10000;
        --z-drawer-overlay: 10001;
        --z-drawer: 10002;
        --z-trigger: 10003;
        --z-modal: 10005;
    }

    html,
    body {
        overflow-x: hidden;
        overflow-y: auto;
        /* Enable vertical scroll natively */
        height: auto;
        /* Allow height to grow */
        min-height: 100vh;
        width: 100%;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        -webkit-overflow-scrolling: touch;
        /* iOS Momentum */
    }

    /* Force Reset Container: Immersive Edge-to-Edge */
    #app-container {
        padding-top: 0 !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        /* ALLOW SCROLL */
        width: 100% !important;
        height: auto !important;
        /* ALLOW GROWTH */
        min-height: auto !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        /* REMOVE 2px BORDER V3 */
        border-radius: 0 !important;
        /* REMOVE ROUNDED EDGES V3 */
        box-shadow: none !important;
        /* REMOVE GLOW FRAME V3 */
    }

    /* Hide Scrollbars for App-like feel */
    ::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    /* --- Typography --- */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Hero Title Responsive Fix */
    h1.glitch-text,
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem) !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        /* Prevent wrapping if possible, or allow controlled wrap */
        max-width: 100%;
        overflow: visible;
    }

    /* Step 24: Light Mode Overrides */
    .light-mode {
        background: #f0f2f5 !important;
        color: #1a1a1a !important;
    }

    /* --- Modal Base (Critical for Mobile) --- */
    .lw-modal-overlay.active,
    .lw-modal-backdrop.active,
    #project-modal.active {
        z-index: var(--z-modal) !important;
        backdrop-filter: blur(10px) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Sound Modal Base - Do NOT force display:flex here */
    #sound-prompt-modal {
        z-index: var(--z-modal) !important;
        backdrop-filter: blur(10px) !important;
        align-items: center !important;
        justify-content: center !important;
        /* Default hidden, let JS toggle it */
    }

    /* --- Onboarding Visibility Control (Merged from _mobile-patch.css) --- */
    body.onboarding-active #mobile-inquiry-bar,
    body.onboarding-active #global-navbar,
    body.onboarding-active .mobile-menu-toggle {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}
/* =====================================================
   Layer 2: Layout - Archive Section (Container & Grid)
   Origin: lightwinner.css (L10-L68, L118-L153)
   ===================================================== */

/* --- 1. Main Container --- */
.lw-archive-section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 20px 150px 20px;
    /* Unified: Inherit 110px from parent section-premium */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center children */
    color: var(--lw-text);
    transition: color 0.3s;

    /* Standardized Glass Effect REMOVED from section level to avoid "Black Filter" */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
}

.lw-archive-section>header,
.lw-archive-section>.lw-row,
.lw-archive-section>div {
    width: 100%;
    max-width: 1400px;
    /* Constrain content width specifically */
}

/* 巨幕模式放权：单独为视频剧场扩大宽度 */
.lw-archive-section>.row-theater {
    max-width: 1600px !important;
}

/* --- 2. Typography Helpers --- */
.lw-header-mini {
    position: relative;
    padding-bottom: 8px;
    /* Tighter */
    margin-bottom: 0px;
    /* Minimal */
}

.lw-header-mini h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--lw-text-muted);
    margin: 0;
    font-weight: 600;
}

/* Premium Brand Line */
.lw-header-mini::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 360px;
    /* Longer to cover "LIGHTWINNER ARCHIVE" */
    height: 1.5px;
    /* Thinner for elegance */
    background: linear-gradient(90deg, var(--lw-accent), transparent);
    border-radius: 2px;
}

.lw-header-mini .thin {
    font-weight: 300;
    color: var(--lw-text);
}

/* --- 4. Mobile Response --- */
@media (max-width: 480px) {
    .lw-archive-section {
        padding: 0 10px 50px 10px !important;
        /* Minimized top/bottom padding */
        gap: 0 !important;
        /* NO GAP, use row logic */
    }

    .lw-row {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }

    /* Grid Resets for specific rows handled here for layout flow */
    .row-theater {
        grid-template-columns: 1fr !important;
        height: auto !important;
        /* Allow stack */
        gap: 0 !important;
        margin-bottom: 0 !important;
    }

    .theater-stage {
        height: 250px !important;
        /* Fixed video height */
    }

    .theater-playlist {
        height: 380px !important;
        /* Slightly taller for mobile comfort */
    }
}

/* --- 5. Tablet/Mobile Header Redesign (v3.4) --- */
@media (max-width: 1024px) {
    .lw-header-mini {
        text-align: center !important;
        padding: 30px 0 25px !important;
        margin-bottom: 10px !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        background: transparent !important;
        border: none !important;
    }

    .lw-header-mini h1 {
        font-size: 1.2rem !important;
        letter-spacing: 0.2em !important;
        text-transform: uppercase !important;
        margin: 0 0 12px 0 !important;
        color: var(--lw-text-muted) !important;
        font-weight: 300 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .lw-header-mini .thin {
        font-weight: 800 !important;
        color: var(--lw-accent, #ffaa00) !important;
        margin-left: 8px !important;
    }

    /* Short Centered Accent Line */
    .lw-header-mini::after {
        content: '' !important;
        position: static !important;
        width: 40px !important;
        height: 1px !important;
        background: linear-gradient(90deg, transparent, var(--lw-accent), transparent) !important;
        box-shadow: 0 0 10px var(--lw-accent) !important;
        border-radius: 1px !important;
        display: block !important;
        margin: 0 auto !important;
    }
}

/* --- Hardware Acceleration & Containment (v3.5) --- */
.timeline-scroll-container,
.log-list-scroll,
.chrono-years-track,
.chrono-months-track {
    will-change: scroll-position;
    /* Removed transform: translateZ(0) to fix backdrop-filter issues */
    backface-visibility: hidden;
    perspective: 1000px;
    contain: content;
    /* Layout Isolation */
}

/* Optimization for Log Cards */
.log-card-item {
    contain: layout style;
    will-change: opacity, transform;
}

/* --- 6. Glassmorphism & Readability (v3.6) --- */
.glass-panel {
    background: var(--lw-panel-bg);
    backdrop-filter: var(--lw-glass-blur) var(--lw-glass-saturate);
    -webkit-backdrop-filter: var(--lw-glass-blur) var(--lw-glass-saturate);
    border: 1px solid var(--lw-border);
    border-radius: 12px;
}

/* Timeline Load More Styling */
.timeline-load-more-wrapper {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.load-more-timeline {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid rgba(255, 170, 0, 0.4);
    color: var(--lw-accent);
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.load-more-timeline:hover {
    background: rgba(255, 170, 0, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.2);
}

.load-more-timeline .plus {
    font-size: 1.5rem;
    line-height: 1;
}

.load-more-timeline .text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
