/* 设置与编辑器：与主菜单共用冷灰 / 旧金配色、矩形控件及选择条。
   工作区保留紧凑布局与等宽读数；shot=1 仍隐藏全部工具。
   两棵根：#settingsRoot 是玩家设置页（Script_SettingsHost，随包发布）；
   #edRoot 是开发工具（高级工具菜单栏 + Inspector、Debug工具叠加层，打包时剔除）。
   这里的控件样式（.edPanel / .edBtn / 滑杆…）两边共用，菜单栏与 Inspector 停靠只写在 #edRoot 下。 */

#edRoot, #settingsRoot {
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none;                       /* 只有面板本身吃鼠标，其余全透 */
  font-family: var(--ui-font);
  color: var(--ui-text);
  font-size: 13px; line-height: 1.5;
}
#edRoot { --ed-bar-h: 46px; --ed-inspector-w: 380px; --ed-inspector-wide: 460px; }
#edRoot.off, #settingsRoot.off { display: none; }

.edFacialTimeline {
  position: absolute; left: 14px; right: calc(var(--ed-inspector-w) + 14px); bottom: 18px;
  padding: 12px 16px; background: var(--ui-panel); border: 1px solid var(--ui-line);
  pointer-events: auto; max-height: 38vh; overflow: auto;
}
.edFacialTimeline canvas { display: block; width: 100%; height: 62px; cursor: crosshair; }
.edFacialTimeline input[type="range"] { width: 100%; max-width: none; }
.edFacialCaption { min-height: 24px; margin-bottom: 8px; color: var(--ui-gold); }
[data-facial] textarea { width: 100%; box-sizing: border-box; resize: vertical; }
@media (max-width: 1050px) {
  .edFacialTimeline { max-height: 32vh; }
}
@media (max-width: 650px) {
  #edRoot .edPanel.work[data-facial] { bottom: 44vh; }
  .edFacialTimeline { left: 8px; right: 8px; bottom: 8px; max-height: 38vh; }
}

/* 数字一律等宽：调参时读数跳动会让人以为值在抖 */
:is(#edRoot, #settingsRoot) :is(.num, input[type="number"], .edVal, .edMono) {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* --- 齿轮按钮 ------------------------------------------------------------ */
.edGear {
  position: absolute; top: 14px; right: 14px;
  width: 40px; min-width: 40px; height: 34px; padding: 0; border-radius: 0;
  pointer-events: auto; cursor: pointer;
  background-color: var(--ui-black);
  background-image: url("./Texture/Hud/Icon_SettingsTools_Publish6bf46cecbff4ce3b4eab5707.png?v=20260930010001");
  background-position: center; background-repeat: no-repeat; background-size: 27px 27px;
  border: 1px solid rgba(214, 217, 209, 0.28);
  color: var(--ui-text);
  font-size: 0; text-align: center;
  transition: background 0.15s linear, border-color 0.15s linear;
}
.edGear:hover { background-color: #151818; border-color: rgba(223, 189, 104, 0.7); }
.edGear.on { border-color: var(--ui-gold); color: var(--ui-gold); }

/* --- 面板 ---------------------------------------------------------------- */
.edPanel {
  position: absolute; top: 84px; bottom: 18px;
  width: 268px;
  pointer-events: auto;
  display: flex; flex-direction: column;
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 0;
  backdrop-filter: blur(2px);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.55);
}
.edPanel.work { right: 14px; width: 320px; }
.edPanel.wide { width: 396px; }
/* 渲染调试是可叠加浮窗：停在左侧，避开右侧的 Inspector，不抢它的位置。 */
.edPanel.debugRendering { left: 14px; right: auto; width: 368px; bottom: 18px; }

.edHead {
  flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 8px;
  padding: 12px 14px; background: var(--ui-black); border-bottom: 1px solid var(--ui-line);
}
.edHead .edTitle { grid-column: 1; color: var(--ui-bright); font-size: 16px; font-weight: 700; letter-spacing: 0.04em; }
.edHead .edSub { grid-column: 1; grid-row: 2; color: var(--ui-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edHead .edSub:empty { display: none; }
.edHead .edX {
  grid-column: 2; grid-row: 1 / span 2; align-self: start; flex-shrink: 0;
  cursor: pointer; width: 28px; height: 28px; padding: 0; text-align: center; line-height: 26px;
  border: 1px solid var(--ui-line); background: transparent; color: var(--ui-muted); font-size: 18px;
}
.edHead .edX:hover { border-color: var(--ui-gold); color: var(--ui-gold); }

.edBody { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 12px 14px 16px; }
.edBody::-webkit-scrollbar { width: 8px; }
.edBody::-webkit-scrollbar-thumb { background: rgba(214, 217, 209, 0.18); border-radius: 0; }

/* --- 分节 ---------------------------------------------------------------- */
.edSection { margin: 10px 0 4px; }
.edSection:first-child { margin-top: 2px; }
.edSection > .h {
  color: var(--ui-gold); font-size: 11px; letter-spacing: 0.08em; font-weight: 700;
  border-bottom: 1px solid var(--ui-line);
  padding-bottom: 6px; margin-bottom: 8px;
}

/* --- 行与控件 ------------------------------------------------------------ */
.edRow { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.edRow > .l { flex: 0 0 82px; color: var(--ui-muted); font-size: 12px; }
.edRow > .c { flex: 1 1 auto; min-width: 0; }

.edBtn {
  cursor: pointer; user-select: none;
  padding: 5px 9px; min-height: 28px; box-sizing: border-box; border-radius: 0; font: 12px/1.5 var(--ui-font);
  background: #151919;
  border: 1px solid rgba(214, 217, 209, 0.22);
  color: var(--ui-text);
}
.edBtn:hover { background: var(--ui-selection); color: var(--ui-gold); }
.edBtn.on { border-color: var(--ui-gold); color: var(--ui-gold); background: var(--ui-selection); }
.edBtn.danger:hover { border-color: var(--theirs, #d6604a); color: var(--theirs, #d6604a); }
.edBtn.wide { display: block; width: 100%; box-sizing: border-box; text-align: center; }
.edBtns { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0; }

.edChips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
/* 碰撞体线框的分类图例：一小段色条 + 名字，颜色与 Script_EditorDebugRendering.COLLIDER_CATEGORIES 同源 */
.edLegend { display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 4px 0 6px; font-size: 11px; color: var(--ui-muted); }
.edLegend .edSwatch { display: inline-block; width: 16px; height: 3px; vertical-align: middle; margin-right: 5px; }
.edChip {
  cursor: pointer; user-select: none; font: 12px/1.5 var(--ui-font); background: transparent;
  padding: 4px 8px; border-radius: 0;
  border: 1px solid rgba(214, 217, 209, 0.20);
  color: rgba(214, 217, 209, 0.82);
}
.edChip:hover { border-color: var(--ui-muted); color: var(--ui-text); }
.edChip.on { border-color: var(--ui-gold); color: var(--ui-gold); background: var(--ui-selection); }

.edPanel select, .edPanel input[type="text"], .edPanel textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(214, 217, 209, 0.22);
  color: var(--ui-text);
  border-radius: 0; padding: 3px 5px; font-size: 12px;
  font-family: inherit;
}
.edPanel textarea { resize: vertical; min-height: 56px; font-family: ui-monospace, Consolas, monospace; }
.edPanel select:focus, .edPanel input:focus, .edPanel textarea:focus {
  outline: none; border-color: var(--ui-gold);
}
.edPanel select option { background: var(--ui-surface); }

/* JSON 取证默认收起：完整场景面板有三块长 JSON，不主动展开就不该挤走场景控件。 */
.edJsonFold { margin: 5px 0; }
.edJsonFold > summary {
  cursor: pointer; user-select: none; list-style-position: inside;
  padding: 3px 7px; border-radius: 0; font-size: 11.5px;
  color: var(--ui-muted);
  border: 1px solid rgba(214, 217, 209, 0.16);
  background: rgba(214, 217, 209, 0.04);
}
.edJsonFold > summary:hover { color: var(--ui-text); border-color: rgba(214, 217, 209, 0.34); }
.edJsonFold[open] > summary { color: var(--ui-gold); border-color: rgba(223, 189, 104, 0.38); }
.edJsonFold > textarea { margin-top: 5px; }

/* 方形滑块沿用界面的旧金焦点色。 */
.edPanel input[type="range"] {
  width: 100%; height: 14px; margin: 0; background: transparent;
  -webkit-appearance: none; appearance: none;
}
.edPanel input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; background: rgba(214, 217, 209, 0.22); border-radius: 0;
}
.edPanel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 9px; height: 13px; margin-top: -5px; border-radius: 0;
  background: var(--ui-text); border: none; cursor: pointer;
}
.edPanel input[type="range"]::-moz-range-track { height: 3px; background: rgba(214, 217, 209, 0.22); }
.edPanel input[type="range"]::-moz-range-thumb {
  width: 9px; height: 13px; border-radius: 0; background: var(--ui-text); border: none; cursor: pointer;
}

/* --- 列表 ---------------------------------------------------------------- */
.edList { border: 1px solid rgba(214, 217, 209, 0.14); border-radius: 0; overflow-y: auto; }
.edList .it {
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 6px; cursor: pointer; border-bottom: 1px solid rgba(214, 217, 209, 0.07);
}
.edList .it:last-child { border-bottom: none; }
.edList .it:hover { background: rgba(214, 217, 209, 0.08); }
.edList .it.on { background: var(--ui-selection); color: var(--ui-gold); }
.edList .it .n { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edList .it .t { flex: 0 0 auto; color: var(--ui-muted); font-size: 11px; }

/* --- 读数 ---------------------------------------------------------------- */
.edFacts { margin: 4px 0; }
.edFacts .f { display: flex; gap: 8px; font-size: 12px; padding: 1px 0; }
.edFacts .f .k { flex: 0 0 92px; color: var(--ui-muted); }
.edFacts .f .v { flex: 1 1 auto; word-break: break-all; }
.edFacts .f .v.warn { color: var(--ui-gold); }
.edFacts .f .v.bad { color: var(--theirs, #d6604a); }
.edFacts .f .v.good { color: var(--ours, #9dc0e4); }

.edAssetTableWrap { overflow: auto; max-height: calc(100vh - 190px); margin-top: 7px; }
.edAssetTable { width: 100%; min-width: 1030px; border-collapse: collapse; font-size: 11px; }
.edAssetTable th {
  position: sticky; top: 0; z-index: 1; padding: 7px 6px; text-align: left;
  background: var(--ui-black); color: var(--ui-muted);
  border-bottom: 1px solid rgba(214, 217, 209, 0.24); white-space: nowrap;
}
.edAssetTable td { padding: 6px; border-bottom: 1px solid rgba(214, 217, 209, 0.09); vertical-align: top; }
.edAssetTable tbody tr:hover { background: rgba(223, 189, 104, 0.08); }
.edAssetTable td.asset { min-width: 142px; }
.edAssetTable td.asset .name { color: var(--ui-text); font-size: 12px; }
.edAssetTable td.asset .id { color: var(--ui-muted); font: 10px ui-monospace, Consolas, monospace; }
.edAssetTable td.num { white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.edAssetTable td.status { white-space: nowrap; }
.edAssetTable td.status.good { color: var(--ours, #9dc0e4); }
.edAssetTable td.status.warn { color: var(--ui-gold); }
.edAssetTable td.status.bad { color: var(--theirs, #d6604a); }
.edAssetRuleCards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.edAssetRuleCard { padding: 10px; border: 1px solid rgba(214, 217, 209, 0.16); background: rgba(0, 0, 0, 0.18); }
.edAssetRuleCard .title { color: var(--ui-text); font-size: 13px; margin-bottom: 4px; }
.edAssetRuleCard .limit { color: var(--ui-gold); font-family: ui-monospace, Consolas, monospace; }
.edAssetRuleCard .texture { color: var(--ui-muted); margin-top: 4px; }
.edAssetRuleCard .note { color: var(--ui-muted); margin-top: 5px; line-height: 1.5; }

.edNote {
  font-size: 11.5px; color: var(--ui-muted); line-height: 1.55;
  border-left: 2px solid rgba(214, 217, 209, 0.18); padding: 2px 0 2px 7px; margin: 5px 0;
}
.edNote.warn { border-left-color: var(--ui-gold); color: rgba(223, 189, 104, 0.85); }

/* --- 操作说明 ------------------------------------------------------------ */
.edControlGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.edControlRow {
  display: grid; grid-template-columns: minmax(96px, auto) 1fr; align-items: center; gap: 9px;
  min-height: 28px; padding: 3px 6px;
  border-bottom: 1px solid rgba(214, 217, 209, 0.08);
}
.edControlRow kbd {
  justify-self: start; min-width: 72px; box-sizing: border-box;
  padding: 2px 6px; border: 1px solid rgba(214, 217, 209, 0.26); border-radius: 0;
  background: rgba(0, 0, 0, 0.34); color: var(--ui-text);
  font: 11px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace;
  text-align: center; white-space: nowrap;
}
.edControlRow span { color: var(--ui-muted); font-size: 11.5px; }

/* --- 时间轴 -------------------------------------------------------------- */
.edTrack {
  position: relative; height: 22px; margin: 6px 0 2px;
  border: 1px solid rgba(214, 217, 209, 0.18); border-radius: 0;
  background: rgba(0, 0, 0, 0.35); cursor: pointer; overflow: hidden;
}
.edTrack .shot {
  position: absolute; top: 0; bottom: 0;
  border-right: 1px solid rgba(214, 217, 209, 0.22);
  font-size: 10px; color: var(--ui-muted);
  text-align: center; line-height: 20px; overflow: hidden;
}
.edTrack .shot.on { background: rgba(223, 189, 104, 0.16); color: var(--ui-gold); }
.edTrack .play { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--theirs, #d6604a); }

/* --- 屏幕中央的提示（拾取/放置模式） ------------------------------------- */
.edHint {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 0; font-size: 12px;
  background: rgba(10, 10, 9, 0.75); border: 1px solid rgba(223, 189, 104, 0.45);
  color: var(--ui-gold); pointer-events: none; opacity: 0;
  transition: opacity 0.18s linear;
}
.edHint.on { opacity: 1; }

/* 十字标：放置/地形笔刷时的准心 */
.edCross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; display: none; }
.edCross.on { display: block; }
.edCross::before, .edCross::after {
  content: ""; position: absolute; background: rgba(223, 189, 104, 0.8);
}
.edCross::before { left: -9px; top: -1px; width: 18px; height: 1px; }
.edCross::after { left: -1px; top: -9px; width: 1px; height: 18px; }

/* 枪械校准：十字交点就是弹道真正经过的屏幕点，不是装饰性准星。 */
.edCross.calibration::before, .edCross.calibration::after { background: var(--theirs, #d6604a); }
.edCross.calibration { display: block; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9)); }
.edCross.calibration::before { left: -13px; width: 26px; }
.edCross.calibration::after { top: -13px; height: 26px; }
.edCross.calibration span {
  position: absolute; left: 12px; top: 10px; width: max-content;
  color: var(--theirs, #d6604a); font: 11px/1.2 ui-monospace, Consolas, monospace;
  text-shadow: 0 1px 2px #000;
}

/* 布防图名牌：场景编辑器的屏幕空间名字层（世界牌在俯瞰机位小得看不见，名字直接投屏幕）。
   z-index:-1：名牌层挂在 workHost（最后一个兄弟）里，不压下去会盖住左侧入口面板的按钮；
   #edRoot 自带 z-index:40 的堆叠上下文，-1 只会沉到全部编辑器 UI 之下，不会沉到画布后面。 */
.edMapHud { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.edMapLabel {
  position: absolute; transform: translate(-50%, -100%);
  font: 600 12px/1.35 var(--ui-font);
  color: #f0cc8b; padding: 1px 6px; border-radius: 0; white-space: nowrap;
  background: rgba(10, 10, 9, 0.62); border: 1px solid rgba(223, 189, 104, 0.4);
  text-shadow: 0 1px 2px #000;
}
.edMapLabel.road { color: #a7cee1; border-color: rgba(117, 169, 198, 0.45); }
/* 布防图参考名（没进文档的）：虚线框区分「图纸上的」与「你放下的」 */
.edMapLabel.ref { opacity: 0.82; border-style: dashed; }
.edMapLabel.sel { color: #fff; border-color: var(--ui-gold); background: rgba(58, 42, 18, 0.88); }

/* 第一人称持枪检查：标签跟着真实挂点投到屏幕，外部检查时仍与同一棵 Viewmodel 对位。 */
.edFpsMountHud { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.edFpsMountLabel {
  position: absolute; transform: translate(-50%, -118%); white-space: nowrap;
  padding: 1px 5px; border-radius: 0;
  color: var(--mount-color, #fff); background: rgba(7, 7, 6, 0.76);
  border: 1px solid var(--mount-color, #fff);
  font: 600 10px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace;
  text-shadow: 0 1px 2px #000;
}
.edFpsMountLabel.actual { transform: translate(-50%, 62%); border-style: dashed; }
.edFpsLegend {
  position: absolute; left: 14px; bottom: 22px; display: flex; flex-wrap: wrap; gap: 5px 10px;
  max-width: calc(100vw - var(--ed-inspector-w) - 42px); padding: 5px 8px; border-radius: 0;
  pointer-events: none; background: rgba(7, 7, 6, 0.72);
  border: 1px solid rgba(214, 217, 209, 0.18);
  font: 10px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.edFpsLegend span { color: var(--c); }
.edFpsLegend span::before { content: "● "; }
.edFpsLegend::after { content: attr(data-view); color: var(--ui-muted); }
body.edFpsClean #edRoot .edPanel,
body.edFpsClean #edRoot .edMenuBar,
body.edFpsClean #edRoot .edInspectorToggle,
body.edFpsClean #weaponRangePanel,
body.edFpsClean #edRoot .edGear,
body.edFpsClean #edRoot .edHint { display: none !important; }

/* 编辑器接管时把 HUD 收起来（过场自己的 .csRoot 必须留着 —— Timeline 要看它） */
body.edHideHud #hud > [class^="hud"] { display: none !important; }
/* 第一人称持枪移动检查的外部机位：屏幕中心的准星对的是观察相机，不是玩家视线，藏掉免得误读（视锥那几根黄线才是玩家视线） */
body.edFpMotionObserver .hudCrosshair { display: none !important; }

/* 窄屏：面板改成上下叠、宽度跟着视口 */
@media (max-width: 900px) {
  #edRoot { --ed-inspector-w: 320px; --ed-inspector-wide: 350px; }
  .edAssetRuleCards { grid-template-columns: 1fr; }
  .edPanel.debugRendering { width: min(280px, calc(100% - var(--ed-inspector-w) - 42px)); }
  .edControlGrid { grid-template-columns: 1fr; }
}
.edPanel input[type="range"]:hover::-webkit-slider-thumb,
.edPanel input[type="range"]:focus-visible::-webkit-slider-thumb { background: var(--ui-gold); }

/* =========================================================================
   高级工具外观：沿用启动界面（指挥室菜单 / 设置页）的视觉语言，只作用于 #edRoot。
   半透明暗色渐变底、象牙白文字、橄榄灰细线、左侧金边 + 渐变的选中条、宽字距小标题、
   衬线标题（TzTitleText）、金色填充细轨 + 竖条滑块、直角控件。取值与 Style_Menu.css 的
   设置页 / 声音页同源，改那边的口径时这里一起改。
   ========================================================================= */
#edRoot {
  --ed-panel: linear-gradient(90deg, #080907f0, #11120ee8 65%, #14150ce0);
  --ed-panel-r: linear-gradient(270deg, #080907f2, #0e0f0cec 55%, #13140fe6);
  --ed-black: #070807;
  --ed-field: #0a0b09b8;
  --ed-rule: #c1bdab55;        /* 主细线（标题下） */
  --ed-rule-2: #c1bdab30;      /* 次细线（分组下、列表行） */
  --ed-edge: #c1bdab40;        /* 控件描边 */
  --ed-text-hi: #eeeee7;
  --ed-text: #deddd2;
  --ed-text-2: #c2c3b6;
  --ed-text-3: #aaa99b;        /* 眉题 / 面包屑 */
  --ed-text-4: #989b8b;
  --ed-gold: #edca83;          /* 选中边、主操作 */
  --ed-gold-text: #e6cb91;
  --ed-gold-hi: #ffe0a1;
  --ed-gold-fill: #d9bb7b;
  --ed-thumb: #e4d9bb;
  --ed-sel: linear-gradient(90deg, #d8d4c324, #bbb7a906);
  --ed-sel-strong: linear-gradient(90deg, #d8d4c333, #bbb7a90d);
  --ed-serif: var(--ui-story-font);
  --ed-good: var(--ours, #9dc0e4);
  --ed-bad: var(--theirs, #d6604a);
}

/* --- 高级工具：顶部菜单栏 ------------------------------------------------ */
/* Unity 式的菜单栏 + 下拉，外观与指挥室菜单同一套：象牙白宽字距、金色细边。 */
.edMenuBar {
  position: absolute; inset: 0 0 auto; height: var(--ed-bar-h); box-sizing: border-box;
  display: none; align-items: stretch; padding: 0 8px 0 22px; pointer-events: auto;
  /* 不能加 backdrop-filter：它会让菜单栏变成 fixed 下拉的包含块，下拉被栏的 overflow 裁掉 */
  background: linear-gradient(180deg, #070807f7, #0b0c0aee); border-bottom: 1px solid var(--ed-rule);
  overflow-x: auto; overflow-y: hidden;
}
/* 主题给 #edRoot 下所有元素配了细滚动条，这里要压过它 */
#edRoot .edMenuBar { scrollbar-width: none; }
#edRoot .edMenuBar::-webkit-scrollbar { display: none; }
#edRoot.toolsOpen .edMenuBar { display: flex; }
#edRoot.toolsOpen .edGear { display: none; }
.edMenuBrand {
  flex: 0 0 auto; display: flex; align-items: center; padding-right: 22px; margin-right: 10px;
  color: var(--ed-text-hi); font: 700 17px/1 var(--ed-serif); letter-spacing: 0.12em; white-space: nowrap;
  position: relative;
}
.edMenuBrand::after { content: ""; position: absolute; right: 0; top: 50%; height: 18px; margin-top: -9px; border-right: 1px solid var(--ed-rule); }
.edMenus { flex: 0 0 auto; display: flex; align-items: stretch; }
/* 右侧那组（Debug工具下拉，2026-10-22）：紧挨音量条，左边一道细竖线跟状态字隔开 */
.edMenusRight { border-left: 1px solid var(--ed-rule-2); }
.edMenu { position: static; display: flex; }
.edMenuTitle {
  cursor: pointer; padding: 0 15px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
  color: #b9bcb7; font: 400 14px/1 var(--ui-font); letter-spacing: 0.12em; white-space: nowrap;
  transition: color 0.12s linear, background 0.12s linear, border-color 0.12s linear;
}
.edMenuTitle:hover { color: var(--ed-gold); }
.edMenu.open > .edMenuTitle { color: var(--ed-gold); border-bottom-color: var(--ed-gold); background: linear-gradient(0deg, #d8d4c31f, transparent 80%); }
.edMenuDrop {
  position: fixed; z-index: 2; display: block; min-width: 236px; padding: 8px 0; box-sizing: border-box;
  background: linear-gradient(90deg, #080907f7, #11120ef2); border: 1px solid var(--ed-edge); border-top-color: var(--ed-rule);
  box-shadow: 0 20px 44px #000b;
  opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity 0.12s linear, transform 0.12s ease, visibility 0s linear 0.12s;
}
.edMenu.open > .edMenuDrop { opacity: 1; visibility: visible; transform: none; transition: opacity 0.12s linear, transform 0.12s ease, visibility 0s; }
.edMenuItem {
  cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
  min-height: 36px; padding: 0 18px 0 13px; border: 0; border-left: 3px solid transparent; border-radius: 0; background: transparent;
  color: #c6c7bd; font: 400 14px/1.4 var(--ui-font); letter-spacing: 0.08em; text-align: left; white-space: nowrap;
  transition: color 0.12s linear, background 0.12s linear;
}
.edMenuItem:hover:not(:disabled), .edMenuItem:focus-visible {
  color: var(--ed-gold); background: var(--ed-sel); border-left-color: var(--ed-gold); outline: none;
}
.edMenuItem:disabled { cursor: default; color: #6f716a; }
/* 当前开着的那项：金字 + 一枚 5 px 金方块（与设置页开关的标记同一种） */
.edMenuCheck { flex: 0 0 8px; display: flex; align-items: center; justify-content: center; }
.edMenuItem.on { color: var(--ed-gold-text); }
.edMenuItem.on .edMenuCheck::before { content: ""; width: 5px; height: 5px; background: currentColor; }
.edMenuLabel { flex: 1 1 auto; }
.edMenuTail { flex: 0 0 auto; color: var(--ed-text-4); font-size: 12px; letter-spacing: 0; }
.edMenuStatus {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 16px; color: var(--ed-text-3); font-size: 12px; letter-spacing: 0.16em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 右端（2026-11-05）：「返回主菜单」文字按钮，左边一道细竖线隔开 */
.edMenuMainMenu {
  flex: 0 0 auto; cursor: pointer; padding: 0 16px; border: 0; border-left: 1px solid var(--ed-rule-2); border-radius: 0;
  background: transparent; color: #bbbbae; font: 400 14px/1 var(--ui-font); letter-spacing: 0.12em; white-space: nowrap;
  transition: color 0.12s linear;
}
.edMenuMainMenu:hover, .edMenuMainMenu:focus-visible { color: var(--ed-gold-hi); }

/* 高级工具独立音量（Script_EditorVolume，2026-10-20）：喇叭 + 细线滑条 + 百分比，放在状态字与 × 之间 */
.edVolume {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 12px; margin-right: 4px;
  border-left: 1px solid var(--ed-rule-2); align-self: stretch;
}
.edVolumeMute {
  width: 26px; height: 26px; padding: 3px; border: 0; border-radius: 0; background: transparent; cursor: pointer;
  color: var(--ed-text-2); transition: color 0.12s linear;
}
.edVolumeMute svg { width: 100%; height: 100%; display: block; }
.edVolumeMute:hover, .edVolumeMute:focus-visible { color: var(--ed-gold-hi); }
.edVolume.muted .edVolumeMute { color: var(--ed-text-4); }
.edVolumeRange {
  -webkit-appearance: none; appearance: none; width: 96px; height: 18px; margin: 0; background: transparent; cursor: pointer;
}
.edVolumeRange::-webkit-slider-runnable-track {
  height: 2px; background: linear-gradient(90deg, var(--ed-gold-fill) var(--fill, 100%), var(--ed-edge) var(--fill, 100%));
}
.edVolumeRange::-moz-range-track { height: 2px; background: var(--ed-edge); }
.edVolumeRange::-moz-range-progress { height: 2px; background: var(--ed-gold-fill); }
.edVolumeRange::-webkit-slider-thumb {
  -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4px; border-radius: 50%; background: var(--ed-thumb); border: 0;
}
.edVolumeRange::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--ed-thumb); border: 0; }
.edVolumeRange:focus-visible { outline: 1px solid var(--ed-gold); outline-offset: 2px; }
.edVolume.muted .edVolumeRange::-webkit-slider-runnable-track { background: var(--ed-edge); }
.edVolume.muted .edVolumeRange::-moz-range-progress { background: transparent; }
.edVolumeValue { min-width: 3.2em; color: var(--ed-text-3); font-size: 12px; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; text-align: right; }

/* --- 高级工具：右侧 Inspector -------------------------------------------- */
/* 每个编辑器仍是自己的 Panel({variant:"work"})，在这里统一停靠到菜单栏下面的右侧；
   Debug Rendering / 敌军 AI 是叠加浮窗、资产规范是整张表，不进 Inspector。 */
#edRoot :is(.edPanel.work:not(.debugRendering):not(.ai):not(.assetStandards), .edPanel.edInspectorEmpty) {
  top: var(--ed-bar-h); right: 0; bottom: 0; width: var(--ed-inspector-w);
  border: 0; border-left: 1px solid var(--ed-rule); border-radius: 0;
  background: var(--ed-panel-r); box-shadow: -18px 0 40px #0007; backdrop-filter: none;
}
#edRoot .edPanel.work.wide:not(.debugRendering):not(.ai):not(.assetStandards) { width: var(--ed-inspector-wide); }
/* 顶上一行眉题，与设置页的「设置 / 声音」面包屑同一种字 */
#edRoot :is(.edPanel.work:not(.debugRendering):not(.ai):not(.assetStandards), .edPanel.edInspectorEmpty)::before {
  content: "高级工具 / Inspector"; flex: 0 0 auto; display: block; padding: 16px 22px 0;
  color: var(--ed-text-3); font-size: 11.5px; letter-spacing: 0.2em;
}
#edRoot .edPanel.assetStandards { top: var(--ed-bar-h); left: 0; right: 0; bottom: 0; width: auto; border: 0; border-radius: 0; background: var(--ed-panel); }
#edRoot.toolsOpen .edHint { top: calc(var(--ed-bar-h) + 14px); }
[hidden].edPanel { display: none !important; }

/* 折叠只影响右侧 Inspector；隐藏后图标留在画面右上角。 */
#edRoot.inspectorCollapsed { --ed-inspector-w: 0px; --ed-inspector-wide: 0px; }
#edRoot.inspectorCollapsed :is(.edPanel.work:not(.debugRendering):not(.ai):not(.assetStandards), .edPanel.edInspectorEmpty) { display: none; }
.edInspectorToggle {
  position: absolute; top: calc(var(--ed-bar-h) + 14px); right: 14px; z-index: 1;
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  pointer-events: auto; cursor: pointer; border: 0; border-radius: 0; background: none; color: #bbbbae;
}
.edInspectorToggle svg { width: 24px; height: 24px; }
.edMenuBar > .edInspectorToggle { position: static; flex: 0 0 32px; align-self: center; }
#edRoot.inspectorCollapsed .edInspectorToggle svg { transform: rotate(180deg); }
.edInspectorToggle[hidden] { display: none; }
.edInspectorToggle:hover { color: var(--ed-gold-hi); }
.edInspectorToggle:focus-visible { outline: 1px solid var(--ed-gold); outline-offset: 2px; }
#edRoot .edHead:has(> .edInspectorToggle) { grid-template-columns: minmax(0, 1fr) 32px 32px; column-gap: 6px; }
#edRoot .edHead:has(> .edInspectorToggle) .edX { grid-column: 3; }
#edRoot .edHead > .edInspectorToggle { position: static; grid-column: 2; grid-row: 1 / span 2; align-self: start; }

/* 空 Inspector：一枚图标 + 衬线标题 + 两句说明 + 快捷键 */
#edRoot .edInspectorEmpty .edHead { display: none; }
#edRoot .edInspectorEmpty .edBody { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 30px 24px; }
.edEmptyArt { width: 58px; height: 58px; margin-bottom: 20px; display: grid; place-items: center;
  border: 1px solid var(--ed-edge); background: #13140b55; color: var(--ed-gold); }
.edEmptyArt svg { width: 26px; height: 26px; }
.edEmptyTitle { color: var(--ed-text-hi); font: 700 22px/1.3 var(--ed-serif); letter-spacing: 0.12em; margin-bottom: 14px;
  padding-bottom: 14px; border-bottom: 1px solid var(--ed-rule); min-width: 60%; }
#edRoot .edInspectorEmpty .edNote { border: 0; background: none; padding: 0; margin: 6px 0; color: var(--ed-text-3); font-size: 12.5px; line-height: 1.9; }
.edEmptyKeys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 22px; color: var(--ed-text-4); font-size: 12px; letter-spacing: 0.08em; }
.edEmptyKeys kbd {
  display: inline-block; min-width: 20px; padding: 2px 7px; margin-right: 7px; box-sizing: border-box;
  border: 1px solid var(--ed-edge); background: #13140b88; color: var(--ed-text); font: 11px/16px var(--ui-mono); text-align: center;
}

/* --- 高级工具：工具首页（?editor=tools 不带关卡，Script_EditorHome） -------- */
/* 没载入任何场景时整页盖住画布：衬线大标题 + 按菜单栏分组的工具卡，选中走金边（同菜单下拉）。 */
.edHome {
  position: absolute; top: var(--ed-bar-h); left: 0; right: 0; bottom: 0; z-index: 0;
  overflow-y: auto; pointer-events: auto; color: var(--ed-text);
  background:
    radial-gradient(120% 90% at 18% 0%, #1d1c14 0%, #0d0e0b 46%, #060705 100%);
}
.edHome[hidden] { display: none; }
/* 极淡的方格底纹：像图纸，不抢字 */
.edHome::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(#c1bdab0b 1px, transparent 1px),
    linear-gradient(90deg, #c1bdab0b 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(90% 80% at 30% 20%, #000 30%, transparent 85%);
}
.edHomeInner { position: relative; max-width: clamp(1180px, 78vw, 2000px); margin: 0 auto; padding: clamp(40px, 4vw, 72px) clamp(32px, 4vw, 72px) 56px; box-sizing: border-box; }


.edHomeTag {
  flex: 0 0 auto; display: inline-flex; align-items: center; height: 1.8em; padding: 0 0.6em; box-sizing: border-box;
  border: 1px solid var(--ed-edge); color: var(--ed-text-3); font-size: clamp(12px, 0.3vw + 8px, 14px); letter-spacing: 0.12em; white-space: nowrap;
}
.edHomeTag[data-kind="level"] { border-color: #edca8366; color: var(--ed-gold-text); }
.edHomeTag[data-kind="old"] { color: var(--ed-text-4); }

.edHomeGrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 19vw, 480px), 1fr)); gap: clamp(36px, 3vw, 56px) clamp(30px, 2.6vw, 48px); align-items: start;
}
.edHomeGroupTitle {
  display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 8px; padding-bottom: 10px;
  border-bottom: 1px solid var(--ed-rule-2);
}
.edHomeGroupLabel { color: var(--ed-text-hi); font: 700 clamp(22px, 0.8vw + 12px, 34px)/1.3 var(--ed-serif); letter-spacing: 0.16em; }

.edHomeTool {
  cursor: pointer; display: flex; flex-direction: column; gap: 5px; width: 100%; box-sizing: border-box;
  padding: clamp(12px, 0.8vw, 18px) 14px clamp(13px, 0.85vw, 19px) 16px; border: 0; border-left: 3px solid transparent; border-radius: 0; background: transparent;
  color: var(--ed-text); font: inherit; text-align: left;
  transition: background 0.12s linear, border-color 0.12s linear, color 0.12s linear;
}
.edHomeTool + .edHomeTool { border-top: 1px solid #c1bdab14; }
.edHomeTool:hover, .edHomeTool:focus-visible { background: var(--ed-sel-strong); border-left-color: var(--ed-gold); outline: none; }
.edHomeToolTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.edHomeToolName { color: var(--ed-text-hi); font-size: clamp(17px, 0.5vw + 11px, 25px); letter-spacing: 0.1em; transition: color 0.12s linear; }
.edHomeTool:hover .edHomeToolName, .edHomeTool:focus-visible .edHomeToolName { color: var(--ed-gold); }
.edHomeToolHint {
  color: var(--ed-text-3); font-size: clamp(14px, 0.35vw + 9.5px, 19px); line-height: 1.7; letter-spacing: 0.04em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}


/* 「载入哪一关」：盖在首页上的一张单子 */
.edHomeSheet {
  position: fixed; inset: var(--ed-bar-h) 0 0; z-index: 3; display: grid; place-items: center; padding: 24px;
  background: #050604c4; backdrop-filter: blur(3px);
}
.edHomeSheet[hidden] { display: none; }
.edHomeSheetBox {
  width: min(clamp(540px, 34vw, 720px), 100%); max-height: calc(100vh - var(--ed-bar-h) - 48px); overflow-y: auto; box-sizing: border-box;
  padding: 28px 30px 24px; background: linear-gradient(180deg, #11120ef7, #090a08f7);
  border: 1px solid var(--ed-edge); border-top: 2px solid var(--ed-gold); box-shadow: 0 30px 70px #000c;
}
.edHomeSheetTitle { margin: 0 0 16px; color: var(--ed-text-hi); font: 700 clamp(24px, 0.6vw + 16px, 32px)/1.4 var(--ed-serif); letter-spacing: 0.08em; }
.edHomeSheetList { display: flex; flex-direction: column; border-top: 1px solid var(--ed-rule-2); }
.edHomeChoice {
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; box-sizing: border-box;
  min-height: 56px; padding: 10px 16px 10px 15px; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--ed-rule-2);
  border-radius: 0; background: transparent; color: var(--ed-text); font: inherit; text-align: left;
  transition: background 0.12s linear, border-color 0.12s linear;
}
.edHomeChoice:hover, .edHomeChoice:focus-visible { background: var(--ed-sel-strong); border-left-color: var(--ed-gold); outline: none; }
.edHomeChoiceText { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.edHomeChoiceName { color: var(--ed-text-hi); font-size: clamp(16px, 0.4vw + 11px, 20px); letter-spacing: 0.08em; }
.edHomeChoice:hover .edHomeChoiceName, .edHomeChoice:focus-visible .edHomeChoiceName { color: var(--ed-gold); }
.edHomeChoiceSub { color: var(--ed-text-3); font-size: clamp(13px, 0.25vw + 10px, 15px); letter-spacing: 0.06em; }
.edHomeCancel {
  cursor: pointer; display: block; margin: 18px 0 0 auto; padding: 8px 18px; border: 1px solid var(--ed-edge); border-radius: 0;
  background: transparent; color: var(--ed-text-2); font: clamp(14px, 0.25vw + 11px, 16px)/1 var(--ui-font); letter-spacing: 0.16em;
}
.edHomeCancel:hover, .edHomeCancel:focus-visible { border-color: var(--ed-gold); color: var(--ed-gold); outline: none; }

@media (max-width: 760px) {
  .edHomeInner { max-width: none; padding: 24px 16px 28px; }
  .edHomeGrid { grid-template-columns: 1fr; gap: 26px; }
  .edHomeSheetBox { padding: 22px 18px 18px; }
}

/* --- 高级工具：面板与控件 ------------------------------------------------ */
#edRoot .edPanel { background: var(--ed-panel); border: 1px solid var(--ed-edge); border-radius: 0; box-shadow: 0 20px 50px #000b; color: var(--ed-text); }
#edRoot .edHead { padding: 8px 14px 16px 22px; gap: 6px 10px; background: transparent; border-bottom: 1px solid var(--ed-rule); }
#edRoot .edHead .edTitle { color: var(--ed-text-hi); font: 700 21px/1.35 var(--ed-serif); letter-spacing: 0.08em; }
#edRoot .edHead .edSub { color: var(--ed-text-3); font-size: 12px; letter-spacing: 0.1em; white-space: normal; }
#edRoot .edHead .edX { width: 32px; height: 32px; line-height: 30px; border: 0; background: none; color: #bbbbae; font-size: 24px; }
#edRoot .edHead .edX:hover { color: var(--ed-gold-hi); }
/* 叠加浮窗（Debug Rendering / 敌军 AI）的标题栏不带眉题，顶上留白收紧 */
#edRoot :is(.edPanel.debugRendering, .edPanel.ai) .edHead { padding-top: 16px; }
#edRoot .edBody { padding: 8px 22px 26px; }
/* 标题下固定的一条工具栏（特效编辑器的播放栏）：不随正文滚动 */
.edPanelBar { flex: 0 0 auto; padding: 0 14px 8px; background: #101416; border-bottom: 1px solid #363d40; }
#edRoot .edPanelBar { padding: 0 22px 10px; background: #0a0b0999; border-bottom: 1px solid var(--ed-rule); }

/* 分组 = 声音设置页的 audioGroup：宽字距灰字 + 一条细线 */
#edRoot .edSection { margin: 20px 0 4px; padding: 0; border: 0; background: none; }
#edRoot .edSection:first-child { margin-top: 12px; }
#edRoot .edSection > .h {
  margin: 0 0 10px; padding: 0 0 9px; border-bottom: 1px solid var(--ed-rule-2);
  color: var(--ed-text-3); font-size: 12px; font-weight: 400; letter-spacing: 0.2em;
}
#edRoot .edRow { gap: 12px; margin: 7px 0; min-height: 28px; }
#edRoot .edRow > .l { flex-basis: 96px; color: var(--ed-text-2); font-size: 13px; letter-spacing: 0.04em; }

/* 按钮 = 设置页开关：细描边、直角、宽字距；按下态金字金边 + 5 px 金方块 */
#edRoot .edBtn {
  min-height: 31px; padding: 4px 13px; border: 1px solid var(--ed-edge); border-radius: 0; background: #13140b55;
  color: #c6c7bd; font: 400 13px/1.4 var(--ui-font); letter-spacing: 0.08em;
  transition: color 0.12s linear, background 0.12s linear, border-color 0.12s linear;
}
#edRoot .edBtn:hover { color: var(--ed-gold-hi); border-color: #cdb77b88; background: var(--ed-sel); }
#edRoot .edBtn.on { color: var(--ed-gold-text); border-color: #cdb77b88; background: var(--ed-sel-strong); }
#edRoot .edBtn[aria-pressed]::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 8px 2px 0; background: currentColor; opacity: 0.3; }
#edRoot .edBtn[aria-pressed="true"]::before { opacity: 1; }
#edRoot .edBtn:disabled { opacity: 0.45; cursor: default; }
#edRoot .edBtn.danger:hover { color: #f0a08f; border-color: #d6604a99; background: linear-gradient(90deg, #d6604a22, transparent); }
#edRoot .edBtns { gap: 6px; margin: 8px 0; }

/* 选项 chips：同一套描边，选中 = 金字金边 + 渐变 */
#edRoot .edChips { gap: 6px; margin: 8px 0 10px; }
#edRoot .edChip {
  min-height: 28px; padding: 3px 12px; border: 1px solid var(--ed-rule-2); border-radius: 0; background: transparent;
  color: #b9bcb7; font: 400 12.5px/1.5 var(--ui-font); letter-spacing: 0.08em; transition: color 0.12s linear, background 0.12s linear, border-color 0.12s linear;
}
#edRoot .edChip:hover { color: var(--ed-gold-hi); border-color: var(--ed-edge); background: var(--ed-sel); }
#edRoot .edChip.on { color: var(--ed-gold-text); border-color: #cdb77b88; background: var(--ed-sel-strong); }

#edRoot .edPanel :is(select, input[type="text"], input[type="number"], textarea) {
  min-height: 31px; padding: 4px 9px; border: 1px solid var(--ed-edge); border-radius: 0; box-sizing: border-box;
  background: var(--ed-field); color: var(--ed-text); font: 13px/1.4 var(--ui-font); letter-spacing: 0.03em;
}
#edRoot .edPanel textarea { font: 11.5px/1.6 var(--ui-mono); letter-spacing: 0; }
#edRoot .edPanel :is(select, input, textarea):focus { border-color: var(--ed-gold); outline: none; }
#edRoot .edPanel select option { background: #11120e; color: var(--ed-text); }

/* 滑杆 = 声音设置页：3 px 金色填充细轨 + 7×17 竖条滑块（--fill 由 Script_EditorUi.Slider 写） */
#edRoot .edPanel input[type="range"] { height: 26px; --fill: 50%; cursor: pointer; }
#edRoot .edPanel input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 0; background: linear-gradient(to right, var(--ed-gold-fill) var(--fill), #a4a59450 var(--fill));
}
#edRoot .edPanel input[type="range"]::-moz-range-track { height: 3px; background: #a4a59450; }
#edRoot .edPanel input[type="range"]::-moz-range-progress { height: 3px; background: var(--ed-gold-fill); }
#edRoot .edPanel input[type="range"]::-webkit-slider-thumb { width: 7px; height: 17px; margin-top: -7px; border-radius: 1px; background: var(--ed-thumb); }
#edRoot .edPanel input[type="range"]::-moz-range-thumb { width: 7px; height: 17px; border: 0; border-radius: 1px; background: var(--ed-thumb); }
#edRoot .edPanel input[type="range"]:is(:hover, :focus-visible)::-webkit-slider-thumb { background: var(--ed-gold-hi); box-shadow: 0 0 0 3px #dfbd6844; }
#edRoot .edPanel input[type="range"]:focus-visible { outline: none; }
#edRoot .edVal { color: var(--ed-text); font-size: 12.5px; }
/* 滑杆读数那一格是行内写死的 44px，「10.00 s」会折成两行：放宽并不许折行 */
#edRoot .edRow > .l:has(> .edVal) { flex: 0 0 auto !important; min-width: 48px; white-space: nowrap; }

/* 列表 = 选章列表：左侧金边 + 渐变的选中条 */
#edRoot .edList { border: 1px solid var(--ed-rule-2); background: #0a0b0999; }
#edRoot .edList .it {
  min-height: 30px; padding: 4px 12px 4px 11px; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid #c1bdab14;
  align-items: center; color: #c6c7bd; letter-spacing: 0.04em;
}
#edRoot .edList .it:hover { background: #d8d4c30f; color: var(--ed-text-hi); }
#edRoot .edList .it.on { border-left-color: var(--ed-gold); background: var(--ed-sel-strong); color: var(--ed-gold); }
#edRoot .edList .it .t { color: var(--ed-text-4); letter-spacing: 0.02em; }

/* 读数：灰键名 + 象牙白等宽值，细线分行 */
#edRoot .edFacts { margin: 8px 0 2px; }
#edRoot .edFacts .f { padding: 5px 0; border-bottom: 1px solid #c1bdab1a; font-size: 12.5px; }
#edRoot .edFacts .f:last-child { border-bottom: 0; }
#edRoot .edFacts .f .k { color: var(--ed-text-4); letter-spacing: 0.04em; }
#edRoot .edFacts .f .v { color: var(--ed-text); }
#edRoot .edFacts .f .v.warn { color: var(--ed-gold-text); }
#edRoot .edFacts .f .v.bad { color: var(--ed-bad); }
#edRoot .edFacts .f .v.good { color: var(--ed-good); }

/* 说明 = 声音页右栏的正文：灰字宽行距，左侧一条细线；告警用金色 */
#edRoot .edNote {
  margin: 8px 0; padding: 1px 0 1px 11px; border: 0; border-left: 1px solid var(--ed-edge); border-radius: 0; background: none;
  color: var(--ed-text-4); font-size: 12.5px; line-height: 1.85;
}
#edRoot .edNote.warn { border-left-color: var(--ed-gold); color: var(--ed-gold-text); }
#edRoot .edJsonFold > summary { border-radius: 0; border-color: var(--ed-rule-2); background: transparent; letter-spacing: 0.08em; padding: 6px 10px; }
#edRoot .edJsonFold[open] > summary { color: var(--ed-gold-text); border-color: #cdb77b66; }
#edRoot .edAssetTable th { background: var(--ed-black); color: var(--ed-text-3); letter-spacing: 0.12em; font-weight: 400; border-bottom-color: var(--ed-rule); }
#edRoot .edAssetTable td { border-bottom-color: #c1bdab1a; }
#edRoot .edAssetTable tbody tr:hover { background: var(--ed-sel); }
#edRoot .edAssetRuleCard { border-radius: 0; border-color: var(--ed-rule-2); background: #0a0b0999; }
#edRoot :is(.edFacialTimeline, .edFpsLegend) { border-radius: 0; border-color: var(--ed-edge); background: var(--ed-panel); }

/* 右上角入口（高级工具关着时）与屏幕中央的提示 */
#edRoot .edGear { background-color: #070807d9; border-color: #c1bdab47; }
#edRoot .edGear:hover { background-color: #11120e; border-color: #edca83b3; }
#edRoot .edHint { padding: 5px 16px; border-radius: 0; background: #070807e0; border-color: #edca8366; color: var(--ed-gold); letter-spacing: 0.1em; }

@media (max-width: 600px) {
  /* 窄屏：Inspector 改成底部抽屉，上面留出画面 */
  #edRoot:not(.inspectorCollapsed) > .edInspectorToggle { top: calc(48vh + 14px); }
  #edRoot :is(.edPanel.work:not(.debugRendering):not(.ai):not(.assetStandards), .edPanel.edInspectorEmpty),
  #edRoot .edPanel.work.wide:not(.debugRendering):not(.ai):not(.assetStandards) {
    left: 0; right: 0; width: auto; top: auto; height: 52vh; border-left: 0; border-top: 1px solid var(--ed-rule);
    background: var(--ed-panel);
  }
  #edRoot .edPanel.work[data-facial] { bottom: 0; }
  .edPanel.debugRendering { left: 10px; right: 10px; width: auto; top: 84px; bottom: 10px; z-index: 1; }
  .edHint { top: 10px; max-width: calc(100% - 150px); left: 10px; transform: none; }
  #edRoot.toolsOpen .edHint { top: calc(var(--ed-bar-h) + 6px); }
  .edFacialTimeline { left: 8px; right: 8px; }
  .edMenuStatus { display: none; }
  .edVolumeRange { width: 64px; }
  .edMenuBrand { font-size: 15px; padding-right: 14px; }
}

/* Empty status messages do not take up space in compact testing panels. */
.edNote:empty { display: none; }

/* --- 敌军 AI 编辑器（叠加层） -------------------------------------------- */
/* 位置：让开 Debug Rendering（left:14，宽 368），也不占右侧 Inspector 的位子 ——
   这三样常常同时开着。窄屏由下面的媒体查询接管。 */
.edPanel.ai { left: 396px; right: auto; width: 420px; bottom: 18px; }

/* 六个分节常驻 DOM（外部按 [data-page] 数得到六个），只有当前那一页显示。 */
.edAiPage { display: none; }
.edAiPage.on { display: block; }
.edAiPages { position: sticky; top: -12px; z-index: 1; background: var(--ui-panel); padding: 2px 0 4px; margin: -2px 0 4px; }

/* 直方图：名字 / 横条 / 数字三列，只改宽度与文字，不重建行。 */
.edAiBars .r { display: flex; align-items: center; gap: 6px; padding: 1px 0; font-size: 11.5px; }
.edAiBars .r > .n { flex: 0 0 92px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edAiBars .r > .t { flex: 1 1 auto; height: 8px; background: rgba(214, 217, 209, 0.10); position: relative; }
.edAiBars .r > .t > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ui-gold); }
.edAiBars .r > .v { flex: 0 0 30px; text-align: right; }

/* 行为图 */
.edAiGraph { border: 1px solid rgba(214, 217, 209, 0.14); background: rgba(0, 0, 0, 0.3); margin: 4px 0; }
.edAiGraph svg { display: block; width: 100%; height: auto; }
.edAiGraph .e { stroke: rgba(214, 217, 209, 0.26); stroke-width: 1; fill: none; }
.edAiGraph .e.hot { stroke: var(--ui-gold); stroke-width: 2; }
.edAiGraph .hit { stroke: transparent; stroke-width: 9; fill: none; }
.edAiGraph .n rect { fill: rgba(10, 12, 12, 0.88); stroke: rgba(214, 217, 209, 0.3); stroke-width: 1; }
.edAiGraph .n.hot rect { fill: rgba(30, 34, 30, 0.95); stroke-width: 1.6; }
.edAiGraph .n.sel rect { fill: var(--ui-selection); stroke: var(--ui-gold); stroke-width: 2; }
.edAiGraph text { fill: var(--ui-text); font: 8px var(--ui-font); text-anchor: middle; }
.edAiGraph text.c { fill: var(--ui-muted); font: 8px ui-monospace, Consolas, monospace; }
.edAiGraph .n.sel text { fill: var(--ui-gold); }

/* 状态时间带：一格一次状态切换，宽度按持续时长 */
.edAiBand {
  position: relative; height: 18px; margin: 5px 0 2px; overflow: hidden;
  border: 1px solid rgba(214, 217, 209, 0.18); background: rgba(0, 0, 0, 0.35);
}
.edAiBand > i { position: absolute; top: 0; bottom: 0; }

/* 调参：一次只显示一张表 */
.edAiTable { display: none; }
.edAiTable.on { display: block; }
/* 表选择器钉在分页 Chips 底下（那一条高 32 px、起点 −12 px，所以正好 20 px）：
   两百多根滑杆滚起来，找不到「我现在在哪张表」比找不到某一根还难受。 */
.edAiTables { position: sticky; top: 20px; z-index: 1; background: var(--ui-panel); padding: 4px 0; margin: 0 0 4px; }
/* 行为图点边跳过来的那一行闪一下 —— 二百多根滑杆里找不到「就是这根」 */
@keyframes edAiFlash {
  0%, 100% { background: transparent; }
  20%, 60% { background: rgba(223, 189, 104, 0.28); }
}
.edAiFlash { animation: edAiFlash 1.1s linear 1; }

@media (max-width: 1200px) {
  .edPanel.ai { left: 14px; width: min(420px, calc(100vw - var(--ed-inspector-w) - 42px)); }
}
@media (max-width: 900px) {
  .edPanel.ai { width: min(360px, calc(100% - var(--ed-inspector-w) - 42px)); }
}
@media (max-width: 600px) {
  .edPanel.ai { left: 10px; right: 10px; width: auto; top: 84px; bottom: 10px; z-index: 1; }
}
