/* ============================
   0. 思维链隐藏
   ============================ */
think {
  display: none !important;
}

/* ============================
   1. 总容器 - 废土档案外壳
   ============================ */
.wasteland-wrapper {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(18, 20, 22, 0.97) 0%,
    rgba(25, 28, 25, 0.97) 50%,
    rgba(20, 22, 24, 0.97) 100%
  );
  border: 1px solid rgba(232, 168, 73, 0.25);
  border-left: 3px solid rgba(232, 168, 73, 0.6);
  border-radius: 6px;
  padding: 16px 14px;
  margin: 8px 0;
  color: #d4cfc6;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  box-shadow:
    0 0 20px rgba(232, 168, 73, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: campfire-breathe 4s ease-in-out infinite;
  overflow: hidden;
}

/* 篝火呼吸灯 - 边框亮度脉动 */
@keyframes campfire-breathe {
  0%, 100% {
    border-left-color: rgba(232, 168, 73, 0.5);
    box-shadow:
      0 0 20px rgba(232, 168, 73, 0.06),
      0 4px 16px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }
  50% {
    border-left-color: rgba(232, 168, 73, 0.8);
    box-shadow:
      0 0 28px rgba(232, 168, 73, 0.12),
      0 4px 16px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }
}

/* 容器内段落基础样式 */
.wasteland-wrapper p {
  margin: 4px 0;
  line-height: 1.7;
}

/* ============================
   2. Details/Summary 折叠块通用
   ============================ */
.wasteland-wrapper details {
  background: rgba(12, 14, 16, 0.6);
  border: 1px solid rgba(232, 168, 73, 0.12);
  border-radius: 4px;
  margin: 8px 0;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.wasteland-wrapper details:hover {
  border-color: rgba(232, 168, 73, 0.3);
}

.wasteland-wrapper details[open] {
  border-color: rgba(232, 168, 73, 0.25);
}

.wasteland-wrapper summary {
  background: linear-gradient(
    90deg,
    rgba(30, 42, 30, 0.9) 0%,
    rgba(25, 35, 28, 0.7) 100%
  );
  color: #e8a849;
  font-weight: bold;
  font-size: 14.5px;
  padding: 9px 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.3s ease, padding-left 0.2s ease;
  border-bottom: 1px solid rgba(232, 168, 73, 0.08);
  letter-spacing: 0.5px;
}

.wasteland-wrapper summary::-webkit-details-marker {
  display: none;
}

/* summary 前面的展开箭头 */
.wasteland-wrapper summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
  transition: transform 0.25s ease;
  color: rgba(232, 168, 73, 0.7);
}

.wasteland-wrapper details[open] > summary::before {
  transform: rotate(90deg);
}

.wasteland-wrapper summary:hover {
  background: linear-gradient(
    90deg,
    rgba(40, 55, 38, 0.95) 0%,
    rgba(35, 48, 38, 0.8) 100%
  );
  padding-left: 18px;
}

/* 折叠块内部内容区 */
.wasteland-wrapper details > *:not(summary) {
  padding: 0 14px;
}

.wasteland-wrapper details > p:last-child {
  padding-bottom: 10px;
}

.wasteland-wrapper details > p:first-of-type {
  padding-top: 8px;
}

/* ============================
   3. 正文区 <text>
   ============================ */
.wasteland-wrapper text {
  display: block;
  background: rgba(15, 17, 19, 0.5);
  border-left: 2px solid rgba(139, 40, 40, 0.45);
  border-radius: 0 4px 4px 0;
  padding: 16px 18px;
  margin: 10px 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: #ddd8ce;
}

.wasteland-wrapper text p {
  margin: 10px 0;
  text-align: justify;
}

.wasteland-wrapper text p:first-child {
  margin-top: 0;
}

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

/* ============================
   4. 对话颜色区分
   ============================ */

/* 玩家对话 - 篝火琥珀暖色 */
.wasteland-wrapper .pc-dialog {
  color: #e8a849;
  background: rgba(232, 168, 73, 0.07);
  border-left: 2px solid rgba(232, 168, 73, 0.5);
  padding: 2px 8px 2px 10px;
  margin: 2px 0;
  display: inline;
  border-radius: 0 3px 3px 0;
  font-style: normal;
  text-shadow: 0 0 12px rgba(232, 168, 73, 0.15);
}

/* NPC对话 - 冷青蓝色 */
.wasteland-wrapper .npc-dialog {
  color: #7aafcf;
  background: rgba(122, 175, 207, 0.07);
  border-left: 2px solid rgba(122, 175, 207, 0.45);
  padding: 2px 8px 2px 10px;
  margin: 2px 0;
  display: inline;
  border-radius: 0 3px 3px 0;
  font-style: normal;
  text-shadow: 0 0 12px rgba(122, 175, 207, 0.12);
}

/* ============================
   5. 角色卡片
   ============================ */
.wasteland-wrapper .survivor-card {
  background: rgba(20, 23, 26, 0.7);
  border-radius: 5px;
  padding: 12px 14px;
  margin: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wasteland-wrapper .survivor-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.wasteland-wrapper .survivor-card p {
  margin: 3px 0;
  font-size: 13.5px;
  line-height: 1.65;
}

/* 领袖卡 - 金琥珀尊贵感 */
.wasteland-wrapper .leader-card {
  border-left: 3px solid rgba(232, 168, 73, 0.65);
  background: linear-gradient(
    135deg,
    rgba(232, 168, 73, 0.04) 0%,
    rgba(20, 23, 26, 0.7) 30%
  );
}

.wasteland-wrapper .leader-card:hover {
  border-left-color: rgba(232, 168, 73, 0.9);
  box-shadow: 0 2px 16px rgba(232, 168, 73, 0.08);
}

/* NPC卡 - 冷青蓝同伴 */
.wasteland-wrapper .npc-card {
  border-left: 3px solid rgba(122, 175, 207, 0.5);
  background: linear-gradient(
    135deg,
    rgba(122, 175, 207, 0.03) 0%,
    rgba(20, 23, 26, 0.7) 30%
  );
}

.wasteland-wrapper .npc-card:hover {
  border-left-color: rgba(122, 175, 207, 0.8);
  box-shadow: 0 2px 16px rgba(122, 175, 207, 0.06);
}

/* ============================
   6. 记忆档案特殊样式
   ============================ */

/* 长期记忆 - 旧档案泛黄感 */
.wasteland-wrapper details:last-of-type b {
  color: #c9b97a;
  font-size: 13.5px;
  letter-spacing: 0.3px;
}

/* 短期记忆条目 - 终端日志风 */
.wasteland-wrapper details:last-of-type p:not(:first-of-type):not(:last-of-type) {
  font-size: 13px;
  line-height: 1.6;
  color: #b0ab9e;
  padding-left: 4px;
}

/* ============================
   7. 战术与行动推荐
   ============================ */

/* 行动推荐所在的details - 用相邻选择策略 */
.wasteland-wrapper details[open]:last-of-type p {
  position: relative;
  transition: background 0.25s ease, padding-left 0.2s ease;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 4px 0;
}

/* 行动推荐悬浮效果 - 篝火发光 */
.wasteland-wrapper details[open]:last-of-type > p:hover {
  background: rgba(232, 168, 73, 0.08);
  padding-left: 16px;
  cursor: pointer;
  box-shadow: inset 2px 0 0 rgba(232, 168, 73, 0.5);
}

/* ============================
   8. 斜体提示文字
   ============================ */
.wasteland-wrapper i {
  color: #7a756a;
  font-size: 12.5px;
}

/* ============================
   9. 模块间分隔线
   ============================ */
.wasteland-wrapper > details + details::before,
.wasteland-wrapper > text + details::before,
.wasteland-wrapper > details + text::before {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(232, 168, 73, 0.25) 20%,
    rgba(232, 168, 73, 0.35) 50%,
    rgba(232, 168, 73, 0.25) 80%,
    transparent 100%
  );
  margin: 4px 0;
}

/* ============================
   10. 骰子/判定结果 - 终端风
   ============================ */
.wasteland-wrapper details p:last-of-type {
  font-family: "Courier New", "SF Mono", "Consolas", monospace;
}

/* ============================
   11. 自定义滚动条
   ============================ */
.wasteland-wrapper::-webkit-scrollbar {
  width: 5px;
}

.wasteland-wrapper::-webkit-scrollbar-track {
  background: rgba(12, 14, 16, 0.5);
}

.wasteland-wrapper::-webkit-scrollbar-thumb {
  background: rgba(232, 168, 73, 0.3);
  border-radius: 3px;
}

.wasteland-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 168, 73, 0.5);
}

/* ============================
   12. 移动端适配
   ============================ */
@media screen and (max-width: 600px) {
  .wasteland-wrapper {
    padding: 12px 10px;
    font-size: 14px;
    border-radius: 4px;
    margin: 4px 0;
  }

  .wasteland-wrapper summary {
    font-size: 13.5px;
    padding: 8px 10px;
  }

  .wasteland-wrapper summary:hover {
    padding-left: 10px;
  }

  .wasteland-wrapper text {
    padding: 12px 12px;
    font-size: 14.5px;
    line-height: 1.8;
  }

  .wasteland-wrapper .survivor-card {
    padding: 10px 10px;
  }

  .wasteland-wrapper .survivor-card p {
    font-size: 12.5px;
  }

  .wasteland-wrapper details > *:not(summary) {
    padding: 0 10px;
  }

  .wasteland-wrapper details[open]:last-of-type > p:hover {
    padding-left: 12px;
  }
}

/* ============================
   13. 触摸设备降级
   ============================ */
@media (hover: none) {
  .wasteland-wrapper summary:hover {
    padding-left: 14px;
  }

  .wasteland-wrapper details[open]:last-of-type > p:hover {
    background: none;
    padding-left: 10px;
    box-shadow: none;
  }

  .wasteland-wrapper .survivor-card:hover {
    box-shadow: none;
  }

  .wasteland-wrapper summary:active {
    background: linear-gradient(
      90deg,
      rgba(40, 55, 38, 0.95) 0%,
      rgba(35, 48, 38, 0.8) 100%
    );
  }

  .wasteland-wrapper details[open]:last-of-type > p:active {
    background: rgba(232, 168, 73, 0.08);
    box-shadow: inset 2px 0 0 rgba(232, 168, 73, 0.5);
  }
}