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

/* ===== 全局details美化（蓝色萌系） ===== */
details {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border: 2px solid #64B5F6;
  border-radius: 12px;
  padding: 0.8em;
  margin: 1em 0;
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.2);
  transition: all 0.3s ease;
}

details:hover {
  box-shadow: 0 6px 20px rgba(100, 181, 246, 0.35);
  transform: translateY(-2px);
}

details[open] {
  background: linear-gradient(135deg, #BBDEFB 0%, #90CAF9 100%);
  border-color: #42A5F5;
}

summary {
  font-weight: 600;
  color: #1976D2;
  cursor: pointer;
  padding: 0.6em 1em;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.2s;
  user-select: none;
  list-style: none;
}

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

summary::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 0.3s;
  color: #42A5F5;
}

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

summary:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ===== 代码块美化（场景、主角信息等markdown区） ===== */
details pre {
  background: rgba(255, 255, 255, 0.85);
  border-left: 4px solid #42A5F5;
  border-radius: 8px;
  padding: 1em;
  margin: 0.8em 0;
  overflow-x: auto;
  font-size: 0.95em;
  line-height: 1.6;
}

details code {
  color: #1565C0;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* ===== 记忆区表格美化（可横向滚动） ===== */
details summary:has(+ *:contains("记忆回廊")) ~ * table,
details:has(summary:contains("记忆")) table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9em;
  display: block;
  overflow-x: auto; /* 横向滚动 */
  max-height: 400px; /* 纵向最大高度 */
  overflow-y: auto; /* 纵向滚动 */
}

details table thead {
  background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

details table th {
  padding: 0.8em;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

details table td {
  padding: 0.7em;
  border-bottom: 1px solid #E3F2FD;
  color: #424242;
}

details table tbody tr:hover {
  background: rgba(100, 181, 246, 0.1);
}

details table tbody tr:nth-child(even) {
  background: rgba(227, 242, 253, 0.3);
}

/* ===== 分隔线美化 ===== */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #64B5F6, transparent);
  margin: 1.5em 0;
}

/* ===== 手机端适配 ===== */
@media (max-width: 768px) {
  details {
    padding: 0.6em;
    margin: 0.8em 0;
    border-radius: 10px;
  }
  
  summary {
    font-size: 0.95em;
    padding: 0.5em 0.8em;
  }
  
  details pre {
    font-size: 0.85em;
    padding: 0.8em;
  }
  
  details table {
    font-size: 0.8em;
    max-height: 300px; /* 手机端降低最大高度 */
  }
  
  details table th,
  details table td {
    padding: 0.5em;
  }
}

/* ===== 小屏幕优化（<480px） ===== */
@media (max-width: 480px) {
  details {
    font-size: 0.9em;
  }
  
  details table {
    max-height: 250px;
  }
}