@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --brand: #2563eb;
    --brand-light: #eff6ff;
    --brand-dark: #1e40af;
    --bg-canvas: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    letter-spacing: -0.01em;
    font-size: 1rem; /* 恢复标准基础字号 */
}

/* 针对不同屏幕尺寸调整基础字号 */
@media (min-width: 1920px) {
    html { font-size: 20px; }
}
@media (max-width: 1919px) and (min-width: 1440px) {
    html { font-size: 18px; }
}
@media (max-width: 1439px) {
    html { font-size: 16px; }
}

.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }

/* 树节点样式：重塑视觉风格，提升精致感 */
.tree-line {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px; /* 恢复圆角，增加精致感 */
    margin: 2px 4px; /* 增加一点左右边距，使高亮框不贴边 */
    height: 36px; /* 稍微增加高度，给文字留出呼吸空间 */
    display: flex;
    align-items: center;
    line-height: 36px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    border: 1px solid transparent;
}

.tree-line:hover {
    background-color: #f1f5f9; 
    border-color: #e2e8f0;
}

/* 选中状态：更现代的视觉表现 */
.is-selected { 
    background-color: #ebf5ff !important; 
    border-color: #bfdbfe !important;
    color: #1e40af !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.is-selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background-color: #3b82f6;
    border-radius: 0 4px 4px 0;
}

.is-selected .node-prefix { color: #93c5fd; }
/* 优化选中状态下的对比度：使用深蓝色 */
.is-selected .text-slate-400, .is-selected .opacity-40, .is-selected .opacity-60 { color: #3b82f6 !important; opacity: 0.8; }
.is-selected .bg-slate-100 { background-color: #dbeafe !important; color: #1e40af !important; }

/* 搜索高亮：更柔和的背景 + 底部强调线 */
.match-search { 
    background-color: #f0fdf4 !important; 
    border-bottom: 2px solid #22c55e !important;
    border-radius: 4px;
}
.match-search span { color: #166534 !important; }
/* 优化搜索高亮下的对比度：使用深绿色 */
.match-search .text-slate-400, .match-search .opacity-40, .match-search .opacity-60 { color: #15803d !important; opacity: 0.7; }
.match-search .bg-slate-100 { background-color: #dcfce7 !important; color: #166534 !important; }

/* 当前聚焦：醒目的绿色圆点/边框 */
.current-focus {
    background-color: #22c55e !important; 
    color: white !important;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}
.current-focus span, .current-focus .bg-slate-100 { color: white !important; background-color: rgba(255, 255, 255, 0.2) !important; }

/* 依赖树内部字体：精调字号与间距 */
.tree-line .text-\[10px\] { font-size: 0.85rem !important; opacity: 0.6; font-weight: 400; font-family: 'Inter', sans-serif; } 
.tree-line .text-\[13px\] { font-size: 1rem !important; font-weight: 600; font-family: 'Inter', sans-serif; letter-spacing: -0.01em; } 
.tree-line .text-\[11px\] { font-size: 0.85rem !important; opacity: 0.7; font-family: 'JetBrains Mono', monospace; } 
.tree-line .node-prefix { 
    font-size: 1rem !important; 
    line-height: 36px; 
    height: 36px;
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -2px;
    opacity: 0.3; /* 符号更加淡雅，不喧宾夺主 */
}

/* 右侧详情面板字体放大 */
aside h2 { font-size: 28px !important; } /* Artifact ID */
aside p { font-size: 18px !important; } /* Group ID */
aside .text-\[9px\] { font-size: 16px !important; } /* 标签文字如“解析版本” */
aside .text-\[10px\] { font-size: 16px !important; } /* 层级标签文字如“层级 0”、“来自 XXX” */
aside .text-\[11px\] { font-size: 18px !important; } /* 列表中出现的版本号数字 */
aside .text-lg { font-size: 22px !important; } /* 主版本号数字 */
aside h3 { font-size: 20px !important; } /* 小标题如“引用链溯源” */
aside .text-xs { font-size: 18px !important; } /* 列表正文内容 */

/* 玻璃拟态效果 */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 动画 */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slide-in { animation: slideIn 0.3s ease-out forwards; }

.collapsible-content { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; }
.collapsed { max-height: 0 !important; opacity: 0; pointer-events: none; }

/* 可拖动分界线样式 */
.resizer {
    width: 8px;
    cursor: col-resize;
    background-color: transparent;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 40;
    margin-left: -4px;
    margin-right: -4px;
}

.resizer:hover, .resizer-active {
    background-color: var(--brand-light);
}

.resizer-handle {
    width: 2px;
    height: 40px;
    background-color: var(--border);
    border-radius: 1px;
    transition: background-color 0.2s;
}

.resizer:hover .resizer-handle {
    background-color: var(--brand);
}

/* 详情面板动画优化 */
aside {
    transition: width 0.05s linear;
}

/* 命令生成器代码块优化 */
.command-box {
    background-color: #0f172a;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    border: 1px solid #1e293b;
}

.command-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    word-break: break-all;
    white-space: pre-wrap;
    padding-right: 2.5rem;
}

.copy-btn {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    padding: 0.5rem;
    background-color: #1e293b;
    color: #94a3b8;
    border-radius: 8px;
    border: 1px solid #334155;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.copy-btn:hover {
    background-color: #334155;
    color: #f8fafc;
    border-color: #475569;
}

.copy-btn.copied {
    background-color: #059669;
    color: white;
    border-color: #10b981;
}

/* 虚拟列表容器：修复滚动失效 */
#virtual-tree-root { 
    position: relative; 
    overflow-y: auto; 
    flex: 1; /* 填充剩余空间 */
    height: 100%;
}
.virtual-tree-content { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
}
