:root {
  --primary: #ff8a4c;
  --primary-deep: #ff6a3c;
  --ios-dark: #1f2937;
  --ios-dark-deep: #0f172a;
  --text-dark: #3f2d22;
  --text-light: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff5ef;
}

body.wechat-mask-open {
  overflow: hidden;
}

.page {
  min-height: 100vh;
  max-width: 750px;
  margin: 0 auto;
  padding: 22px 20px;
  padding-bottom: 56px;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  background: #fff5ef url("appBg.png") center top / cover no-repeat;
}

.view {
  width: 100%;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
}

.view[hidden] {
  display: none;
}

.center-content {
  width: 100%;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.center-content > * + * {
  margin-top: 18px;
}

.invite-card {
  width: 86%;
  max-width: 420px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 10px 12px;
}

.invite-card > * {
  margin: 0 4px;
}

.invite-label {
  font-size: 18px;
  color: var(--text-dark);
  font-weight: 700;
}

.invite-code {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6b6bff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
}

.copy-btn {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  color: var(--text-light);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 14px;
}

.app-area {
  width: 100%;
  text-align: center;
}

.app-logo-wrap {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.6);
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  overflow: hidden;
}

.app-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.82);
}

.download-decor {
  width: 86%;
  max-width: 460px;
  margin: 0 auto -200px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.download-actions {
  width: 92%;
  max-width: 460px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -webkit-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  margin-left: auto;
  margin-right: auto;
}

.download-actions > .download-btn {
  margin: 0 6px;
}

.download-actions > .download-btn:first-child {
  margin-left: 0;
}

.download-actions > .download-btn:last-child {
  margin-right: 0;
}

.download-btn {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 0;
  -ms-flex: 1 1 0;
  flex: 1 1 0;
  min-width: 0;
  border: none;
  border-radius: 999px;
  color: var(--text-light);
  font-size: 20px;
  font-weight: 700;
  padding: 12px 14px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  box-shadow: 0 12px 22px rgba(255, 99, 59, 0.25);
}

.download-btn > * {
  margin: 0 4px;
}

.download-btn-android {
  background: linear-gradient(135deg, var(--primary-deep), #ffb15b);
}

.download-btn-ios {
  background: linear-gradient(135deg, var(--ios-dark-deep), var(--ios-dark));
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.25);
}

.download-btn-icon {
  width: 26px;
  height: 26px;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.tip {
  margin: 18px 0 0;
  color: #7d5f4f;
  font-size: 15px;
  text-align: center;
}

.ios-guide-view {
  padding-bottom: 12px;
}

.ios-guide-view > * + * {
  margin-top: 16px;
}

.guide-header {
  position: relative;
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  min-height: 36px;
}

.guide-back {
  position: absolute;
  left: 0;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  font-size: 26px;
  line-height: 1;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.guide-title {
  margin: 0;
  color: var(--text-dark);
  font-size: 20px;
  font-weight: 700;
}

.guide-steps {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
}

.guide-steps > .guide-step + .guide-step {
  margin-top: 14px;
}

.guide-step {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 16px 14px 18px;
  display: block;
  box-shadow: 0 6px 16px rgba(255, 138, 76, 0.12);
}

.guide-step > * + * {
  margin-top: 12px;
}

.guide-step-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.guide-step-num {
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  color: var(--text-light);
  font-size: 15px;
  vertical-align: middle;
  margin-right: 8px;
}

.guide-app-name {
  color: var(--primary-deep);
  word-break: break-all;
}

.guide-step-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #6b5648;
}

.guide-step-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.guide-step-image {
  width: 100%;
  height: auto;
  display: block;
}

.guide-step-app-icon-slot {
  position: absolute;
  left: 10.48%;
  top: 29.2%;
  width: 16.21%;
  height: 0;
  padding-bottom: 16.21%;
  overflow: hidden;
  border-radius: 22%;
  background: rgba(255, 255, 255, 0.6);
}

.guide-step-app-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.guide-step-app-icon:not([src]),
.guide-step-app-icon[src=""] {
  visibility: hidden;
}

.guide-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  color: var(--text-light);
  font-size: 18px;
  font-weight: 700;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
  display: block;
  box-shadow: 0 8px 16px rgba(255, 99, 59, 0.22);
}

.guide-btn-disabled {
  background: linear-gradient(135deg, #b8b8b8, #d4d4d4);
  box-shadow: none;
  pointer-events: none;
  opacity: 0.7;
}

.wechat-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  color: #ffffff;
}

.wechat-mask-arrow {
  margin: 10px 18px 0 0;
  margin-top: calc(10px + env(safe-area-inset-top));
  text-align: right;
  font-size: 46px;
  line-height: 1;
}

.wechat-mask-panel {
  width: 86%;
  max-width: 520px;
  margin: 14px auto 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
}

.wechat-mask-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.wechat-mask-text {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 480px) {
  .page {
    padding: 16px 14px;
    padding-bottom: 44px;
    padding-bottom: calc(44px + env(safe-area-inset-bottom));
  }

  .center-content > * + * {
    margin-top: 14px;
  }

  .invite-card {
    width: 92%;
    max-width: 360px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .invite-label {
    font-size: 15px;
  }

  .invite-code {
    font-size: 22px;
    max-width: 120px;
  }

  .copy-btn {
    font-size: 14px;
    padding: 6px 10px;
  }

  .app-logo-wrap {
    width: 152px;
    height: 152px;
  }

  .download-decor {
    width: 92%;
    margin: 0 auto -150px;
  }

  .download-actions {
    width: 96%;
  }

  .download-actions > .download-btn {
    margin: 0 4px;
  }

  .download-actions > .download-btn:first-child {
    margin-left: 0;
  }

  .download-actions > .download-btn:last-child {
    margin-right: 0;
  }

  .download-btn {
    font-size: 16px;
    padding: 10px 10px;
  }

  .download-btn > * {
    margin: 0 3px;
  }

  .download-btn-icon {
    width: 18px;
    height: 18px;
  }

  .tip {
    font-size: 13px;
    margin-top: 14px;
  }

  .ios-guide-view > * + * {
    margin-top: 12px;
  }

  .guide-back {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }

  .guide-title {
    font-size: 18px;
  }

  .guide-step {
    padding: 14px 12px 16px;
    border-radius: 14px;
  }

  .guide-step-title {
    font-size: 15px;
  }

  .guide-step-num {
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 13px;
  }

  .guide-step-desc {
    font-size: 13px;
  }

  .guide-btn {
    font-size: 16px;
    padding: 11px 14px;
  }

  .wechat-mask-arrow {
    font-size: 38px;
    margin-right: 12px;
  }

  .wechat-mask-panel {
    width: calc(100% - 24px);
    margin-top: 10px;
    padding: 14px;
  }

  .wechat-mask-title {
    font-size: 18px;
  }

  .wechat-mask-text {
    font-size: 14px;
  }
}
