/* 哥特紫罗兰风格 - 整体基调：暗黑、紫罗兰、神秘、哥特装饰细节 */

details.tw-chain {
  background: #1a1218;  /* 深紫黑底 */
  border: 1.5px solid #4b2a3a;  /* 暗紫罗兰边框 */
  border-radius: 14px;
  padding: 8px 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(75, 42, 58, 0.6);
  transition: all 0.25s ease;
}

details.tw-chain:hover {
  border-color: #8b5a7a;  /* 紫罗兰高光 */
  box-shadow: 0 4px 20px rgba(139, 90, 122, 0.5);
}

details.tw-chain > summary {
  font-size: 14px;
  font-weight: 600;
  color: #c9a0b8;  /* 淡紫罗兰文字，与 details > summary 一致 */
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px rgba(139, 90, 122, 0.3);
}

details.tw-chain > summary::-webkit-details-marker {
  display: none;
}

details.tw-chain > summary::before {
  content: "🦇";  /* 哥特蝙蝠 */
  font-size: 16px;
  margin-right: 4px;
  filter: drop-shadow(0 0 4px #8b5a7a);
}

details.tw-chain[open] > summary::before {
  content: "🌙";  /* 暗月 */
}

details.tw-chain div.chain-block {
  font-size: 13px;
  line-height: 1.6;
  color: #d4b8c8;  /* 灰紫文字，与 text 和 details[open] p 一致 */
  padding: 6px 10px;
  margin: 4px 0;
  background: rgba(30, 18, 26, 0.7);
  border-radius: 8px;
  border-left: 3px solid #6b3a5a;
  box-shadow: inset 0 0 8px rgba(75, 42, 58, 0.3);
}

details.tw-chain div.chain-block b {
  color: #d68ab8;  /* 亮紫罗兰，与 details[open] p b 一致 */
  font-weight: 700;
  text-shadow: 0 0 8px #6b3a5a;
}

details.tw-chain div.chain-block.b1 { border-left-color: #8b5a7a; }
details.tw-chain div.chain-block.b2 { border-left-color: #a06a8a; }
details.tw-chain div.chain-block.b3 { border-left-color: #b87a9a; }
details.tw-chain div.chain-block.b4 { border-left-color: #d08aaa; }

text {
  display: block;
  background: linear-gradient(145deg, #1e141a, #2a1a24);  /* 深紫黑渐变 */
  border: 1.5px solid #4b2a3a;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(75, 42, 58, 0.2);
  line-height: 1.75;
  font-size: 15px;
  color: #d4b8c8;  /* 灰紫 */
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

text:hover {
  box-shadow: 0 6px 28px rgba(75, 42, 58, 0.8), inset 0 0 30px rgba(139, 90, 122, 0.15);
  border-color: #6b3a5a;
}

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

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

details[open] {
  background: #1a1218;
  border: 1.5px solid #5a3a4a;  /* 紫罗兰边框 */
  border-radius: 14px;
  padding: 8px 14px 14px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 12px rgba(75, 42, 58, 0.6), inset 0 0 20px rgba(30, 18, 26, 0.6);
  transition: all 0.2s ease;
}

details[open]:hover {
  border-color: #8b5a7a;
  box-shadow: 0 3px 20px rgba(75, 42, 58, 0.8), inset 0 0 30px rgba(30, 18, 26, 0.8);
}

details > summary {
  font-size: 14px;
  font-weight: 700;
  color: #c9a0b8;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  letter-spacing: 0.5px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 8px rgba(139, 90, 122, 0.2);
}

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

details > summary::after {
  content: " ◈";  /* 哥特菱形 */
  font-size: 14px;
  color: #8b5a7a;
  transition: transform 0.25s ease, color 0.2s;
}

details[open] > summary::after {
  content: " ◈";
  transform: rotate(180deg);
  color: #b87a9a;
}

details[open] p {
  font-size: 13px;
  line-height: 1.65;
  color: #d4b8c8;  /* 灰紫文字 */
  margin: 5px 0;
  padding: 3px 6px;
  background: rgba(30, 18, 26, 0.5);
  border-radius: 6px;
  border-left: 2px solid #4b2a3a;
}

details[open] p b,
details[open] p strong {
  color: #d68ab8;  /* 亮紫罗兰 */
  font-weight: 700;
  text-shadow: 0 0 8px #4b2a3a;
}

details[open] details[open] {
  background: #100c10;
  border-color: #5a3a4a;
  margin-top: 8px;
  padding: 6px 12px 10px 12px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

details[open] details[open] p {
  background: rgba(20, 12, 18, 0.7);
  border-left-color: #6b3a5a;
}

details[open] details[open] p:has(+ p) {
  border-bottom: 1px dashed #4b2a3a;
  padding-bottom: 6px;
}

details[open] details[open] p:last-child {
  margin-bottom: 2px;
}

a {
  color: #b87a9a;
  text-decoration: none;
  border-bottom: 1px dotted #4b2a3a;
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: #d68ab8;
  border-bottom-color: #d68ab8;
  text-shadow: 0 0 12px #8b5a7a;
}

/* 哥特风格滚动条 */
details[open]::-webkit-scrollbar {
  width: 5px;
}

details[open]::-webkit-scrollbar-track {
  background: #1a1218;
  border-radius: 10px;
}

details[open]::-webkit-scrollbar-thumb {
  background: #4b2a3a;
  border-radius: 10px;
}

details[open]::-webkit-scrollbar-thumb:hover {
  background: #8b5a7a;
}

@media (max-width: 640px) {
  text {
    padding: 14px 16px;
    font-size: 14px;
    border-radius: 12px;
  }

  details[open] {
    padding: 6px 10px 12px 10px;
  }

  details[open] p {
    font-size: 12.5px;
    padding: 2px 4px;
  }

  details > summary {
    font-size: 13px;
  }

  details.tw-chain {
    padding: 6px 10px;
  }

  details.tw-chain div.chain-block {
    font-size: 12px;
    padding: 4px 8px;
  }
}
/* ====================== 星记忆回廊 - 优化版 ====================== */

details.sys-panel {
    background: #1a1218;
    border: 1.8px solid #4b2a3a;
    border-radius: 16px;
    padding: 10px 14px;
    margin: 16px 0;
    box-shadow: 0 4px 20px rgba(75, 42, 58, 0.75);
    transition: all 0.3s ease;
}

details.sys-panel:hover {
    border-color: #8b5a7a;
    box-shadow: 0 6px 25px rgba(139, 90, 122, 0.6);
}

details.sys-panel > summary {
    font-size: 15.5px;
    font-weight: 700;
    color: #e0b0cc;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    text-shadow: 0 0 10px rgba(214, 138, 184, 0.5);
}

details.sys-panel > summary::-webkit-details-marker {
    display: none;
}

details.sys-panel > summary::before {
    content: "⚜️";
    color: #d68ab8;
    font-size: 19px;
    filter: drop-shadow(0 0 6px #d68ab8);
}

/* 内部记忆详情容器 */
details.star-memory {
    margin-top: 12px;
    background: #120b12;
    border: 1px solid #5a3a4a;
    border-radius: 12px;
    padding: 12px;
}

details.star-memory > summary {
    font-size: 14.5px;
    color: #c9a0b8;
    font-weight: 600;
    padding: 6px 0;
}

details.star-memory > summary::-webkit-details-marker {
    display: none;
}

/* 表格优化 - 关键修复 */
details.sys-panel table,
details.star-memory table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.55;
    color: #d4b8c8;
    table-layout: fixed;
}

details.sys-panel th,
details.star-memory th {
    background: #2a1a24;
    color: #f0c0d8;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid #8b5a7a;
    font-weight: 700;
    white-space: nowrap;
}

details.sys-panel td,
details.star-memory td {
    padding: 9px 8px;
    border-bottom: 1px solid #4b2a3a;
    vertical-align: top;
    word-break: break-all;
}

details.sys-panel tr:last-child td,
details.star-memory tr:last-child td {
    border-bottom: none;
}

/* 固化触发警告样式 */
details.sys-panel summary .warning {
    color: #ffaa77;
    font-weight: 700;
}

/* 增强可读性 */
details.sys-panel code,
details.star-memory code,
details.sys-panel pre,
details.star-memory pre {
    background: #1f1620;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #b87a9a;
    overflow-x: auto;
    font-size: 13.8px;
    line-height: 1.6;
}