/* =========================================================
   课桌间的风 · 粉白纸页式美化 CSS
   用法：AI 输出正文外层包裹 <div class="sggs-wrap"> ... </div>
   ========================================================= */

/* ---------- 全局变量 ---------- */
:root {
  --sggs-bg: rgba(255, 250, 246, 0.94);
  --sggs-bg-soft: rgba(255, 245, 241, 0.82);
  --sggs-card: rgba(255, 253, 250, 0.96);
  --sggs-line: #ff9fbd;
  --sggs-line-soft: rgba(255, 159, 189, 0.32);
  --sggs-pink: #ff6fa3;
  --sggs-pink-dark: #d94b82;
  --sggs-blue: #4f67ff;
  --sggs-purple: #8f4cff;
  --sggs-text: #32292b;
  --sggs-sub: #6d5b60;
  --sggs-faint: #a8959a;
  --sggs-cream: #fff8f2;
  --sggs-shadow: 0 12px 34px rgba(126, 75, 92, 0.12);
  --sggs-radius: 22px;
}

/* ---------- 主体纸页容器 ---------- */
.sggs-wrap {
  position: relative;
  max-width: 760px;
  margin: 18px auto;
  padding: 24px 28px 28px 36px;
  color: var(--sggs-text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Serif SC",
    serif;
  font-size: 15.5px;
  line-height: 1.95;
  letter-spacing: 0.02em;
  background:
    linear-gradient(90deg, rgba(255, 159, 189, 0.16) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,247,242,0.94));
  border: 1px solid rgba(255, 185, 203, 0.38);
  border-left: 3px solid var(--sggs-line);
  border-radius: 0 18px 18px 0;
  box-shadow: var(--sggs-shadow);
  overflow: hidden;
}

/* 左侧装饰竖线 */
.sggs-wrap::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 127, 168, 0.68) 10%,
    rgba(255, 127, 168, 0.42) 86%,
    transparent
  );
}

.sggs-wrap::after {
  content: "✦";
  position: absolute;
  left: 9px;
  top: 16px;
  color: rgba(255, 127, 168, 0.72);
  font-size: 15px;
}

/* ---------- 正文段落 ---------- */
.sggs-wrap p,
.sggs-p {
  margin: 0 0 15px;
  text-align: justify;
}

.sggs-main {
  position: relative;
  z-index: 1;
}

/* 动作描写 */
.sggs-action {
  color: var(--sggs-text);
}

/* 场景环境描写 */
.sggs-scene {
  margin: 16px 0 20px;
  padding: 14px 18px;
  color: var(--sggs-sub);
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.08em;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 170, 195, 0.18), transparent 38%),
    rgba(255, 247, 242, 0.82);
  border: 1px solid rgba(255, 178, 198, 0.34);
  border-radius: 18px;
}

/* ---------- 对话颜色 ---------- */
.sggs-dialogue-pink,
.sggs-npc {
  color: var(--sggs-pink-dark);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(255, 139, 178, 0.18);
}

.sggs-dialogue-blue,
.sggs-user {
  color: var(--sggs-blue);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(79, 103, 255, 0.12);
}

.sggs-dialogue-purple {
  color: var(--sggs-purple);
  font-weight: 600;
}

.sggs-quote {
  color: var(--sggs-text);
}

/* 角色名字标签 */
.sggs-name-tag {
  display: inline-block;
  margin-right: 6px;
  color: var(--sggs-pink-dark);
  font-weight: 700;
}

/* ---------- 内心独白 ---------- */
.sggs-inner {
  margin: 14px 0 18px;
  padding: 12px 18px;
  color: #ff9ab8;
  font-size: 14px;
  line-height: 1.8;
  background: rgba(255, 231, 239, 0.58);
  border-left: 3px solid rgba(255, 127, 168, 0.65);
  border-radius: 0 14px 14px 0;
  font-style: normal;
}

.sggs-inner::before {
  content: "……";
  margin-right: 4px;
  color: rgba(255, 127, 168, 0.72);
}

/* ---------- 分隔线 ---------- */
.sggs-divider {
  position: relative;
  height: 1px;
  margin: 26px 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 127, 168, 0.35),
    rgba(97, 116, 255, 0.28),
    rgba(255, 127, 168, 0.35),
    transparent
  );
}

.sggs-divider::after {
  content: "✧";
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  padding: 0 10px;
  color: rgba(255, 127, 168, 0.8);
  background: var(--sggs-bg);
}

/* ---------- 时间 / 地点加载栏 ---------- */
.sggs-timebar {
  position: relative;
  margin: 0 0 20px;
  padding: 14px 18px 14px 20px;
  color: var(--sggs-sub);
  font-size: 13.5px;
  line-height: 1.7;
  background:
    linear-gradient(135deg, rgba(255, 226, 237, 0.86), rgba(239, 243, 255, 0.88)),
    rgba(255,255,255,0.88);
  border: 1px solid rgba(255, 170, 195, 0.42);
  border-left: 4px solid var(--sggs-line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(255, 127, 168, 0.1);
  overflow: hidden;
}

.sggs-timebar::before {
  content: "🌸 当前场景";
  display: block;
  margin-bottom: 6px;
  color: var(--sggs-pink-dark);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* 小型加载条 */
.sggs-loader {
  position: relative;
  margin: 12px 0 18px;
  padding: 10px 16px;
  color: var(--sggs-pink-dark);
  font-size: 13px;
  background: rgba(255, 246, 249, 0.92);
  border: 1px solid rgba(255, 175, 202, 0.38);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(255, 127, 168, 0.08);
  overflow: hidden;
}

.sggs-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 137, 178, 0.24),
    transparent
  );
  animation: sggsLoading 2.4s ease-in-out infinite;
}

.sggs-loader span {
  position: relative;
  z-index: 1;
}

@keyframes sggsLoading {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(260%); }
}

/* ---------- 选项按钮 ---------- */
.sggs-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 8px;
}

.sggs-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 16px;
  color: var(--sggs-blue);
  font-size: 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(111, 128, 255, 0.26);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(95, 105, 180, 0.08);
  cursor: pointer;
  transition: 0.22s ease;
}

.sggs-option:hover {
  color: #fff;
  background: linear-gradient(135deg, #6d7dff, #ff78aa);
  border-color: transparent;
  transform: translateY(-1px);
}

/* ---------- 信件 / 纸条 ---------- */
.sggs-letter {
  margin: 18px 0;
  padding: 18px 20px;
  color: #5f4f52;
  font-family: "KaiTi", "STKaiti", "Noto Serif SC", serif;
  line-height: 1.9;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,248,238,0.92));
  border: 1px dashed rgba(210, 150, 120, 0.55);
  border-radius: 14px;
  box-shadow: inset 0 0 20px rgba(210, 150, 120, 0.08);
}

/* ---------- 状态栏 details 通用 ---------- */
.sggs-wrap details,
details.sggs-state {
  margin: 18px 0;
  padding: 0;
  color: var(--sggs-text);
  background: rgba(255, 253, 250, 0.94);
  border: 1px solid rgba(255, 178, 198, 0.42);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(126, 75, 92, 0.1);
  overflow: hidden;
}

.sggs-wrap details summary,
details.sggs-state summary {
  position: relative;
  padding: 13px 18px 13px 42px;
  color: var(--sggs-pink-dark);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  background:
    linear-gradient(135deg, rgba(255, 226, 237, 0.88), rgba(246, 240, 255, 0.85));
  border-bottom: 1px solid rgba(255, 178, 198, 0.24);
}

.sggs-wrap details summary::-webkit-details-marker,
details.sggs-state summary::-webkit-details-marker {
  display: none;
}

.sggs-wrap details summary::before,
details.sggs-state summary::before {
  content: "▸";
  position: absolute;
  left: 18px;
  top: 13px;
  color: var(--sggs-pink);
  transition: transform 0.22s ease;
}

.sggs-wrap details[open] summary::before,
details.sggs-state[open] summary::before {
  transform: rotate(90deg);
}

.sggs-wrap details[open],
details.sggs-state[open] {
  animation: sggsFadeIn 0.28s ease;
}

/* details 内部内容 */
.sggs-state-body,
.sggs-wrap details > div,
details.sggs-state > div {
  padding: 16px 18px 18px;
  font-size: 13.5px;
  line-height: 1.82;
}

/* ---------- 状态栏分区标题 ---------- */
.sggs-section {
  margin: 14px 0 10px;
  padding: 7px 10px;
  color: var(--sggs-pink-dark);
  font-weight: 700;
  background: rgba(255, 236, 243, 0.7);
  border-left: 3px solid var(--sggs-line);
  border-radius: 0 10px 10px 0;
}

.sggs-field {
  margin: 4px 0;
  color: var(--sggs-sub);
}

.sggs-field b,
.sggs-label {
  color: #4d3e42;
  font-weight: 700;
}

/* ---------- 人物状态卡 ---------- */
.sggs-char-card {
  margin: 16px 0;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255, 248, 251, 0.9));
  border: 1px solid rgba(255, 182, 204, 0.36);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(255, 127, 168, 0.07);
}

.sggs-char-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 178, 198, 0.28);
}

.sggs-char-name {
  color: var(--sggs-pink-dark);
  font-weight: 800;
  font-size: 15px;
}

.sggs-char-tag {
  padding: 3px 10px;
  color: #7f6d75;
  font-size: 12px;
  background: rgba(255, 236, 243, 0.82);
  border-radius: 999px;
}

/* 好感 / 亲密心形 */
.sggs-heart {
  color: #ff5f99;
  letter-spacing: 1px;
  font-weight: 700;
}

.sggs-heart-empty {
  color: #d8cbd0;
}

/* 私密/成人状态模块：仅适合全员18+设定 */
.sggs-private {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255, 239, 246, 0.72);
  border: 1px solid rgba(255, 154, 190, 0.32);
  border-radius: 14px;
}

.sggs-private .sggs-section {
  margin-top: 0;
}

/* 内心独白状态栏 */
.sggs-monologue {
  margin-top: 12px;
  padding: 12px 14px;
  color: #9b6a7a;
  font-size: 13px;
  line-height: 1.75;
  background: rgba(255, 245, 249, 0.84);
  border-left: 3px solid rgba(255, 127, 168, 0.6);
  border-radius: 0 12px 12px 0;
}

/* ---------- 小提示 / 系统提示 ---------- */
.sggs-note {
  margin: 14px 0;
  padding: 12px 16px;
  color: #7a6570;
  font-size: 13.5px;
  background: rgba(248, 246, 255, 0.8);
  border: 1px solid rgba(167, 151, 255, 0.22);
  border-left: 3px solid rgba(111, 128, 255, 0.55);
  border-radius: 0 14px 14px 0;
}

/* ---------- 动画 ---------- */
.sggs-fade {
  animation: sggsFadeIn 0.32s ease;
}

@keyframes sggsFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ---------- 手机端适配 ---------- */
@media (max-width: 600px) {
  .sggs-wrap {
    margin: 12px 6px;
    padding: 18px 16px 22px 26px;
    font-size: 14.2px;
    line-height: 1.85;
    border-radius: 0 14px 14px 0;
  }

  .sggs-wrap::before {
    left: 11px;
  }

  .sggs-wrap::after {
    left: 4px;
  }

  .sggs-timebar {
    font-size: 12.8px;
    padding: 12px 14px;
  }

  .sggs-wrap details summary,
  details.sggs-state summary {
    font-size: 13.5px;
    padding: 12px 14px 12px 36px;
  }

  .sggs-wrap details summary::before,
  details.sggs-state summary::before {
    left: 15px;
    top: 12px;
  }

  .sggs-state-body,
  .sggs-wrap details > div,
  details.sggs-state > div {
    padding: 14px;
    font-size: 12.8px;
  }

  .sggs-char-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .sggs-option {
    font-size: 13px;
    padding: 6px 13px;
  }
}

/* =========================================================
   私密状态小卡片系统 · 点击展开版
   用法：
   <div class="sggs-sensitive-grid">
     <details class="sggs-sensitive-card">
       <summary>嘴唇</summary>
       <div class="sggs-sensitive-pop">...</div>
     </details>
   </div>
   ========================================================= */

/* 私密状态总容器 */
.sggs-sensitive-box {
  margin: 18px 0;
  padding: 16px 18px 20px;
  background:
    linear-gradient(180deg, rgba(255, 248, 251, 0.96), rgba(255, 255, 255, 0.94));
  border: 1px solid rgba(255, 132, 174, 0.26);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(255, 105, 158, 0.08);
}

/* 顶部提示条 */
.sggs-sensitive-title {
  margin: 0 0 14px;
  padding: 8px 12px;
  color: #e83f83;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.06em;
  background: rgba(255, 231, 241, 0.68);
  border-radius: 999px;
}

/* 私密状态说明文本 */
.sggs-sensitive-desc {
  margin: 8px 0 18px;
  color: #604e56;
  font-size: 13.5px;
  line-height: 1.75;
}

/* 小按钮网格 */
.sggs-sensitive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px 22px;
  align-items: start;
  margin: 14px 0;
}

/* 每一个可点击小卡 */
.sggs-sensitive-card {
  position: relative;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

/* 去掉默认箭头 */
.sggs-sensitive-card summary {
  list-style: none;
}

.sggs-sensitive-card summary::-webkit-details-marker {
  display: none;
}

/* 小按钮本体 */
.sggs-sensitive-card > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 18px;
  color: #ff3f87;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1.6px solid #ff4f93;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(255, 90, 148, 0.08);
  cursor: pointer;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

/* hover/点击后的按钮效果 */
.sggs-sensitive-card > summary:hover,
.sggs-sensitive-card[open] > summary {
  color: #fff;
  background: linear-gradient(135deg, #ff5b9d, #ff3f87);
  box-shadow: 0 8px 20px rgba(255, 79, 147, 0.22);
  transform: translateY(-1px);
}

/* 弹出的说明小卡 */
.sggs-sensitive-pop {
  position: relative;
  z-index: 5;
  margin: 10px auto 0;
  padding: 13px 14px;
  width: min(270px, 100%);
  color: #5a4650;
  font-size: 13px;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.98);
  border: 2px solid rgba(255, 90, 148, 0.72);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(255, 90, 148, 0.18);
  animation: sggsSensitivePop 0.22s ease;
}

/* 小卡顶部标题 */
.sggs-sensitive-pop-title {
  margin-bottom: 8px;
  padding-bottom: 6px;
  color: #e83f83;
  font-weight: 800;
  font-size: 14px;
  border-bottom: 1px dashed rgba(255, 105, 158, 0.35);
}

/* 小卡字段 */
.sggs-sensitive-pop p {
  margin: 4px 0;
}

.sggs-sensitive-pop b {
  color: #e83f83;
  font-weight: 700;
}

/* 小三角装饰 */
.sggs-sensitive-pop::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.98);
  border-left: 2px solid rgba(255, 90, 148, 0.72);
  border-top: 2px solid rgba(255, 90, 148, 0.72);
  transform: translateX(-50%) rotate(45deg);
}

/* 动画 */
@keyframes sggsSensitivePop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* 分割线 */
.sggs-sensitive-divider {
  height: 1px;
  margin: 20px 0 14px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 105, 158, 0.38),
    transparent
  );
}

/* 物品栏按钮 */
.sggs-inventory-btn {
  display: block;
  width: fit-content;
  min-width: 90px;
  margin: 14px auto 0;
  padding: 8px 22px;
  color: #334155;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  background: linear-gradient(180deg, #f9fbff, #eef3f8);
  border: 1px solid rgba(140, 158, 175, 0.55);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    0 6px 16px rgba(90, 110, 130, 0.12);
}

/* 手机端 */
@media (max-width: 600px) {
  .sggs-sensitive-box {
    padding: 14px 12px 16px;
  }

  .sggs-sensitive-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px 10px;
  }

  .sggs-sensitive-card > summary {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
  }

  .sggs-sensitive-pop {
    width: 100%;
    font-size: 12.5px;
    padding: 12px;
  }
}

/* =========================================================
   状态栏黑底修复 + 地图容器修复补丁
   直接追加到当前 CSS 最后面
   ========================================================= */

/* 允许地图、弹出卡、状态栏内容正常显示，不再被外层裁切 */
.sggs-wrap {
  overflow: visible !important;
}

/* 但正文仍然避免横向撑破页面 */
.sggs-main,
.sggs-state,
.sggs-state-body,
.sggs-char-card,
.sggs-sensitive-box {
  max-width: 100%;
  box-sizing: border-box;
}

/* =========================================================
   1. 全局修复：状态栏里的 pre / code 黑底问题
   ========================================================= */

/* 覆盖平台默认黑色代码块 */
.sggs-wrap pre,
.sggs-wrap code,
.sggs-state pre,
.sggs-state code,
.sggs-state-body pre,
.sggs-state-body code,
.sggs-char-card pre,
.sggs-char-card code,
.sggs-sensitive-box pre,
.sggs-sensitive-box code {
  color: #3f3438 !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255, 248, 251, 0.94)) !important;
  border: 1px solid rgba(255, 178, 198, 0.38) !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 18px rgba(255, 127, 168, 0.08) !important;
  text-shadow: none !important;
}

/* pre 代码块改成浅色滚动卡 */
.sggs-wrap pre,
.sggs-state pre,
.sggs-state-body pre,
.sggs-char-card pre,
.sggs-sensitive-box pre {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 12px 0 16px !important;
  padding: 14px 16px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  line-height: 1.75 !important;
  font-family:
    "LXGW WenKai",
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Serif SC",
    serif !important;
  font-size: 13.5px !important;
}

/* 行内 code 不要黑底 */
.sggs-wrap code,
.sggs-state code,
.sggs-state-body code,
.sggs-char-card code {
  display: inline !important;
  padding: 2px 5px !important;
  color: #d94b82 !important;
  background: rgba(255, 236, 243, 0.72) !important;
  border: 1px solid rgba(255, 178, 198, 0.32) !important;
  border-radius: 6px !important;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif !important;
  font-size: 0.95em !important;
}

/* 防止代码块内部 span 被平台染成深色低对比 */
.sggs-wrap pre *,
.sggs-state pre *,
.sggs-state-body pre *,
.sggs-char-card pre * {
  color: #3f3438 !important;
  background: transparent !important;
  text-shadow: none !important;
}

/* =========================================================
   2. 记忆区：做成主角档案同款浅色卡
   ========================================================= */

.sggs-memory-box {
  margin: 14px 0 18px;
  padding: 15px 16px;
  color: #4b3d42;
  font-size: 13.5px;
  line-height: 1.8;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(255, 248, 251, 0.94));
  border: 1px solid rgba(255, 178, 198, 0.38);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(255, 127, 168, 0.08);
}

.sggs-memory-title {
  margin: 0 0 10px;
  padding: 8px 12px;
  color: #d94b82;
  font-weight: 800;
  background: rgba(255, 236, 243, 0.72);
  border-left: 3px solid #ff9fbd;
  border-radius: 0 12px 12px 0;
}

.sggs-memory-item {
  margin: 8px 0;
  padding: 9px 11px;
  color: #5f4f55;
  background: rgba(255, 252, 250, 0.88);
  border: 1px solid rgba(255, 195, 210, 0.26);
  border-radius: 12px;
}

.sggs-memory-item b {
  color: #3f3438;
}

/* 如果记忆区仍被 AI 写成 pre，也强行改成记忆卡样式 */
.sggs-state-body pre.sggs-memory,
.sggs-wrap pre.sggs-memory {
  color: #4b3d42 !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(255, 248, 251, 0.94)) !important;
  border: 1px solid rgba(255, 178, 198, 0.38) !important;
  border-radius: 16px !important;
}

/* =========================================================
   3. 地图容器：不再被遮挡，支持横向滚动
   ========================================================= */

.sggs-map-box {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 16px 0 20px;
  padding: 16px 14px 18px;
  box-sizing: border-box;
  color: #3f3438;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 192, 210, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255, 246, 250, 0.94));
  border: 1px solid rgba(255, 178, 198, 0.42);
  border-left: 4px solid #ff9fbd;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(255, 127, 168, 0.1);
  overflow: hidden;
}

.sggs-map-title {
  margin: 0 0 12px;
  padding: 8px 12px;
  color: #d94b82;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.06em;
  background: rgba(255, 236, 243, 0.76);
  border-radius: 999px;
}

/* 地图本体：横向滚动，不裁切 */
.sggs-map-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

/* ASCII 地图用这个 */
.sggs-map {
  display: block;
  min-width: max-content;
  margin: 0;
  padding: 14px 16px;
  color: #4b3d42;
  background: rgba(255, 252, 250, 0.92);
  border: 1px solid rgba(255, 195, 210, 0.36);
  border-radius: 14px;
  font-family:
    "Courier New",
    "Consolas",
    monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  box-shadow: inset 0 0 18px rgba(255, 127, 168, 0.06);
}

/* 地图说明区 */
.sggs-map-info {
  margin-top: 12px;
  padding: 12px 14px;
  color: #5f4f55;
  font-size: 13px;
  line-height: 1.75;
  background: rgba(255, 246, 249, 0.82);
  border: 1px solid rgba(255, 195, 210, 0.3);
  border-radius: 14px;
}

.sggs-map-info b {
  color: #d94b82;
}

/* 如果 AI 仍然把地图写成 ```Map 代码块，至少不黑底、不裁切 */
.sggs-wrap pre.language-Map,
.sggs-wrap pre.language-map,
.sggs-state pre.language-Map,
.sggs-state pre.language-map,
.sggs-wrap pre[class*="language-Map"],
.sggs-wrap pre[class*="language-map"],
.sggs-state pre[class*="language-Map"],
.sggs-state pre[class*="language-map"] {
  white-space: pre !important;
  overflow-x: auto !important;
  word-break: normal !important;
  color: #4b3d42 !important;
  background: rgba(255, 252, 250, 0.94) !important;
  font-family: "Courier New", "Consolas", monospace !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;
}

/* =========================================================
   4. 角色档案进一步压窄美化，避免手机端挤爆
   ========================================================= */

.sggs-char-card {
  overflow: visible !important;
}

.sggs-char-card .sggs-field {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.sggs-sensitive-pop {
  max-width: 100%;
  box-sizing: border-box;
}

/* details 嵌套时，避免内层 details 继承外层大状态栏样式过头 */
.sggs-sensitive-card,
.sggs-sensitive-card[open] {
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}

.sggs-sensitive-card > summary {
  border-bottom: 1.6px solid #ff4f93 !important;
}

/* =========================================================
   5. 手机端加强修复
   ========================================================= */

@media (max-width: 600px) {
  .sggs-wrap {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin-left: auto;
    margin-right: auto;
    overflow: visible !important;
  }

  .sggs-state,
  details.sggs-state {
    width: 100%;
    max-width: 100%;
  }

  .sggs-map-box {
    margin-left: 0;
    margin-right: 0;
    padding: 14px 10px 16px;
  }

  .sggs-map {
    font-size: 11.5px;
    line-height: 1.45;
    padding: 12px;
  }

  .sggs-map-info {
    font-size: 12.5px;
  }

  .sggs-wrap pre,
  .sggs-state pre,
  .sggs-state-body pre,
  .sggs-char-card pre {
    font-size: 12.5px !important;
    line-height: 1.65 !important;
    padding: 12px !important;
    white-space: pre-wrap !important;
  }

  .sggs-sensitive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   地图收放栏 + 新闻区 + 爆代码警报补丁
   追加到 CSS 最后
   ========================================================= */

/* 地图 details 外框 */
details.sggs-map-state {
  margin: 18px 0;
}

details.sggs-map-state > summary {
  background:
    linear-gradient(135deg, rgba(255, 226, 237, 0.92), rgba(239, 243, 255, 0.88)) !important;
}

/* 地图放进 details 后，内部地图容器不要再额外撑爆 */
details.sggs-map-state .sggs-state-body {
  padding: 14px !important;
}

details.sggs-map-state .sggs-map-box {
  margin: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 地图横向滚动保持可用 */
details.sggs-map-state .sggs-map-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* 地图本体不要自动换行，否则ASCII地图会变形 */
details.sggs-map-state .sggs-map {
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* 新闻区 */
.sggs-news-box {
  margin: 14px 0 18px;
  padding: 15px 16px;
  color: #4b3d42;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(255, 248, 251, 0.94));
  border: 1px solid rgba(255, 178, 198, 0.38);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(255, 127, 168, 0.08);
}

.sggs-news-title {
  margin: 0 0 10px;
  padding: 8px 12px;
  color: #d94b82;
  font-weight: 800;
  background: rgba(255, 236, 243, 0.72);
  border-left: 3px solid #ff9fbd;
  border-radius: 0 12px 12px 0;
}

.sggs-news-item {
  margin: 10px 0;
  padding: 10px 12px;
  color: #5f4f55;
  line-height: 1.75;
  background: rgba(255, 252, 250, 0.88);
  border: 1px solid rgba(255, 195, 210, 0.26);
  border-radius: 12px;
}

.sggs-news-comment {
  margin: 8px 0 0;
  padding: 7px 10px;
  color: #6b5c62;
  font-size: 12.5px;
  background: rgba(255, 246, 249, 0.86);
  border-radius: 10px;
}

/* 爆代码警报：如果角色档案又被放进 pre/code，一眼能看出来 */
.sggs-state-body pre,
.sggs-char-card pre,
.sggs-state-body code,
.sggs-char-card code {
  border: 2px dashed rgba(255, 70, 130, 0.72) !important;
}

/* 爆代码警报：排除合法地图 pre */
.sggs-state-body pre:not(.sggs-map),
.sggs-char-card pre,
.sggs-state-body code,
.sggs-char-card code {
  border: 2px dashed rgba(255, 70, 130, 0.72) !important;
}

.sggs-state-body pre:not(.sggs-map)::before,
.sggs-char-card pre::before {
  content: "⚠ 格式错误：这里被模型输出成代码块。请重生成，并要求不要使用代码围栏，直接输出真实HTML。";
  display: block;
  margin-bottom: 10px;
  padding: 8px 10px;
  color: #d94b82;
  font-weight: 700;
  background: rgba(255, 236, 243, 0.92);
  border-radius: 10px;
}

/* 防止行内 code 把 HTML 标签伪装成正常文本 */
.sggs-char-card code::before,
.sggs-state-body code::before {
  content: "⚠";
  margin-right: 4px;
  color: #d94b82;
  font-weight: 800;
}

/* 手机端地图收放栏 */
@media (max-width: 600px) {
  details.sggs-map-state .sggs-state-body {
    padding: 10px !important;
  }

  details.sggs-map-state .sggs-map-box {
    padding: 12px 8px 14px;
  }

  details.sggs-map-state .sggs-map {
    font-size: 11.2px;
    line-height: 1.45;
  }

  .sggs-news-box {
    padding: 12px;
    font-size: 12.8px;
  }
}

/* =========================================================
   协议检查 / 原思维链替代模块
   不使用 pre/code，避免爆代码
   ========================================================= */

.sggs-audit-state {
  margin: 18px 0;
}

.sggs-audit-box {
  margin: 0;
  padding: 14px 15px;
  color: #4b3d42;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(255, 248, 251, 0.94));
  border: 1px solid rgba(255, 178, 198, 0.38);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(255, 127, 168, 0.08);
}

.sggs-audit-title {
  margin: 14px 0 8px;
  padding: 8px 12px;
  color: #d94b82;
  font-weight: 800;
  font-size: 13.5px;
  background: rgba(255, 236, 243, 0.76);
  border-left: 3px solid #ff9fbd;
  border-radius: 0 12px 12px 0;
}

.sggs-audit-title:first-child {
  margin-top: 0;
}

.sggs-audit-item {
  margin: 7px 0;
  padding: 8px 10px;
  color: #5f4f55;
  font-size: 13px;
  line-height: 1.72;
  background: rgba(255, 252, 250, 0.9);
  border: 1px solid rgba(255, 195, 210, 0.26);
  border-radius: 11px;
}

.sggs-audit-item b {
  color: #3f3438;
  font-weight: 700;
}

/* 手机端 */
@media (max-width: 600px) {
  .sggs-audit-box {
    padding: 12px;
  }

  .sggs-audit-title {
    font-size: 13px;
  }

  .sggs-audit-item {
    font-size: 12.4px;
    line-height: 1.65;
  }
}

/* =========================================================
   地图误触发爆代码警报修复
   原因：.sggs-state-body pre::before 误伤 <pre class="sggs-map">
   ========================================================= */

/* 地图 pre 不显示爆代码警报 */
.sggs-state-body pre.sggs-map::before,
.sggs-map::before {
  content: none !important;
  display: none !important;
}

/* 地图 pre 不使用爆代码虚线框 */
.sggs-state-body pre.sggs-map,
.sggs-wrap pre.sggs-map,
details.sggs-map-state pre.sggs-map {
  display: block !important;
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 14px 16px !important;

  color: #4b3d42 !important;
  background: rgba(255, 252, 250, 0.94) !important;
  border: 1px solid rgba(255, 195, 210, 0.36) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 0 18px rgba(255, 127, 168, 0.06) !important;

  font-family: "Courier New", "Consolas", monospace !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;

  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* 地图外层滚动容器：只横向滚动，不裁切 */
details.sggs-map-state .sggs-map-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

/* 地图状态栏内部不要二次撑爆 */
details.sggs-map-state .sggs-state-body.sggs-map-body {
  padding: 14px !important;
  overflow: hidden !important;
}

details.sggs-map-state .sggs-map-box {
  margin: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden !important;
}

/* 手机端地图 */
@media (max-width: 600px) {
  .sggs-state-body pre.sggs-map,
  .sggs-wrap pre.sggs-map,
  details.sggs-map-state pre.sggs-map {
    font-size: 11.2px !important;
    line-height: 1.45 !important;
    padding: 12px !important;
  }
}

/* =========================================================
   关系状态归纳栏美化
   ========================================================= */

.sggs-relation-state {
  margin: 18px 0;
}

.sggs-relation-box {
  margin: 0;
  padding: 15px 16px;
  color: #4b3d42;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(255, 248, 251, 0.94));
  border: 1px solid rgba(255, 178, 198, 0.38);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(255, 127, 168, 0.08);
}

.sggs-relation-title {
  margin: 14px 0 10px;
  padding: 8px 12px;
  color: #d94b82;
  font-weight: 800;
  font-size: 13.5px;
  background: rgba(255, 236, 243, 0.76);
  border-left: 3px solid #ff9fbd;
  border-radius: 0 12px 12px 0;
}

.sggs-relation-title:first-child {
  margin-top: 0;
}

.sggs-relation-item {
  margin: 9px 0;
  padding: 11px 12px;
  color: #5f4f55;
  background: rgba(255, 252, 250, 0.9);
  border: 1px solid rgba(255, 195, 210, 0.28);
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(255, 127, 168, 0.05);
}

.sggs-relation-core {
  border-left: 3px solid rgba(255, 111, 163, 0.62);
}

.sggs-relation-sleep {
  opacity: 0.82;
  background: rgba(248, 246, 255, 0.78);
  border-color: rgba(167, 151, 255, 0.22);
}

.sggs-relation-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.sggs-relation-name {
  color: #d94b82;
  font-weight: 800;
}

.sggs-relation-meta {
  color: #6d5b60;
  font-size: 13px;
}

.sggs-relation-sub {
  margin-top: 5px;
  color: #8a747c;
  font-size: 12.5px;
}

.sggs-relation-note {
  margin-top: 7px;
  padding: 7px 9px;
  color: #6b5c62;
  font-size: 12.5px;
  line-height: 1.65;
  background: rgba(255, 246, 249, 0.82);
  border-radius: 10px;
}

/* 手机端 */
@media (max-width: 600px) {
  .sggs-relation-box {
    padding: 12px;
  }

  .sggs-relation-item {
    padding: 10px;
  }

  .sggs-relation-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .sggs-relation-meta,
  .sggs-relation-sub,
  .sggs-relation-note {
    font-size: 12.2px;
  }
}

/* =========================================================
   正文纸页背景增强 + 人物对话框美化
   追加到当前 CSS 最后
   ========================================================= */

/* ---------- 正文主体背景：接近图1的淡粉纸页感 ---------- */
.sggs-wrap {
  position: relative;
  background:
    linear-gradient(90deg,
      rgba(255, 145, 180, 0.22) 0 2px,
      transparent 2px 18px,
      rgba(255, 145, 180, 0.10) 18px 20px,
      transparent 20px 100%
    ),
    radial-gradient(circle at 18% 8%, rgba(255, 220, 232, 0.55), transparent 32%),
    radial-gradient(circle at 85% 18%, rgba(235, 230, 255, 0.45), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 250, 0.98), rgba(255, 247, 242, 0.96)) !important;
  border-left: 3px solid rgba(255, 135, 175, 0.72) !important;
  border-right: 1px solid rgba(255, 190, 210, 0.42);
  box-shadow:
    0 14px 40px rgba(126, 75, 92, 0.13),
    inset 0 0 42px rgba(255, 210, 225, 0.18) !important;
}

/* 正文内容区：像图1里中央白纸块 */
.sggs-main {
  position: relative;
  margin: 18px 0;
  padding: 18px 22px;
  color: #2f2930;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255, 252, 248, 0.88));
  border: 1px solid rgba(255, 190, 210, 0.26);
  border-radius: 2px;
  box-shadow:
    0 8px 22px rgba(255, 140, 178, 0.08),
    inset 0 0 18px rgba(255, 220, 232, 0.18);
}

/* 正文段落更像小说排版 */
.sggs-main p {
  margin: 0 0 17px;
  line-height: 2.05;
  letter-spacing: 0.035em;
  text-align: justify;
}

/* 让普通彩色台词不再只是裸色，稍微有重点 */
.sggs-dialogue-pink {
  color: #d93586 !important;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(255, 110, 165, 0.14);
}

.sggs-dialogue-blue {
  color: #315cff !important;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(80, 105, 255, 0.12);
}

.sggs-dialogue-purple {
  color: #9b2de1 !important;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(160, 70, 230, 0.12);
}

/* ---------- 图2风格：人物对话框 ---------- */

/* 对话块总容器 */
.sggs-talk {
  position: relative;
  margin: 20px 0 22px;
  padding: 0;
}

/* 角色名小标签 */
.sggs-talk-name {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-left: 10px;
  margin-bottom: -1px;
  padding: 5px 13px 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, #d7004f, #9b002d);
  border-radius: 0 0 0 0;
  box-shadow: 0 4px 12px rgba(120, 0, 35, 0.22);
}

/* 标签下的小三角 */
.sggs-talk-name::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: -8px;
  width: 0;
  height: 0;
  border-top: 8px solid #9b002d;
  border-right: 9px solid transparent;
}

/* 对话框主体：深红黑底，接近图2 */
.sggs-talk-box {
  position: relative;
  padding: 18px 22px;
  color: #fff7f9;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  background:
    linear-gradient(180deg, rgba(78, 0, 15, 0.98), rgba(48, 0, 10, 0.98));
  border: 1px solid rgba(255, 80, 120, 0.48);
  border-radius: 0 12px 12px 12px;
  box-shadow:
    0 12px 26px rgba(80, 0, 20, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 对话框内文字 */
.sggs-talk-box p {
  margin: 0;
  color: #fff7f9;
  line-height: 1.9;
}

/* 对话框里的引号强调 */
.sggs-talk-box .sggs-talk-quote {
  color: #fff;
  font-weight: 500;
}

/* 温柔粉色对话框：适合夏目葵、星野纱良等日常 */
.sggs-talk-soft .sggs-talk-name {
  background: linear-gradient(135deg, #ff6fa3, #d94b82);
  box-shadow: 0 4px 12px rgba(255, 90, 148, 0.22);
}

.sggs-talk-soft .sggs-talk-name::after {
  border-top-color: #d94b82;
}

.sggs-talk-soft .sggs-talk-box {
  color: #4a3038;
  background:
    linear-gradient(180deg, rgba(255, 246, 250, 0.98), rgba(255, 236, 244, 0.96));
  border: 1px solid rgba(255, 145, 180, 0.52);
  box-shadow:
    0 10px 24px rgba(255, 120, 165, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

.sggs-talk-soft .sggs-talk-box p,
.sggs-talk-soft .sggs-talk-box .sggs-talk-quote {
  color: #4a3038;
}

/* 蓝色对话框：适合玩家/男主发言 */
.sggs-talk-blue .sggs-talk-name {
  background: linear-gradient(135deg, #4f67ff, #3047d8);
  box-shadow: 0 4px 12px rgba(80, 105, 255, 0.22);
}

.sggs-talk-blue .sggs-talk-name::after {
  border-top-color: #3047d8;
}

.sggs-talk-blue .sggs-talk-box {
  color: #f7f8ff;
  background:
    linear-gradient(180deg, rgba(40, 52, 135, 0.98), rgba(20, 27, 84, 0.98));
  border: 1px solid rgba(120, 145, 255, 0.52);
  box-shadow:
    0 10px 24px rgba(50, 75, 180, 0.22),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

/* 紫色对话框：适合暧昧、压低声音、特殊氛围 */
.sggs-talk-purple .sggs-talk-name {
  background: linear-gradient(135deg, #a84cff, #7c2bd6);
}

.sggs-talk-purple .sggs-talk-name::after {
  border-top-color: #7c2bd6;
}

.sggs-talk-purple .sggs-talk-box {
  color: #fff8ff;
  background:
    linear-gradient(180deg, rgba(62, 16, 88, 0.98), rgba(35, 8, 55, 0.98));
  border: 1px solid rgba(190, 120, 255, 0.5);
  box-shadow:
    0 10px 24px rgba(110, 55, 170, 0.22),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

/* 对话前后的旁白 */
.sggs-talk-before,
.sggs-talk-after {
  margin: 12px 0;
  color: #2f2930;
  line-height: 2;
}

/* 对话框里的低语/小字 */
.sggs-talk-small {
  color: rgba(255, 245, 248, 0.78);
  font-size: 13px;
}

/* soft 版本的小字 */
.sggs-talk-soft .sggs-talk-small {
  color: rgba(90, 60, 70, 0.72);
}

/* ---------- 手机端适配 ---------- */
@media (max-width: 600px) {
  .sggs-main {
    padding: 15px 14px;
  }

  .sggs-main p {
    line-height: 1.95;
    letter-spacing: 0.02em;
  }

  .sggs-talk {
    margin: 18px 0 20px;
  }

  .sggs-talk-name {
    margin-left: 8px;
    padding: 5px 11px;
    font-size: 12.5px;
  }

  .sggs-talk-box {
    padding: 15px 16px;
    font-size: 14px;
    line-height: 1.85;
  }
}