/* NAV 04｜线路弹层、菜单面板、遮罩 */
/* PC：线路面板高于游戏区；弹层位于触发卡片上方并保持在触发区域内 */
.quick-actions { position: relative; z-index: 40; isolation: isolate; }
.quick-enter { position: relative; z-index: 1; }
.quick-enter.is-open { z-index: 1000; border-color: #c9a16c; }
.games-section { position: relative; z-index: 0; }
.route-popover {
    display: none;
    position: absolute;
    z-index: 1001;
    top: auto;
    /* 与触发卡片无缝衔接：鼠标从卡片移入面板时不会穿过空隙触发关闭 */
    bottom: calc(100% - 2px);
    left: 0;
    transform: none;
    width: min(520px, calc(100vw - 64px));
    max-height: min(72vh, 460px);
    overflow-y: auto;
    pointer-events: auto;
    overscroll-behavior: contain;
    padding: 17px;
    border: 1px solid rgba(207,177,137,.72);
    border-radius: 18px;
    background: rgba(255,253,249,.97);
    box-shadow: 0 18px 48px rgba(29,35,42,.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.quick-enter.is-open .route-popover { display: block; }
.route-popover::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: rgba(255,253,249,.97);
    border-right: 1px solid rgba(207,177,137,.72);
    border-bottom: 1px solid rgba(207,177,137,.72);
    transform: translateX(-50%) rotate(45deg);
}
.route-popover-title { margin: 0 0 9px; color: #173b60; font-family: "Noto Serif CJK SC", "Songti SC", serif; font-size: 17px; }
.route-list { display: flex; flex-direction: column; gap: 8px; }
.route-row { min-height: 52px; display: grid; grid-template-columns: 84px 1fr 70px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #efe4d5; border-radius: 12px; background: #fcfaf6; }
.route-name { color: #198a71; font-size: 13px; white-space: nowrap; }
.route-description { color: #24425d; font-size: 14px; }
.route-go { min-width: 64px; padding: 8px 12px; border: 0; border-radius: 99px; color: #fff; background: var(--color-blue); cursor: pointer; }
.menu-backdrop, .route-backdrop { position: fixed; z-index: calc(var(--overlay-z) - 1); inset: 0; visibility: hidden; opacity: 0; background: rgba(17,27,39,.24); backdrop-filter: blur(3px); transition: opacity .25s ease, visibility .25s ease; }
.site-menu { position: fixed; z-index: var(--overlay-z); top: 0; right: 0; width: min(390px, 88vw); height: 100dvh; padding: 24px; transform: translateX(105%); transition: transform .28s ease; background: rgba(255,253,249,.91); border-left: 1px solid rgba(255,255,255,.7); box-shadow: -20px 0 55px rgba(20,30,40,.16); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.site-menu.is-open { transform: translateX(0); }
.menu-backdrop.is-open, .route-backdrop.is-open { visibility: visible; opacity: 1; }
.site-menu-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; margin-bottom: 12px; border-bottom: 1px solid var(--color-line); color: #173b60; font-family: "Noto Serif CJK SC", "Songti SC", serif; font-size: 20px; }
.menu-close, .sheet-close { width: 38px; height: 38px; border: 0; border-radius: 50%; color: #5e4a32; background: #f3eee6; font-size: 25px; cursor: pointer; }
.menu-item { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; margin: 8px 0; border: 1px solid rgba(224,210,190,.8); border-radius: 13px; color: #24425d; background: rgba(255,255,255,.6); }
.menu-item b { color: #b18a58; font-size: 21px; font-weight: 400; }
.menu-login { color: #fff; background: #12385d; border-color: #12385d; }
.menu-login b { color: #f2dcae; }
.site-menu-note { position: absolute; bottom: 28px; left: 24px; right: 24px; text-align: center; color: #aa9a86; font-size: 11px; letter-spacing: .1em; }
.mobile-route-sheet { position: fixed; z-index: var(--overlay-z); left: 0; right: 0; bottom: 0; max-height: 78dvh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .28s ease; background: rgba(255,253,249,.97); border-radius: 22px 22px 0 0; box-shadow: 0 -16px 45px rgba(20,30,40,.16); }
.mobile-route-sheet.is-open { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; color: #173b60; font-family: "Noto Serif CJK SC", "Songti SC", serif; font-size: 19px; }


/* NAV 06｜PC 线路选择确认版：固定居中模态层，避免卡片遮挡及页面位置判断 */
.desktop-route-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 31, 43, .30);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.desktop-route-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.desktop-route-dialog {
    width: min(520px, calc(100vw - 48px));
    max-height: min(78vh, 580px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px;
    border: 1px solid rgba(207,177,137,.78);
    border-radius: 22px;
    background: rgba(255,253,249,.98);
    box-shadow: 0 24px 76px rgba(18,31,45,.24);
    transform: translateY(9px) scale(.985);
    transition: transform .2s ease;
}
.desktop-route-overlay.is-open .desktop-route-dialog {
    transform: translateY(0) scale(1);
}
.desktop-route-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
    color: #173b60;
    font-family: "Noto Serif CJK SC", "Songti SC", serif;
    font-size: 22px;
}
.desktop-route-close {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #6b6258;
    background: #f3eee6;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.desktop-route-note {
    margin: 14px 2px 0;
    color: #a08f7b;
    font-size: 12px;
    text-align: center;
}
.desktop-route-dialog .route-list { gap: 9px; }
.desktop-route-dialog .route-row {
    min-height: 58px;
    grid-template-columns: 84px minmax(0,1fr) 70px;
    padding: 9px 12px;
    border-radius: 14px;
}
.desktop-route-dialog .route-description { overflow-wrap: anywhere; }
.desktop-route-close:focus-visible,
.desktop-route-dialog .route-go:focus-visible {
    outline: 2px solid #c8954d;
    outline-offset: 3px;
}
/* V8.7 不锁定 body，避免滚动条变化导致页面左右跳动 */

@media (max-width: 768px) {
    .desktop-route-overlay { display: none !important; }
}




/* V8.9 PC route panel: portal layer, right-side aligned, no layout shift */
@media (min-width: 769px) {
  .quick-actions { position: relative; }
  .quick-enter { position: relative; z-index: 1; }
  body.route-panel-open .quick-enter { z-index: 9001; }
  .route-focus-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    background: rgba(246,243,237,.08);
    -webkit-backdrop-filter: blur(2.5px);
    backdrop-filter: blur(2.5px);
    transition: opacity .16s ease, visibility .16s ease;
  }
  .route-focus-backdrop.is-visible { opacity: 1; visibility: visible; }
  body > .route-popover.route-popover-floating {
    display: block !important;
    position: fixed !important;
    z-index: 9002 !important;
    box-sizing: border-box !important;
    width: 410px !important;
    max-width: calc(100vw - 32px) !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 19px !important;
    left: 16px;
    top: 16px;
    right: auto !important;
    bottom: auto !important;
    border: 1px solid rgba(207,177,137,.78) !important;
    border-radius: 18px !important;
    background: rgba(255,253,249,.985) !important;
    box-shadow: 0 18px 48px rgba(29,35,42,.20) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  }
  body > .route-popover.route-popover-floating.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: opacity .16s ease, transform .16s ease, visibility 0s;
  }
  body > .route-popover.route-popover-floating::after {
    content: "";
    position: absolute;
    left: -7px;
    top: var(--route-arrow-top, 50%);
    bottom: auto;
    width: 12px;
    height: 12px;
    background: rgba(255,253,249,.985);
    border-left: 1px solid rgba(207,177,137,.78);
    border-bottom: 1px solid rgba(207,177,137,.78);
    transform: translateY(-50%) rotate(45deg);
  }
  body > .route-popover.route-popover-floating .route-list { gap: 9px; }
  body > .route-popover.route-popover-floating .route-row { min-height: 54px; }
}
@media (max-width: 768px) {
  .route-focus-backdrop,
  body > .route-popover.route-popover-floating { display: none !important; }
}

@media (min-width: 769px) {
  body > .route-popover.route-popover-floating.opens-left::after {
    left: auto;
    right: -7px;
    border-left: 0;
    border-bottom: 0;
    border-right: 1px solid rgba(207,177,137,.78);
    border-top: 1px solid rgba(207,177,137,.78);
  }
}


/* V8.10 responsive PC route panel: final override, viewport-aware dimensions */
@media (min-width: 769px) {
  body > .route-popover.route-popover-floating {
    display: block !important;
    position: fixed !important;
    box-sizing: border-box !important;
    width: 410px;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    max-height: min(78vh, 520px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    top: 16px;
    left: 16px;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-6px);
    z-index: 9002 !important;
  }
  body > .route-popover.route-popover-floating.is-visible {
    transform: translateX(0);
  }
  body > .route-popover.route-popover-floating.is-measuring {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  body > .route-popover.route-popover-floating.opens-left::after {
    left: auto !important;
    right: -7px !important;
    border-left: 0 !important;
    border-bottom: 0 !important;
    border-right: 1px solid rgba(207,177,137,.78) !important;
    border-top: 1px solid rgba(207,177,137,.78) !important;
  }
}
