[x-cloak] { display: none !important; }
body {
    background-color: #050505;
    color: #e5e5e5;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.08), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.06), transparent 40%),
        url('https://www.transparenttextures.com/patterns/stardust.png');
    background-attachment: fixed;
}

/* 导航菜单样式 */
.nav-item { position: relative; height: 100%; display: flex; align-items: center; cursor: pointer; }
.nav-item::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background-color: #C8102E; transition: width 0.3s;
}
.nav-item:hover::after { width: 100%; }

.dropdown-menu {
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
}
.nav-item:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

/* ================= 核心：原生滚动驱动动画 (Scrubbing) ================= */
/* 
   原理：JS 计算每个元素的可见进度 --p (0.0 ~ 1.0)
   CSS 使用 calc() 根据 --p 实时改变样式
   滚轮动 -> --p 变 -> 样式变
*/

/* 1. 影院级浮现 (跟随滚轮) */
.anim-fade-up {
    opacity: clamp(0, calc((var(--p) - 0.05) * 3), 1);
    transform:
        translate3d(0, calc(130px * (1 - var(--p))), 0)
        scale(calc(0.97 + 0.03 * var(--p)));
    /* 透明/模糊不要影响阅读：只保留一点点过渡 */
    filter: blur(calc(0.6px * (1 - var(--p))));
    transition: transform 0.08s cubic-bezier(0, 0, 0.2, 1), opacity 0.08s cubic-bezier(0, 0, 0.2, 1), filter 0.08s cubic-bezier(0, 0, 0.2, 1);
    will-change: transform, opacity, filter;
}

/* 1B. 3D 翻转入场 (用于卡片) */
.anim-flip-up {
    opacity: clamp(0, calc((var(--p) - 0.1) * 2), 1);
    transform:
        perspective(1000px)
        translate3d(0, calc(90px * (1 - var(--p))), 0)
        rotateX(calc(16deg * (1 - var(--p))));
    filter: blur(calc(0.6px * (1 - var(--p))));
    transition: transform 0.08s linear, opacity 0.08s linear, filter 0.08s linear;
    will-change: transform, opacity, filter;
}

/* 2. 缩放聚焦 */
.anim-scale {
    transform: translateZ(0) scale(calc(1.06 - 0.06 * var(--p)));
    opacity: clamp(0, calc(var(--p) * 2), 1);
    filter: brightness(calc(0.7 + 0.3 * var(--p)));
    transition: transform 0.08s linear, opacity 0.08s linear, filter 0.08s linear;
    will-change: transform, opacity, filter;
}

/* 3. 线条生长 (用于时间轴) */
.anim-grow-line {
    height: calc(100% * var(--p));
    max-height: 100%;
    transition: height 0.05s linear;
    box-shadow: 0 0 10px rgba(212, 175, 55, calc(var(--p) * 0.35));
}

/* 4. 背景视差 (Parallax) */
.anim-parallax {
    /* 背景图移动速度比前景慢 */
    transform: translateY(calc(var(--scroll-y) * 0.5px));
    transition: transform 0.05s linear;
}

/* 首页 Hero：轻微视差（只让图片动，遮罩不动；限制最大位移避免“飘”） */
.hero-parallax-img {
    transform: translate3d(0, clamp(-24px, calc(var(--scroll-y) * -0.06px), 0px), 0) scale(1.1);
    filter: brightness(0.6);
    transition: transform 0.05s linear;
    will-change: transform;
}

.sdlv-home-like-hero-title {
    text-wrap: balance;
}

.sdlv-home-like-hero-body p {
    max-width: 27rem;
}

#study-hero .sdlv-home-like-hero-copy {
    padding-top: 0.75rem;
}

/* 地图交互 */
.map-point-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    background: rgba(212, 175, 55, 0.4);
    animation: pulse-glow 2s infinite;
    pointer-events: none;
}
@keyframes pulse-glow {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.map-line {
    width: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    height: 1px;
    background: linear-gradient(90deg, #D4AF37, transparent);
    position: absolute;
    transform-origin: left center;
}
.map-active .map-line { width: 140px; }
.map-label { opacity: 0; transform: translateY(10px); transition: all 0.6s ease 0.6s; }
.map-active .map-label { opacity: 1; transform: translateY(0); }

/* 悬浮咨询按钮组（参照AI稿） */
.float-widget-container {
    position: absolute;
    right: 22px;
    z-index: 9999;
    /* Elastic follow: top = scrollY + viewportHeight - offset (bigger offset => higher on screen) */
    top: calc(var(--scroll-y, 0) * 1px + 100vh - var(--fab-offset, 200px));
    transition: top 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    will-change: top;
}
.float-btn-group {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    align-items: flex-end;
}
.main-float-btn {
    width: 60px;
    height: 60px;
    border-radius: 9999px;
    background: linear-gradient(180deg, rgba(0, 51, 102, 0.96), rgba(0, 38, 77, 0.92));
    border: 1px solid rgba(200, 16, 46, 0.35);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(0, 35, 71, 0.35);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #ffffff;
}
.main-float-btn:hover {
    transform: scale(1.08);
    border-color: rgba(200, 16, 46, 0.65);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.14), 0 18px 38px rgba(0, 35, 71, 0.4);
}

.sub-float-btn {
    opacity: 0;
    transform: translateY(20px) scale(0.88);
    pointer-events: none;
    background: rgba(241, 245, 249, 0.96);
    color: #003366;
    border: 1px solid rgba(0, 51, 102, 0.12);
    padding: 10px 22px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2em;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.sub-float-btn:hover {
    background: #ffffff;
    color: #c8102e;
    border-color: rgba(200, 16, 46, 0.25);
}

.float-btn-group:hover .sub-float-btn,
.float-btn-group.is-open .sub-float-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.float-btn-group:hover .sub-float-btn:nth-child(2),
.float-btn-group.is-open .sub-float-btn:nth-child(2) { transition-delay: 0.05s; }
.float-btn-group:hover .sub-float-btn:nth-child(3),
.float-btn-group.is-open .sub-float-btn:nth-child(3) { transition-delay: 0.1s; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #003366; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #0A4B8F; }

/* ================= TEMP: Disable scrub animations globally =================
   Purpose: temporarily show all scrubbed elements without scroll-driven reveal.
   To re-enable: remove this override block.
*/
.scrub-item,
.anim-fade-up,
.anim-flip-up,
.anim-scale {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    will-change: auto !important;
}

.anim-grow-line {
    height: 100% !important;
    transition: none !important;
    box-shadow: none !important;
}

/* Footer quick links: prevent wrapping and prevent cross-column overlap */
.footer-links button,
.footer-links a {
    display: block;
    width: 100%;
    white-space: nowrap;
    text-align: left;
}

@media (max-width: 1024px) {
    .sdlv-site-footer-contact {
        width: 9rem !important;
        min-width: 9rem !important;
        padding-left: 1.5rem !important;
    }

    .sdlv-site-footer-contact-links,
    .sdlv-site-footer-contact-links a,
    .sdlv-site-footer-contact-links button {
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
    }

    .sdlv-site-footer-contact .text-xs {
        font-size: 0.6875rem !important;
    }
}

/* Agent dashboard: prevent browser default blue focus/autofill tint */
[data-agent-ui] {
    -webkit-tap-highlight-color: transparent;
}

[data-agent-ui] input,
[data-agent-ui] select,
[data-agent-ui] textarea {
    color-scheme: dark;
}

[data-agent-ui] input {
    caret-color: #D4AF37;
}

[data-agent-ui] input::placeholder,
[data-agent-ui] textarea::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
    opacity: 1 !important;
}

[data-agent-ui] input::-ms-input-placeholder,
[data-agent-ui] textarea::-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

[data-agent-ui] input:focus,
[data-agent-ui] select:focus,
[data-agent-ui] textarea:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.75) !important;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25) !important;
}

[data-agent-ui] input:-webkit-autofill,
[data-agent-ui] input:-webkit-autofill:hover,
[data-agent-ui] input:-webkit-autofill:focus,
[data-agent-ui] textarea:-webkit-autofill,
[data-agent-ui] textarea:-webkit-autofill:hover,
[data-agent-ui] textarea:-webkit-autofill:focus,
[data-agent-ui] select:-webkit-autofill,
[data-agent-ui] select:-webkit-autofill:hover,
[data-agent-ui] select:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    caret-color: #D4AF37;
    transition: background-color 9999s ease-out 0s;
    box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.35) inset !important;
}

@media (max-width: 1280px) {
    .max-w-7xl {
        max-width: 68rem !important;
    }

    .max-w-6xl {
        max-width: 62rem !important;
    }

    .max-w-5xl {
        max-width: 56rem !important;
    }

    .px-6 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    #hero {
        min-height: clamp(36rem, 60vh, 44rem) !important;
        align-items: center !important;
    }

    #hero .max-w-3xl {
        max-width: 34rem !important;
    }

    #hero .flex.items-center.gap-4.mb-8 {
        margin-bottom: 1.1rem !important;
    }

    #hero h1 {
        font-size: clamp(3rem, 5vw, 3.9rem) !important;
        line-height: 1 !important;
        margin-bottom: 1.1rem !important;
    }

    #hero p.text-xl {
        max-width: 27rem !important;
        font-size: 0.9375rem !important;
        line-height: 1.55 !important;
        margin-bottom: 1.5rem !important;
    }

    #hero-planner-bar {
        max-width: 25.5rem !important;
        padding: 0.25rem !important;
    }

    #hero-planner-bar .flex-1 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #hero-planner-bar button {
        padding: 0.8rem 1.2rem !important;
        font-size: 0.875rem !important;
        gap: 0.375rem !important;
    }

    .sdlv-home-like-hero {
        min-height: clamp(36rem, 60vh, 44rem) !important;
        align-items: center !important;
    }

    .sdlv-home-like-hero .sdlv-home-like-hero-copy {
        max-width: 34rem !important;
    }

    .sdlv-home-like-hero .sdlv-home-like-hero-kicker {
        margin-bottom: 1.1rem !important;
    }

    .sdlv-home-like-hero .sdlv-home-like-hero-title {
        font-size: clamp(3rem, 5vw, 3.9rem) !important;
        line-height: 1 !important;
        margin-bottom: 1.1rem !important;
    }

    .sdlv-home-like-hero .sdlv-home-like-hero-body {
        max-width: 27rem !important;
        margin-bottom: 1.5rem !important;
        gap: 0.875rem !important;
    }

    #study-hero .sdlv-home-like-hero-copy {
        padding-top: 1.5rem !important;
    }

    .sdlv-home-like-hero .sdlv-home-like-hero-body p {
        max-width: 27rem !important;
        font-size: 0.9375rem !important;
        line-height: 1.55 !important;
    }

    #core-business {
        transform: translateY(42%) !important;
    }

    #core-business > div {
        max-width: 57rem !important;
    }

    #core-business .group {
        padding: 1.35rem 1.25rem !important;
    }

    #core-business .group > div:first-child {
        width: 2rem !important;
        margin-bottom: 0.875rem !important;
    }

    #core-business .group h3 {
        font-size: 1rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0.375rem !important;
    }

    #core-business .group p {
        font-size: 0.6875rem !important;
        line-height: 1.45 !important;
    }

    #hero + div {
        height: clamp(12rem, 21vh, 15rem) !important;
    }

    .sdlv-compact-network-grid {
        max-width: 64rem !important;
        grid-template-columns: 11rem minmax(0, 1fr) 11rem !important;
        gap: 0.75rem !important;
        min-height: 32rem !important;
        margin-top: 4rem !important;
        margin-bottom: 4rem !important;
    }

    .sdlv-compact-network-grid > .grid {
        gap: 0.5rem !important;
    }

    .sdlv-compact-network-grid > .grid > div {
        width: 10rem !important;
    }

    .sdlv-compact-network-grid .relative.max-w-\[44rem\] {
        max-width: 38rem !important;
    }

    .sdlv-site-footer {
        padding-top: 4.5rem !important;
        padding-bottom: 4.5rem !important;
    }

    .sdlv-site-footer-main {
        gap: 2.5rem !important;
        font-size: 0.8125rem !important;
    }

    .sdlv-site-footer-title {
        font-size: 1.875rem !important;
        line-height: 1.2 !important;
    }

    .sdlv-site-footer-brand-copy {
        font-size: 0.6875rem !important;
        letter-spacing: 0.16em !important;
        max-width: 16rem !important;
    }

    .sdlv-site-footer-links {
        column-gap: 1.25rem !important;
        row-gap: 2rem !important;
    }

    .sdlv-site-footer .footer-links,
    .sdlv-site-footer .footer-links a,
    .sdlv-site-footer .footer-links button {
        font-size: 0.8125rem !important;
        line-height: 1.45 !important;
    }

    .sdlv-site-footer .text-xs,
    .sdlv-site-footer .text-sm {
        font-size: 0.75rem !important;
    }

    .sdlv-site-footer-bottom {
        margin-top: 2.75rem !important;
        padding-top: 1.25rem !important;
        font-size: 0.6875rem !important;
    }
}
