:root {
    --ink: var(--weui-FG-0, rgba(0, 0, 0, .9));
    --muted: var(--weui-FG-1, rgba(0, 0, 0, .55));
    --light: var(--weui-FG-2, rgba(0, 0, 0, .3));
    --line: var(--weui-SEPARATOR-0, rgba(0, 0, 0, .1));
    --green: var(--weui-BRAND, #07c160);
    --green-pressed: var(--weui-BRAND-90, #06ae56);
    --canvas: var(--weui-BG-1, #f7f7f7);
    --paper: var(--weui-BG-2, #ffffff);
    --sans: var(--wl-font, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif);
}

* { box-sizing: border-box; }

html {
    min-width: 300px;
    background: var(--canvas);
    color-scheme: light;
}

body {
    min-width: 300px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--sans);
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-only { display: none; }

.portal-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.portal-shell {
    min-height: 100svh;
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 22px clamp(28px, 4vw, 72px) 18px;
    display: flex;
    flex-direction: column;
}

.portal-header,
.portal-footer {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-header { min-height: 48px; }

.portal-brand {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.portal-mark {
    width: 40px;
    height: 40px;
    padding: 0;
    flex: 0 0 40px;
    display: block;
    overflow: visible;
    background: transparent;
}

.portal-mark .bubble-body { fill: var(--green); }
.portal-mark .bubble-eye { fill: #ffffff; }
.portal-mark .bubble-pupil { fill: rgba(0, 0, 0, .88); }

.portal-mark .bubble-smile {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.7;
    stroke-linecap: round;
}

.portal-brand > span {
    display: grid;
    gap: 1px;
}

.portal-brand strong {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .04em;
}

.portal-brand small {
    color: var(--muted);
    font-size: 11px;
}

.portal-status {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 13px;
}

.portal-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.portal-main {
    width: min(100%, 1160px);
    margin: auto;
    padding: clamp(34px, 5vh, 64px) 0;
    display: grid;
    grid-template-columns: minmax(350px, 480px) minmax(430px, 1fr);
    align-items: center;
    gap: clamp(54px, 7vw, 104px);
}

.portal-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #eef7f1;
    box-shadow: 0 14px 38px rgba(7, 80, 47, .12);
    isolation: isolate;
    perspective: 900px;
    transform-style: preserve-3d;
}

.portal-visual::before {
    content: "";
    position: absolute;
    z-index: 4;
    inset: 0;
    background: linear-gradient(180deg, transparent 51%, rgba(3, 45, 26, .08) 68%, rgba(3, 45, 26, .7) 100%);
    pointer-events: none;
}

.portal-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    transform-style: preserve-3d;
    transform-origin: 50% 50%;
    will-change: transform;
}

.portal-layer {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    will-change: transform;
}

.portal-layer img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.portal-layer-background {
    z-index: 1;
    inset: -3.75%;
}

.portal-layer-background img {
    filter: saturate(.9) contrast(.94) brightness(1.025);
    animation: portal-background-breathe 9s ease-in-out infinite alternate;
}

.portal-layer-person {
    z-index: 2;
    -webkit-mask: url('/site/assets/images/jingxuan-person-mask.svg') center / 100% 100% no-repeat;
    mask: url('/site/assets/images/jingxuan-person-mask.svg') center / 100% 100% no-repeat;
    filter: drop-shadow(0 16px 22px rgba(15, 92, 58, .09));
}

.portal-layer-person img {
    filter: saturate(.98) contrast(1.01) brightness(1.005);
    animation: portal-person-breathe 6.4s ease-in-out infinite alternate;
}

.portal-magic {
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}

.portal-magic::before {
    content: "";
    position: absolute;
    left: -20%;
    top: 63%;
    width: 140%;
    height: 1px;
    background: linear-gradient(90deg, transparent 8%, rgba(255,255,255,.2) 24%, rgba(255,255,255,.92) 50%, rgba(7,193,96,.35) 72%, transparent 92%);
    box-shadow: 0 0 14px rgba(255,255,255,.75), 0 0 28px rgba(7,193,96,.34);
    opacity: 0;
    transform: rotate(-7deg) translateY(54px);
    animation: portal-scan 5.8s 1.25s ease-in-out infinite;
}

.portal-magic::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 62%;
    width: 48%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.2) 0, rgba(7,193,96,.1) 38%, transparent 70%);
    mix-blend-mode: screen;
    transform: translate(-50%, -50%) scale(.84);
    animation: portal-core-pulse 3.2s ease-in-out infinite alternate;
}

.magic-ring {
    position: absolute;
    left: 50%;
    top: 62%;
    width: 36%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
    box-shadow: 0 0 22px rgba(7, 193, 96, .24), inset 0 0 18px rgba(255, 255, 255, .16);
    opacity: 0;
    transform: translate(-50%, -50%) scale(.72);
}

.ring-one { animation: portal-ring 4.8s 1s ease-out infinite; }
.ring-two { animation: portal-ring 4.8s 2.8s ease-out infinite; }

.magic-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(7, 193, 96, .16), 0 0 18px rgba(7, 193, 96, .72);
    animation: portal-dot 3.6s ease-in-out infinite alternate;
}

.dot-one { left: 14%; top: 28%; animation-delay: .3s; }
.dot-two { right: 12%; top: 20%; animation-delay: 1.1s; }
.dot-three { left: 10%; top: 63%; animation-delay: 1.9s; }
.dot-four { right: 14%; top: 58%; animation-delay: 2.5s; }

.magic-connection {
    position: absolute;
    width: 68px;
    height: 28px;
    border-top: 1px solid rgba(255, 255, 255, .68);
    border-radius: 50%;
    opacity: 0;
    animation: portal-connection 5.6s ease-in-out infinite;
}

.connection-one { left: 8%; top: 42%; transform: rotate(21deg); }
.connection-two { right: 7%; top: 38%; transform: rotate(-24deg); animation-delay: 2.2s; }

@keyframes portal-background-breathe {
    from { transform: scale(1); filter: saturate(.88) contrast(.94) brightness(1.025); }
    to { transform: scale(1.018); filter: saturate(.96) contrast(.97) brightness(1.04); }
}

@keyframes portal-person-breathe {
    from { transform: scale(1); }
    to { transform: scale(1.012); }
}

@keyframes portal-ring {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
    20% { opacity: .68; }
    72%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.65); }
}

@keyframes portal-dot {
    from { opacity: .36; transform: translateY(3px) scale(.72); }
    to { opacity: 1; transform: translateY(-5px) scale(1); }
}

@keyframes portal-connection {
    0%, 14%, 100% { opacity: 0; }
    32%, 62% { opacity: .8; }
}

@keyframes portal-scan {
    0%, 8% { opacity: 0; transform: rotate(-7deg) translateY(54px); }
    24%, 55% { opacity: .78; }
    82%, 100% { opacity: 0; transform: rotate(-7deg) translateY(-94px); }
}

@keyframes portal-core-pulse {
    from { opacity: .45; transform: translate(-50%, -50%) scale(.84); }
    to { opacity: .9; transform: translate(-50%, -50%) scale(1.08); }
}

.portal-visual figcaption {
    position: absolute;
    z-index: 5;
    right: 24px;
    bottom: 24px;
    left: 24px;
    display: block;
    color: #ffffff;
}

.portal-visual figcaption span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    opacity: 0;
    animation: portal-copy-in .7s .35s ease-out forwards;
}

.portal-visual figcaption strong {
    display: block;
    font-weight: 600;
    line-height: 1.13;
    text-align: left;
}

.portal-visual figcaption .portal-slogan {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.portal-visual figcaption strong em,
.portal-visual figcaption strong b {
    display: block;
    font-style: normal;
    opacity: 0;
    transform: translateY(14px);
    animation: portal-copy-in .74s ease-out forwards;
}

.portal-visual figcaption strong em {
    padding: 5px 10px 6px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 14px rgba(255, 255, 255, .08);
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    backdrop-filter: blur(7px);
    animation-delay: .72s;
}

.portal-visual figcaption strong em i {
    font-style: normal;
    font-weight: 800;
    letter-spacing: .02em;
}

.portal-visual figcaption strong b {
    margin-top: 0;
    font-size: 38px;
    letter-spacing: .03em;
    animation-delay: 1.02s;
}

.portal-visual figcaption small {
    display: block;
    margin-top: 11px;
    font-size: 12px;
    letter-spacing: .12em;
    opacity: 0;
    animation: portal-copy-in .72s 1.34s ease-out forwards;
}

@keyframes portal-copy-in {
    to { opacity: 1; transform: translateY(0); }
}

.portal-content { min-width: 0; }
.portal-intro { margin-bottom: 26px; }

.portal-kicker {
    color: var(--green-pressed);
    font-size: 13px;
    font-weight: 600;
}

.portal-intro h1 {
    margin: 12px 0 10px;
    font-size: clamp(38px, 4vw, 52px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .02em;
}

.portal-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.route-list {
    overflow: hidden;
    border-radius: 12px;
    background: var(--paper);
}

.route-card {
    position: relative;
    min-height: 82px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 40px 160px minmax(170px, 1fr) 32px;
    align-items: center;
    gap: 14px;
    background: var(--paper);
}

.route-card + .route-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 16px;
    height: 1px;
    background: var(--line);
    transform: scaleY(.5);
    transform-origin: 0 0;
}

.route-card:hover,
.route-card:focus-visible,
.route-card:active {
    outline: none;
    background: var(--weui-BG-1, #f7f7f7);
}

.route-icon { display: none; }

.route-number {
    color: var(--light);
    font-size: 13px;
}

.route-copy {
    display: grid;
    gap: 3px;
}

.route-copy small {
    color: var(--green-pressed);
    font-size: 13px;
    font-weight: 500;
}

.route-copy strong {
    font-size: 20px;
    font-weight: 600;
}

.route-description {
    color: var(--muted);
    font-size: 15px;
}

.route-arrow {
    width: 32px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--light);
    font: 300 30px/1 Arial, sans-serif;
}

.portal-footer {
    min-height: 40px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.portal-footer p { margin: 0; }
.portal-footer span { font-size: 12px; }

.wechat-gate {
    min-height: 100svh;
    padding: 32px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--weui-BG-0, #ededed);
}

.gate-symbol {
    position: relative;
    width: 82px;
    height: 68px;
    margin-bottom: 28px;
}

.gate-symbol span {
    position: absolute;
    border-radius: 50%;
    background: var(--green);
}

.gate-symbol span:first-child {
    width: 56px;
    height: 48px;
    top: 0;
    left: 0;
}

.gate-symbol span:nth-child(2) {
    width: 48px;
    height: 42px;
    right: 0;
    bottom: 0;
    background: var(--green-pressed);
}

.gate-symbol i,
.gate-symbol b {
    position: absolute;
    z-index: 2;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffffff;
}

.gate-symbol i:nth-of-type(1) { top: 21px; left: 18px; }
.gate-symbol i:nth-of-type(2) { top: 21px; left: 34px; }
.gate-symbol b { right: 16px; bottom: 17px; box-shadow: -13px 0 0 #ffffff; }

.wechat-gate h1 {
    margin: 12px 0 10px;
    font-size: 24px;
    font-weight: 600;
}

.wechat-gate p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.gate-url {
    margin: 28px 0 10px;
    padding: 12px 22px;
    border-radius: 8px;
    color: var(--green-pressed);
    background: var(--paper);
    font-size: 16px;
}

.wechat-gate small {
    color: var(--muted);
    font-size: 14px;
}

body[data-portal="mobile-browser"] .portal-shell { display: none; }
body[data-portal="mobile-browser"] .wechat-gate { display: flex; }

@media (max-width: 860px) {
    html,
    body { background: var(--weui-BG-0, #ededed); }

    .desktop-only { display: none !important; }
    .mobile-only { display: inline; }

    .portal-shell {
        width: 100%;
        padding: 0 0 max(12px, env(safe-area-inset-bottom));
    }

    .portal-header {
        min-height: calc(52px + env(safe-area-inset-top));
        padding: max(8px, env(safe-area-inset-top)) 16px 8px;
        background: var(--paper);
    }

    .portal-brand {
        min-height: 36px;
        gap: 10px;
    }

    .portal-mark {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .portal-brand strong { font-size: 17px; }
    .portal-brand small { font-size: 12px; }

    .portal-status {
        min-height: 36px;
        font-size: 14px;
    }

    .portal-status i {
        width: 9px;
        height: 9px;
        box-shadow: 0 0 0 5px rgba(7, 193, 96, .12);
    }

    .portal-status span { display: none; }

    .portal-main {
        width: 100%;
        margin: 0;
        padding: 12px 16px 18px;
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: 0;
    }

    .portal-visual {
        flex: none;
        width: 100%;
        aspect-ratio: 1;
        border-radius: 12px;
        box-shadow: none;
    }

    .portal-layer img { object-position: center; }

    .portal-visual figcaption {
        right: 20px;
        bottom: 20px;
        left: 20px;
        display: block;
    }

    .portal-visual figcaption span {
        display: block;
        margin-bottom: 7px;
        font-size: 14px;
        opacity: .9;
    }

    .portal-visual figcaption strong {
        display: block;
        line-height: 1.12;
        text-align: left;
    }

    .portal-visual figcaption .portal-slogan { gap: 9px; }

    .portal-visual figcaption strong em {
        padding: 5px 9px 6px;
        font-size: clamp(16px, 4.5vw, 18px);
    }

    .portal-visual figcaption strong b {
        margin-top: 0;
        font-size: clamp(30px, 8.6vw, 37px);
    }

    .portal-visual figcaption small {
        margin-top: 9px;
        font-size: 12px;
        letter-spacing: .09em;
    }

    .portal-content { width: 100%; }

    .portal-intro {
        margin: 20px 0 13px;
    }

    .portal-kicker { font-size: 14px; }

    .portal-intro h1 {
        margin: 3px 0 2px;
        font-size: 22px;
        font-weight: 600;
        line-height: 1.4;
    }

    .portal-intro p { font-size: 14px; }

    .route-list {
        overflow: visible;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        border-radius: 0;
        background: transparent;
    }

    .route-card {
        min-height: 138px;
        padding: 15px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        border-radius: 12px;
        background: var(--paper);
    }

    .route-card + .route-card::before { display: none; }
    .route-card:active { background: var(--weui-BG-1, #f7f7f7); }

    .route-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 11px;
        display: grid;
        place-items: center;
        border-radius: 11px;
        color: var(--green-pressed);
        background: rgba(7, 193, 96, .1);
    }

    .route-icon svg {
        width: 27px;
        height: 27px;
        overflow: visible;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
        vector-effect: non-scaling-stroke;
    }

    .route-number { display: none; }

    .route-copy { gap: 1px; }

    .route-copy small {
        color: var(--muted);
        font-size: 14px;
        font-weight: 400;
        line-height: 1.35;
    }

    .route-copy strong {
        font-size: 18px;
        font-weight: 600;
        line-height: 1.4;
    }

    .route-description {
        margin-top: auto;
        color: var(--green-pressed);
        font-size: 14px;
        line-height: 1.35;
    }

    .route-arrow {
        position: absolute;
        right: 10px;
        bottom: 8px;
        width: 28px;
        height: 32px;
        color: var(--light);
        font-size: 26px;
    }

    .portal-footer {
        min-height: 44px;
        margin: 0 16px;
        padding: 11px 0 0;
        justify-content: center;
        border-top-color: var(--line);
        font-size: 13px;
    }

    .portal-footer span { display: none; }
}

@media (max-width: 350px) {
    .portal-main {
        padding-right: 12px;
        padding-left: 12px;
    }

    .route-list { gap: 8px; }

    .route-card {
        min-height: 132px;
        padding: 13px;
    }

    .route-copy strong { font-size: 17px; }

    .route-copy small,
    .route-description { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
