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

span.庄清鸢 {
  color: #c62828;
  font-weight: 600;
}

/* ⛩️ 山河社稷图 · 世界状态栏 ⛩️ */
/* 淡墨古风画卷风格——黄白系（含移动端适配） */

/* ========== 全局画境基底（桌面端） ========== */
.css-175oi2r,
div[data-testid="sidebarColumn"] section,
aside[aria-label="世界状态"] {
  position: relative;
  background: 
    linear-gradient(180deg, #fffef7 0%, #fdf8e8 30%, #faf0d7 100%);
  background-color: #fefdf7;
  border: 1px solid #d4b87a;
  border-radius: 0;
  box-shadow: 
    inset 0 0 40px rgba(200, 170, 110, 0.12),
    0 4px 20px rgba(100, 70, 30, 0.25),
    0 0 0 8px rgba(220, 190, 130, 0.18),
    0 0 0 9px #d4b87a;
  padding: 20px 16px 16px;
  margin: 0;
  overflow: hidden;
  font-family: "Noto Serif SC", "SimSun", "STSong", "KaiTi", "楷体", serif;
}

/* 绢帛纹理——更轻盈的黄白丝绢感 */
.css-175oi2r::before,
div[data-testid="sidebarColumn"] section::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(180, 150, 90, 0.02) 2px,
      rgba(180, 150, 90, 0.02) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(200, 160, 100, 0.015) 40px,
      rgba(200, 160, 100, 0.015) 42px
    );
  pointer-events: none;
  z-index: 2;
}

/* 顶部卷轴横杆——暖金调 */
.css-175oi2r::after,
div[data-testid="sidebarColumn"] section::after {
  content: "";
  position: absolute;
  top: 0; left: -5%;
  width: 110%; height: 6px;
  background: linear-gradient(180deg, #c9a55c 0%, #e0c78a 40%, #d4b468 100%);
  border-radius: 3px;
  box-shadow: 
    0 2px 6px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.45);
  z-index: 5;
}

/* ========== 题目题额 ========== */
h2[dir="ltr"],
div[data-testid="sidebarColumn"] h2,
aside[aria-label="世界状态"] h2 {
  display: block;
  position: relative;
  font-size: 18px !important;
  font-weight: 400 !important;
  color: #5a3e1b !important;
  text-align: center;
  letter-spacing: 8px;
  padding: 8px 0 12px;
  margin: 0 0 12px 0;
  border-bottom: 1px solid #d4b87a;
  background: transparent;
  font-family: "Noto Serif SC", "SimSun", "KaiTi", serif;
}

h2[dir="ltr"]::before,
div[data-testid="sidebarColumn"] h2::before {
  content: "◇";
  display: inline;
  color: #a07830;
  font-size: 8px;
  margin: 0 12px;
  vertical-align: middle;
  opacity: 0.5;
}

h2[dir="ltr"]::after,
div[data-testid="sidebarColumn"] h2::after {
  content: "◇";
  display: inline;
  color: #a07830;
  font-size: 8px;
  margin: 0 12px;
  vertical-align: middle;
  opacity: 0.5;
}

/* ========== 时光印戳 ========== */
time {
  display: block;
  font-size: 13px;
  color: #6b4e2a;
  text-align: center;
  padding: 6px 16px;
  margin: 8px 0;
  background: rgba(220, 190, 130, 0.18);
  border: 1px dashed #c9a55c;
  border-radius: 0;
  letter-spacing: 2px;
  position: relative;
  font-style: italic;
  font-family: "Noto Serif SC", "KaiTi", serif;
}

time::before {
  content: "☁";
  color: #c9a55c;
  margin-right: 8px;
  opacity: 0.5;
  font-style: normal;
}

time::after {
  content: "☁";
  color: #c9a55c;
  margin-left: 8px;
  opacity: 0.5;
  font-style: normal;
}

/* ========== 地理篆印 ========== */
loc {
  display: block;
  font-size: 13px;
  color: #4a3520;
  text-align: center;
  padding: 4px 20px;
  margin: 6px 0 16px;
  letter-spacing: 4px;
  position: relative;
  font-weight: 500;
  font-family: "Noto Serif SC", "SimSun", serif;
}

loc::after {
  content: "";
  display: block;
  width: 60%;
  margin: 10px auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4b87a, transparent);
}

/* ========== 隐藏步骤思维链——loc内注释全部隐藏 ========== */
loc *,
loc > *:not(:defined) {
  display: none !important;
}

/* 通用步骤隐藏——覆盖所有可能的步骤容器 */
*:has(> *:contains("步骤1")),
span:contains("步骤2"),
span:contains("步骤3"),
span:contains("步骤4"),
span:contains("步骤5"),
span:contains("步骤6"),
span:contains("步骤7"),
span:contains("步骤8"),
span:contains("步骤9"),
div:contains("步骤10") {
  display: none !important;
}

/* 隐藏loc内部的原始注释文本（作为后备方案） */
loc {
  font-size: 13px;
}

/* ========== 水墨画轴点缀 ========== */
div[data-testid="sidebarColumn"] section {
  border-left: 3px solid #a07830;
  border-image: linear-gradient(180deg, #e0c78a, #a07830 50%, #e0c78a) 1;
}

/* 画卷右下角印章 */
div[data-testid="sidebarColumn"] footer::after,
div[data-testid="sidebarColumn"] div:last-child::after {
  content: "山河契";
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 11px;
  color: rgba(180, 50, 20, 0.45);
  border: 1px solid rgba(180, 50, 20, 0.3);
  padding: 2px 8px;
  transform: rotate(-5deg);
  letter-spacing: 2px;
  font-family: "KaiTi", "STKaiti", serif;
  z-index: 3;
}

/* ========== 移动端适配（仅≤768px） ========== */
@media screen and (max-width: 768px) {
  .css-175oi2r,
  div[data-testid="sidebarColumn"] section,
  aside[aria-label="世界状态"] {
    width: calc(100% - 16px);
    max-width: 100vw;
    margin: 8px auto;
    padding: 16px 14px 14px;
    box-sizing: border-box;
    box-shadow: 
      inset 0 0 20px rgba(200, 170, 110, 0.08),
      0 2px 12px rgba(100, 70, 30, 0.2),
      0 0 0 4px rgba(220, 190, 130, 0.18),
      0 0 0 5px #d4b87a;
    border-radius: 2px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .css-175oi2r::before,
  div[data-testid="sidebarColumn"] section::before {
    background-image: 
      repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(180, 150, 90, 0.015) 2px,
        rgba(180, 150, 90, 0.015) 4px
      ),
      repeating-linear-gradient(
        90deg,
        transparent,
        transparent 30px,
        rgba(200, 160, 100, 0.01) 30px,
        rgba(200, 160, 100, 0.01) 32px
      );
  }

  .css-175oi2r::after,
  div[data-testid="sidebarColumn"] section::after {
    height: 4px;
    top: 0;
    left: -2%;
    width: 104%;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }

  h2[dir="ltr"],
  div[data-testid="sidebarColumn"] h2,
  aside[aria-label="世界状态"] h2 {
    font-size: 17px !important;
    letter-spacing: 4px;
    padding: 6px 0 10px;
    margin-bottom: 10px;
  }

  h2[dir="ltr"]::before,
  h2[dir="ltr"]::after,
  div[data-testid="sidebarColumn"] h2::before,
  div[data-testid="sidebarColumn"] h2::after {
    font-size: 6px;
    margin: 0 8px;
  }

  time {
    font-size: 13px;
    padding: 5px 14px;
    margin: 6px 0;
    letter-spacing: 1.5px;
    white-space: normal;
  }

  loc {
    font-size: 13px;
    letter-spacing: 2.5px;
    padding: 4px 12px;
    margin: 4px 0 14px;
  }

  loc::after {
    width: 50%;
    margin-top: 8px;
  }

  .css-175oi2r *,
  div[data-testid="sidebarColumn"] section * {
    -webkit-user-select: none;
    user-select: none;
  }

  a, button, [role="button"] {
    -webkit-user-select: auto;
    user-select: auto;
    touch-action: manipulation;
  }

  div[data-testid="sidebarColumn"] section {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

/* 淡入墨韵 */
@keyframes inkFlow {
  from { opacity: 0; filter: blur(2px); }
  to { opacity: 1; filter: blur(0); }
}

time, loc {
  animation: inkFlow 0.8s ease-out;
}

/* ===== 正文区域——淡黄底 ===== */
article {
  display: block;
  background: #FFFDE7;
  border-radius: 12px;
  padding: 18px 16px;
  margin: 10px 0;
  line-height: 1.9;
  font-size: 1em;
  color: #3E2723;
  box-shadow: 0 2px 8px rgba(255, 213, 79, 0.15);
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #FFF3C4;
}

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

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

/* ===== 状态栏卡片（details/summary）——黄白系 ===== */
details {
  background: #FFFEF9;
  border: 1px solid #F5E6C8;
  border-left: 3px solid #E0C78A;
  border-radius: 10px;
  margin: 10px 0;
  padding: 0;
  box-shadow: 0 2px 6px rgba(200, 170, 110, 0.1);
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

details summary {
  background: linear-gradient(90deg, #FFFEF7 0%, #FDF8E8 100%);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 1em;
  color: #5a3e1b;
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: background 0.2s ease;
}

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

details summary::before {
  content: "▸";
  color: #c9a55c;
  margin-right: 8px;
  transition: transform 0.2s ease;
  display: inline-block;
}

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

details summary:active {
  background: #FFF8E1;
}

details > p,
details > div {
  padding: 4px 14px;
  margin: 0;
  font-size: 1em;
  color: #4E342E;
  line-height: 1.7;
}

details > p:first-of-type {
  padding-top: 10px;
}

details > p:last-of-type {
  padding-bottom: 10px;
}

/* ===== 子信息块（熊燕颉服饰/性器等） ===== */
.sb-block {
  background: #FFFEF5;
  border: 1px dashed #E0C78A;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 14px;
  font-size: 0.88em;
}

.sb-block p {
  margin: 4px 0;
  line-height: 1.6;
  color: #5D4037;
}

/* 熊燕颉性器子块——暖调柔和 */
.sb-block:last-of-type p {
  color: #6b3a5a;
}

/* ===== 记忆回廊 ===== */
.memory-scroll {
  max-width: 100%;
  box-sizing: border-box;
}

.memory-scroll details {
  border-left-color: #c9a55c;
}

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

.memory-scroll table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 12px;
  margin: 0;
}

.memory-scroll table th {
  background: linear-gradient(180deg, #fef9e7, #f5e6c8);
  color: #7a5a20;
  font-weight: 700;
  padding: 7px 8px;
  text-align: left;
  border-bottom: 2px solid #d4b87a;
  white-space: nowrap;
}

.memory-scroll table td {
  padding: 6px 8px;
  border-bottom: 1px solid #faf0d7;
  color: #555;
  line-height: 1.5;
  vertical-align: top;
  word-break: break-word;
}

.memory-scroll table tr:hover td {
  background: #fffdf4;
}

/* ===== 行动推荐——紫调改为暖粉调，与黄白主调协调 ===== */
.action-bar {
  border-left-color: #d4a0a0;
  background: #FDF8F7;
  border-color: #F5E0D8;
}

.action-bar summary {
  background: linear-gradient(90deg, #FDF5F3 0%, #FFFEF9 100%);
  color: #8b4a4a;
}

.action-bar summary::before {
  color: #c97a7a;
}

.action-bar p {
  padding: 3px 14px;
  margin: 0;
  font-size: 0.86em;
  color: #6b3a3a;
  line-height: 1.8;
  position: relative;
  padding-left: 28px;
}

.action-bar p::before {
  content: "◈";
  position: absolute;
  left: 14px;
  color: #d4a0a0;
}

/* ===== 移动端微调 ===== */
@media screen and (max-width: 480px) {
  article p {
    margin: 0;
  }

  details summary {
    padding: 9px 12px;
    font-size: 1em;
  }

  details > p,
  details > div {
    padding: 3px 12px;
    font-size: 1em;
  }

  .sb-block {
    margin: 6px 10px;
    padding: 6px 10px;
    font-size: 0.84em;
  }

  .memory-scroll table {
    font-size: 0.78em;
  }

  .memory-scroll table th,
  .memory-scroll table td {
    padding: 5px 6px;
  }
}