:root {
  --gn-font-sans: "Inter", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Micro Hei", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Ubuntu", sans-serif;
  --gn-font-mono: "JetBrains Mono", "Noto Sans Mono CJK SC", "Noto Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

html, body, #root {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Disable global scrollbar */
  background-color: transparent !important; /* CRITICAL: Allow Wails window transparency */
}

body, #root {
  border-radius: var(--gonavi-border-radius); /* Slightly rounded app window corners */
}

body,
button,
input,
textarea,
select {
  font-family: var(--gn-font-sans);
}

code,
pre,
kbd,
samp {
  font-family: var(--gn-font-mono);
}

/* 侧边栏 Tree 样式优化 */
.ant-tree .ant-tree-treenode {
  width: 100%;
}

.ant-tree .ant-tree-node-content-wrapper {
  display: flex !important;
  align-items: center;
  white-space: nowrap;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.ant-tree .ant-tree-title,
.ant-tree .ant-tree-treenode * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

.ant-tree .ant-tree-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.sidebar-tree-scroll-shell {
  overflow-x: auto;
  overflow-y: hidden;
}

.sidebar-tree-scroll-content {
  min-width: 100%;
}

.sidebar-tree-scroll-shell .ant-tree {
  min-width: 100%;
}

.sidebar-tree-scroll-shell .ant-tree .ant-tree-list-holder,
.sidebar-tree-scroll-shell .ant-tree .ant-tree-list-holder-inner {
  min-width: 100%;
}

.sidebar-tree-scroll-shell .ant-tree .ant-tree-treenode {
  width: auto;
  min-width: 100%;
}

.sidebar-tree-scroll-shell .ant-tree .ant-tree-node-content-wrapper {
  width: auto !important;
  min-width: 0;
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.sidebar-tree-scroll-shell .ant-tree .ant-tree-switcher {
  flex: 0 0 24px;
  width: 24px;
  min-width: 24px;
}

.sidebar-tree-scroll-shell .ant-tree .ant-tree-iconEle {
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-end: 0;
}

.sidebar-tree-scroll-shell .ant-tree .ant-tree-title {
  flex: 0 0 auto;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.redis-viewer-workbench .ant-tree {
    background: transparent;
}

.redis-viewer-workbench .ant-tree .ant-tree-list-holder-inner,
.redis-viewer-workbench .ant-tree .ant-tree-list-holder-inner .ant-tree-treenode {
    width: 100% !important;
}

.redis-viewer-workbench .ant-tree .ant-tree-node-content-wrapper {
    min-height: 36px;
    border-radius: 14px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
}

.redis-viewer-workbench .ant-tree .ant-tree-node-content-wrapper:hover,
.redis-viewer-workbench .ant-tree .ant-tree-node-content-wrapper:active,
.redis-viewer-workbench .ant-tree .ant-tree-node-content-wrapper:focus,
.redis-viewer-workbench .ant-tree .ant-tree-node-content-wrapper:focus-visible,
.redis-viewer-workbench .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected,
.redis-viewer-workbench .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected:hover {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.redis-viewer-workbench .ant-tree .ant-tree-treenode {
    padding: 2px 0;
    width: 100%;
    border-radius: 14px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    border: none;
    align-items: center;
    position: relative;
    z-index: 0;
    display: flex !important;
    box-sizing: border-box;
}

.redis-viewer-workbench .ant-tree .ant-tree-switcher {
    width: 0 !important;
    min-width: 0 !important;
    margin-inline-end: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
}

.redis-viewer-workbench .ant-tree .ant-tree-switcher:hover,
.redis-viewer-workbench .ant-tree .ant-tree-switcher:active,
.redis-viewer-workbench .ant-tree .ant-tree-switcher:focus {
    background: transparent !important;
}

.redis-viewer-workbench .redis-tree-expander-button:hover,
.redis-viewer-workbench .redis-tree-expander-button:focus-visible {
    background: transparent !important;
    outline: none;
}

.redis-viewer-workbench .ant-radio-group .ant-radio-button-wrapper {
    border-radius: 10px;
    margin-inline-end: 6px;
}

.redis-viewer-workbench .ant-radio-group .ant-radio-button-wrapper:last-child {
    margin-inline-end: 0;
}

.redis-viewer-workbench .ant-table {
    background: transparent;
}

.redis-viewer-workbench .ant-table-wrapper .ant-table-thead > tr > th {
    font-weight: 700;
}

/* Scrollbar styling for dark mode */
body[data-theme='dark'] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
body[data-theme='dark'] ::-webkit-scrollbar-track {
    background: #1f1f1f;
}
body[data-theme='dark'] ::-webkit-scrollbar-corner {
    background: #1f1f1f;
}
body[data-theme='dark'] ::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 4px;
    border: 2px solid #1f1f1f;
}
body[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Scrollbar styling for light mode (transparent-friendly) */
body[data-theme='light'] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
body[data-theme='light'] ::-webkit-scrollbar-track {
    background: transparent;
}
body[data-theme='light'] ::-webkit-scrollbar-corner {
    background: transparent;
}
body[data-theme='light'] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
body[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.30);
    border: 2px solid transparent;
    background-clip: content-box;
}

/* Ensure body background matches theme to avoid white flashes, but kept transparent for window composition */
body {
    transition: color 0.3s;
}

body[data-theme='dark'] {
    /* 移除全局 text-shadow：对每个文本元素增加 GPU compositing 成本，
       在透明窗口环境下会显著加剧 GPU 负载 */
}

/* 暗色 + 透明：提升选中/焦点可读性，避免默认蓝色在半透明背景下发灰 */
body[data-theme='dark'] .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected,
body[data-theme='dark'] .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected:hover {
    background: rgba(246, 196, 83, 0.24) !important;
    color: rgba(255, 236, 179, 0.98) !important;
}

body[data-theme='dark'] .redis-viewer-workbench .ant-tree .ant-tree-treenode:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

body[data-theme='dark'] .redis-viewer-workbench .ant-tree .ant-tree-treenode.ant-tree-treenode-selected,
body[data-theme='dark'] .redis-viewer-workbench .ant-tree .ant-tree-treenode.ant-tree-treenode-selected:hover {
    background: linear-gradient(90deg, rgba(246, 196, 83, 0.22), rgba(246, 196, 83, 0.08)) !important;
    border: 1px solid rgba(246, 196, 83, 0.24) !important;
}

body[data-theme='dark'] .ant-checkbox-checked .ant-checkbox-inner {
    background-color: #f6c453 !important;
    border-color: #f6c453 !important;
}

body[data-theme='dark'] .ant-checkbox-indeterminate .ant-checkbox-inner::after {
    background-color: #f6c453 !important;
}

body[data-theme='dark'] .ant-checkbox:hover .ant-checkbox-inner,
body[data-theme='dark'] .ant-checkbox-wrapper:hover .ant-checkbox-inner {
    border-color: #f6c453 !important;
}

body[data-theme='dark'] .ant-radio-checked .ant-radio-inner {
    border-color: #f6c453 !important;
    background-color: #f6c453 !important;
}

body[data-theme='dark'] .ant-radio-wrapper:hover .ant-radio-inner,
body[data-theme='dark'] .ant-radio:hover .ant-radio-inner {
    border-color: #f6c453 !important;
}

body[data-theme='dark'] .ant-switch.ant-switch-checked {
    background: #d8a93b !important;
}

body[data-theme='dark'] .ant-table-tbody > tr.ant-table-row-selected > td,
body[data-theme='dark'] .ant-table-tbody .ant-table-row.ant-table-row-selected > .ant-table-cell {
    background: rgba(246, 196, 83, 0.18) !important;
}

body[data-theme='dark'] .ant-table-tbody > tr.ant-table-row-selected:hover > td,
body[data-theme='dark'] .ant-table-tbody .ant-table-row.ant-table-row-selected:hover > .ant-table-cell {
    background: rgba(246, 196, 83, 0.26) !important;
}

body[data-theme='dark'] .redis-viewer-workbench .ant-radio-button-wrapper {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(230, 234, 242, 0.9);
}

body[data-theme='dark'] .redis-viewer-workbench .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
    background: rgba(246, 196, 83, 0.16);
    border-color: rgba(246, 196, 83, 0.3);
    color: #f6c453;
}

body[data-theme='light'] .redis-viewer-workbench .ant-tree .ant-tree-treenode:hover {
    background: rgba(15, 23, 42, 0.04) !important;
}

body[data-theme='light'] .redis-viewer-workbench .ant-tree .ant-tree-treenode.ant-tree-treenode-selected,
body[data-theme='light'] .redis-viewer-workbench .ant-tree .ant-tree-treenode.ant-tree-treenode-selected:hover {
    color: rgba(15, 23, 42, 0.92) !important;
    background: linear-gradient(90deg, rgba(22, 119, 255, 0.12), rgba(22, 119, 255, 0.04)) !important;
    border: 1px solid rgba(22, 119, 255, 0.18) !important;
}

body[data-theme='light'] .redis-viewer-workbench .ant-radio-button-wrapper {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(15, 23, 42, 0.08);
    color: rgba(51, 65, 85, 0.88);
}

body[data-theme='light'] .redis-viewer-workbench .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
    background: rgba(22, 119, 255, 0.1);
    border-color: rgba(22, 119, 255, 0.22);
    color: #1677ff;
}

/* 连接配置弹窗：滚动仅在弹窗 body 内部，不使用外层 wrap 滚动条 */
.connection-modal-wrap {
    overflow: hidden !important;
}

.connection-modal-wrap .ant-modal-content {
    max-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
}

.connection-modal-wrap .ant-modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

.connection-modal-wrap .ant-modal-footer {
    flex-shrink: 0;
}

/* Custom Title Bar Close Button Hover */
.titlebar-close-btn:hover {
    background-color: #ff4d4f !important;
    color: #fff !important;
}

.driver-manager-modal .ant-modal-body {
    background: var(--ant-color-bg-layout, #f5f5f5);
}

.driver-manager-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.driver-manager-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: stretch;
    padding: 14px 16px;
    border: 1px solid rgba(5, 5, 5, 0.08);
    border-radius: 8px;
    background: var(--ant-color-bg-container, #fff);
}

.driver-manager-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.driver-manager-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    gap: 8px;
    min-width: 360px;
}

.driver-manager-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid rgba(5, 5, 5, 0.08);
    border-radius: 8px;
    background: rgba(5, 5, 5, 0.02);
}

.driver-manager-stat span:first-child {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.driver-manager-stat-warning span:first-child {
    color: #d48806;
}

.driver-manager-directory-panel {
    border: 1px solid rgba(5, 5, 5, 0.08);
    border-radius: 8px;
    background: var(--ant-color-bg-container, #fff);
}

.driver-manager-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.driver-manager-search {
    min-width: 280px;
    flex: 1 1 360px;
}

.driver-manager-toolbar-actions {
    justify-content: flex-end;
}

.driver-manager-batch-progress-panel {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 8px;
}

.driver-manager-batch-progress-header,
.driver-manager-batch-progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.driver-manager-batch-progress-header span,
.driver-manager-batch-progress-meta span {
    min-width: 0;
    word-break: break-word;
}

.driver-manager-list-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 24px;
}

.driver-manager-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.driver-manager-card {
    border: 1px solid rgba(5, 5, 5, 0.08);
    border-radius: 8px;
    background: var(--ant-color-bg-container, #fff);
    overflow: hidden;
}

.driver-manager-card-warning {
    border-color: rgba(250, 173, 20, 0.35);
}

.driver-manager-card-ready {
    border-color: rgba(82, 196, 26, 0.22);
}

.driver-manager-card-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 38%);
    gap: 16px;
    padding: 16px;
}

.driver-manager-card-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.driver-manager-title-row,
.driver-manager-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.driver-manager-driver-name {
    font-size: 16px;
}

.driver-manager-meta-row {
    row-gap: 4px;
}

.driver-manager-update-note {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(250, 173, 20, 0.1);
}

.driver-manager-note-text,
.driver-manager-muted-message {
    margin-bottom: 0 !important;
}

.driver-manager-muted-message {
    color: var(--ant-color-text-secondary);
}

.driver-manager-card-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.driver-manager-control-block {
    display: grid;
    gap: 4px;
}

.driver-manager-control-label,
.driver-manager-small-text {
    font-size: 12px;
}

.driver-manager-version-control {
    display: grid;
    gap: 4px;
}

.driver-manager-version-lock {
    line-height: 24px;
}

.driver-manager-card-actions {
    justify-content: flex-end;
}

.driver-manager-card-actions .ant-btn {
    min-width: 88px;
}

.driver-manager-footer-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .driver-manager-header,
    .driver-manager-card-main {
        grid-template-columns: 1fr;
    }

    .driver-manager-stats {
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .driver-manager-card-actions {
        justify-content: flex-start;
    }

    .driver-manager-batch-progress-header,
    .driver-manager-batch-progress-meta {
        justify-content: flex-start;
    }
}

.security-update-action-btn.ant-btn,
.security-update-action-btn.ant-btn-default,
.security-update-action-btn.ant-btn-primary,
.security-update-action-btn.ant-btn-text {
    box-shadow: none !important;
}

.security-update-action-btn.ant-btn:focus,
.security-update-action-btn.ant-btn:focus-visible,
.security-update-action-btn.ant-btn-default:focus,
.security-update-action-btn.ant-btn-default:focus-visible,
.security-update-action-btn.ant-btn-primary:focus,
.security-update-action-btn.ant-btn-primary:focus-visible,
.security-update-action-btn.ant-btn-text:focus,
.security-update-action-btn.ant-btn-text:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.security-update-banner {
    position: relative;
    isolation: isolate;
}

.security-update-result-card {
    transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.security-update-result-card-active {
    animation: security-update-result-pulse 1.8s ease;
}

@keyframes security-update-result-pulse {
    0% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-2px);
    }
    100% {
        transform: translateY(0);
    }
}
.gonavi-query-editor-link-hint {
  color: #1677ff !important;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.gonavi-query-editor-object-token {
  color: #2563eb;
}

.gonavi-query-editor-column-token {
  color: #0f766e;
}

.gonavi-query-editor-db-token {
  color: #7c3aed;
}

body[data-theme='dark'] .gonavi-query-editor-object-token {
  color: #7dd3fc;
}

body[data-theme='dark'] .gonavi-query-editor-link-hint {
  color: #69b1ff !important;
}

body[data-theme='dark'] .gonavi-query-editor-column-token {
  color: #5eead4;
}

body[data-theme='dark'] .gonavi-query-editor-db-token {
  color: #c4b5fd;
}

/* Legacy sidebar resize bounds — mirror v2 .gn-v2-app-sider so Ant Design inline width locks do not collapse drag range. */
body[data-ui-version="legacy"] .ant-layout-sider {
  min-width: 232px !important;
  max-width: 420px !important;
}
