/* CloudHub Style - Fixed Version */
:root {
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
    --danger-color: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ================= Standard View ================= */
.standard-view {
    display: flex;
    height: 100vh;
    background: var(--bg-color);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 24px;
    width: auto;
    display: inline-block;
    object-fit: contain;
}

.logo-icon-std {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    color: var(--primary-color);
}

.logo-icon-std svg {
    width: 100%;
    height: 100%;
}

.logo-text-std {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-left: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.nav-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

.tree-container {
    padding-bottom: 1rem;
}

.tree-item {
    display: block;
    margin-bottom: 2px;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.2s;
}

.tree-node:hover {
    background-color: var(--hover-bg);
}

.tree-node.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.tree-expand {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 4px;
    margin-right: 4px;
    transition: transform 0.2s;
}

.tree-expand:hover {
    background: rgba(0, 0, 0, 0.05);
}

.tree-expand.expanded svg {
    transform: rotate(90deg);
}

.tree-item .tree-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    color: #f59e0b;
    display: flex;
    align-items: center;
}

.tree-item .tree-icon svg {
    width: 100%;
    height: 100%;
}

.tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tree Children - Toggle visibility */
.tree-children {
    display: none;
    padding-left: 0;
}

.tree-children.open {
    display: block;
}

.empty-tree {
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
}

.storage-info {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Main Content */
.main-content-std {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header-std {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb-item {
    cursor: pointer;
}

.breadcrumb-item:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
    cursor: default;
    text-decoration: none;
}

.header-actions-std {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.search-box-std {
    display: flex;
    align-items: center;
    background: var(--hover-bg);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    width: 180px;
    min-width: 100px;
    transition: width 0.3s;
}

.search-box-std:focus-within {
    width: 240px;
}

.search-box-std input {
    border: none;
    background: transparent;
    margin-left: 0.5rem;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

.mode-switch-btn-std {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-switch-btn-std:hover {
    background: var(--hover-bg);
}

.view-toggle {
    display: flex;
    background: var(--hover-bg);
    border-radius: 6px;
    padding: 2px;
}

.view-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
}

.view-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-login-std {
    padding: 0.4rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-login-std:hover {
    background: var(--primary-hover);
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hover-bg);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.btn-logout:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

/* Toolbar */
.toolbar {
    padding: 0.8rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.toolbar-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
}

.toolbar-btn:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Content Area */
.folder-info {
    padding: 1.5rem 2rem 0.5rem;
}

.folder-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    margin-bottom: 0.5rem;
}

.folder-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

/* File Item */
.file-item,
.file-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    background: var(--card-bg);
    width: 100%;
    box-sizing: border-box;
}

.file-item:hover,
.file-card:hover {
    background-color: white;
    border-color: var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.file-item.selected,
.file-card.selected {
    background-color: #eff6ff;
    border-color: #bfdbfe;
}

.file-icon,
.file-card-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.file-icon svg,
.file-card-icon svg {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
}

.file-item.is-folder .file-icon,
.file-card[data-type="folder"] .file-card-icon {
    color: #f59e0b;
}

/* File Card - Header structure */
.file-card-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hide action button in grid view */
.file-card-action {
    display: none;
}

/* Show file card meta */
.file-card-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* File Card Thumbnail */
.file-card-thumbnail {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    flex-shrink: 0 !important;
}

.file-name,
.file-card-name {
    font-size: 0.85rem;
    text-align: center;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* List View */
.file-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-grid.list-view .file-item,
.file-grid.list-view .file-card {
    flex-direction: row;
    padding: 0.5rem 1rem;
    align-items: center;
    height: auto;
}

.file-grid.list-view .file-icon,
.file-grid.list-view .file-card-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
    margin-right: 1rem;
}

.file-grid.list-view .file-card-thumbnail {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    margin-bottom: 0;
    margin-right: 1rem;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0 !important;
}

.file-grid.list-view .file-name,
.file-grid.list-view .file-card-name {
    text-align: left;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    flex: 1;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-full {
    width: 100%;
}

/* Preview Modals */
.modal-preview {
    background: rgba(0, 0, 0, 0.85);
}

.preview-container {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.preview-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
}

.preview-info {
    margin-top: 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.text-preview-container,
.html-preview-container {
    background: white;
    border-radius: 8px;
    width: 90vw;
    max-width: 900px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-title {
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.preview-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.preview-body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.text-content {
    margin: 0;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    z-index: 1001;
}

.upload-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.progress-bar {
    height: 6px;
    background: var(--hover-bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Immersive View */
.immersive-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 2000;
}

.immersive-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), transparent);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-brand {
    display: flex;
    align-items: center;
}

.logo-icon {
    color: #60a5fa;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    margin-left: 10px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
}

.mode-switch-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-switch-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-btn,
.zoom-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover,
.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.zoom-level {
    color: white;
    font-size: 0.85rem;
    min-width: 40px;
    text-align: center;
}

.search-box-immersive {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
}

.search-box-immersive svg {
    color: rgba(255, 255, 255, 0.6);
}

.search-box-immersive input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    margin-left: 8px;
    width: 150px;
}

.search-box-immersive input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-login-immersive {
    background: white;
    color: black;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-login-immersive:hover {
    background: #f1f5f9;
}

/* Canvas */
.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Immersive View Nodes (Knowledge Network Cards) */
.node {
    position: absolute;
    width: auto;
    min-width: 220px;
    max-width: 320px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.node:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(96, 165, 250, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.node.selected {
    border-color: #60a5fa;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
}

.node.folder {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(30, 41, 59, 0.95) 100%);
}

.node.folder:hover {
    border-color: rgba(245, 158, 11, 0.5);
}

.node.hidden-file {
    opacity: 0.5;
}

.node-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.node-icon svg {
    width: 100%;
    height: 100%;
}

.node.folder .node-icon {
    color: #f59e0b;
}

.node-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.node-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.node-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.node-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    opacity: 0.7;
}

.node-hint svg {
    width: 12px;
    height: 12px;
}

.node-action {
    background: rgba(59, 130, 246, 0.2);
    border: none;
    color: #60a5fa;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.node-action:hover {
    background: rgba(59, 130, 246, 0.4);
}

.node-action svg {
    width: 12px;
    height: 12px;
}

/* Connection Lines */
.connection-line {
    stroke-linecap: round;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    z-index: 5000;
    display: none;
    min-width: 160px;
}

.context-menu.show {
    display: block;
}

.context-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
}

.context-item:hover {
    background-color: var(--hover-bg);
}

.context-item.danger {
    color: var(--danger-color);
}

.context-item.admin-only {
    display: none;
}

body.is-admin .context-item.admin-only {
    display: flex;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 50;
        transition: left 0.3s;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .header-actions-std {
        gap: 8px;
    }

    .search-box-std {
        width: 120px;
    }

    .mode-switch-btn-std span {
        display: none;
    }
}

/* Hide breadcrumb navigation - use sidebar only */
#breadcrumbStd {
    display: none !important;
}

/* 知识脉络右侧预览面板 */
.immersive-preview-panel {
    position: absolute;
    top: 20px;
    right: -60vw;
    width: 50vw;
    min-width: 450px;
    bottom: 20px;
    border-radius: 8px;
    background: var(--bg-surface, #1e1e1e);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.immersive-preview-panel.active {
    right: 20px;
}

.ipp-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
}

.ipp-title {
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.ipp-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s;
}

.ipp-close:hover {
    color: #ff4d4f;
}

.ipp-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ipp-body img {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
