/* ========================================================= */
/* ===== 0. CSS变量 · 修仙宗门色系 ===== */
/* ========================================================= */
:root {
  --bg:                #f0ece4;
  --surface:           #faf7f2;
  --surface2:          #f5f0e8;
  --border:            #c8b898;
  --border-light:      #d8ccb4;
  --text:              #2a1e12;
  --text-dim:          #6a5a4a;
  --text-bright:       #1a0e04;
  --accent:            #8b3a3a;
  --accent-dim:        rgba(139,58,58,0.08);
  --rose:              #a04545;
  --gold:              #b8962a;
  --ink:               #1a1614;
  --jade:              #5a8a6a;
  --blue:              #2a6090;
  --heavenly:          #d4a020;
  --font-serif:        'Noto Serif SC','Source Han Serif SC','Georgia','SimSun',serif;
  --font-sans:         'Inter','PingFang SC','Microsoft YaHei','Noto Sans SC',sans-serif;
  --font-mono:         'SF Mono','Cascadia Code','Consolas','Courier New',monospace;
}

/* ========================================================= */
/* ===== 1. 通用折叠栏 · 玄铁风格 ===== */
/* ========================================================= */
details {
  display: block; background: var(--ink); padding: 0;
  margin-bottom: 12px; max-width: 100%; width: 100%; box-sizing: border-box;
  border: 1px solid #2a221c; border-left: 4px solid #3a3028;
  box-shadow: 0 2px 12px rgba(10,8,4,0.3);
  border-radius: 0; transition: box-shadow 0.2s ease, border-color 0.2s ease; overflow: hidden;
}
details[open] {
  box-shadow: 0 4px 20px rgba(139,58,58,0.18);
  border-color: #4a3028;
}
details:hover { border-left-color: #8b3a3a; }

details summary {
  display: flex; align-items: center; justify-content: space-between;
  list-style: none; cursor: pointer; position: relative;
  background: linear-gradient(135deg, #1a1614 0%, #2a221c 100%);
  padding: 14px 22px;
  font-weight: 800; letter-spacing: 1.5px; color: #c8b898;
  font-family: var(--font-serif); font-style: italic; font-size: 1.15em;
  width: 100%; max-width: 100%; box-sizing: border-box;
  border-left: 4px solid #3a3028; text-align: left;
  user-select: none; transition: all 0.2s ease; overflow: hidden; border-radius: 0;
}
details summary::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: #3a3028; transition: background 0.2s ease;
}
details summary::after {
  content: "◆";
  font-size: 0.7em; color: #b8962a;
  text-shadow: 0 0 6px rgba(184,150,42,0.5);
  transition: all 0.2s ease; margin-left: auto;
}
details summary:hover {
  background: linear-gradient(135deg, #2a1e18 0%, #3a2a20 100%);
  color: #d4a858; border-left-color: #8b3a3a; padding-right: 34px;
}
details summary:hover::before { background: #8b3a3a; }
details summary:hover::after {
  content: "▶"; color: #d4a858; text-shadow: none; transform: translateX(4px);
}
details[open] summary::after { transform: rotate(180deg); }
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ""; }

.details-body {
  background: #1e1a16;
  color: #c8bcac;
  padding: 16px 22px; font-size: 0.95em; line-height: 1.7;
  border-top: 1px solid #2e2420;
}
.details-body a { color: #d4a858; text-decoration: none; }
.details-body a:hover { color: #e8c878; text-decoration: underline; }

/* ========================================================= */
/* ===== 2. 面板类折叠 · 宗门卷轴风格 ===== */
/* ========================================================= */
details.panel-details {
  background: transparent; border: none; border-left: none;
  box-shadow: none; margin-bottom: 14px;
}
details.panel-details[open] { box-shadow: none; border-color: transparent; }
details.panel-details:hover { border-left-color: transparent; }

details.panel-details > summary {
  display: flex; align-items: center; gap: 10px; list-style: none;
  cursor: pointer; position: relative;
  background: linear-gradient(135deg, #2a1e18 0%, #1a1410 100%);
  border-radius: 8px 8px 0 0;
  padding: 14px 20px; font-weight: 700; letter-spacing: 1px;
  color: #d4c0a0; font-family: var(--font-serif); font-style: normal;
  font-size: 0.95em; width: 100%; box-sizing: border-box;
  border-left: none; border-bottom: 1px solid #2e2420;
  text-align: left; user-select: none; transition: all 0.2s ease;
}
details.panel-details > summary::before { display: none; }
details.panel-details > summary .panel-summary-icon { font-size: 1.2em; flex-shrink: 0; }
details.panel-details > summary .panel-summary-title { flex: 0 0 auto; }
details.panel-details > summary .panel-summary-sub {
  margin-left: auto; font-size: 0.68em; font-weight: 500;
  color: #6a5a40; letter-spacing: 1.5px;
  font-family: var(--font-mono);
}
details.panel-details > summary::after {
  content: "▾"; font-size: 0.7em; color: rgba(200,180,140,0.6);
  text-shadow: none; margin-left: 6px; transition: transform 0.2s ease; flex-shrink: 0;
}
details.panel-details[open] > summary {
  border-radius: 8px 8px 0 0; border-bottom-color: #3a2a20;
}
details.panel-details[open] > summary::after { transform: rotate(180deg); }
details.panel-details > summary:hover {
  background: linear-gradient(135deg, #3a2818 0%, #2a1a10 100%);
  color: #e8d4b0; border-left: none; padding-right: 20px;
}
details.panel-details > summary:hover::after { color: #e8d4b0; transform: none; }
details.panel-details[open] > summary:hover::after { transform: rotate(180deg); }
details.panel-details > summary::-webkit-details-marker { display: none; }
details.panel-details > summary::marker { display: none; content: ""; }

/* ── 面板内容：素绢质感 ── */
.panel-body {
  background: linear-gradient(170deg, #fdfaf4 0%, #f5f0e6 100%) !important;
  border-radius: 0 0 8px 8px !important;
  border: 1px solid #c8b898 !important; border-top: none !important;
  color: #2a1e12 !important; padding: 18px 20px !important;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.6);
}

/* ── 各角色面板header色 ── */
details.luo-panel > summary { background: linear-gradient(135deg, #1e2028 0%, #1a1c24 100%); border-left: 3px solid #6a8090; }
details.su-panel > summary { background: linear-gradient(135deg, #1e241a 0%, #1a2018 100%); border-left: 3px solid #5a8a6a; }
details.jian-panel > summary { background: linear-gradient(135deg, #241e1a 0%, #201a16 100%); border-left: 3px solid #9a6a4a; }
details.yun-panel > summary { background: linear-gradient(135deg, #1a1a24 0%, #161620 100%); border-left: 3px solid #7a6a9a; }
details.tang-panel > summary { background: linear-gradient(135deg, #241a1a 0%, #201616 100%); border-left: 3px solid #d4a020; }
details.player-panel > summary { background: linear-gradient(135deg, #1e1a18 0%, #1a1614 100%); border-left: 3px solid #8b3a3a; }

/* ========================================================= */
/* ===== 3. 玩家面板 ===== */
/* ========================================================= */
.player-card { display: flex; flex-direction: column; gap: 14px; }
.player-name-row {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid #d8ccb4;
}
.player-name { font-size: 1.4em; font-weight: 700; color: #1a0e04; letter-spacing: 1px; }
.player-badge {
  font-size: 0.75em; font-weight: 600; color: #8b3a3a;
  background: rgba(139,58,58,0.1); padding: 2px 10px; border-radius: 10px;
  border: 1px solid rgba(139,58,58,0.2);
}
.player-section { display: flex; flex-direction: column; gap: 4px; }
.player-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.player-tag {
  font-size: 0.8em; font-weight: 600; color: #5a3a2a;
  background: linear-gradient(135deg, #f0e8dc 0%, #e8dcc8 100%);
  border: 1px solid #c8b090; padding: 4px 12px; border-radius: 14px;
}
.player-text { font-size: 0.85em; color: #3a2a1a; line-height: 1.6; margin: 0; }

/* ========================================================= */
/* ===== 4. 女性角色通用面板组件 ===== */
/* ========================================================= */
.xj-portrait-frame {
  width: 100%; max-width: 360px; margin: 0 auto 16px auto;
  border-radius: 6px; overflow: hidden; border: 2px solid #b8962a;
  box-shadow: 0 4px 20px rgba(20,10,4,0.25); background: #f5ede0;
}
.xj-portrait-img { width: 100%; height: auto; display: block; object-fit: cover; }
.xj-portrait-caption {
  display: block; text-align: center; padding: 8px 14px;
  font-size: 0.78em; font-weight: 600; color: #8b6a3a; letter-spacing: 1.5px;
  background: linear-gradient(180deg, #f5ede0 0%, #eadcc8 100%);
  border-top: 1px solid #c8b898;
  font-family: var(--font-serif); font-style: italic;
}
.xj-quickinfo {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #d8ccb4;
}
.xj-quickitem {
  font-size: 0.82em; color: #3a2a1a;
  background: rgba(184,150,42,0.08); padding: 4px 10px; border-radius: 6px;
  border: 1px solid rgba(184,150,42,0.15);
}
.xj-section { margin-bottom: 10px; }
.xj-text { font-size: 0.85em; color: #3a2a1a; line-height: 1.6; margin: 0; }

.xj-inner-thoughts {
  background: linear-gradient(135deg, #fef9f2 0%, #faf3e8 100%);
  border-left: 3px solid #b8962a; border-radius: 0 6px 6px 0;
  padding: 12px 16px; margin: 14px 0; font-style: italic;
}
.xj-inner-thoughts p { margin: 0; font-size: 0.88em; color: #5a4030; line-height: 1.7; }

.xj-next-action {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #fff8f0 0%, #fef0e0 100%);
  border: 1px dashed #b8962a; border-radius: 6px; padding: 10px 16px; margin: 12px 0;
}
.xj-next-text { font-size: 0.88em; color: #5d4030; font-weight: 500; }

.xj-stat-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid #d8ccb4; }

/* ── 阶段标签 ── */
.phase-row {
  margin-top: 10px; padding: 6px 12px;
  background: rgba(139,58,58,0.06); border-radius: 4px;
  border-left: 2px solid #8b3a3a; font-size: 0.82em;
}
.phase-label { color: #6a5a4a; font-weight: 600; }
.phase-value { color: #8b3a3a; font-weight: 700; }

/* ========================================================= */
/* ===== 5. 状态条 · 觉醒度(朱砂红) / 信任值(青蓝) / 天道(暗金) ===== */
/* ========================================================= */
.stat-bar { margin: 12px 0; }
.stat-bar .stat-label {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 0.9em; color: #2a1e12; margin-bottom: 6px;
}
.stat-bar .stat-label span { font-weight: 500; font-size: 0.88em; color: #5a4a3a; }
.stat-bar .bar-track {
  width: 100%; height: 12px; background: #e0d8cc; border-radius: 999px;
  overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.stat-bar .bar-fill {
  height: 100%; border-radius: 999px; transition: width 0.6s ease;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.12);
}

/* 觉醒度：朱砂红 */
.stat-bar.trust .bar-fill.awakening-fill {
  background: linear-gradient(90deg, #8b3a3a 0%, #c04040 100%);
  box-shadow: 0 0 8px rgba(139,58,58,0.25);
}

/* 信任值：青蓝 */
.stat-bar.desire .bar-fill.trust-fill {
  background: linear-gradient(90deg, #2a6090 0%, #4080b0 100%);
  box-shadow: 0 0 8px rgba(42,96,144,0.2);
}

/* 天道气运：暗金 */
.stat-bar.desire.locked .bar-fill.heavenly-fill {
  background: linear-gradient(90deg, #b8962a 0%, #d4a840 100%);
  box-shadow: 0 0 10px rgba(184,150,42,0.3);
}
.stat-bar.desire.locked .bar-fill { background: #3a2818; }

/* ── 数值变动原因 ── */
.change-reason {
  font-size: 0.82em; color: #8b5a3a; margin-top: 4px; font-weight: 600;
  line-height: 1.5; padding: 2px 6px; border-radius: 3px;
  background: rgba(139,58,58,0.04); border-left: 2px solid #8b3a3a;
}

/* ========================================================= */
/* ===== 6. 时间头 · 简化3行 ===== */
/* ========================================================= */
.time-header {
  background: linear-gradient(135deg, #1a1612 0%, #2a2018 40%, #1a1612 100%);
  border-radius: 10px; padding: 18px 22px; margin-bottom: 20px;
  color: #e0d4c0; border: 1px solid rgba(184,150,42,0.1);
  box-shadow: 0 4px 20px rgba(10,8,4,0.3); position: relative; overflow: hidden;
}
.time-header::before {
  content: ""; position: absolute; top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(184,150,42,0.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.th-main {
  font-size: 1.3em; font-weight: 700; letter-spacing: 2px;
  color: #e8d8b8; font-family: var(--font-serif); margin: 0 0 8px; text-indent: 0;
}
.th-sub {
  font-size: 0.9em; color: #b8a890; margin: 0 0 14px; text-indent: 0;
}
.th-budget {
  font-size: 0.85em; color: #8a7a6a; margin: 0; padding-top: 14px;
  border-top: 1px solid rgba(184,150,42,0.15); text-indent: 0;
}

/* ========================================================= */
/* ===== 7. 正文容器 · 古籍感 ===== */
/* ========================================================= */
.khorra-output {
  max-width: 100%; width: 100%; box-sizing: border-box;
  background: linear-gradient(180deg, #fdfaf4 0%, #f8f2e8 30%, #f5ede0 100%);
  border-radius: 8px; padding: 22px 24px;
  border: 1px solid #c8b898;
  box-shadow: 0 2px 12px rgba(100,80,50,0.08), inset 0 0 0 1px rgba(255,255,255,0.8);
  line-height: 1.9; color: #2a1e12;
}
.khorra-output p {
  text-indent: 2em; margin: 0.8em 0; line-height: 1.9; font-family: var(--font-serif);
}

/* ========================================================= */
/* ===== 8. 正文对话颜色 ===== */
/* ========================================================= */
.dialogue { display: inline; padding: 1px 4px; border-radius: 2px; }
.dialogue.luo { color: #6a8090; background: rgba(106,128,144,0.08); }
.dialogue.su { color: #5a8a6a; background: rgba(90,138,106,0.08); }
.dialogue.jian { color: #9a6a4a; background: rgba(154,106,74,0.08); }
.dialogue.yun { color: #7a6a9a; background: rgba(122,106,154,0.08); }
.dialogue.tang { color: #d4a020; background: rgba(212,160,32,0.08); }
.dialogue.user { color: #8b3a3a; background: rgba(139,58,58,0.08); }

/* ========================================================= */
/* ===== 9. 内心独白 ===== */
/* ========================================================= */
.inner-monologue {
  font-style: italic; color: #5a4a3a;
  background: linear-gradient(135deg, #faf5ec 0%, #f5ede0 100%);
  border-left: 3px solid #b8962a; padding: 12px 18px; margin: 16px 0;
  border-radius: 0 6px 6px 0; font-size: 0.95em; line-height: 1.7; text-indent: 0;
}

/* ========================================================= */
/* ===== 10. 因果预算迷你条 ===== */
/* ========================================================= */
.budget-mini {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 0 0; padding: 8px 14px;
  background: linear-gradient(135deg, #f0e8dc 0%, #e8dcc8 100%);
  border-radius: 6px; border: 1px solid #c8b898;
}
.budget-mini-label { font-size: 0.82em; font-weight: 700; color: #6a4a2a; white-space: nowrap; }
.budget-mini-bar { flex: 1; height: 8px; background: #d8ccb4; border-radius: 999px; overflow: hidden; }
.budget-mini-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #b8962a 0%, #d4a840 100%);
  transition: width 0.5s ease;
}
.budget-mini-num { font-size: 0.82em; font-weight: 700; color: #8b3a3a; white-space: nowrap; }

/* ========================================================= */
/* ===== 11. 解锁提醒 ===== */
/* ========================================================= */
.unlock-notice {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px 0 18px 0; padding: 14px 20px;
  background: linear-gradient(135deg, #fdf4e8 0%, #f8e8d0 100%);
  border: 2px solid #d4a020; border-radius: 8px;
  font-size: 0.95em; color: #5d4030;
  box-shadow: 0 2px 14px rgba(184,150,42,0.15);
}
.unlock-icon { font-size: 1.3em; }
.unlock-text strong { color: #8b3a3a; font-weight: 700; }

/* ========================================================= */
/* ===== 12. 选择面板 · 令牌风格 ===== */
/* ========================================================= */
.choice-panel {
  margin-top: 18px; padding: 18px 20px;
  background: linear-gradient(170deg, #fefaf4 0%, #f8f0e4 100%);
  border: 1px solid #c8b090; border-radius: 8px;
  box-shadow: 0 2px 14px rgba(100,80,40,0.08);
}
.choice-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 0.95em; font-weight: 700; color: #5a3a1a; letter-spacing: 2px;
}
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: #fff; border: 1px solid #d8ccb4; border-radius: 6px;
  cursor: pointer; transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.choice-card:hover {
  background: #fefaf4; border-color: #b8962a;
  box-shadow: 0 2px 10px rgba(139,58,58,0.08);
}
.choice-card[data-choice="1"] { border-left: 4px solid #8b3a3a; }
.choice-card[data-choice="2"] { border-left: 4px solid #2a6090; }
.choice-card[data-choice="3"] { border-left: 4px solid #5a8a6a; }
.choice-left { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.choice-label {
  display: inline-block; width: fit-content;
  font-size: 0.68em; font-weight: 700; letter-spacing: 1.5px;
  color: #fff; padding: 2px 8px; border-radius: 3px; text-transform: uppercase;
}
.choice-card[data-choice="1"] .choice-label { background: #8b3a3a; }
.choice-card[data-choice="2"] .choice-label { background: #2a6090; }
.choice-card[data-choice="3"] .choice-label { background: #5a8a6a; }
.choice-text { font-size: 0.88em; color: #3a2a1a; line-height: 1.5; }
.choice-card:hover .choice-text { color: #1a0e04; }
.choice-arrow {
  font-size: 0.85em; color: #b8962a; flex-shrink: 0;
  transition: transform 0.15s ease;
}
.choice-card:hover .choice-arrow { color: #8b3a3a; transform: translateX(3px); }
.choice-note {
  margin-top: 12px; font-size: 0.76em; color: #8a7a6a;
  font-style: italic; text-align: center;
}

/* ========================================================= */
/* ===== 13. 因果节点 ===== */
/* ========================================================= */
.contract-clauses { display: flex; flex-direction: column; gap: 6px; }
.contract-clause {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 6px;
  background: linear-gradient(135deg, #fdfaf4 0%, #f8f2e8 100%);
  border: 1px solid #c8b090;
}
.clause-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72em; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-mono);
  background: #8b3a3a; color: #fff;
}
.clause-body { flex: 1; min-width: 0; }
.clause-title { font-size: 0.85em; font-weight: 700; color: #2a1a0e; margin-bottom: 2px; }
.clause-detail { font-size: 0.78em; color: #5a4a3a; line-height: 1.5; }
.clause-tag {
  font-size: 0.68em; font-weight: 700; padding: 3px 8px;
  border-radius: 10px; flex-shrink: 0; letter-spacing: 0.5px;
  background: rgba(139,58,58,0.1); color: #8b3a3a; white-space: nowrap;
}
.clause-tag.hard { background: rgba(160,69,69,0.12); color: #a04545; }
.clause-tag.story { background: rgba(90,138,106,0.12); color: #5a8a6a; }
.contract-new-notice {
  margin-top: 10px; padding: 10px 14px;
  background: linear-gradient(135deg, #fef8ec 0%, #faf0dc 100%);
  border: 1px dashed #b8962a; border-radius: 6px;
  font-size: 0.82em; font-weight: 600; color: #8b5a2a; text-align: center; letter-spacing: 0.5px;
}
.contrast-verdict {
  background: linear-gradient(135deg, #fdf6ec 0%, #f8ece0 100%);
  border-radius: 6px; padding: 10px 16px;
  font-size: 0.84em; color: #5d4030; line-height: 1.6; border: 1px solid #d8c4a0;
}

/* ========================================================= */
/* ===== 14. 记忆存档面板 ===== */
/* ========================================================= */
.memory-table {
  width: 100%; border-collapse: collapse; font-size: 0.82em; line-height: 1.6;
}
.memory-table th {
  text-align: left; padding: 6px 8px; font-size: 0.78em; font-weight: 700;
  color: #6a5a4a; letter-spacing: 0.5px; border-bottom: 1px solid #d8ccb4; white-space: nowrap;
}
.memory-table td {
  padding: 6px 8px; color: #3a2a1a; vertical-align: top; border-bottom: 1px solid #e8dcc8;
}
.memory-table tr:last-child td { border-bottom: none; }
.memory-table td:first-child,
.memory-table th:first-child {
  width: 36px; text-align: center;
  font-family: var(--font-mono); font-weight: 600; color: #8b5a3a;
}

details.memory-config {
  background: transparent; border: none; border-left: none; box-shadow: none; margin-bottom: 8px;
}
details.memory-config[open] { box-shadow: none; border-color: transparent; }
details.memory-config:hover { border-left-color: transparent; }
details.memory-config > summary {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  background: #f0e8dc; border-radius: 4px; padding: 8px 14px;
  font-weight: 600; font-size: 0.8em; color: #5a4a3a; letter-spacing: 0.5px;
  border-left: none; transition: all 0.15s ease;
}
details.memory-config > summary::before { display: none; }
details.memory-config > summary::after {
  content: "▾"; font-size: 0.7em; color: #8a7a6a; margin-left: auto; transition: transform 0.2s ease;
}
details.memory-config[open] > summary::after { transform: rotate(180deg); }
details.memory-config > summary:hover { background: #e8dcc8; color: #2a1a0e; }
details.memory-config > summary::-webkit-details-marker { display: none; }
details.memory-config > summary::marker { display: none; content: ""; }
.memory-config-body {
  padding: 8px 14px; font-size: 0.78em; color: #6a5a4a;
  font-family: var(--font-mono); background: #f8f4ec; border-radius: 0 0 4px 4px;
  border: 1px solid #d8ccb4; border-top: none;
}

details.memory-stm,
details.memory-ltm {
  background: transparent; border: none; border-left: none; box-shadow: none; margin-bottom: 6px;
}
details.memory-stm[open],
details.memory-ltm[open] { box-shadow: none; border-color: transparent; }
details.memory-stm:hover,
details.memory-ltm:hover { border-left-color: transparent; }
details.memory-stm > summary,
details.memory-ltm > summary {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  background: #f0e8dc; border-radius: 4px; padding: 8px 14px;
  font-weight: 600; font-size: 0.82em; color: #5a4a3a; letter-spacing: 0.5px;
  border-left: none; transition: all 0.15s ease;
}
details.memory-stm > summary::before,
details.memory-ltm > summary::before { display: none; }
details.memory-stm > summary::after,
details.memory-ltm > summary::after {
  content: "▾"; font-size: 0.7em; color: #8a7a6a; margin-left: auto; transition: transform 0.2s ease;
}
details.memory-stm[open] > summary::after,
details.memory-ltm[open] > summary::after { transform: rotate(180deg); }
details.memory-stm > summary:hover,
details.memory-ltm > summary:hover { background: #e8dcc8; color: #2a1a0e; }
details.memory-stm > summary::-webkit-details-marker,
details.memory-ltm > summary::-webkit-details-marker { display: none; }
details.memory-stm > summary::marker,
details.memory-ltm > summary::marker { display: none; content: ""; }
details.memory-stm > .details-body,
details.memory-ltm > .details-body { background: transparent; padding: 0; border: none; }

.memory-note {
  font-size: 0.72em; color: #8a7a6a; margin-top: 10px; padding-top: 8px;
  border-top: 1px solid #d8ccb4; font-style: italic; text-align: center;
}

/* ========================================================= */
/* ===== 15. 记忆汇总 ===== */
/* ========================================================= */
.memory-summary {
  background: #1a1612; border: 1px solid #2a221c;
  border-radius: 4px; padding: 0; overflow: hidden;
}
.memory-summary-header {
  background: #0e0c0a; border-bottom: 1px solid #2a221c;
  padding: 12px 18px; display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
}
.memory-summary-icon { font-size: 1.1em; }
.memory-summary-title { font-weight: 700; color: #d4c0a0; letter-spacing: 2px; }
.memory-summary-body { padding: 18px; font-size: 0.88em; line-height: 1.8; color: #c8b898; }
.memory-summary-footer {
  background: #0e0c0a; border-top: 1px solid #2a221c;
  padding: 10px 18px; font-size: 0.72em; color: #6a5a40;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
}

/* ========================================================= */
/* ===== 16. 思维链 ===== */
/* ========================================================= */
.cot-exec-content {
  font-size: 0.8em; color: #9a8a7a; line-height: 1.6;
  white-space: pre-wrap; font-family: var(--font-mono);
}
.cot-check-details { border-left: 3px solid #b8962a !important; }

/* ========================================================= */
/* ===== 17. 玩家面板简化组件 ===== */
/* ========================================================= */
.p-name {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid #d8ccb4;
  font-size: 1.4em; font-weight: 700; color: #1a0e04; letter-spacing: 1px;
}
.p-badge {
  font-size: 0.55em; font-weight: 600; color: #8b3a3a;
  background: rgba(139,58,58,0.1); padding: 2px 10px; border-radius: 10px;
  border: 1px solid rgba(139,58,58,0.2);
}
.p-section-label {
  font-size: 0.72em; font-weight: 700; color: #8a7a6a;
  letter-spacing: 1.5px; text-transform: uppercase; margin: 10px 0 4px;
}
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.p-tags span {
  font-size: 0.8em; font-weight: 600; color: #5a3a2a;
  background: linear-gradient(135deg, #f0e8dc 0%, #e8dcc8 100%);
  border: 1px solid #c8b090; padding: 4px 12px; border-radius: 14px;
}
.p-text { font-size: 0.85em; color: #3a2a1a; line-height: 1.6; margin: 0; }
.p-info-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid #ece4d4;
  font-size: 0.85em;
}
.p-info-label {
  color: #8a7a6a; font-weight: 600; letter-spacing: 0.5px;
  min-width: 40px; flex-shrink: 0;
}
.p-info-val {
  color: #3a2a1a; font-weight: 500;
}

/* ========================================================= */
/* ===== 18. 暗色覆盖规则 ===== */
/* ========================================================= */
.details-body .stat-bar .stat-label { color: #d8ccc0 !important; }
.details-body .stat-bar .stat-label span { color: #9a8a7a !important; }
.details-body .bar-track { background: #2a2220 !important; box-shadow: inset 0 1px 3px rgba(0,0,0,0.4) !important; }
.details-body .stat-detail-label { color: #d4a858 !important; }
.details-body .budget-mini {
  background: linear-gradient(135deg, #1a1612 0%, #201a16 100%) !important;
  border-color: #2e2420 !important;
}
.details-body .budget-mini-label { color: #9a8a7a !important; }
.details-body .budget-mini-bar { background: #2e2420 !important; }
.details-body .budget-mini-num { color: #d4a858 !important; }
.details-body .unlock-notice {
  background: linear-gradient(135deg, #1e1a16 0%, #241e18 100%) !important;
  border-color: #b8962a !important; color: #d8ccc0 !important;
}
.details-body .unlock-text strong { color: #e8c060 !important; }

/* 面板内显式覆盖：暗→亮 */
.panel-body .stat-bar .stat-label { color: #2a1e12 !important; }
.panel-body .stat-bar .stat-label span { color: #5a4a3a !important; }
.panel-body .bar-track { background: #e0d8cc !important; box-shadow: inset 0 1px 3px rgba(0,0,0,0.08) !important; }
.panel-body .stat-detail-label { color: #8b5a3a !important; }
.panel-body .budget-mini {
  background: linear-gradient(135deg, #f0e8dc 0%, #e8dcc8 100%) !important;
  border-color: #c8b898 !important;
}
.panel-body .budget-mini-label { color: #6a4a2a !important; }
.panel-body .budget-mini-bar { background: #d8ccb4 !important; }
.panel-body .budget-mini-num { color: #8b3a3a !important; }

/* ========================================================= */
/* ===== 19. 溢出保护 ===== */
/* ========================================================= */
details, details > * { word-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; white-space: normal; max-width: 100%; }
.stat-bar, .bar-track, .bar-fill { min-width: 0; max-width: 100%; }
.budget-mini { flex-wrap: wrap; }
.unlock-notice { flex-wrap: wrap; text-align: center; }
.panel-body { word-wrap: break-word; overflow-wrap: anywhere; }

/* ========================================================= */
/* ===== 20. 移动端适配 ===== */
/* ========================================================= */
@media (max-width: 640px) {
  details summary { padding: 12px 14px; font-size: 1em; }
  details summary:hover { padding-right: 24px; }
  details.panel-details > summary { padding: 12px 14px; font-size: 0.88em; gap: 6px; }
  details.panel-details > summary .panel-summary-sub { display: none; }
  .panel-body { padding: 12px 14px !important; }
  .xj-portrait-frame { max-width: 100%; }
  .xj-quickinfo { flex-direction: column; gap: 4px; }
  .xj-next-action { flex-wrap: wrap; }
  .time-header { padding: 12px 14px; }
  .khorra-output { padding: 12px 14px; }
  .khorra-output p { text-indent: 1.5em; }
  .choice-panel { padding: 14px 14px; }
  .choice-card { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px; }
  .choice-arrow { align-self: flex-end; }
  .budget-mini { gap: 6px; padding: 6px 10px; }
  .budget-mini-label { font-size: 0.75em; }
  .unlock-notice { padding: 10px 14px; font-size: 0.85em; }
  .memory-summary-body { padding: 12px; font-size: 0.82em; }
  .memory-summary-footer { flex-direction: column; gap: 4px; text-align: center; }
  .contract-clause { flex-wrap: wrap; }
  .clause-tag { font-size: 0.62em; padding: 2px 6px; }
  .p-name { font-size: 1.2em; }
  .p-tags span { font-size: 0.72em; padding: 3px 8px; }
}

@media (max-width: 380px) {
  details summary { padding: 10px 12px; font-size: 0.92em; }
  details.panel-details > summary { padding: 10px 12px; font-size: 0.82em; }
  .panel-body { padding: 10px 10px !important; }
  .khorra-output { padding: 10px 10px; }
  .time-header { padding: 10px 12px; }
  .xj-portrait-caption { font-size: 0.7em; }
}
/* ── 私密档案内嵌折叠 ── */
details.private-details {
  background: transparent; border: 1px solid rgba(139,58,58,0.15);
  border-left: 3px solid #8b3a3a; border-radius: 4px;
  box-shadow: none; margin-top: 12px; overflow: hidden;
}
details.private-details[open] { box-shadow: 0 2px 10px rgba(139,58,58,0.08); }
details.private-details > summary {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  background: linear-gradient(135deg, rgba(139,58,58,0.08) 0%, rgba(139,58,58,0.04) 100%);
  padding: 8px 14px; font-weight: 700; font-size: 0.82em;
  color: #8b3a3a; letter-spacing: 1px; border-left: none;
  transition: all 0.15s ease; position: relative;
}
details.private-details > summary::before { display: none; }
details.private-details > summary::after {
  content: "▾"; font-size: 0.65em; color: #8b3a3a;
  margin-left: auto; transition: transform 0.2s ease;
  opacity: 0.6;
}
details.private-details[open] > summary {
  border-bottom: 1px solid rgba(139,58,58,0.1);
}
details.private-details[open] > summary::after {
  transform: rotate(180deg); opacity: 1;
}
details.private-details > summary:hover {
  background: linear-gradient(135deg, rgba(139,58,58,0.14) 0%, rgba(139,58,58,0.08) 100%);
  color: #6a2020;
}
details.private-details > summary::-webkit-details-marker { display: none; }
details.private-details > summary::marker { display: none; content: ""; }
details.private-details > .details-body {
  background: rgba(139,58,58,0.02); padding: 10px 14px;
  border-top: none; font-size: 0.84em; line-height: 1.7;
}