/* ==================================================================
   后日谈《灯塔》 · 独立样式（END/epilogue.css）
   由 index.html 在 style.css 之后引入；删除本文件 + epilogue.js
   即可让主游戏回到「没有后日谈」的状态。
   ================================================================== */
/* ==================== 后日谈 · 灯塔 ==================== */

/* 「读完邮件 → 点 X 关闭 → 黑屏进入下一步」的统一提示
   三处复用：任务目标面板常驻行 / 通知里的附加行 / 邮件正文底部 */
#objective-panel .op-hint {
  padding: 8px 14px; font-size: 11px; line-height: 1.6;
  color: #7a5000;
  background: rgba(255, 180, 84, 0.18);
  border-bottom: 1px solid var(--line);
}
#objective-panel .op-hint.hidden { display: none; }
.toast .t-hint {
  display: block; margin-top: 6px;
  font-size: 11.5px; line-height: 1.55; color: #ffd27a;
}
.epi-mail-tip {
  display: flex; align-items: flex-start; gap: 7px;
  /* 邮件很长时也要一直看得见：跟着阅读区滚动吸附在顶部 */
  position: sticky; top: -6px; z-index: 2;
  margin: 10px 0 14px; padding: 9px 12px;
  font-size: 12px; line-height: 1.65; color: #7a5000;
  background: #fbeed6;
  border-left: 3px solid #d99a2b;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.epi-mail-tip svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

#epilogue-screen {
  flex-direction: column; overflow-y: auto;
  /* 短幕（敲门/灯塔/终幕）垂直居中更像立绘卡；长幕（法庭）用 safe 回退到顶部，不会裁掉开头 */
  justify-content: center;
  justify-content: safe center;
  /* 顶部留出时间横幅的位置（横幅固定在 top:24，高约 45），否则小标会被压住 */
  padding: 92px 0 44px;
  background: rgba(12, 15, 22, 0.94);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: background .8s ease, backdrop-filter .8s ease, opacity .5s ease;
}
#epilogue-screen.closing { opacity: 0; }
/* 灰幕拍（第五拍）：桌面是浅色，文字必须换成深色才读得清 */
#epilogue-screen.grey { background: rgba(126, 133, 146, 0.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#epilogue-screen.grey .epi-line { color: #232c3a; }
#epilogue-screen.grey .epi-line.dim { color: #4a5566; }
#epilogue-screen.grey .epi-line.quote { color: #2f3a4a; }
#epilogue-screen.grey .epi-line.big { color: #141c28; }
#epilogue-screen.grey .epi-line.mid { color: #1c2532; }
#epilogue-screen.grey .epi-kicker { color: #3d5f92; }
#epilogue-screen.grey .epi-foot { color: #4d5766; }
.epi-inner { width: 620px; max-width: 92vw; text-align: center; }
.epi-kicker {
  font-size: 11px; letter-spacing: 5px; color: #7fb8ff; font-weight: 700;
  font-family: var(--mono); margin-bottom: 24px; text-transform: uppercase;
}
.epi-kicker:empty { display: none; }
.epi-lines { display: flex; flex-direction: column; gap: 13px; margin: 6px 0 26px; }
.epi-line { color: #dbe6f5; font-size: 15.5px; line-height: 2.1; animation: epi-in .6s ease-out both; }
.epi-line.dim { color: #8fa2ba; font-size: 13.5px; }
.epi-line.quote { color: #c9d6ea; font-style: italic; }
.epi-line.big { font-size: 32px; font-weight: 700; letter-spacing: 12px; color: #fff; padding: 8px 0; }
.epi-line.mid { font-size: 19px; letter-spacing: 2px; color: #eaf1fb; }
.epi-term {
  text-align: left; background: #0b0e14; border: 1px solid #22303f; border-radius: 12px;
  padding: 16px 18px; margin: 2px 0 18px;
}
.epi-term .epi-line { font-family: var(--mono); font-size: 12.5px; line-height: 2; color: #a8d8b8; }
.epi-term .epi-line.warn { color: #ffb27f; }
.epi-term .epi-line.bad { color: #ff8f8f; }
.epi-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 4px; min-height: 4px; }
.epi-actions .btn { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.06); color: #e8eefb; }
.epi-actions .btn:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.4); }
.epi-actions .btn.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); border-color: var(--accent); color: #fff; }
.epi-foot { font-size: 11px; color: #5f6f86; letter-spacing: .3px; margin-top: 32px; line-height: 1.75; }
@keyframes epi-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 红头公文 / 批注（邮件与弹层复用） */
.epi-doc { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.epi-doc-head {
  background: linear-gradient(90deg, #b02a2a, #e05353); color: #fff;
  padding: 11px 18px; font-size: 14px; font-weight: 700; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.epi-doc-head .edh-no { font-size: 11px; font-weight: 400; letter-spacing: 1px; font-family: var(--mono); color: #ffe0e0; }
.epi-doc-head.blue { background: linear-gradient(90deg, #1d4e89, #2f74c0); }
.epi-doc-head.blue .edh-no { color: #dcebfb; }
.epi-doc-body { padding: 18px 20px; font-size: 13.5px; line-height: 2.05; color: #2d3748; }
.epi-doc-body p { margin-bottom: 10px; }
.epi-doc-body .edb-title { font-size: 16px; font-weight: 700; color: #1a202c; letter-spacing: 1px; margin-bottom: 12px; }
.epi-doc-body .edb-sub { font-size: 12.5px; color: #718096; font-family: var(--mono); margin-bottom: 14px; }
.epi-doc-body .edb-list { padding-left: 2px; }
.epi-doc-body .edb-list p { margin-bottom: 8px; }
.epi-doc-body .edb-sign { text-align: right; color: #4a5568; font-size: 12.5px; margin-top: 14px; }
.epi-doc-body .edb-hr { height: 1px; background: var(--line); margin: 16px 0; }
.epi-note {
  margin-top: 14px; padding: 12px 15px; text-align: left;
  border-left: 3px solid var(--accent); border-radius: 8px;
  background: rgba(108, 92, 231, 0.07);
  font-size: 12.5px; line-height: 2; color: var(--text-secondary);
}
.epi-note .en-title { display: block; font-weight: 700; color: var(--accent); letter-spacing: 1px; margin-bottom: 6px; }
.epi-note p { margin-bottom: 4px; }
.mail-content.rich { white-space: normal; }
.mail-content.rich .epi-note { margin-top: 16px; }

/* 桌面右上角 · 监视居住执行告知书角标 */
#epi-house-arrest {
  position: fixed; top: 14px; right: 16px; z-index: 220;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: rgba(120, 128, 140, 0.85); color: #f2f5f9;
  border: 1px solid rgba(255,255,255,0.35);
  font-size: 11.5px; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  animation: eha-in .8s ease-out both;
}
#epi-house-arrest:hover { background: rgba(96, 104, 118, 0.95); }
#epi-house-arrest .eha-dot { width: 7px; height: 7px; border-radius: 50%; background: #ffd27f; box-shadow: 0 0 8px #ffd27f; animation: pulse 2s infinite; }
@keyframes eha-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
body.epi-dim .desktop-wallpaper { filter: brightness(0.62) saturate(0.5); transition: filter .9s ease; }

/* 后日谈期间：目标面板压在通知之上，确保「点击任务目标」可点 */
body.epi-active #objective-panel { z-index: 100000; }

/* 时间流逝 · 渐变黑过场（覆盖全部界面，含通知与目标面板） */
#epi-fade {
  position: fixed; inset: 0; z-index: 100060;
  background: #000; opacity: 0; pointer-events: none;
  transition: opacity .52s ease;
  will-change: opacity;
}
#epi-fade.on { opacity: 1; }
#epi-fade.red { background: rgba(112, 12, 12, .94); }
#epi-fade.flash { transition-duration: .14s; }
@media (prefers-reduced-motion: reduce) { #epi-fade { transition: none; } }

/* 演出幕打开时，通知区让位（移动端通知会压住法庭正文） */
#toast-area { transition: opacity .25s ease; }
body.epi-stage #toast-area { opacity: 0; pointer-events: none; }

/* 简介页 · 后日谈入口 */
.qr-epi {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px;
  border: 1px dashed var(--accent-light);
  background: rgba(108, 92, 231, 0.06);
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-secondary);
}
.qr-epi .qr-epi-tag { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .5px; }

@media (max-width: 760px) {
  .epi-inner { width: 94%; }
  .epi-line { font-size: 14.5px; }
  .epi-line.big { font-size: 26px; letter-spacing: 8px; }
  .epi-line.mid { font-size: 17px; }
  .epi-doc-body { padding: 15px 15px; font-size: 13px; }
  #epilogue-screen { padding: 80px 0 30px; }
  /* 右上角被任务目标面板占着：角标改到右侧居中，避免与面板重叠后被盖住 */
  #epi-house-arrest {
    top: 50%; right: 6px; left: auto;
    transform: translateY(-50%);
    animation: eha-in-m .8s ease-out both;
  }
  @keyframes eha-in-m { from { opacity: 0; transform: translate(10px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }
}

/* ===== 任务栏左侧的虚构声明（仅后日谈期间显示，主线不出现） =====
   由 END/epilogue.js 注入到 #taskbar 内，绝对定位贴左侧，
   不参与 flex 居中，所以不会推动「提示 / 开始」与窗口按钮。 */
#epi-disclaimer {
  position: absolute;
  left: 16px; top: 50%; transform: translateY(-50%);
  max-width: min(300px, calc(50% - 160px));
  font-size: 11px; line-height: 1.5; letter-spacing: .2px;
  color: rgba(88, 100, 120, 0.86);
  pointer-events: none; user-select: none; -webkit-user-select: none;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
/* 隐藏态必须写明：媒体查询里的 display 带 !important，会压过通用的 .hidden */
#epi-disclaimer.hidden { display: none !important; }

/* 窄屏（手机）：任务栏里塞不下，改成浮在任务栏上方的一行小提示条。
   相对 #taskbar 定位，所以在任何窗口之上；两行以内，宽度不超过屏幕。 */
@media (max-width: 900px) {
  #epi-disclaimer {
    display: -webkit-box !important;
    left: 50%; right: auto; top: auto;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    width: max-content; max-width: calc(100vw - 24px);
    padding: 3px 9px;
    text-align: center;
    font-size: 10px; line-height: 1.45; letter-spacing: 0;
    color: rgba(88, 100, 120, 0.92);
    background: rgba(244, 247, 252, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(31, 38, 55, 0.10);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    -webkit-line-clamp: 2;
  }
}
