/* ========================================================= */
/* ===== 0. CSS变量 ===== */
/* ========================================================= */
:root {
  --warm-bg:        #fdf8f0;
  --warm-surface:   #faf2e8;
  --warm-surface2:  #f5ece0;
  --warm-border:    #e0d0c0;
  --warm-text:      #3d3028;
  --warm-text-dim:  #7a6a5e;
  --warm-accent:    #d4906a;
  --warm-rose:      #d4857a;
  --warm-gold:      #e0b080;
  --dark-bg:        #1a1412;
  --dark-surface:   #1e1816;
  --dark-surface2:  #12100e;
  --dark-border:    #2e2420;
  --dark-text:      #d8ccc4;
  --dark-text-dim:  #a09084;
  --dark-accent:    #d4a080;
  --dark-rose:      #c08070;
  --dark-gold:      #e0c090;
  --shadow-light:   0 2px 10px rgba(140,100,70,0.06);
  --shadow-dark:    0 2px 10px rgba(0,0,0,0.40);
  --radius-sm:      4px;
  --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 #4a3028;
  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,144,106,0.15); border-color: #4a3a30; }
details:hover { border-left-color: #d4906a; }

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 #4a3028;
  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: #4a3028; transition: background var(--transition);
}
details summary::after {
  content: "◆"; font-size: 0.7em; color: #d4906a;
  text-shadow: 0 0 6px rgba(212,144,106,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; }
.details-body a:hover { color: #e0b898; 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%, #1e1410 100%);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 14px 20px; font-weight: 700; letter-spacing: 0.8px;
  color: #e8d0b8; 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 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: #6a5a4e; 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,176,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: #3a2a20; }
details.panel-details[open] > summary::after { transform: rotate(180deg); }
details.panel-details > summary:hover {
  background: linear-gradient(135deg, #342620 0%, #2a1e18 100%);
  color: #f0dcc8; border-left: none; padding-right: 20px;
}
details.panel-details > summary:hover::after { color: #f0dcc8; 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, #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; }
.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: 4px; }
.player-section-label {
  font-size: 0.72em; font-weight: 700; color: #a09080;
  letter-spacing: 1px; text-transform: uppercase;
}
.player-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.player-tag {
  font-size: 0.8em; font-weight: 600; color: #6a5040;
  background: linear-gradient(135deg, #f0e8e0 0%, #e8ded4 100%);
  border: 1px solid #d8ccc0; padding: 4px 12px; border-radius: 14px;
}
.player-text { font-size: 0.85em; color: #4a3e34; line-height: 1.6; margin: 0; }

/* ========================================================= */
/* ===== 4. 田小娟面板 ===== */
/* ========================================================= */
.xj-portrait-frame {
  width: 100%; max-width: 360px; margin: 0 auto 16px auto;
  border-radius: 8px; overflow: hidden; border: 2px solid #d4c0a8;
  box-shadow: 0 4px 18px rgba(30,20,10,0.2); background: #faf2e8;
}
.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: #8d6e5a; letter-spacing: 1px;
  background: linear-gradient(180deg, #faf2e8 0%, #f0e4d8 100%);
  border-top: 1px solid #e0d0c0;
  font-family: 'Georgia', 'Noto Serif SC', 'Source Han Serif SC', serif; font-style: italic;
}
.xj-quickinfo {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #e8e0d8;
}
.xj-quickitem { font-size: 0.82em; color: #4a3e34; background: rgba(180,140,110,0.08); padding: 4px 10px; border-radius: 6px; }
.xj-quicklabel { font-weight: 700; color: #8a6a50; margin-right: 2px; }
.xj-section { margin-bottom: 10px; }
.xj-section-label {
  font-size: 0.72em; font-weight: 700; color: #a09080;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px;
}
.xj-text { font-size: 0.85em; color: #4a3e34; line-height: 1.6; margin: 0; }

.xj-inner-thoughts {
  background: linear-gradient(135deg, #fef9f4 0%, #faf3ea 100%);
  border-left: 3px solid #d4a858; border-radius: 0 8px 8px 0;
  padding: 12px 16px; margin: 14px 0; font-style: italic;
}
.xj-thoughts-label { font-size: 0.75em; font-weight: 700; color: #b08050; letter-spacing: 0.5px; margin-bottom: 4px; }
.xj-inner-thoughts p { margin: 0; font-size: 0.88em; color: #6a5040; 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 #d4a060; border-radius: 8px; padding: 10px 16px; margin: 12px 0;
}
.xj-next-icon { color: #d4906a; font-size: 1em; }
.xj-next-label { font-size: 0.78em; font-weight: 700; color: #a06030; letter-spacing: 0.5px; text-transform: uppercase; flex-shrink: 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 #e8e0d8; }

/* ========================================================= */
/* ===== 5. 记忆存档面板 ===== */
/* ========================================================= */
.mem-block { margin-bottom: 12px; }
.mem-block:last-child { margin-bottom: 0; }
.mem-block-title {
  font-size: 0.8em; font-weight: 700; color: #8a6a50;
  letter-spacing: 0.5px; margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid #eee4da;
}
.mem-list { font-size: 0.84em; color: #4a3e34; line-height: 1.7; padding-left: 4px; }
.mem-item { display: block; padding: 3px 0; }
.mem-id {
  font-family: 'Courier New', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85em; font-weight: 600; color: #b08050; margin-right: 6px;
}

/* ========================================================= */
/* ===== 6. 反差时刻面板（上：态度+做事左右 / 下：聊天全宽） ===== */
/* ========================================================= */
.contrast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "cold   warm"
    "social social";
  gap: 10px;
  margin-bottom: 12px;
}
.contrast-col {
  border-radius: 8px;
  padding: 14px 14px;
  min-height: 60px;
}
.contrast-col.cold-col {
  grid-area: cold;
  background: linear-gradient(170deg, #f5f0f4 0%, #ede4ec 100%);
  border: 1px solid #d8ccd8;
}
.contrast-col.warm-col {
  grid-area: warm;
  background: linear-gradient(170deg, #fef8f2 0%, #faf0e4 100%);
  border: 1px solid #e8d4b8;
}
.contrast-col.social-col {
  grid-area: social;
  background: #ededed;
  border: 1px solid #d0d0d0;
}
.contrast-col-header {
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.cold-col .contrast-col-header { color: #9a7a8a; }
.warm-col .contrast-col-header { color: #b07040; }
.social-col .contrast-col-header { color: #6a6a6a; }
.contrast-content {
  font-size: 0.84em;
  color: #4a3e34;
  line-height: 1.7;
  font-style: italic;
}

/* --- 聊天记录（全宽，统一左对齐） --- */
.contrast-chat-mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cc-line {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 0.78em;
  line-height: 1.6;
  padding: 2px 4px;
}
.cc-line .cc-speaker {
  font-weight: 700;
  flex-shrink: 0;
  min-width: 28px;
  font-size: 0.9em;
}
.cc-line .cc-speaker.friend { color: #7a7a8a; }
.cc-line .cc-speaker.xj { color: #d4906a; }
.cc-line .cc-msg-text {
  color: #333;
  word-break: break-word;
}

/* --- 结论条 --- */
.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 #e8d8c0;
}
.contrast-verdict span { font-weight: 700; color: #a06030; }

@media (max-width: 640px) {
  .contrast-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "cold"
      "warm"
      "social";
  }
}
/* ========================================================= */
/* ===== 7. 对话气泡 ===== */
/* ========================================================= */
.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;
}
.dialogue-box .speaker,
.dialogue-box[data-role] .speaker {
  display: block; font-size: 0.82em; font-weight: 700;
  margin-bottom: 4px; letter-spacing: 0.5px;
}
.dialogue-box .dialogue-text,
.dialogue-box[data-role] .dialogue-text {
  display: block; font-size: 1.04em; line-height: 1.7;
}
.dialogue-box[data-role="xiaojuan"],
.dialogue-box[data-role="田小娟"] {
  background: linear-gradient(135deg, #f8f0ec 0%, #f2e6de 100%) !important;
  border-left-color: var(--warm-rose) !important;
  box-shadow: 0 2px 10px rgba(212,133,122,0.14) !important;
}
.dialogue-box[data-role="xiaojuan"] .speaker,
.dialogue-box[data-role="田小娟"] .speaker { color: #b06a5a !important; }
.dialogue-box[data-role="xiaojuan"] .dialogue-text,
.dialogue-box[data-role="田小娟"] .dialogue-text { color: #8a5040 !important; }
.dialogue-box[data-role="user"],
.dialogue-box[data-role="玩家"] {
  background: linear-gradient(135deg, #f3ece4 0%, #ede0d4 100%) !important;
  border-left-color: #c0906a !important;
  box-shadow: 0 2px 10px rgba(192,144,106,0.12) !important;
}
.dialogue-box[data-role="user"] .speaker,
.dialogue-box[data-role="玩家"] .speaker { color: #9a6a50 !important; }
.dialogue-box[data-role="user"] .dialogue-text,
.dialogue-box[data-role="玩家"] .dialogue-text { color: #7a5040 !important; }

/* ========================================================= */
/* ===== 8. 状态条 ===== */
/* ========================================================= */
.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: #2a1e18; margin-bottom: 6px;
}
.stat-bar .stat-label span { font-weight: 500; font-size: 0.88em; color: #6a5a50; }
.stat-bar .bar-track {
  width: 100%; height: 12px; background: #e2d8d0; border-radius: 999px;
  overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.10);
}
.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.15);
}
.stat-bar.trust .bar-fill { background: linear-gradient(90deg, var(--warm-rose) 0%, #d4a090 100%); }
.stat-bar.desire .bar-fill { background: linear-gradient(90deg, var(--warm-gold) 0%, var(--warm-accent) 100%); }
.stat-bar.desire.locked .bar-fill { background: #3a2a20; }
.stat-detail-label { display: inline-block; font-size: 0.82em; font-weight: 600; color: #c0805a; margin-top: 6px; margin-right: 4px; }

/* ========================================================= */
/* ===== 9. 时间/场景信息头 ===== */
/* ========================================================= */
.time-header {
  background: linear-gradient(135deg, #3a2820 0%, #4a3228 40%, #3a2820 100%);
  border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 20px;
  color: #ece4dc; box-shadow: 0 4px 20px rgba(30,20,15,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(255,255,255,0.04) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.time-row-main { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.time-icon { font-size: 1.6em; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); }
.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-family: 'Georgia', 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  font-size: 0.92em; font-weight: 600; letter-spacing: 0.5px;
  padding: 4px 12px; border-radius: 20px; border: 1px solid #d8c0a8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); margin-left: 4px;
}
.time-row-loc { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 0.9em; }
.time-loc-icon { font-size: 1em; }
.time-loc-text { color: #c0b0a4; letter-spacing: 0.5px; }
.time-row-weather { display: flex; align-items: center; gap: 6px; font-size: 0.85em; }
.time-weather-icon { font-size: 1em; }
.time-weather-text { color: #a09084; }
.time-row-surroundings { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.85em; }
.time-surroundings-icon { font-size: 1em; }
.time-surroundings-text { color: #a09084; letter-spacing: 0.5px; font-style: italic; }
.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-icon { font-size: 1em; }
.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.xiaojuan { color: #d4a090; background: rgba(212,144,106,0.15); }

/* ========================================================= */
/* ===== 10. 正文容器 ===== */
/* ========================================================= */
.narrative-p { text-indent: 2em; line-height: 1.9; margin: 0.8em 0; }
.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);
}

/* ========================================================= */
/* ===== 11. 内心独白 ===== */
/* ========================================================= */
.inner-monologue {
  font-style: italic; color: #7a6050;
  background: linear-gradient(135deg, var(--warm-surface) 0%, var(--warm-surface2) 100%);
  border-left: 3px solid #d4a858; 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;
}

/* ========================================================= */
/* ===== 12. 预算迷你条 ===== */
/* ========================================================= */
.budget-mini {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 0 0; padding: 8px 14px;
  background: linear-gradient(135deg, #f0e8e0 0%, #e8e0d8 100%);
  border-radius: var(--radius-md); border: 1px solid #d8d0c8;
}
.budget-mini-label { font-size: 0.82em; font-weight: 700; color: #8a6040; white-space: nowrap; }
.budget-mini-bar { flex: 1; height: 8px; background: #d8d0c8; border-radius: 999px; overflow: hidden; }
.budget-mini-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #e8b080 0%, var(--warm-accent) 100%);
  transition: width 0.5s ease;
}
.budget-mini-num { font-size: 0.82em; font-weight: 700; color: var(--warm-accent); white-space: nowrap; }

/* ========================================================= */
/* ===== 13. 插图组件 ===== */
/* ========================================================= */
.scene-illustration {
  width: 100%; max-width: 420px; margin: 18px auto;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(30,20,10,0.18);
  border: 2px solid #d4c0a8; background: var(--warm-surface); text-align: center;
}
.scene-illustration img { width: 100%; height: auto; display: block; object-fit: cover; }
.scene-caption {
  display: block; padding: 8px 14px; font-size: 0.82em; font-weight: 600;
  color: #8d6e5a; background: linear-gradient(180deg, var(--warm-surface) 0%, #f0e4d8 100%);
  letter-spacing: 0.5px; border-top: 1px solid var(--warm-border);
}

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

/* ========================================================= */
/* ===== 15. 选项面板（轻量卡片） ===== */
/* ========================================================= */
.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-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.choice-icon { font-size: 1.2em; }
.choice-title { font-size: 0.95em; font-weight: 700; color: #6a4a30; letter-spacing: 1px; }
.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 #e8ddd0; border-radius: 8px;
  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: #d4a060;
  box-shadow: 0 2px 8px rgba(180,120,60,0.10);
}
.choice-card[data-choice="1"] { border-left: 4px solid #e8a090; }
.choice-card[data-choice="2"] { border-left: 4px solid #a0c0e0; }
.choice-card[data-choice="3"] { border-left: 4px solid #a0d0a0; }
.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: #d88878; }
.choice-card[data-choice="2"] .choice-label { background: #80a0c0; }
.choice-card[data-choice="3"] .choice-label { background: #70a880; }
.choice-text { font-size: 0.88em; color: #4a3e34; line-height: 1.5; }
.choice-card:hover .choice-text { color: #2a1f0e; }
.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;
}

/* ========================================================= */
/* ===== 16. 微信聊天气泡 ===== */
/* ========================================================= */
details.wechat-details {
  background: transparent; border: none; border-left: none;
  box-shadow: none; margin-bottom: 14px;
}
details.wechat-details[open] { box-shadow: none; border-color: transparent; }
details.wechat-details:hover { border-left-color: transparent; }
details.wechat-details > summary {
  display: flex; align-items: center; gap: 8px; list-style: none;
  cursor: pointer; position: relative;
  background: linear-gradient(180deg, #d48a4a 0%, #b8703a 100%);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 12px 18px; font-weight: 600; letter-spacing: 0.5px; color: #fff;
  font-style: normal; font-size: 1em; width: 100%; box-sizing: border-box;
  border-left: none; text-align: left; user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
details.wechat-details > summary::before { content: "💬"; font-size: 1em; text-shadow: none; }
details.wechat-details > summary::after {
  content: "▾"; font-size: 0.7em; color: rgba(255,255,255,0.75);
  text-shadow: none; margin-left: auto; transition: transform 0.2s ease;
}
details.wechat-details[open] > summary { border-radius: var(--radius-md) var(--radius-md) 0 0; }
details.wechat-details[open] > summary::after { transform: rotate(180deg); }
details.wechat-details > summary:hover {
  background: linear-gradient(180deg, #e09858 0%, #c88044 100%);
  color: #fff; border-left: none; padding-right: 18px;
}
details.wechat-details > summary:hover::after { color: #fff; }
details.wechat-details > summary::-webkit-details-marker { display: none; }
details.wechat-details > summary::marker { display: none; content: ""; }
.wechat-body {
  background: #ededed !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  border: 1px solid #d0d0d0 !important; border-top: none !important;
  padding: 0 !important; color: #333 !important;
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  overflow: hidden;
}
.wechat-chat-section { display: block; }
.wechat-chat-header {
  text-align: center; font-size: 0.75em; color: #888;
  padding: 10px 0 6px 0; background: #f6f6f6;
  border-bottom: 1px solid #e0e0e0; letter-spacing: 0.5px;
}
.wechat-chat-divider {
  height: 6px; background: #d9d9d9;
  border-top: 1px solid #c0c0c0; border-bottom: 1px solid #c0c0c0;
}
.wechat-msg-list {
  padding: 10px 14px 14px 14px; display: flex;
  flex-direction: column; gap: 8px; background: #ededed;
}
.wechat-msg { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.wechat-msg.left { flex-direction: row; }
.wechat-msg.right { flex-direction: row-reverse; }
.wechat-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; display: flex; align-items: center;
  justify-content: center; font-size: 0.75em; font-weight: 600;
}
.wechat-bubble {
  background: #fff; padding: 8px 12px; border-radius: 3px 10px 10px 10px;
  font-size: 0.82em; color: #333; line-height: 1.5;
  word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.wechat-msg.right .wechat-bubble { border-radius: 10px 3px 10px 10px; }
.wechat-bubble.self { background: #95ec69; }

/* ========================================================= */
/* ===== 17. 思维链 & 记忆备注 & 记忆汇总 ===== */
/* ========================================================= */
.cot-exec-content { font-size: 0.82em; color: #b0a898; line-height: 1.6; white-space: pre-wrap; }
.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-summary {
  background: var(--dark-surface2); border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm); padding: 0; overflow: hidden;
}
.memory-summary-header {
  background: #0e0c0a; border-bottom: 1px solid var(--dark-border);
  padding: 12px 18px; display: flex; align-items: center; gap: 8px;
  font-family: 'Courier New', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.memory-summary-icon { font-size: 1.1em; }
.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: #0e0c0a; 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', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

/* ========================================================= */
/* ===== 18. 信息行 ===== */
/* ========================================================= */
.info-line { display: block; width: 100%; margin: 6px 0; line-height: 1.6; }
.info-line .stat-detail-label { display: inline; margin-right: 4px; }
.info-line.note { color: #8880a0; font-size: 0.9em; font-style: italic; }

/* ========================================================= */
/* ===== 19. 暗色覆盖规则 ===== */
/* ========================================================= */
.details-body .stat-bar .stat-label { color: #e8dcd4 !important; }
.details-body .stat-bar .stat-label span { color: #a89080 !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: var(--dark-accent) !important; }
.details-body .budget-mini {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #221c18 100%) !important;
  border-color: var(--dark-border) !important;
}
.details-body .budget-mini-label { color: #a89080 !important; }
.details-body .budget-mini-bar { background: var(--dark-border) !important; }
.details-body .budget-mini-num { color: #e8b080 !important; }
.details-body .unlock-notice {
  background: linear-gradient(135deg, var(--dark-surface) 0%, #2a1e18 100%) !important;
  border-color: #d4a060 !important; color: #e8d0b8 !important;
}
.details-body .unlock-text strong { color: #f0c080 !important; }

/* === 面板内显式覆盖：把暗色规则打回亮色 === */
.panel-body .stat-bar .stat-label { color: #2a1e18 !important; }
.panel-body .stat-bar .stat-label span { color: #6a5a50 !important; }
.panel-body .bar-track { background: #e2d8d0 !important; box-shadow: inset 0 1px 3px rgba(0,0,0,0.10) !important; }
.panel-body .stat-detail-label { color: #c0805a !important; }
.panel-body .budget-mini {
  background: linear-gradient(135deg, #f0e8e0 0%, #e8e0d8 100%) !important;
  border-color: #d8d0c8 !important;
}
.panel-body .budget-mini-label { color: #8a6040 !important; }
.panel-body .budget-mini-bar { background: #d8d0c8 !important; }
.panel-body .budget-mini-num { color: var(--warm-accent) !important; }

/* 暗色内的微信 */
.details-body.wechat-body { background: #ededed !important; color: #333 !important; border-color: #d0d0d0 !important; }
.details-body .wechat-chat-header { color: #888 !important; background: #f6f6f6 !important; }
.details-body .wechat-msg-list { background: #ededed !important; }
.details-body .wechat-bubble { color: #333 !important; background: #fff !important; }
.details-body .wechat-bubble.self { background: #95ec69 !important; }

/* ========================================================= */
/* ===== 20. 溢出/换行保护 ===== */
/* ========================================================= */
details, details > * { word-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; white-space: normal; max-width: 100%; }
.stat-panel, .stat-block, .stat-row { max-width: 100%; word-wrap: break-word; overflow-wrap: anywhere; }
.stat-label, .stat-label span, .stat-detail-label { word-wrap: break-word; overflow-wrap: anywhere; 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; }

/* ========================================================= */
/* ===== 21. 移动端适配 ===== */
/* ========================================================= */
@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; }

  .contrast-grid { grid-template-columns: 1fr; }

  .time-header { padding: 12px 14px; }
  .time-row-main { flex-wrap: wrap; gap: 4px; }
  .time-day { font-size: 1.2em; }
  .time-period { font-size: 1em; }
  .time-clock { font-size: 0.82em; padding: 3px 10px; }
  .time-row-budget { gap: 6px; flex-wrap: wrap; }

  .khorra-output { padding: 12px 14px; }
  .narrative-p { text-indent: 1.5em; }

  .dialogue-box, .dialogue-box[data-role] { margin-left: 0 !important; margin-right: 0 !important; padding: 10px 14px !important; }

  .player-name-row { flex-wrap: wrap; }
  .player-tags { gap: 4px; }
  .player-tag { font-size: 0.75em; padding: 3px 8px; }

  .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; }

  .wechat-msg-list { padding: 8px 10px; }
  .wechat-avatar { width: 30px; height: 30px; }
  .wechat-bubble { font-size: 0.78em; }

  .budget-mini { gap: 6px; padding: 6px 10px; }
  .budget-mini-label { font-size: 0.75em; }
  .unlock-notice { padding: 10px 14px; font-size: 0.85em; }

  .scene-illustration { max-width: 100%; }
  .scene-caption { font-size: 0.75em; padding: 6px 10px; }

  .memory-summary-body { padding: 12px; font-size: 0.82em; }
  .memory-summary-footer { flex-direction: column; gap: 4px; text-align: center; }

  .id-grid { flex-direction: column; gap: 14px; }
  .id-photo { width: 100%; height: 120px; }
  .stats-grid { grid-template-columns: 1fr; }
  .phase-grid { grid-template-columns: repeat(3, 1fr); }
}

@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; }
  .phase-grid { grid-template-columns: repeat(2, 1fr); }
  .khorra-output { padding: 10px 10px; }
  .time-header { padding: 10px 12px; }
  .xj-portrait-caption { font-size: 0.7em; }
}
/* ========================================================= */
/* ===== 22. 合同条目面板 ===== */
/* ========================================================= */
.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 #d8c8a8;
}
.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: 'Courier New', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  background: #d4906a;
  color: #fff;
}
.clause-body {
  flex: 1;
  min-width: 0;
}
.clause-title {
  font-size: 0.85em;
  font-weight: 700;
  color: #3a2a20;
  margin-bottom: 2px;
}
.clause-detail {
  font-size: 0.78em;
  color: #6a5a4e;
  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(212,144,106,0.12);
  color: #d4906a;
  white-space: nowrap;
}
.clause-tag.hard {
  background: rgba(212,133,122,0.12);
  color: #d4857a;
}
.clause-tag.player {
  background: rgba(192,144,106,0.12);
  color: #c0906a;
}
.clause-tag.story {
  background: rgba(160,180,140,0.12);
  color: #8a9a6a;
}

/* 新增条款通知 */
.contract-new-notice {
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef8ec 0%, #faf0dc 100%);
  border: 1px dashed #d4a060;
  border-radius: 6px;
  font-size: 0.82em;
  font-weight: 600;
  color: #a06030;
  text-align: center;
  letter-spacing: 0.5px;
}
/* ========================================================= */
/* ===== 23. 后置词减耗：固定UI文本→CSS伪元素 ===== */
/* ========================================================= */

/* --- 时间头图标 --- */
.time-row-main::before { content:"📅"; font-size:1.6em; filter:drop-shadow(0 2px 3px rgba(0,0,0,0.3)); margin-right:4px; }
.time-row-loc::before { content:"📍"; margin-right:2px; }
.time-row-weather::before { content:"🌤️"; margin-right:2px; }
.time-row-budget::before { content:"📋"; margin-right:4px; }

/* --- 玩家面板 --- */
.player-badge::before { content:"大一新生"; }
.player-section.anchor::before { content:"性格锚点"; display:block; font-size:0.72em; font-weight:700; color:#a09080; letter-spacing:1px; text-transform:uppercase; margin-bottom:4px; }
.player-section.look::before { content:"外貌特征"; display:block; font-size:0.72em; font-weight:700; color:#a09080; letter-spacing:1px; text-transform:uppercase; margin-bottom:4px; }
.player-section.note::before { content:"特殊备注"; display:block; font-size:0.72em; font-weight:700; color:#a09080; letter-spacing:1px; text-transform:uppercase; margin-bottom:4px; }

/* --- 田小娟面板 --- */
.xj-section.char::before { content:"性格"; display:block; font-size:0.72em; font-weight:700; color:#a09080; letter-spacing:1px; text-transform:uppercase; margin-bottom:4px; }
.xj-section.outfit::before { content:"今日着装"; display:block; font-size:0.72em; font-weight:700; color:#a09080; letter-spacing:1px; text-transform:uppercase; margin-bottom:4px; }
.xj-inner-thoughts::before { content:"💭 内心想法"; display:block; font-size:0.75em; font-weight:700; color:#b08050; letter-spacing:0.5px; margin-bottom:4px; }
.xj-next-action::before { content:"➤ 下一步"; font-size:0.78em; font-weight:700; color:#a06030; letter-spacing:0.5px; text-transform:uppercase; flex-shrink:0; margin-right:8px; }

/* --- 状态条label --- */
.stat-bar.trust .stat-label span:first-child::before { content:"❤️ 好感度"; }
.stat-bar.desire .stat-label span:first-child::before { content:"🔗 服从度"; }
.budget-mini-label::before { content:"📋 本周命令"; }

/* --- 记忆面板 --- */
.mem-block:nth-child(1) .mem-block-title::before { content:"📝 短期记忆 STM("; }
.mem-block:nth-child(1) .mem-block-title::after { content:")"; }
.mem-block:nth-child(2) .mem-block-title::before { content:"📦 长期记忆 LTM("; }
.mem-block:nth-child(2) .mem-block-title::after { content:")"; }

/* --- 反差面板 --- */
.cold-col .contrast-col-header::before { content:"❄️ 对你的态度"; }
.warm-col .contrast-col-header::before { content:"🔥 实际做的事"; }
.social-col .contrast-col-header::before { content:"💬 和朋友在一起时"; }
.cc-line:nth-child(odd)::before { content:"友："; font-weight:700; color:#7a7a8a; flex-shrink:0; min-width:28px; font-size:0.9em; }
.cc-line:nth-child(even)::before { content:"娟："; font-weight:700; color:#d4906a; flex-shrink:0; min-width:28px; font-size:0.9em; }
.contrast-verdict::before { content:"📌 观测结论："; font-weight:700; color:#a06030; }

/* --- 合同面板 --- */
.contract-new-notice::before { content:"📜 新条款已录入合同，不可撤销。"; }

/* --- 选项面板 --- */
.choice-header::before { content:"📌 接下来…"; font-size:0.95em; font-weight:700; color:#6a4a30; letter-spacing:1px; }
.choice-card:nth-child(1) .choice-label::before { content:"选项A"; }
.choice-card:nth-child(2) .choice-label::before { content:"选项B"; }
.choice-card:nth-child(3) .choice-label::before { content:"选项C"; }
.choice-note::before { content:"选一个，或者做点别的——她都在看着你。"; }

/* ========================================================= */
/* ===== 24. 记忆表格 ===== */
/* ========================================================= */
.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; }
/* ── 正文首行缩进 ── */
.khorra-output p,
.khorra-output .narrative-p {
  text-indent: 2em;
  margin: 0.8em 0;
  line-height: 1.9;
}
.khorra-output p:first-child,
.khorra-output .narrative-p:first-child {
  text-indent: 0;
}
/* ── 正文对话颜色 ── */
.dialogue {
  display: inline;
  padding: 1px 4px;
  border-radius: 2px;
}
.dialogue.xj {
  color: #b05040;
  background: rgba(212,133,122,0.08);
}
.dialogue.user {
  color: #b07040;
  background: rgba(192,144,106,0.08);
}

/* ── 正文首行缩进 ── */
.khorra-output p,
.khorra-output .narrative-p {
  text-indent: 2em;
  margin: 0.8em 0;
  line-height: 1.9;
}
.khorra-output p:first-child,
.khorra-output .narrative-p:first-child {
  text-indent: 0;
}

