/* ========== 容器主体 ========== */
scene {
  display: block;
  max-width: 900px;
  margin: 20px auto;
  padding: clamp(16px, 4vw, 28px);
  background: #FAF7F2;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

scene::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer 8s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

/* ========== 正文区域 ========== */
text {
  display: block;
  line-height: 1.8;
  color: #2C2C2C;
  margin-bottom: 18px;
  font-size: clamp(14px, 2.5vw, 16px);
}

text p {
  margin: 0 0 12px 0;
}

text p:last-child {
  margin-bottom: 0;
}

/* ========== 对话气泡（超鲜明配色 + 悬停显示💬） ========== */
u {
  color: #1E5BA8;
  background: linear-gradient(135deg, rgba(30, 91, 168, 0.2), rgba(30, 91, 168, 0.12));
  padding: 3px 12px 3px 8px;
  border-radius: 8px;
  border-left: 3px solid #1E5BA8;
  font-weight: 600;
  display: inline-block;
  margin: 2px 0;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(30, 91, 168, 0.15);
  position: relative;
}

u::before {
  content: '💬';
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  font-size: 16px;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

u:hover::before {
  transform: translateY(-50%) scale(1);
  opacity: 1;
  left: -26px;
}

u:hover {
  background: #1E5BA8;
  color: #FFFFFF;
  transform: translateX(3px);
  box-shadow: 0 4px 10px rgba(30, 91, 168, 0.35);
}

q {
  color: #D63384;
  background: linear-gradient(135deg, rgba(214, 51, 132, 0.18), rgba(214, 51, 132, 0.1));
  padding: 3px 14px 3px 8px;
  border-radius: 14px;
  font-weight: 600;
  display: inline-block;
  margin: 2px 0;
  transition: all 0.2s ease;
  quotes: none;
  box-shadow: 0 2px 6px rgba(214, 51, 132, 0.2);
  position: relative;
}

q::before {
  content: '💬';
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  font-size: 16px;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

q:hover::before {
  transform: translateY(-50%) scale(1);
  opacity: 1;
  left: -26px;
}

q:hover {
  background: #D63384;
  color: #FFFFFF;
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(214, 51, 132, 0.4);
}

/* ========== 折叠状态栏 ========== */
details {
  background: #FFFFFF;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s ease;
  padding: 14px 18px;
}

details:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #D4AF37;
}

details summary {
  padding: 12px 18px;
  margin: -14px -18px 0 -18px;
  cursor: pointer;
  font-weight: 600;
  color: #2C2C2C;
  font-size: clamp(14px, 2.3vw, 15px);
  user-select: none;
  position: relative;
  transition: all 0.2s ease;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.06) 0%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
}

details summary:hover {
  background-size: 100% 100%;
  padding-left: 24px;
}

details summary::marker {
  color: #D4AF37;
}

details[open] summary {
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 14px;
}

details p {
  margin: 6px 0;
  padding-left: 10px;
  color: #2C2C2C;
  font-size: clamp(13px, 2.2vw, 14px);
  line-height: 1.6;
}

details p:last-child {
  margin-bottom: 0;
}

details b {
  color: #D4AF37;
  font-weight: 600;
}

/* ========== 好感度进度条（四级配色） ========== */
.progress-bar {
  width: 100%;
  height: 22px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin: 10px 0 12px 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1), background 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.progress-fill.lv1 {
  background: linear-gradient(90deg, #3A5BA0, #4A6BB0);
  box-shadow: 0 2px 8px rgba(58, 91, 160, 0.4);
}

.progress-fill.lv2 {
  background: linear-gradient(90deg, #C49A3D, #D4AA4D);
  box-shadow: 0 2px 8px rgba(196, 154, 61, 0.4);
}

.progress-fill.lv3 {
  background: linear-gradient(90deg, #D8704F, #E8805F);
  box-shadow: 0 2px 8px rgba(216, 112, 79, 0.4);
}

.progress-fill.lv4 {
  background: linear-gradient(90deg, #C94266, #D95276);
  box-shadow: 0 2px 8px rgba(201, 66, 102, 0.5);
}

/* ========== 好感度变动标记 ========== */
.favor-up {
  color: #28A745;
  font-weight: 700;
  font-size: 14px;
  padding: 2px 8px;
  background: rgba(40, 167, 69, 0.12);
  border-radius: 6px;
  display: inline-block;
  margin-left: 6px;
  animation: bounce-in 0.4s ease;
}

.favor-down {
  color: #DC3545;
  font-weight: 700;
  font-size: 14px;
  padding: 2px 8px;
  background: rgba(220, 53, 69, 0.12);
  border-radius: 6px;
  display: inline-block;
  margin-left: 6px;
  animation: bounce-in 0.4s ease;
}

@keyframes bounce-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ========== 内心话区域 ========== */
.inner-voice {
  background: linear-gradient(135deg, rgba(121, 82, 179, 0.12), rgba(121, 82, 179, 0.06));
  border-left: 3px solid #5A3A8C;
  padding: 10px 14px;
  margin: 12px -10px 0 -10px;
  border-radius: 8px;
  color: #C72C48;
  font-style: italic;
  font-size: clamp(13px, 2.2vw, 14px);
  line-height: 1.6;
  box-shadow: 0 2px 6px rgba(121, 82, 179, 0.15);
}

/* ========== 行动推荐卡片 ========== */
.action-card {
  background: linear-gradient(135deg, #FFFFFF, #F8F9FA);
  border-left: 3px solid #D4AF37;
  padding: 10px 14px;
  margin: 8px -10px;
  border-radius: 8px;
  font-size: clamp(13px, 2.2vw, 14px);
  color: #2C2C2C;
  transition: all 0.25s ease;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.action-card:hover {
  background: linear-gradient(135deg, #FFF9E6, #FFFBF0);
  border-left-width: 5px;
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.25);
}

.action-card:first-child {
  margin-top: 0;
}

.action-card:last-child {
  margin-bottom: 0;
}

/* ========== 响应式适配 ========== */
@media (max-width: 600px) {
  scene {
    margin: 12px;
    padding: 16px;
    border-radius: 12px;
  }

  u::before, q::before {
    font-size: 14px;
    left: -20px;
  }

  u:hover::before, q:hover::before {
    left: -24px;
  }

  details {
    padding: 12px 14px;
  }

  details summary {
    padding: 10px 14px;
    margin: -12px -14px 0 -14px;
    font-size: 14px;
  }

  details[open] summary {
    margin-bottom: 12px;
  }

  details p {
    padding-left: 10px;
  }

  .progress-bar {
    height: 20px;
  }

  .action-card {
    padding: 8px 12px;
    margin: 8px -10px;
  }

  .inner-voice {
    margin: 12px -10px 0 -10px;
  }
}

@media (max-width: 400px) {
  scene {
    margin: 8px;
    padding: 12px;
  }

  text {
    font-size: 14px;
  }

  u, q {
    padding: 2px 8px 2px 6px;
    font-size: 13px;
  }

  .favor-up, .favor-down {
    font-size: 12px;
    padding: 1px 6px;
  }

  details {
    padding: 10px 12px;
  }

  details summary {
    margin: -10px -12px 0 -12px;
  }

  details p {
    padding-left: 8px;
  }
}