/* ===== 思维链隐藏 - 多重保险 ===== */
think {
  display: none;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

/* ===== 安全隔离层 - 防止think未闭合吞噬正文 ===== */
text,
text *,
details,
details *,
.top-bar,
.top-bar *,
.action-recommend,
.action-recommend * {
  display: revert !important;
  visibility: visible !important;
  max-height: none !important;
  overflow: visible !important;
  font-size: revert !important;
  line-height: revert !important;
  opacity: 1 !important;
  position: revert !important;
  pointer-events: auto !important;
}
text {
  display: block !important;
}
details {
  display: block !important;
}

/* ===== 顶部状态栏 ===== */
.top-bar {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  margin: 12px 0;
  background: linear-gradient(135deg, rgba(30, 30, 60, 0.85), rgba(60, 30, 80, 0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(180, 140, 255, 0.25);
  box-shadow: 0 4px 20px rgba(100, 60, 180, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  font-size: 13px;
  color: #d4c6f0;
  letter-spacing: 0.5px;
}
.top-bar .top-left {
  font-weight: 600;
  color: #e8d5ff;
}
.top-bar .top-right {
  color: #b8a5d4;
  font-size: 12px;
}

/* ===== 正文区域 ===== */
text {
  display: block !important;
  padding: 4px 2px;
  line-height: 1.9;
  font-size: 15px;
  color: #e8e0f0;
}
text p {
  display: block !important;
  margin: 0.6em 0;
  text-indent: 2em;
  text-align: justify;
  word-break: break-word;
}

/* ===== 折叠面板通用 ===== */
details {
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden !important;
  border: 1px solid rgba(180, 140, 255, 0.2);
  background: linear-gradient(180deg, rgba(25, 20, 50, 0.9), rgba(35, 25, 60, 0.95));
  box-shadow: 0 2px 15px rgba(80, 40, 150, 0.15);
  transition: box-shadow 0.3s ease;
}
details:hover {
  box-shadow: 0 4px 25px rgba(120, 70, 200, 0.3);
}
details summary {
  display: flex !important;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #d8c4f5;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(60, 40, 100, 0.6), rgba(80, 50, 120, 0.4));
  border-bottom: 1px solid rgba(180, 140, 255, 0.15);
  list-style: none;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: background 0.3s ease, color 0.3s ease;
}
details summary::-webkit-details-marker {
  display: none;
}
details summary::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.3s ease;
  color: #a78bfa;
  font-size: 12px;
}
details[open] summary::before {
  transform: rotate(90deg);
}
details[open] summary {
  background: linear-gradient(135deg, rgba(80, 50, 130, 0.7), rgba(100, 60, 150, 0.5));
  color: #efe0ff;
}

/* ===== 面板内容区域 ===== */
.status-panel,
.sensory-panel,
.memory-panel {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.8;
  color: #c8b8e0;
}
.status-panel strong,
.sensory-panel strong,
.memory-panel strong {
  color: #d8c0f8;
  font-size: 13.5px;
}

/* ===== 身体详情特殊样式 ===== */
.body-detail {
  background: linear-gradient(180deg, rgba(40, 20, 60, 0.5), rgba(50, 25, 70, 0.3));
  border-top: 1px solid rgba(255, 120, 180, 0.15);
}

/* ===== 记忆区表格 ===== */
.memory-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  table-layout: fixed;
}
.memory-panel table th {
  background: linear-gradient(135deg, rgba(80, 50, 130, 0.8), rgba(100, 60, 160, 0.6));
  color: #e8d5ff;
  padding: 8px 6px;
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(180, 140, 255, 0.3);
}
.memory-panel table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(180, 140, 255, 0.1);
  color: #b8a5d4;
  vertical-align: top;
  word-break: break-word;
}
.memory-panel table tr:hover td {
  background: rgba(100, 60, 180, 0.1);
  color: #d4c0f0;
}
.memory-panel table td:first-child {
  width: 8%;
  text-align: center;
  color: #a78bfa;
  font-weight: 600;
}
.memory-panel table td:nth-child(2) {
  width: 28%;
  font-size: 11px;
}
.memory-panel table td:nth-child(3) {
  width: 18%;
}
.memory-panel table td:nth-child(4) {
  width: 46%;
}
.memory-panel hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 140, 255, 0.3), transparent);
  margin: 12px 0;
}

/* ===== 推荐行动 ===== */
.action-recommend {
  margin: 12px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(30, 25, 55, 0.9), rgba(45, 30, 70, 0.85));
  border-radius: 12px;
  border: 1px solid rgba(180, 140, 255, 0.2);
  font-size: 13px;
  color: #c8b8e0;
  line-height: 2;
}
.action-recommend strong {
  color: #e8d0ff;
  font-size: 14px;
}

/* ===== 移动端适配 ===== */
@media screen and (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    font-size: 12px;
  }
  text {
    font-size: 14.5px;
    line-height: 1.85;
  }
  text p {
    text-indent: 1.5em;
  }
  .status-panel,
  .sensory-panel,
  .memory-panel {
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .memory-panel table {
    font-size: 11px;
  }
  .memory-panel table th {
    padding: 6px 4px;
    font-size: 10.5px;
  }
  .memory-panel table td {
    padding: 5px 4px;
  }
  .memory-panel table td:nth-child(2) {
    font-size: 10px;
  }
  details summary {
    padding: 10px 12px;
    font-size: 13px;
  }
  .action-recommend {
    padding: 10px 12px;
    font-size: 12.5px;
  }
}

/* ===== 浅色模式兼容 ===== */
@media (prefers-color-scheme: light) {
  .top-bar {
    background: linear-gradient(135deg, rgba(240, 235, 255, 0.95), rgba(230, 220, 250, 0.95));
    border-color: rgba(140, 100, 220, 0.3);
    box-shadow: 0 4px 20px rgba(140, 100, 220, 0.12);
    color: #5a4a7a;
  }
  .top-bar .top-left {
    color: #4a3870;
  }
  .top-bar .top-right {
    color: #7a6a9a;
  }
  text {
    color: #3a2a5a;
  }
  details {
    background: linear-gradient(180deg, rgba(248, 244, 255, 0.98), rgba(240, 235, 252, 0.98));
    border-color: rgba(140, 100, 220, 0.25);
    box-shadow: 0 2px 15px rgba(140, 100, 220, 0.08);
  }
  details:hover {
    box-shadow: 0 4px 25px rgba(140, 100, 220, 0.18);
  }
  details summary {
    background: linear-gradient(135deg, rgba(230, 220, 250, 0.8), rgba(240, 230, 255, 0.6));
    border-bottom-color: rgba(140, 100, 220, 0.15);
    color: #5a4080;
  }
  details summary::before {
    color: #7c5cbf;
  }
  details[open] summary {
    background: linear-gradient(135deg, rgba(220, 205, 250, 0.85), rgba(230, 215, 255, 0.7));
    color: #4a3070;
  }
  .status-panel,
  .sensory-panel,
  .memory-panel {
    color: #5a4a7a;
  }
  .status-panel strong,
  .sensory-panel strong,
  .memory-panel strong {
    color: #4a3570;
  }
  .body-detail {
    background: linear-gradient(180deg, rgba(255, 240, 248, 0.4), rgba(250, 235, 245, 0.3));
    border-top-color: rgba(220, 100, 160, 0.2);
  }
  .memory-panel table th {
    background: linear-gradient(135deg, rgba(220, 205, 250, 0.9), rgba(230, 215, 255, 0.7));
    color: #4a3570;
    border-bottom-color: rgba(140, 100, 220, 0.3);
  }
  .memory-panel table td {
    color: #6a5a8a;
    border-bottom-color: rgba(140, 100, 220, 0.1);
  }
  .memory-panel table tr:hover td {
    background: rgba(140, 100, 220, 0.06);
    color: #4a3870;
  }
  .memory-panel table td:first-child {
    color: #7c5cbf;
  }
  .memory-panel hr {
    background: linear-gradient(90deg, transparent, rgba(140, 100, 220, 0.25), transparent);
  }
  .action-recommend {
    background: linear-gradient(135deg, rgba(245, 240, 255, 0.95), rgba(238, 230, 252, 0.9));
    border-color: rgba(140, 100, 220, 0.2);
    color: #5a4a7a;
  }
  .action-recommend strong {
    color: #4a3570;
  }
}

/* ===== 呼吸灯动效 ===== */
@keyframes subtle-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(100, 60, 180, 0.2), 0 0 8px rgba(167, 139, 250, 0.15); }
  50% { box-shadow: 0 4px 20px rgba(100, 60, 180, 0.2), 0 0 16px rgba(167, 139, 250, 0.3); }
}
.top-bar {
  animation: subtle-glow 4s ease-in-out infinite;
}