* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    background: #1a1a2e;
    color: #eee;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
}

.toolbar h1 {
    font-size: 18px;
    font-weight: 500;
    color: #e94560;
}

.toolbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn, .upload-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #0f3460;
    color: #eee;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn:hover, .upload-btn:hover {
    background: #e94560;
}

select {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #0f3460;
    color: #eee;
    cursor: pointer;
    font-size: 14px;
}

/* 开关标签 */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
    padding: 6px 10px;
    background: #0f3460;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-label:hover {
    background: #1a3a5c;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #e94560;
    cursor: pointer;
}

/* 主内容区 */
.content {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

#graphContainer {
    flex: 1;
    background: #1a1a2e;
    position: relative;
}

.placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.placeholder p {
    margin: 8px 0;
}

.placeholder .hint {
    font-size: 12px;
    color: #444;
}

/* 属性面板 */
.panel {
    width: 480px;
    background: #16213e;
    border-left: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(0);
}

.panel.hidden {
    transform: translateX(100%);
    pointer-events: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #0f3460;
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}

.close-btn:hover {
    color: #e94560;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 属性项 */
.prop-item {
    margin-bottom: 16px;
}

.prop-label {
    font-size: 13px;
    color: #9db8d4;
    margin-bottom: 6px;
    font-weight: 500;
}

.prop-value {
    font-size: 14px;
    color: #fff;
    word-break: break-all;
    line-height: 1.6;
    padding: 10px 12px;
    background: #0f3460;
    border-radius: 4px;
}

.prop-value.empty {
    color: #7a94b0;
}

/* 节点名称高亮 */
.node-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    padding: 12px;
    background: #0f3460;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: center;
}

/* 关系列表 */
.relations-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #0f3460;
}

.relations-section h4 {
    font-size: 13px;
    color: #9db8d4;
    margin-bottom: 10px;
    font-weight: 500;
}

.relation-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #0f3460;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
}

.relation-item .arrow {
    color: #5DADE2;
    margin: 0 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.relation-item .relation-type {
    color: #9db8d4;
    font-size: 12px;
    margin-left: auto;
    background: #1a1a2e;
    padding: 3px 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* 状态栏 */
.statusbar {
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
    background: #16213e;
    border-top: 1px solid #0f3460;
    font-size: 12px;
    color: #666;
}

/* Cytoscape 节点提示 */
.cy-tooltip {
    position: absolute;
    background: #16213e;
    border: 1px solid #0f3460;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #eee;
    pointer-events: none;
    z-index: 1000;
    max-width: 200px;
}

/* 3D图谱节点提示 */
.node-tooltip {
    background: rgba(22, 33, 62, 0.95);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    border: 1px solid #e94560;
    max-width: 250px;
    word-break: break-all;
}

/* 3D图谱容器canvas */
#graphContainer canvas {
    display: block;
}

/* 场景信息覆盖层 */
.scene-info-msg {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(22, 33, 62, 0.8);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    color: #888;
    pointer-events: none;
}

/* 加载状态 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #e94560;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e94560;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 搜索高亮 */
.highlighted {
    box-shadow: 0 0 20px #e94560;
}

/* 调试面板 */
.debug-panel {
    display: flex;
    gap: 20px;
    padding: 10px 20px;
    background: #0d1a2d;
    border-bottom: 1px solid #0f3460;
    flex-wrap: wrap;
}

.debug-panel.hidden {
    display: none;
}

.debug-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.debug-item label {
    font-size: 12px;
    color: #888;
}

.debug-item label span {
    color: #e94560;
    font-weight: bold;
}

.debug-item input[type="range"] {
    width: 150px;
    height: 6px;
    background: #0f3460;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.debug-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #e94560;
    border-radius: 50%;
    cursor: pointer;
}

.debug-item input[type="range"]::-webkit-slider-thumb:hover {
    background: #ff6b7a;
}

/* 层级半径滑动条容器 */
.level-radius-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
