/* 附件预览弹窗样式 */

/* 遮罩层 */
.pm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.pm-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 顶部栏 */
.pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.pm-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.pm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pm-btn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.pm-btn-close {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.pm-btn-close:hover {
  background: #dc2626;
}

/* 主体区域 */
.pm-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #f9fafb;
}

/* 加载中 */
.pm-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #6b7280;
  font-size: 14px;
}

.pm-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: pm-spin 0.8s linear infinite;
}

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

/* 内容区 */
.pm-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  padding: 20px;
}

/* 错误 */
.pm-error {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #6b7280;
}

.pm-error-icon {
  font-size: 48px;
}

.pm-error-msg {
  font-size: 15px;
  color: #374151;
  font-weight: 500;
}

.pm-error-hint {
  font-size: 13px;
  color: #9ca3af;
}

/* PDF */
.pm-pdf-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pm-pdf-page {
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
}

/* Word */
.pm-word-container {
  background: #fff;
  padding: 20px 40px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pm-word-container .docx-wrapper {
  background: #fff;
}

.pm-word-container .docx-wrapper > section {
  margin-bottom: 20px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pm-word-html {
  line-height: 1.6;
  color: #1f2937;
}

.pm-word-html p {
  margin: 0 0 12px 0;
}

.pm-word-html table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
}

.pm-word-html td,
.pm-word-html th {
  border: 1px solid #d1d5db;
  padding: 6px 10px;
}

.pm-word-html th {
  background: #f3f4f6;
  font-weight: 600;
}

.pm-word-html ul,
.pm-word-html ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

/* Excel */
.pm-excel-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 1;
}

.pm-excel-tab {
  padding: 6px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px 6px 0 0;
  background: #f9fafb;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pm-excel-tab:hover {
  background: #f3f4f6;
}

.pm-excel-tab.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.pm-excel-body {
  padding: 16px;
  overflow: auto;
}

.pm-excel-table {
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.pm-excel-table td,
.pm-excel-table th {
  border: 1px solid #d1d5db;
  padding: 4px 8px;
  min-width: 60px;
}

.pm-excel-table th {
  background: #f3f4f6;
  font-weight: 600;
}

.pm-excel-table tr:nth-child(even) {
  background: #f9fafb;
}

/* 图片 */
.pm-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
}

.pm-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* 视频 */
.pm-video-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
}

.pm-video {
  max-width: 100%;
  max-height: 100%;
}

.pm-video-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: #6b7280;
  text-align: center;
  padding: 20px;
}

/* 不支持格式 */
.pm-other-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: #6b7280;
}

.pm-other-icon {
  font-size: 64px;
}
.pm-other-icon .file-icon { width: 56px; height: 56px; }

.pm-other-name {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
}

.pm-other-hint {
  font-size: 13px;
  color: #9ca3af;
}
