gameOutput {
  display: block;
  max-width: 680px;
  margin: 16px auto;
  background: linear-gradient(to bottom, #f5f1e8 0%, #ebe5d9 100%);
  border: 2px solid #8b7355;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.6);
  padding: 0;
  font-family: "Noto Serif SC", "SimSun", serif;
  font-size: 14px;
  line-height: 1.75;
  color: #3a3a3a;
  position: relative;
  overflow: hidden;
}

gameOutput::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><defs><pattern id="grain" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><rect fill="%23000" opacity="0.02" x="0" y="0" width="1" height="1"/><rect fill="%23000" opacity="0.015" x="30" y="20" width="1" height="1"/><rect fill="%23000" opacity="0.02" x="60" y="50" width="1" height="1"/></pattern></defs><rect fill="url(%23grain)" width="200" height="200"/></svg>');
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

gameOutput > * { 
  position: relative; 
  z-index: 1; 
}

chapter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #8b4513 0%, #a0522d 50%, #8b4513 100%);
  color: #f5e6d3;
  font-size: 18px;
  font-weight: bold;
  padding: 12px 48px;
  border-radius: 6px 6px 0 0;
  position: relative;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
  letter-spacing: 2px;
  border-bottom: 3px solid #5a3a1a;
}

chapter::before, chapter::after {
  content: '';
  width: 28px;
  height: 28px;
  background: radial-gradient(circle, #d4a574 20%, #8b7355 60%, #5a4a3a 100%);
  border-radius: 50%;
  border: 3px solid #3a2a1a;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.6), 0 2px 4px rgba(0,0,0,0.4);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

chapter::before { left: 12px; }
chapter::after { right: 12px; }

text {
  display: block;
  padding: 14px 18px;
  font-size: 15px;
  background: rgba(255,255,255,0.3);
}

text p { 
  margin: 10px 0; 
  text-indent: 2em;
  text-align: justify;
}

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

gameOutput details {
  border-top: 1px solid rgba(139,115,85,0.3);
  padding: 10px 14px;
  transition: background 0.3s;
}

gameOutput details[open] { 
  background: rgba(139,69,19,0.05);
  border-top-color: rgba(139,115,85,0.5);
}

gameOutput summary {
  cursor: pointer;
  font-weight: bold;
  color: #6b4423;
  padding: 8px 10px;
  background: linear-gradient(to right, rgba(139,69,19,0.12), transparent 70%);
  border-left: 4px solid #8b4513;
  position: relative;
  transition: all 0.3s;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

gameOutput summary::-webkit-details-marker { display: none; }

gameOutput summary:hover {
  background: linear-gradient(to right, rgba(139,69,19,0.25), transparent 70%);
  border-left-color: #d4a017;
  padding-left: 14px;
}

gameOutput summary::before {
  content: '▸';
  font-size: 14px;
  transition: transform 0.3s;
  color: #8b4513;
  display: inline-block;
}

gameOutput details[open] summary::before {
  transform: rotate(90deg);
}

/* 修复：精确指定p标签的作用域，避免污染平台其他元素 */
gameOutput .memory-lt p,
gameOutput .memory-st p,
gameOutput .top-officers p,
gameOutput .npc-main p,
gameOutput .npc-others,
gameOutput .other-officers {
  margin: 8px 0; 
  font-size: 13px;
  line-height: 1.7;
}

gameOutput details > p {
  margin: 8px 0; 
  font-size: 13px;
  line-height: 1.7;
}

gameOutput details b { 
  color: #8b4513; 
  font-weight: 600;
}

mapGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.04) 100%);
  border-radius: 4px;
  border: 1px solid rgba(139,115,85,0.3);
}

mapCell {
  display: flex;
  background: linear-gradient(to bottom, #e8dcc8 0%, #dfd3bf 100%);
  border: 1px solid #a89576;
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  transition: all 0.3s;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.5);
  word-break: break-all;
}

mapCell:hover { 
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15), inset 0 1px 2px rgba(255,255,255,0.5);
}

mapCell.center {
  background: radial-gradient(ellipse at center, #ffcc66 0%, #f4b840 40%, #d4a017 100%);
  border: 2px solid #d4a017;
  color: #2a2a2a;
  font-weight: bold;
  box-shadow: 
    0 0 16px rgba(212,160,23,0.8),
    0 0 8px rgba(255,204,102,0.6),
    inset 0 0 12px rgba(255,255,255,0.4);
  animation: beaconPulse 2.5s infinite;
  transform: scale(1.02);
}

@keyframes beaconPulse {
  0%, 100% { 
    box-shadow: 
      0 0 16px rgba(212,160,23,0.8),
      0 0 8px rgba(255,204,102,0.6),
      inset 0 0 12px rgba(255,255,255,0.4);
  }
  50% { 
    box-shadow: 
      0 0 24px rgba(212,160,23,1),
      0 0 16px rgba(255,204,102,0.9),
      inset 0 0 16px rgba(255,255,255,0.6);
  }
}

mapCell.center:hover { transform: scale(1.02); }

/* 修复：补充mapNote的display属性 */
mapNote, mapNote2 {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #777;
  text-align: center;
  font-style: italic;
}

mapNote2 { 
  font-weight: 600; 
  color: #8b4513;
  font-style: normal;
  border-top: 1px dashed rgba(139,69,19,0.3);
  padding-top: 6px;
  margin-top: 10px;
}

gameOutput .npc-main {
  background: rgba(94,140,106,0.08);
  border-left: 3px solid #5e8c6a;
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 3px;
}

gameOutput .npc-main p { 
  margin: 4px 0; 
}

gameOutput .npc-others {
  color: #666;
  font-size: 12px;
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px dashed #999;
}

gameOutput .top-officers {
  background: rgba(139,69,19,0.06);
  padding: 8px 10px;
  border-radius: 3px;
  margin: 6px 0;
}

gameOutput .top-officers p {
  margin: 5px 0;
  padding-left: 8px;
  border-left: 2px solid #d4a017;
  font-size: 12px;
}

gameOutput .other-officers {
  color: #666;
  font-size: 12px;
  margin-top: 8px;
  font-style: italic;
}

gameOutput .memory-lt {
  background: rgba(139,69,19,0.08);
  border: 1px dashed #a89576;
  padding: 10px;
  margin: 8px 0;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.8;
}

gameOutput .memory-st {
  margin-top: 10px;
}

gameOutput .memory-st p {
  margin: 6px 0;
  padding-left: 10px;
  border-left: 3px solid #5e8c6a;
  font-size: 12px;
}

@media (max-width: 640px) {
  gameOutput { 
    margin: 10px 6px; 
    font-size: 13px;
    border-width: 1px;
  }
  chapter { 
    font-size: 16px; 
    padding: 10px 40px;
    letter-spacing: 1px;
  }
  chapter::before, chapter::after {
    width: 24px;
    height: 24px;
  }
  chapter::before { left: 8px; }
  chapter::after { right: 8px; }
  text { 
    font-size: 14px; 
    padding: 12px 14px;
  }
  text p { text-indent: 1.8em; }
  mapGrid {
    gap: 4px;
    padding: 8px;
  }
  mapCell { 
    font-size: 11px; 
    padding: 6px 2px; 
    min-height: 44px;
  }
  gameOutput summary { font-size: 13px; }
  gameOutput details p { font-size: 12px; }
}

@media (max-width: 480px) {
  gameOutput { margin: 8px 4px; }
  chapter { font-size: 15px; padding: 9px 36px; }
  text { font-size: 13px; padding: 10px 12px; }
  mapCell { font-size: 10px; padding: 5px 1px; min-height: 40px; }
}

/* 玩家对话标签 - 朱砂红 */
gameOutput mc {
  display: inline;
  color: #c1272d;
  font-weight: 600;
  text-shadow: 0 0 1px rgba(193,39,45,0.3);
  transition: all 0.3s ease;
  cursor: default;
}

gameOutput mc:hover {
  color: #e63946;
  text-shadow: 
    0 0 8px rgba(230,57,70,0.5),
    0 0 12px rgba(193,39,45,0.3);
  filter: brightness(1.1);
}

/* NPC对话标签 - 青铜绿配朱砂红特效 */
gameOutput npc {
  display: inline;
  color: #5e8c6a;
  font-weight: 600;
  text-shadow: 0 0 1px rgba(94,140,106,0.3);
  transition: all 0.3s ease;
  cursor: default;
}

gameOutput npc:hover {
  color: #4a6e55;
  text-shadow: 
    0 0 8px rgba(74,110,85,0.5),
    0 0 12px rgba(94,140,106,0.3);
  filter: brightness(1.1);
  font-weight: 600;
}