/* Email subscribe popup */
.dolphin-es {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.dolphin-es[hidden] {
  display: none !important;
}

.dolphin-es__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.dolphin-es__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  box-sizing: border-box;
}

.dolphin-es__close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.dolphin-es__close:hover {
  color: #0f172a;
}

.dolphin-es__media[hidden],
.dolphin-es__brand-row[hidden],
.dolphin-es__eyebrow[hidden],
.dolphin-es__offer[hidden],
.dolphin-es__perks[hidden] {
  display: none !important;
}

.dolphin-es__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #2f5f8a;
}

.dolphin-es__brand-row {
  display: flex;
  align-items: center;
  margin: 0 2rem 0.85rem 0;
}

.dolphin-es__logo {
  display: block;
  height: 1.85rem;
  width: auto;
  max-width: 9.5rem;
  object-fit: contain;
  object-position: left center;
}

.dolphin-es__title {
  margin: 0 1.5rem 0.75rem 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.dolphin-es__offer {
  margin: 0 0 0.55rem;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: #1e3a5f;
}

.dolphin-es__body {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #64748b;
}

.dolphin-es__perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1.15rem;
  padding: 0;
  list-style: none;
}

.dolphin-es__perk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.dolphin-es__perk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #1e3a5f;
}

.dolphin-es__perk-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.dolphin-es__perk-label {
  font-size: 0.68rem;
  line-height: 1.25;
  font-weight: 600;
  color: #1e3a5f;
}

.dolphin-es__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dolphin-es__field {
  position: relative;
}

.dolphin-es__field-icon {
  display: none;
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.dolphin-es__input {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fff;
}

.dolphin-es__input:focus {
  outline: none;
  border-color: var(--dolphin-brand-red, #e51b23);
  box-shadow: 0 0 0 3px rgba(229, 27, 35, 0.12);
}

.dolphin-es__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.85rem;
  border: 0;
  border-radius: 9999px;
  background: var(--dolphin-brand-red, #e51b23);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.dolphin-es__submit:hover:not(:disabled) {
  background: var(--dolphin-brand-red-hover, #c4161d);
}

.dolphin-es__submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.dolphin-es__submit.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.dolphin-es__submit.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.15rem;
  height: 1.15rem;
  margin: -0.575rem 0 0 -0.575rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: dolphin-es-spin 0.7s linear infinite;
}

@keyframes dolphin-es-spin {
  to {
    transform: rotate(360deg);
  }
}

.dolphin-es__message {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #166534;
}

.dolphin-es__message.is-error {
  color: #b91c1c;
  font-weight: 600;
}

/* Success toast popup (above subscribe modal) */
.dolphin-es-toast {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.dolphin-es-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.dolphin-es-toast__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.dolphin-es-toast__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(100%, 18.5rem);
  margin: 0;
  padding: 1.35rem 1.5rem 1.15rem;
  border: 0;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  color: #0f172a;
  cursor: pointer;
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease, background 0.15s ease;
}

.dolphin-es-toast.is-visible .dolphin-es-toast__card {
  transform: translateY(0) scale(1);
}

.dolphin-es-toast__card:hover,
.dolphin-es-toast__card:focus-visible {
  background: #f8fafc;
  outline: none;
}

.dolphin-es-toast__icon {
  display: inline-flex;
  color: #16a34a;
}

.dolphin-es-toast__text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: #166534;
}

.dolphin-es-toast__hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

/* —— Split variants: book (coupon) + content (干货) —— */
.dolphin-es--book .dolphin-es__dialog,
.dolphin-es--content .dolphin-es__dialog {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  width: min(100%, 52rem);
  min-height: 22rem;
  padding: 0;
  overflow: hidden;
  border-radius: 0.35rem;
  background: #eaf2f7;
}

.dolphin-es--book .dolphin-es__media,
.dolphin-es--content .dolphin-es__media {
  display: block;
  min-height: 100%;
  background: #d7e4ee;
}

.dolphin-es--book .dolphin-es__media-img,
.dolphin-es--content .dolphin-es__media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.dolphin-es--book .dolphin-es__panel,
.dolphin-es--content .dolphin-es__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 1.75rem 1.75rem;
  box-sizing: border-box;
}

.dolphin-es--book .dolphin-es__close,
.dolphin-es--content .dolphin-es__close {
  top: 0.85rem;
  right: 0.9rem;
  color: #1e3a5f;
  font-size: 1.35rem;
  font-weight: 400;
}

.dolphin-es--book .dolphin-es__brand-row,
.dolphin-es--content .dolphin-es__brand-row {
  margin: 0 2.25rem 0.9rem 0;
}

.dolphin-es--book .dolphin-es__logo,
.dolphin-es--content .dolphin-es__logo {
  height: 1.7rem;
  max-width: 8.75rem;
}

.dolphin-es--book .dolphin-es__title,
.dolphin-es--content .dolphin-es__title {
  display: block;
  margin: 0 0 0.45rem;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1e3a5f;
}

.dolphin-es--content .dolphin-es__title {
  font-size: 1.7rem;
  margin: 0 0 0.65rem;
}

.dolphin-es--book .dolphin-es__offer {
  margin: 0 0 0.55rem;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: #1e3a5f;
}

.dolphin-es--book .dolphin-es__body,
.dolphin-es--content .dolphin-es__body {
  margin: 0 0 1.1rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #4a6280;
}

.dolphin-es--book .dolphin-es__field-icon,
.dolphin-es--content .dolphin-es__field-icon {
  display: inline-flex;
}

.dolphin-es--book .dolphin-es__input,
.dolphin-es--content .dolphin-es__input {
  min-height: 2.9rem;
  padding-left: 2.55rem;
  border-radius: 0.2rem;
  border-color: #c9d6e3;
  background: #fff;
}

.dolphin-es--book .dolphin-es__input:focus,
.dolphin-es--content .dolphin-es__input:focus {
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.dolphin-es--book .dolphin-es__submit,
.dolphin-es--content .dolphin-es__submit {
  min-height: 2.9rem;
  border-radius: 0.2rem;
  background: #1e3a5f;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dolphin-es--book .dolphin-es__submit:hover:not(:disabled),
.dolphin-es--content .dolphin-es__submit:hover:not(:disabled) {
  background: #162c49;
}

html.dolphin-es-open,
html.dolphin-es-open body {
  overflow: hidden;
}

.dolphin-es__handle {
  display: none;
}

.dolphin-es__handle-bar {
  display: block;
  width: 2.5rem;
  height: 0.28rem;
  margin: 0 auto;
  border-radius: 999px;
  background: #94a3b8;
}

@media (max-width: 760px) {
  /* Mobile: soft bottom drawer, not a hard full-screen takeover */
  .dolphin-es {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
    pointer-events: none;
  }

  .dolphin-es__backdrop {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.28);
  }

  .dolphin-es__dialog {
    pointer-events: auto;
    width: 100%;
    max-width: none;
    max-height: min(82vh, 40rem);
    margin: 0;
    border-radius: 1rem 1rem 0 0;
    padding: 1.25rem 1.1rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.18);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    animation: dolphin-es-drawer-up 0.28s ease-out;
    will-change: transform;
    touch-action: pan-y;
  }

  .dolphin-es__dialog.is-dragging {
    animation: none;
  }

  /* Mobile: high-contrast close over hero image + drag handle */
  .dolphin-es__close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 8;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 0;
    background: #0f172a;
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.4);
  }

  .dolphin-es__close:hover,
  .dolphin-es__close:active,
  .dolphin-es__close:focus-visible {
    background: #1e293b;
    color: #ffffff;
    outline: none;
  }

  .dolphin-es--book .dolphin-es__close,
  .dolphin-es--content .dolphin-es__close {
    top: 0.7rem;
    right: 0.7rem;
    color: #ffffff;
  }

  .dolphin-es__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
    height: 1.35rem;
    margin: 0;
    padding: 0.45rem 0 0.2rem;
    background: transparent;
    pointer-events: none;
  }

  .dolphin-es__handle-bar {
    width: 2.75rem;
    height: 0.32rem;
    background: #334155;
  }

  .dolphin-es--book .dolphin-es__dialog,
  .dolphin-es--content .dolphin-es__dialog {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    width: 100%;
    min-height: 0;
    max-height: min(82vh, 42rem);
    border-radius: 1rem 1rem 0 0;
    padding: 0;
    overflow: auto;
  }

  .dolphin-es--book .dolphin-es__handle,
  .dolphin-es--content .dolphin-es__handle {
    grid-row: 1;
    grid-column: 1;
    position: absolute;
    top: 0.35rem;
    left: 0;
    right: 0;
    height: 1.5rem;
    padding: 0.55rem 0 0;
    z-index: 6;
  }

  .dolphin-es--book .dolphin-es__handle-bar,
  .dolphin-es--content .dolphin-es__handle-bar {
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(15, 23, 42, 0.35);
  }

  .dolphin-es--book .dolphin-es__media,
  .dolphin-es--content .dolphin-es__media {
    grid-row: 2;
    min-height: 8.5rem;
    max-height: 10.5rem;
  }

  .dolphin-es--book .dolphin-es__panel,
  .dolphin-es--content .dolphin-es__panel {
    grid-row: 3;
    padding: 1.1rem 1.1rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }

  .dolphin-es--book .dolphin-es__offer {
    font-size: 1.55rem;
  }

  .dolphin-es--book .dolphin-es__title,
  .dolphin-es--content .dolphin-es__title {
    font-size: 1.3rem;
  }

  .dolphin-es--book .dolphin-es__perks,
  .dolphin-es--content .dolphin-es__perks {
    gap: 0.4rem;
  }

  .dolphin-es--book .dolphin-es__perk-label,
  .dolphin-es--content .dolphin-es__perk-label {
    font-size: 0.62rem;
  }

  .dolphin-es__title {
    font-size: 1.25rem;
  }
}

@keyframes dolphin-es-drawer-up {
  from {
    transform: translateY(110%);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .dolphin-es__dialog {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dolphin-es--book .dolphin-es__dialog {
    padding: 0;
  }
}
