/* =========================================================
   08-hero · 首屏 Hero
   承载范围：原 style.css 第 2338-2966 行
   本节包含：
     - 开场加载动画
     - 全屏 Hero 区域
     - Ciallo 装饰文字
     - OC 对话气泡
     - 可滚动页面内容覆盖
     - 时段切换按钮
     - 顶部导航栏
   ========================================================= */

/* ============= 开场加载动画 ============= */
.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-gradient);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}


.loader-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 背景光晕 */
.loader-bg-bloom {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-shadow), transparent 70%);
    animation: loaderBloom 3s ease-in-out infinite;
    pointer-events: none;
}


@keyframes loaderBloom {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* 内容区 */
.loader-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loader-logo {
    font-size: 56px;
    animation: loaderLogoIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes loaderLogoIn {
    0% { opacity: 0; transform: scale(0) rotate(-30deg); }
    70% { transform: scale(1.15) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

.loader-brand {
    font-size: 26px;
    font-weight: 700;
    color: var(--pink-700);
    letter-spacing: 2px;
    animation: loaderFadeUp 0.6s 0.25s ease both;
}


.loader-sub {
    font-size: 13px;
    color: var(--text-muted);
    animation: loaderFadeUp 0.6s 0.4s ease both;
}


@keyframes loaderFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 进度条 */
.loader-bar-track {
    width: 180px;
    height: 3px;
    background: var(--accent-soft);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    animation: loaderFadeUp 0.6s 0.55s ease both;
}


.loader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--pink-300), var(--pink-500));
    border-radius: 4px;
    transition: width 0.3s ease;
}


@media (max-width: 768px) {
    .loader-logo { font-size: 42px; }
    .loader-brand { font-size: 22px; }
    .loader-bar-track { width: 140px; }
}

/* ============= 全屏 Hero 区域 ============= */
.hero-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
}

/* 背景层 */
.hero-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-position: bottom center;
    background-repeat: no-repeat;
    transition: background-image 1.2s ease-in-out;
    z-index: 0;
}

/* 默认渐变（无图片时的 fallback，由 JS 设置） */



/* OC + 气泡 容器 */
.hero-oc-wrapper {
    position: absolute;
    bottom: 5%;
    right: 10%;
    width: 65%;
    max-width: 400px;
    height: 75%;
    z-index: 2;
    pointer-events: none;
}

/* OC 图片层 */
.hero-oc-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 110%;
    height: 110%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.hero-oc-layer.hidden {
    opacity: 0;
}
/* ============= Ciallo 装饰文字 ============= */
.hero-ciallo-deco {
    position: absolute;
    top: 23%;
    right: 56%;
    z-index: 5;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    font-size: 60px;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    background: var(--ciallo-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 6px var(--accent-glow));
    animation: decoFloat 3.5s ease-in-out infinite;
}

@keyframes decoFloat {
    0%, 100% { transform: translateY(-30%) rotate(-25deg); }
    30% { transform: translateY(-35%) rotate(-21deg); }
    60% { transform: translateY(-35%) rotate(-18deg); }
    85% { transform: translateY(-32%) rotate(-22deg); }
}

.hero-ciallo-deco:hover {
    filter: drop-shadow(0 2px 12px var(--accent-glow-strong)) brightness(1.08);
}

.hero-ciallo-deco:active {
    filter: drop-shadow(0 1px 4px var(--accent-glow)) brightness(0.95);
}



@media (max-width: 768px) {
    .hero-ciallo-deco {
        font-size: 14px;
        top: 12%;
        right: 4%;
    }
}

/* ============= OC 对话气泡 ============= */
.hero-speech-bubble {
    position: absolute;
    top: -40px;
    right: 140px;
    max-width: 280px;
    z-index: 3;
    pointer-events: auto;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: none;
}

.hero-speech-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.35s ease-out, transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-speech-bubble.pop {
    animation: bubblePop 0.35s ease-out;
}

@keyframes bubblePop {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    60% { transform: translateY(-2px) scale(1.05); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.bubble-inner {
    position: relative;
    background: var(--bubble-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    box-shadow: 0 4px 20px var(--scrim-12), 0 0 0 1px var(--accent-border);
    text-align: left;
    word-break: break-word;
}

/* 小三角 */
.bubble-inner::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 28px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--bubble-bg);
}



@media (max-width: 768px) {
    .hero-oc-wrapper {
        width: 50%;
        max-width: 280px;
        height: 50%;
        right: 2%;
    }

    .hero-speech-bubble {
        top: -45px;
        right: 5px;
        max-width: 140px;
    }

    .bubble-inner {
        font-size: 11px;
        padding: 10px 12px;
        border-radius: 14px;
    }
}

/* 遮罩 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        var(--scrim-10) 0%,
        var(--scrim-05) 40%,
        var(--scrim-35) 80%,
        var(--scrim-50) 100%
    );
    z-index: 3;
}

.night .hero-overlay {
    background: linear-gradient(
        to bottom,
        var(--scrim-20) 0%,
        var(--scrim-10) 50%,
        var(--scrim-50) 100%
    );
}

/* Hero 文字内容 */
.hero-content {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 4;
    pointer-events: none;
}

.hero-title-text {
    font-size: 96px;
    font-weight: 800;
    color: var(--white);
    text-shadow: 0 2px 20px var(--accent-shadow-strong), 0 0 60px var(--accent-glow);
    letter-spacing: 6px;
    margin-bottom: 50px;
    animation: heroTitleIn 1s ease-out;
}

.hero-subtitle-text {
    font-size: 16px;
    color: var(--glass-85);
    letter-spacing: 8px;
    text-shadow: 0 1px 8px var(--accent-shadow);
    margin-bottom: 200px;
    animation: heroTitleIn 1.2s ease-out;
}

@keyframes heroTitleIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动提示 */
.hero-scroll-hint {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--glass-70);
    font-size: 13px;
    letter-spacing: 3px;
    z-index: 4;
    pointer-events: none;
    animation: scrollHintBounce 2s ease-in-out infinite;
    transition: opacity 0.6s ease;
}

.hero-scroll-hint.fade {
    opacity: 0;
}

.scroll-arrow {
    font-size: 20px;
    animation: scrollArrowBounce 1.5s ease-in-out infinite;
}

@keyframes scrollHintBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

@keyframes scrollArrowBounce {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============= 可滚动页面内容（覆盖 Hero） ============= */
.page-content {
    position: relative;
    z-index: 2;
    margin-top: 100vh;
    background: transparent;
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 手机浏览器地址栏会随滚动收起/展开，纯 vh 会导致首屏高度跳变；svh 取最小可视高度更稳 */
    .hero-fullscreen {
        height: 100vh;
        height: 100svh;
    }

    .page-content {
        margin-top: 100vh;
        margin-top: 100svh;
    }

    .hero-title-text {
        font-size: 28px;
        letter-spacing: 3px;
    }

    .hero-subtitle-text {
        font-size: 13px;
        letter-spacing: 2px;
        /* 触摸设备上把点击热区撑到 40px 左右 */
        padding: 9px 12px;
    }

    .hero-content {
        bottom: 28%;
    }

    .hero-oc-wrapper {
        width: 50%;
        max-width: 280px;
        height: 50%;
        right: 2%;
    }

    .hero-scroll-hint {
        bottom: 5%;
        font-size: 11px;
    }
}

/* ============= 时间段切换按钮 ============= */
.hero-nav-period {
    display: flex;
    gap: 6px;
    align-items: center;
}

.period-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--glass-50);
    background: var(--glass-10);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.period-btn:hover {
    border-color: var(--glass-85);
    background: var(--glass-25);
    transform: scale(1.1);
}

.period-btn.active {
    border-color: var(--glass-95);
    background: var(--glass-35);
    box-shadow: 0 0 14px var(--glass-35), inset 0 0 8px var(--glass-15);
    transform: scale(1.08);
}

/* ============= 顶部导航栏 ============= */
.hero-navbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    z-index: 5;
    background: linear-gradient(
        to bottom,
        var(--scrim-25) 0%,
        var(--scrim-08) 60%,
        transparent 100%
    );
    gap: 16px;
    flex-wrap: wrap;
}

.hero-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hero-nav-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.hero-nav-avatar .avatar-placeholder,
.hero-nav-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--glass-15);
    backdrop-filter: blur(4px);
}

.hero-nav-name {
    color: var(--glass-90);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px var(--scrim-30);
    white-space: nowrap;
}

.hero-nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-nav-menu .nav-item {
    background: var(--glass-10);
    color: var(--glass-85);
    border: 1.5px solid var(--glass-25);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hero-nav-menu .nav-item:hover {
    background: var(--glass-20);
    border-color: var(--glass-50);
    transform: translateY(-1px);
}

.hero-nav-menu .nav-item.active {
    background: var(--glass-30);
    color: var(--white);
    border-color: var(--glass-70);
    box-shadow: 0 2px 12px var(--scrim-15);
}

/* 移动端顶栏适配 */
@media (max-width: 768px) {
    .hero-navbar {
        padding: 8px 12px;
        gap: 8px;
    }

    .hero-nav-left {
        gap: 6px;
    }

    .hero-nav-name {
        font-size: 12px;
    }

    .hero-nav-menu {
        gap: 3px;
        order: 3;
        width: 100%;
        justify-content: flex-start;
        padding-top: 4px;
    }

    .hero-nav-menu .nav-item {
        font-size: 11px;
        padding: 4px 10px;
    }

    .hero-nav-period {
        gap: 4px;
    }

    .period-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}
