/* ================= 故事线（分支树） ================= */
.sl {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(90% 70% at 78% 12%, rgba(255, 214, 140, .22), transparent 60%),
    radial-gradient(70% 60% at 12% 88%, rgba(120, 180, 150, .14), transparent 60%),
    linear-gradient(160deg, #0d1a1a 0%, #14231f 28%, #1d2419 54%, #33291a 76%, #4a3520 100%);
}
.sl::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 50%, rgba(6, 8, 6, .7) 100%);
}

.sl-header {
  position: absolute; top: 0; left: 0; right: 0; height: 62px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent);
  pointer-events: none;
}
.sl-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-title); font-size: 20px; letter-spacing: 4px; color: #ffeecb;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
}
.sl-title .seal {
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle, #ffd98a, #a9762f); display: grid; place-items: center;
  font-size: 11px; color: #3a2205;
}
.sl-legend { display: flex; gap: 16px; font-size: 11px; color: rgba(255, 240, 210, .72); }
.sl-legend span { display: flex; align-items: center; gap: 5px; }
.sl-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.sl-canvas { position: absolute; inset: 0; cursor: grab; }
.sl-canvas.dragging { cursor: grabbing; }
.sl-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.sl-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.sl-edge { fill: none; stroke: rgba(255, 226, 168, .5); stroke-width: 1.6; }
.sl-edge.dim { stroke: rgba(120, 140, 130, .35); stroke-dasharray: 4 5; }
.sl-edge.correct { stroke: rgba(127, 192, 138, .85); stroke-width: 2; }
.sl-edge.correct.dim { stroke: rgba(127, 192, 138, .4); }
.sl-edge.fail { stroke: rgba(224, 112, 95, .85); stroke-width: 2; stroke-dasharray: 6 4; }
.sl-edge.fail.dim { stroke: rgba(224, 112, 95, .4); }
.sl-edge.hot { stroke: #ffdd9c; stroke-width: 2.6; filter: drop-shadow(0 0 6px rgba(255, 200, 120, .8)); }

/* 播片节点卡 */
.sl-node {
  position: absolute; width: 176px; cursor: pointer; user-select: none;
}
.sl-node .frame {
  position: relative; height: 100px; border-radius: 8px; overflow: hidden;
  border: 2px solid rgba(255, 228, 170, .75);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 20px rgba(0, 0, 0, .4);
  background: #12100a center/cover no-repeat;
}
.sl-node .frame::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .55));
}
.sl-node .corner {
  position: absolute; z-index: 2; width: 12px; height: 12px; border: 2px solid rgba(255, 236, 190, .9);
}
.sl-node .c1 { left: 2px; top: 2px; border-right: 0; border-bottom: 0; }
.sl-node .c2 { right: 2px; top: 2px; border-left: 0; border-bottom: 0; }
.sl-node .c3 { left: 2px; bottom: 2px; border-right: 0; border-top: 0; }
.sl-node .c4 { right: 2px; bottom: 2px; border-left: 0; border-top: 0; }
.sl-node .plate {
  position: relative; margin: -14px auto 0; width: 150px;
  padding: 4px 8px 4px 22px; z-index: 3;
  background: linear-gradient(180deg, rgba(36, 60, 52, .95), rgba(14, 26, 22, .96));
  border: 1px solid rgba(255, 228, 170, .6); border-radius: 4px;
  font-family: var(--font-title); font-size: 13px; letter-spacing: 1px; color: #ffeecb;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.sl-node .plate::before {
  content: '▶'; position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
  font-size: 9px; color: var(--gold);
}
.sl-node:hover .frame { border-color: #fff0c8; box-shadow: 0 8px 26px rgba(0, 0, 0, .6), 0 0 22px rgba(255, 200, 120, .45); }
.sl-node:hover { transform: translateY(-2px); }
.sl-node.current .frame { border-color: #ffd98a; animation: nodePulse 1.8s infinite; }
@keyframes nodePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255, 210, 130, .6) } 50% { box-shadow: 0 0 0 10px rgba(255, 210, 130, 0) } }
.sl-node.selected .frame { border-color: #fff; }

/* 正确 / 失败分支节点区分：边框色 + 铭牌底色 + 角标 */
.sl-node.oc-correct .frame { border-color: rgba(127, 192, 138, .9); box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 20px rgba(30, 70, 40, .5); }
.sl-node.oc-correct .plate { background: linear-gradient(180deg, rgba(34, 74, 46, .95), rgba(12, 30, 18, .96)); border-color: rgba(127, 192, 138, .7); color: #d6f5dc; }
.sl-node.oc-correct .plate::before { content: '✓'; color: #9be3a6; }
.sl-node.oc-correct .corner { border-color: rgba(160, 230, 175, .9); }
.sl-node.oc-correct:hover .frame { border-color: #a9ecb6; box-shadow: 0 8px 26px rgba(0, 0, 0, .6), 0 0 22px rgba(120, 220, 140, .5); }

.sl-node.oc-fail .frame { border-color: rgba(224, 112, 95, .9); box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 20px rgba(80, 24, 18, .5); filter: grayscale(.25); }
.sl-node.oc-fail .plate { background: linear-gradient(180deg, rgba(80, 30, 24, .95), rgba(34, 12, 9, .96)); border-color: rgba(224, 112, 95, .7); color: #f4c8bf; }
.sl-node.oc-fail .plate::before { content: '✕'; color: #f0a89a; }
.sl-node.oc-fail .corner { border-color: rgba(240, 160, 145, .9); }
.sl-node.oc-fail:hover .frame { border-color: #f4b3a6; box-shadow: 0 8px 26px rgba(0, 0, 0, .6), 0 0 22px rgba(224, 112, 95, .5); filter: none; }

/* 未探索节点：小暗点 */
.sl-dot {
  position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, #26312c, #0d1512);
  border: 1px solid rgba(160, 180, 170, .35);
  cursor: help; display: grid; place-items: center;
  font-size: 10px; color: rgba(190, 205, 195, .6);
}
.sl-dot:hover { border-color: rgba(255, 228, 170, .7); color: var(--gold); }

/* 结局奖章 */
.sl-end { position: absolute; width: 110px; text-align: center; cursor: default; }
.sl-end .medal {
  width: 58px; height: 58px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  border: 2px solid rgba(255, 228, 170, .8);
  background: radial-gradient(circle, #3a2a12, #120c05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6), inset 0 0 14px rgba(255, 190, 100, .3);
  color: var(--gold);
  position: relative; overflow: hidden;
  background-size: cover; background-position: center;
}
.sl-end .medal span { position: relative; z-index: 2; text-shadow: 0 1px 4px #000; }
.sl-end .lbl { margin-top: 6px; font-size: 11px; letter-spacing: 1px; color: #ffeecb; }
.sl-end .nm { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.sl-end.locked .medal { border-color: rgba(150, 165, 158, .4); color: rgba(180, 195, 185, .55); filter: grayscale(1); }
.sl-end.locked .lbl { color: rgba(200, 210, 200, .5); }
.sl-end.fail .medal { border-color: rgba(224, 112, 95, .75); color: #f0a493; }
.sl-end.good .medal { border-color: #ffe0a0; box-shadow: 0 0 20px rgba(255, 200, 110, .5), inset 0 0 14px rgba(255, 190, 100, .35); }

/* 底部信息条 */
.sl-foot {
  position: absolute; left: 0; right: 0; bottom: 0; height: 76px; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent);
}
.sl-stats { font-size: 12px; line-height: 1.9; color: rgba(255, 240, 210, .8); }
.sl-stats b { color: var(--gold-2); }
.sl-bar { width: 220px; height: 4px; background: rgba(255, 255, 255, .14); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.sl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e8c37a, #ffd98a); }
.sl-foot-actions { display: flex; gap: 10px; align-items: center; }

/* 右侧详情面板 */
.sl-info {
  position: absolute; right: 0; top: 62px; bottom: 76px; width: 300px; z-index: 5;
  background: rgba(10, 16, 14, .9); border-left: 1px solid var(--line);
  padding: 16px; overflow: auto; transform: translateX(100%); transition: .25s;
  backdrop-filter: blur(6px);
}
.sl-info.show { transform: translateX(0); }
.sl-info h3 { font-family: var(--font-title); font-size: 16px; margin: 0 0 4px; color: var(--gold-2); letter-spacing: 2px; }
.sl-info .sub { font-size: 11px; color: var(--text-dim); margin-bottom: 12px; }
.sl-info .sec { font-size: 11px; letter-spacing: 2px; color: var(--gold); margin: 14px 0 6px; }
.sl-info .li {
  font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px;
  margin-bottom: 6px; color: var(--text); background: rgba(0, 0, 0, .25);
}
.sl-info .li .meta { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.sl-info .li.dim { color: var(--text-dim); border-style: dashed; }
.sl-info .li.oc-correct { border-left: 3px solid #7fc08a; }
.sl-info .li.oc-fail { border-left: 3px solid #e0705f; }
.sl-info .thumb { width: 100%; height: 150px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; background: #000; margin-bottom: 10px; }
.sl-info .x { float: right; cursor: pointer; color: var(--text-dim); }
.sl-info .x:hover { color: var(--gold); }
