﻿/* ==========================================================================
   咸池 · OmniaBasin 下载页样式
   设计基调：品牌蓝 #0574F8 → #08A8F0，浅蓝留白 + 白色卡片
   ========================================================================== */

/* ---------- 1. 重置与变量 ---------- */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand-1: #0574F8;
  --brand-2: #08A8F0;
  --brand-grad: linear-gradient(135deg, #0574F8 0%, #08A8F0 100%);
  --brand-soft: #EAF4FF;

  --ink: #0F1B2D;
  --ink-2: #43506A;
  --muted: #62708A;
  --muted-2: #5A6880;
  --brand-link: #0560D4;

  --bg: #F2F8FD;
  --card: #FFFFFF;
  --line: rgba(15, 27, 45, .07);
  --line-strong: rgba(15, 27, 45, .12);

  --warn-bg: #FFF8E8;
  --warn-line: #FFE3AC;
  --warn-ink: #8A5B00;

  --radius: 18px;
  --shadow-sm: 0 2px 8px rgba(16, 58, 120, .05);
  --shadow: 0 6px 20px rgba(16, 58, 120, .07);
  --shadow-lg: 0 14px 34px rgba(5, 116, 248, .16);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

a { color: var(--brand-link); text-decoration: none; }

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 2. 背景光晕 ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(8, 168, 240, .20), transparent 62%),
    radial-gradient(80% 45% at 6% 2%, rgba(5, 116, 248, .13), transparent 58%),
    linear-gradient(180deg, #F5FBFF 0%, #F2F8FD 45%, #F7FAFE 100%);
}

/* ---------- 3. 布局 ---------- */
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
}

/* 移动端显式给足顶部间距与模块间距，不依赖桌面端媒体查询兜底 */
.page {
  padding-top: 20px;
  /* 移动端两列纵向堆叠，必须用 flex 才能产生列间距；
     否则 .col-a 与 .col-b 之间 gap 不生效，小程序卡片会紧贴平台卡片 */
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.col-a, .col-b { display: flex; flex-direction: column; gap: 24px; }
.col-a { gap: 18px; }

/* ---------- 4. 头部 ---------- */
.hero {
  padding: 14px 0 6px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(5, 116, 248, .26);
}

.brand-text { text-align: left; }

.brand-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.brand-en {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--muted);
}

.ver {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(5, 116, 248, .09);
  color: var(--brand-link);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.tagline {
  margin: 18px auto 0;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ---------- 5. 微信环境提示 ---------- */
.wx-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--warn-line);
  border-radius: 14px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 12.5px;
  line-height: 1.6;
}

.wx-note svg { flex: 0 0 auto; margin-top: 1px; }

.wx-note b { font-weight: 700; }

/* ---------- 6. 平台卡片 ---------- */
.plats {
  display: grid;
  gap: 12px;
}

.plat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.plat-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plat-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-1);
}

.plat-icon svg { width: 23px; height: 23px; }

.plat-text { flex: 1 1 auto; min-width: 0; }

.plat-text .plat-name {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.plat-text p {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}

.plat-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

/* 被识别为主平台：进阶为默认主卡片（由 html 上的平台类驱动，首帧即生效） */
.plat.is-primary,
html.is-ios #platIos,
html.is-android #platAndroid,
html.is-harmony #platHarmony {
  padding: 18px;
  border-color: rgba(5, 116, 248, .28);
  box-shadow: var(--shadow-lg);
}

.plat.is-primary .plat-icon,
html.is-ios #platIos .plat-icon,
html.is-android #platAndroid .plat-icon,
html.is-harmony #platHarmony .plat-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 6px 14px rgba(5, 116, 248, .3);
}

.plat.is-primary .plat-text .plat-name,
html.is-ios #platIos .plat-text .plat-name,
html.is-android #platAndroid .plat-text .plat-name,
html.is-harmony #platHarmony .plat-text .plat-name { font-size: 16.5px; }

.plat.is-primary .plat-actions,
html.is-ios #platIos .plat-actions,
html.is-android #platAndroid .plat-actions,
html.is-harmony #platHarmony .plat-actions { margin-top: 15px; }

.plat-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.plat-note a { font-weight: 600; }

/* ---------- 6.1 平台推荐排序（首帧即生效，无需等 JS） ---------- */

/*
 * HTML 里的固定顺序是 iOS → Android → 鸿蒙。
 * 这里用 order 把当前设备提到最前，CSS 先行完成，避免 JS 排序造成的布局跳动。
 */
.plats {
  display: grid;
  grid-template-areas: "ios" "android" "harmony";
}

#platIos { grid-area: ios; }
#platAndroid { grid-area: android; }
#platHarmony { grid-area: harmony; }

html.is-ios .plats { grid-template-areas: "ios" "android" "harmony"; }
html.is-android .plats { grid-template-areas: "android" "ios" "harmony"; }
html.is-harmony .plats { grid-template-areas: "harmony" "android" "ios"; }

/* 「当前设备」角标：显隐完全交给 CSS，避免 JS 首帧之后再显示造成跳动 */
.badge.js-current { display: none; }

html.is-ios #platIos .js-current,
html.is-android #platAndroid .js-current,
html.is-harmony #platHarmony .js-current { display: inline-block; }

/* 桌面端三端平铺，不显示「当前设备」 */
@media (min-width: 900px) {
  .badge.js-current { display: none !important; }
}

/* 桌面端不推荐，三个入口平铺 */
@media (min-width: 900px) {
  .plats { grid-template-areas: "ios" "android" "harmony"; }
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .22s var(--ease),
    background-color .22s var(--ease), border-color .22s var(--ease), opacity .2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.985); }

.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(5, 116, 248, .3);
}

.btn-primary:hover { box-shadow: 0 10px 26px rgba(5, 116, 248, .38); }

.btn-outline {
  background: #fff;
  border-color: rgba(5, 116, 248, .3);
  color: var(--brand-link);
}

.btn-outline:hover { background: rgba(5, 116, 248, .05); }

.btn-ghost {
  background: rgba(15, 27, 45, .035);
  border-color: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover { background: rgba(15, 27, 45, .06); }

/* 非主卡片：按钮平分、更紧凑 */
.plat:not(.is-primary) .plat-actions .btn { flex: 1 1 0; }
.plat:not(.is-primary) .plat-actions .btn + .btn { flex: 0 1 44%; }

html.is-ios #platIos .plat-actions .btn,
html.is-android #platAndroid .plat-actions .btn,
html.is-harmony #platHarmony .plat-actions .btn,
.plat.is-primary .plat-actions .btn {
  flex: 1 1 auto;
  height: 50px;
  border-radius: 14px;
  font-size: 15.5px;
}

/* 注意：只给「可点击」的主按钮上渐变，
   禁用态（如 iOS 未上架）必须保持灰色，不能被这条规则覆盖 */
.plat.is-primary .plat-actions .btn-primary:not(.is-disabled),
.plat.is-primary .plat-actions .btn-outline:first-child:not(.is-disabled) {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(5, 116, 248, .3);
}

.plat.is-primary .plat-actions .btn + .btn {
  flex: 0 0 42%;
  height: 50px;
}

html.is-ios #platIos .plat-actions .btn + .btn,
html.is-android #platAndroid .plat-actions .btn + .btn,
html.is-harmony #platHarmony .plat-actions .btn + .btn {
  flex: 0 0 42%;
  height: 50px;
}

/* iOS 未上架时的禁用态：优先级要压过 .plat.is-primary 的渐变规则 */
.plat .btn.is-disabled,
.plat .btn[aria-disabled="true"],
.btn.is-disabled,
.btn[aria-disabled="true"] {
  background: rgba(15, 27, 45, .05);
  background-image: none;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- 8. 小程序 ---------- */
.weapp-card {
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.weapp-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.weapp-head p {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}

.qr-box {
  width: 190px;
  margin: 16px auto 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.qr-box img { width: 100%; border-radius: 9px; }

.qr-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------- 9. 截图 ---------- */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sec-head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}

.shots-track {
  display: flex;
  gap: 12px;
  margin: 0 -20px;
  padding: 4px 20px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* 吸附点必须扣除左右内边距，否则首张图会被吸到滚动区最左侧，
     把 20px 的留白吃掉，导致截图贴屏幕边缘、与上方卡片对不齐 */
  scroll-padding-left: 20px;
  scroll-padding-right: 20px;
  /* 阻止横向滑动传导给页面，避免整页左右晃动 */
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.shots-track::-webkit-scrollbar { display: none; }

.shot {
  flex: 0 0 auto;
  width: 158px;
  scroll-snap-align: start;
}

.shot img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---------- 10. 功能 ---------- */
.features ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.features li {
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.f-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-1);
}

.f-icon svg { width: 17px; height: 17px; }

.features strong {
  display: block;
  margin-top: 9px;
  font-size: 13.5px;
  font-weight: 600;
}

.features p {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- 11. 页脚 ---------- */
.foot {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font-size: 12.5px;
}

.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--brand-1); }

.foot-icp, .foot-copy {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.foot-icp a { color: var(--muted); }
.foot-icp a:hover { color: var(--brand-1); }

/* ---------- 12. 微信引导浮层 ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 34, .52);
  backdrop-filter: blur(2px);
  animation: fade .22s var(--ease);
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--card);
  box-shadow: 0 -12px 40px rgba(8, 18, 34, .18);
  animation: rise .28s var(--ease);
}

.sheet-arrow {
  position: absolute;
  top: -2px;
  right: 22px;
  width: 54px;
  height: 54px;
  color: var(--brand-1);
  opacity: .85;
}

.sheet-panel h2 {
  font-size: 18px;
  font-weight: 700;
}

.sheet-panel > p {
  margin-top: 7px;
  font-size: 13px;
  color: var(--ink-2);
}

.sheet-steps {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.sheet-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
}

.step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-1);
  font-size: 12px;
  font-weight: 700;
}

.sheet-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 7px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.sheet-actions .btn {
  flex: 1 1 0;
  height: 46px;
  font-size: 14px;
}

.copy-state {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  text-align: center;
  color: #12924B;
}

/* ---------- 12.1 轻提示 ---------- */
.xc-toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: 88vw;
  padding: 11px 18px;
  border-radius: 99px;
  background: rgba(15, 27, 45, .9);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  pointer-events: none;
}

.xc-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(18px); opacity: .6; } }

/* ---------- 13. 桌面端 ---------- */
@media (min-width: 900px) {
  .wrap {
    max-width: 1060px;
    padding: 0 32px calc(32px + env(safe-area-inset-bottom));
  }

  .page {
    display: grid;
    grid-template-columns: minmax(380px, 420px) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
    padding-top: 24px;
  }

  .hero { padding-top: 0; text-align: left; }
  .brand { justify-content: flex-start; }
  .tagline { margin-left: 0; margin-right: 0; max-width: none; }

  .col-a { gap: 16px; }
  .col-b { gap: 24px; }

  /* 截图在桌面端改为两行网格，避免拖出一条长长的横向滚动区 */
  .shots-track {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 4px 0 0;
    overflow: visible;
  }

  .shot { width: auto; }
  .shot img { border-radius: 12px; }

  .features ul { gap: 12px; }

  .sheet { align-items: center; }
  .sheet-panel { border-radius: 22px; max-width: 440px; }
  .sheet-arrow { display: none; }
}

/* 大屏：截图恢复为更舒展的两列功能 + 更大的卡片间距 */
@media (min-width: 1200px) {
  .wrap { max-width: 1180px; }
  .page { grid-template-columns: minmax(420px, 460px) minmax(0, 1fr); gap: 56px; }
}

/* ---------- 14. 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E9EFF8;
    --ink-2: #B4C1D4;
    --muted: #8494AB;

    --bg: #0B1220;
    --card: #141D2C;
    --line: rgba(233, 239, 248, .09);
    --line-strong: rgba(233, 239, 248, .16);
    --brand-soft: rgba(5, 116, 248, .17);

    --warn-bg: rgba(255, 196, 66, .10);
    --warn-line: rgba(255, 196, 66, .28);
    --warn-ink: #F2C567;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow: 0 6px 20px rgba(0, 0, 0, .34);
    --shadow-lg: 0 14px 34px rgba(0, 0, 0, .44);
  }

  .bg-glow {
    background:
      radial-gradient(120% 55% at 50% -8%, rgba(8, 168, 240, .18), transparent 62%),
      radial-gradient(80% 45% at 6% 2%, rgba(5, 116, 248, .14), transparent 58%),
      linear-gradient(180deg, #0C1626 0%, #0B1220 45%, #0A111D 100%);
  }

  .plat.is-primary { border-color: rgba(8, 168, 240, .4); }

  .btn-outline {
    background: transparent;
    border-color: rgba(8, 168, 240, .38);
    color: #6FC6FF;
  }

  .btn-outline:hover { background: rgba(8, 168, 240, .1); }

  .btn-ghost {
    background: rgba(233, 239, 248, .07);
    color: var(--ink-2);
  }

  .plat .btn.is-disabled,
  .plat .btn[aria-disabled="true"] {
    background: rgba(233, 239, 248, .08);
    color: var(--muted);
  }

  .qr-box img { background: #fff; }

  .sheet-mask { background: rgba(0, 0, 0, .62); }
}

/* ---------- 15. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
