/* 亦虎留资组件 v1.0.0：所有选择器均以 yhlc- 前缀隔离，不依赖外部字体或 CDN。 */
.yhlc-widget,
.yhlc-widget *,
.yhlc-widget *::before,
.yhlc-widget *::after {
  box-sizing: border-box;
}

.yhlc-launcher,
.yhlc-overlay,
.yhlc-dialog,
.yhlc-dialog button,
.yhlc-dialog input,
.yhlc-dialog textarea {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* 右下角悬浮入口 */
.yhlc-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
  height: 50px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #1F7A6B;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 14px 32px -12px rgba(31, 122, 107, 0.62), 0 4px 12px rgba(24, 92, 81, 0.16);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.yhlc-launcher:hover {
  background: #185C51;
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -12px rgba(31, 122, 107, 0.7), 0 5px 14px rgba(24, 92, 81, 0.2);
}

.yhlc-launcher:active {
  transform: translateY(0);
}

.yhlc-launcher:focus-visible,
.yhlc-close:focus-visible,
.yhlc-submit:focus-visible {
  outline: 3px solid rgba(31, 122, 107, 0.34);
  outline-offset: 3px;
}

.yhlc-launcher-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.yhlc-launcher-text {
  display: inline-block;
}

/* 页面底部预留，避免悬浮入口压住页脚最后一行内容 */
.yhlc-spacer {
  width: 1px;
  height: 76px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

/* 浮层 */
.yhlc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 28, 24, 0.54);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: yhlc-fade-in 0.18s ease-out both;
}

.yhlc-overlay[hidden],
.yhlc-form[hidden],
.yhlc-success[hidden],
.yhlc-field-error[hidden],
.yhlc-form-error[hidden] {
  display: none !important;
}

.yhlc-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 28px;
  overflow-y: auto;
  border: 1px solid rgba(228, 234, 231, 0.9);
  border-radius: 22px;
  background: #fff;
  color: #1E2A27;
  box-shadow: 0 30px 80px -24px rgba(9, 25, 20, 0.5), 0 10px 28px rgba(9, 25, 20, 0.16);
  animation: yhlc-pop-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.yhlc-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #F1F5F3;
  color: #52615C;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.yhlc-close:hover:not(:disabled) {
  background: #E3F0ED;
  color: #185C51;
}

.yhlc-close:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.yhlc-head {
  padding-right: 40px;
}

.yhlc-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #E3F0ED;
  color: #185C51;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.yhlc-title {
  margin: 0;
  color: #1E2A27;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.42;
  letter-spacing: 0.01em;
}

.yhlc-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.yhlc-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.yhlc-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #3F4F4A;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
}

.yhlc-required {
  color: #C24636;
  font-weight: 800;
}

.yhlc-optional {
  color: #7A8A84;
  font-size: 12.5px;
  font-weight: 400;
}

.yhlc-input,
.yhlc-textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #DCE5E1;
  border-radius: 12px;
  background: #FAFCFB;
  color: #1E2A27;
  font-size: 14.5px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.yhlc-textarea {
  min-height: 104px;
  max-height: 220px;
  resize: vertical;
}

.yhlc-input::placeholder,
.yhlc-textarea::placeholder {
  color: #9AA9A4;
}

.yhlc-input:hover,
.yhlc-textarea:hover {
  border-color: #C5D6D0;
}

.yhlc-input:focus,
.yhlc-textarea:focus {
  border-color: #1F7A6B;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 122, 107, 0.14);
}

.yhlc-input[aria-invalid="true"],
.yhlc-textarea[aria-invalid="true"] {
  border-color: #C24636;
  background: #FFFDFC;
  box-shadow: 0 0 0 3px rgba(194, 70, 54, 0.09);
}

.yhlc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 16px;
}

.yhlc-hint,
.yhlc-counter {
  color: #86968F;
  font-size: 11.5px;
  line-height: 1.45;
}

.yhlc-counter {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yhlc-field-error {
  margin: -1px 0 0;
  color: #B23A2C;
  font-size: 12px;
  line-height: 1.5;
}

.yhlc-form-error {
  padding: 10px 12px;
  border: 1px solid #F2CEC7;
  border-radius: 10px;
  background: #FDF1EF;
  color: #A83326;
  font-size: 13px;
  line-height: 1.55;
}

.yhlc-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin: 2px 0 0;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: #1F7A6B;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(31, 122, 107, 0.65);
  transition: background-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.yhlc-submit:hover:not(:disabled) {
  background: #185C51;
  transform: translateY(-1px);
}

.yhlc-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.yhlc-spinner {
  display: none;
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: yhlc-spin 0.7s linear infinite;
}

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

.yhlc-privacy {
  margin: -3px 0 0;
  color: #86968F;
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
}

.yhlc-success {
  padding: 30px 4px 10px;
  text-align: center;
  outline: none;
}

.yhlc-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #E3F0ED;
  color: #1F7A6B;
}

.yhlc-success-icon svg {
  width: 28px;
  height: 28px;
}

.yhlc-success-text {
  margin: 0;
  color: #1E2A27;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
}

@keyframes yhlc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes yhlc-pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes yhlc-sheet-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* 移动端缩成小圆钮，底部留白保证页脚正文不被遮挡 */
@media (max-width: 640px) {
  .yhlc-launcher {
    right: 14px;
    bottom: 14px;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    flex-direction: column;
    gap: 1px;
    width: 58px;
    min-width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
    font-size: 12px;
    letter-spacing: 0.02em;
  }

  .yhlc-launcher-icon {
    width: 17px;
    height: 17px;
  }

  .yhlc-launcher-text {
    line-height: 1.1;
  }

  .yhlc-spacer {
    height: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .yhlc-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .yhlc-dialog {
    max-width: none;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    animation-name: yhlc-sheet-in;
  }

  .yhlc-title {
    font-size: 19px;
  }

  .yhlc-form {
    gap: 15px;
    margin-top: 18px;
  }

  .yhlc-input,
  .yhlc-textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yhlc-launcher,
  .yhlc-overlay,
  .yhlc-dialog,
  .yhlc-spinner {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .yhlc-launcher,
  .yhlc-launcher-text,
  .yhlc-kicker,
  .yhlc-label,
  .yhlc-optional,
  .yhlc-hint,
  .yhlc-counter,
  .yhlc-field-error,
  .yhlc-form-error,
  .yhlc-privacy {
    font-size: 14px;
  }

  .yhlc-close {
    min-width: 44px;
    min-height: 44px;
  }
}
