/* 首页。各块按设计稿坐标摆放（1rem = 设计稿 100px） */

/* ---------- 顶部 Banner ---------- */
.hero { height: 6.91rem; }
.trophy-plate {
  left: -.34%;
  top: -1.98%;
  width: 100.32%;
  height: 117.31%;
}

.home-hero__copy {
  position: absolute;
  left: 3.69rem;
  top: 2.07rem;
  white-space: nowrap;
  filter: drop-shadow(0 .04rem .04rem rgba(0, 0, 0, .25));
}
.home-hero__slogan,
.quotes__btn,
.app__cta,
.edge__subtitle,
.edge-card p { font-family: var(--font-display); }

.home-hero__title,
.home-hero__slogan {
  line-height: 1.05rem;
  letter-spacing: -.002rem;
}
.home-hero__title {
  font-size: .96rem;
  font-weight: 700;
}
.home-hero__rule {
  position: absolute;
  left: .03rem;
  top: 2.345rem;
  width: 4.955rem;
  height: .11rem;
}
.home-hero__slogan {
  margin-top: .32rem;
  font-size: .53rem;
}

/* ---------- 行情条 + 官方 APP ---------- */
.app {
  position: relative;
  height: 11.96rem;
  background: #f8f0ef;
  color: #4d4d4d;
}

.quotes {
  position: absolute;
  left: calc(50% - 6.75rem);
  top: -.55rem;
  z-index: 1;
  display: flex;
  gap: .24rem;
  box-sizing: border-box;
  width: 13.5rem;
  padding: .25rem;
  border: 1px solid #f1f5f9;
  border-radius: .24rem;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 .16rem .36rem -.06rem rgba(83, 65, 205, .08), 0 .04rem .16rem -.02rem rgba(0, 0, 0, .04);
  -webkit-backdrop-filter: blur(.12rem);
  backdrop-filter: blur(.12rem);
}
.quote {
  flex: 1;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: .6rem;
  padding: 0 .17rem;
  border: 1px solid #eef2ff;
  border-radius: .16rem;
  white-space: nowrap;
}
.quote--gold { background: linear-gradient(to right, #fff2de, #ffedc7); }
.quote--silver { background: linear-gradient(to right, #f8f9fe, #979fc7); }
.quote__icon {
  width: .44rem;
  height: .44rem;
  margin-right: .14rem;
  border: 1px solid rgba(253, 230, 138, .6);
  border-radius: .16rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.quote--silver .quote__icon { border-color: rgba(199, 210, 254, .6); }
.quote__info { margin-right: auto; }
.quote__name {
  display: flex;
  align-items: center;
  gap: .08rem;
  margin-bottom: .02rem;
  color: #64748b;
  font-size: .14rem;
  font-weight: 600;
  line-height: .16rem;
}
.quote__name span {
  padding: 0 .06rem;
  border-radius: 99rem;
  background: rgba(255, 255, 255, .7);
  color: #b45309;
  font-size: .1rem;
  font-weight: 700;
}
.quote--silver .quote__name span {
  background: rgba(224, 231, 255, .7);
  color: #5341cd;
}
.quote__price {
  color: #171931;
  font-size: .24rem;
  font-weight: 700;
  line-height: .32rem;
}
.quote__change {
  display: flex;
  align-items: center;
  padding: .03rem .09rem;
  border: 1px solid rgba(167, 243, 208, .4);
  border-radius: 99rem;
  background: #ecfdf5;
  color: #059669;
  font-size: .12rem;
  font-weight: 700;
  line-height: .16rem;
}
/* 涨跌箭头：用图标当蒙版、填文字颜色，涨跌共用一个图标，跌时上下翻转 */
.quote__arrow {
  width: .13667rem;
  height: .07rem;
  background: currentColor;
  -webkit-mask: url("../assets/icon-up.svg?v=df16eb0d") center / 100% 100% no-repeat;
  mask: url("../assets/icon-up.svg?v=df16eb0d") center / 100% 100% no-repeat;
}
/* 国内习惯涨红跌绿：设计稿的绿色样式（上面 .quote__change 的默认值）留给“跌”，“涨”换成红色 */
.quote[data-dir="up"] .quote__change {
  border-color: rgba(254, 202, 202, .6);
  background: #fef2f2;
  color: #dc2626;
}
.quote[data-dir="down"] .quote__arrow { scale: 1 -1; }
/* 平盘、还没拿到数据、接口连不上：灰色，不显示箭头 */
.quote[data-dir="flat"] .quote__change {
  border-color: rgba(148, 163, 184, .3);
  background: rgba(255, 255, 255, .6);
  color: #64748b;
}
.quote[data-dir="flat"] .quote__arrow { display: none; }
/* 价格跳动时闪一下颜色 */
.quote__price { transition: color .6s; }
.quote__price.is-tick-up { color: #dc2626; transition: none; }
.quote__price.is-tick-down { color: #059669; transition: none; }

.quotes__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: .6rem;
  font-size: .24rem;
  font-weight: 900;
  line-height: .28rem;
  letter-spacing: -.002rem;
  white-space: nowrap;
  transition: filter .2s;
}
.quotes__btn:hover { filter: brightness(1.08); }
.quotes__btn--open {
  width: 2.15rem;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: .64rem;
  background: linear-gradient(to bottom, #ffdcbd, #ffbb61);
  color: #541516;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .05));
}

.app__title {
  position: absolute;
  left: calc(50% - 5.42rem);
  top: 1.6917rem;
  width: 10.84rem;
  background: linear-gradient(to left, #683b33, #ce7565);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: .64rem;
  font-weight: 900;
  line-height: .76rem;
  letter-spacing: -.002rem;
  text-align: center;
}
.app__laurel {
  position: absolute;
  top: 1.5532rem;
  width: .35963rem;
  height: 1.03694rem;
}
.app__laurel--left { left: 6.7499rem; scale: -1 1; }
.app__laurel--right { left: 12.0404rem; }

.app__phones {
  position: absolute;
  left: 3.28rem;
  top: 3.5rem;
  width: 6.02rem;
  height: 5.34rem;
  overflow: hidden;
}
.app__phone { position: absolute; }
.app__phone--app {
  left: 2.92rem;
  top: 1.05rem;
  width: 2.71rem;
  height: 5.54rem;
}
.app__phone--chart {
  left: .2rem;
  top: .33rem;
  width: 3.06rem;
  height: 6.26rem;
}
.app__phones-fade {
  position: absolute;
  left: 0;
  top: 4.44rem;
  width: 6.1rem;
  height: .94rem;
  background: linear-gradient(to top, #f8f0ef 9.621%, rgba(248, 240, 239, 0));
}
.app__info {
  position: absolute;
  left: 3.45rem;
  top: 9.065rem;
  color: #777;
  font-size: .15rem;
  line-height: .31rem;
  white-space: nowrap;
}
.app__sep { margin: 0 .24rem; } /* 设计稿里竖线两边各空 7 个空格 */
.app__info a:hover { color: #683b33; text-decoration: underline; }

.app__icon,
.app__qr {
  position: absolute;
  background: #fff;
}
.app__icon {
  left: 10.18rem;
  top: 4.61rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: .16rem;
}
.app__qr {
  top: 6.67rem;
  width: 2.22rem;
  height: 2.22rem;
}
.app__qr img {
  width: 100%;
  height: 100%;
}
.app__qr--android { left: 10.18rem; }
.app__qr--ios { left: 13.28rem; }

.app__features {
  position: absolute;
  left: 11.74rem;
  top: 4.475rem;
  font-size: .24rem;
  line-height: .5rem;
  white-space: nowrap;
}
.app__features li {
  position: relative;
  padding-left: .42rem;
}
.app__features img {
  position: absolute;
  left: 0;
  top: .025rem;
  width: .33rem;
  height: .43rem;
}

.dl-btn {
  position: absolute;
  top: 9.14rem;
}
.dl-btn--android { left: 9.99rem; }
.dl-btn--ios { left: 13.09rem; }

.app__cta {
  position: absolute;
  left: calc(50% - 1.78rem);
  top: 10.36rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 3.56rem;
  height: .81rem;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: .64rem;
  background: linear-gradient(to bottom, #ffdcbd, #ffc477);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .05));
  font-size: .36rem;
  font-weight: 900;
  line-height: .28rem;
  letter-spacing: -.002rem;
}
.app__cta span {
  /* 渐变字只在自己的盒子里显示。设计稿行高 28 比 36 的字还矮，照搬会把字的上下切掉，所以这里把盒子加高；
     按钮是上下居中的，字的位置不变 */
  line-height: .5rem;
  background: linear-gradient(to top, #541516, #ba2f31);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 华信优势 ---------- */
.edge {
  position: relative;
  height: 7.87rem;
  background: #f8f0ef; /* 和上面的 APP 区同色，面板圆角外侧露出的是它（不设会透出网页的白底） */
  overflow-x: clip; /* 面板的光边左右各多出几像素，裁掉免得页面能横向滚动 */
}
.panel {
  top: .171rem;
  bottom: calc(-3.15rem + .5px); /* 一直垫到页脚底下，免得接缝处漏出浅色底 */
  --halo-top: -.171rem;
  --halo-height: 8.2175rem;
}
.edge__title,
.edge__subtitle {
  position: absolute;
  left: 3.92rem;
  width: 10.84rem;
  line-height: .76rem;
  text-align: center;
}
.edge__title {
  top: 1.045rem;
  font-size: .48rem;
  font-weight: 900;
  letter-spacing: -.002rem;
}
.edge__subtitle {
  top: 1.7483rem;
  font-size: .32rem;
  letter-spacing: .2rem;
}
.edge__list {
  position: absolute;
  left: 4.24rem;
  top: 3.24rem;
  display: grid;
  grid-template-columns: 5.25rem 5.25rem;
  gap: .2406rem .23rem;
}
.edge-card {
  position: relative;
  height: 1.64rem;
  border-radius: .27rem;
  background: linear-gradient(to bottom, #441215, #240e0f);
  box-shadow: 0 1px 3.8px rgba(0, 0, 0, .43);
  transition: translate .3s, box-shadow .3s;
}
.edge-card:hover {
  translate: 0 -.06rem;
  box-shadow: 0 .12rem .3rem rgba(0, 0, 0, .5);
}
.edge-card img {
  position: absolute;
  left: .39rem;
  top: var(--y); /* 四张卡片的图标上下位置略有不同，写在页面里 */
  width: 1.31rem;
  height: 1.31rem;
  border-radius: .12rem;
}
.edge-card h3,
.edge-card p {
  position: absolute;
  left: 2.13rem;
  white-space: nowrap;
}
.edge-card h3 {
  top: .5rem;
  font-size: .24rem;
  font-weight: 900;
  line-height: .28rem;
  letter-spacing: -.002rem;
}
.edge-card p {
  top: .96rem;
  color: #dbcab0;
  font-size: .2rem;
  font-weight: 500;
  line-height: .2113rem;
}

.site-footer {
  box-sizing: border-box;
  height: 3.15rem;
  padding-bottom: .12rem;
}

/* ---------- 动效（生效条件见 base.css） ---------- */
/* 按要求停用“减少动态效果”判断：动效对所有访客都播放。原来是 @media (prefers-reduced-motion: no-preference) { 包住下面这些规则 */
  /* 两台手机跟着滚动从下面升起来，一前一后 */
  .app__phones.is-playing .app__phone--chart { animation: phone-rise-chart 1s linear both; }
  .app__phones.is-playing .app__phone--app { animation: phone-rise-app 1s .2s linear both; }

  /* “开户领赠金”按钮上每隔几秒扫过一道光 */
  .js .app__cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .7) 50%, transparent 60%) no-repeat;
    background-size: 300% 100%;
    animation: cta-shine 3.6s ease-in-out infinite;
  }

  /* 优势图标轻轻浮动 */
  .js .edge-card img { animation: float-sm 3.2s ease-in-out infinite alternate; }
  .js .edge-card:nth-child(even) img { animation-delay: -1.6s; }
/* 停用的 prefers-reduced-motion 外壳到此结束 */

/* =====================================================================
   手机版（宽度 < 1080），公共部分见 base.css 末尾
   ===================================================================== */
@media (max-width: 1079.98px) {
  /* ---------- Banner：奖杯在上，标题压在下方的暗色渐变上 ---------- */
  .hero { height: 7.2rem; }
  .trophy-plate {
    --h: 4.5rem;
    --ratio: 2.37625;
    --focus: .6562;
    top: .14rem;
    /* 画面下缘淡出，奖杯底座融进背景，标题落在暗色上 */
    -webkit-mask-image: linear-gradient(transparent, #000 7%, #000 60%, transparent 97%);
    mask-image: linear-gradient(transparent, #000 7%, #000 60%, transparent 97%);
  }
  .home-hero__copy {
    left: var(--gutter);
    top: auto;
    bottom: .74rem;
  }
  .home-hero__title {
    font-size: .5rem;
    line-height: .6rem;
  }
  .home-hero__rule {
    position: static;
    width: 2.6rem;
    height: .06rem;
    margin: .14rem 0 .06rem;
  }
  .home-hero__slogan {
    margin-top: 0;
    font-size: .25rem;
    line-height: .4rem;
  }

  /* ---------- 行情条 + 官方 APP：六列网格，边上两列给麦穗和 APP 图标用 ---------- */
  .app {
    display: grid;
    grid-template-columns: .3rem .3rem 1fr 1fr .3rem .3rem;
    grid-template-areas:
      "q   q   q   q   q   q"
      ".   t   t   t   t   ."
      "ph  ph  ph  ph  ph  ph"
      "f   f   f   f   f   f"
      "an  an  an  io  io  io"
      "ic  ic  in  in  in  in"
      "cta cta cta cta cta cta";
    height: auto;
    padding: 0 var(--gutter) .64rem;
  }
  .app > * {
    position: relative;
    left: auto;
    top: auto;
  }

  .quotes {
    grid-area: q;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .08rem;
    width: auto;
    margin-top: -.5rem;
    padding: .1rem;
    border-radius: .2rem;
  }
  .quote {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon info" "chg chg";
    gap: .07rem .08rem;
    height: auto;
    padding: .1rem;
    border-radius: .14rem;
  }
  .quote__icon {
    grid-area: icon;
    width: .34rem;
    height: .34rem;
    margin: 0;
    border-radius: .1rem;
  }
  .quote__info { grid-area: info; margin: 0; }
  .quote__name {
    gap: .04rem;
    margin-bottom: .01rem;
    font-size: .11rem;
    line-height: .14rem;
  }
  .quote__name span { padding: 0 .04rem; font-size: .09rem; }
  .quote__price { font-size: .19rem; line-height: .22rem; }
  .quote__change {
    grid-area: chg;
    justify-self: start;
    gap: .03rem;
    padding: .02rem .07rem;
    font-size: .1rem;
    line-height: .14rem;
  }
  .quote__arrow { width: .1rem; height: .05rem; }
  .quotes__btn {
    grid-column: 1 / -1;
    width: auto;
    height: .46rem;
    font-size: .17rem;
    line-height: .2rem;
  }

  .app__title {
    grid-area: t;
    align-self: center;
    width: auto;
    margin-top: .5rem;
    font-size: .34rem;
    line-height: .4rem;
  }
  /* 麦穗和标题同一行、以行中心对称摆放，任何宽度下都贴着标题 */
  .app__laurel {
    grid-row: 2;
    grid-column: 1 / -1;
    align-self: center;
    justify-self: center;
    width: .19rem;
    height: .55rem;
    margin-top: .5rem;
  }
  .app__laurel--left { translate: -1.4rem 0; }
  .app__laurel--right { translate: 1.4rem 0; }

  /* 两台手机：桌面版的坐标换算成相对容器的百分比，容器按原比例跟着宽度缩放 */
  .app__phones {
    grid-area: ph;
    width: auto;
    height: auto;
    margin-top: .16rem;
    aspect-ratio: 602 / 534;
  }
  .app__phone--app { left: 48.505%; top: 19.663%; width: 45.017%; height: 103.745%; }
  .app__phone--chart { left: 3.322%; top: 6.18%; width: 50.83%; height: 117.228%; }
  .app__phones-fade { top: 83.146%; width: 101.329%; height: 17.603%; }

  .app__features {
    grid-area: f;
    margin-top: -.04rem;
    padding: .14rem .18rem;
    border-radius: .16rem;
    background: #fff;
    box-shadow: 0 .12rem .3rem -.14rem rgba(104, 59, 51, .3);
    font-size: .15rem;
    line-height: .36rem;
    white-space: normal;
  }
  .app__features li { padding-left: .3rem; }
  .app__features img { top: .05rem; width: .2rem; height: .26rem; }

  /* 二维码是给电脑前的人用手机扫的，在手机上没意义 */
  .app__qr { display: none; }
  .dl-btn--android { grid-area: an; margin: .2rem .05rem 0 0; }
  .dl-btn--ios { grid-area: io; margin: .2rem 0 0 .05rem; }

  .app__icon {
    grid-area: ic;
    align-self: center;
    width: .52rem;
    height: .52rem;
    margin-top: .24rem;
    border-radius: .12rem;
  }
  .app__info {
    grid-area: in;
    align-self: center;
    margin-top: .24rem;
    padding-left: .12rem;
    font-size: .115rem;
    line-height: .19rem;
    white-space: normal;
  }
  .app__sep { margin: 0 .1rem; }
  .app__cta {
    grid-area: cta;
    justify-self: center;
    width: 2.6rem;
    height: .58rem;
    margin-top: .36rem;
    font-size: .24rem;
  }
  .app__cta span { line-height: .4rem; }

  /* ---------- 华信优势 ---------- */
  .edge {
    height: auto;
    padding: .8rem var(--gutter) .72rem;
  }
  .panel {
    top: .2rem;
    bottom: 0;
    --halo-top: -.06rem;
    --halo-height: 1.6rem;
  }
  .edge__title,
  .edge__subtitle {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
  }
  .edge__title { font-size: .3rem; line-height: .44rem; }
  .edge__subtitle {
    margin-top: .02rem;
    padding-left: .1rem; /* 字距会在最后一个字后面也留一段，补回来才居中 */
    font-size: .17rem;
    line-height: .3rem;
    letter-spacing: .1rem;
  }
  .edge__list {
    position: relative;
    left: auto;
    top: auto;
    grid-template-columns: 1fr;
    gap: .12rem;
    margin-top: .32rem;
  }
  .edge-card {
    height: .96rem;
    border-radius: .2rem;
  }
  .edge-card img {
    left: .14rem;
    top: .12rem;
    width: .72rem;
    height: .72rem;
    border-radius: .1rem;
  }
  .edge-card h3,
  .edge-card p { left: 1.04rem; }
  .edge-card h3 { top: .25rem; font-size: .18rem; line-height: .22rem; }
  .edge-card p { top: .55rem; font-size: .13rem; line-height: .18rem; }

  .site-footer { height: auto; padding-bottom: .4rem; }
}
@media (min-width: 640px) and (max-width: 1079.98px) {
  .edge__list { grid-template-columns: 1fr 1fr; }
  .app__phones {
    justify-self: center;
    width: 100%;
    max-width: 4.6rem;
  }
}

@keyframes phone-rise-chart {
  from { transform: translateY(55%) rotate(-7deg); }
  to { transform: none; }
}
@keyframes phone-rise-app {
  from { transform: translateY(75%) rotate(9deg); }
  to { transform: none; }
}
@keyframes cta-shine {
  0% { background-position: 150% 0; }
  40%, 100% { background-position: -50% 0; }
}
