/* =================================================================
   builtInCss · 合租女室友 · 深夜档案纸风 · 通用无容器
   -----------------------------------------------------------------
   适用：无固定回答容器的平台；选择器直接作用于运行时输出标签
   用途：平台运行时输出区样式（裁决块 / 分隔线 / 正文 / 面板 / 行动建议）
   配色：暖米白底 #f5f0e6 / 正文暗金 #8a6d3b / 深金 #6d5326 / 酒红 #a84a5e
         副文暖灰褐 #9c8f7d / 浅褐 #c9bdab / 面板底 #faf6ee
   字体：Noto Serif SC（正文）+ 等宽小字（裁决/标签）
   约束：≤3种字体 / 无绝对定位 / 不依赖 description DOM / 引擎术语零泄漏
   ================================================================= */

/* ---------- 0. 字体引入 + 变量根 ---------- */
/* 可选增强：目标平台确认可加载外部字体时再启用，避免离线/受限平台依赖外链。
   @import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;700&family=JetBrains+Mono:wght@400;500;700&display=swap');
*/

:root {
  --bg: #f5f0e6;
  --bg-2: #efe7d8;
  --gold: #8a6d3b;
  --gold-deep: #6d5326;
  --wine: #a84a5e;
  --line: rgba(138,109,59,.18);
  --line-hi: rgba(138,109,59,.45);
  --text: #8a6d3b;
  --muted: #9c8f7d;
  --dim: #c9bdab;
  --card: #faf6ee;
  --shadow: 0 10px 30px rgba(90,70,35,.12);
}

/* 运行时输出区整体氛围：暖米白档案纸，微光 */
body {
  background: radial-gradient(ellipse at 50% 0%, rgba(168,74,94,.05), transparent 55%),
              linear-gradient(180deg, #f5f0e6, #efe7d8);
  color: #8a6d3b;
  font-family: "Noto Serif SC", serif;
}

/* 通用过渡 */
.story,
details,
details summary,
.panel,
.panel summary,
.suggestions,
suggested_questions,
.suggested-questions,
.suggested_questions {
  transition: border-color .22s, background-color .22s, box-shadow .22s, opacity .22s, transform .22s;
}

/* ---------- 1. 正文 .story —— 深夜叙事质感 ---------- */
.story {
  padding: 26px 24px;
  font-size: 16px;
  line-height: 1.92;
  color: var(--text);
  letter-spacing: .3px;
  border-left: 1px solid rgba(138,109,59,.12);
  margin-left: 8px;
  animation: fadeInStory .6s ease both;
}

@keyframes fadeInStory {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.story p {
  margin: 0 0 15px;
  text-indent: 2em;
}

.story p:last-child {
  margin-bottom: 0;
}

/* 强调：深金 = 人名/关键名词 */
.story strong {
  color: var(--gold-deep);
  font-weight: 700;
}

/* 斜体：酒红 = 欲望/身体瞬间 */
.story em {
  color: var(--wine);
  font-style: italic;
  text-shadow: 0 0 8px rgba(168,74,94,.1);
}

/* 引文块 */
.story blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  background: rgba(138,109,59,.05);
  border-left: 3px solid rgba(138,109,59,.35);
  border-radius: 0 6px 6px 0;
  color: #7a6240;
  font-size: 15px;
  line-height: 1.75;
  font-style: italic;
}

/* 对话引用 */
.story q {
  color: var(--gold-deep);
  font-style: italic;
}

/* ---------- 2. 物理分隔线 —— 夜深交接 ---------- */
hr,
.separator {
  border: none;
  height: auto;
  margin: 32px 0;
  text-align: center;
  position: relative;
  overflow: visible;
}

/* 渐变深金横线 */
hr::before,
.separator::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(138,109,59,.2) 15%,
    rgba(138,109,59,.5) 50%,
    rgba(138,109,59,.2) 85%,
    transparent 100%
  );
  transform: translateY(-50%);
}

/* 中间文字：夜深 · 故事始 */
hr::after,
.separator::after {
  content: "夜深 · 故事始";
  position: relative;
  display: inline-block;
  padding: 0 18px;
  background: var(--bg);
  font-size: 11px;
  letter-spacing: .34em;
  color: rgba(138,109,59,.5);
  animation: fadeInLine .8s ease .2s both;
}

@keyframes fadeInLine {
  from { opacity: 0; letter-spacing: .5em; }
  to { opacity: 1; letter-spacing: .34em; }
}

/* ---------- 3. 裁决块 —— 深夜登记簿 ---------- */
details {
  margin: 8px 0;
  animation: fadeInDetails .5s ease both;
}

@keyframes fadeInDetails {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* summary：酒红指示灯 */
details summary {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(138,109,59,.6);
  cursor: pointer;
  padding: 8px 12px;
  position: relative;
  list-style: none;
  user-select: none;
  border-radius: 4px;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "●";
  display: inline-block;
  margin-right: 8px;
  font-size: 8px;
  color: rgba(168,74,94,.5);
  text-shadow: 0 0 6px rgba(168,74,94,.25);
  animation: pulseIndicator 2.6s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulseIndicator {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

details summary:hover {
  color: rgba(138,109,59,.9);
  background: rgba(138,109,59,.05);
}

details summary:hover::before {
  color: var(--wine);
  text-shadow: 0 0 10px rgba(168,74,94,.5);
}

/* 展开后的裁决内容：档案纸日志 */
details[open] {
  margin-bottom: 20px;
}

.judge[open] > .judge-body {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.75;
  color: rgba(138,109,59,.75);
  padding: 12px 16px;
  background: rgba(250,246,238,.9);
  border: 1px solid rgba(138,109,59,.16);
  border-top: none;
  border-radius: 0 0 6px 6px;
  margin-top: -2px;
}

.judge-body > .judge-line,
.judge-body > .judge-meta {
  margin: 6px 0;
  padding-left: 12px;
  border-left: 2px solid rgba(138,109,59,.2);
}

/* 裁决块内第一行（Scene 行）高亮：深金 */
.judge-body > :first-child {
  border-left-color: rgba(138,109,59,.5);
  color: rgba(109,83,38,.9);
}

/* ---------- 4. 状态面板 —— 档案卡 ---------- */
.panel {
  margin: 18px 0;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid rgba(138,109,59,.2);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.8;
  color: #7a6240;
  box-shadow:
    0 8px 24px rgba(90,70,35,.08),
    inset 0 1px 0 rgba(255,255,255,.6);
  animation: slideUpPanel .5s ease both;
}

@keyframes slideUpPanel {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.panel summary {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  margin-bottom: 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 4px 0;
}

.panel summary::-webkit-details-marker {
  display: none;
}

/* 主焦点 NPC 面板（👩）—— 酒红 */
.panel.npc summary {
  color: var(--wine);
  text-shadow: 0 0 10px rgba(168,74,94,.15);
}

/* 已登场索引（📋 roster）—— 深金 */
.panel.roster summary {
  color: var(--gold-deep);
  text-shadow: 0 0 10px rgba(109,83,38,.15);
}

/* 面板行：<p><b>标签：</b>值</p> */
.panel p {
  margin: 7px 0;
  line-height: 1.8;
  font-size: 13.5px;
  color: #7a6240;
}

.panel p b {
  color: var(--gold-deep);
  font-weight: 700;
  margin-right: 2px;
}

.panel p:hover {
  background: rgba(138,109,59,.04);
  border-radius: 4px;
  padding-left: 6px;
}

/* ---------- 5. 行动建议 —— 档案选项 ---------- */
suggested_questions, .suggested-questions, .suggested_questions, .suggestions {
  display: block;
  margin: 20px 0 8px;
  padding: 0;
  background: transparent;
  border: none;
  animation: slideUpPanel .5s ease .1s both;
  counter-reset: sug;
}

suggested_questions::before,
.suggested-questions::before,
.suggested_questions::before,
.suggestions::before {
  content: "下一步";
  display: block;
  font-size: 10px;
  letter-spacing: .3em;
  color: rgba(156,143,125,.7);
  margin-bottom: 10px;
  padding-left: 4px;
}

suggested_questions p,
suggested_questions button,
.suggested-questions p,
.suggested-questions button,
.suggested_questions p,
.suggested_questions button,
.suggestions p,
.suggestions button {
  position: relative;
  padding: 13px 16px 13px 46px;
  margin: 8px 0;
  background: rgba(250,246,238,.85);
  border: 1px solid rgba(138,109,59,.28);
  border-radius: 10px;
  color: #7a6240;
  font-size: 14px;
  line-height: 1.7;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  counter-increment: sug;
}

suggested_questions p::before,
suggested_questions button::before,
.suggested-questions p::before,
.suggested-questions button::before,
.suggested_questions p::before,
.suggested_questions button::before,
.suggestions p::before,
.suggestions button::before {
  content: "[" counter(sug, decimal-leading-zero) "]";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: rgba(156,143,125,.55);
  letter-spacing: .08em;
}

suggested_questions p:hover,
suggested_questions button:hover,
.suggested-questions p:hover,
.suggested-questions button:hover,
.suggested_questions p:hover,
.suggested_questions button:hover,
.suggestions p:hover,
.suggestions button:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: #f5f0e6;
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(90,70,35,.18),
    0 0 16px rgba(138,109,59,.15);
}

suggested_questions p:hover::before,
suggested_questions button:hover::before,
.suggested-questions p:hover::before,
.suggested-questions button:hover::before,
.suggested_questions p:hover::before,
.suggested_questions button:hover::before,
.suggestions p:hover::before,
.suggestions button:hover::before {
  color: rgba(245,240,230,.7);
}

/* ---------- 6. 通用元素补充 ---------- */
p {
  margin: 0 0 12px;
}

ul, ol {
  padding-left: 20px;
  margin: 10px 0;
}

li {
  margin: 5px 0;
  color: #7a6240;
}

/* 代码/等宽 */
code, pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  background: rgba(250,246,238,.9);
  border: 1px solid rgba(138,109,59,.18);
  border-radius: 4px;
  color: rgba(109,83,38,.9);
}

code {
  padding: 2px 6px;
}

pre {
  padding: 12px 16px;
  overflow-x: auto;
  margin: 12px 0;
}

/* 链接 */
a {
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid rgba(168,74,94,.3);
}

a:hover {
  color: var(--gold-deep);
  border-bottom-color: var(--gold-deep);
}

/* ---------- 7. 响应式 ---------- */
@media (max-width: 480px) {
  .story {
    padding: 16px 14px;
    font-size: 15px;
    line-height: 1.85;
    margin-left: 0;
    border-left: none;
  }

  .story p {
    text-indent: 1.5em;
  }

  .panel {
    padding: 14px 16px;
  }

  .panel summary {
    font-size: 12px;
    letter-spacing: .16em;
  }

  suggested_questions p,
  suggested_questions button,
  .suggested-questions p,
  .suggested-questions button,
  .suggested_questions p,
  .suggested_questions button,
  .suggestions p,
  .suggestions button {
    padding: 12px 14px 12px 42px;
    font-size: 13px;
  }

  suggested_questions p::before,
  suggested_questions button::before,
  .suggested-questions p::before,
  .suggested-questions button::before,
  .suggested_questions p::before,
  .suggested_questions button::before,
  .suggestions p::before,
  .suggestions button::before {
    font-size: 11px;
    left: 12px;
  }

  details summary {
    font-size: 10px;
    letter-spacing: .16em;
  }

  hr::after,
  .separator::after {
    font-size: 10px;
    letter-spacing: .3em;
    padding: 0 12px;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .story, .story *, details, details *, .panel, .panel *,
  .suggestions, .suggestions *, suggested_questions, suggested_questions *,
  .suggested-questions, .suggested-questions *, .suggested_questions, .suggested_questions * {
    animation: none !important;
    transition: none !important;
  }
}
