/* ========================================
   智能建造技术专业能力图谱 - 样式文件
   ======================================== */

/* CSS变量定义 */
:root {
    /* 节点颜色 */
    --color-major: #E74C3C;
    --color-category: #3498DB;
    --color-course: #2ECC71;
    --color-type: #F39C12;
    --color-ability: #9B59B6;
    --color-point: #1ABC9C;
    
    /* 主题色 */
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --success-color: #27ae60;
    --success-hover: #219a52;
    --secondary-color: #95a5a6;
    --secondary-hover: #7f8c8d;
    --danger-color: #e74c3c;
    
    /* 背景色 */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-dark: #2c3e50;
    
    /* 文字色 */
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #ffffff;
    
    /* 边框 */
    --border-color: #e1e8ed;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    
    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 尺寸 */
    --toolbar-height: 60px;
    --panel-width: 320px;
}

/* 重置样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow: hidden;
}

/* ========================================
   顶部工具栏
   ======================================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--toolbar-height);
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.toolbar-left {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), var(--color-course));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.toolbar-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 课程选择器 */
.course-selector,
.level-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-selector label {
    font-weight: 500;
    color: var(--text-secondary);
}

.course-selector select,
.level-selector select {
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.course-selector select {
    min-width: 200px;
}

.level-selector select {
    min-width: 80px;
}

.course-selector select:hover,
.level-selector select:hover {
    border-color: var(--primary-color);
}

.course-selector select:focus,
.level-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.level-selector select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* ========================================
   按钮样式
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn .icon {
    font-size: 16px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-light);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 20px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ========================================
   主内容区
   ======================================== */
.main-container {
    display: flex;
    height: calc(100vh - var(--toolbar-height));
    position: relative;
}

/* 图谱容器 */
.graph-container {
    flex: 1;
    position: relative;
    background: #ffffff;
    overflow: hidden;
    transition: background 0.5s ease;
}

.graph-chart {
    width: 100%;
    height: 100%;
}

/* 加载遮罩 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 50;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 加载动画容器 */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loading-spinner::before {
    width: 100%;
    height: 100%;
    border: 4px solid #e1e8ed;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-color);
    animation: spin 1.2s linear infinite;
}

.loading-spinner::after {
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    border: 4px solid #e1e8ed;
    border-bottom-color: var(--color-course);
    border-left-color: var(--color-course);
    animation: spin 0.8s linear infinite reverse;
}

/* 加载节点动画 */
.loading-nodes {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.loading-node {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: nodeFloat 1.4s ease-in-out infinite;
}

.loading-node:nth-child(1) { 
    animation-delay: 0s; 
    background: var(--color-major);
}
.loading-node:nth-child(2) { 
    animation-delay: 0.2s; 
    background: var(--color-category);
}
.loading-node:nth-child(3) { 
    animation-delay: 0.4s; 
    background: var(--color-course);
}
.loading-node:nth-child(4) { 
    animation-delay: 0.6s; 
    background: var(--color-type);
}
.loading-node:nth-child(5) { 
    animation-delay: 0.8s; 
    background: var(--color-point);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes nodeFloat {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateY(-10px) scale(1.15);
        opacity: 0.7;
    }
}

.loading-overlay p {
    margin-top: 20px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.loading-tip {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 图例面板 - 见文件末尾增强样式 */

/* 统计面板 - 见文件末尾增强样式 */

/* ========================================
   配置面板
   ======================================== */
.config-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: var(--panel-width);
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    z-index: 90;
    display: flex;
    flex-direction: column;
}

.config-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* 配置区块 */
.config-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-item {
    margin-bottom: 12px;
}

.config-item:last-child {
    margin-bottom: 0;
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

/* 输入框 */
.input-text {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.input-text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* 颜色选择器 */
.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.color-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.color-item label {
    flex: 1;
}

.color-item input[type="color"] {
    width: 36px;
    height: 28px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.color-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-item input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* 滑块 */
.slider-item label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.slider-item label span {
    color: var(--primary-color);
    font-weight: 600;
}

.slider-item input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

.slider-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.slider-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* 复选框 */
input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* ========================================
   模态框
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.modal-body .detail-item {
    display: flex;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}

.modal-body .detail-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-body .detail-label {
    width: 80px;
    color: var(--text-secondary);
    font-size: 13px;
}

.modal-body .detail-value {
    flex: 1;
    font-weight: 500;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .toolbar-left,
    .toolbar-center,
    .toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .course-selector select {
        min-width: 150px;
    }
    
    .config-panel {
        width: 100%;
    }
    
    .legend-panel {
        left: 10px;
        bottom: 10px;
        padding: 12px;
    }
    
    .stats-panel {
        right: 10px;
        bottom: 10px;
        padding: 8px 12px;
    }
}

/* ========================================
   工具提示
   ======================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-hover);
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn var(--transition-normal);
}

.slide-in {
    animation: slideIn var(--transition-normal);
}

/* ========================================
   特殊效果
   ======================================== */
/* 背景效果已移除，保持白色简洁背景 */

/* ========================================
   主题选择器
   ======================================== */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-selector label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.theme-selector select {
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none;
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 120px;
}

.theme-selector select:hover {
    border-color: var(--primary-color);
}

.theme-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* ========================================
   图例面板美化
   ======================================== */
.legend-panel {
    position: absolute;
    left: 20px;
    bottom: 20px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.legend-panel h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 2px rgba(255,255,255,0.5);
}

/* ========================================
   统计面板美化
   ======================================== */
.stats-panel {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    gap: 20px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    z-index: 10;
}

.stats-panel span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-panel span::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

.stats-panel span:last-child::before {
    background: var(--success-color);
}

/* ========================================
   按钮增强
   ======================================== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e8449 100%);
}

/* 节点高亮效果 - 由ECharts处理 */
