/* ========================================
   管理员模式样式
   ======================================== */

/* --- 自定义模态框（替代原生 prompt/confirm，兼容 iframe） --- */
.admin-input-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.admin-input-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  font-family: inherit;
}
.admin-input-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.4;
}
.admin-input-field {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  resize: vertical;
}
.admin-input-field:focus {
  outline: 2px solid var(--accent, #0d9488);
  border-color: transparent;
}
.admin-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.admin-input-actions button {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.admin-input-cancel {
  background: #e2e8f0;
  color: #475569;
}
.admin-input-ok {
  background: var(--accent, #0d9488);
  color: #fff;
  font-weight: 600;
}

/* --- 入口按钮 --- */
.admin-entry {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #0d9488);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform .15s ease, background .15s ease;
}
.admin-entry:hover { transform: scale(1.08); background: var(--accent-light, #14b8a6); }

/* --- 工具栏 --- */
.admin-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: #0f172a;
  color: #fff;
  z-index: 300;
  box-shadow: var(--shadow-md);
}
.admin-bar-title { font-weight: 600; margin-right: 8px; font-size: 14px; }
.admin-bar-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease;
}
.admin-bar-btn:hover { background: rgba(255,255,255,0.24); }
.admin-bar-exit { background: #dc2626; border-color: #dc2626; }
.admin-bar-exit:hover { background: #b91c1c; }
.admin-saved-tip { margin-left: auto; font-size: 12px; color: #94e3d8; }

/* 进入管理员模式后，顶部给工具栏让位 */
body.admin-mode { padding-top: 46px; }
body.admin-mode .header { top: 46px; }

/* --- 板块控制（仅管理员模式可见） --- */
.admin-drag {
  display: none;
  cursor: grab;
  color: var(--accent, #0d9488);
  font-size: 18px;
  user-select: none;
  padding: 0 6px;
}
body.admin-mode .admin-drag { display: inline-block; }
body.admin-mode .admin-drag:active { cursor: grabbing; }
body.admin-mode .section-header { outline: 1px dashed var(--accent, #0d9488); outline-offset: 3px; border-radius: 8px; }

.admin-edit-title, .admin-hide-toggle, .admin-edit-content, .admin-del-section, .admin-cat-edit {
  display: none;
}
body.admin-mode .admin-edit-title,
body.admin-mode .admin-hide-toggle,
body.admin-mode .admin-edit-content,
body.admin-mode .admin-del-section { display: inline-flex; }
body.admin-mode .admin-cat-edit {
  display: inline-flex;
  margin-left: 6px;
  cursor: pointer;
  color: var(--accent, #0d9488);
  font-size: 12px;
  opacity: .7;
}
body.admin-mode .admin-cat-edit:hover { opacity: 1; }

/* 拖拽插入指示线 */
.admin-insert-line {
  height: 4px;
  background: var(--accent, #0d9488);
  border-radius: 4px;
  margin: 4px 0;
  box-shadow: 0 0 0 2px rgba(13,148,136,0.25);
}

/* 自定义内容区默认样式 */
.custom-content { padding: 8px 0; line-height: 1.7; }

/* --- 调色板 --- */
.admin-palette {
  position: fixed;
  right: 18px;
  bottom: 76px;
  width: 240px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 250;
  overflow: hidden;
}
.admin-palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--primary, #1e40af);
  color: #fff;
  font-size: 13px;
}
.admin-palette-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.admin-palette-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.admin-palette-item {
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 14px 8px;
  text-align: center;
  font-size: 13px;
  cursor: grab;
  background: var(--surface-hover, #f1f5f9);
  transition: border-color .15s ease, transform .1s ease;
}
.admin-palette-item:hover { border-color: var(--accent, #0d9488); transform: translateY(-1px); }
.admin-palette-item:active { cursor: grabbing; }
.admin-palette-hint { padding: 0 12px 12px; font-size: 11px; color: var(--text-muted, #94a3b8); }

/* --- 背景设计弹窗 --- */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
}
.admin-modal-card {
  width: 420px;
  max-width: 92vw;
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--primary, #1e40af);
  color: #fff;
  font-weight: 600;
}
.admin-modal-body { padding: 18px; }
.admin-field { margin-bottom: 16px; }
.admin-field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  margin-bottom: 8px;
}
.admin-radio-row { display: flex; gap: 16px; font-size: 13px; }
.admin-radio-row label { font-weight: 400; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.admin-color-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.admin-color-row input[type="color"] { width: 40px; height: 30px; border: 1px solid var(--border); border-radius: 6px; padding: 0; cursor: pointer; }
.admin-field input[type="text"], .admin-field input[type="color"] { border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.admin-hint { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.admin-modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* 让调色板/弹窗内的关闭按钮复用 .admin-palette-close 样式时背景适配 */
.admin-modal-head .admin-palette-close { color: #fff; }
