/* ========== 顶部信息栏 top-bar ========== */
.top-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  background: linear-gradient(90deg, #1e0632, #3a1055, #1e0632);
  border-left: 3px solid #b56dff;
  border-right: 3px solid #b56dff;
  border-radius: 8px;
  color: #eeddff;
  font-size: 0.88em;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 12px rgba(90, 20, 140, 0.35);
}

.top-bar .tb-item {
  padding: 3px 10px;
  background: rgba(180, 100, 240, 0.12);
  border: 1px solid rgba(180, 100, 240, 0.35);
  border-radius: 12px;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 120px;
}

.top-bar .tb-item b {
  color: #d49aff;
  margin-right: 4px;
}

/* ========== 思维链面板 think-panel（重写：强制按钮显示） ========== */
.think-panel {
  display: block;
  margin: 12px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px dashed #7a2ac2;
  background: rgba(20, 8, 35, 0.7);
  transition: all 0.3s ease;
}

.think-panel > summary {
  display: block;
  cursor: pointer;
  padding: 14px 18px;
  background: linear-gradient(135deg, #2a0b4a 0%, #451580 100%);
  color: #ffb6ff;
  font-weight: bold;
  font-size: 0.95em;
  list-style: none;
  user-select: none;
  transition: all 0.25s ease;
  letter-spacing: 0.8px;
  text-align: left;
  border-bottom: 1px solid rgba(180, 100, 240, 0.3);
  position: relative;
  min-height: 20px;
}

.think-panel > summary::-webkit-details-marker {
  display: none;
}

.think-panel > summary::marker {
  content: "";
  display: none;
}

.think-panel > summary::before {
  content: "▶ ";
  color: #ffb6ff;
  font-size: 0.9em;
  margin-right: 6px;
  transition: transform 0.3s ease;
  display: inline-block;
  text-shadow: 0 0 8px rgba(255, 182, 255, 0.6);
}

.think-panel[open] > summary::before {
  content: "▼ ";
}

.think-panel > summary::after {
  content: " [ 点击展开 / 折叠 ]";
  color: #b56dff;
  font-size: 0.75em;
  font-style: italic;
  margin-left: 8px;
  opacity: 0.85;
}

.think-panel[open] > summary::after {
  content: " [ 点击折叠 ]";
}

.think-panel > summary:hover {
  background: linear-gradient(135deg, #3a1560 0%, #5820a0 100%);
  color: #ffffff;
  box-shadow: inset 0 0 20px rgba(180, 100, 240, 0.3);
}

.think-panel > summary:active {
  background: linear-gradient(135deg, #451580 0%, #6a2ab2 100%);
}

.think-panel think {
  display: block;
  padding: 14px 18px;
  background: rgba(10, 3, 20, 0.9);
  color: #a888c8;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82em;
  line-height: 1.75;
  white-space: pre-wrap;
  border-top: 1px solid rgba(180, 100, 240, 0.25);
  word-break: break-word;
}

/* ========== 正文紫色气泡 story-bubble ========== */
.story-bubble {
  display: block;
  padding: 18px 22px;
  margin: 14px 0;
  background: linear-gradient(135deg, #2a0d40 0%, #3d1560 50%, #2a0d40 100%);
  border: 1px solid #7a2ac2;
  border-radius: 16px;
  box-shadow:
    0 4px 20px rgba(90, 20, 140, 0.45),
    inset 0 0 40px rgba(180, 100, 240, 0.08);
  color: #f0e0ff;
  line-height: 1.85;
  font-size: 0.95em;
  position: relative;
}

.story-bubble::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c48eff, transparent);
  opacity: 0.6;
}

.story-bubble p {
  margin: 0 0 12px 0;
  text-indent: 2em;
}

.story-bubble p:last-child {
  margin-bottom: 0;
}

/* ========== 状态栏 details 折叠面板（排除 think-panel） ========== */
details:not(.think-panel) {
  display: block;
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #4a1a70;
  transition: all 0.3s ease;
  background: #1a0a28;
}

details:not(.think-panel) > summary {
  display: block;
  cursor: pointer;
  padding: 11px 16px;
  background: linear-gradient(135deg, #22062e 0%, #38095a 100%);
  color: #e8c9ff;
  font-weight: bold;
  font-size: 0.95em;
  list-style: none;
  user-select: none;
  transition: all 0.25s ease;
  border-left: 4px solid #7a2ac2;
  letter-spacing: 0.5px;
}

details:not(.think-panel) > summary::-webkit-details-marker {
  display: none;
}

details:not(.think-panel) > summary::marker {
  content: "";
  display: none;
}

details:not(.think-panel) > summary::before {
  content: "▶";
  color: #b56dff;
  font-size: 0.75em;
  margin-right: 8px;
  transition: transform 0.3s ease;
  display: inline-block;
}

details:not(.think-panel) > summary:hover {
  background: linear-gradient(135deg, #33095a, #52148a);
  color: #ffffff;
  border-left-color: #c48eff;
  box-shadow: inset 0 0 15px rgba(180, 100, 240, 0.2);
}

details:not(.think-panel)[open] {
  background: #3d1560;
  border-color: #8a3ad2;
  box-shadow: 0 0 16px rgba(140, 60, 200, 0.4);
}

details:not(.think-panel)[open] > summary {
  background: linear-gradient(135deg, #522090 0%, #6a2ab2 100%);
  color: #ffffff;
  border-left-color: #d49aff;
  border-bottom: 1px solid #7a2ac2;
}

details:not(.think-panel)[open] > summary::before {
  transform: rotate(90deg);
  color: #ffb6ff;
}

details:not(.think-panel)[open] > summary:hover {
  background: linear-gradient(135deg, #5a24a0 0%, #7830c8 100%);
}

/* ========== 表格样式 ========== */
details table {
  margin: 0 !important;
  border: none !important;
  border-radius: 0;
  width: 100%;
}

details table th,
details table td {
  border: 1px solid #4a1a70 !important;
  padding: 7px 9px !important;
  transition: background 0.2s ease;
}

details table tr:hover td {
  background: rgba(180, 100, 240, 0.1) !important;
}

/* ========== 行动接口面板 action-panel ========== */
.action-panel {
  display: block;
  background: linear-gradient(135deg, #2a1040 0%, #3d1560 100%);
  border: 1px solid #6a2ab2;
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 12px;
  color: #ccc;
  font-size: 0.9em;
  box-shadow: 0 2px 12px rgba(90, 20, 140, 0.35);
}

.action-panel p {
  margin: 3px 0;
}

.action-panel p b {
  color: #d49aff;
  text-shadow: 0 0 6px rgba(180, 100, 240, 0.5);
}

.action-panel p:hover {
  color: #f0e0ff;
  transition: color 0.2s ease;
}