/* 为移动端版式：10rem 占满页面，500px 以上固定为 500px。 */
:root {
  --page-background: rgba(240, 243, 247, 1);
  --footer-background: rgba(97, 140, 233, .97);
  --tool-color: #1577fe;
  --bubble-background: #ea4e3d;
}
:where(html.home-page), :where(body.home-page), :where(.home-page) *, :where(.home-page) *::before, :where(.home-page) *::after { box-sizing: border-box; margin: 0; padding: 0; }
html.home-page { font-size: 10vw; }
@media (min-width: 500px) { html.home-page { font-size: 50px; } }
html.home-page, body.home-page { min-height: 100%; }
body.home-page {
  background: #f5f8fa;
  color: #202124;
  font-size: .346667rem;
  line-height: 1.4286;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
:where(body.home-page) a { text-decoration: none; color: inherit; }
:where(body.home-page) button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
:where(body.home-page) button, :where(body.home-page) a { -webkit-tap-highlight-color: transparent; }
:where(body.home-page) button:focus-visible, :where(body.home-page) a:focus-visible { outline: 3px solid #202124; outline-offset: 3px; }
:where(body.home-page) img { display: block; max-width: 100%; border: 0; pointer-events: none; }
.home-page::-webkit-scrollbar, .home-page ::-webkit-scrollbar { width: .053333rem; height: .053333rem; }
.home-page::-webkit-scrollbar-thumb, .home-page ::-webkit-scrollbar-thumb { background: #c0c4cc; border-radius: .026667rem; }
.home-page::-webkit-scrollbar-track-piece, .home-page ::-webkit-scrollbar-track-piece { background: transparent; }
.home-page::-webkit-scrollbar-button, .home-page ::-webkit-scrollbar-button, .home-page::-webkit-scrollbar-corner, .home-page ::-webkit-scrollbar-corner { display: none; }
#page-view { position: relative; width: 100%; max-width: 500px; margin: 0 auto; }
.page-content { width: 100%; padding-bottom: 1.6rem; background: var(--page-background); }
.picture { display: block; width: 100%; }
.picture img { width: 100%; height: auto; }

/* 两张游戏截图：使用 4 秒自动切换的全宽轮播。 */
.carousel { position: relative; width: 100%; aspect-ratio: 750 / 380; overflow: hidden; touch-action: pan-y; user-select: none; }
.carousel-track { display: flex; height: 100%; transform: translateX(-100%); transition: transform 500ms ease; }
.carousel-slide { flex: 0 0 100%; width: 100%; height: 100%; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-indicators { position: absolute; left: 50%; bottom: .32rem; display: flex; gap: .16rem; transform: translateX(-50%); }
.carousel-dot { width: .16rem; height: .16rem; border-radius: 50%; background: #ebedf0; opacity: .3; }
.carousel-dot[aria-current="true"] { background: #1989fa; opacity: 1; }
.carousel-dot::after { content: ""; display: block; width: 22px; height: 22px; transform: translate(-8px, -8px); }

/* 配置 styleType=1：底栏只显示游戏/下载两按钮，不显示 title。 */
.download-footer {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  display: flex; align-items: center; align-content: center; flex-wrap: wrap;
  width: 100%; max-width: 500px; height: 1.6rem; z-index: 99;
  background: var(--footer-background); color: #fff; letter-spacing: .026667rem;
}
.footer-button {
  position: relative; display: flex; align-items: center; justify-content: center; flex: 1;
  height: .906667rem; margin: 0 .253333rem; padding: 0 .253333rem;
  border-radius: .213333rem; text-align: center;
}
.footer-button.play { background: rgba(62, 185, 13, 1); }
.footer-button.download { background: #ffaa09; }
.footer-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-bubble {
  position: absolute; right: 0; bottom: 1.013333rem;
  max-width: calc(100% - .253333rem); padding: .16rem .253333rem;
  border-radius: .213333rem; background: var(--bubble-background);
  color: #fff; font-size: .293333rem; white-space: normal; word-break: break-all;
}
.footer-bubble::before {
  content: ""; position: absolute; left: 0; bottom: -.186667rem;
  width: 0; height: 0; border: .32rem solid transparent;
  border-left-color: var(--bubble-background);
}

/* 固定客服；教程按钮只在 iOS / macOS 出现。 */
.fixed-tools { position: fixed; top: 3.2rem; right: max(calc(50vw - 250px + .133333rem), .133333rem); z-index: 100; }
.tool-button {
  display: block;
  width: 1.333333rem; height: 1.333333rem; margin-top: .253333rem;
  border: .053333rem solid var(--tool-color); border-radius: 30%;
  background: rgba(255, 255, 255, .7); color: var(--tool-color);
  text-align: center; font-size: .24rem; line-height: .293333rem;
}
.tool-icon { display: inline-block; width: .56rem; height: .56rem; margin-top: .186667rem; fill: currentColor; overflow: hidden; }
.tool-label { display: block; font-size: .24rem; line-height: .293333rem; }
[hidden] { display: none !important; }

/* 本地弹窗不依赖原站接口；外部链接只在用户选择之后打开。 */
:where(body.home-page) dialog {
  width: 8.8rem; max-width: calc(100vw - .8rem); max-height: calc(100dvh - 1rem);
  margin: auto; padding: .506667rem; overflow: auto;
  border: 0; border-radius: .213333rem; background: #fff; color: #202124;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}
:where(body.home-page) dialog::backdrop { background: rgba(0, 0, 0, .4); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .253333rem; margin-bottom: .253333rem; }
.dialog-title { font-size: .453333rem; font-weight: 600; }
.dialog-close { flex: 0 0 .8rem; height: .8rem; font-size: .6rem; line-height: 1; color: #5f6368; }
/* 线路弹窗沿用截图的行布局；ms 表示浏览器 HTTP 请求耗时，不是 ICMP ping。 */
#lines-dialog {
  width: 8.8rem; padding: .253333rem;
  border: 1px solid #fff; border-radius: .213333rem;
  background: rgba(142, 193, 241, .96); color: #fff;
  overflow-x: hidden; overflow-y: auto;
}
#lines-dialog .line-dialog-title {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#lines-dialog .line-list { list-style: none; }
#lines-dialog .line-item { display: flex; align-items: center; height: 1.2rem; }
#lines-dialog .line-signal { flex: 0 0 .8rem; text-align: center; line-height: .32rem; }
#lines-dialog .line-bars { position: relative; width: .8rem; }
#lines-dialog .line-bar {
  display: inline-block; width: 4px; height: 16px;
  margin: 0 2px; border-radius: 2px; background: #04be02;
}
#lines-dialog .line-bar:nth-child(1) { height: 8px; }
#lines-dialog .line-bar:nth-child(2) { height: 12px; }
#lines-dialog .line-latency { color: #04be02; font-size: .293333rem; white-space: nowrap; }
#lines-dialog .line-signal[data-state="pending"] .line-bar { background: #969799; }
#lines-dialog .line-signal[data-state="pending"] .line-latency { color: #969799; }
#lines-dialog .line-signal[data-state="error"] .line-bar,
#lines-dialog .line-signal[data-state="timeout"] .line-bar { background: #ea4e3d; }
#lines-dialog .line-signal[data-state="error"] .line-latency,
#lines-dialog .line-signal[data-state="timeout"] .line-latency { color: #ea4e3d; }
#lines-dialog .line-name { flex: 1; overflow: hidden; padding: 0 .506667rem; font-size: .346667rem; text-align: center; }
#lines-dialog .line-link {
  display: flex; flex-shrink: 0; align-items: center; justify-content: center;
  height: .8rem; padding: 0 .32rem; border-radius: .213333rem;
  background: #1678ff; color: #fff; font-size: .293333rem;
}
.download-status { position: fixed; left: 50%; bottom: 1.85rem; transform: translateX(-50%); z-index: 101; width: min(92vw, 460px); padding: .24rem .32rem; border-radius: .16rem; background: #fff; color: #202124; font-size: .293333rem; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.tutorial-image { width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .carousel-track { transition: none; } }
