/* 调试三栏布局：左=预览 / 中=HTML+命中CSS / 右=Markdown；可拖动分隔条调整列宽；本文件最后加载 */
.workspace { grid-template-columns: 1.15fr 7px 1.1fr 7px 0.95fr; }
.preview-pane, .code-pane, .editor-pane { min-width: 0; overflow: hidden; }
.editor-pane { border-right: none; border-left: none; }

/* 列分隔条（可左右拖动） */
.col-resizer { cursor: col-resize; background: var(--line); position: relative; z-index: 5; }
.col-resizer:hover, .col-resizer.active { background: var(--accent); }

.code-pane { display: flex; flex-direction: column; gap: 14px; padding: 16px; min-height: 0; }
.code-block { flex: 1 1 50%; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.code-block .pane-head { margin-bottom: 8px; }
.code-view { flex: 1; min-height: 0; min-width: 0; overflow: auto; margin: 0; background: var(--panel); color: var(--text-dim); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; tab-size: 2; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .col-resizer { display: none; }
  .code-pane { border-top: 1px solid var(--line); }
}

/* ====================================================================
   INSPECTOR 联动高亮 — 点击「展示 / HTML / CSS」任一处，另两处对应部分高亮
   ==================================================================== */
.code-view .insp-h, .code-view .insp-c { cursor: pointer; border-radius: 3px; }
.code-view .insp-h:hover, .code-view .insp-c:hover { background: rgba(54, 166, 255, 0.12); }
.code-view .insp-active { background: rgba(54, 166, 255, 0.22); box-shadow: 0 0 0 1px rgba(54, 166, 255, 0.55); }
.card [data-insp-idx] { cursor: pointer; }
/* 展示卡片高亮：左右两条边线（inset box-shadow，不挤动布局）+ 浅蓝半透明填充 */
.card .insp-active { background: rgba(54, 166, 255, 0.13); box-shadow: inset 2px 0 0 rgba(54, 166, 255, 0.92), inset -2px 0 0 rgba(54, 166, 255, 0.92); }

/* ====================================================================
   CSS 面板·关键信息摘要：标签名 / 字段标签 / 色块
   ==================================================================== */
.code-view .insp-tag { color: #9ecbff; font-weight: 700; }
.code-view .insp-k { display: inline-block; min-width: 3.6em; color: #6f7c8c; }
.code-view .insp-sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: middle; margin: 0 4px 0 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }

/* ====================================================================
   MODULAR GRID OVERLAY — 独立描边方块 + Excel 式编号（仅预览可见，导出不含）
   挂在 .card-frame 上（不进入导出克隆的 .card），顶栏「网格」勾选框控制显隐，默认隐藏。
   具体几何（inset / 模板 / 间距 / 格子与编号）由 grid.js 按选定列数动态计算并写入 inline，以保证格子恒为正方形。
   外边框 1px；格子边框 1px、颜色较浅；最外圈格子去掉服向外的那条边（et/eb/el/er），由外边框充当，避免双线。
   ==================================================================== */
.card-frame { position: relative; }
.grid-overlay {
  position: absolute;
  inset: 6.1111% 8.5185%;   /* 默认值；grid.js 会按列数覆盖 */
  box-sizing: border-box;
  display: none;
  pointer-events: none; z-index: 40;
  border: 1px solid rgba(54, 166, 255, 0.8);
}
body:has(#gridToggle:checked) .grid-overlay { display: grid; }
.grid-overlay > i {
  position: relative;
  box-sizing: border-box;
  border: 1px solid rgba(54, 166, 255, 0.32);
}
.grid-overlay > i.et { border-top: 0; }
.grid-overlay > i.eb { border-bottom: 0; }
.grid-overlay > i.el { border-left: 0; }
.grid-overlay > i.er { border-right: 0; }
.grid-overlay > i > b {
  position: absolute;
  top: 1px; left: 3px;
  font: 600 10px/1.1 "SFMono-Regular", Menlo, Consolas, monospace;
  font-style: normal;
  letter-spacing: .02em;
  color: rgba(54, 166, 255, 0.85);
  pointer-events: none;
  white-space: nowrap;
}
