/* ========================================================
   访客来访弹窗样式 (Animated Characters Visitor Modal)
   ======================================================== */

.visitor-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
  box-sizing: border-box;
}

.visitor-modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.visitor-modal-card {
  position: relative;
  width: 100%;
  max-width: 920px;
  min-height: 540px;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  overflow: hidden;
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.visitor-modal-backdrop.is-active .visitor-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* 关闭按钮 */
.visitor-modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(241, 245, 249, 0.9);
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: all 0.2s ease;
}

.visitor-modal-close-btn:hover {
  background: #0f172a;
  color: #ffffff;
  transform: rotate(90deg);
}

/* ================= 左侧卡通角色动画舞台 ================= */
.visitor-stage-panel {
  width: 48%;
  background: #f1f3f7;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid #e2e8f0;
}

.visitor-stage {
  position: relative;
  width: 340px;
  height: 340px;
  transform-origin: bottom center;
}

/* 角色 1：紫色 (Purple) */
.char-purple {
  position: absolute;
  left: 55px;
  bottom: 0;
  width: 130px;
  height: 260px;
  z-index: 10;
  transform-origin: bottom center;
  transition: transform 0.05s ease-out;
}

.char-purple svg.char-body-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  overflow: visible;
}

.char-purple-face {
  position: absolute;
  width: 100%;
  top: 40px;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.char-purple-eyes {
  display: flex;
  gap: 12px;
}

.char-eye-white {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: height 0.15s ease;
}

.char-pupil-black {
  width: 6px;
  height: 6px;
  background: #111827;
  border-radius: 50%;
  position: absolute;
  transition: transform 0.05s ease-out;
}

.char-purple-mouth {
  width: 12px;
  height: 4px;
  background: #111827;
  border-radius: 2px;
  margin-top: 8px;
  transition: all 0.2s ease;
}

/* 角色 2：黑色柱状 (Black) */
.char-black {
  position: absolute;
  left: 135px;
  bottom: 0;
  width: 80px;
  height: 210px;
  z-index: 30;
  transform-origin: bottom center;
  transition: transform 0.05s ease-out;
}

.char-black svg.char-body-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  overflow: visible;
}

.char-black-face {
  position: absolute;
  width: 100%;
  top: 36px;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.char-black-eyes {
  display: flex;
  gap: 10px;
  padding-left: 10px;
}

/* 角色 3：黄色半圆柱 (Yellow) */
.char-yellow {
  position: absolute;
  left: 205px;
  bottom: 0;
  width: 95px;
  height: 170px;
  background: #ecd842;
  border-radius: 47.5px 47.5px 0 0;
  z-index: 40;
  transform-origin: bottom center;
  overflow: hidden;
  transition: transform 0.05s ease-out;
}

.char-yellow-face {
  padding-top: 38px;
  padding-left: 24px;
  pointer-events: none;
}

.char-yellow-eye {
  width: 10px;
  height: 10px;
  background: #111827;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  margin-left: 6px;
  transition: height 0.15s ease;
}

.char-yellow-pupil {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
}

.char-yellow-mouth {
  width: 50px;
  height: 4px;
  background: #111827;
  border-radius: 2px;
  margin-top: 12px;
  transform: rotate(-6deg);
  transform-origin: left center;
  transition: all 0.2s ease;
}

/* 角色 4：橙色半圆 (Orange - Front) */
.char-orange {
  position: absolute;
  left: -80px;
  bottom: 0;
  width: 240px;
  height: 95px;
  background: #fb8b46;
  border-radius: 120px 120px 0 0;
  z-index: 50;
  transform-origin: bottom center;
  overflow: hidden;
  display: flex;
  justify-content: center;
  transition: transform 0.05s ease-out;
}

.char-orange-face {
  margin-top: 28px;
  margin-left: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.char-orange-eyes {
  display: flex;
  gap: 22px;
}

.char-orange-eye {
  width: 10px;
  height: 10px;
  background: #111827;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  transition: height 0.15s ease;
}

.char-orange-pupil {
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
}

.char-orange-mouth {
  margin-top: 5px;
}

/* 角色眨眼/眨眼闭合类 */
.eyes-blink .char-eye-white,
.eyes-blink .char-yellow-eye,
.eyes-blink .char-orange-eye {
  height: 3px !important;
}

/* 点头与呼吸动画 */
.nodding-animation {
  animation: charNod 0.4s ease;
}

@keyframes charNod {
  0% { transform: translateY(0); }
  50% { transform: translateY(16px); }
  100% { transform: translateY(0); }
}

/* ================= 右侧表单操作面板 ================= */
.visitor-form-panel {
  width: 52%;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.visitor-star-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.visitor-star-icon svg {
  width: 32px;
  height: 32px;
  fill: #0f172a;
}

.visitor-title {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  text-align: center;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.visitor-subtitle {
  font-size: 13.5px;
  color: #64748b;
  text-align: center;
  margin: 0 0 28px 0;
}

/* 头像选择列表 */
.visitor-avatars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.visitor-avatar-item {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  overflow: hidden;
  cursor: pointer;
  background: #f8fafc;
  opacity: 0.75;
  filter: grayscale(20%);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 0;
}

.visitor-avatar-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visitor-avatar-item:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: translateY(-3px) scale(1.05);
}

.visitor-avatar-item.is-selected {
  border-color: #0f172a;
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.12);
  box-shadow: 0 8px 20px -2px rgba(15, 23, 42, 0.25);
}

.visitor-avatar-upload-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px dashed #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.visitor-avatar-upload-btn:hover {
  border-color: #0f172a;
  color: #0f172a;
  transform: rotate(90deg) scale(1.05);
}

/* 输入框区域 */
.visitor-input-group {
  margin-bottom: 22px;
}

.visitor-input-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  margin-left: 4px;
}

.visitor-input-field {
  width: 100%;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
  font-family: inherit;
}

.visitor-input-field:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* 提交登录按钮 */
.visitor-submit-btn {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  border: none;
  background: #0f172a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.visitor-submit-btn:hover:not(:disabled) {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.4);
}

.visitor-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.visitor-submit-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.visitor-submit-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.visitor-submit-btn:hover:not(:disabled) svg {
  transform: translateX(4px);
}

.visitor-footer-caption {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #94a3b8;
  text-transform: uppercase;
}

/* ================= 导航栏访客身份卡胶囊 ================= */
.visitor-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 14px 4px 6px;
  border-radius: 9999px;
  cursor: pointer;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
  margin-right: 14px;
}

.visitor-profile-pill:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.visitor-profile-pill img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.visitor-profile-pill .pill-title {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  margin-right: 2px;
}

/* ================= 移动端响应式适配 ================= */
@media (max-width: 768px) {
  .visitor-modal-backdrop {
    padding: 12px;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .visitor-modal-card {
    flex-direction: column;
    width: 100%;
    max-height: 92vh;
    margin: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45);
  }
  .visitor-stage-panel {
    width: 100%;
    height: 120px;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
  .visitor-stage {
    transform: scale(0.48);
    bottom: -50px;
  }
  .visitor-form-panel {
    width: 100%;
    padding: 18px 16px;
    box-sizing: border-box;
  }
  .visitor-star-icon {
    margin-bottom: 6px;
  }
  .visitor-star-icon svg {
    width: 24px;
    height: 24px;
  }
  .visitor-title {
    font-size: 20px;
    margin-bottom: 4px;
  }
  .visitor-subtitle {
    font-size: 12px;
    margin-bottom: 14px;
  }
  .visitor-avatars-row {
    gap: 8px;
    margin-bottom: 16px;
  }
  .visitor-avatar-item,
  .visitor-avatar-upload-btn {
    width: 44px;
    height: 44px;
  }
  .visitor-input-group {
    margin-bottom: 14px;
  }
  .visitor-input-label {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .visitor-input-field {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 14px;
  }
  .visitor-submit-btn {
    padding: 13px;
    font-size: 15px;
    border-radius: 14px;
  }
  .visitor-footer-caption {
    margin-top: 12px;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .visitor-profile-pill {
    padding: 3px 8px 3px 4px;
    font-size: 11px;
    margin-right: 6px;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .visitor-profile-pill img {
    width: 20px;
    height: 20px;
  }
}
