html.tsg-gate-lock,
body.tsg-gate-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.tsg-gate,
.tsg-gate * {
  box-sizing: border-box;
}

.tsg-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.99), rgba(238, 242, 248, 0.98) 54%, rgba(226, 232, 241, 0.99)),
    #edf1f7;
  color: #171d2d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.tsg-gate__dialog {
  position: relative;
  width: min(100%, 640px);
  padding: 42px;
  border: 1px solid rgba(22, 29, 45, 0.08);
  border-radius: 30px;
  outline: none;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 30px 80px rgba(22, 29, 45, 0.16), 0 8px 26px rgba(22, 29, 45, 0.08);
  text-align: center;
  animation: tsg-gate-enter 260ms ease-out;
}

.tsg-gate__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  margin: 0 auto 22px;
  border-radius: 23px;
}

.tsg-gate__icon svg {
  width: 35px;
  height: 35px;
}

.tsg-gate__icon--dark {
  background: #171d2d;
  color: #fff;
}

.tsg-gate__icon--error {
  background: #fff0f0;
  color: #d73737;
}

.tsg-gate__icon--success {
  background: #eaf8ef;
  color: #16854a;
}

.tsg-gate__title {
  margin: 0;
  color: #171d2d;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.tsg-gate__description {
  max-width: 500px;
  margin: 14px auto 0;
  color: #687083;
  font-size: 16px;
  line-height: 1.8;
}

.tsg-gate__choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.tsg-gate button.tsg-gate__choice {
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 178px;
  padding: 24px 18px;
  border: 2px solid #e7eaf0;
  border-radius: 23px;
  background: #fff;
  color: #171d2d;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.tsg-gate button.tsg-gate__choice:hover {
  transform: translateY(-3px);
  border-color: #bcc3d0;
  background: #fcfcfd !important;
  color: #171d2d !important;
  box-shadow: 0 13px 32px rgba(22, 29, 45, 0.10);
}

/* 防止主题的 button:focus 样式把整个选项染成蓝色。 */
.tsg-gate button.tsg-gate__choice:focus,
.tsg-gate button.tsg-gate__choice:focus-visible {
  border-color: #bcc3d0;
  background: #fff !important;
  color: #171d2d !important;
  box-shadow: none;
}

/* 仅在实际按下时提供短暂反馈，不保留选中背景。 */
.tsg-gate button.tsg-gate__choice:active {
  transform: translateY(1px) scale(0.985);
  border-color: #c8ced8;
  background: #f4f6f9 !important;
  color: #171d2d !important;
  box-shadow: inset 0 2px 5px rgba(22, 29, 45, 0.08);
}

.tsg-gate__choice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-bottom: 15px;
  border-radius: 21px;
  color: #fff;
}

.tsg-gate__choice-icon--taobao {
  background: linear-gradient(145deg, #ff7a16, #ff4b00);
  font-size: 34px;
  font-weight: 850;
  line-height: 1;
}

.tsg-gate__choice-icon--site {
  background: #171d2d;
}

.tsg-gate__choice-icon--site svg {
  width: 34px;
  height: 34px;
}

.tsg-gate__choice-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tsg-gate__choice-copy strong {
  font-size: 18px;
  line-height: 1.4;
}

.tsg-gate__choice-copy small {
  color: #8a909e;
  font-size: 13px;
  line-height: 1.5;
}

.tsg-gate__message {
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: 19px;
  font-size: 15px;
  line-height: 1.85;
  text-align: left;
}

.tsg-gate__message p {
  margin: 6px 0 0;
}

.tsg-gate__message--error {
  border: 1px solid #ffd1d1;
  background: #fff5f5;
  color: #922828;
}

.tsg-gate__message--success {
  border: 1px solid #ccead7;
  background: #f1faf4;
  color: #226640;
}

.tsg-gate__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 17px;
  border: 1px solid #e4e7ed;
  border-radius: 16px;
  background: #f8f9fb;
  color: #3e4657;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

.tsg-gate__checkbox input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #171d2d;
  cursor: pointer;
}

.tsg-gate__checkbox span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tsg-gate__checkbox strong {
  font-size: 14px;
  line-height: 1.5;
}

.tsg-gate__checkbox small {
  color: #858c9b;
  font-size: 12px;
  line-height: 1.5;
}

.tsg-gate__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.tsg-gate__actions--single .tsg-gate__button {
  min-width: 180px;
}

.tsg-gate__button {
  appearance: none;
  min-height: 51px;
  padding: 12px 26px;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 720;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.tsg-gate__button:hover {
  transform: translateY(-2px);
}

.tsg-gate__button--primary {
  border: 1px solid #171d2d;
  background: #171d2d;
  color: #fff;
  box-shadow: 0 10px 25px rgba(23, 29, 45, 0.20);
}

.tsg-gate__button--secondary {
  border: 1px solid #dfe2e9;
  background: #fff;
  color: #303748;
}

.tsg-gate__choice:focus-visible,
.tsg-gate__button:focus-visible,
.tsg-gate__checkbox input:focus-visible {
  outline: 3px solid rgba(41, 101, 255, 0.30);
  outline-offset: 3px;
}

.tsg-gate__footnote {
  margin: 18px 0 0;
  color: #969caa;
  font-size: 12px;
  line-height: 1.6;
}

@keyframes tsg-gate-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .tsg-gate {
    align-items: flex-start;
    padding: 16px;
  }

  .tsg-gate__dialog {
    width: 100%;
    margin: auto 0;
    padding: 30px 20px;
    border-radius: 24px;
  }

  .tsg-gate__choices {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 25px;
  }

  .tsg-gate__choice {
    flex-direction: row;
    justify-content: flex-start;
    min-height: 100px;
    padding: 17px;
    text-align: left;
  }

  .tsg-gate__choice-icon {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    margin: 0 16px 0 0;
    border-radius: 18px;
  }

  .tsg-gate__actions {
    flex-direction: column-reverse;
  }

  .tsg-gate__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tsg-gate__dialog {
    animation: none;
  }

  .tsg-gate__choice,
  .tsg-gate__button {
    transition: none;
  }
}
