/* ================================================================
 * home.css — 首页专属样式（home.html / index.html 引用）
 * 需在 base.css 之后加载：覆盖 sections-wrapper / fullpage-section，
 * 并新增首页装饰层、浑天仪、文字浮动与发光效果
 * ================================================================ */

/* ========== home 页背景（第3层，独立于 body 背景） ========== */
.home-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 9;
    background: var(--color-bg);
}

/* home 文字容器 — 固定定位，独立于 wrapper，避免继承 wrapper 的垂直位移 */
.home-text-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 51;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    pointer-events: none;
}
/* 初始进入动画：文字从右侧滑入 */
.home-text-content.enter {
    animation: homeTextEnter 1s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}
/* 进入后清除动画状态，让 JS 接管 */
.home-text-content.parallax-ready {
    animation: none;
}
@keyframes homeTextEnter {
    0%   { transform: translate3d(100%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

/* ========== 覆盖 base.css：首页主内容区的滚动 wrapper（绝对定位 + 3D 透视） ========== */
.sections-wrapper {
    position: absolute;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}
.fullpage-section {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ========== 首页首屏文字排版 ========== */
.content-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 70px;
}
/* 文字主体包裹层：保留上下浮动，浑天仪保持静止 */
.content-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: floatTitle 5s ease-in-out infinite;
}
/* 首页首屏标题专属：白色发光 + 上下浮动 */
@keyframes floatTitle {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}
.home-title-glow {
    position: relative;
    z-index: 2;
    text-shadow:
        0 0 1px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.85);
}

/* ========== 浑天仪：CSS 3D 立体球体框架（装饰，文字容器上方） ========== */
.armillary {
    width: 225px;
    aspect-ratio: 1;
    margin: 0 auto 30px;
    pointer-events: none;
    perspective: 700px;
    perspective-origin: 50% 45%;
}
/* 场景：接收 JS 鼠标倾角（通过 CSS 变量），制造交互立体感 */
.armillary-scene {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(var(--arm-tilt-x, 12deg)) rotateY(var(--arm-tilt-y, -14deg));
    transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
/* 转子：整体缓慢自转，营造空间旋转感 */
.armillary-rotor {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    animation: armRotor 40s linear infinite;
}
/* 通用圆环：三维球体的经/纬线框架 */
.ring {
    position: absolute;
    inset: 6%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform-style: preserve-3d;
    backface-visibility: visible;
}
/* 视差外层做滚轮位移时，浑天仪整体平移需与父级一致，无需额外设置 */
/* 经线环：绕 Y 轴不同角度，等距勾勒球体轮廓 */
.ring-r0 { transform: rotateY(0deg); }
.ring-r1 { transform: rotateY(60deg); }
.ring-r2 { transform: rotateY(120deg); }
/* 赤道环：水平大圈，稍作倾斜显现椭球透视 */
.ring-eq {
    border-style: dashed;
    border-width: 1px;
    border-color: rgba(255, 255, 255, 0.6);
    transform: rotateX(80deg);
}
/* 纬线环：倾斜切片，强化球体的空间纵深感 */
.ring-t1 { transform: rotateX(55deg) rotateY(20deg); }
.ring-t2 { transform: rotateX(-55deg) rotateY(20deg); }
/* 极轴：贯穿球心的竖直轴线 */
.armillary-axis {
    position: absolute;
    left: 50%;
    top: -12%;
    width: 1px;
    height: 124%;
    background: rgba(255, 255, 255, 0.35);
    transform: translateX(-50%) rotateX(90deg);
}
@keyframes armRotor {
    from { transform: rotate(0deg) rotateY(0deg); }
    to   { transform: rotate(0deg) rotateY(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .armillary-rotor { animation: none; }
    .armillary-scene { transition: none; }
}

/* ========== 全屏浑天仪背景层：按页面位置放大显露 ========== */
/* 层级：深空背景(z9)之上、正文内容(z50)之下；首页(index 0)完全透明不显示 */
.armillary-bg {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    overflow: hidden;
    perspective: 1000px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}
/* 显示时立即可见，靠透明度淡入淡出 */
.armillary-bg.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.7s ease, visibility 0s;
}
/* 复用首页浑天仪场景：静止(首页隐藏)为屏幕中央的小浑天仪；
   淡入并激活(.show)时由中央小尺寸平滑放大到当前比例(0.78)并移动到对应方位 */
.armillary-bg .armillary-scene {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 180vmin;
    height: 180vmin;
    transform-origin: center;
    transform: translate(-50%, -50%) scale(0.18) rotateX(var(--arm-tilt-x, 10deg)) rotateY(var(--arm-tilt-y, -14deg));
    transition: left 0.7s cubic-bezier(0.25, 0.1, 0.25, 1), top 0.7s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}
/* 激活后放大到当前比例：home→页面时由中央小浑天仪放大并移出；页面间切换保持该比例不变 */
.armillary-bg.show .armillary-scene {
    transform: translate(-50%, -50%) scale(0.78) rotateX(var(--arm-tilt-x, 10deg)) rotateY(var(--arm-tilt-y, -14deg));
}
/* 六位置：球心从屏幕中间（50%/50%）移到对应方位边缘，放大后仅显露逼近该侧的弧段 */
.armillary-bg.pos-tl .armillary-scene { left: 100%;  top: 100%; }
.armillary-bg.pos-tr .armillary-scene { left: 0%;    top: 100%; }
.armillary-bg.pos-bl .armillary-scene { left: 100%;  top: 0%; }
.armillary-bg.pos-br .armillary-scene { left: 0%;    top: 0%; }
.armillary-bg.pos-lm .armillary-scene { left: 100%;  top: 50%; }
.armillary-bg.pos-rm .armillary-scene { left: 0%;    top: 50%; }
/* 背景浑天仪线条加粗，保证放大后依旧清晰醒目 */
.armillary-bg .ring {
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.55);
}
.armillary-bg .ring-eq {
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.65);
}
.armillary-bg .armillary-axis {
    width: 2px;
    background: rgba(255, 255, 255, 0.4);
}
@media (prefers-reduced-motion: reduce) {
    .armillary-bg .armillary-scene { transition: none; }
}

/* ========== 向下滚动提示 ========== */
.scroll-hint {
    position: absolute;
    bottom: 50px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    opacity: 0.85;
    pointer-events: none;
    animation: hintFloat 3.2s ease-in-out infinite;
}
.scroll-hint.pos-br { right: 100px; }
.scroll-hint.pos-bl { left: 100px; }
/* 回到主页提示：点击向上滚回首页 */
.scroll-hint.home-hint {
    padding: 16px 14px;
    border-radius: 20px;
    pointer-events: auto;
    cursor: url('../%E7%81%AB%E7%AE%AD.svg') 13 4, pointer;
    transition: background 0.3s ease, opacity 0.3s ease;
}
.scroll-hint.home-hint:hover { opacity: 1; background: transparent; }
.scroll-hint.home-hint .hint-text,
.scroll-hint.home-hint .hint-icon { pointer-events: none; }
@keyframes hintFloatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.scroll-hint.home-hint { animation: hintFloatUp 3.2s ease-in-out infinite; }
.hint-text {
    writing-mode: vertical-rl;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 6px;
    color: #fff;
    line-height: 1.5;
}
.hint-icon {
    width: 22px;
    height: 22px;
    margin-top: 14px;
    opacity: 0.95;
}
@keyframes hintFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
    .scroll-hint { animation: none; }
}