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

/* ===== 顶部环境栏 ===== */
env {
  display: block;
  background: rgba(27, 31, 59, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #E8E8F0;
  padding: 10px 16px;
  margin: 0 0 16px 0;
  border-radius: 8px;
  font-size: 0.88em;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.3);
}

env::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 12px;
  width: 3px;
  height: 3px;
  background: #E8E8F0;
  border-radius: 50%;
  box-shadow:
    -15px 4px 0 0 rgba(232,232,240,0.7),
    -35px -1px 0 0 rgba(232,232,240,0.4),
    -58px 3px 0 -1px rgba(232,232,240,0.6),
    -80px -2px 0 0 rgba(232,232,240,0.3),
    -105px 5px 0 -1px rgba(232,232,240,0.5),
    -130px 1px 0 0 rgba(232,232,240,0.35),
    -160px 4px 0 -1px rgba(232,232,240,0.45),
    -188px -1px 0 0 rgba(232,232,240,0.25),
    -210px 3px 0 0 rgba(232,232,240,0.55),
    -240px 0px 0 -1px rgba(232,232,240,0.3);
}

/* ===== 正文区域 ===== */
text {
  display: block;
  margin: 0 0 16px 0;
  line-height: 1.9;
  font-size: 1em;
  background: rgba(20, 25, 55, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid rgba(100, 140, 200, 0.15);
  box-shadow: inset 0 0 40px rgba(10, 15, 40, 0.3);
}

/* 普通叙述段落：缩进2em */
text p {
  margin: 0 0 14px 0;
  text-align: justify;
  color: #C8D8F0;
  text-indent: 2em;
}

/* 普通角色对话段落：不缩进 */
text p.d {
  text-indent: 0;
  padding-left: 12px;
  border-left: 2px solid rgba(180, 200, 230, 0.35);
  color: #B8C8E0;
}

/* 丘木对话段落：蓝色系 */
text p.qm {
  text-indent: 0;
  padding-left: 12px;
  border-left: 3px solid #6BA3E8;
  color: #7BB8F0;
}

/* ===== 行动选项（不折叠） ===== */
actions {
  display: block;
  margin: 0 0 14px 0;
  padding: 12px 0 4px 0;
  border-top: 1px solid rgba(201, 168, 76, 0.2);
}

actions::before {
  content: "🎯 行动选项";
  display: block;
  font-weight: bold;
  font-size: 0.93em;
  color: #4A3B6B;
  margin-bottom: 8px;
  padding-left: 2px;
  letter-spacing: 0.5px;
}

actions p {
  background: rgba(37, 42, 85, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 0 0 6px 0;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid rgba(201, 168, 76, 0.18);
  color: #D0D0E0;
  font-size: 0.92em;
  line-height: 1.6;
  transition: all 0.3s ease;
  cursor: pointer;
  text-indent: 0;
}

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

actions p:hover {
  border-color: rgba(201, 168, 76, 0.7);
  box-shadow: 0 0 14px rgba(201, 168, 76, 0.18), 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
  color: #E8E8F0;
  background: rgba(46, 51, 104, 0.85);
}

actions p b {
  color: #C9A84C;
}

/* ===== 折叠面板通用样式 ===== */
details {
  margin: 0 0 10px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.25);
  background: rgba(27, 31, 59, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s ease;
}

details:hover {
  border-color: rgba(201, 168, 76, 0.6);
}

details summary {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95em;
  color: #E8E8F0;
  background: rgba(34, 38, 74, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  list-style: none;
  position: relative;
  transition: background 0.3s ease;
  user-select: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

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

details summary::after {
  content: "▸";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #C9A84C;
  font-size: 0.85em;
  transition: transform 0.3s ease;
}

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

details summary:hover {
  background: rgba(42, 47, 90, 0.8);
}

details[open] summary {
  border-bottom: 1px solid rgba(201, 168, 76, 0.35);
}

details p {
  padding: 2px 16px;
  margin: 0;
  color: #D0D0E0;
  font-size: 0.92em;
  line-height: 1.75;
  text-indent: 0;
}

details b {
  color: #C9A84C;
}

/* ===== 心声面板（第1个details） ===== */
details:nth-of-type(1) {
  border-left: 3px solid #7B68AE;
}

details:nth-of-type(1) p {
  font-style: italic;
  color: #B8A9D4;
}

/* ===== 丘木状态面板（第2个details） ===== */
details:nth-of-type(2) {
  border-left: 3px solid #5A9E8F;
  position: relative;
}

details:nth-of-type(2)::after {
  content: "";
  position: absolute;
  top: 40px;
  right: 8px;
  width: 2px;
  height: 2px;
  background: transparent;
  border-radius: 50%;
  box-shadow:
    0 0 3px 1px rgba(201,168,76,0.15),
    -20px 15px 3px 0px rgba(232,232,240,0.08),
    -45px 30px 2px 0px rgba(201,168,76,0.1),
    -10px 55px 3px 0px rgba(232,232,240,0.06),
    -60px 70px 2px 0px rgba(201,168,76,0.08),
    -25px 90px 3px 0px rgba(232,232,240,0.07);
  pointer-events: none;
}

/* ===== 主角状态面板（第3个details） ===== */
details:nth-of-type(3) {
  border-left: 3px solid #4A6FA5;
}

/* ===== 记忆区面板（第4个details） ===== */
details:nth-of-type(4) {
  border-left: 3px solid #C9A84C;
}

details:nth-of-type(4) p b:first-child {
  display: inline-block;
  margin-top: 6px;
}

details:nth-of-type(4) p:last-of-type {
  font-size: 0.82em;
  color: #8888AA;
  border-top: 1px solid rgba(201, 168, 76, 0.15);
  margin-top: 6px;
  padding-top: 8px;
}

/* ===== summary中emoji防止被截断 ===== */
details summary {
  overflow: visible;
  white-space: nowrap;
}

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
  text {
    font-size: 0.95em;
    line-height: 1.85;
    padding: 12px 14px;
  }

  actions p {
    padding: 9px 12px;
    font-size: 0.88em;
  }

  actions::before {
    font-size: 0.88em;
  }

  details summary {
    padding: 9px 14px;
    font-size: 0.9em;
  }

  details p {
    padding: 2px 12px;
    font-size: 0.88em;
  }

  text {
    font-size: 0.95em;
    line-height: 1.85;
  }

  text p {
    text-indent: 2em;
  }

  text p.d,
  text p.qm {
    text-indent: 0;
  }
}