:root {
    --map-max-w: 620px;
    --btn-py: clamp(9px, 2.2vmin, 11px);
    --btn-px: clamp(12px, 3.2vmin, 16px);
    --bg-color: rgb(135, 178, 131);
    --gb-fail: rgba(255, 60, 60, 0.98);
    --game-bg-color: rgb(35, 51, 33);
}

@media (min-width: 900px) {
    :root {
        --map-max-w: 720px;
    }
}

@media (min-width: 1200px) {
    :root {
        --map-max-w: 820px;
    }
}

html,
body {
    width: 100%;
    height: 100%;
    min-width: 320px;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -ms-user-select: none;
    -moz-user-select: none;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

* {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

body {
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.center-box {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;

    /* 安全区 + 自适应内边距（横竖屏更稳） */
    padding-top: calc(clamp(12px, 3vh, 22px) + env(safe-area-inset-top));
    padding-right: calc(clamp(12px, 3.8vw, 22px) + env(safe-area-inset-right));
    padding-bottom: calc(clamp(32px, 6vh, 48px) + env(safe-area-inset-bottom));
    padding-left: calc(clamp(12px, 3.8vw, 22px) + env(safe-area-inset-left));
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    z-index: 20;
    pointer-events: none;
}

.title {
    font-size: clamp(22px, 5.2vmin, 40px);
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #222;
    line-height: 1.1;
}

/* 7点关卡路径：节点层（可点击） */
#beginNodes {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* 默认不吃点击，点位自己再开启 */
    z-index: 10;
    /* 放到 center-box 上面，确保能点到 */
}

/* 点位基础样式 */
.path-node {
    position: absolute;
    transform: translate(-50%, -50%);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: visible;
    z-index: 1;

    pointer-events: none;
}

/* 点击后短暂“按下/确认”态：让交互可见 */
.path-node.starting {
    pointer-events: none;
    /* 防连点 */
    filter: brightness(0.96);
}

.path-node.state-past.starting {
    transform: translate(-50%, -50%) scale(1.05);
}

.path-node.state-current.starting {
    transform: translate(-50%, -50%) scale(1.14);
}

/* 只有 clickable 才允许点 */
.path-node.clickable {
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

/* PC/触控板：只有支持 hover 的设备才启用 */
@media (hover: hover) and (pointer: fine) {
    .path-node.state-past.clickable:hover {
        transform: translate(-50%, -50%) scale(1.10);
        filter: brightness(1.08) saturate(1.06);
        box-shadow:
            inset 0 2px 0 rgba(255, 255, 255, 0.26),
            inset 0 -4px 10px rgba(0, 0, 0, 0.18),
            0 10px 22px rgba(0, 0, 0, 0.16);
    }
}

/* 移动端按下反馈 */
.path-node.state-past.clickable:active {
    transform: translate(-50%, -50%) scale(1.02);
    filter: brightness(0.98);
}

/* 键盘可达（PC） */
.path-node.state-past.clickable:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
}

/* 节点字体用 vmin：避免宽屏巨大、窄屏过小 */
.path-node.state-past,
.path-node.state-future {
    font-size: clamp(24px, 7vmin, 36px);
}

/* 1~3 低亮 */
.path-node.state-past {
    color: rgba(255, 255, 255, 0.96);
    background: rgb(135, 178, 131);
    border: 1px solid rgba(255, 255, 255, 0.18);

    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.20),
        inset 0 -4px 10px rgba(0, 0, 0, 0.18),
        0 6px 16px rgba(0, 0, 0, 0.10);
}

/* 4 高亮（当前）：放大 1.2 倍 + 扩散动画 */
.path-node.state-current {
    transform: translate(-50%, -50%) scale(1.5);
    font-size: clamp(28px, 8vmin, 42px);
    font-weight: 900;
    color: #fff;
    background: rgba(255, 153, 0, 1);
    /* box-shadow: 0 0 0 clamp(3px, 0.9vmin, 5px) rgba(255, 153, 0, 0.10); */

    /* 关键：创建独立层叠上下文，避免波纹被压没 */
    isolation: isolate;
    z-index: 3;
}


@keyframes level-bump {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0);
    }

    35% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0);
    }
}

@keyframes level-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.95);
        opacity: 1;
    }

    100% {
        box-shadow: 0 0 0 28px rgba(255, 255, 255, 0);
        opacity: 0;
    }
}

/* bump：用伪元素做缩放/阴影，不动节点本身的 translate(-50%,-50%) */
.path-node.state-current::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    pointer-events: none;
    z-index: 0;
    transform-origin: center;
    animation: level-bump 1s ease-in-out infinite;
    will-change: transform, box-shadow;
}

/* glow：外发光圈 */
.path-node.state-current::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    animation: level-glow 1s ease-out infinite;
    will-change: opacity, box-shadow;
}

@keyframes node-arrive {
    0% {
        filter: brightness(1);
    }

    45% {
        filter: brightness(1.12) saturate(1.05);
    }

    100% {
        filter: brightness(1);
    }
}

.path-node.handoff-to {
    animation: node-arrive 480ms cubic-bezier(.16, .9, .28, 1) 1;
}

@keyframes label-tick {
    0% {
        transform: translateY(-0.35em);
        opacity: .35;
    }

    100% {
        transform: translateY(-0.06em);
        opacity: 1;
    }

    /* 对齐你原本的 -0.06em */
}

.path-node.tick .node-label {
    animation: label-tick 260ms ease-out 1;
}

/* 胜利回 begin 播星前：临时关闭当前点的发光/缩放，让星星更干净 */
.path-node.state-current.star-focus::before,
.path-node.state-current.star-focus::after {
    animation: none !important;
    opacity: 0 !important;
}

/* 触底提示动画（两种模式） */
/* - touch：edge-min-hold（持续放大变红） */
/* - wheel/key：edge-min-pulse（短促提示，带节流避免跳动） */
@keyframes edge-min-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 0 rgba(255, 60, 60, 0);
    }

    55% {
        transform: translate(-50%, -50%) scale(1.22);
        filter: brightness(1.08) saturate(1.1);
        box-shadow: 0 0 0 16px rgba(255, 60, 60, 0.22);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 0 rgba(255, 60, 60, 0);
    }
}

/* 持续态（触摸按住持续滑时） */
.path-node.edge-min-hold.state-past {
    transform: translate(-50%, -50%) scale(1.22);
    background: rgba(255, 60, 60, 0.98);
    color: #fff;
    filter: brightness(1.06) saturate(1.1);
    box-shadow: 0 0 0 16px rgba(255, 60, 60, 0.18);
}

/* 脉冲态（滚轮/键盘） */
.path-node.edge-min-pulse.state-past {
    background: rgba(255, 60, 60, 0.98);
    color: #fff;
    animation: edge-min-pulse 280ms ease-out 1;
}

/* 5~7 灰色（未来，不可点） */
.path-node.state-future {

    /* border: 2px solid rgba(150, 150, 150, 1); */
    color: rgba(255, 255, 255, 0.7);
    background: rgba(150, 150, 150, 1);
}

/* 节点里的数字 */
.path-node .node-label {
    font-weight: 700;
    line-height: 1;
    position: relative;
    z-index: 2;

    /* 生产级：字体视觉中心补偿（数字通常会显得偏下） */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transform: translateY(-0.06em);
    pointer-events: none;
}

/* === Stars (use star.svg as mask) === */
.path-node {
    --node-d: 56px;
}

.node-stars {
    position: absolute;
    left: 50%;
    top: calc(var(--node-d) * -0.12);
    transform: translate(-50%, -100%);
    display: flex;
    gap: 3px;
    z-index: 4;
    pointer-events: none;
    /* filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); */
}

.node-star {
    width: var(--star-s, clamp(14px, 3.5vmin, 18px));
    height: var(--star-s, clamp(14px, 3.5vmin, 18px));
    background-color: rgba(255, 255, 255, 1);
    -webkit-mask: url("star.svg") no-repeat center / contain;
    mask: url("star.svg") no-repeat center / contain;
    transform-origin: center;
    transition: none;
    opacity: 1;
}

/* 入口初态：先隐藏（避免三颗一起“大半透明”站着等） */
.node-star.pending {
    transform: translateY(-50px) scale(3.5);
    opacity: 0;
    transition: none;
}

/* 入场动画：从上往下飞入：极大半透明 -> 略大 -> 回正 */
@keyframes star-pop {
    0% {
        transform: translateY(-50px) scale(3.5);
        opacity: 0.1;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.node-star.reveal {
    animation: star-pop 900ms cubic-bezier(.16, .9, .28, 1) both;
}

.node-star.on {
    background-color: rgba(255, 153, 0, 1);
    -webkit-mask: url("star.svg") no-repeat center / contain;
    mask: url("star.svg") no-repeat center / contain;
    opacity: 1;
}

/* 当前关更亮一点 */
.path-node.state-current .node-star {
    background-color: rgba(255, 255, 255, 1);
}

/* 播星期间（star-focus）星星保持高亮色，不用白色 */
.path-node.state-current.star-focus .node-star {
    background-color: rgba(255, 153, 0, 1);
}

/* 同步滑移时：隐藏真实节点里的 label+stars，只显示 ghost */
.path-node.shifting .node-label,
.path-node.shifting .node-stars {
    opacity: 0;
}

/* 同步滑移时：隐藏真实节点（圆也隐藏），只显示 ghost */
.path-node.shifting {
    opacity: 0;
}

/* ghost：只承载 label+stars，不画圆 */
.node-ghost {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 50;
    width: var(--node-d, 56px);
    height: var(--node-d, 56px);
    will-change: left, top, transform, opacity;
}

.node-ghost::before,
.node-ghost::after {
    animation: none !important;
    opacity: 0 !important;
    box-shadow: none !important;
}

/* ghost 里的星星位置继承 node-stars 的绝对定位 */
.node-ghost .node-stars {
    pointer-events: none;
}

.tips {
    position: absolute;
    width: 300px;
    height: 63px;
    left: 100px;
    top: 27%;
    margin: -50px 0 0 -100px;
}

.op {
    display: flex;
    flex-direction: column;
    /* 上下排列 */
    align-items: flex-end;
    /* 右对齐 */
    justify-content: flex-start;
    gap: clamp(6px, 1.8vmin, 10px);

    flex-wrap: wrap;

    padding: 0 clamp(6px, 2vmin, 18px);
    /* background: rgba(255, 255, 255, 0.15); */
    /* border: 1px solid rgba(0, 0, 0, 0.06); */
    /* backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px); */
}


.wx {
    position: absolute;
    width: 300px;
    height: 24px;
    left: 100px;
    top: 92%;
    margin: -50px 0 0 -100px;
}

a {
    text-decoration: none;
}

.button {
    --btn-fg: rgba(102, 152, 97, 1);
    --btn-bg: rgba(102, 152, 97, .3);
    --btn-border: rgba(102, 152, 97, 1);
    --btn-hover-fg: #fff;
    --btn-hover-bg: rgba(102, 152, 97, 1);
    --btn-hover-border: rgba(102, 152, 97, 1);
    --btn-lh: 1.2;
    --btn-h: calc(1em * var(--btn-lh) + (var(--btn-py) * 2) + 2px);
    box-sizing: border-box;
    line-height: var(--btn-lh);

    border-radius: clamp(24px, 6vmin, 32px);
    font-size: clamp(14px, 4.5vmin, 24px);

    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);

    justify-content: center;
    display: inline-flex;
    align-items: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 140ms ease, filter 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
    pointer-events: auto;
}

/* 确认态：hover 仍保留浮起/阴影，但不改变背景色（不“染”到 gr-text） */
#shareBtn.is-confirm,
#gameReset.is-confirm {
    --btn-hover-fg: var(--btn-fg);
    --btn-hover-bg: var(--btn-bg);
    --btn-hover-border: var(--btn-border);
}

@media (hover: hover) and (pointer: fine) {
    .button:hover {
        color: var(--btn-hover-fg);
        background-color: var(--btn-hover-bg);
        border-color: var(--btn-hover-border);
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
        transform: translateY(-1px);
    }
}

/* 移动端/按下反馈（PC 也有效） */
.button:active {
    transform: translateY(0) scale(0.98);
    filter: brightness(0.96);
}

/* 键盘可达（PC） */
.button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.map-header {
    padding: clamp(10px, 2.6vmin, 14px) clamp(14px, 4vmin, 22px);
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.06);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}

.map-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.map-level {
    margin: 0 5px 0 0;
    text-align: right;
    white-space: nowrap;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    line-height: 1;

    font-size: clamp(12px, 3.5vmin, 24px);
    color: #555;
}

.map-level b {
    color: #ff9900;
    font-size: clamp(18px, 4vmin, 32px);
    font-weight: 800;

    display: inline-block;
    line-height: 1;
    transform: translateY(-0.06em);
}

.map-header,
.op {
    width: min(var(--map-max-w), 100%);
    box-sizing: border-box;
    border-radius: clamp(18px, 4.8vmin, 22px);
    pointer-events: none;
    /* 允许点击穿透 */
}

.map-howto {
    margin-top: clamp(6px, 1.8vmin, 10px);
    font-size: clamp(12px, 3.5vmin, 24px);
    line-height: 1.5;
    color: #666;
}

#shareBtn.button,
#gameReset.button,
#moreBtn.button {
    padding: 0;
    height: var(--btn-h);
    max-width: 100%;
    align-items: center;
    justify-content: center;
}

#gameReset .gr-default {
    box-sizing: border-box;
    padding: var(--btn-py) var(--btn-px) var(--btn-py) calc(var(--btn-px) + 5px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

#moreBtn .gr-default {
    box-sizing: border-box;
    padding: var(--btn-py) var(--btn-px) var(--btn-py) calc(var(--btn-px) - 2px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

#gameReset .gr-confirm,
#shareBtn .gr-default,
#shareBtn .gr-confirm,
#moreBtn .gr-confirm {
    box-sizing: border-box;
    padding: var(--btn-py) var(--btn-px);
    height: 100%;
    display: flex;
    align-items: center;
    max-width: 100%;
    justify-content: center;
}

#gameReset .gr-confirm,
#shareBtn .gr-confirm {
    justify-content: space-between;
    padding: 0 clamp(6px, 2vmin, 8px);
    gap: 6px;
    position: relative;
}

/* subtle continuous width-like pulse for gameReset (height unchanged) */
:root {
    --pl-jump-1: 1px;
    --pl-jump-2: 2px;
    --pl-jump-3: 3px;
    --pl-jump-4: 4px;
    --pl-jump-6: 6px;
}

@keyframes pl-jump {
    0% {
        padding-left: 0;
    }

    30% {
        padding-left: var(--pl-jump-2);
    }

    50% {
        padding-left: var(--pl-jump-1);
    }

    60% {
        padding-left: var(--pl-jump-3);
    }

    70% {
        padding-left: var(--pl-jump-6);
    }

    80% {
        padding-left: var(--pl-jump-4);
    }

    100% {
        padding-left: var(--pl-jump-1);
    }
}

/* 作用于外层按钮以确保能在默认/确认两态可见 */
.button#gameReset {
    will-change: transform;
    transform-origin: center;
}

/* 通用脉冲类，可应用于任意按钮；保留对高度的不变性 */
.button.pulse {
    will-change: transform, padding-left;
    transform-origin: center;
    animation: pl-jump 2000ms ease-in-out infinite;
    animation-fill-mode: both;
}

#gameReset .gr-text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    /* 不用省略号 */
    font-size: clamp(12px, 3.8vmin, 18px);
}

/* 文案自动“横向压缩”适配宽度（不影响高度） */
#gameReset .gr-text .gr-text-inner {
    display: inline-block;
    transform-origin: left center;
    will-change: transform;
}

#shareBtn .gr-actions,
#gameReset .gr-actions {
    display: flex;
    flex: 0 0 auto;
    gap: clamp(4px, 1.2vmin, 6px);
    flex-wrap: nowrap;
    white-space: nowrap;
}


#shareBtn .gr-btn,
#gameReset .gr-btn {
    font-size: clamp(12px, 3.8vmin, 18px);
    padding: clamp(6px, 1vmin, 8px) clamp(8px, 3vmin, 14px);
}

.gr-ok,
.gr-cancel,
.share-cancel {
    border: 0;
    color: rgba(255, 255, 255, 0.9);
}

.gr-cancel {
    background: rgba(150, 150, 150, .25);
}

.share-cancel {
    background: rgba(150, 150, 150, .25);
    margin-left: clamp(10px, 3vmin, 14px);
}

#begin {
    /* 第一层是半透明遮罩，第二层是图片 */
    background-image: linear-gradient(rgba(200, 200, 200, 0.45), rgba(200, 200, 200, 0.75)), url("bg01.jpg");
    background-repeat: repeat, repeat;
    background-position: 0 0, 0 0;
    background-size: auto, auto;

    /* 进场/退场时长可复用变量 */
    --begin-out-ms: 520ms;
    --begin-in-ms: 520ms;
    --begin-out-delay-pts: 160ms;
    /* pts 等元素比 header/op 晚消失 */
    --begin-in-delay-head: 140ms;
    /* header/op 比 pts 晚飞入 */

    /* 关键：补齐 easing 变量，否则 animation 失效 */
    --begin-ease-out: cubic-bezier(.18, .7, .2, 1);
    --begin-ease-in: cubic-bezier(.16, .9, .28, 1);
}


/* 离场：header/op 先飞出 */
#begin.is-leaving .map-header {
    animation: begin-header-out var(--begin-out-ms) var(--begin-ease-out) both;
}

#begin.is-leaving .op {
    animation: begin-op-out var(--begin-out-ms) var(--begin-ease-out) both;
}

/* 离场：pts 等元素晚一点消失 */
#begin.is-leaving #beginDecor,
#begin.is-leaving #beginNodes {
    animation: begin-others-out var(--begin-out-ms) var(--begin-ease-out) both;
    animation-delay: var(--begin-out-delay-pts);
}

/* 退场：先显示 pts，再飞入 header/op */
#begin.is-entering #beginDecor,
#begin.is-entering #beginNodes {
    animation: begin-others-in 260ms var(--begin-ease-in) both;
    animation-delay: 0ms;
}

#begin.is-entering .map-header {
    animation: begin-header-in var(--begin-in-ms) var(--begin-ease-in) both;
    animation-delay: var(--begin-in-delay-head);
}

#begin.is-entering .op {
    animation: begin-op-in var(--begin-in-ms) var(--begin-ease-in) both;
    animation-delay: var(--begin-in-delay-head);
}

/* 更明显的飞出 */
@keyframes begin-header-out {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }

    60% {
        transform: translate3d(0, -36px, 0) scale(1.02);
        opacity: 0.75;
    }

    100% {
        transform: translate3d(0, -80px, 0) scale(0.98);
        opacity: 0;
    }
}

@keyframes begin-op-out {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }

    60% {
        transform: translate3d(0, 36px, 0) scale(1.02);
        opacity: 0.75;
    }

    100% {
        transform: translate3d(0, 90px, 0) scale(0.98);
        opacity: 0;
    }
}

/* 更明显的飞入 + 回弹 */
@keyframes begin-header-in {
    0% {
        transform: translate3d(0, -90px, 0) scale(0.98);
        opacity: 0;
    }

    55% {
        transform: translate3d(0, 30px, 0) scale(1.03);
        opacity: 1;
    }

    78% {
        transform: translate3d(0, -15px, 0) scale(0.99);
        opacity: 1;
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }
}

@keyframes begin-op-in {
    0% {
        transform: translate3d(0, 96px, 0) scale(0.98);
        opacity: 0;
    }

    55% {
        transform: translate3d(0, -30px, 0) scale(1.03);
        opacity: 1;
    }

    78% {
        transform: translate3d(0, -15px, 0) scale(0.99);
        opacity: 1;
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }
}

@keyframes begin-others-out {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate3d(0, 8px, 0) scale(0.98);
        opacity: 0;
    }
}

@keyframes begin-others-in {
    0% {
        transform: translate3d(0, 10px, 0) scale(0.98);
        opacity: 0;
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }
}

/* 确保可见 */
#begin.is-leaving .map-header,
#begin.is-leaving .op,
#begin.is-entering .map-header,
#begin.is-entering .op {
    will-change: transform, opacity;
}

#beginDecor {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 横屏/矮屏：收敛说明区，避免顶/底卡片挤占高度 */
@media (max-height: 420px) {

    /* .map-howto {font-size: 12px; } */
    .center-box {
        padding-top: calc(8px + env(safe-area-inset-top));
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .map-header {
        padding: 8px 10px;
    }

    .op {
        padding: 8px 10px;
    }
}

#shareBtn .gr-text {
    position: absolute;
    left: clamp(12px, 4vmin, 20px);
    /* 水平位置，可调 */
    top: 0;
    /* 压在上边框 */
    transform: translateY(-100%);
    /* 往上抬，让它压在边框上 */
    padding: 2px 8px;
    line-height: 1.05;
    font-size: clamp(12px, 3.2vmin, 14px);

    /* 关键：遮住边框，形成“压住”效果 */
    background: rgba(102, 152, 97, .9);
    color: #fff;
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

#shareBtn #btnShareTo {
    display: flex;
    gap: clamp(4px, 1.2vmin, 6px);
    flex-wrap: wrap;
    justify-content: flex-end;
}

#shareBtn .gr-btn-shareTo {
    font-size: clamp(12px, 3.8vmin, 14px);
    padding: 4px clamp(8px, 2.5vmin, 12px);
    border-radius: 999px;
    border: 0;
    background: rgba(102, 152, 97, .45);
    color: rgba(255, 255, 255, .95);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

#shareBtn #btnShareWeibo,
#shareBtn #btnShareTwitter,
#shareBtn #btnShareFacebook,
#shareBtn #btnShareWechat {
    width: clamp(28px, 8vmin, 42px);
    height: clamp(28px, 8vmin, 42px);
    padding: 0;
    font-size: 0;
    color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60% 60%;
}

#shareBtn #btnShareWeibo {
    background-image: url("/assets/icons/weibo.svg");
}

#shareBtn #btnShareTwitter {
    background-image: url("/assets/icons/x.svg");
}

#shareBtn #btnShareFacebook {
    background-image: url("/assets/icons/facebook.svg");
}

#shareBtn #btnShareWechat {
    background-image: url("/assets/icons/wechat.svg");
}

@media (hover:hover) and (pointer:fine) {
    #shareBtn .gr-btn-shareTo:hover {
        background: rgba(102, 152, 97, .75);
    }
}

#shareBtn .gr-btn-shareTo:active {
    transform: scale(.98);
    filter: brightness(.96);
}