/* ============================================
   学生能力图谱 3D 可视化系统 - 样式表
   ============================================ */

/* CSS 变量 */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-panel: rgba(20, 20, 45, 0.85);
    --bg-panel-border: rgba(100, 150, 255, 0.15);
    --text-primary: #e0e0ff;
    --text-secondary: #8899bb;
    --accent-blue: #4488ff;
    --accent-cyan: #00d4ff;
    --accent-gold: #ffaa33;
    --accent-green: #44dd88;
    --accent-red: #ff5555;
    --btn-primary: linear-gradient(135deg, #4488ff, #00aaff);
    --btn-primary-hover: linear-gradient(135deg, #5599ff, #11bbff);
    --btn-secondary: rgba(255, 255, 255, 0.1);
    --btn-secondary-hover: rgba(255, 255, 255, 0.2);
    --radius: 10px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* ============================================
   顶部标题栏
   ============================================ */
.top-bar {
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 170, 51, 0.2);
    color: var(--accent-gold);
    border: 1px solid rgba(255, 170, 51, 0.3);
}

.top-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   按钮样式
   ============================================ */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.btn-primary {
    background: var(--btn-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(68, 136, 255, 0.3);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(68, 136, 255, 0.4);
}

.btn-secondary {
    background: var(--btn-secondary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 10px;
}

/* ============================================
   主布局
   ============================================ */
.main-layout {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ============================================
   左侧边栏
   ============================================ */
.sidebar {
    width: 320px;
    min-width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--bg-panel-border);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(100, 150, 255, 0.2);
    border-radius: 3px;
}

/* ============================================
   面板卡片
   ============================================ */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--bg-panel-border);
    border-radius: var(--radius);
    padding: 16px;
    backdrop-filter: blur(10px);
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.panel-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ============================================
   表单元素
   ============================================ */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 150, 255, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px !important;
    color: var(--text-primary) !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* ============================================
   维度滑块列表
   ============================================ */
.dimension-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dimension-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dimension-name {
    font-size: 13px;
    color: var(--text-primary);
}

.dimension-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-cyan);
    min-width: 32px;
    text-align: right;
}

.dimension-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.dimension-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
    cursor: pointer;
    transition: transform 0.15s;
}

.dimension-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.dimension-bar {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    margin-top: 2px;
    transition: width 0.3s ease;
}

/* ============================================
   结果面板
   ============================================ */
.result-panel {
    background: rgba(255, 170, 51, 0.05);
    border-color: rgba(255, 170, 51, 0.2);
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.result-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-gold);
}

.result-badge {
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    background: rgba(68, 221, 136, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(68, 221, 136, 0.3);
}

.result-badge.level-1 {
    background: rgba(170, 170, 170, 0.15);
    color: #aaa;
    border-color: rgba(170, 170, 170, 0.3);
}

.result-badge.level-2 {
    background: rgba(68, 136, 255, 0.15);
    color: var(--accent-blue);
    border-color: rgba(68, 136, 255, 0.3);
}

.result-badge.level-3 {
    background: rgba(68, 221, 136, 0.15);
    color: var(--accent-green);
    border-color: rgba(68, 221, 136, 0.3);
}

.result-badge.level-4 {
    background: rgba(255, 170, 51, 0.15);
    color: var(--accent-gold);
    border-color: rgba(255, 170, 51, 0.3);
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.result-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.result-comment {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border-left: 3px solid var(--accent-gold);
}

/* ============================================
   3D 画布区域
   ============================================ */
.canvas-container {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

.canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.canvas-overlay {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.overlay-hint {
    display: flex;
    gap: 20px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   加载遮罩
   ============================================ */
.loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.5s;
}

.loading-mask.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(68, 136, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-mask p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   截图弹窗
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-panel-border);
    border-radius: var(--radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-panel-border);
}

.modal-header h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    text-align: center;
}

.modal-body img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--bg-panel-border);
}

.modal-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--bg-panel-border);
}

/* ============================================
   导入区域样式
   ============================================ */
.import-area {
    margin-bottom: 10px;
}

.import-dropzone {
    border: 2px dashed rgba(100, 150, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(0, 0, 0, 0.2);
}

.import-dropzone:hover {
    border-color: var(--accent-blue);
    background: rgba(68, 136, 255, 0.08);
}

.import-dropzone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.import-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.import-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.import-hint {
    font-size: 11px;
    color: var(--text-secondary);
}

.import-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.import-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    flex: 1;
    justify-content: center;
}

.import-status {
    margin-top: 8px;
    font-size: 12px;
    min-height: 18px;
    text-align: center;
}

.import-status.success {
    color: var(--accent-green);
}

.import-status.error {
    color: var(--accent-red);
}

.import-status.loading {
    color: var(--accent-cyan);
}

/* ============================================
   维度滑块增强样式
   ============================================ */
.dimension-bar-bg {
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

/* ============================================
   3D 错误提示
   ============================================ */
.error-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 60;
    text-align: center;
    padding: 40px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-mask p {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error-hint {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.loading-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.7;
}

/* ============================================
   按钮小尺寸
   ============================================ */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
@media (max-width: 900px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
    }
}

@media (max-width: 700px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-width: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--bg-panel-border);
    }
    .overlay-hint {
        display: none;
    }
}

/* ============================================
   维度模板选择
   ============================================ */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.template-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(100, 150, 255, 0.15);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
}

.template-btn:hover {
    background: rgba(68, 136, 255, 0.1);
    border-color: rgba(68, 136, 255, 0.3);
    color: var(--text-primary);
}

.template-btn.active {
    background: rgba(68, 136, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.template-icon {
    font-size: 16px;
}

.template-name {
    flex: 1;
}

.template-dims {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    color: var(--text-secondary);
}

.template-btn.active .template-dims {
    background: rgba(68, 136, 255, 0.2);
    color: var(--accent-blue);
}

/* ============================================
   截图弹窗 - 带左侧栏
   ============================================ */
.modal-content.modal-with-sidebar {
    flex-direction: row;
    max-width: 1100px;
    width: 90vw;
    max-height: 85vh;
}

.modal-sidebar {
    width: 220px;
    min-width: 220px;
    background: rgba(10, 10, 30, 0.95);
    border-right: 1px solid var(--bg-panel-border);
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.style-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.style-section-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.style-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.style-theme-btn,
.style-template-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(100, 150, 255, 0.15);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
}

.style-theme-btn:hover,
.style-template-btn:hover {
    background: rgba(68, 136, 255, 0.1);
    border-color: rgba(68, 136, 255, 0.3);
    color: var(--text-primary);
}

.style-theme-btn.active,
.style-template-btn.active {
    background: rgba(68, 136, 255, 0.2);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.style-preview {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.style-name {
    flex: 1;
}

.style-hint {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border-left: 3px solid var(--accent-gold);
}

.modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.modal-main .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-panel-border);
}

.modal-main .modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-main .modal-body img {
    max-width: 100%;
    max-height: 55vh;
    border-radius: 6px;
    border: 1px solid var(--bg-panel-border);
}

.modal-main .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--bg-panel-border);
}

/* 弹窗响应式 */
@media (max-width: 800px) {
    .modal-content.modal-with-sidebar {
        flex-direction: column;
        width: 95vw;
    }
    .modal-sidebar {
        width: 100%;
        min-width: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--bg-panel-border);
    }
}
