.resource-gate-open{
  overflow: hidden;
}

.resource-gate-overlay{
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(70,42,20,.2);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s var(--ease-out), visibility 0s linear .28s;
}

.resource-gate-overlay.show{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.resource-gate-panel{
  position: relative;
  width: min(495px, calc(100% - 16px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 31px 26px;
  border: 1px solid #fff;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,250,245,.95));
  box-shadow: inset 0 1px 0 #fff, 0 4px 10px rgba(84,52,28,.05), 0 40px 90px -30px rgba(120,62,20,.38);
  text-align: left;
  opacity: 0;
  transform: translateY(18px) scale(.94);
  transform-origin: center center;
  transition: opacity .3s var(--ease-out), transform .45s var(--ease-spring);
  scrollbar-width: thin;
  scrollbar-color: rgba(240,120,42,.45) transparent;
}

.resource-gate-overlay.show .resource-gate-panel{
  opacity: 1;
  transform: none;
}

.resource-gate-close{
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.7);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}

.resource-gate-close:hover{
  color: var(--text);
  border-color: var(--line-strong);
  background: #fff;
}

.resource-gate-close:active{
  transform: scale(.97);
}

.resource-gate-eyebrow{
  display: block;
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
}

.resource-gate-title{
  margin: 0 72px 10px 0;
  color: var(--text);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.resource-gate-intro{
  margin: 0 0 20px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.78;
}

.resource-field{
  margin-bottom: 0;
}

.resource-field label{
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.resource-field > label{
  margin-left: 3px;
}

.resource-email-input{
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  background: rgba(251,246,240,.8);
  color: var(--text);
  caret-color: var(--accent);
  font: 500 16px/1 var(--font);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.resource-email-input::placeholder{
  color: #a39890;
  font-weight: 500;
}

.resource-email-input:hover{
  border-color: rgba(84,52,28,.28);
}

.resource-email-input:focus{
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(240,120,42,.16);
}

.resource-email-input[aria-invalid="true"]{
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.resource-helper,
.resource-field-error{
  display: block;
  min-height: 18px;
  margin: 7px 2px 0;
  font-size: 12px;
  line-height: 1.5;
}

.resource-helper{
  color: var(--text-3);
}

.resource-field-error,
.resource-form-error{
  color: var(--danger);
}

.resource-field-error{
  margin-top: 7px;
}

.resource-field-error.is-hint{
  color: var(--text-2);
}

.resource-email-fix{
  display: inline;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.resource-email-fix:hover{ color: var(--accent); }

.resource-consents{
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.resource-consent-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.55;
}

.resource-consent-item + .resource-consent-item{
  margin-top: 0;
}

.resource-consent-toggle{
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px;
  cursor: pointer;
}

.resource-consent-toggle input{
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.resource-check-box{
  position: relative;
  width: 21px;
  height: 21px;
  overflow: visible;
  border: 1.5px solid rgba(84,52,28,.28);
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(84,52,28,.08);
  transform: scale(1);
  transition:
    background-color .24s var(--ease-out),
    border-color .24s var(--ease-out),
    box-shadow .24s var(--ease-out),
    transform .18s var(--ease-spring);
}

.resource-check-box::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 10px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: translate(-50%, -58%) rotate(45deg) scale(.35);
  transform-origin: center;
  transition: opacity .16s ease, transform .34s var(--ease-spring);
}

.resource-consent-toggle input:checked + .resource-check-box{
  border-color: var(--accent);
  background: var(--accent-grad);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 0 0 4px rgba(240,120,42,.14);
  transform: scale(1);
}

.resource-consent-toggle input:checked + .resource-check-box::after{
  opacity: 1;
  transform: translate(-50%, -58%) rotate(45deg) scale(1);
}

.resource-consent-toggle input:active + .resource-check-box{
  transform: scale(.92);
}

.resource-consent-toggle input:focus-visible + .resource-check-box{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.resource-consent-copy{
  margin: 0;
}

.resource-legal-link{
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: default;
  transition: none;
}

.resource-legal-link:hover,
.resource-legal-link:focus-visible{
  color: var(--accent-strong);
  text-decoration: underline;
}

.resource-legal-link:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.resource-consents.has-error{
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.resource-consents.has-error .resource-check-box{
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.resource-form-error{
  min-height: 20px;
  margin: 6px 0 7px;
  font-size: 12.5px;
  line-height: 1.55;
}

/* 立体外观由 site.css 的 .btn-3d 提供 */
.resource-submit{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  border-radius: 15px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.resource-submit:disabled{
  cursor: wait;
  opacity: .78;
}

.resource-submit-spinner{
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: resource-spin .72s linear infinite;
}

.resource-submit.is-loading .resource-submit-spinner{
  display: block;
}

@keyframes resource-spin{
  to{ transform: rotate(360deg); }
}

.resource-gate-note{
  margin: 11px auto 0;
  max-width: 58ch;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.resource-honeypot{
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

[data-resource-gate].is-gate-checking{
  pointer-events: none;
  opacity: .78;
}

[data-resource-gate].is-gate-checking::after{
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: resource-spin .72s linear infinite;
}

.resource-sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px){
  .resource-gate-overlay{
    align-items: flex-start;
    padding: 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .resource-gate-panel{
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    padding: 27px 20px 22px;
    border-radius: 22px;
  }

  .resource-gate-close{
    top: 14px;
    right: 14px;
    min-width: 54px;
    min-height: 44px;
  }

  .resource-gate-eyebrow{
    margin-right: 66px;
  }

  .resource-gate-title{
    margin-right: 60px;
    font-size: 22px;
  }

  .resource-gate-intro{
    margin-bottom: 19px;
    font-size: 14px;
  }

  .resource-consents{
    margin-top: 16px;
    padding: 0;
  }

  .resource-consent-item{
    align-items: center;
  }

  .resource-consent-toggle{
    margin: -4px;
  }
}

@media (prefers-reduced-motion: reduce){
  .resource-gate-overlay,
  .resource-gate-panel,
  .resource-check-box,
  .resource-check-box::after,
  .resource-submit,
  [data-resource-gate]::after{
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }

  .resource-submit-spinner,
  [data-resource-gate].is-gate-checking::after{
    animation: none !important;
  }
}
