/* css/worlds-embed.css — 三部曲页内嵌「三重世界」专用样式（作用域隔离版）
 *
 * 背景 (2026-11-07 用户令「把自然/人类/哲学世界的内容和导航都集成到三部曲里, 缩减导航栏」):
 *   三独立页各带一份 css (natural/human/philosophy), 各自重定义了 .card / .page-container /
 *   .chip / .bridge-line / .hume-* 等基础类。实测冲突:
 *     · .bridge-line  chain.css = 横线(1px, dashed)  vs  world css = 竖线(2px×16px) —— 方向相反
 *     · .chip         chain.css = 圆角 999px 胶囊       vs  world css = 圆角 2px 方角
 *     · .card         app.css   = 圆角 10px + 阴影      vs  world css = 圆角 3px + 0.5px 描边
 *   直接把三份 world css 引入 chain.html ⇒ 三部曲页自身样式被污染 ⇒ 本文件改为
 *   「作用域隔离」: 所有选择器一律带 .wx-scope 前缀, 只作用于内嵌区。
 *
 * 编写纪律:
 *   ① 不重定义 chain.css/app.css 已有的类(.card/.muted/.faint/.accent/.bridge-* 等)
 *      —— 内嵌区直接继承三部曲页的样式, 保持全页视觉一致。
 *   ② 只补 world 独有、chain 里没有的类(node-*/obj-rel-grid/or-*/key-node-*/sys-encoding-card
 *      /granularity-banner/anchor-pill/btn-run/detail-block/wx-* 等)。
 *   ③ 三独立页的 css 文件本身不动(它们各自的页面样式保持原样, 无回归风险)。
 */

/* ============ 内嵌区容器 ============ */
.wx-scope {
  margin-top: 4px;
}

/* 页签条 */
.wx-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
  padding: 6px;
  background: rgba(31, 56, 100, 0.04);
  border: 1px solid rgba(31, 56, 100, 0.14);
  border-radius: 8px;
}
.wx-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid rgba(31, 56, 100, 0.22);
  border-radius: 6px;
  background: #FFFFFF;
  color: #1F3864;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}
.wx-tab:hover { border-color: #1F3864; }
.wx-tab.active {
  background: #1F3864;
  border-color: #1F3864;
  color: #FFFFFF;
}
.wx-tab-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(31, 56, 100, 0.1);
  color: #1F3864;
  font-size: 11px;
  font-weight: 700;
}
.wx-tab.active .wx-tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}
.wx-tab-sub {
  font-size: 11.5px;
  font-weight: 400;
  opacity: .72;
}

/* 当前页签说明条 */
.wx-panel-head {
  margin: 10px 0 4px;
  padding: 9px 12px;
  border-left: 3px solid #1F3864;
  background: rgba(31, 56, 100, 0.035);
  border-radius: 0 6px 6px 0;
}
.wx-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1F3864;
}
.wx-panel-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  background: #1F3864;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
}
.wx-panel-desc {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #444444;
}

/* 页签面板: 只显示激活的那个 */
.wx-pane { display: none; }
.wx-pane.wx-active { display: block; }
.wx-box.pb-hidden { display: none !important; }

/* ============ 世界层渲染 (world css 独有类, 作用域化) ============ */

/* —— 层头 —— */
.wx-scope .layer-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 4px 2px 0;
}
.wx-scope .layer-name {
  font-size: 18px;
  font-weight: 600;
  margin-right: 8px;
}
.wx-scope .layer-intro {
  padding: 7px 2px 12px;
  font-size: 12px;
}

/* —— 节点卡 —— */
.wx-scope .node-card {
  position: relative;
}
.wx-scope .node-head {
  display: flex;
  align-items: flex-start;
}
.wx-scope .node-index {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  background: #1F3864;
  color: #FFFFFF;
  border-radius: 2px;
  font-size: 12px;
  margin-right: 9px;
  margin-top: 2px;
}
.wx-scope .node-titles { flex: 1; }
.wx-scope .theory {
  margin: 8px 0 2px;
  font-size: 13px;
  color: #1A1A1A;
}
.wx-scope .no-primitive {
  margin-top: 10px;
  padding: 6px 0;
  border-top: 1px dashed #D9DEE7;
}

/* —— 关键节点徽标 —— */
.wx-scope .key-node-badge {
  display: inline-block;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  border-radius: 2px;
  padding: 2px 8px;
  margin-top: 6px;
  letter-spacing: 0.5px;
}
.wx-scope .key-node-firstbit { background: #7D3C98; }
.wx-scope .key-node-hardstep { background: #B03A2E; }
.wx-scope .key-node-cognitive { background: #1F3864; }
.wx-scope .key-node-script { background: #1E6B52; }
.wx-scope .key-node-desc {
  margin-top: 4px;
  font-size: 11px;
  color: #595959;
  border-left: 2px solid #B03A2E;
  padding-left: 6px;
}
.wx-scope .node-key-card { border-left: 3px solid #B03A2E; }
.wx-scope .node-focus {
  border: 1px solid #B03A2E;
  box-shadow: 0 0 0 2px rgba(176, 58, 46, 0.12);
}

/* —— 对象-关系区块 —— */
.wx-scope .obj-rel-grid {
  display: flex;
  flex-wrap: wrap;
  margin-top: 9px;
}
.wx-scope .or-box {
  width: 100%;
  box-sizing: border-box;
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  padding: 7px 8px;
  margin-bottom: 6px;
}
.wx-scope .or-label {
  font-size: 11px;
  font-weight: 600;
  color: #1F3864;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.wx-scope .or-items {
  display: flex;
  flex-wrap: wrap;
}
.wx-scope .or-item {
  background: #FFFFFF;
  border: 1px solid #C9CDD4;
  border-radius: 2px;
  padding: 3px 7px;
  font-size: 11px;
  color: #1A1A1A;
  margin-right: 6px;
  margin-bottom: 4px;
}
.wx-scope .or-item-key {
  border-color: #B03A2E;
  color: #B03A2E;
  font-weight: 600;
}
.wx-scope .or-coding-text {
  font-size: 12px;
  color: #1A1A1A;
}

/* —— 粒度规则横幅 —— */
.wx-scope .granularity-banner {
  background: #F5F6FA;
  border: 1px dashed #8C8C8C;
  border-radius: 2px;
  padding: 6px 8px;
  margin-top: 2px;
  font-size: 11px;
  color: #595959;
}
.wx-scope .granularity-banner .gran-forbid {
  color: #B03A2E;
  font-weight: 600;
}

/* —— 系统级信息编码卡 —— */
.wx-scope .sys-encoding-card .se-row {
  display: flex;
  align-items: flex-start;
  margin-top: 6px;
}
.wx-scope .sys-encoding-card .se-key {
  flex-shrink: 0;
  width: 75px;
  font-size: 11px;
  color: #1F3864;
  font-weight: 600;
}
.wx-scope .sys-encoding-card .se-val {
  flex: 1;
  font-size: 12px;
  color: #1A1A1A;
  line-height: 1.6;
}
.wx-scope .sys-encoding-card .se-rule {
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  padding: 7px 8px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.7;
}
.wx-scope .sys-encoding-card .se-rule-forbid { color: #B03A2E; }
.wx-scope .sys-encoding-card .se-rule-enable { color: #1E6B52; }

/* —— 数值锚点 pill —— */
.wx-scope .anchor-pill {
  display: inline-block;
  background: #F2F5FA;
  border-left: 3px solid #1F3864;
  color: #1F3864;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  margin-top: 7px;
}

/* —— 运行按钮 —— */
.wx-scope .btn-run {
  margin-top: 10px;
  background: #1F3864;
  color: #FFFFFF;
  font-size: 13px;
  border-radius: 2px;
  padding: 7px 0;
  text-align: center;
  cursor: pointer;
}
.wx-scope .btn-run.disabled {
  background: #B8BDC7;
  color: #FFFFFF;
  cursor: default;
}

/* —— 折叠详情 —— */
.wx-scope .detail-toggle {
  margin-top: 8px;
  font-size: 11px;
  color: #595959;
  text-decoration: underline;
  cursor: pointer;
}
.wx-scope .detail-block {
  margin-top: 7px;
  padding: 9px;
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  font-size: 11px;
  color: #595959;
}
.wx-scope .detail-block .dt-head {
  color: #1A1A1A;
  font-weight: 600;
  margin: 5px 0 2px;
}
.wx-scope .detail-block .dt-head:first-child { margin-top: 0; }
.wx-scope .result-title {
  font-size: 12px;
  margin-bottom: 5px;
}

/* —— 涌现桥(竖向, world 版) —— */
.wx-scope .bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
}
.wx-scope .bridge-arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid #1F3864;
}
.wx-scope .bridge-line {
  width: 2px;
  height: 16px;
  background: #1F3864;
}
.wx-scope .bridge-label {
  color: #1F3864;
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0;
}

/* —— 休谟边界(哲学页专属块) —— */
.wx-scope .hume-theory { margin-top: 8px; }
.wx-scope .hume-theory-head {
  font-size: 12.5px;
  font-weight: 600;
  color: #1F3864;
  margin-bottom: 3px;
}
.wx-scope .hume-theory-text {
  font-size: 12px;
  line-height: 1.75;
  color: #1A1A1A;
}
.wx-scope .hume-gate {
  padding: 8px 10px;
  background: rgba(176, 58, 46, 0.05);
  border-left: 3px solid #B03A2E;
  border-radius: 0 4px 4px 0;
}
.wx-scope .hume-gate .hume-theory-head { color: #B03A2E; }
.wx-scope .hume-lex {
  margin-top: 8px;
  font-size: 11.5px;
  color: #595959;
}
.wx-scope .hume-lex summary { cursor: pointer; color: #1F3864; }

/* —— 实证锚点注册表(哲学页) —— */
.wx-scope .anchor-item {
  padding: 8px 0;
  border-bottom: 1px solid #E5E7EB;
}
.wx-scope .anchor-item:last-child { border-bottom: none; }
.wx-scope .anchor-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.wx-scope .anchor-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
}
.wx-scope .anchor-item-value { font-size: 12.5px; }
.wx-scope .anchor-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
}
.wx-scope .anchor-badge-ph {
  background: rgba(176, 58, 46, 0.1);
  color: #B03A2E;
}

/* —— 多映射稳健性检验(哲学页) —— */
.wx-scope .cross-item {
  padding: 7px 0;
  border-bottom: 1px solid #E5E7EB;
}
.wx-scope .cross-item:last-child { border-bottom: none; }
.wx-scope .cross-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1A1A1A;
}
.wx-scope .cross-verdict {
  font-size: 12px;
  font-weight: 600;
  margin: 2px 0;
}
.wx-scope .cross-verdict.pass { color: #1E6B52; }
.wx-scope .cross-verdict.warn { color: #B03A2E; }

/* —— 离线实证数据(哲学页) —— */
.wx-scope .offline-sub-title {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1F3864;
}
.wx-scope .bar-row { margin-top: 9px; }
.wx-scope .bar-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.wx-scope .bar-label { font-size: 12px; color: #1A1A1A; }
.wx-scope .bar-value { font-size: 12px; }
.wx-scope .bar-track {
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  margin-top: 4px;
  overflow: hidden;
}
.wx-scope .bar-fill {
  height: 100%;
  background: #1F3864;
  border-radius: 4px;
}
.wx-scope .implication {
  margin-top: 12px;
  padding: 9px 11px;
  background: #F5F6FA;
  border-left: 3px solid #1F3864;
  font-size: 12px;
  line-height: 1.75;
  color: #1A1A1A;
}
.wx-scope .link-line {
  margin-top: 7px;
  font-size: 11.5px;
  color: #1F3864;
  word-break: break-all;
  cursor: pointer;
}
.wx-scope .lit-row {
  padding: 8px 0;
  border-bottom: 1px solid #E5E7EB;
}
.wx-scope .lit-row:last-child { border-bottom: none; }
.wx-scope .lit-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 3px;
}
.wx-scope .lit-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
}

/* —— 外部数据库目录(哲学页) —— */
.wx-scope .ds-status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
}
.wx-scope .ds-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
}
.wx-scope .ds-badge-offline {
  background: #1F3864;
  color: #FFFFFF;
}
.wx-scope .ds-badge-guide {
  background: transparent;
  border: 1px solid #8C8C8C;
  color: #595959;
}
.wx-scope .ds-status-name { font-size: 12.5px; color: #1A1A1A; }
.wx-scope .dataset-item {
  padding: 9px 0;
  border-bottom: 1px solid #E5E7EB;
  cursor: pointer;
}
.wx-scope .dataset-item:last-child { border-bottom: none; }
.wx-scope .dataset-name {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 3px;
}
