/* =============================
 * WebView 最稳最终版 style.css（无 CSS 变量）
 * 目标：Android 4.x+ / 老 WebView / 国产 ROM / 内嵌浏览器 更稳
 * 处理点：
 * 1) 不使用 CSS 变量
 * 2) flex gap 降级为 margin（老 WebView 不支持 gap）
 * 3) 统一资源路径为相对路径（避免 /static 在 file:// / 子路径部署下 404）
 * 4) webp 提供 png fallback（老 WebView 可能不支持 webp）
 * 5) vh 提供百分比兜底（老 WebView vh 可能抖动）
 * ============================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* vh 兜底：老 WebView 对 100vh 可能不准 */
html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;

  background-color: #000000;
  color: #ffffff;

  background-repeat: no-repeat;
  background-position: center top;
  background-size: auto 100%;
}

.page-wrapper {
  /* vh 兜底 */
  min-height: 100%;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
}

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-left-logo img {
  width: 100%;
  height: 100%;
}

.header-left-title-container {
  margin-left: 10px;
}

.header-left-title {
  font-size: 23px;
  font-weight: bold;
  line-height: 1.3;
}

.header-left-sub {
  margin-top: 4px;
  font-size: 13px;
  color: #cccccc;
}

.header-right {
  text-align: center;
  font-size: 12px;
  color: #ffffff;
}

.header-right .link-hezuo {
  display: block;
  width: 120px;
  height: 50px;
  margin: 0 auto;
}

.header-right img {
  width: 100%;
  height: 100%;
}

/* 主体布局 */
.main-layout {
  display: flex;
}

.main-layout-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.main-layout-right {
  text-align: center;
}

/* PC 二维码 */
.pc-qrcode-container {
  display: none;
  margin: 0 auto;
  margin-top: 50px;
  border: 2px dashed #ffffff;
  border-radius: 16px;
  padding: 16px 20px;
}

.pc-qrcode {
  width: 150px;
  height: 150px;
  background-color: #ffffff;
}

.pc-platform-text {
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
}

/* Mobile 下载区 */
.mobile-downlaod-container {
  display: none;
}

.btn-mobile-downlaod {
  text-decoration: none;
  background-image: url("../static/img/download.png");
  height: 49px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: auto 100%;
  margin-bottom: 20px;
}

.content-tip {
  margin-top: 20px;
  font-size: 12px;
  color: #ffffff;
}

.content-tip p {
  line-height: 1.5;
  text-align: center;
}

/* ========= 响应式控制 ========= */

@media (max-width: 1023px) {
  body {
    background-image: url("../static/img/bg-phone.jpg");
  }

  .page-wrapper {
    padding: 16px;
  }

  .header-left-logo {
    width: 52px;
    height: 52px;
  }

  .main-layout {
    margin-top: 30px;

    /* 老 WebView 不支持 gap：用 margin 降级 */
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
  }

  .main-layout > * {
    margin-top: 30px;
  }

  .main-layout > *:first-child {
    margin-top: 0;
  }

  .mobile-downlaod-container {
    display: block;
  }
}

@media (min-width: 1024px) {
  body {
    background-image: url("../static/img/bg-pc.png");
  }

  .page-wrapper {
    padding: 24px 5%;
    justify-content: space-between;
  }

  .header-left-logo {
    width: 70px;
    height: 70px;
  }

  .main-layout {
    flex-direction: row;
    justify-content: space-between;
  }

  .pc-qrcode-container {
    display: block;
  }
}

/* ========= 通用弹窗 ========= */

.dialog-mask {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;

  background: rgba(0, 0, 0, 0.6);
  display: none;

  align-items: center;
  justify-content: center;

  z-index: 1000;
}

.dialog {
  width: 82%;
  max-width: 360px;

  background: #ffffff;
  border-radius: 16px;
  padding: 18px 18px 20px;

  color: #333333;
  position: relative;
}

.dialog-close {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 18px;
  cursor: pointer;
}

.dialog-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.dialog-section {
  background: #e9f3ff;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
}

.dialog-section p {
  margin-bottom: 8px;
}

.dialog-section-btn {
  display: block;
  width: 100%;
  text-align: center;

  height: 36px;
  line-height: 36px;

  border-radius: 8px;
  border: none;

  background: #4a8dff;
  color: #ffffff;

  font-size: 14px;
  cursor: pointer;
}

.dialog-section-btn.secondary {
  background: #ff0b7a;
}

/* ========= 安装教程弹窗 ========= */

.tutorial-dialog {
  width: 92%;
  max-width: 420px;
}

.tutorial-body {
  /* vh 兜底 */
  max-height: 70%;
  max-height: 70vh;

  overflow-y: auto;
  font-size: 14px;
}

.tutorial-body img {
  width: 100%;
  display: none;
}
