/* 全局样式 - Mantine 版本 */

/* 基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-feature-settings: "rlig" 1, "calt" 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--mantine-color-gray-4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mantine-color-gray-5);
}

[data-mantine-color-scheme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--mantine-color-dark-4);
}

[data-mantine-color-scheme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--mantine-color-dark-3);
}

/* Allotment 分割线样式 */
.split-view-view {
  overflow: hidden !important;
}

.sash {
  background: var(--mantine-color-gray-3) !important;
  transition: background 0.15s ease;
}

.sash:hover {
  background: var(--mantine-color-teal-6) !important;
}

[data-mantine-color-scheme="dark"] .sash {
  background: var(--mantine-color-dark-4) !important;
}

[data-mantine-color-scheme="dark"] .sash:hover {
  background: var(--mantine-color-teal-7) !important;
}

.sash-vertical {
  width: 4px !important;
}

.sash-horizontal {
  height: 4px !important;
}

/* Monaco Editor 样式覆盖 */
.monaco-editor {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

/* 禁用选中文本高亮 */
::selection {
  background: var(--mantine-color-teal-light);
}

/* 动画 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* 面板布局 */
.panel-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--mantine-color-gray-3);
  padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
}

[data-mantine-color-scheme="dark"] .panel-header {
  border-bottom-color: var(--mantine-color-dark-4);
}

.panel-content {
  flex: 1;
  overflow: hidden;
}

/* 工具栏样式 */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--mantine-spacing-xs);
  padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
  border-bottom: 1px solid var(--mantine-color-gray-3);
  background: var(--mantine-color-body);
}

[data-mantine-color-scheme="dark"] .toolbar {
  border-bottom-color: var(--mantine-color-dark-4);
}

/* 列表项样式 */
.list-item {
  display: flex;
  align-items: center;
  padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: var(--mantine-radius-sm);
}

.list-item:hover {
  background: var(--mantine-color-gray-1);
}

[data-mantine-color-scheme="dark"] .list-item:hover {
  background: var(--mantine-color-dark-5);
}

.list-item.active {
  background: var(--mantine-color-teal-light);
}

[data-mantine-color-scheme="dark"] .list-item.active {
  background: var(--mantine-color-teal-light);
}

/* 代码块样式 */
.code-block {
  font-family: var(--mantine-font-family-monospace);
  font-size: var(--mantine-font-size-xs);
  background: var(--mantine-color-gray-0);
  border-radius: var(--mantine-radius-sm);
  padding: var(--mantine-spacing-xs);
  overflow-x: auto;
}

[data-mantine-color-scheme="dark"] .code-block {
  background: var(--mantine-color-dark-6);
}

/* 日志级别颜色 */
.log-info {
  color: var(--mantine-color-blue-6);
}

.log-success {
  color: var(--mantine-color-green-6);
}

.log-warning {
  color: var(--mantine-color-yellow-6);
}

.log-error {
  color: var(--mantine-color-red-6);
}

/* 分类标签颜色 */
.category-request {
  background: var(--mantine-color-blue-6);
}

.category-parse {
  background: var(--mantine-color-green-6);
}

.category-field {
  background: var(--mantine-color-violet-6);
}

.category-error {
  background: var(--mantine-color-red-6);
}
