/* JK Game DOS Arcade — 存檔編輯器（hexedit.js） */
body.hx-open { overflow: hidden; }

.hx {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(7, 6, 15, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hx[hidden] { display: none; }

.hx-box {
  background: var(--bg-2);
  border: 2px solid var(--jk-purple);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25), var(--shadow);
  width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.hx-head,
.hx-tools,
.hx-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.hx-foot { border-bottom: 0; border-top: 1px solid var(--line); }
.hx-head strong { font-family: var(--font-pixel); font-size: 11px; color: var(--jk-cyan); }
.hx-head .hx-close { margin-left: auto; }
.hx-note { color: var(--muted); font-size: 13px; }
.hx-sep { flex: 1; }

.hx select,
.hx input[type="text"],
.hx input:not([type]) {
  background: #12081f;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 5px 6px;
  font-family: var(--font-term);
  font-size: 15px;
}

.hx-tools label { font-size: 13px; color: var(--muted); }

.hx-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0;
  min-height: 0;
  flex: 1;
}

.hx-grid {
  position: relative;
  overflow: auto;
  height: min(60vh, 560px);
  background: #08060f;
  font-family: var(--font-term);
  font-size: 16px;
  outline: none;
}

.hx-spacer { width: 1px; }
.hx-rows { position: absolute; inset: 0; }

.hx-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  line-height: 22px;
  white-space: nowrap;
  padding: 0 10px;
}

.hx-off { color: var(--jk-purple); margin-right: 10px; }

.hx-b {
  display: inline-block;
  width: 24px;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
}

.hx-b:hover { background: rgba(139, 92, 246, 0.25); }
.hx-b.is-changed { color: var(--jk-gold); }
.hx-b.is-cursor { background: var(--jk-cyan); color: #07060f; }
.hx-pad { cursor: default; }
.hx-ascii { margin-left: 12px; color: var(--muted); }

.hx-side {
  border-left: 1px solid var(--line);
  padding: 10px 12px;
  overflow: auto;
  height: min(60vh, 560px);
}

.hx-side h3 {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--jk-cyan);
  margin: 0 0 8px;
}

.hx-inspect div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}

.hx-inspect span { color: var(--muted); }
.hx-inspect b { font-family: var(--font-term); font-size: 16px; }
.hx-tip { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 10px 0 0; }

.hx-hits { margin-top: 14px; }
.hx-hits button {
  display: block;
  width: 100%;
  text-align: left;
  background: #12081f;
  border: 1px solid var(--line);
  color: var(--jk-cyan);
  font-family: var(--font-term);
  font-size: 14px;
  padding: 3px 6px;
  margin-bottom: 3px;
  cursor: pointer;
}

.hx-hits button:hover { border-color: var(--jk-cyan); }
.hx-hits i { color: var(--jk-gold); font-style: normal; float: right; }
.hx-status { color: var(--muted); font-size: 13px; flex: 1; }

@media (max-width: 820px) {
  .hx-body { grid-template-columns: minmax(0, 1fr); }
  .hx-side { border-left: 0; border-top: 1px solid var(--line); height: auto; max-height: 30vh; }
  .hx-grid { height: 40vh; font-size: 14px; }
  .hx-b { width: 20px; }
  .hx-ascii { display: none; }
}
