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

/* ===== 正文区域 · 轻小说阅读感 ===== */
text {
  display: block;
  background: linear-gradient(180deg, #fffef9 0%, #faf8f2 100%);
  border-left: 3px solid #c8b88a;
  margin: 16px 0 20px 0;
  padding: 20px 18px 20px 22px;
  border-radius: 0 12px 12px 0;
  box-shadow:
    0 2px 12px rgba(160, 140, 100, 0.08),
    inset 0 0 30px rgba(255, 252, 240, 0.5);
  position: relative;
}

text::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><rect width="200" height="200" fill="none"/><line x1="0" y1="32" x2="200" y2="32" stroke="%23e8e0cc" stroke-width="0.5" opacity="0.3"/><line x1="0" y1="64" x2="200" y2="64" stroke="%23e8e0cc" stroke-width="0.5" opacity="0.3"/><line x1="0" y1="96" x2="200" y2="96" stroke="%23e8e0cc" stroke-width="0.5" opacity="0.3"/><line x1="0" y1="128" x2="200" y2="128" stroke="%23e8e0cc" stroke-width="0.5" opacity="0.3"/><line x1="0" y1="160" x2="200" y2="160" stroke="%23e8e0cc" stroke-width="0.5" opacity="0.3"/><line x1="0" y1="192" x2="200" y2="192" stroke="%23e8e0cc" stroke-width="0.5" opacity="0.3"/></svg>');
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 0;
  border-radius: 0 12px 12px 0;
}

text p {
  position: relative;
  z-index: 1;
  margin-bottom: 1em;
  line-height: 1.95;
  color: #3a3225;
  text-indent: 2em;
  letter-spacing: 0.03em;
}

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

/* ===== 状态栏 details 通用容器 ===== */
details {
  margin: 8px 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 2px 10px rgba(120, 100, 70, 0.07);
  border: 1px solid rgba(200, 184, 138, 0.25);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

details:hover {
  box-shadow: 0 4px 18px rgba(120, 100, 70, 0.13);
  border-color: rgba(200, 184, 138, 0.45);
}

details[open] {
  box-shadow: 0 4px 20px rgba(120, 100, 70, 0.12);
  border-color: rgba(180, 160, 110, 0.4);
}

/* ===== summary 标题行 ===== */
details summary {
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5a4e3a;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(245, 240, 225, 0.85) 0%, rgba(240, 235, 215, 0.7) 100%);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease;
  user-select: none;
  position: relative;
}

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

details summary::after {
  content: "▸";
  position: absolute;
  right: 16px;
  color: #b0a080;
  transition: transform 0.3s ease;
}

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

details[open] summary {
  background: linear-gradient(135deg, rgba(235, 228, 205, 0.9) 0%, rgba(228, 220, 195, 0.8) 100%);
  border-bottom: 1px solid rgba(200, 184, 138, 0.3);
}

/* ===== details 内容区 ===== */
details p {
  padding: 4px 16px 4px 20px;
  margin: 0;
  line-height: 1.75;
  color: #4a4235;
  position: relative;
}

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

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

/* ===== 各状态栏个性化左侧色条 ===== */

/* 角色状态 - 暖琥珀 */
details:nth-of-type(1) {
  border-left: 4px solid #d4a853;
}
details:nth-of-type(1) summary {
  background: linear-gradient(135deg, rgba(250, 243, 225, 0.88) 0%, rgba(248, 238, 210, 0.75) 100%);
}

/* 江澈 - 冰蓝 */
details:nth-of-type(2) {
  border-left: 4px solid #7ab0c9;
}
details:nth-of-type(2) summary {
  background: linear-gradient(135deg, rgba(235, 245, 252, 0.88) 0%, rgba(225, 240, 250, 0.75) 100%);
}

/* 主角信息 - 薄荷绿 */
details:nth-of-type(3) {
  border-left: 4px solid #7dbf9e;
}
details:nth-of-type(3) summary {
  background: linear-gradient(135deg, rgba(235, 250, 242, 0.88) 0%, rgba(225, 245, 235, 0.75) 100%);
}

/* 在场NPC - 淡紫 */
details:nth-of-type(4) {
  border-left: 4px solid #b09ed1;
}
details:nth-of-type(4) summary {
  background: linear-gradient(135deg, rgba(243, 238, 252, 0.88) 0%, rgba(238, 232, 248, 0.75) 100%);
}

/* 记忆区 - 旧纸棕 */
details:nth-of-type(5) {
  border-left: 4px solid #c4a96a;
}
details:nth-of-type(5) summary {
  background: linear-gradient(135deg, rgba(250, 244, 228, 0.88) 0%, rgba(245, 238, 218, 0.75) 100%);
}

/* 行动建议 - 珊瑚橘 */
details:nth-of-type(6) {
  border-left: 4px solid #d98a6c;
}
details:nth-of-type(6) summary {
  background: linear-gradient(135deg, rgba(252, 242, 235, 0.88) 0%, rgba(250, 236, 225, 0.75) 100%);
}

/* ===== 移动端微调 ===== */
@media (max-width: 640px) {
  text {
    padding: 16px 14px 16px 18px;
    margin: 12px 0 16px 0;
    border-radius: 0 8px 8px 0;
  }

  details {
    margin: 6px 0;
    border-radius: 8px;
  }

  details summary {
    padding: 10px 14px;
  }

  details p {
    padding: 3px 14px 3px 16px;
  }

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

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

/* ===== 大屏优化（平板/桌面端） ===== */
@media (min-width: 768px) {
  text {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 28px 26px 28px 30px;
    border-radius: 0 16px 16px 0;
  }

  details {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}