/* Drive Explorer - 单列网盘风样式（去掉灰底，只在预览时显示预览区） */

/* 外层容器，占满 default.html 的 content 宽度 */
.drive-explorer-container {
  padding: 8px 0 20px;
  min-height: 70vh;
}

/* 主区域：标题 + 按钮 + 面包屑 + 文件网格 + 预览
   去掉原来的浅灰背景和白字，改用默认白底 + 深色文字 */
.drive-explorer-main {
  background: transparent;
  border-radius: 0;
  padding: 0 0 10px;
  border: none;
  display: flex;
  flex-direction: column;
  min-height: 60vh;
  color: inherit; /* 跟随站点默认文字颜色 */
}

/* 顶部标题与按钮区 */
.drive-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* 只保留目录（面包屑），隐藏“当前文件名”和“当前路径” */
.drive-current-file,
.drive-current-path {
  display: none;
}

.drive-viewer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* 顶部按钮保持蓝色，白字没问题 */
.drive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #fff;
  background: #3b82f6;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.drive-btn:hover {
  filter: brightness(1.08);
}

/* 面包屑导航 */
.drive-breadcrumb {
  font-size: 0.78rem;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  color: #6b7280;
}

.drive-breadcrumb .breadcrumb-item {
  cursor: pointer;
}

.drive-breadcrumb .breadcrumb-item.active {
  cursor: default;
  font-weight: 600;
  color: #111827;
}

.drive-breadcrumb .breadcrumb-separator {
  opacity: 0.6;
  padding: 0 2px;
}

/* 文件网格（列表模式） */
.drive-file-grid {
  flex: 0 0 auto;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(15,23,42,0.08);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 40vh;       /* 上面一块：文件列表 */
  overflow: auto;
}

.drive-item {
  border-radius: 6px;
  border: 1px solid rgba(15,23,42,0.08);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: #ffffff;
}

.drive-item:hover {
  background: #f3f4f6;
}

.drive-item-icon {
  font-size: 1.6rem;
}

.drive-item-name {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111827;
}

.drive-item-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.drive-empty {
  font-size: 0.82rem;
  color: #6b7280;
}

/* 预览区域：默认完全隐藏 */
.drive-viewer-body {
  display: none;          /* 进页面时不显示预览区 */
  height: 0;              /* 没有高度，避免撑开 */
  flex: 0 0 auto;
  margin-top: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
  position: relative;
}

/* 预览 iframe 本身占满整个预览区域 */
.drive-preview-frame {
  width: 100%;
  height: 100%;           /* 有了父元素的 height，这个才生效 */
  border: none;
}

.drive-preview-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  text-align: center;
  padding: 16px;
  background: #ffffff;
}

.drive-preview-fallback .small {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* “只预览模式”：隐藏文件网格，让预览占更多高度
   同时这里才真正显示预览区域 */
.drive-explorer-main.preview-only .drive-file-grid {
  display: none;
}

/* “只预览模式”：此时才给预览区域实际高度，让 pdf 占满 */
.drive-explorer-main.preview-only .drive-viewer-body {
  display: block;
  height: 70vh;           /* 你可以根据喜好改成 65vh / 80vh 等 */
}

/* 加载提示文字 */
.drive-loading {
  font-size: 0.82rem;
  color: #6b7280;
}

/* 响应式 */
@media (max-width: 900px) {
  .drive-explorer-main {
    padding: 0 0 10px;
    min-height: 60vh;
  }

  .drive-file-grid {
    max-height: 35vh;
  }

  .drive-explorer-main.preview-only .drive-viewer-body {
    min-height: 60vh;
  }
}
