/**
 * 考拉老师弹窗组件 - 样式表
 * 一建AI私教 | 每天首次访问自动弹出，提供情绪价值
 */

/* ===== 遮罩层 ===== */
.koala-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.koala-overlay.koala-visible {
  opacity: 1;
  visibility: visible;
}

/* ===== 弹窗主体 ===== */
.koala-modal {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255,255,255,0.1);
  max-width: 520px;
  width: 90%;
  padding: 32px;
  position: relative;
  z-index: 99999;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.koala-overlay.koala-visible .koala-modal {
  transform: translateY(0) scale(1);
}

/* 顶部装饰条 */
.koala-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #818cf8, #4f46e5);
  background-size: 200% 100%;
  animation: koala-shimmer 3s ease infinite;
}

@keyframes koala-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== 内容区域 ===== */
.koala-content {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* 考拉图片 */
.koala-avatar {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
  border: 3px solid #e8e5ff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
  transition: transform 0.3s ease;
}

.koala-avatar:hover {
  transform: scale(1.05) rotate(-2deg);
}

/* 文案区域 */
.koala-text {
  flex: 1;
  min-width: 0;
}

.koala-greeting {
  font-size: 14px;
  color: #4f46e5;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.koala-message {
  font-size: 17px;
  line-height: 1.7;
  color: #1e293b;
  font-weight: 400;
  word-break: break-word;
}

/* ===== 关闭按钮 ===== */
.koala-close-btn {
  display: block;
  margin: 24px auto 0;
  padding: 10px 36px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

.koala-close-btn:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.koala-close-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ===== 倒计时提示（可选） ===== */
.koala-countdown {
  margin-top: 12px;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

/* ===== 移动端适配 ===== */
@media (max-width: 520px) {
  .koala-modal {
    padding: 24px 20px;
    border-radius: 16px;
    width: 94%;
  }

  .koala-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .koala-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }

  .koala-message {
    font-size: 16px;
  }

  .koala-greeting {
    font-size: 13px;
  }

  .koala-close-btn {
    margin-top: 20px;
    padding: 10px 32px;
    font-size: 14px;
  }
}

/* ===== 超小屏幕适配 ===== */
@media (max-width: 360px) {
  .koala-modal {
    padding: 20px 16px;
  }

  .koala-avatar {
    width: 80px;
    height: 80px;
  }

  .koala-message {
    font-size: 15px;
  }
}

/* ===== 减弱动画（用户偏好） ===== */
@media (prefers-reduced-motion: reduce) {
  .koala-overlay,
  .koala-modal,
  .koala-avatar,
  .koala-close-btn {
    transition: none !important;
    animation: none !important;
  }
}
