/* =========================================================
   explore.css — 探索玩法 / 彩蛋 / 三栏诊断面板
   配色口径：青（感知）· 白（事实）· 金（彩蛋线索）
   禁止使用战斗的红色告警样式，避免"一发现就是敌人"的误读。
   ========================================================= */

.ex-root {
  /* 探索侧专用色板：刻意与战斗侧红色告警区分开 */
  --ex-cyan: #38e1d0;
  --ex-cyan-dim: rgba(56, 225, 208, .16);
  --ex-gold: #d8b26a;
  --ex-gold-dim: rgba(216, 178, 106, .16);
  --ex-white: #eef4f7;
  --ex-txt-dim: #9fb3bd;
  --ex-glass: rgba(16, 26, 30, .78);
  --ex-stroke: rgba(150, 220, 225, .16);
  --ex-stroke-2: rgba(150, 220, 225, .32);
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ex-white);
}

.ex-root button { font-family: inherit; }

/* ------------------------------------------------------------
   交互提示（屏幕中下部，绝不压住角色）
   ------------------------------------------------------------ */
.ex-hint {
  position: absolute;
  left: 50%;
  bottom: 64px;
  transform: translate(-50%, 8px);
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: min(620px, 74vw);
  padding: 8px 15px 8px 9px;
  border-radius: 13px;
  background: var(--ex-glass);
  border: 1px solid var(--ex-stroke-2);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45), 0 0 0 1px rgba(56, 225, 208, .08);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.ex-hint.show { opacity: 1; transform: translate(-50%, 0); }

/* 展开探索日志时，提示条上移，避免压住日志 */
.ex-root.ex-log-open .ex-hint { bottom: calc(40vh + 74px); }

.ex-hint-ring { position: relative; width: 40px; height: 40px; flex: none; }
.ex-hint-ring svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.ex-ring-bg { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 3; }
.ex-ring-fg {
  fill: none;
  stroke: var(--ex-cyan);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 113.1;
  transition: stroke-dashoffset .08s linear;
}
.ex-ring-key {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ex-cyan);
  text-transform: uppercase;
}
.ex-hint-main { min-width: 0; }
.ex-hint-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--ex-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-hint-sub {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ex-txt-dim);
}
.ex-hint-sub::before { content: "▸ "; color: var(--ex-cyan); }

/* ------------------------------------------------------------
   扫描诊断卡片
   ------------------------------------------------------------ */
.ex-scan {
  position: absolute;
  left: 50%;
  bottom: 128px;
  transform: translate(-50%, 10px);
  width: min(560px, 70vw);
  padding: 11px 13px 12px;
  border-radius: 13px;
  background: var(--ex-glass);
  border: 1px solid var(--ex-stroke-2);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .5);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease;
}
.ex-scan.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.ex-scan-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 9px;
}
.ex-scan-head b { font-size: 11.5px; letter-spacing: 2px; color: var(--ex-cyan); }
.ex-scan-target { font-size: 11px; color: var(--ex-txt-dim); }

.ex-chan {
  display: grid;
  grid-template-columns: 74px 1fr 52px;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  border-top: 1px solid rgba(150, 220, 225, .1);
  font-size: 10.5px;
}
.ex-chan-name { color: var(--ex-white); letter-spacing: .5px; }
.ex-chan-note { color: var(--ex-txt-dim); line-height: 1.45; }
.ex-chan-state { text-align: right; font-size: 9.5px; letter-spacing: .5px; color: var(--ex-txt-dim); }
.ex-chan.active .ex-chan-name { color: var(--ex-cyan); }
.ex-chan.active .ex-chan-state { color: var(--ex-cyan); }
.ex-chan.active .ex-chan-note { color: var(--ex-white); }
.ex-chan.done .ex-chan-state { color: #8ef0b0; }
.ex-chan.missing .ex-chan-state { color: var(--ex-gold); }
.ex-chan.missing .ex-chan-note { color: rgba(216, 178, 106, .78); }
.ex-scan-foot {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(150, 220, 225, .1);
  font-size: 9.5px;
  line-height: 1.55;
  color: rgba(159, 179, 189, .78);
}

/* ------------------------------------------------------------
   探索日志面板（右下操作条上方，默认收起成一条）
   ------------------------------------------------------------ */
.ex-log {
  position: absolute;
  right: 28px;
  bottom: 84px;
  width: min(460px, calc(100vw - 360px));
  border-radius: 13px;
  background: var(--ex-glass);
  border: 1px solid var(--ex-stroke);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .42);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  overflow: hidden;
  pointer-events: auto;
}
.ex-log-bar {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  user-select: none;
}
.ex-log-bar b { font-size: 11px; font-weight: 600; letter-spacing: 2px; color: var(--ex-cyan); }
.ex-log-count {
  font-size: 10.5px;
  color: var(--ex-txt-dim);
  font-variant-numeric: tabular-nums;
}
.ex-log-caret { margin-left: auto; font-size: 11px; color: var(--ex-txt-dim); transition: transform .2s ease; }
.ex-log-body { max-height: 0; overflow-y: auto; transition: max-height .25s ease; }
.ex-log.open .ex-log-body { max-height: 40vh; }
.ex-log-list { padding: 2px 14px 12px; }
.ex-log-list::-webkit-scrollbar { width: 5px; }
.ex-log-list::-webkit-scrollbar-thumb { background: rgba(150, 220, 225, .2); border-radius: 5px; }

.ex-log-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 9px;
  padding: 6px 0;
  border-top: 1px solid rgba(150, 220, 225, .09);
  font-size: 11px;
}
.ex-log-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ex-cyan); align-self: center; }
.ex-log-item.easter .ex-log-dot { background: var(--ex-gold); }
.ex-log-name { color: var(--ex-white); font-weight: 600; }
.ex-log-item.easter .ex-log-name { color: #f0dcae; }
.ex-log-where { font-size: 10px; color: var(--ex-txt-dim); }
.ex-log-reward {
  grid-column: 2 / 4;
  font-size: 10px;
  color: rgba(159, 179, 189, .85);
}
.ex-log-empty {
  padding: 10px 0 4px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ex-txt-dim);
}

/* ------------------------------------------------------------
   三栏诊断面板（右侧抽屉：观察事实 / 候选原因 / 验证方法）
   ------------------------------------------------------------ */
.ex-diag {
  position: absolute;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: min(660px, 46vw);
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  background: rgba(13, 22, 26, .9);
  border: 1px solid var(--ex-stroke-2);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  visibility: hidden;
  transform: translateX(14px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: auto;
  overflow: hidden;
}
.ex-diag.show { opacity: 1; visibility: visible; transform: translateX(0); }

.ex-diag-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--ex-stroke);
}
.ex-diag-head b { font-size: 11.5px; letter-spacing: 2px; color: var(--ex-cyan); }
.ex-diag-target {
  font-size: 11px;
  color: var(--ex-txt-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-diag-close, .ex-tl-close {
  margin-left: auto;
  width: 24px; height: 24px;
  flex: none;
  border: none;
  border-radius: 7px;
  background: rgba(255, 255, 255, .07);
  color: var(--ex-white);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ex-diag-close:hover, .ex-tl-close:hover { background: rgba(255, 255, 255, .16); }

.ex-diag-cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: 1px;
  background: var(--ex-stroke);
  overflow: hidden;
}
.ex-col {
  min-width: 0;
  padding: 12px 12px 14px;
  background: rgba(11, 19, 23, .96);
  overflow-y: auto;
}
.ex-col::-webkit-scrollbar { width: 5px; }
.ex-col::-webkit-scrollbar-thumb { background: rgba(150, 220, 225, .2); border-radius: 5px; }
.ex-col h4 {
  margin: 0 0 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--ex-txt-dim);
  display: flex;
  align-items: center;
  gap: 7px;
}
.ex-col h4::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--ex-stroke), transparent); }
.ex-col-causes h4 { color: #a8ded6; }
.ex-col-methods h4 { color: #d8c49a; }

/* 观察事实 */
.ex-fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  margin-bottom: 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(150, 220, 225, .1);
}
.ex-fact-src { font-size: 9px; letter-spacing: .8px; color: var(--ex-cyan); opacity: .85; }
.ex-fact-text { font-size: 10.5px; line-height: 1.6; color: var(--ex-white); }
.ex-outcome {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px dashed rgba(216, 178, 106, .42);
  background: var(--ex-gold-dim);
  font-size: 10.5px;
  line-height: 1.6;
  color: #f0dcae;
}

/* 候选原因 */
.ex-cause {
  padding: 8px 9px;
  margin-bottom: 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(150, 220, 225, .1);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.ex-cause:hover { background: rgba(56, 225, 208, .1); border-color: var(--ex-stroke-2); transform: translateX(-1px); }
.ex-cause-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ex-cause-top b { font-size: 11.5px; font-weight: 600; color: var(--ex-white); }
.ex-cause-conf {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ex-cyan);
}
.ex-cause-bar {
  height: 4px;
  margin: 6px 0 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.ex-cause-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #2fb9ab, var(--ex-cyan));
}
.ex-cause-why { font-size: 9.5px; line-height: 1.55; color: var(--ex-txt-dim); }

/* 验证方法 */
.ex-method {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  margin-bottom: 6px;
  border-radius: 9px;
  background: rgba(216, 178, 106, .07);
  border: 1px solid rgba(216, 178, 106, .16);
}
.ex-method b { font-size: 11px; font-weight: 600; color: #f0dcae; }
.ex-method span { font-size: 9.5px; line-height: 1.55; color: var(--ex-txt-dim); }

/* 证据卡 */
.ex-diag-ev {
  padding: 10px 14px 4px;
  border-top: 1px solid var(--ex-stroke);
}
.ex-diag-ev-title { font-size: 9.5px; letter-spacing: 1.2px; color: var(--ex-txt-dim); margin-bottom: 7px; }
.ex-ev-list { display: flex; flex-wrap: wrap; gap: 7px; }
.ex-ev {
  min-width: 150px;
  flex: 1 1 150px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(150, 220, 225, .14);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ex-ev:hover { background: rgba(56, 225, 208, .09); }
.ex-ev.sel { background: rgba(56, 225, 208, .16); border-color: var(--ex-cyan); }
.ex-ev b { display: block; font-size: 10.5px; font-weight: 600; color: var(--ex-white); margin-bottom: 2px; }
.ex-ev span { display: block; font-size: 9px; line-height: 1.45; color: var(--ex-txt-dim); }
.ex-ev-empty { font-size: 10px; color: var(--ex-txt-dim); padding: 3px 0 7px; }

.ex-diag-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--ex-stroke);
}
.ex-diag-msg { font-size: 10px; line-height: 1.5; color: var(--ex-txt-dim); flex: 1; }
.ex-diag-msg.ok { color: #8ef0b0; }
.ex-diag-msg.pending { color: #f0dcae; }
.ex-diag-msg.bad { color: #ffcf8a; }
.ex-btn {
  flex: none;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--ex-stroke-2);
  background: linear-gradient(140deg, rgba(56, 225, 208, .22), rgba(56, 225, 208, .07));
  color: var(--ex-white);
  font-size: 11px;
  letter-spacing: .6px;
  cursor: pointer;
  transition: filter .15s, transform .12s;
}
.ex-btn:hover { filter: brightness(1.18); transform: translateY(-1px); }

/* 证据 → 原因 的 SVG 连线 */
.ex-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.ex-link-line {
  stroke: var(--ex-cyan);
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
  opacity: .85;
}

/* ------------------------------------------------------------
   复盘回放时间轴（Tab）
   ------------------------------------------------------------ */
.ex-timeline {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-height: 40vh;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  background: rgba(13, 22, 26, .9);
  border: 1px solid var(--ex-stroke-2);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: auto;
  overflow: hidden;
}
.ex-timeline.show { opacity: 1; visibility: visible; transform: translateY(0); }
.ex-tl-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--ex-stroke);
}
.ex-tl-head b { font-size: 11.5px; letter-spacing: 2px; color: var(--ex-cyan); }
.ex-tl-sub { font-size: 10px; color: var(--ex-txt-dim); }
.ex-tl-body { padding: 10px 14px 14px; overflow-y: auto; }
.ex-tl-body::-webkit-scrollbar { width: 5px; }
.ex-tl-body::-webkit-scrollbar-thumb { background: rgba(150, 220, 225, .2); border-radius: 5px; }
.ex-tl-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 7px 0;
  border-top: 1px solid rgba(150, 220, 225, .09);
  font-size: 10.5px;
}
.ex-tl-row:first-child { border-top: none; }
.ex-tl-time { font-variant-numeric: tabular-nums; color: var(--ex-cyan); }
.ex-tl-label { color: var(--ex-white); font-weight: 600; }
.ex-tl-label i { font-style: normal; font-weight: 400; font-size: 9.5px; color: var(--ex-txt-dim); margin-left: 6px; }
.ex-tl-cmp { grid-column: 2; font-size: 9.5px; line-height: 1.55; color: var(--ex-txt-dim); }
.ex-tl-cmp em { font-style: normal; color: rgba(159, 179, 189, .7); margin-right: 5px; }
.ex-tl-empty { font-size: 10.5px; color: var(--ex-txt-dim); }

/* ------------------------------------------------------------
   独立提示（没有 app.toast 时的兜底）
   ------------------------------------------------------------ */
.ex-toasts {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  pointer-events: none;
}
.ex-toast {
  max-width: min(560px, 70vw);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ex-white);
  background: rgba(16, 26, 30, .9);
  border: 1px solid var(--ex-stroke-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  transition: opacity .35s ease, transform .35s ease;
}
.ex-toast.good { border-color: rgba(140, 240, 176, .42); color: #cdf6dc; }
.ex-toast.warn { border-color: rgba(216, 178, 106, .46); color: #f0dcae; }
.ex-toast.info { border-color: var(--ex-stroke-2); }
.ex-toast.out { opacity: 0; transform: translateY(-8px); }

/* ------------------------------------------------------------
   窄屏适配：面板改为整宽，三栏改单列堆叠
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .ex-diag { left: 16px; right: 16px; width: auto; top: 64px; bottom: 120px; }
  .ex-diag-cols { grid-template-columns: 1fr; grid-auto-rows: min-content; overflow-y: auto; }
  .ex-col { overflow: visible; }
  .ex-root.ex-log-open .ex-hint { bottom: 46vh; }
}
@media (max-width: 800px) {
  .ex-log { right: 16px; width: min(380px, calc(100vw - 196px)); bottom: 128px; }
  .ex-log.open { width: calc(100vw - 32px); }
}
