/* ============================================================
   校园生活模拟器 · 玻璃手账风格（最终整合版）
   适配新结构：隐藏推演链，柔和记忆区与公告板
   ============================================================ */

/* ---------- 根容器 ---------- */
ai {
  all: initial;
  display: block;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  max-width: 840px;
  margin: 0 auto;
  padding: 28px 28px 48px;
  background: linear-gradient(145deg, #f0f5fa 0%, #e4ecf3 100%);
  color: #1e2b3c;
  line-height: 1.8;
  border-radius: 32px;
  box-shadow: 0 8px 40px rgba(30, 50, 70, 0.06);
  position: relative;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.5) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 40px 40px, 60px 60px;
  background-blend-mode: overlay;
}

/* ---------- 隐藏推演链（思维链） ---------- */
ai details.cot {
  display: none !important;
}

/* ---------- 所有卡片通用玻璃样式 ---------- */
ai details:not(.cot),
ai hd,
ai g,
ai nc,
ai table {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.2s;
}

ai details:not(.cot):hover,
ai hd:hover,
ai g:hover,
ai nc:hover {
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.8);
}

/* ---------- 头部 ---------- */
ai hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  padding: 16px 26px;
  margin-bottom: 28px;
  border-radius: 20px;
  font-size: 0.92rem;
  color: #1a3a5c;
  letter-spacing: 0.03em;
  background: rgba(235, 245, 252, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 
    0 6px 24px rgba(60, 120, 180, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(255, 255, 255, 0.3);
  position: relative;
}

ai hd::before {
  content: "🏫";
  font-size: 1.5rem;
  margin-right: 4px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

ai hd::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 8px;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

ai hd > * {
  display: inline-block;
  background: rgba(255, 255, 255, 0.5);
  padding: 4px 16px;
  border-radius: 40px;
  font-size: 0.85rem;
  color: #1a3a5c;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
  backdrop-filter: none;
}

/* ============================================================
   ✨ 正文区域
   ============================================================ */
ai text {
  display: block;
  padding: 8px 12px 16px;
  background: rgba(255, 252, 245, 0.55);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 40px rgba(220, 200, 180, 0.05);
  position: relative;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-blend-mode: overlay;
}

ai text::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  bottom: 20px;
  background: repeating-linear-gradient(
    transparent,
    transparent 31px,
    rgba(200, 180, 165, 0.08) 31px,
    rgba(200, 180, 165, 0.08) 32px
  );
  pointer-events: none;
  border-radius: 8px;
  z-index: 0;
}

ai text::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, transparent 50%, rgba(200, 180, 165, 0.12) 50%);
  pointer-events: none;
  border-radius: 0 16px 0 0;
  z-index: 1;
}

ai text > * {
  position: relative;
  z-index: 1;
}

/* ---------- 正文段落 ---------- */
ai text p {
  margin: 0 0 18px 0;
  padding: 2px 0 2px 0;
  font-size: 1.02rem;
  color: #2a3a4a;
  text-align: justify;
  line-height: 2.1;
  letter-spacing: 0.03em;
  text-indent: 2em;
  font-weight: 400;
  font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", "Noto Serif SC", serif;
}

ai text p:first-child::first-letter {
  font-size: 2.8em;
  float: left;
  line-height: 0.9;
  margin-right: 6px;
  color: #4a7a9a;
  font-weight: 700;
  font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", "Noto Serif SC", serif;
}

ai text p + p {
  position: relative;
}

ai text p + p::before {
  content: "♢";
  display: block;
  text-align: center;
  font-size: 0.7rem;
  color: rgba(150, 170, 190, 0.25);
  margin: -6px 0 2px 0;
  letter-spacing: 0.4em;
  font-weight: 300;
}

ai text p:hover {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  transition: background 0.2s;
}

/* ============================================================
   💬 对话引用
   ============================================================ */
ai q {
  display: block;
  margin: 20px 0 20px 20px;
  padding: 16px 22px 16px 22px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px 16px 16px 4px;
  font-style: normal;
  color: #1a3a5c;
  position: relative;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.04),
    0 1px 4px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", "Noto Serif SC", serif;
  line-height: 1.9;
  text-indent: 0;
  transform: rotate(-0.3deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
  border-left: none !important;
}

ai q:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

ai q[n="苏沐瑶"] {
  background: rgba(255, 240, 240, 0.92);
}
ai q[n="白芷"] {
  background: rgba(235, 245, 255, 0.92);
}

ai q[n]::after {
  content: "—— " attr(n);
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: #6a8aa0;
  text-align: right;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  border-top: 1px dashed rgba(180, 200, 220, 0.3);
  padding-top: 6px;
}

ai q::before {
  display: none !important;
}

/* ============================================================
   📚 折叠面板 —— 通用样式（排除 .cot）
   ============================================================ */
ai details:not(.cot) {
  display: block;
  margin: 22px 0 0;
  padding: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.3s, border-color 0.3s;
  overflow: visible;
}

ai details:not(.cot)[open] {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

ai summary {
  display: block;
  padding: 16px 24px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1d3a57;
  cursor: pointer;
  border-radius: 20px 20px 0 0;
  background: rgba(245, 250, 255, 0.6);
  transition: background 0.3s, color 0.2s;
  letter-spacing: 0.04em;
  user-select: none;
  list-style: none;
  position: relative;
  border-bottom: 2px solid transparent;
  z-index: 2;
}

ai summary:hover {
  background: rgba(235, 245, 252, 0.7);
}

ai details:not(.cot)[open] > summary {
  background: rgba(225, 240, 252, 0.7);
  border-bottom-color: rgba(150, 190, 220, 0.4);
}

ai summary::before {
  content: "● ";
  font-size: 0.6rem;
  color: rgba(91, 141, 184, 0.6);
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* 各面板主题色（跳过第1个 .cot） */
ai details:nth-of-type(1):not(.cot) summary {
  background: rgba(220, 240, 255, 0.5);
  color: #0e3b5e;
}
ai details:nth-of-type(1):not(.cot)[open] {
  border-color: rgba(100, 170, 220, 0.5);
}
ai details:nth-of-type(2):not(.cot) summary {
  background: rgba(220, 245, 220, 0.5);
  color: #2a5a3a;
}
ai details:nth-of-type(2):not(.cot)[open] {
  border-color: rgba(120, 190, 140, 0.5);
}
ai details:nth-of-type(3):not(.cot) summary {
  background: rgba(250, 235, 210, 0.5);
  color: #6a4e2a;
}
ai details:nth-of-type(3):not(.cot)[open] {
  border-color: rgba(210, 170, 130, 0.5);
}
/* 校园风向板（第4个）见下方独立样式 */
/* 记忆区（第5个）见下方独立样式 */
ai details:nth-of-type(6):not(.cot) summary {
  background: rgba(250, 225, 220, 0.5);
  color: #6a2e2a;
}
ai details:nth-of-type(6):not(.cot)[open] {
  border-color: rgba(210, 140, 130, 0.5);
}

/* 折叠内容动画 */
ai details:not(.cot) > *:not(summary) {
  max-height: 0;
  overflow: hidden;
  padding: 0 24px 0 24px;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s ease,
              opacity 0.3s ease;
}

ai details:not(.cot)[open] > *:not(summary) {
  max-height: 5000px;
  padding: 12px 24px 22px;
  opacity: 1;
}

/* ============================================================
   📢 校园风向 & 传闻板 —— 柔和软木板（圆润过渡）
   ============================================================ */
/* 使用第4个 details（因为第一个 .cot 被隐藏，所以索引变化，但用实际标签选择更安全） */
/* 但我们有 class 标记，可以直接用 details:nth-of-type(4) 但 .cot 被隐藏了，实际可见的第4个 details 就是原本的第5个？ */
/* 更可靠：用属性选择器或直接按顺序，既然 .cot 被 display:none，那么可见的 details 顺序依次为：
   1. 主角信息
   2. NPC信息
   3. 常识一览
   4. 校园风向
   5. 记忆区
   6. 行动推荐
   所以我们仍然可以用 nth-of-type(4) 和 nth-of-type(5) 来定位校园风向和记忆区，因为 .cot 不占位。
   但为了更稳健，我们可以使用类或 data 属性，但用户没有给这些 details 加类，所以用 nth-of-type 没问题。
*/
ai details:nth-of-type(4) {
  background: rgba(210, 190, 170, 0.15) !important; /* 更淡的软木底色，减少对比 */
  border: 1px solid rgba(190, 170, 150, 0.25);
  border-radius: 20px;
  box-shadow: 
    inset 0 0 40px rgba(160, 140, 120, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.02);
  padding-bottom: 2px;
  position: relative;
}

ai details:nth-of-type(4)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

ai details:nth-of-type(4) > * {
  position: relative;
  z-index: 1;
}

ai details:nth-of-type(4) summary {
  background: rgba(200, 180, 160, 0.2) !important;
  color: #3d2a1a !important;
  border-bottom: 2px solid rgba(160, 140, 120, 0.15);
  border-radius: 20px 20px 0 0 !important;
}

ai details:nth-of-type(4) summary::before {
  content: "📌 ";
  font-size: 1rem;
  color: #8a6a4a;
}

/* 每条 g 变成独立便签（柔和版） */
ai details:nth-of-type(4) g {
  display: block;
  margin: 14px 12px 16px 12px;
  padding: 14px 18px 12px 18px;
  border-radius: 14px 16px 16px 14px;
  border-left: 4px solid rgba(180, 160, 140, 0.3);
  background: rgba(255, 252, 245, 0.8) !important;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.02),
    0 1px 2px rgba(0, 0, 0, 0.01),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

ai details:nth-of-type(4) g[t="校园公告"] {
  border-left-color: #c47a6b;
  background: rgba(255, 248, 245, 0.85) !important;
}
ai details:nth-of-type(4) g[t="NPC间传闻"] {
  border-left-color: #8aa67a;
  background: rgba(245, 252, 242, 0.85) !important;
}
ai details:nth-of-type(4) g[t="近期事件"] {
  border-left-color: #b58da8;
  background: rgba(252, 245, 250, 0.85) !important;
}

/* 图钉装饰 */
ai details:nth-of-type(4) g::before {
  content: "📌";
  position: absolute;
  top: -8px;
  left: 14px;
  font-size: 16px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.08));
  transform: rotate(-6deg);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  z-index: 2;
}

/* 标题标签 */
ai details:nth-of-type(4) g::after {
  content: attr(t);
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: rgba(100, 120, 140, 0.6);
  padding: 1px 12px;
  border-radius: 30px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  backdrop-filter: none;
  border: 1px solid rgba(255,255,255,0.15);
}

ai details:nth-of-type(4) g[t="校园公告"]::after {
  background: rgba(196, 122, 107, 0.7);
}
ai details:nth-of-type(4) g[t="NPC间传闻"]::after {
  background: rgba(138, 166, 122, 0.7);
}
ai details:nth-of-type(4) g[t="近期事件"]::after {
  background: rgba(181, 141, 168, 0.7);
}

ai details:nth-of-type(4) g > d {
  padding: 4px 0 2px 0;
  border-bottom: 1px dashed rgba(200, 180, 170, 0.15);
  font-size: 0.9rem;
  color: #2a3a4a;
  font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", "Noto Serif SC", serif;
  line-height: 1.7;
}

ai details:nth-of-type(4) g > d:last-child {
  border-bottom: none;
}

ai details:nth-of-type(4) g > d::before {
  content: "• ";
  color: rgba(150, 170, 190, 0.35);
  font-weight: 300;
}

ai details:nth-of-type(4) g:hover {
  transform: translateY(-2px) rotate(0.2deg);
  box-shadow: 
    0 6px 18px rgba(0, 0, 0, 0.04),
    0 2px 6px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

ai details:nth-of-type(4) g:empty {
  display: none;
}

/* ============================================================
   🧠 记忆区 —— 柔和档案盒（圆润过渡）
   ============================================================ */
ai details:nth-of-type(5) {
  background: rgba(245, 240, 230, 0.15) !important; /* 更淡的底色 */
  border: 1px solid rgba(200, 185, 165, 0.2);
  border-radius: 20px;
  box-shadow: 
    inset 0 0 40px rgba(200, 180, 160, 0.03),
    0 4px 16px rgba(0, 0, 0, 0.02);
  padding-bottom: 2px;
  position: relative;
}

ai details:nth-of-type(5)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

ai details:nth-of-type(5) > * {
  position: relative;
  z-index: 1;
}

ai details:nth-of-type(5) summary {
  background: rgba(220, 210, 195, 0.2) !important;
  color: #3d3228 !important;
  border-bottom: 2px solid rgba(200, 185, 165, 0.15);
  border-radius: 20px 20px 0 0 !important;
}

ai details:nth-of-type(5) summary::before {
  content: "📂 ";
  font-size: 1rem;
}

/* 记忆区内的普通 d */
ai details:nth-of-type(5) > d {
  padding: 8px 16px;
  margin: 6px 14px 8px 14px;
  background: rgba(255, 252, 245, 0.5);
  border-radius: 30px;
  border: 1px solid rgba(200, 185, 170, 0.15);
  font-size: 0.85rem;
  color: #4a3d32;
  text-align: center;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  display: inline-block;
  width: auto;
}

/* 归纳状态 */
ai details:nth-of-type(5) details {
  margin: 10px 12px 14px 12px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.7) !important;
  border: 1px solid rgba(200, 185, 170, 0.15);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.01),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

ai details:nth-of-type(5) details summary {
  background: rgba(235, 225, 215, 0.3) !important;
  color: #3d3228 !important;
  border-bottom: 1px solid rgba(200, 185, 170, 0.1);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: 14px 14px 0 0 !important;
  letter-spacing: 0.04em;
}

ai details:nth-of-type(5) details summary::before {
  content: "📋 ";
  font-size: 0.9rem;
  color: #7a6a5a;
}

ai details:nth-of-type(5) details d {
  padding: 5px 18px 5px 28px;
  font-size: 0.82rem;
  color: #4a3d32;
  border-bottom: 1px dashed rgba(200, 185, 170, 0.1);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  position: relative;
}

ai details:nth-of-type(5) details d:last-child {
  border-bottom: none;
}

ai details:nth-of-type(5) details d::before {
  content: "▸";
  position: absolute;
  left: 8px;
  color: rgba(160, 140, 120, 0.3);
  font-size: 0.6rem;
}

/* 记忆区 g 档案盒 */
ai details:nth-of-type(5) g {
  display: block;
  margin: 12px 12px 16px 12px;
  padding: 12px 16px 14px 16px;
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.7) !important;
  border-left: 4px solid rgba(160, 140, 120, 0.25);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.01),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  border: 1px solid rgba(200, 185, 170, 0.1);
  border-left-width: 4px;
}

ai details:nth-of-type(5) g[t="剧情记忆 PLOT"] {
  border-left-color: #b58da8;
  background: rgba(252, 245, 250, 0.75) !important;
}
ai details:nth-of-type(5) g[t="长期记忆 LTM"] {
  border-left-color: #8aa6b8;
  background: rgba(245, 250, 252, 0.75) !important;
}
ai details:nth-of-type(5) g[t="短期记忆 STM"] {
  border-left-color: #c4a57a;
  background: rgba(252, 248, 240, 0.75) !important;
}

ai details:nth-of-type(5) g::after {
  content: attr(t);
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  background: rgba(160, 140, 120, 0.5);
  padding: 1px 12px;
  border-radius: 30px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  border: 1px solid rgba(255,255,255,0.15);
}

ai details:nth-of-type(5) g[t="剧情记忆 PLOT"]::after {
  background: rgba(181, 141, 168, 0.6);
}
ai details:nth-of-type(5) g[t="长期记忆 LTM"]::after {
  background: rgba(138, 166, 184, 0.6);
}
ai details:nth-of-type(5) g[t="短期记忆 STM"]::after {
  background: rgba(196, 165, 122, 0.6);
}

ai details:nth-of-type(5) g::before {
  display: none !important;
}

ai details:nth-of-type(5) g table {
  background: rgba(255, 255, 255, 0.25) !important;
  border: 1px solid rgba(200, 185, 170, 0.1);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.82rem;
  margin-top: 4px;
}

ai details:nth-of-type(5) g table th {
  background: rgba(220, 210, 195, 0.2);
  color: #3d3228;
  font-size: 0.7rem;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(200, 185, 170, 0.15);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

ai details:nth-of-type(5) g table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(200, 185, 170, 0.08);
  color: #3d3228;
  font-size: 0.82rem;
  line-height: 1.6;
  font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", "Noto Serif SC", serif;
}

ai details:nth-of-type(5) g table tr:last-child td {
  border-bottom: none;
}

ai details:nth-of-type(5) g table tr:hover td {
  background: rgba(255, 255, 255, 0.15);
}

ai details:nth-of-type(5) g:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.03),
    0 2px 6px rgba(0, 0, 0, 0.01),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

ai details:nth-of-type(5) g:empty {
  display: none;
}

/* ============================================================
   📝 常识一览表格（原“一览”）
   ============================================================ */
ai details:nth-of-type(3) table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.4) !important;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

ai details:nth-of-type(3) table th {
  background: rgba(220, 235, 248, 0.5);
  color: #1f405e;
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid rgba(180, 200, 220, 0.3);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

ai details:nth-of-type(3) table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(200, 215, 230, 0.2);
  vertical-align: top;
  color: #1b3348;
}

ai details:nth-of-type(3) table tr:last-child td {
  border-bottom: none;
}

ai details:nth-of-type(3) table tr:hover td {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   📋 信息条目 d（通用）
   ============================================================ */
ai d {
  display: block;
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(200, 215, 230, 0.3);
  color: #1f364d;
}

ai d:last-of-type {
  border-bottom: none;
}

ai f {
  display: inline-block;
  min-width: 56px;
  font-weight: 700;
  color: rgba(43, 87, 125, 0.8);
  margin-right: 6px;
  font-size: 0.85rem;
}

/* ============================================================
   👥 NPC 卡片组
   ============================================================ */
ai nc {
  display: block;
  padding: 10px 0 6px;
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px;
  margin: 6px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

ai nc d {
  padding: 4px 16px;
  border-bottom: 1px solid rgba(200, 215, 230, 0.2);
}

/* ============================================================
   ➖ 分割线
   ============================================================ */
ai hr {
  display: block;
  margin: 24px 0 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), rgba(180, 200, 220, 0.4), rgba(255,255,255,0.6), transparent);
  opacity: 0.6;
}

/* ============================================================
   📊 通用表格（备用）
   ============================================================ */
ai table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.4) !important;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

ai th {
  background: rgba(220, 235, 248, 0.5);
  color: #1f405e;
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid rgba(180, 200, 220, 0.3);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

ai td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(200, 215, 230, 0.2);
  vertical-align: top;
  color: #1b3348;
}

ai tr:last-child td {
  border-bottom: none;
}

ai tr:hover td {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   🏷️ g 标签（通用）
   ============================================================ */
ai g {
  display: block;
  margin: 8px 0 14px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px;
  border-left: 5px solid rgba(139, 179, 208, 0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  color: #1a3a5c;
  font-size: 0.95rem;
  line-height: 1.6;
}

ai g::before {
  content: attr(t) " ";
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a3a5c;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(180, 200, 220, 0.3);
  padding-bottom: 4px;
}

ai g:not([t])::before {
  display: none;
}

ai g > * {
  font-weight: normal;
  color: inherit;
}

ai g > d {
  font-weight: normal;
  color: #1f364d;
  border-bottom: 1px solid rgba(200, 215, 230, 0.2);
}

/* ============================================================
   🎯 行动推荐
   ============================================================ */
ai details:last-of-type[open] {
  background: rgba(255, 245, 240, 0.7) !important;
  border-color: rgba(210, 140, 130, 0.6);
}

ai details:last-of-type[open] summary {
  background: rgba(250, 225, 220, 0.6);
  color: #5a2a22;
  border-bottom-color: rgba(210, 140, 130, 0.3);
}

ai details:last-of-type[open] d {
  padding: 10px 18px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-weight: 600;
  color: #1b3d5c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 8px rgba(0,0,0,0.02);
  transition: all 0.2s;
}

ai details:last-of-type[open] d:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(210, 140, 130, 0.5);
  transform: translateX(6px);
  box-shadow: 0 4px 16px rgba(180, 100, 80, 0.05);
}

ai details:last-of-type[open] d::before {
  content: "▸ ";
  color: rgba(176, 106, 90, 0.7);
  font-weight: 700;
}

/* ============================================================
   🆕 空状态表格
   ============================================================ */
ai table:has(td:only-child) {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 2px dashed rgba(200, 215, 230, 0.5);
  box-shadow: none !important;
  border-radius: 12px;
}

ai table:has(td:only-child) th {
  display: none;
}

ai table:has(td:only-child) td {
  text-align: center;
  padding: 22px 12px;
  color: rgba(138, 162, 185, 0.7);
  font-size: 0.85rem;
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.04em;
  background: transparent !important;
}

/* ============================================================
   📱 响应式微调
   ============================================================ */
@media (max-width: 600px) {
  ai {
    padding: 16px 14px 30px;
    border-radius: 20px;
    background: linear-gradient(145deg, #f0f5fa 0%, #e4ecf3 100%);
    background-size: auto;
  }

  ai hd {
    padding: 12px 16px;
    font-size: 0.8rem;
    gap: 4px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  ai hd > * {
    padding: 3px 12px;
    font-size: 0.78rem;
  }

  ai hd::after {
    display: none;
  }

  ai text {
    padding: 6px 6px 12px;
  }
  ai text p {
    font-size: 0.95rem;
    line-height: 2;
    text-indent: 1.8em;
    font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", "Noto Serif SC", serif;
  }
  ai text p:first-child::first-letter {
    font-size: 2.2em;
  }
  ai text p + p::before {
    font-size: 0.6rem;
  }
  ai text::after {
    width: 24px;
    height: 24px;
  }

  ai q {
    margin-left: 8px;
    padding: 12px 14px 12px 14px;
    transform: rotate(0deg);
    font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", "Noto Serif SC", serif;
  }

  /* 常识一览表格滚动 */
  ai details:nth-of-type(3) {
    position: relative;
  }

  ai details:nth-of-type(3)[open] > *:not(summary) {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding: 6px 4px 16px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 200, 220, 0.4) transparent;
  }

  ai details:nth-of-type(3)[open] > *:not(summary)::-webkit-scrollbar {
    height: 6px;
  }
  ai details:nth-of-type(3)[open] > *:not(summary)::-webkit-scrollbar-track {
    background: rgba(200, 215, 230, 0.15);
    border-radius: 10px;
  }
  ai details:nth-of-type(3)[open] > *:not(summary)::-webkit-scrollbar-thumb {
    background: rgba(160, 185, 210, 0.4);
    border-radius: 10px;
  }

  ai details:nth-of-type(3) table {
    display: table;
    min-width: 620px;
    width: auto;
    font-size: 0.72rem;
    border-radius: 10px;
    margin: 0;
  }

  ai details:nth-of-type(3) table th,
  ai details:nth-of-type(3) table td {
    padding: 6px 10px;
    white-space: nowrap;
    font-size: 0.7rem;
    vertical-align: middle;
  }

  ai details:nth-of-type(3) table th:nth-child(1),
  ai details:nth-of-type(3) table td:nth-child(1) {
    padding: 6px 6px;
    min-width: 36px;
    text-align: center;
  }
  ai details:nth-of-type(3) table th:nth-child(2),
  ai details:nth-of-type(3) table td:nth-child(2) {
    min-width: 100px;
  }
  ai details:nth-of-type(3) table th:nth-child(3),
  ai details:nth-of-type(3) table td:nth-child(3) {
    min-width: 160px;
    max-width: 220px;
    white-space: normal;
    word-break: break-word;
  }
  ai details:nth-of-type(3) table th:nth-child(4),
  ai details:nth-of-type(3) table td:nth-child(4) {
    min-width: 140px;
    max-width: 200px;
    white-space: normal;
    word-break: break-word;
  }

  ai details:nth-of-type(3) table::after {
    content: "↔ 左右滑动查看完整表格";
    display: block;
    text-align: center;
    font-size: 0.55rem;
    color: rgba(100, 130, 160, 0.5);
    padding: 6px 0 2px 0;
    letter-spacing: 0.06em;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  }

  ai details:nth-of-type(3) table:has(td:only-child)::after {
    display: none;
  }

  /* 通用表格 */
  ai table {
    font-size: 0.75rem;
  }
  ai th,
  ai td {
    padding: 6px 8px;
  }

  /* 折叠面板 */
  ai details:not(.cot) > *:not(summary) {
    padding: 0 14px 0 14px;
  }
  ai details:not(.cot)[open] > *:not(summary) {
    padding: 6px 14px 16px;
  }

  ai summary {
    padding: 12px 16px;
    font-size: 0.88rem;
  }

  /* 空状态表格 */
  ai table:has(td:only-child) td {
    padding: 14px 10px;
  }

  /* 通用 g 标签 */
  ai g {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  ai g::before {
    font-size: 0.95rem;
  }

  ai text::before {
    left: 12px;
    right: 12px;
  }

  /* 公告板响应式 */
  ai details:nth-of-type(4) g {
    margin: 12px 6px 14px 6px;
    padding: 12px 14px 10px 14px;
  }
  ai details:nth-of-type(4) g::before {
    font-size: 14px;
    top: -8px;
    left: 10px;
  }
  ai details:nth-of-type(4) g::after {
    font-size: 0.55rem;
    padding: 1px 10px;
  }

  /* 记忆区响应式 */
  ai details:nth-of-type(5) g {
    margin: 10px 6px 12px 6px;
    padding: 10px 12px 10px 12px;
  }
  ai details:nth-of-type(5) g::after {
    font-size: 0.55rem;
    padding: 1px 8px;
  }
  ai details:nth-of-type(5) details {
    margin: 8px 6px 10px 6px;
  }
  ai details:nth-of-type(5) > d {
    padding: 6px 12px;
    font-size: 0.78rem;
    margin: 4px 10px 6px 10px;
  }
  ai details:nth-of-type(5) g table {
    font-size: 0.7rem;
  }
  ai details:nth-of-type(5) g table th,
  ai details:nth-of-type(5) g table td {
    padding: 4px 6px;
  }
}

/* ============================================================
   🖨️ 打印友好
   ============================================================ */
@media print {
  ai {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #ccc;
  }
  ai details:not(.cot),
  ai hd,
  ai g,
  ai nc,
  ai table {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  ai details:not(.cot)[open]:last-of-type d:hover {
    transform: none;
    box-shadow: none;
  }
  ai text {
    background: white !important;
  }
  ai text::before,
  ai text::after {
    display: none;
  }
  ai q {
    transform: none !important;
    background: white !important;
  }
  ai details:nth-of-type(4) {
    background: white !important;
  }
  ai details:nth-of-type(4)::before {
    display: none;
  }
  ai details:nth-of-type(4) g {
    transform: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
  }
  ai details:nth-of-type(5) {
    background: white !important;
  }
  ai details:nth-of-type(5)::before {
    display: none;
  }
  ai details:nth-of-type(5) g {
    transform: none !important;
    box-shadow: none !important;
    background: white !important;
  }
  ai details:nth-of-type(3) table::after {
    display: none !important;
  }
  ai details:nth-of-type(3)[open] > *:not(summary) {
    overflow: visible !important;
  }
}