/* ==================================================================
   editor.css — chaloa (6CA) Modal 全屏 Markdown 编辑器
   1px 极简边框 + [Ln X, Col Y] 状态栏，与终端主题 CSS 变量联动
   ================================================================== */

#editor-root {
  display: none;
}
#editor-root.open {
  display: block;
}

/* 遮罩 */
.editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  backdrop-filter: blur(2px);
}

/* Modal 容器：全屏，1px 极简边框 */
.editor-modal {
  width: 100%;
  height: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: var(--font-mono);
}

/* 标题栏 */
.editor-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--thumb-dim);
  font-size: 13px;
  color: var(--dim);
  user-select: none;
}
.editor-titlebar .ed-path {
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editor-titlebar .ed-hint {
  white-space: nowrap;
  color: var(--dim);
}
.editor-titlebar .ed-hint b {
  color: var(--fg);
  font-weight: 600;
}

/* 编辑区 */
.editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#editor-textarea {
  flex: 1;
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 14px;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
#editor-textarea::selection {
  background: var(--selection);
}
#editor-textarea::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
#editor-textarea::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 3px;
}
#editor-textarea::-webkit-scrollbar-track {
  background: transparent;
}

/* [Ln X, Col Y] 状态栏 */
.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 14px;
  border-top: 1px solid var(--thumb-dim);
  font-size: 12px;
  color: var(--dim);
  user-select: none;
}
.editor-statusbar .ed-lncol {
  color: var(--accent);
  letter-spacing: 0.4px;
}
.editor-statusbar .ed-state {
  white-space: nowrap;
}
.editor-statusbar .ed-state.ok { color: var(--ok); }
.editor-statusbar .ed-state.err { color: var(--err); }

/* 无边框按钮：与终端按钮风格一致 */
.editor-titlebar .term-btn {
  font-size: 12px;
}

@media (max-width: 640px) {
  .editor-overlay { padding: 8px; }
  .editor-modal { max-height: 96vh; border-radius: 4px; }
  #editor-textarea { font-size: 13px; padding: 10px; }
}
