/* === 全局根容器与和风色彩变量 === */
x {
  --th-bg: #fdfaf5;
  --th-main: #c73e3a;
  --th-text: #2c2727;
  --th-border: #d4c0a8;
  --ero-bg: #fff0f5;
  --ero-main: #d0104c;
  --ero-text: #8a0b2f;
  font-family: "Noto Serif JP", "Noto Serif SC", "Songti SC", "SimSun", serif;
  color: var(--th-text);
  font-size: 14px;
  line-height: 1.6;
  display: block;
  max-width: 850px;
}
/* === 折叠面板系统 === */
x details {
  margin-bottom: 8px;
  border: 1px solid var(--th-border);
  background: var(--th-bg);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
x summary {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: bold;
  color: var(--th-main);
  border-bottom: 1px dashed transparent;
  user-select: none;
  transition: background 0.3s;
}
x details[open] > summary {
  border-bottom-color: var(--th-border);
  margin-bottom: 4px;
  background: rgba(199, 62, 58, 0.05);
}
x summary::before {
  content: "❀ ";
  color: var(--th-main);
}
x details details {
  margin: 6px 12px;
  box-shadow: none;
  border-style: dashed;
}
/* === 键值对网格布局 === */
x d {
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 8px;
  padding: 4px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  align-items: center;
}
x d:last-child {
  border-bottom: none;
}
x l {
  color: #666;
  font-size: 13px;
  font-weight: bold;
}
x v {
  font-weight: 500;
  font-size: 14px;
}
/* === 和风进度条 === */
x bar {
  display: block;
  height: 10px;
  background: #e0d5c1;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  margin-top: 4px;
  width: 100%;
  max-width: 220px;
}
x bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--p);
  background: var(--th-main);
  border-radius: 5px;
  transition: width 0.5s ease;
}
x hr {
  border: 0;
  border-top: 1px dashed var(--th-border);
  margin: 8px 12px;
}
/* === 🔞 生理与性经验专属特效 === */
x details.ero {
  border-color: #f5a9bc;
  background: var(--ero-bg);
}
x details.ero > summary {
  color: var(--ero-main);
}
x details.ero > summary::before {
  content: "♥ ";
}
x details.ero[open] > summary {
  background: rgba(208, 16, 76, 0.08);
}
x details.ero d {
  border-bottom-color: rgba(208, 16, 76, 0.08);
}
x details.ero l {
  color: #b2476a;
}
x details.ero v {
  color: var(--ero-text);
  text-shadow: 0 0 3px rgba(208,16,76,0.15);
}
x details.ero bar {
  background: #fadce6;
}
x details.ero bar::after {
  background: linear-gradient(90deg, #f5719a, #d0104c);
  box-shadow: 0 0 5px rgba(208,16,76,0.5);
}
/* === 💬 防粘连对话框系统 === */
x text {
  display: flex;
  flex-direction: column;
  padding: 12px 4px;
  font-size: 15px;
  margin-bottom: 12px;
  gap: 14px;
}
x text p {
  margin: 0;
  line-height: 1.8;
  text-indent: 2em;
}
x msg {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 2px 0;
}
x msg.npc {
  align-items: flex-start;
}
x msg.user {
  align-items: flex-end;
}
x n {
  font-size: 12px;
  color: #888;
  font-weight: bold;
  margin-bottom: 4px;
}
x msg.npc n {
  margin-left: 6px;
}
x msg.user n {
  margin-right: 6px;
}
x b {
  padding: 10px 16px;
  border-radius: 12px;
  max-width: 85%;
  word-break: break-word;
  line-height: 1.6;
}
x msg.npc b {
  background: #fff;
  border: 1px solid var(--th-main);
  border-top-left-radius: 2px;
  color: var(--th-text);
  box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
}
x msg.user b {
  background: var(--th-main);
  color: #fff;
  border-top-right-radius: 2px;
  box-shadow: -2px 2px 5px rgba(0,0,0,0.05);
}