/* ═══ 思维链隐藏 ═══ */
think {
  display: none;
}

/* ═══ 正文区域 ═══ */
text {
  display: block;
  background: linear-gradient(135deg, #fef5f8 0%, #faf0f5 100%);
  border-left: 3px solid #f48fb1;
  border-radius: 0 12px 12px 0;
  padding: 16px 14px;
  margin: 10px 0;
  line-height: 1.9;
  font-size: 15px;
  color: #4a4a4a;
  letter-spacing: 0.3px;
}

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

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

/* ═══ 角色对话字体渲染 ═══ */
span.user {
  color: #1565c0;
  font-weight: 600;
}

span.鱼玄素 {
  color: #b8860b;
  font-weight: 600;
}

span.澹台凝芳 {
  color: #c62828;
  font-weight: 600;
}

/* ═══ 通用 details 折叠块基础样式 ═══ */
details.sw-scene,
details.sw-user,
details.sw-npc,
details.sw-relation,
details.sw-memory-wrap,
details.sw-branch {
  border: 1px solid #f8bbd0;
  border-radius: 10px;
  margin: 8px 0;
  padding: 0;
  overflow: hidden;
  background: #fffafa;
  box-shadow: 0 2px 8px rgba(244, 143, 177, 0.12);
  transition: box-shadow 0.3s ease;
}

details.sw-scene[open],
details.sw-user[open],
details.sw-npc[open],
details.sw-relation[open],
details.sw-memory-wrap[open],
details.sw-branch[open] {
  box-shadow: 0 4px 16px rgba(244, 143, 177, 0.22);
}

details.sw-scene summary,
details.sw-user summary,
details.sw-npc summary,
details.sw-relation summary,
details.sw-memory-wrap summary,
details.sw-branch summary {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

details.sw-scene summary::-webkit-details-marker,
details.sw-user summary::-webkit-details-marker,
details.sw-npc summary::-webkit-details-marker,
details.sw-relation summary::-webkit-details-marker,
details.sw-memory-wrap summary::-webkit-details-marker,
details.sw-branch summary::-webkit-details-marker {
  display: none;
}

details.sw-scene summary::before,
details.sw-user summary::before,
details.sw-npc summary::before,
details.sw-relation summary::before,
details.sw-memory-wrap summary::before,
details.sw-branch summary::before {
  content: "▸";
  font-size: 12px;
  transition: transform 0.3s ease;
  color: #f48fb1;
}

details.sw-scene[open] summary::before,
details.sw-user[open] summary::before,
details.sw-npc[open] summary::before,
details.sw-relation[open] summary::before,
details.sw-memory-wrap[open] summary::before,
details.sw-branch[open] summary::before {
  transform: rotate(90deg);
}

/* ═══ 各区块个性化配色 ═══ */

/* 世界场景 */
details.sw-scene summary {
  background: linear-gradient(90deg, #e8f5e9, #f1f8e9);
  color: #2e7d32;
  border-bottom: 1px solid #c8e6c9;
}

details.sw-scene summary::before {
  content: "🌏";
}

details.sw-scene p {
  padding: 4px 14px;
  margin: 0;
  font-size: 13px;
  color: #555;
}

/* 主角信息 */
details.sw-user summary {
  background: linear-gradient(90deg, #e3f2fd, #bbdefb);
  color: #1565c0;
  border-bottom: 1px solid #90caf9;
}

details.sw-user summary::before {
  content: "🎭";
  color: #1565c0;
}

details.sw-user p {
  padding: 3px 14px;
  margin: 0;
  font-size: 13px;
  color: #444;
  line-height: 1.7;
}

/* 女主NPC */
details.sw-npc summary {
  background: linear-gradient(90deg, #fce4ec, #f8bbd0);
  color: #c62828;
  border-bottom: 1px solid #f48fb1;
}

details.sw-npc summary::before {
  content: "💋";
  color: #e91e63;
}

details.sw-npc p {
  padding: 3px 14px;
  margin: 0;
  font-size: 13px;
  color: #444;
  line-height: 1.7;
}

/* 附近人物 */
details.sw-relation summary {
  background: linear-gradient(90deg, #f3e5f5, #e1bee7);
  color: #6a1b9a;
  border-bottom: 1px solid #ce93d8;
}

details.sw-relation summary::before {
  content: "👥";
  color: #8e24aa;
}

details.sw-relation p {
  padding: 3px 14px;
  margin: 0;
  font-size: 13px;
  color: #444;
  line-height: 1.7;
}

/* 记忆回廊 */
details.sw-memory-wrap summary {
  background: linear-gradient(90deg, #fff8e1, #ffecb3);
  color: #e65100;
  border-bottom: 1px solid #ffcc02;
}

details.sw-memory-wrap summary::before {
  content: "";
}

details.sw-memory-wrap .sw-memory {
  padding: 10px 12px;
}

details.sw-memory-wrap .sw-mem-title {
  font-weight: 700;
  font-size: 13px;
  color: #bf360c;
  margin: 8px 0 6px 0;
  padding: 0;
}

details.sw-memory-wrap .sw-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 10px 0;
  border-radius: 6px;
  border: 1px solid #ffe0b2;
}

details.sw-memory-wrap table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 12px;
}

details.sw-memory-wrap table th {
  background: #fff3e0;
  color: #e65100;
  font-weight: 700;
  padding: 7px 8px;
  text-align: left;
  border-bottom: 2px solid #ffcc80;
  white-space: nowrap;
}

details.sw-memory-wrap table td {
  padding: 6px 8px;
  border-bottom: 1px solid #fff3e0;
  color: #555;
  vertical-align: top;
}

details.sw-memory-wrap table tr:hover td {
  background: #fff8e1;
}

/* 剧情分支 */
details.sw-branch summary {
  background: linear-gradient(90deg, #fce4ec, #f8bbd0);
  color: #ad1457;
  border-bottom: 1px solid #f48fb1;
}

details.sw-branch summary::before {
  content: "";
}

details.sw-branch p {
  padding: 6px 14px;
  margin: 0;
  font-size: 13.5px;
  color: #6a1b9a;
  line-height: 1.8;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease;
}

details.sw-branch p:hover {
  background: #fce4ec;
}

/* ═══ 隐藏追踪区确保不渲染 ═══ */
hidden-track {
  display: none;
}

/* ═══ 手机端微调 ═══ */
@media screen and (max-width: 768px) {
  text {
    padding: 12px 10px;
    font-size: 14.5px;
    border-radius: 0 8px 8px 0;
  }

  details.sw-scene summary,
  details.sw-user summary,
  details.sw-npc summary,
  details.sw-relation summary,
  details.sw-memory-wrap summary,
  details.sw-branch summary {
    padding: 9px 10px;
    font-size: 13.5px;
  }

  details.sw-memory-wrap table {
    font-size: 11px;
    min-width: 360px;
  }

  details.sw-branch p {
    font-size: 13px;
    padding: 8px 12px;
  }
}