ai {
  --parchment: #F5E6C8;
  --ink: #2C1810;
  --cinnabar: #C23B22;
  --stone: #6B7B8D;
  --gold: #D4A853;
  --old-paper: #E8D5A3;
  --binding-dark: #1A0F0A;
  --binding-light: #3A2518;
  --seal-red: rgba(194,59,34,0.15);
  --brush-stroke: rgba(44,24,16,0.08);
  
  display: block;
  max-width: 680px;
  margin: 16px auto;
  padding: 20px 24px 24px;
  background: linear-gradient(135deg, var(--parchment) 0%, var(--old-paper) 50%, var(--parchment) 100%);
  border: 2px solid var(--binding-dark);
  border-right-color: var(--binding-light);
  border-bottom-color: var(--binding-light);
  border-radius: 0 12px 12px 0;
  box-shadow: 
    3px 3px 0 rgba(26,15,10,0.3),
    inset 0 0 60px rgba(139,90,43,0.08);
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", Georgia, serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  position: relative;
}

/* 宣纸纹理背景 */
ai::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      var(--brush-stroke) 28px,
      var(--brush-stroke) 28.5px
    );
  pointer-events: none;
  opacity: 0.4;
}

/* 卷轴轴头装饰 — 顶部 */
ai::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 6px;
  background: linear-gradient(90deg, 
    var(--binding-dark) 0%, 
    var(--gold) 20%, 
    var(--binding-dark) 50%, 
    var(--gold) 80%, 
    var(--binding-dark) 100%
  );
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ===================== HEADER ===================== */
hd {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--cinnabar);
  letter-spacing: 1px;
  padding: 6px 0 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--cinnabar);
  position: relative;
}
/* 印章标记 */
hd::after {
  content: "◆";
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: var(--cinnabar);
  opacity: 0.5;
  transform: rotate(45deg);
}

/* ===================== TEXT ===================== */
text {
  display: block;
  margin: 8px 0;
}
text p {
  margin: 0.4em 0;
  text-indent: 2em;
  text-align: justify;
  word-break: break-word;
}

/* ===================== DETAILS（卷轴章节） ===================== */
details {
  display: block;
  margin: 8px 0;
  border: 1px solid rgba(44,24,16,0.15);
  border-radius: 0 8px 8px 8px;
  background: rgba(245,230,200,0.3);
  backdrop-filter: blur(2px);
  transition: all 0.25s ease;
}
details[open] {
  background: rgba(245,230,200,0.6);
  box-shadow: inset 0 1px 4px rgba(44,24,16,0.06);
}

/* SUMMARY — 章节标题（卷轴杆设计） */
summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--ink) 0%, #3A2518 100%);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  border-radius: 0 8px 8px 0;
  user-select: none;
  position: relative;
  transition: all 0.2s;
  min-height: 28px;
}
/* 卷轴杆两端圆钮 */
summary::before,
summary::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold), var(--binding-dark));
  flex-shrink: 0;
}
summary::after {
  margin-left: auto;
}
/* 悬停朱砂光效 */
summary:hover {
  color: #F0D080;
  text-shadow: 0 0 6px rgba(212,168,83,0.4);
}

/* 朱批竖线装饰（每个p的左侧） */
details p {
  display: block;
  padding: 2px 0 2px 14px;
  margin: 2px 0;
  border-left: 2px solid var(--cinnabar);
  position: relative;
}
/* 批注起首圆点 */
details p::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cinnabar);
  opacity: 0.4;
}

/* ===================== d（数据字段行） ===================== */
d {
  display: block;
  font-size: 13.5px;
  padding: 1px 0;
  line-height: 1.6;
  transition: all 0.15s;
  position: relative;
}
/* 悬停毛笔波浪下划线 */
d:hover {
  color: #4A2A1A;
}
d:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: repeating-linear-gradient(
    90deg,
    var(--cinnabar) 0px,
    var(--cinnabar) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.4;
}

/* ===================== t= 标记（分类徽标） ===================== */
p[t] {
  border-left-color: var(--gold);
}
p[t]::before {
  background: var(--gold);
  opacity: 0.6;
}

/* 自检/时间/地点等特殊分区 */
p[t="解析"] { border-left-color: #5B7A9E; }
p[t="解析"]::before { background: #5B7A9E; }
p[t="记忆"] { border-left-color: #7A6B4E; }
p[t="记忆"]::before { background: #7A6B4E; }
p[t="评价"] { border-left-color: #A35C3A; }
p[t="评价"]::before { background: #A35C3A; }

/* ===================== 表格（记忆区） ===================== */
p[t="seq"],
p[t="seq2"],
p[t="data"],
p[t="data2"] {
  font-family: "Courier New", monospace;
  font-size: 12px;
  background: rgba(44,24,16,0.03);
  border-left-color: rgba(44,24,16,0.2);
  padding: 1px 14px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow-x: auto;
}
p[t="seq"]::before,
p[t="data"]::before,
p[t="seq2"]::before,
p[t="data2"]::before { display: none; }
p[t="archive"],
p[t="instant"] {
  border-left: none;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cinnabar);
  padding: 4px 0 2px 0;
  font-size: 13px;
}
p[t="archive"]::before,
p[t="instant"]::before { display: none; }

/* ===================== 选项 (opt) ===================== */
p[t="opt"] {
  border-left: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
p[t="opt"]::before { display: none; }
p[t="opt"] d {
  padding: 3px 10px 3px 16px;
  border-left: 3px solid var(--cinnabar);
  margin: 0;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s;
  cursor: default;
}
p[t="opt"] d:hover {
  background: rgba(194,59,34,0.06);
  border-left-width: 5px;
}
p[t="opt"] d:first-child {
  border-left-color: var(--gold);
}
p[t="opt"] d:last-child {
  border-left-color: #5B7A9E;
}

/* ===================== 手机适配 ===================== */
@media (max-width: 520px) {
  ai {
    padding: 14px 12px 18px;
    margin: 8px auto;
    border-radius: 0 8px 8px 0;
  }
  hd {
    font-size: 12px;
    padding: 4px 0 8px;
  }
  summary {
    font-size: 13px;
    padding: 4px 8px;
    min-height: 24px;
  }
  summary::before,
  summary::after {
    width: 7px;
    height: 7px;
  }
  d {
    font-size: 12.5px;
  }
  text p {
    font-size: 14px;
  }
  details p {
    padding-left: 10px;
  }
  p[t="seq"],
  p[t="data"],
  p[t="seq2"],
  p[t="data2"] {
    font-size: 11px;
    white-space: normal;
  }
}