/* ===== 外层容器 ===== */
rc {
  display: block;
  position: relative;
  background: #FAF7F2;
  border-radius: 16px;
  padding: clamp(16px, 4vw, 28px);
  margin: 16px auto;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  overflow: hidden;
  color: #2C2C2C;
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.8;
}

rc::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: rc-shimmer 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

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

/* ===== 正文区域 ===== */
rc article {
  padding: 12px 0;
}

rc article p {
  margin: 0 0 12px 0;
}

rc article p:last-child {
  margin-bottom: 0;
}

/* ===== 对话气泡系统 ===== */

/* 玩家对话 - 蓝色系 */
.mc {
  display: inline-block;
  background: linear-gradient(135deg, rgba(30,91,168,0.1), rgba(30,91,168,0.18));
  color: #1E5BA8;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 10px;
  border-left: 3px solid #1E5BA8;
  box-shadow: 0 1px 4px rgba(30,91,168,0.1);
  transition: all 0.2s ease;
}

.mc:hover {
  background: #1E5BA8;
  color: #fff;
  transform: translateX(3px);
  box-shadow: 0 3px 10px rgba(30,91,168,0.25);
}

/* ===== 陈星晚对话 - 改为红色系 ===== */
.chen {
  display: inline-block;
  background: linear-gradient(135deg, rgba(198,40,40,0.1), rgba(198,40,40,0.18));
  color: #C62828;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(198,40,40,0.1);
  transition: all 0.25s ease;
}

.chen:hover {
  background: #C62828;
  color: #fff;
  transform: scale(1.03);
  box-shadow: 0 3px 10px rgba(198,40,40,0.25);
}

/* NPC对话 - 绿色系（与玩家和女主区分） */
.npc {
  display: inline-block;
  background: linear-gradient(135deg, rgba(40,167,69,0.1), rgba(40,167,69,0.18));
  color: #28A745;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 10px;
  border-left: 3px solid #28A745;
  box-shadow: 0 1px 4px rgba(40,167,69,0.1);
  transition: all 0.2s ease;
}

.npc:hover {
  background: #28A745;
  color: #fff;
  transform: translateX(3px);
  box-shadow: 0 3px 10px rgba(40,167,69,0.25);
}

/* 手机消息 - 深灰科技感 */
.phone {
  display: inline-block;
  background: linear-gradient(135deg, rgba(44,62,80,0.08), rgba(44,62,80,0.16));
  color: #2C3E50;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid rgba(44,62,80,0.15);
  box-shadow: 0 1px 4px rgba(44,62,80,0.08);
  transition: all 0.2s ease;
}

.phone:hover {
  background: #2C3E50;
  color: #F8E6D0;
  box-shadow: 0 3px 10px rgba(44,62,80,0.2);
}

/* ===== 内心独白 - 改为紫色系 ===== */
.inner-voice {
  display: block;
  background: rgba(126,87,194,0.1);
  color: #7E57C2;
  font-style: italic;
  font-weight: 500;
  padding: 8px 14px;
  margin-top: 8px;
  border-radius: 5px;
  border-left: 3px solid #7E57C2;
  box-shadow: 0 1px 4px rgba(126,87,194,0.08);
  transition: all 0.25s ease;
}

.inner-voice:hover {
  background: #7E57C2;
  color: #fff;
  transform: scale(1.02);
  box-shadow: 0 3px 10px rgba(126,87,194,0.2);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ===== 通用折叠面板 ===== */
rc details {
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

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

rc details summary {
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  color: #2C2C2C;
  list-style: none;
  position: relative;
  transition: background-size 0.3s ease, padding-left 0.3s ease, color 0.3s ease;
  background: linear-gradient(to right, rgba(0,0,0,0.04), rgba(0,0,0,0.04)) no-repeat left center;
  background-size: 0% 100%;
}

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

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

rc details[open] summary {
  border-bottom: 2px solid rgba(212,175,55,0.3);
}

/* ===== 折叠面板内容区通用 ===== */
rc details > div,
rc details > p {
  padding: 10px 16px;
  animation: rc-fadeIn 0.3s ease;
}

@keyframes rc-fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

rc details p {
  margin: 0 0 6px 0;
}

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

/* 字段名金色高亮 */
rc details b {
  color: #D4AF37;
}

/* ===== 思维链面板 ===== */
.think-section {
  border-left: 3px solid #7952B3;
}

.think-section summary {
  color: #7952B3;
}

.think-content {
  padding: 10px 16px;
}

.think-content b {
  display: block;
  color: #7952B3;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: clamp(13px, 2.2vw, 15px);
}

.think-content b:first-child {
  margin-top: 0;
}

.think-content p {
  margin: 0 0 4px 0;
  padding-left: 8px;
  font-size: clamp(12.5px, 2.2vw, 14px);
  color: #555;
}

/* ===== 世界信息面板 ===== */
.world-info {
  border-left: 3px solid #2C3E50;
}

.world-info summary {
  background: linear-gradient(135deg, #2C3E50, #34495E);
  color: #F8E6D0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  border-radius: 10px 10px 0 0;
  position: relative;
}

.world-info summary::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: #D4AF37;
  border-radius: 0 10px 0 0;
  box-shadow: 0 0 8px rgba(212,175,55,0.4);
}

.world-info summary:hover {
  background-size: 0% 100%;
  padding-left: 16px;
  color: #F8E6D0;
}

.world-info[open] summary {
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid rgba(212,175,55,0.3);
}

.loc-time {
  font-weight: 600;
  color: #2C3E50;
  font-size: clamp(13px, 2.3vw, 15px);
}

.scene-desc {
  color: #666;
  font-style: italic;
  font-size: clamp(12px, 2vw, 14px);
}

/* ===== 玩家信息卡 ===== */
.player-card {
  border-left: 3px solid #1E5BA8;
}

.player-card summary {
  color: #1E5BA8;
}

/* ===== 女主信息卡 ===== */
.heroine-card {
  border-left: 3px solid #D63384;
}

.heroine-card summary {
  color: #D63384;
}

/* ===== 关系状态卡 ===== */
.relation-card {
  border-left: 3px solid #E74C3C;
}

.relation-card summary {
  color: #E74C3C;
}

/* ===== 进度条修复 - 覆盖通用padding ===== */
.progress-bar {
  width: 100% !important;
  height: 12px !important;
  background: rgba(0,0,0,0.08) !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  margin: 8px 16px 12px 16px !important;
  padding: 0 !important;
  position: relative !important;
  display: block !important;
  box-sizing: border-box !important;
}

.progress-fill {
  height: 100% !important;
  min-height: 12px !important;
  border-radius: 6px !important;
  transition: width 0.5s ease !important;
  display: block !important;
  padding: 0 !important;
  background: linear-gradient(90deg, #5DADE2, #3498DB) !important;
}

.progress-fill.lv1 {
  background: linear-gradient(90deg, #BDC3C7, #95A5A6) !important;
}

.progress-fill.lv2 {
  background: linear-gradient(90deg, #5DADE2, #3498DB) !important;
}

.progress-fill.lv3 {
  background: linear-gradient(90deg, #F39C12, #E67E22) !important;
}

.progress-fill.lv4 {
  background: linear-gradient(90deg, #E74C3C, #C0392B) !important;
}

.progress-fill.lv5 {
  background: linear-gradient(90deg, #D4AF37, #F1C40F) !important;
  box-shadow: 0 0 10px rgba(212,175,55,0.4) !important;
}

/* ===== 好感变化修复 ===== */
.favor-change {
  font-weight: 700 !important;
  font-size: clamp(12px, 2vw, 14px) !important;
  margin-left: 6px !important;
  color: #999 !important;
}

span.favor-change.up {
  color: #27AE60 !important;
}

span.favor-change.down {
  color: #E74C3C !important;
}

/* ===== 行动推荐 ===== */
.action-card {
  border-left: 3px solid #D4AF37;
}

.action-card summary {
  color: #B8960C;
}

.action-section {
  margin-bottom: 10px;
}

.action-title {
  margin-bottom: 6px;
}

.action-item {
  display: flex;
  align-items: flex-start;
  padding: 6px 10px;
  margin-bottom: 4px;
  background: rgba(212,175,55,0.06);
  border-radius: 6px;
  transition: background 0.2s ease;
}

.action-item:hover {
  background: rgba(212,175,55,0.15);
}

.action-icon {
  margin-right: 8px;
  flex-shrink: 0;
}

.action-label {
  font-weight: 600;
  color: #B8960C;
  margin-right: 4px;
  white-space: nowrap;
}

.location-section {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 10px;
}

.location-title {
  margin-bottom: 6px;
}

.location-item {
  padding: 5px 10px;
  margin-bottom: 4px;
  background: rgba(44,62,80,0.04);
  border-radius: 6px;
  font-size: clamp(12.5px, 2.2vw, 14px);
}

.loc-name {
  font-weight: 600;
  color: #2C3E50;
}

.distance {
  color: #999;
  font-size: clamp(11px, 1.8vw, 13px);
}

/* ===== 通用分隔线 ===== */
rc hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #D4AF37, transparent);
  opacity: 0.5;
  margin: 14px 0;
}

/* ===== 移动端适配 ===== */
@media (max-width: 600px) {
  rc {
    margin: 12px;
    padding: 16px;
    border-radius: 12px;
  }

  rc details summary {
    padding: 8px 12px;
    font-size: 13px;
  }

  rc details > div,
  rc details > p {
    padding: 8px 12px;
  }

  .think-content {
    padding: 8px 12px;
  }

  .world-info summary {
    font-size: 13px;
  }

  .action-item {
    padding: 5px 8px;
  }

  .mc, .chen, .npc, .phone {
    padding: 3px 10px;
  }
}