/* ===== 卷面 xy===== */
xy {
  display: block;
  max-width: 860px;
  margin: 20px auto;
  padding: clamp(22px, 4.8vw, 38px);
  background:
    radial-gradient(circle at 12% 16%, rgba(42,42,40,0.05), transparent 26%),
    radial-gradient(circle at 88% 84%, rgba(42,42,40,0.045), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.4), transparent 70%),
    #FAF7F2;
  border: 1px solid rgba(42,42,40,0.32);
  border-radius: 3px;
  box-shadow: 0 8px 26px rgba(42,42,40,0.13), inset 0 0 60px rgba(42,42,40,0.02);
  position: relative;
  overflow: hidden;
  color: #2C2620;
  font-family: "STKaiti", "Kaiti SC", "Songti SC", serif;
}
xy::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(42,42,40,0.2);
  border-radius: 2px;
  box-shadow: inset 0 0 0 3px rgba(250,247,242,0.6), inset 0 0 0 4px rgba(42,42,40,0.1);
  pointer-events: none;
  z-index: 0;
}
xy::after {
  content: '墨';
  position: absolute;
  bottom: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 50%),
    #D63384;
  color: #FAF7F2;
  font-family: "STKaiti", "Kaiti SC", serif;
  font-size: 18px;
  font-weight: 700;
  border-radius: 4px;
  box-shadow: 0 2px 7px rgba(214,51,132,0.32), inset 0 0 0 1px rgba(255,255,255,0.25);
  opacity: 0.92;
  pointer-events: none;
  z-index: 2;
}
xy > * { position: relative; z-index: 1; }

/* ===== 正文 text ===== */
xy text {
  display: block;
  line-height: 2.1;
  color: #2C2620;
  margin: 0 0 22px 0;
  padding: 6px 4px;
  font-size: clamp(14px, 2.5vw, 16px);
  font-family: "STKaiti", "Kaiti SC", "Songti SC", serif;
  letter-spacing: 0.6px;
}
/* 【修复一】补完整字体栈 */
xy text p {
  margin: 0 0 15px 0;
  text-indent: 2em;
  font-family: "STKaiti", "Kaiti SC", "Songti SC", serif;
}
xy text p:last-child { margin-bottom: 0; }
xy text > p:first-of-type::first-letter {
  color: #D63384;
  font-weight: 700;
  font-size: 1.18em;
  letter-spacing: 2px;
}

/* ===== 顶栏 sbar（原 hd）===== */
/* 【修复二】hd → sbar */
xy sbar {
  display: block;
  margin: 6px 0 24px 0;
  padding: 14px 34px;
  background:
    linear-gradient(90deg, transparent, rgba(214,51,132,0.045) 50%, transparent),
    repeating-linear-gradient(0deg, transparent 0, transparent 24px, rgba(42,42,40,0.03) 24px, rgba(42,42,40,0.03) 25px),
    rgba(255,255,255,0.6);
  border: 1px solid rgba(42,42,40,0.28);
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px rgba(250,247,242,0.7), 0 2px 8px rgba(42,42,40,0.08);
  position: relative;
}
xy sbar::before,
xy sbar::after {
  content: '❖';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #D63384;
  font-size: 12px;
}
xy sbar::before { left: 12px; }
xy sbar::after  { right: 12px; }

xy sbar p {
  margin: 0;
  padding: 3px 0;
  text-indent: 0;
  line-height: 1.75;
  font-family: "STKaiti", "Kaiti SC", "Songti SC", serif;
}
xy sbar p:nth-of-type(5) {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(42,42,40,0.2);
}

/* 标签 lb：小色块印签（原 i → lb） */
/* 【修复二】i → lb */
xy sbar lb {
  display: inline-block;
  font-style: normal;
  color: #FAF7F2;
  padding: 2px 9px;
  border-radius: 2px;
  font-size: clamp(11px, 1.9vw, 12px);
  letter-spacing: 2px;
  margin-right: 10px;
  font-family: "STKaiti", "Kaiti SC", serif;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
xy sbar p:nth-of-type(1) lb { background: #B33A6A; }
xy sbar p:nth-of-type(2) lb { background: #1E5BA8; }
xy sbar p:nth-of-type(3) lb { background: #6A5A4E; }
xy sbar p:nth-of-type(4) lb { background: #7952B3; }
xy sbar p:nth-of-type(5) lb { background: #D63384; }

xy sbar b {
  display: inline-block;
  color: #2C2620;
  font-family: "STKaiti", "Kaiti SC", serif;
  font-size: clamp(13px, 2.3vw, 15px);
  letter-spacing: 1.5px;
  line-height: 1.75;
  vertical-align: middle;
}
xy sbar p:nth-of-type(1) b { color: #B33A6A; font-weight: 700; letter-spacing: 3px; }
xy sbar p:nth-of-type(2) b { color: #1E5BA8; font-weight: 600; }
xy sbar p:nth-of-type(3) b { color: #6A5A4E; }
xy sbar p:nth-of-type(4) b { color: #7952B3; font-weight: 600; }
xy sbar p:nth-of-type(5) b { color: #4A2C3A; font-style: italic; }

/* ===== 折叠状态栏 details ===== */
xy details {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 25px, rgba(42,42,40,0.025) 25px, rgba(42,42,40,0.025) 26px),
    rgba(255,255,255,0.5);
  border: 1px solid rgba(42,42,40,0.3);
  border-radius: 3px;
  margin-bottom: 13px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(42,42,40,0.06);
}
xy details summary {
  padding: 12px 16px 12px 42px;
  cursor: pointer;
  font-family: "STKaiti", "Kaiti SC", serif;
  font-weight: 700;
  color: #2C2620;
  font-size: clamp(14px, 2.3vw, 15px);
  letter-spacing: 2px;
  user-select: none;
  list-style: none;
  position: relative;
  transition: background 0.3s ease;
}
xy details summary::-webkit-details-marker { display: none; }
xy details summary::before {
  content: '卷';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background: #1E5BA8;
  color: #FAF7F2;
  font-size: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
  transition: background 0.3s ease;
}
xy details[open] summary::before { content: '展'; background: #D63384; }
xy details[open] summary { border-bottom: 1px solid rgba(42,42,40,0.25); }
xy details summary:hover { background: rgba(214,51,132,0.03); }
xy details[open] > *:not(summary) { animation: inkUnfold 0.4s ease; }
@keyframes inkUnfold {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

xy details > p {
  margin: 0;
  padding: 10px 16px 10px 34px;
  color: #2C2620;
  font-size: clamp(13px, 2.2vw, 14px);
  line-height: 1.85;
  font-family: "STKaiti", "Kaiti SC", serif;
  letter-spacing: 0.5px;
  position: relative;
  border-bottom: 1px dashed rgba(42,42,40,0.08);
  background-image: linear-gradient(90deg, rgba(214,51,132,0.02), transparent30%);
}
xy details > p:last-child { border-bottom: none; }
xy details > p::before {
  content: '·';
  position: absolute;
  left: 20px;
  top: 10px;
  color: #D63384;
  font-weight: 700;
}

xy details > p > b:not(.mc):not(.npc) {
  display: inline-block;
  color: #B33A6A;
  font-size: clamp(13px, 2.2vw, 14px);
  letter-spacing: 2px;
  padding: 2px 8px;
  margin-left: -4px;
  border-left: 3px solid #D63384;
  background: linear-gradient(90deg, rgba(214,51,132,0.06), transparent);
}

/* ===== 嵌套 details（帏内春光）===== */
xy details details {
  margin: 8px 12px 12px;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 22px, rgba(214,51,132,0.02) 22px, rgba(214,51,132,0.02) 23px),
    rgba(255,242,246,0.5);
  border: 1px solid rgba(178,58,106,0.4);
  box-shadow: 0 1px 4px rgba(178,58,106,0.08);
}
xy details details summary {
  color: #B33A6A;
  padding-left: 42px;
}
xy details details summary::before { background: #B33A6A; }
xy details details[open] summary::before { background: #7952B3; }
xy details details > p {
  color: #4A2C3A;
  background-image: linear-gradient(90deg, rgba(214,51,132,0.03), transparent 40%);
}
xy details details > p::before { color: #B33A6A; }

xy details > p { transition: background 0.25s ease, padding-left 0.25s ease; }
xy details > p:hover {
  background-image: linear-gradient(90deg, rgba(214,51,132,0.08), rgba(30,91,168,0.03) 60%, transparent);
  padding-left: 38px;
  cursor: default;
}

/* ===== 玩家对白 b.mc ===== */
xy b.mc {
  color: #1E5BA8;
  font-weight: 600;
  font-family: "STKaiti", "Kaiti SC", serif;
  letter-spacing: 0.5px;
  padding: 0 2px;
  transition: color 0.28s ease;
}
xy b.mc:hover { color: #164A8C; }

/* ===== NPC对白 b.npc ===== */
xy b.npc {
  color: #D63384;
  font-weight: 600;
  font-family: "STKaiti", "Kaiti SC", serif;
  letter-spacing: 0.5px;
  padding: 0 2px;
  transition: color 0.28s ease;
}
xy b.npc:hover { color: #B02A6E; }

/* ===== 诗词·偈语<v> ===== */
xy v {
  display: block;
  margin: 22px auto;
  padding: 22px 34px 20px;
  max-width: 82%;
  text-align: center;
  text-indent: 0;
  font-family: "STKaiti", "Kaiti SC", "Songti SC", serif;
  font-style: italic;
  color: #4A2C3A;
  font-size: clamp(14px, 2.55vw, 16.5px);
  line-height: 2.35;
  letter-spacing: 4px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(214,51,132,0.06), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(121,82,179,0.05), transparent 60%),
    linear-gradient(180deg, rgba(255,250,240,0.6), rgba(255,242,246,0.4));
  border-top: 2px double rgba(178,58,106,0.55);
  border-bottom: 2px double rgba(178,58,106,0.55);
  position: relative;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
xy v::before {
  content: '❋';
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #FAF7F2;
  padding: 0 10px;
  color: #B33A6A;
  font-size: 14px;
  letter-spacing: 0;
}
xy v::after {
  content: '❋';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #FAF7F2;
  padding: 0 10px;
  color: #7952B3;
  font-size: 14px;
  letter-spacing: 0;
}
xy text v { margin: 24px auto; }

/* ===== 移动端 ===== */
@media (max-width: 600px) {
  xy { margin: 12px; padding: 20px 14px; }
  xy::before { inset: 5px; }
  xy::after { width: 28px; height: 28px; line-height: 28px; font-size: 15px; bottom: 12px; right: 14px; }
  xy text p { text-indent: 1.5em; }
  /* 【修复二】移动端同步改sbar */
  xy sbar { padding: 12px 26px; }
  xy sbar::before { left: 8px; }
  xy sbar::after  { right: 8px; }
  xy sbar lb { letter-spacing: 1.5px; margin-right: 8px; }
  xy details summary { padding-left: 40px; letter-spacing: 1px; }
  xy details > p { padding: 9px 14px 9px 30px; }
  xy details > p::before { left: 16px; top: 9px; }
  xy details details { margin: 6px 8px 10px; }
  xy details details summary { padding-left: 40px; }
  xy v { padding: 18px 20px 16px; max-width: 92%; letter-spacing: 3px; line-height: 2.15; }
}