/* ===== 整体底框容器 ===== */
gamebox {
  display: block;
  background: linear-gradient(135deg, #FFF8F0 0%, #FFF0E6 50%, #FFF5ED 100%);
  border: 2px solid #FFCBA4;
  border-radius: 16px;
  padding: 18px 16px 14px;
  margin: 10px 4px;
  box-shadow: 0 4px 20px rgba(255, 160, 90, 0.15), 0 1px 4px rgba(0,0,0,0.06);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #3D3028;
  line-height: 1.75;
  position: relative;
  overflow: hidden;
}

/* 底框右上角装饰小辣椒 */
gamebox::before {
  content: "🌶️";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 18px;
  opacity: 0.35;
  pointer-events: none;
}

/* ===== 顶部信息栏 ===== */
topbar {
  display: block;
  background: linear-gradient(90deg, #FFE8D6, #FFD6BA);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  border-left: 4px solid #FF8C42;
  font-size: 0.9em;
  color: #5A3E2B;
}

topbar p {
  margin: 4px 0;
}

topbar details summary {
  cursor: pointer;
  font-weight: 600;
  color: #C65D21;
  font-size: 0.88em;
}

/* ===== 正文区域 ===== */
text {
  display: block;
  padding: 14px 10px;
  margin: 10px 0;
  font-size: 1em;
  line-height: 1.85;
  color: #2E2420;
  border-bottom: 1px dashed #F0C8A0;
}

text p {
  margin: 8px 0;
  text-indent: 2em;
}

/* ===== 玩家对话 - 天蓝色系 ===== */
pline {
  display: inline;
  color: #1A73B5;
  font-weight: 500;
  background: linear-gradient(120deg, rgba(26, 115, 181, 0.08) 0%, rgba(100, 180, 255, 0.08) 100%);
  padding: 1px 6px;
  border-radius: 4px;
  border-left: 3px solid #4A9FD9;
  margin-left: 2px;
}

/* ===== 星遥对话 - 珊瑚红/辣椒色系 ===== */
sline {
  display: inline;
  color: #D94F3B;
  font-weight: 500;
  background: linear-gradient(120deg, rgba(217, 79, 59, 0.08) 0%, rgba(255, 140, 66, 0.08) 100%);
  padding: 1px 6px;
  border-radius: 4px;
  border-left: 3px solid #E8734A;
  margin-left: 2px;
}

/* ===== 其他NPC对话 - 森绿色系 ===== */
nline {
  display: inline;
  color: #2E8B57;
  font-weight: 500;
  background: linear-gradient(120deg, rgba(46, 139, 87, 0.08) 0%, rgba(80, 180, 120, 0.08) 100%);
  padding: 1px 6px;
  border-radius: 4px;
  border-left: 3px solid #3DA06E;
  margin-left: 2px;
}

/* ===== 状态栏 details 通用样式 ===== */
gamebox > details {
  margin: 8px 0;
  border: 1px solid #F0D5B8;
  border-radius: 10px;
  overflow: hidden;
  background: #FFFBF5;
  transition: box-shadow 0.3s ease;
}

gamebox > details:hover {
  box-shadow: 0 2px 12px rgba(255, 140, 66, 0.18);
}

gamebox > details > summary {
  cursor: pointer;
  padding: 10px 14px;
  background: linear-gradient(90deg, #FFF0E0, #FFE4CC);
  font-weight: 700;
  font-size: 0.95em;
  color: #8B5A2B;
  border-bottom: 1px solid #F0D5B8;
  list-style: none;
  position: relative;
  transition: background 0.2s ease;
}

gamebox > details > summary::-webkit-details-marker {
  display: none;
}

gamebox > details > summary::after {
  content: "▸";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #C67A3C;
  font-size: 1em;
  transition: transform 0.25s ease;
}

gamebox > details[open] > summary::after {
  transform: translateY(-50%) rotate(90deg);
}

gamebox > details[open] > summary {
  background: linear-gradient(90deg, #FFE4CC, #FFD6B5);
}

gamebox > details > p {
  padding: 4px 16px;
  margin: 3px 0;
  font-size: 0.9em;
  color: #4A3728;
  line-height: 1.65;
}

gamebox > details > p b {
  color: #B8602A;
  font-size: 0.92em;
}

/* ===== 沈星遥栏目内心话特殊高亮 ===== */
gamebox > details:nth-of-type(3) > p:nth-last-of-type(2) {
  background: rgba(232, 115, 74, 0.08);
  border-radius: 6px;
  padding: 6px 12px;
  border-left: 3px solid #E8734A;
  font-style: italic;
  color: #C0522A;
}

/* ===== 记忆区标题样式 ===== */
gamebox > details:nth-of-type(4) > p > b {
  display: inline-block;
  padding: 2px 8px;
  background: #FFF0E0;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ===== 行动建议栏 ===== */
gamebox > details:last-of-type > p {
  position: relative;
  padding-left: 20px;
  transition: color 0.2s ease;
}

gamebox > details:last-of-type > p:hover {
  color: #D94F3B;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  gamebox {
    padding: 14px 10px 10px;
    margin: 6px 2px;
    border-radius: 12px;
  }
  
  topbar {
    padding: 6px 10px;
    font-size: 0.85em;
  }
  
  text {
    padding: 10px 6px;
    font-size: 0.95em;
  }
  
  gamebox > details > summary {
    padding: 8px 10px;
    font-size: 0.9em;
  }
  
  gamebox > details > p {
    padding: 3px 12px;
    font-size: 0.85em;
  }
}