/* 全局样式 */
body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 目录树样式 */
.directory-item {
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 8px 15px;
    border-left: 3px solid transparent;
}

.directory-item:hover {
    background-color: #f0f0f0;
    border-left-color: #0d6efd;
}

.directory-item.active {
    background-color: #e9ecef;
    border-left-color: #0d6efd;
    font-weight: 500;
}

.directory-item .material-icons {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 5px;
}

.directory-item ul {
    list-style-type: none;
    padding-left: 20px;
    display: none; /* 默认隐藏子目录 */
}

.directory-item.expanded > ul {
    display: block; /* 展开时显示子目录 */
}

/* 文件卡片样式 */
.file-card {
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
    cursor: pointer;
    height: auto;
    min-height: 120px;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.file-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px !important;
}

.file-icon {
    font-size: 36px;
    text-align: center;
    color: #0d6efd;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.file-name {
    text-align: center;
    padding: 5px;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.2;
    font-size: 0.85rem;
    width: 100%;
    height: auto;
}

/* PDF 预览样式 */
.pdf-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.modal-fullscreen .pdf-container {
    height: 90vh;
}

.modal-fullscreen .modal-body {
    padding: 0;
}

/* 还原按钮样式 */
.pdf-container .btn-outline-secondary {
    z-index: 1000;
    opacity: 0.7;
}

.pdf-container .btn-outline-secondary:hover {
    opacity: 1;
}

/* 调整模态框过渡效果 */
.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
}

.modal.fade .modal-dialog.modal-fullscreen {
    transform: none;
}

/* 视频播放器样式 */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 面包屑导航 */
.breadcrumb-item {
    cursor: pointer;
}

.breadcrumb-item.active {
    color: white; /* 设置当前目录的文字颜色为白色 */
}

.breadcrumb-item a {
    color: inherit; /* 确保链接继承父元素的颜色 */
}

.breadcrumb-item a:hover {
    color: #ddd; /* 鼠标悬停时的颜色 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    .file-card {
        min-height: 100px;
    }
    
    .file-icon {
        font-size: 28px;
        margin-bottom: 5px;
    }
    
    .file-name {
        font-size: 0.8rem;
        padding: 3px;
    }
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

/* 搜索高亮 */
.highlight {
    background-color: yellow;
    font-weight: bold;
}

/* 音频播放器样式 */
.audio-container {
    max-width: 600px;
    margin: 0 auto;
}

.audio-container audio {
    width: 100%;
    margin: 1rem 0;
}

.audio-container .card {
    background-color: #f8f9fa;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.audio-container .card-body {
    padding: 2rem;
}

/* 自定义音频播放器样式 */
audio {
    border-radius: 30px;
    background-color: #e9ecef;
}

audio::-webkit-media-controls-panel {
    background-color: #e9ecef;
}

audio::-webkit-media-controls-play-button {
    background-color: #007bff;
    border-radius: 50%;
}

audio::-webkit-media-controls-play-button:hover {
    background-color: #0056b3;
}

/* 页脚样式 */
footer {
    background-color: #0d6efd; /* 使用与头部相同的蓝色 */
    color: white;
    padding: 1rem 0;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    color: #ddd;
    text-decoration: underline;
}

/* 文本预览样式 */
.text-container {
    max-width: 100%;
    margin: 0 auto;
}

.text-container .card {
    background-color: #f8f9fa;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.text-content {
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #fff;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    max-height: 70vh;
    overflow-y: auto;
}

/* Word文档预览样式 */
.word-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.word-content {
    font-family: 'Calibri', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

.word-content h1,
.word-content h2,
.word-content h3,
.word-content h4,
.word-content h5,
.word-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #000;
}

.word-content p {
    margin-bottom: 1em;
}

.word-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
}

.word-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.word-content table td,
.word-content table th {
    border: 1px solid #ddd;
    padding: 8px;
}

/* 模态框全屏显示 */
.modal-xl {
    max-width: 95%;
}

.modal-body {
    max-height: 85vh;
    overflow-y: auto;
}

.word-container .material-icons {
    vertical-align: middle;
    margin-right: 5px;
}

.word-container .alert {
    text-align: left;
    margin-bottom: 0;
}

.word-container .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* PDF HTML预览样式 */
.pdf-html-content {
    background: #fff;
    padding: 20px;
}

.pdf-pages {
    max-width: 100%;
    margin: 0 auto;
}

.pdf-page {
    margin: 0 auto 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    justify-content: center;
}

.page-wrapper {
    position: relative;
}

/* PDF 文本层样式 */
.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
    user-select: text;
    pointer-events: auto;
}

.textLayer span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

.textLayer ::selection {
    background: rgba(0, 0, 255, 0.3);
}

.page-number {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.page-loading {
    padding: 40px;
    text-align: center;
}

.download-button {
    position: sticky;
    bottom: 20px;
    text-align: center;
    z-index: 1000;
}

/* 按钮组样式 */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.btn-group-vertical .btn {
    width: 100%;
    margin-bottom: 10px;
    padding: 15px 30px;
}

.btn-group-vertical .material-icons {
    font-size: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

/* PDF 查看器样式 */
.pdf-viewer {
    width: 100%;
    background: #f5f5f5;
    padding: 20px;
}

.pdf-viewer .page {
    margin: 10px auto;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.pdf-viewer .textLayer {
    opacity: 0.2;
    mix-blend-mode: multiply;
}

.pdf-viewer .textLayer ::selection {
    background: rgba(0,0,255,0.3);
}

.pdf-viewer .textLayer .highlight {
    margin: -1px;
    padding: 1px;
    background-color: rgba(180, 0, 170, 0.2);
    border-radius: 4px;
}

.pdf-viewer .textLayer .highlight.selected {
    background-color: rgba(0, 100, 0, 0.2);
}

/* Office 预览样式 */
.office-container {
    width: 100%;
    height: 100%;
    overflow: auto;
}

.pptx-content {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.xlsx-content {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.xlsx-content table {
    border-collapse: collapse;
    width: 100%;
}

.xlsx-content th,
.xlsx-content td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.xlsx-content th {
    background-color: #f8f9fa;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .office-container {
        padding: 10px !important;
    }
}

/* 图片预览样式 */
.image-preview-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-preview-container img {
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
}

/* Viewer.js 自定义样式 */
.viewer-toolbar > ul > li {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    margin: 2px;
}

.viewer-toolbar > ul > li:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.viewer-title {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    padding: 4px 8px;
}

/* PowerPoint 预览样式 */
.ppt-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.slide {
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform-origin: top center;
    transition: transform 0.3s ease;
}

.ppt-controls {
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ppt-controls .btn-group {
    margin: 0 5px;
}

/* 幻灯片全屏模式 */
#ppt-slides-container:fullscreen {
    background-color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ppt-slides-container:fullscreen .slide {
    max-height: 90vh;
    max-width: 90vw;
    margin: auto;
}

/* PowerPoint 查看器样式 */
.pptx-container {
    position: relative;
    min-height: 500px;
    width: 100%;
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}

.pptx-viewer {
    width: 100%;
    height: 100%;
}

/* 确保 PPTXjs 生成的幻灯片正确显示 */
.slide {
    margin: 0 auto !important;
    max-width: 100% !important;
}

/* 全屏模式 */
.pptx-viewer:fullscreen {
    background-color: white;
    padding: 20px;
}

.pptx-viewer:fullscreen .slide {
    max-height: 90vh !important;
}

/* 控制栏样式 */
.ppt-controls {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* pptx-parser 预览样式 */
.slide-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    background-color: #f1f1f1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.slide {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: white;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.slide-container:fullscreen {
    padding: 20px;
    background-color: #333;
}

.slide-container:fullscreen .slide {
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
}

.slide-text {
    word-wrap: break-word;
    overflow: hidden;
}

.slide-image {
    overflow: hidden;
}

.slide-shape {
    border-radius: 4px;
}

.file-size {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Excel 预览样式 */
.excel-container {
    max-width: 100%;
    overflow-x: auto;
}

.excel-content {
    min-width: 100%;
    padding: 1rem;
}

.excel-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.excel-content th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.excel-content td, 
.excel-content th {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

.excel-content tr:nth-child(even) {
    background-color: #f8f9fa;
}

.excel-content tr:hover {
    background-color: #e9ecef;
} 