ai {
  display: block;
  max-width: 100%;
  padding: 16px;
  background:
    linear-gradient(rgba(245,240,228,0.97), rgba(238,230,212,0.97)),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(180,155,110,0.04) 40px,
      rgba(180,155,110,0.04) 80px
    );
  color: #1e1810;
  line-height: 1.9;
  border-radius: 4px;
  border: 1px solid #c8b89a;
  box-shadow:
    0 0 0 4px #f0e8d4,
    0 0 0 5px #c0aa88,
    0 6px 24px rgba(0,0,0,0.12);
}

/* ── 隐藏元素 ── */
.think-box, cot {
  display: none;
}

/* ── 顶部时间地点栏 ── */
.time-location {
  background: linear-gradient(to right, #2c2010, #3d2e1a);
  color: #e8d9b8;
  padding: 10px 16px;
  border-radius: 3px;
  margin-bottom: 14px;
  font-size: 0.88em;
  letter-spacing: 0.8px;
  position: relative;
  overflow: hidden;
}

.time-location::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, #c9a96e, transparent);
}

.time-location::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #8b6f3e, transparent);
}

.time-location summary {
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  color: #d4b87a;
  list-style: none;
  letter-spacing: 1.5px;
}

.time-location summary::-webkit-details-marker { display: none; }

/* ── 分割线 ── */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #b09870 20%, #c9a96e 50%, #b09870 80%, transparent);
  margin: 18px 0;
  position: relative;
}

/* ── 正文区 ── */
text {
  display: block;
  padding: 18px 20px;
  background: rgba(255,253,248,0.72);
  border-radius: 3px;
  border-left: 3px solid #c9a96e;
  border-right: 1px solid #e0d0b8;
  margin-bottom: 14px;
  font-size: 1em;
  letter-spacing: 0.3px;
}

text p {
  margin: 0 0 14px 0;
  text-indent: 2em;
}

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

/* ── 状态栏通用 ── */
details {
  background: rgba(255,252,245,0.8);
  border: 1px solid #d8c8a8;
  border-top: 2px solid #b09870;
  border-radius: 3px;
  padding: 0;
  margin-bottom: 8px;
  transition: box-shadow 0.25s ease;
  overflow: hidden;
}

details:hover {
  box-shadow: 0 3px 14px rgba(100,75,40,0.13);
}

details summary {
  font-weight: bold;
  color: #3d2e1a;
  cursor: pointer;
  user-select: none;
  padding: 10px 14px 10px 36px;
  list-style: none;
  position: relative;
  background: linear-gradient(to right, rgba(192,165,115,0.15), transparent);
  letter-spacing: 1px;
  font-size: 0.95em;
}

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

details summary::before {
  content: "◈";
  position: absolute;
  left: 12px;
  color: #b09060;
  font-size: 0.85em;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease, color 0.2s;
}

details[open] summary::before {
  transform: translateY(-50%) rotate(45deg);
  color: #8b6030;
}

details[open] summary {
  border-bottom: 1px dashed #d8c8a8;
  margin-bottom: 0;
}

details > *:not(summary) {
  padding: 10px 14px;
}

/* ── 玩家面板 ── */
.player-panel {
  border-top-color: #c9a96e;
}

.player-panel summary {
  color: #5a3820;
  font-size: 1em;
}

/* ── 灵宠面板（去除绿色，改为琥珀褐）── */
.skills-panel {
  border-top-color: #a07840;
}

.skills-panel summary {
  color: #5a4020;
}

/* ── 装备面板 ── */
.weapon-panel {
  border-top-color: #887060;
}

/* ── 物品栏 ── */
.inventory-panel {
  border-top-color: #9a8870;
}

/* ── NPC面板 ── */
.npc-panel, .locked-npc-panel {
  border-top-color: #7a6888;
}

.npc-panel summary, .locked-npc-panel summary {
  color: #3d2e50;
}

/* ── 记忆区 ── */
.memory-panel {
  border-top-color: #5a7888;
  font-size: 0.88em;
}

.memory-panel summary {
  color: #2a4858;
}

.memory-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.memory-panel th, .memory-panel td {
  padding: 6px 10px;
  border-bottom: 1px solid #e4d8c4;
  text-align: left;
}

.memory-panel th {
  background: rgba(90,120,136,0.1);
  color: #2a4858;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.memory-panel tr:hover td {
  background: rgba(90,120,136,0.05);
}

/* ── 行动选项 ── */
.action-panel {
  border-top-color: #c07848;
}

.action-panel summary {
  color: #6a3820;
  font-size: 1em;
}

.action-panel ol {
  margin: 0;
  padding-left: 22px;
}

.action-panel li {
  margin: 7px 0;
  color: #3d2810;
  transition: all 0.18s;
  cursor: pointer;
  letter-spacing: 0.3px;
}

.action-panel li:hover {
  color: #c07848;
  padding-left: 4px;
}

/* ── 移动端适配 ── */
@media (max-width: 768px) {
  ai {
    padding: 10px;
    font-size: 0.94em;
    box-shadow:
      0 0 0 3px #f0e8d4,
      0 0 0 4px #c0aa88,
      0 4px 14px rgba(0,0,0,0.10);
  }

  text {
    padding: 14px;
  }
}