/* ==========================================================================
   「/构造」AI 灵动状态气泡 (SillyTavern 风格 HTML 状态卡) 视觉样式库
   ========================================================================== */

/* 卡片外层安全包裹容器 */
.construct-card-wrapper {
  max-width: 92%;
  margin: 6px 0;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  user-select: text;
  word-break: break-word;
}

.construct-card-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.construct-card-wrapper.me {
  margin-left: auto;
}

.construct-card-wrapper.them {
  margin-right: auto;
}

/* 卡片入场弹性缩放动画 */
.construct-card-enter {
  animation: constructCardPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes constructCardPop {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 生成中：呼吸骨架屏样式 */
.construct-card-loading-box {
  min-width: 240px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #2b2520 0%, #3d342c 100%);
  border: 1px solid rgba(220, 180, 120, 0.3);
  border-radius: 18px;
  color: #f7e7ce;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.construct-card-loading-box::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
  animation: constructShimmer 1.8s infinite linear;
}

@keyframes constructShimmer {
  0% {
    left: -150%;
  }
  100% {
    left: 150%;
  }
}

.construct-loading-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.construct-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(240, 200, 140, 0.3);
  border-top-color: #f0c88c;
  border-radius: 50%;
  animation: constructSpin 0.8s infinite linear;
}

@keyframes constructSpin {
  100% {
    transform: rotate(360deg);
  }
}

.construct-loading-title {
  font-size: 13px;
  font-weight: bold;
  color: #f0c88c;
  letter-spacing: 0.5px;
}

.construct-loading-prompt {
  font-size: 12px;
  color: rgba(247, 231, 206, 0.7);
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.4;
  font-style: italic;
}

/* 内部卡片重置规则（防止外部 CSS 意外影响 AI 的设计） */
.construct-card-wrapper * {
  box-sizing: border-box;
}

.construct-card-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
