/* ========================================================= */
/* ===== 0. CSS变量 ===== */
/* ========================================================= */
:root {
  --warm-bg:        #faf6f0;
  --warm-surface:   #f5efe6;
  --warm-surface2:  #efe6da;
  --warm-border:    #e0d4c4;
  --warm-text:      #3a2e26;
  --warm-text-dim:  #7a6a5c;
  --warm-accent:    #d4905a;
  --warm-orange:    #e8a04a;
  --shu-purple:     #a078a8;
  --shu-rose:       #c47a8a;
  --shu-blue:       #7a8aa8;
  --dark-bg:        #17141a;
  --dark-surface:   #1c181f;
  --dark-surface2:  #100e12;
  --dark-border:    #2c2430;
  --dark-text:      #d8ccc4;
  --dark-text-dim:  #9c9084;
  --dark-accent:    #d49a78;
  --dark-gold:      #e8c090;
  --shadow-light:   0 2px 10px rgba(140,100,70,0.06);
  --shadow-dark:    0 2px 10px rgba(0,0,0,0.40);
  --radius-md:      10px;
  --radius-lg:      14px;
  --transition:     0.18s ease;
}

/* ========================================================= */
/* ===== 1. 通用折叠栏 ===== */
/* ========================================================= */
details {
  display: block; background: var(--dark-bg); padding: 0;
  margin-bottom: 12px; max-width: 100%; width: 100%; box-sizing: border-box;
  border: 1px solid var(--dark-border); border-left: 4px solid #4a3648;
  box-shadow: var(--shadow-dark); border-radius: 0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease; overflow: hidden;
}
details[open] { box-shadow: 0 4px 18px rgba(212,154,120,0.15); border-color: #4a3a30; }
details:hover { border-left-color: #d49a78; }

details summary {
  display: flex; align-items: center; justify-content: space-between;
  list-style: none; cursor: pointer; position: relative;
  background: var(--dark-surface2); padding: 14px 22px;
  font-weight: 800; letter-spacing: 1px; color: #e0c8b8;
  font-style: italic; font-size: 1.15em; width: 100%; max-width: 100%;
  box-sizing: border-box; border-left: 4px solid #4a3648;
  text-align: left; user-select: none; transition: all var(--transition); overflow: hidden;
  border-radius: 0;
}
details summary::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: #4a3648; transition: background var(--transition);
}
details summary::after {
  content: "◆"; font-size: 0.7em; color: #d49a78;
  text-shadow: 0 0 6px rgba(212,154,120,0.6);
  transition: all var(--transition); margin-left: auto;
}
details summary:hover {
  background: #f0d0a0; color: var(--dark-surface2);
  border-left-color: var(--dark-surface2); padding-right: 34px;
}
details summary:hover::before { background: var(--dark-surface2); }
details summary:hover::after { content: "▶"; color: var(--dark-surface2); 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: var(--dark-surface); color: var(--dark-text);
  padding: 16px 22px; font-size: 0.95em; line-height: 1.7;
  border-top: 1px solid var(--dark-border);
}
.details-body a { color: var(--dark-accent); text-decoration: none; }

/* ========================================================= */
/* ===== 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, #2a2230 0%, #1e1822 100%);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 14px 20px; font-weight: 700; letter-spacing: 0.8px;
  color: #e8d0c8; font-style: normal; font-size: 0.95em;
  width: 100%; box-sizing: border-box; border-left: none;
  border-bottom: 1px solid #2e2428; text-align: left; user-select: none;
  transition: all var(--transition);
}
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: #6a5a5e; letter-spacing: 1.5px;
  font-family: 'Courier New', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
details.panel-details > summary::after {
  content: "▾"; font-size: 0.7em; color: rgba(224,200,190,0.6);
  text-shadow: none; margin-left: 6px; transition: transform 0.2s ease; flex-shrink: 0;
}
details.panel-details[open] > summary { border-radius: var(--radius-md) var(--radius-md) 0 0; border-bottom-color: #3a2a30; }
details.panel-details[open] > summary::after { transform: rotate(180deg); }
details.panel-details > summary:hover {
  background: linear-gradient(135deg, #342a38 0%, #2a2230 100%);
  color: #f0dcc8; border-left: none; padding-right: 20px;
}
details.panel-details > summary::-webkit-details-marker { display: none; }
details.panel-details > summary::marker { display: none; content: ""; }

.panel-body {
  background: linear-gradient(170deg, #fdfaf6 0%, #f6f2ec 100%) !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  border: 1px solid #d8d0c8 !important; border-top: none !important;
  color: #2c2824 !important; padding: 18px 20px !important;
}

/* ========================================================= */
/* ===== 3. 玩家面板 ===== */
/* ========================================================= */
.player-card { display: flex; flex-direction: column; gap: 14px; padding: 6px 10px; }
.player-name-row {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid #e8e0d8;
}
.player-name { font-size: 1.4em; font-weight: 700; color: #1a1a28; letter-spacing: 0.5px; }
.player-badge {
  font-size: 0.75em; font-weight: 600; color: #8a7060;
  background: rgba(180,140,110,0.12); padding: 2px 10px; border-radius: 10px;
}
.player-section { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.player-text { font-size: 0.85em; color: #4a3e34; line-height: 1.6; margin: 0; padding-left: 2px; }

/* ========================================================= */
/* ===== 4. 叶淑华面板（银灰蓝×暖橙） ===== */
/* ========================================================= */
.sh-panel {
  width: 100%; max-width: none; margin: 0 auto;
  background: linear-gradient(180deg, #fdfaf6 0%, #f5efe6 100%);
  border: 2px solid #b8a8c8; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(160,120,168,0.16), inset 0 1px 0 rgba(255,255,255,0.8);
  overflow: hidden; color: #3a2e26; position: relative;
}
.sh-panel::before {
  content:""; position:absolute; top:0; left:0; right:0; height:3px;
  background: linear-gradient(90deg, transparent, #a078a8, transparent);
}
.sh-portrait { padding: 18px 18px 6px; text-align: center; }
.sh-portrait img {
  display: inline-block; width: 220px; aspect-ratio: 3/4;
  border-radius: 10px; overflow: hidden;
  border: 2px solid #c8b8d0;
  box-shadow: 0 6px 24px rgba(120,90,130,0.2), 0 0 0 1px rgba(160,120,168,0.15);
  background: #f5efe6; object-fit: cover;
}
.sh-portrait-caption {
  display: block; margin-top: 8px; font-size: .68em;
  color: #8a6a98; letter-spacing: 2px; font-family: 'Courier New',monospace;
}
.sh-quickinfo {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin: 4px 18px 0; padding: 0; border: none;
}
.sh-quickinfo span {
  font-size: .72em; color: #6a4a78;
  background: rgba(160,120,168,0.08); border: 1px solid rgba(160,120,168,0.2);
  padding: 3px 10px; border-radius: 12px;
}
.sh-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px; border-bottom: 1px solid #e0d8e8;
  background: linear-gradient(180deg, rgba(160,120,168,0.06), transparent);
  margin-top: 12px; flex-wrap: wrap; gap: 6px;
}
.sh-level { font-size: 1.4em; font-weight: 800; letter-spacing: 1px; color: #a078a8; }
.sh-class { font-size: .85em; color: #a09098; letter-spacing: 1px; }
.sh-next {
  font-size: .72em; color: #e05830; font-family: 'Courier New',monospace;
  background: rgba(224,88,48,0.08); border: 1px solid rgba(224,88,48,0.25);
  padding: 3px 10px; border-radius: 12px; white-space: nowrap;
}
.sh-bars { padding: 14px 18px 4px; display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-name { flex: 0 0 74px; font-size: .78em; font-weight: 700; letter-spacing: 1px; }
.bar-track {
  flex: 1; height: 12px; background: #ece4f0; border-radius: 999px;
  border: 1px solid #d8ccdc; overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(140,110,150,0.15);
}
.bar-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.bar-value { flex: 0 0 74px; text-align: right; font-size: .72em; font-family: 'Courier New',monospace; color: #a09098; }
.bar-row.trust .bar-name { color: #a078a8; }
.bar-row.trust .bar-fill { background: linear-gradient(90deg, #a078a8, #c89ad0); box-shadow: 0 0 8px rgba(160,120,168,0.3); }
.bar-row.dep .bar-name { color: #d4905a; }
.bar-row.dep .bar-fill { background: linear-gradient(90deg, #e8a04a, #f0c878); box-shadow: 0 0 8px rgba(232,160,74,0.3); }
.bar-row.ts .bar-name { color: #c47a8a; }
.bar-row.ts .bar-fill { background: linear-gradient(90deg, #d4857a, #f0a0b0); box-shadow: 0 0 8px rgba(212,133,122,0.3); }

.sh-changes {
  display: flex; flex-direction: column; gap: 2px;
  margin: 6px 18px 0; padding: 6px 12px; border-radius: 6px;
  background: rgba(160,120,168,0.05); border-left: 2px solid #b8a8c8;
  font-size: .72em; color: #a09098; line-height: 1.7;
}
.change-item.trust { color: #8a5a98; }
.change-item.dep { color: #a07030; }
.change-item.ts { color: #b06078; }

.sh-status {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 6px 18px 0; padding: 10px 14px; border-radius: 8px;
  background: rgba(232,160,74,0.06); border: 1px dashed #d4a060;
  font-size: .78em; color: #6a5040;
}
.sh-status b { color: #d4905a; font-weight: 700; }

.sh-sub { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.sub-block { padding: 12px 16px; border-radius: 8px; background: #fffdf8; border: 1px solid #e8d8c0; }
.sub-label { font-size: .72em; font-weight: 700; color: #a078a8; letter-spacing: 1px; margin-bottom: 6px; }
.sub-text { font-size: .85em; color: #4a3020; line-height: 1.7; }
.sub-block.thoughts {
  background: linear-gradient(135deg, #faf6fd 0%, #f2ecf5 100%);
  border-left: 3px solid #a078a8; border-radius: 0 8px 8px 0;
}
.sub-block.thoughts .sub-text { font-style: italic; color: #6a4a78; }
.sub-block.next {
  background: linear-gradient(135deg, #fff8f0 0%, #fef0e0 100%);
  border: 1px dashed #d4a060;
}
.sub-block.next .sub-label { color: #a06030; }
.sub-block.next .sub-text { font-weight: 500; color: #5d4030; }

/* ========================================================= */
/* ===== 5. 对话气泡 · 三档配色 ===== */
/* ========================================================= */
.dialogue-box, .dialogue-box[data-role] {
  position: relative; display: block;
  border-radius: 4px 16px 16px 16px !important;
  padding: 12px 18px 12px 16px !important;
  margin: 14px 0 14px 8px !important; text-indent: 0 !important;
  border-left-width: 4px !important; border-left-style: solid !important;
  background: linear-gradient(135deg, #f7f7f7 0%, #eeeeee 100%) !important;
  border-left-color: #b0b0b0 !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
}
.dialogue-box .speaker, .dialogue-box[data-role] .speaker {
  display: block; font-size: 0.82em; font-weight: 700;
  margin-bottom: 4px; letter-spacing: 0.5px; color: #777777 !important;
}
.dialogue-box .dialogue-text, .dialogue-box[data-role] .dialogue-text {
  display: block; font-size: 1.04em; line-height: 1.7; color: #555555 !important;
}
.dialogue-box[data-role="npc"], .dialogue-box[data-role="路人"], .dialogue-box[data-role="其他"] {
  background: linear-gradient(135deg, #f7f7f7 0%, #eeeeee 100%) !important;
  border-left-color: #b0b0b0 !important;
}
.dialogue-box[data-role="npc"] .speaker { color: #777777 !important; }

/* 叶淑华 · 紫灰系 */
.dialogue-box[data-role="shuhua"], .dialogue-box[data-role="叶淑华"] {
  background: linear-gradient(135deg, #f4eef8 0%, #eadef2 100%) !important;
  border-left-color: #a078a8 !important;
  box-shadow: 0 2px 10px rgba(160,120,168,0.16) !important;
}
.dialogue-box[data-role="shuhua"] .speaker, .dialogue-box[data-role="叶淑华"] .speaker { color: #8a5a98 !important; }
.dialogue-box[data-role="shuhua"] .dialogue-text, .dialogue-box[data-role="叶淑华"] .dialogue-text { color: #5a3a68 !important; }

/* 玩家 · 暖橙系 */
.dialogue-box[data-role="user"], .dialogue-box[data-role="玩家"] {
  background: linear-gradient(135deg, #fdf3e6 0%, #fae8d0 100%) !important;
  border-left-color: #e8a04a !important;
  box-shadow: 0 2px 10px rgba(232,160,74,0.15) !important;
}
.dialogue-box[data-role="user"] .speaker, .dialogue-box[data-role="玩家"] .speaker { color: #b07030 !important; }
.dialogue-box[data-role="user"] .dialogue-text, .dialogue-box[data-role="玩家"] .dialogue-text { color: #8a5a20 !important; }

/* ========================================================= */
/* ===== 6. 时间/场景信息头 ===== */
/* ========================================================= */
.time-header {
  background: linear-gradient(135deg, #2a2430 0%, #3a2e40 40%, #2a2430 100%);
  border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 20px;
  color: #ece4dc; box-shadow: 0 4px 20px rgba(20,15,25,0.25);
  border: 1px solid rgba(255,255,255,0.06); position: relative; overflow: hidden;
}
.time-header::before {
  content: ""; position: absolute; top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(160,120,168,0.08) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.time-row-main { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.time-day { font-size: 1.5em; font-weight: 700; letter-spacing: 1px; color: #f5ece4; }
.time-sep { font-size: 1.3em; color: #8a7a70; margin: 0 2px; }
.time-period { font-size: 1.2em; font-weight: 600; color: #e8c8a0; }
.time-clock {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #f7efe0 0%, #efe0d0 100%);
  color: #5a4030; font-size: 0.92em; font-weight: 600; letter-spacing: 0.5px;
  padding: 4px 12px; border-radius: 20px; border: 1px solid #d8c0a8;
  margin-left: 4px;
}
.time-row-loc { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 0.9em; color: #c0b0a4; }
.time-row-weather { display: flex; align-items: center; gap: 6px; font-size: 0.85em; color: #a09084; flex-wrap: wrap; }
.time-divider {
  height: 1px; margin: 14px 0 12px 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 20%, rgba(255,255,255,0.12) 80%, transparent 100%);
}
.time-row-budget { display: flex; align-items: center; gap: 10px; font-size: 0.85em; flex-wrap: wrap; }
.budget-label { color: #a09084; margin-right: 6px; }
.budget-item { font-weight: 600; letter-spacing: 0.3px; padding: 2px 10px; border-radius: 12px; font-size: 0.9em; }
.budget-item.shuhua { color: #d4a0b8; background: rgba(196,122,138,0.15); }

/* ========================================================= */
/* ===== 7. 正文容器 / 内心独白 ===== */
/* ========================================================= */
.khorra-output {
  max-width: 100%; width: 100%; box-sizing: border-box;
  background: linear-gradient(180deg, var(--warm-bg) 0%, var(--warm-surface) 30%, var(--warm-surface2) 100%);
  border-radius: 12px; padding: 22px 24px; border: 1px solid var(--warm-border);
  box-shadow: var(--shadow-light), inset 0 0 0 1px rgba(255,255,255,0.8);
  line-height: 1.85; color: var(--warm-text);
}
.narrative-p { text-indent: 2em; line-height: 1.9; margin: 0.8em 0; }
.inner-monologue {
  font-style: italic; color: #6a4a78;
  background: linear-gradient(135deg, #f4eef8 0%, #eadef2 100%);
  border-left: 3px solid #a078a8; padding: 12px 18px; margin: 16px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.95em; line-height: 1.7; text-indent: 0;
}

/* ========================================================= */
/* ===== 8. 解锁提醒 ===== */
/* ========================================================= */
.unlock-notice {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px 0 18px 0; padding: 12px 20px;
  background: linear-gradient(135deg, #f6ecf8 0%, #eadcf0 100%);
  border: 1px solid #a078a8; border-radius: var(--radius-md);
  font-size: 0.92em; color: #5d4050;
  box-shadow: 0 2px 10px rgba(160,120,168,0.12);
}
.unlock-icon { font-size: 1.3em; }
.unlock-text strong { color: #8a5a98; font-weight: 700; }

/* ========================================================= */
/* ===== 9. 选择面板 ===== */
/* ========================================================= */
.choice-panel {
  margin-top: 18px; padding: 18px 20px;
  background: linear-gradient(170deg, #fefaf4 0%, #f8f0e8 100%);
  border: 1px solid #e0d0b8; border-radius: var(--radius-md);
  box-shadow: 0 2px 12px rgba(140,100,60,0.08);
}
.choice-title { font-size: 0.95em; font-weight: 700; color: #6a4a30; letter-spacing: 1px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choice-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: #fff; border: 1px solid #e8ddd0; border-radius: 8px;
  cursor: pointer; transition: all 0.15s ease;
}
.choice-card:hover { background: #fefaf4; border-color: #a078a8; box-shadow: 0 2px 8px rgba(160,120,168,0.10); }
.choice-card[data-choice="1"] { border-left: 4px solid #c89ad0; }
.choice-card[data-choice="2"] { border-left: 4px solid #e8a04a; }
.choice-card[data-choice="3"] { border-left: 4px solid #a0c0a0; }
.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: 1px;
  color: #fff; padding: 2px 8px; border-radius: 3px; text-transform: uppercase;
}
.choice-card[data-choice="1"] .choice-label { background: #a078a8; }
.choice-card[data-choice="2"] .choice-label { background: #e8a04a; }
.choice-card[data-choice="3"] .choice-label { background: #70a880; }
.choice-text { font-size: 0.88em; color: #4a3e34; line-height: 1.5; }
.choice-arrow { font-size: 0.85em; color: #c8a860; flex-shrink: 0; transition: transform 0.15s ease; }
.choice-card:hover .choice-arrow { color: #8b6018; transform: translateX(3px); }
.choice-note { margin-top: 12px; font-size: 0.76em; color: #a09080; font-style: italic; text-align: center; }

/* ========================================================= */
/* ===== 10. 记忆面板 / 思维链 / 记忆汇总 ===== */
/* ========================================================= */
.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: #8a6a50; letter-spacing: 0.5px; border-bottom: 1px solid #e0d8d0; white-space: nowrap; }
.memory-table td { padding: 6px 8px; color: #4a3e34; vertical-align: top; border-bottom: 1px solid #f0e8e0; }
.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: 'Courier New',monospace; font-weight: 600; color: #a078a8; }
.memory-note { font-size: 0.72em; color: #8888aa; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); font-style: italic; text-align: center; }
.cot-exec-content { font-size: 0.82em; color: #b0a898; line-height: 1.6; white-space: pre-wrap; }
.memory-summary {
  background: var(--dark-surface2); border: 1px solid var(--dark-border);
  border-radius: 6px; padding: 0; overflow: hidden;
}
.memory-summary-header {
  background: #0e0c12; border-bottom: 1px solid var(--dark-border);
  padding: 12px 18px; display: flex; align-items: center; gap: 8px;
  font-family: 'Courier New',monospace;
}
.memory-summary-title { font-weight: 700; color: #e0c8b8; letter-spacing: 1px; }
.memory-summary-body { padding: 18px; font-size: 0.88em; line-height: 1.8; color: #d0c4b8; }
.memory-summary-footer {
  background: #0e0c12; border-top: 1px solid var(--dark-border);
  padding: 10px 18px; font-size: 0.72em; color: #8a7a6a;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Courier New',monospace;
}

/* ========================================================= */
/* ===== 11. 溢出保护 / 移动端适配 ===== */
/* ========================================================= */
details, details > * { word-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; white-space: normal; max-width: 100%; }
.panel-body { word-wrap: break-word; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  details summary { padding: 12px 14px; font-size: 1em; }
  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; }
  .sh-portrait img { width: 170px; }
  .sh-quickinfo { flex-direction: column; gap: 4px; align-items: center; }
  .sh-bars { padding: 12px 14px 4px; gap: 8px; }
  .bar-name { flex: 0 0 58px; font-size: .72em; }
  .bar-value { flex: 0 0 56px; font-size: .66em; }
  .bar-track { height: 10px; }
  .sh-top { padding: 12px 14px 10px; }
  .sh-next { order: 3; width: 100%; text-align: center; font-size: .66em; }
  .sh-changes { margin: 6px 14px 0; padding: 5px 10px; font-size: .66em; }
  .sh-status { margin: 6px 14px 0; padding: 8px 12px; font-size: .72em; flex-direction: column; gap: 4px; }
  .sh-sub { padding: 2px 14px 14px; gap: 8px; }
  .sub-block { padding: 10px 12px; }
  .khorra-output { padding: 12px 14px; }
  .time-header { padding: 12px 14px; }
  .time-day { font-size: 1.2em; }
  .time-period { font-size: 1em; }
  .time-row-budget { gap: 6px; flex-wrap: wrap; }
  .dialogue-box, .dialogue-box[data-role] { margin-left: 0 !important; margin-right: 0 !important; padding: 10px 14px !important; }
  .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; }
  .memory-summary-body { padding: 12px; font-size: 0.82em; }
}
/* ========================================================= */
/* ===== 12. 记忆存档面板 v2 · 紫灰×暖橙 ===== */
/* ========================================================= */
/* 记忆配置区 */
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 > summary {
  display: flex; align-items: center; gap: 6px;
  list-style: none; cursor: pointer;
  background: linear-gradient(135deg, #f2ecf5 0%, #eae2f0 100%);
  border: 1px solid #d8ccdc; border-radius: 8px;
  padding: 9px 14px; font-weight: 600; font-size: 0.8em;
  color: #6a4a78; 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: #a078a8; margin-left: auto; transition: transform 0.2s ease;
}
details.memory-config[open] > summary::after { transform: rotate(180deg); }
details.memory-config > summary:hover { background: linear-gradient(135deg, #eae2f0 0%, #e0d4ea 100%); color: #4a2a58; }
details.memory-config > summary::-webkit-details-marker { display: none; }
details.memory-config > summary::marker { display: none; content: ""; }
.memory-config-body {
  padding: 12px 16px; font-size: 0.78em; line-height: 1.9;
  color: #6a4a78; font-family: 'Courier New','SF Mono','Cascadia Code','Consolas',monospace;
  background: linear-gradient(170deg, #faf6fd 0%, #f2ecf5 100%);
  border: 1px solid #e0d8e8; border-top: none; border-radius: 0 0 8px 8px;
}

/* STM/LTM 子折叠（嵌套面板内） */
details.memory-stm, details.memory-ltm {
  background: transparent; border: none; border-left: none;
  box-shadow: none; margin-bottom: 8px;
}
details.memory-stm[open], details.memory-ltm[open] { box-shadow: none; border-color: transparent; }
details.memory-stm > summary, details.memory-ltm > summary {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer;
  background: linear-gradient(135deg, #fffdf8 0%, #f5efe6 100%);
  border: 1px solid #e8dcc8; border-radius: 8px;
  padding: 9px 14px; font-weight: 700; font-size: 0.82em;
  color: #8a5a30; 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: #d4a060; 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: linear-gradient(135deg, #faf2e8 0%, #f0e4d8 100%); color: #5d4030; }
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: 6px 2px 2px; border: none;
}

/* 记忆表格 v2 */
.memory-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.82em; line-height: 1.6; border-radius: 8px; overflow: hidden;
  border: 1px solid #e8e0d8; box-shadow: 0 2px 8px rgba(160,120,168,0.06);
}
.memory-table th {
  text-align: left; padding: 8px 10px; font-size: 0.74em; font-weight: 700;
  color: #fff; letter-spacing: 0.5px; white-space: nowrap;
  background: linear-gradient(135deg, #8a6a98 0%, #a078a8 100%);
  border-bottom: none;
}
.memory-table td {
  padding: 8px 10px; color: #4a3e34; vertical-align: top;
  border-bottom: 1px solid #f0e8f2; background: #fffdf8;
}
.memory-table tr:last-child td { border-bottom: none; }
.memory-table tr:nth-child(even) td { background: #faf6fd; }
.memory-table td:first-child, .memory-table th:first-child {
  width: 38px; text-align: center;
  font-family: 'Courier New','SF Mono',monospace; font-weight: 700; color: #a078a8;
}
.memory-table tr:hover td { background: #f4eef8; }

/* 总纲存档条目 */
.archive-entry {
  margin-bottom: 10px; padding: 12px 14px;
  background: linear-gradient(170deg, #faf6fd 0%, #f2ecf5 100%);
  border-left: 3px solid #a078a8; border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 8px rgba(160,120,168,0.08);
}
.archive-entry-head {
  font-size: .72em; font-weight: 700; color: #a06030; margin-bottom: 4px;
  font-family: 'Courier New','SF Mono',monospace; letter-spacing: 0.5px;
}
.archive-entry-text { font-size: .8em; color: #5d4030; line-height: 1.7; }

/* ========================================================= */
/* ===== 13. 人情账本面板 v2 · 欠条卡片 ===== */
/* ========================================================= */
.debt-list { display: flex; flex-direction: column; gap: 8px; }
.debt-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 8px;
  background: linear-gradient(135deg, #fffdf8 0%, #faf2e8 100%);
  border: 1px solid #e8dcc8; box-shadow: 0 2px 8px rgba(160,120,168,0.05);
  position: relative; overflow: hidden;
}
.debt-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #a078a8, #d4a060);
}
.debt-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72em; font-weight: 700;
  font-family: 'Courier New','SF Mono',monospace;
  background: linear-gradient(135deg, #a078a8, #c89ad0);
  color: #fff; box-shadow: 0 2px 6px rgba(160,120,168,0.3);
}
.debt-body { flex: 1; min-width: 0; }
.debt-title { font-size: 0.88em; font-weight: 700; color: #3a2a20; margin-bottom: 2px; }
.debt-detail { font-size: 0.76em; color: #8a7060; line-height: 1.5; }
.debt-tag {
  font-size: 0.66em; font-weight: 700; padding: 3px 10px;
  border-radius: 12px; flex-shrink: 0; letter-spacing: 1px;
  background: linear-gradient(135deg, #e8d8f0 0%, #dcc8e8 100%);
  color: #8a5a98; border: 1px solid #c8b0d8;
  white-space: nowrap; align-self: center;
}

/* 她的态度（毒舌语录式） */
.debt-status {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: linear-gradient(135deg, #f6ecf8 0%, #eadcf0 100%);
  border-left: 3px solid #a078a8;
  font-size: 0.84em; font-style: italic; color: #6a4a78; line-height: 1.6;
}
.debt-status::before { content: "🗯️ 她说："; font-weight: 700; font-style: normal; color: #8a5a98; }

/* 消失警告 */
.debt-warn {
  margin-top: 10px; padding: 10px 14px; border-radius: 8px;
  background: linear-gradient(135deg, #fdf0f0 0%, #f8e0e0 100%);
  border: 1px dashed #d47070; border-left: 3px solid #d47070;
  font-size: 0.8em; font-weight: 600; color: #a05050; line-height: 1.6;
}
.debt-warn::before { content: "⚠️ "; }

/* 账本为空时的提示 */
.debt-empty {
  text-align: center; padding: 18px 12px; border-radius: 8px;
  background: linear-gradient(170deg, #faf6fd 0%, #f2ecf5 100%);
  border: 1px dashed #c8b8d8; color: #8a6a98;
  font-size: 0.82em; font-style: italic; letter-spacing: 1px;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .debt-item { padding: 10px 12px; gap: 8px; }
  .debt-num { width: 22px; height: 22px; font-size: 0.66em; }
  .debt-title { font-size: 0.82em; }
  .debt-detail { font-size: 0.72em; }
  .memory-config-body { padding: 10px 12px; font-size: 0.72em; }
  .memory-table { font-size: 0.76em; }
  .archive-entry { padding: 10px 12px; }
}
/* ========================================================= */
/* ===== 记忆区 · 完整样式（旧卡原样） ===== */
/* ========================================================= */
.memory-note {
  font-size: 0.72em; color: #8888aa; margin-top: 10px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06); font-style: italic; text-align: center;
}
.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: #8a6a50; letter-spacing: 0.5px; border-bottom: 1px solid #e0d8d0;
  white-space: nowrap;
}
.memory-table td {
  padding: 6px 8px; color: #4a3e34; vertical-align: top;
  border-bottom: 1px solid #f0e8e0;
}
.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: 'Courier New','SF Mono','Cascadia Code','Consolas',monospace;
  font-weight: 600; color: #b08050;
}

/* 记忆配置区 */
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: #f5f0ec; border-radius: 6px;
  padding: 8px 14px; font-weight: 600; font-size: 0.8em;
  color: #6a5a4e; 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: #8c8878;
  margin-left: auto; transition: transform 0.2s ease;
}
details.memory-config[open] > summary::after { transform: rotate(180deg); }
details.memory-config > summary:hover { background: #ece6e0; color: #3a2a20; }
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: #8a7a6a;
  font-family: 'Courier New','SF Mono','Cascadia Code','Consolas',monospace;
  background: #f9f6f2; border-radius: 0 0 6px 6px;
  border: 1px solid #e8e0d8; border-top: none;
}

/* STM/LTM子折叠 */
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: #f5f0ec; border-radius: 6px;
  padding: 8px 14px; font-weight: 600; font-size: 0.82em;
  color: #5a4a3e; 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: #8c8878;
  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: #ece6e0; color: #3a2a20; }
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;
}

/* 面板内覆盖：表格打回浅色 */
.panel-body .memory-table th { color: #8a6a50; border-bottom-color: #e0d8d0; }
.panel-body .memory-table td { color: #4a3e34; border-bottom-color: #f0e8e0; }

/* 总纲条目 */
.archive-entry {
  margin-bottom: 10px; padding: 10px 12px;
  background: #f9f6f2; border-left: 3px solid #d4a858;
  border-radius: 0 6px 6px 0;
}
.archive-entry-head { font-size: .72em; font-weight: 700; color: #a06030; margin-bottom: 4px; }
.archive-entry-text { font-size: .8em; color: #5d4030; line-height: 1.7; }
/* ========================================================= */
/* ===== 15. 总纲存档 · 专属样式（独立class） ===== */
/* ========================================================= */
details.memory-archive {
  background: transparent; border: none; border-left: none;
  box-shadow: none; margin-bottom: 6px;
}
details.memory-archive[open] { box-shadow: none; border-color: transparent; }
details.memory-archive:hover { border-left-color: transparent; }
details.memory-archive > summary {
  display: flex; align-items: center; gap: 6px;
  list-style: none; cursor: pointer;
  background: linear-gradient(135deg, #fdf3e6 0%, #f8e8d4 100%);
  border: 1px solid #e8d4b8; border-radius: 6px;
  padding: 8px 14px; font-weight: 600; font-size: 0.82em;
  color: #a06030; letter-spacing: 0.5px; border-left: none;
  transition: all 0.15s ease;
}
details.memory-archive > summary::before { display: none; }
details.memory-archive > summary::after {
  content: "▾"; font-size: 0.7em; color: #d4a060;
  margin-left: auto; transition: transform 0.2s ease;
}
details.memory-archive[open] > summary::after { transform: rotate(180deg); }
details.memory-archive > summary:hover { background: linear-gradient(135deg, #f8e8d4 0%, #f0dcc0 100%); color: #8a4a20; }
details.memory-archive > summary::-webkit-details-marker { display: none; }
details.memory-archive > summary::marker { display: none; content: ""; }

/* 总纲内容区（专属，不受 memory-ltm 规则影响） */
.archive-body {
  background: linear-gradient(170deg, #faf6fd 0%, #f2ecf5 100%);
  border: 1px solid #e0d8e8; border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 12px 14px;
}
.archive-entry {
  margin-bottom: 10px; padding: 12px 14px;
  background: #fffdf8; border-left: 3px solid #a078a8;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 8px rgba(160,120,168,0.08);
}
.archive-entry-head { font-size: .72em; font-weight: 700; color: #a06030; margin-bottom: 4px; font-family: 'Courier New','SF Mono',monospace; }
.archive-entry-text { font-size: .8em; color: #5d4030; line-height: 1.7; }
.archive-entry:last-child { margin-bottom: 0; }

/* 空态提示 */
.archive-empty {
  text-align: center; padding: 14px 12px; border-radius: 8px;
  background: linear-gradient(170deg, #faf6fd 0%, #f2ecf5 100%);
  border: 1px dashed #c8b8d8; color: #8a6a98;
  font-size: 0.8em; font-style: italic; letter-spacing: 1px;
}
/* ========================================================= */
/* ===== 16. 立绘切换 · checkbox hack（唯一id·全轮生效） ===== */
/* ========================================================= */
.shu-form-toggle { display: none; position: absolute; }
.shu-form-switch {
  display: block; cursor: pointer; margin: 0 auto 6px;
  max-width: 240px;
}
.shu-form-frame {
  position: relative; display: block; width: 100%;
  aspect-ratio: 3/4; border-radius: 10px; overflow: hidden;
  border: 2px solid #c8b8d0;
  box-shadow: 0 6px 24px rgba(120,90,130,0.2);
  background: #f5efe6;
}
/* ★ 防 .sh-portrait img 通用规则污染 */
.sh-portrait .shu-form-frame img {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  max-width: none !important;
  object-fit: cover; display: block;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.shu-form-img.makeup { opacity: 1; transform: scale(1); }
.shu-form-img.natural { opacity: 0; transform: scale(1.03); }
.shu-form-toggle:checked ~ .shu-form-switch .shu-form-img.makeup { opacity: 0; transform: scale(1.03); }
.shu-form-toggle:checked ~ .shu-form-switch .shu-form-img.natural { opacity: 1; transform: scale(1); }

/* 提示文字切换 */
.shu-form-hint {
  display: block; text-align: center; font-size: 0.66em;
  color: #8a6a98; letter-spacing: 1px; margin-top: 6px;
}
.shu-form-hint .hint-natural { display: none; }
.shu-form-toggle:checked ~ .shu-form-switch .hint-makeup { display: none; }
.shu-form-toggle:checked ~ .shu-form-switch .hint-natural { display: inline; }

@media (max-width: 640px) {
  .shu-form-switch { max-width: 180px; }
  .shu-form-hint { font-size: 0.6em; }
}
/* ========================================================= */
/* ===== 17. 隐秘档案 · 红色保密章折叠 ===== */
/* ========================================================= */
details.secret-details {
  background: transparent; border: none; border-left: none;
  box-shadow: none; margin: 14px 0 4px;
}
details.secret-details[open] { box-shadow: none; border-color: transparent; }
details.secret-details:hover { border-left-color: transparent; }
details.secret-details > summary {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer;
  background: linear-gradient(135deg, #3a1c1c 0%, #241212 100%);
  border: 1px solid #4a2a2a; border-radius: 8px;
  padding: 10px 14px; font-weight: 700; font-size: 0.86em;
  color: #f0d0c8; letter-spacing: 1px; border-left: none;
  transition: all 0.15s ease; position: relative;
}
details.secret-details > summary::before { display: none; }
details.secret-details > summary::after {
  content: "▾"; font-size: 0.7em; color: #d49080;
  margin-left: auto; transition: transform 0.2s ease;
}
details.secret-details[open] > summary::after { transform: rotate(180deg); }
details.secret-details > summary:hover { background: linear-gradient(135deg, #4a2222 0%, #341818 100%); }
details.secret-details > summary::-webkit-details-marker { display: none; }
details.secret-details > summary::marker { display: none; content: ""; }
details.secret-details > summary .secret-ic { font-size: 1.1em; }
details.secret-details > summary .secret-title { color: #f0d0c8; }

/* 红色"密"字印章 */
details.secret-details > summary .secret-badge {
  font-size: 0.7em; font-weight: 900; color: rgba(225, 75, 75, 0.92);
  border: 2px solid rgba(225, 75, 75, 0.8); padding: 1px 8px; border-radius: 4px;
  transform: rotate(-10deg); letter-spacing: 3px; margin-left: 4px;
  font-family: '楷体','KaiTi','STKaiti','SimSun',serif;
  background: rgba(225, 75, 75, 0.08);
  box-shadow: 0 0 8px rgba(225, 75, 75, 0.35);
  text-shadow: 0 0 4px rgba(225, 75, 75, 0.4);
}

/* 内容区 */
.secret-body {
  background: linear-gradient(170deg, #fffaf8 0%, #fdf0ec 100%);
  border: 1px solid #e8c8c0; border-top: none;
  border-radius: 0 0 8px 8px; padding: 12px 14px;
}
.secret-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.secret-item {
  background: linear-gradient(170deg, #fffaf8 0%, #fdf0ec 100%);
  border: 1px solid #e8c8c0; border-left: 3px solid #d47070;
  border-radius: 6px; padding: 10px 12px;
}
.secret-label { font-size: 0.72em; font-weight: 700; color: #c05050; letter-spacing: 1px; margin-bottom: 4px; }
.secret-text { font-size: 0.82em; color: #5d4030; line-height: 1.6; }
.secret-note {
  font-size: 0.7em; color: #a08080; font-style: italic;
  margin-top: 10px; text-align: center; line-height: 1.5;
}
.secret-eye {
  font-size: 0.74em; font-weight: 600; color: #c05050;
  letter-spacing: 0.5px; margin-bottom: 10px;
  padding: 7px 11px; border-radius: 6px;
  background: rgba(212, 80, 80, 0.06); border-left: 3px solid #d47070;
}
@media (max-width: 640px) {
  .secret-grid { grid-template-columns: 1fr; }
  details.secret-details > summary { padding: 9px 12px; font-size: 0.8em; }
  details.secret-details > summary .secret-badge { font-size: 0.62em; }
  .secret-body { padding: 10px 12px; }
}
/* ========================================================= */
/* ===== 18. 修复补丁 · 限制作用域，防误伤平台容器 ===== */
/* ========================================================= */
/* 第一步：全局 details 全部还原为透明无样式（解除误伤） */
details {
  background: transparent !important;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: auto !important;
}

/* 第二步：只对 .khorra-output 内部的 details 恢复我们的样式 */
.khorra-output details {
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  border-left: 4px solid #4a3648;
  box-shadow: var(--shadow-dark);
  margin-bottom: 12px;
  padding: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* 宽屏恢复 */
.khorra-output { max-width: 100% !important; width: 100% !important; }
@media (max-width: 640px) {
  .khorra-output { padding: 12px 14px !important; margin: 0 !important; }
}
/* ========================================================= */
/* ===== 20. 玩家档案面板 v2 · 完整要素 ===== */
/* ========================================================= */
.player-card { display: flex; flex-direction: column; gap: 14px; padding: 6px 10px; }
.player-name-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid #e8e0d8;
}
.player-name { font-size: 1.5em; font-weight: 800; color: #1a1a28; letter-spacing: 0.5px; }
.player-badge {
  font-size: 0.72em; font-weight: 600; color: #8a7060;
  background: linear-gradient(135deg, #f0e8e0, #e8ded4);
  border: 1px solid #d8ccc0; padding: 2px 12px; border-radius: 12px;
}
.player-lv {
  margin-left: auto; font-size: 0.78em; font-weight: 700;
  font-family: 'Courier New','SF Mono',monospace; color: #a078a8;
  background: rgba(160,120,168,0.08); border: 1px solid rgba(160,120,168,0.25);
  padding: 2px 10px; border-radius: 12px;
}
.player-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.meta-item {
  font-size: 0.78em; color: #4a3e34; line-height: 1.5;
  background: linear-gradient(135deg, #fffdf8, #f8f2ec);
  border: 1px solid #e8ddd0; border-radius: 6px; padding: 7px 10px;
  word-break: break-word;
}
.meta-job .meta-label, .meta-scale .meta-label, .meta-funds .meta-label, .meta-view .meta-label { font-weight: 700; color: #8a5a30; }
.player-section { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.player-section-label {
  font-size: 0.68em; font-weight: 700; color: #a09080;
  letter-spacing: 1px; text-transform: uppercase;
}
.player-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.player-tag {
  font-size: 0.8em; font-weight: 600; color: #6a4a78;
  background: linear-gradient(135deg, #f4eef8 0%, #eadef2 100%);
  border: 1px solid #d8c8e0; padding: 4px 14px; border-radius: 14px;
}
.player-section.look .player-text, .player-section.note .player-text {
  font-size: 0.85em; color: #4a3e34; line-height: 1.6; margin: 0; padding-left: 2px;
}
@media (max-width: 640px) {
  .player-meta { grid-template-columns: 1fr; }
  .player-name { font-size: 1.25em; }
  .player-lv { margin-left: 0; }
}
/* ========================================================= */
/* ===== 21. 折叠模块间距强化（强制生效） ===== */
/* ========================================================= */
/* 一级折叠面板（前置检查/玩家档案/叶淑华/人情账本/记忆存档）之间：大间隙 */
.khorra-output > details {
  margin-bottom: 18px !important;
}
/* 面板内嵌套子折叠（记忆配置/STM/LTM/总纲/隐秘档案/立绘切换）：小间隙 */
.khorra-output details details {
  margin-bottom: 8px !important;
}
@media (max-width: 640px) {
  .khorra-output > details { margin-bottom: 14px !important; }
}
/* ========================================================= */
/* ===== 22. 人情账本 · 旧笔记本样式 ===== */
/* ========================================================= */
/* --- 封面标签：皮质棕 --- */
details.panel-details.debt-panel > summary {
  background: linear-gradient(135deg, #8a6a50 0%, #6e4f38 100%) !important;
  color: #f5e8d0 !important;
  border-bottom: 1px solid #5a4028 !important;
  letter-spacing: 1.5px;
}
details.panel-details.debt-panel > summary:hover {
  background: linear-gradient(135deg, #9a7a5e 0%, #7a5a40 100%) !important;
}
details.panel-details.debt-panel > summary .panel-summary-sub { color: #d8c0a0 !important; }

/* --- 内页：横线纸 + 米黄底色 --- */
details.panel-details.debt-panel .panel-body {
  background:
    repeating-linear-gradient(180deg, transparent 0, transparent 27px, rgba(160,120,80,0.15) 27px, rgba(160,120,80,0.15) 28px),
    linear-gradient(180deg, #fdf6e3 0%, #f7ecd2 100%) !important;
  border: 1px solid #d8c8a8 !important;
  border-top: none !important;
  position: relative;
  padding: 26px 24px 20px 44px !important;
}
/* --- 左侧装订孔 --- */
details.panel-details.debt-panel .panel-body::before {
  content: "";
  position: absolute; left: 14px; top: 0; bottom: 0; width: 14px;
  background-image: radial-gradient(circle at 7px 14px, rgba(120,80,50,0.28) 3px, transparent 3.5px);
  background-size: 14px 56px;
  background-repeat: repeat-y;
}
/* --- 手写字体（全内容区） --- */
details.panel-details.debt-panel .panel-body,
details.panel-details.debt-panel .panel-body * {
  font-family: 'Ma Shan Zheng', 'Zhi Mang Xing', 'STKaiti', 'KaiTi', '楷体', 'SimSun', cursive !important;
}

/* --- 欠条便签：手写纸条 + 胶带 --- */
.debt-list { gap: 14px; }
.debt-item {
  background: linear-gradient(135deg, #fffbe8 0%, #fff2c0 100%) !important;
  border: 1px solid #e8d6a0 !important;
  border-left: 4px solid #d4a060 !important;
  transform: rotate(-0.4deg);
  box-shadow: 2px 3px 10px rgba(120,90,50,0.15);
  position: relative;
  margin-bottom: 4px !important;
}
.debt-item:nth-child(even) { transform: rotate(0.5deg); }
.debt-item::before { display: none; } /* 隐藏旧渐变边 */
.debt-item::after {
  content: "";
  position: absolute; top: -7px; left: 50%;
  width: 46px; height: 15px;
  transform: translateX(-50%) rotate(-2deg);
  background: linear-gradient(180deg, rgba(240,220,160,0.75), rgba(230,205,140,0.55));
  border-left: 1px dashed rgba(160,120,60,0.45);
  border-right: 1px dashed rgba(160,120,60,0.45);
  border-radius: 2px;
}
.debt-num {
  background: none !important; color: #a06030 !important;
  border: 1.5px solid #c89050 !important;
  box-shadow: none !important;
  font-size: 0.8em; font-weight: 700;
}
.debt-title { font-size: 1.02em; color: #5a4028; }
.debt-detail { color: #8a6a50; font-size: 0.82em; }
.debt-tag {
  background: #fdf0dc !important; color: #b05030 !important;
  border: 1px solid #e0b080 !important;
  font-weight: 700; transform: rotate(3deg);
  font-family: 'STKaiti', 'KaiTi', '楷体', cursive !important;
}

/* --- 手写批注（她的想法） --- */
.debt-status {
  background: rgba(255,250,235,0.6) !important;
  border-left: 3px solid #c89050 !important;
  border-bottom: 1px dashed #d8b890;
  font-size: 0.95em; line-height: 1.8;
}

/* --- 空页提示 --- */
.debt-empty {
  border: 1.5px dashed #d8b890 !important;
  background: rgba(255,250,235,0.5) !important;
  color: #a08050 !important;
  font-size: 0.95em; letter-spacing: 2px;
}

/* --- 移动端 --- */
@media (max-width: 640px) {
  details.panel-details.debt-panel .panel-body { padding: 20px 14px 16px 34px !important; }
  details.panel-details.debt-panel .panel-body::before { left: 10px; width: 12px; }
  .debt-item::after { width: 36px; height: 12px; }
}
/* ========================================================= */
/* ===== 23. 叶淑华面板 · 去最外围大框 ===== */
/* ========================================================= */
.sh-panel {
  border: none !important;        /* 去掉外边框 */
  background: transparent !important;  /* 去掉外底色 */
  box-shadow: none !important;    /* 去掉外阴影 */
  padding: 0 !important;          /* 去掉外内边距 */
  border-radius: 0 !important;
}
.sh-panel::before { display: none !important; }  /* 去掉顶部渐变条 */
/* ========================================================= */
/* ===== 24. 嵌套 details 防误伤补丁（放最末，强制最高优先级） ===== */
/* ========================================================= */
/* 防止 18 段的 .khorra-output details 给嵌套子折叠加框 */
.khorra-output details details {
  background: transparent !important;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
  max-width: none !important;
  width: auto !important;
  margin-bottom: 8px !important;
}
