/* ==========================================================================
   旺商聊官网首页 — 复刻样式
   断点与原站一致：<768px 走移动端版式，>=768px 走桌面端版式
   ========================================================================== */

:root {
  --c-page: #f8fafc;
  --c-ink: #1b1d20;
  --c-muted: #606366;
  --c-sep: #d0d3d6;
  --c-line: #f1f5f9;
  --c-card: #24272c;
  --c-card-border: #383c44;
  --c-card-hover: #2a2e34;
  --c-card-sub: #8e9299;
  --c-white: #fff;

  --header-h: 42px;
  --card-w: 262px;
  --card-h: 108px;
  --card-h-open: 192px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  /* 对应 Tailwind preflight：html { line-height: 1.5 }，
     未显式声明行高的元素都会继承它 */
  line-height: 1.5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", sans-serif;
  background: var(--c-page);
  color: var(--c-ink);
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 页面容器 & 背景层 ---------- */

.page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--c-page);
}

.bg-layer {
  position: absolute;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-img--mobile {
  object-position: top;
}

.bg-img--desktop {
  display: none;
}

/* ---------- 顶栏 ---------- */

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.015);
  user-select: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: 0.025em;
}

/* ---------- Hero 文案 ---------- */

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-weight: 400;
  color: var(--c-ink);
  letter-spacing: 0.025em;
  line-height: 1.3;
  text-align: center;
}

.fw8 {
  font-weight: 800;
}

.sparkle {
  display: inline-block;
  flex: none;
  color: var(--c-ink);
  vertical-align: middle;
}

.hero-sub {
  font-weight: 400;
  color: var(--c-muted);
  letter-spacing: 0.03em;
  text-align: center;
}

.hero-sub .fw8 {
  color: var(--c-ink);
}

.sep {
  color: var(--c-sep);
}

/* ==========================================================================
   桌面端版式（>=768px 显示）
   ========================================================================== */

.layout-desktop {
  display: none;
}

.layout-desktop .site-header {
  height: 84px;
  padding: 0 48px;
}

.layout-desktop .header-inner {
  width: 100%;
  margin: 0 auto;
  gap: 10px;
}

.layout-desktop .brand-logo {
  width: 48px;
  height: 48px;
}

.layout-desktop .brand-name {
  font-size: 20px;
  /* 对应 Tailwind text-xl 的默认行高 1.75rem */
  line-height: 28px;
}

.hero--desktop {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 84px);
  margin-top: 84px;
  padding: 80px 24px;
}

.hero--desktop .hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1152px;
}

.hero--desktop .hero-title {
  font-size: 48px;
}

.hero--desktop .sparkle {
  width: 32px;
  height: 32px;
  margin: 0 12px;
}

.hero--desktop .hero-sub {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.5;
}

.hero--desktop .sep {
  margin: 0 6px;
}

.dl-block {
  width: 100%;
  max-width: 1152px;
  margin-top: 160px;
}

.dl-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  height: var(--card-h-open);
  gap: 24px;
  animation: fadeUp 0.8s ease-out both;
}

/* ---------- 桌面端下载卡片 ---------- */

.card {
  position: relative;
  display: block;
  width: var(--card-w);
  height: var(--card-h);
  overflow: hidden;
  background: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.card:hover {
  height: var(--card-h-open);
  background: var(--c-card-hover);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.card__front,
.card__back {
  position: absolute;
  inset: 0;
  transition: all 0.3s;
}

.card__back {
  opacity: 0;
  pointer-events: none;
}

.card:hover .card__front {
  opacity: 0;
  pointer-events: none;
}

.card:hover .card__back {
  opacity: 1;
  pointer-events: auto;
}

.card__front-inner,
.card__back-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 16px;
  text-align: center;
}

.card__front-inner {
  gap: 8px;
}

.card__back-inner {
  gap: 8px;
  animation: fadeIn 0.8s ease-out both;
}

.card__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  user-select: none;
}

.card__icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 原站写作 w-8.5 / h-8.5，该值不在 Tailwind 默认间距表内，
     因此盒子实际由内部 46px 图标撑开 */
  width: 46px;
  height: 46px;
}

.card__icon {
  width: 46px;
  height: 46px;
  max-width: none;
  object-fit: contain;
}

.card__title {
  color: var(--c-white);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1;
}

.card__desc {
  margin: 4px 0 0;
  color: var(--c-card-sub);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  user-select: none;
}

/* 二维码 */

.qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  padding: 8px;
  overflow: hidden;
  background: var(--c-white);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.card__desc--qr {
  margin-top: 6px;
  /* 背面描述在原站没有 leading-none，继承 html 的 1.5 */
  line-height: 1.5;
}

.card__desc--win,
.card__desc--mac {
  margin-top: 4px;
  line-height: 1.5;
}

/* Windows 卡展开态 */

.card__back-inner--win {
  gap: 10px;
}

.win-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.win-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
}

.win-icon-box img {
  width: 80px;
  height: 80px;
  max-width: none;
  object-fit: contain;
}

.card__title--win {
  margin-top: 6px;
  font-size: 16px;
}

/* Mac 卡展开态 */

.card__back-inner--mac {
  gap: 12px;
}

.mac-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 210px;
  margin: 0 auto;
}

.mac-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 8px 16px;
  background: var(--c-white);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.15s;
}

.mac-btn:hover {
  background: #f1f5ff;
}

.mac-btn--intel {
  padding: 10px 16px;
}

.mac-btn__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mac-apple {
  flex: none;
  width: 24px;
  height: 24px;
  fill: currentColor;
  color: var(--c-ink);
}

.intel-badge {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #0071c5;
  border-radius: 9999px;
  color: var(--c-white);
  font-size: 8px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  user-select: none;
}

.mac-dl {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--c-muted);
}

/* ==========================================================================
   移动端版式（<768px 显示）
   ========================================================================== */

.layout-mobile {
  display: block;
}

.layout-mobile .site-header {
  height: 42px;
  padding: 0 16px;
}

.layout-mobile .brand-logo {
  width: 24px;
  height: 24px;
}

.layout-mobile .brand-name {
  font-size: 14px;
}

.hero-m {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 42px);
  margin-top: 42px;
}

.hero-m__outer {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  padding-top: 32px;
}

.hero-m__center {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 0 24px;
}

.hero-m .hero-title {
  font-size: 23px;
}

.hero-m .sparkle {
  width: 20px;
  height: 20px;
  margin: 0 6px;
}

.hero-m .hero-sub {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.hero-m .sep {
  margin: 0 4px;
}

.dl-mobile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 297px;
  margin: 56px auto 0;
  animation: fadeUp 0.8s ease-out both;
}

.mcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 297px;
  height: 54px;
  padding: 4px 0;
  background: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s;
}

.mcard:active {
  transform: scale(0.98);
}

.mcard__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}

.mcard__icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.mcard__icon-box img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.mcard__title {
  color: var(--c-white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1;
}

.mcard__sub {
  margin-top: 2px;
  color: var(--c-card-sub);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1;
  text-align: center;
  user-select: none;
}

/* ---------- 安装教程 ---------- */

.tutorial {
  position: relative;
  z-index: 10;
  margin-top: -80px;
}

.tutorial__card {
  position: relative;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--c-white);
  border-radius: 16px 16px 0 0;
  user-select: none;
}

.tutorial__top {
  position: absolute;
  top: 12px;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tutorial__handle {
  width: 32px;
  height: 6px;
  background: #e2e7fe;
  border-radius: 3px;
}

.tutorial__link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: #b5babf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.025em;
  transition: transform 0.15s;
  animation: bounceDown 1.8s ease-in-out infinite;
}

.tutorial__link img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  user-select: none;
}

.tutorial__image {
  width: 100%;
  aspect-ratio: 750 / 2524;
  background-image: url("../assets/install-tutorial.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* ---------- 动画 ---------- */

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bounceDown {
  0%,
  to {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* ---------- 断点切换 ---------- */

@media (min-width: 768px) {
  :root {
    --header-h: 84px;
  }

  .bg-img--mobile {
    display: none;
  }

  .bg-img--desktop {
    display: block;
  }

  .layout-mobile {
    display: none;
  }

  .layout-desktop {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dl-grid,
  .dl-mobile,
  .card__back-inner,
  .tutorial__link {
    animation: none;
  }
}
