/* DevKit 局部样式（补充 Tailwind 无法覆盖的细节） */
html { scroll-behavior: smooth; }

body {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.font-code, code, pre, textarea.code-editor, .code-text {
  font-family: "Spline Sans Mono", "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
}

textarea.code-editor {
  tab-size: 2;
  line-height: 1.7;
}

/* 轻量滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: #C3C6D7 transparent;
}
.dark * {
  scrollbar-color: #434655 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #C3C6D7; border-radius: 9999px; }
.dark *::-webkit-scrollbar-thumb { background: #434655; }
*::-webkit-scrollbar-track { background: transparent; }

/* JSON 树形视图 */
.tree-node { position: relative; }
.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}
.tree-toggle:hover { background: #EDEDF9; }
.dark .tree-toggle:hover { background: #282A32; }
.tree-children { margin-left: 18px; border-left: 1px dashed #DFE1F4; padding-left: 10px; }
.dark .tree-children { border-left-color: #434655; }
.tree-key { color: #004AC6; }
.dark .tree-key { color: #B4C5FF; }
.tree-type {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #EDEDF9;
  color: #434655;
}
.dark .tree-type { background: #282A32; color: #C3C6D7; }

/* Diff 视图 */
.diff-line { display: flex; font-size: 14px; line-height: 22px; }
.diff-num {
  width: 42px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 8px;
  color: #737686;
  user-select: none;
}
.diff-add { background: rgba(22, 101, 52, 0.1); }
.diff-del { background: rgba(186, 26, 26, 0.1); }
.dark .diff-add { background: rgba(74, 222, 128, 0.12); }
.dark .diff-del { background: rgba(255, 180, 171, 0.12); }
.diff-text { white-space: pre-wrap; word-break: break-all; padding-right: 8px; }

/* 匹配高亮 */
mark.regex-hit {
  background: #FFEDE6;
  color: #943700;
  border-radius: 3px;
  padding: 0 1px;
}
.dark mark.regex-hit { background: #581E00; color: #FFB596; }

/* 表单基础 */
.dk-input {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #C3C6D7;
  background: #F3F3FE;
  padding: 6px 10px;
  font-size: 15px;
  color: #191B23;
  outline: none;
}
.dk-input:focus { border-color: #004AC6; }
.dark .dk-input { border-color: #434655; background: #1D1F27; color: #E1E2ED; }
.dark .dk-input:focus { border-color: #B4C5FF; }

.dk-checkbox { accent-color: #004AC6; }
.dark .dk-checkbox { accent-color: #B4C5FF; }

/* 表格 */
.dk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dk-table th, .dk-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #E7E7F3; }
.dark .dk-table th, .dark .dk-table td { border-bottom-color: #282A32; }
.dk-table th { font-weight: 600; color: #434655; }
.dark .dk-table th { color: #C3C6D7; }

/* 拖拽态 */
.drop-active { border-color: #004AC6 !important; background: #EEEFFF !important; }
.dark .drop-active { border-color: #B4C5FF !important; background: #282A32 !important; }

/* Toast 显示 */
#toast-banner.is-visible { display: flex; }
