/* ============================================================
   Homepage v2 - design preview (mock: 主页设计稿)
   Scoped to body.home-v2 so the rest of the site is untouched.
   ============================================================ */

body.home-v2 {
    background: var(--bg-primary);
}

/* ---------- navigation ---------- */
/* the old bar was a blurred strip that ran through the whole page width with the
   logo pinned to the far left and the menu pushed to the far right. it becomes
   one group that floats in the middle of the top of the page: the logo stands
   on its own and only the menu sits on the frosted glass. */
body.home-v2 .navbar {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding-top: 18px;
    padding-bottom: 0;
}

body.home-v2 .navbar-nav.ml-auto {
    margin-left: 0;
    flex-wrap: nowrap;
}

@media (min-width: 992px) {
    body.home-v2 .navbar {
        top: 18px;
        left: 50%;
        right: auto;
        width: max-content;
        max-width: calc(100% - 32px);
        transform: translateX(-50%);
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 14px;
    }

    body.home-v2 .navbar-brand {
        margin: 0;
        display: flex;
        align-items: center;
    }

    body.home-v2 .navbar-brand .logo {
        height: 46px;
        width: auto;
        margin-left: 0;
    }

    /* only the menu gets the glass, so the blur never spreads over the logo */
    body.home-v2 .navbar-collapse {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        background: var(--bg-navbar);
        border-radius: 14px;
        padding: 6px 8px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    /* the menu text, the logo and the theme button all sit on the same
       centre line, otherwise the text floats above the logo */
    body.home-v2 .navbar-nav {
        align-items: center;
    }

    body.home-v2 .navbar-nav .nav-item .theme-toggle {
        margin: 0 0 0 10px;
    }
}

body.home-v2 .navbar-nav .nav-link {
    border-radius: 10px;
    padding: 8px 16px;
    margin: 0 2px;
    color: var(--text-primary);
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: color .25s ease;
}

body.home-v2 .navbar-nav .nav-link.active,
body.home-v2 .navbar-nav .nav-link:hover {
    background: none;
    color: var(--accent);
}

/* the marker that slides under the navigation items */
body.home-v2 .navbar-nav {
    position: relative;
}

body.home-v2 .nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: transform .38s cubic-bezier(.4, 0, .2, 1), width .38s cubic-bezier(.4, 0, .2, 1), opacity .25s ease;
}

/* the light that shines up from the marker while the pointer is on the bar */
body.home-v2 .nav-indicator::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 150%;
    height: 26px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 100%, var(--accent-overlay), transparent 70%);
    opacity: 0;
    transition: opacity .35s ease;
}

body.home-v2 .nav-indicator.is-hover::after {
    opacity: 1;
}

/* on phones only the section you are standing in is shown; the rest of the
   menu is one tap away in a card that slides in under the hamburger */
body.home-v2 .navbar-crumb {
    display: none;
}

@media (max-width: 991.98px) {
    /* the bar turns into a stacked menu, so there is nothing to slide */
    body.home-v2 .nav-indicator {
        display: none;
    }

    body.home-v2 .navbar {
        padding-top: 12px;
        align-items: center;
    }

    body.home-v2 .navbar-brand {
        display: flex;
        align-items: center;
        margin: 0;
    }

    body.home-v2 .navbar-brand .logo {
        display: block;
        width: auto;
        height: 34px;
        margin-left: 6px;
    }

    /* the section name and the hamburger share the glass strip that fills the
       bar from the logo to the right edge, so the whole strip is the control */
    body.home-v2 .navbar-toggler {
        display: flex;
        align-items: center;
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 10px;
        padding: 6px 10px 6px 16px;
        border-radius: 12px;
        background: var(--bg-navbar);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    }

    body.home-v2 .navbar-toggler .icon-bar {
        margin-right: 0;
    }

    /* by day the strip is 60% white and the brand's white bars vanish into it,
       so the hamburger gets a mid grey that reads on both strips */
    body.home-v2 .navbar-toggler .hamburger span {
        background: #6b7280;
    }

    body.home-v2 .navbar-crumb {
        display: block;
        margin-right: auto;
        color: var(--text-primary);
        font-size: 15px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
    }

    /* once the card is out, the strip is only a close button back at the edge */
    body.home-v2 .navbar:has(.navbar-collapse.show) .navbar-crumb {
        display: none;
    }

    body.home-v2 .navbar:has(.navbar-collapse.show) .navbar-toggler {
        flex: 0 0 auto;
        margin-left: auto;
        padding: 8px;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }

    body.home-v2 .navbar-collapse {
        top: 66px;
        right: 12px;
        left: auto;
        width: min(268px, calc(100% - 24px));
        max-width: calc(100% - 24px);
        height: auto;
        max-height: calc(100vh - 90px);
        /* the items fly in from the right, and a scrollable box would show a
           scrollbar while they do */
        overflow: hidden auto;
        padding: 8px;
        align-items: stretch;
        justify-content: flex-start;
        background: var(--bg-navbar);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-radius: 16px;
        box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
        transform: translateX(calc(100% + 24px));
        opacity: 0;
        visibility: hidden;
        transition: transform .42s cubic-bezier(.32, .72, 0, 1),
            opacity .26s ease, visibility 0s linear .42s;
    }

    body.home-v2 .navbar-collapse.show {
        transform: none;
        opacity: 1;
        visibility: visible;
        transition: transform .42s cubic-bezier(.32, .72, 0, 1),
            opacity .26s ease;
    }

    body.home-v2 .navbar-collapse .navbar-nav {
        width: 100%;
        padding: 0;
    }

    /* the drawer painted its own blue plate behind the selected item; the card
       uses the same accent pill as the desktop hover instead */
    body.home-v2 .navbar-collapse .navbar-nav .nav-link {
        color: var(--text-primary);
        font-size: 15px;
        padding: 11px 14px;
        margin: 0;
        border-bottom: 0;
        border-radius: 10px;
        text-align: left;
    }

    body.home-v2 .navbar-collapse .navbar-nav .nav-link.active {
        background: var(--menu-item-hover);
        color: var(--accent);
    }

    body.home-v2 .navbar-collapse .navbar-nav .nav-item:nth-child(4) {
        transition-delay: .32s;
    }

    body.home-v2 .navbar-collapse .navbar-nav .nav-item:nth-child(5) {
        transition-delay: .40s;
    }

    body.home-v2 .navbar-collapse .navbar-nav .nav-item:nth-child(6) {
        transition-delay: .48s;
    }

    body.home-v2 .navbar-collapse .nav-item .theme-toggle {
        display: block;
        width: 58px;
        height: 30px;
        margin: 10px 0 2px 14px;
        font-size: 1rem;
    }
}

/* the old design painted a blue plate behind the item, the sliding marker
   takes its place now */
body.home-v2 .line li a::before {
    display: none;
}

/* ---------- theme switch ---------- */
/* the plain moon button becomes a sliding switch: the knob hides the icon of
   the mode you are in and leaves the icon of the other mode showing */
body.home-v2 .theme-toggle {
    position: relative;
    width: 58px;
    height: 30px;
    margin-left: 10px;
    padding: 0;
    border-radius: 10px;
    background: #ffc94a;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07);
    opacity: 1;
    transition: background-color .35s ease;
}

body.home-v2 .theme-toggle:hover {
    background: #ffbe2e;
    color: inherit;
}

/* the sun and the moon are drawn here rather than taken from the icon font:
   the font sun reads as a gear and its moon has no sparkle */
body.home-v2 .theme-toggle .ic {
    position: absolute;
    top: 7.5px;
    width: 15px;
    height: 15px;
    color: #fff;
    transition: opacity .3s ease, transform .45s cubic-bezier(.4, 0, .2, 1);
}

body.home-v2 .theme-toggle .ic-sun {
    left: 9px;
    opacity: 0;
    transform: rotate(-60deg) scale(.5);
}

body.home-v2 .theme-toggle .ic-moon {
    right: 9px;
    opacity: 1;
    transform: rotate(0) scale(1);
}

body.home-v2 .theme-toggle:hover .ic-moon {
    transform: rotate(-14deg) scale(1.12);
}

/* the star in the moon's notch keeps blinking */
body.home-v2 .theme-toggle .spark {
    transform-origin: 19px 5.5px;
    animation: sw-twinkle 3s ease-in-out infinite;
}

@keyframes sw-twinkle {
    0%, 62%, 100% { opacity: 1; transform: scale(1) rotate(0); }
    78% { opacity: .3; transform: scale(.55) rotate(35deg); }
}

[data-theme="dark"] body.home-v2 .theme-toggle .ic-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

[data-theme="dark"] body.home-v2 .theme-toggle:hover .ic-sun {
    transform: rotate(45deg) scale(1.12);
}

[data-theme="dark"] body.home-v2 .theme-toggle .ic-moon {
    opacity: 0;
    transform: rotate(60deg) scale(.5);
}

body.home-v2 .theme-toggle .knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #ff9500;
    transform: translateX(0);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1), background-color .35s ease;
}

[data-theme="dark"] body.home-v2 .theme-toggle {
    background: #8a8a8f;
}

[data-theme="dark"] body.home-v2 .theme-toggle:hover {
    background: #9a9aa0;
}

[data-theme="dark"] body.home-v2 .theme-toggle .knob {
    background: #dcdce1;
    transform: translateX(28px);
}

@media (prefers-reduced-motion: reduce) {
    body.home-v2 .theme-toggle .spark {
        animation: none;
    }
}

/* ---------- hero ---------- */
body.home-v2 .hero-v2 {
    position: relative;
    margin-top: 18px;
    /* the picture is a landscape, so it keeps its square frame */
    border-radius: 0;
    overflow: hidden;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    background: var(--bg-secondary);
}

/* the picture ends above the bottom edge, right where the players walk:
   the strip below it holds their name labels */
body.home-v2 .hero-v2-bg {
    position: absolute;
    inset: -8px 0 21px 0;
    background-image: url('../img/hero-v2.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(6px) saturate(1.15);
}

body.home-v2 .hero-v2-panel {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, .22) 45%, rgba(255, 255, 255, .06) 100%);
}

[data-theme="dark"] body.home-v2 .hero-v2-panel {
    background: linear-gradient(180deg, rgba(0, 0, 0, .30) 0%, rgba(0, 0, 0, .40) 45%, rgba(0, 0, 0, .20) 100%);
}

body.home-v2 .hero-v2-inner {
    position: relative;
    text-align: center;
    padding: 40px 20px 120px;
    width: 100%;
}

body.home-v2 .hero-v2-eyebrow {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
    display: inline-block;
    vertical-align: middle;
}

/* the hero logo is the hollow outline with the brand rainbow running through
   it: the gradient is masked to the inside of the strokes, so the counters of
   P, R and A still let the picture behind show through */
body.home-v2 .hero-v2-logo {
    position: relative;
    display: inline-block;
    height: 78px;
    margin-left: 18px;
    vertical-align: middle;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .45));
}

/* the outline has to sit above the gradient layer: an absolutely positioned
   sibling paints over static in-flow content, so without this the fill chews
   into the inner edge of the black stroke */
body.home-v2 .hero-v2-logo img {
    position: relative;
    z-index: 1;
    display: block;
    height: 100%;
    width: auto;
}

body.home-v2 .hero-v2-logo-fill {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-image: linear-gradient(to right,
        #3b82f6,
        #22c55e,
        #eab308,
        #ec4899,
        #3b82f6
    );
    background-size: 200% auto;
    animation: hv-shine 3s linear infinite;
    -webkit-mask-image: url(../img/logo-hollow-mask.svg?v=2);
    mask-image: url(../img/logo-hollow-mask.svg?v=2);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

@keyframes hv-shine {
    to {
        background-position: 200% center;
    }
}

body.home-v2 .hero-v2-text {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
    font-size: 1.15rem;
    line-height: 1.7;
    margin: 22px auto 28px;
    max-width: 720px;
}

body.home-v2 .hero-v2-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 14px 44px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
    transition: transform .15s ease, box-shadow .15s ease;
}

body.home-v2 .hero-v2-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .34);
}

/* ---------- walking players ---------- */
body.home-v2 .hero-v2-players {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

/* the nametags use the game's own pixel font. the file carries a full CJK set
   because 网易版 players show up with Chinese names */
@font-face {
    font-family: 'Minecraft AE';
    src: url(../fonts/minecraft-ae.ttf) format('truetype');
    font-display: swap;
}

.mc-walker {
    position: absolute;
    bottom: 16px;
    left: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: mc-walk-across 26s linear forwards;
}

/* the walker is a canvas with the player's own skin, rendered with the real
   player rig and walk animation */
.mc-walker canvas {
    display: block;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .35));
}

/* as in the game: the name floats above the head on a black plate that grows
   with the text */
.mc-walker .mc-name {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    padding: 2px 3px;
    background: rgba(0, 0, 0, .5);
    border-radius: 0;
    color: #fff;
    font-family: 'Minecraft AE', 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 12px;
    white-space: nowrap;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .5);
    -webkit-font-smoothing: none;
}

@keyframes mc-walk-across {
    from { transform: translateX(0); }
    to { transform: translateX(calc(var(--hero-w, 100vw) * -1 - 190px)); }
}

/* the special walker stops in the open instead of leaving the screen, so his
   own animation stays visible */
.mc-walker-special {
    animation-name: mc-walk-stop;
}

@keyframes mc-walk-stop {
    from { transform: translateX(0); }
    to { transform: translateX(calc(var(--hero-w, 100vw) * -0.45)); }
}

/* the potion particles he dissolves into */
.mc-walker .mc-fx {
    position: absolute;
    left: 0;
    top: -34px;
    pointer-events: none;
    image-rendering: pixelated;
    filter: none;
}

@media (max-width: 767px) {
    body.home-v2 .hero-v2-inner { padding-bottom: 150px; }
    body.home-v2 .hero-v2-eyebrow { font-size: 1.3rem; }
    body.home-v2 .hero-v2-logo { height: 54px; margin-left: 10px; }
}

/* ---------- game mode cards ---------- */
body.home-v2 .dest {
    padding: 70px 0 40px;
}

body.home-v2 .dest-title {
    font-size: 2.1rem;
    font-weight: 800;
}

body.home-v2 .dest-subtitle {
    color: var(--text-secondary);
}

body.home-v2 .dest .card {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .1);
    transition: transform .18s ease, box-shadow .18s ease;
}

body.home-v2 .dest .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .16);
}

/* the shots are 16:9, so the card keeps that ratio and shows the whole
   picture instead of cutting a strip out of it */
body.home-v2 .dest .card-img-top {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

body.home-v2 .dest .card .text-center {
    padding: 12px 15px 16px;
}

body.home-v2 .dest .card p {
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

body.home-v2 .dest-more {
    background: var(--bg-secondary);
    border-radius: 10px;
    text-align: center;
    padding: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 26px;
}

/* ---------- footer ---------- */
body.home-v2 .footer {
    /* 页脚带子压得深一点，白字才站得住 —— 原来那条半透明的浅灰带子上，
       底下那行小字几乎看不见 */
    background: rgba(38, 40, 46, .62) !important;
    padding: 26px 0 !important;
}

body.home-v2 .footer .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

body.home-v2 .footer .footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

body.home-v2 .footer .footer-left .logo {
    height: 34px;
    width: auto;
}

body.home-v2 .footer .copyright h5 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
}

body.home-v2 .footer .copyright p {
    font-size: .8rem;
    /* 页脚是半透明的，下面就是照片。白字在深浅两种底上都读得出来，
       灰字压在这种底上会糊成一片；再垫一道极淡的暗影，
       白字落在浅灰的底上也不会飘 */
    color: #fff;
    margin: 4px 0 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

body.home-v2 .footer .footer-links {
    display: flex;
    gap: 12px;
}

body.home-v2 .footer .footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

body.home-v2 .footer .footer-links a:hover {
    color: #fff;
    filter: brightness(1.08);
}

@media (max-width: 767px) {
    body.home-v2 .footer .footer-inner { flex-direction: column; align-items: flex-start; }
}
