/* 管理员文件中心（R159）：只补本页专用布局，主体沿用 app.css / gov-red.css。 */

.file-search-card { margin-bottom: 16px; }
.file-search-card .card-head { border-bottom: 0; padding-bottom: 4px; }
.file-card-sub { color: var(--muted); font-size: 12.5px; }

.file-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 4px;
}
.file-search-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  font-size: 14px;
}
.file-search-btn { flex: none; height: 42px; padding: 0 20px; }

.file-filters {
  padding: 8px 18px 0;
  margin-bottom: 4px;
}
.file-filter-hint { color: var(--muted); font-size: 12px; }
.file-search-tip {
  padding: 2px 18px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.file-search-note { padding: 0 18px; }

.file-search-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
}
.file-search-loading .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.file-wait-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(200, 16, 46, .35);
  animation: filePulse 1.2s infinite;
}
@keyframes filePulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 16, 46, .35); }
  70% { box-shadow: 0 0 0 12px rgba(200, 16, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0); }
}

.file-result-card { margin-bottom: 16px; }
.file-result-headbar { flex-wrap: wrap; }
.file-search-meta { color: var(--muted); font-size: 12px; }
.file-search-note-line {
  padding: 8px 18px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.file-search-keywords {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 18px 2px;
  color: var(--muted);
  font-size: 12px;
}
.badge.plain {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--line);
  font-weight: 400;
}

.file-results { padding: 6px 18px 16px; }
.file-result {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.file-result:first-child { border-top: 0; }
.file-result-rank {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.file-result-main { flex: 1; min-width: 0; }
.file-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}
.file-result-title b { word-break: break-all; }
.file-score {
  color: var(--muted);
  font-size: 11.5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}
.file-score.high { color: var(--ok); border-color: #cbe6d8; background: var(--ok-soft); }
.file-result-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.file-result-snippet {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2);
  word-break: break-all;
}
.file-result-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.file-result-reason { color: var(--muted); font-size: 12px; }
.file-result-foot .spacer { flex: 1; }

.file-list-card .card-head { flex-wrap: wrap; }
.file-list-summary { color: var(--muted); font-size: 12px; }
.file-list-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0 12px;
}
.file-list-toolbar .input { flex: 1; min-width: 200px; max-width: 460px; }

.file-center-table td:first-child { min-width: 240px; }
.file-name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-name-cell b { font-weight: 600; word-break: break-all; }
.file-from-sub {
  flex: none;
  font-size: 10.5px;
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 0 7px;
}
.file-owner-cell { display: flex; flex-direction: column; line-height: 1.45; }
.file-owner-role { color: var(--muted); font-size: 11px; }
.file-actions { display: flex; gap: 6px; flex-wrap: wrap; white-space: nowrap; }

/* ------------------------------------------------------------ 预览弹窗 */
.file-preview-body { min-height: 160px; }
.file-preview-image-wrap {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  max-height: 68vh;
  overflow: auto;
}
.file-preview-image {
  max-width: 100%;
  max-height: 64vh;
  object-fit: contain;
  border-radius: 6px;
}
.file-preview-frame {
  width: 100%;
  height: 68vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.file-preview-text {
  margin: 0;
  padding: 16px 18px;
  max-height: 66vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", monospace;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}
.file-preview-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.file-sheet { margin-bottom: 16px; }
.file-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.file-sheet-trunc { color: var(--warn); font-size: 11.5px; }
.file-sheet-wrap { max-height: 46vh; overflow: auto; }
.file-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: var(--surface);
}
.file-sheet-table th,
.file-sheet-table td {
  border: 1px solid var(--line);
  padding: 6px 9px;
  text-align: left;
  /* R162（UAT SUG-02）：长文本列限宽换行，避免单个单元格把预览弹窗撑到几千像素。 */
  max-width: 420px;
  vertical-align: top;
  white-space: pre-wrap;
  word-break: break-word;
  min-width: 72px;
}
.file-sheet-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-weight: 600;
  z-index: 1;
}
.file-sheet-table .file-sheet-no {
  width: 38px;
  min-width: 38px;
  color: var(--muted);
  text-align: right;
  background: var(--surface-2);
}
.file-sheet-table tbody tr:nth-child(even) td { background: rgba(150, 110, 60, .035); }

@media (max-width: 720px) {
  .file-search-row { flex-wrap: wrap; }
  .file-search-input { flex-basis: 100%; }
  .file-search-btn { flex: 1; }
  .file-result-foot { flex-wrap: wrap; }
  .file-preview-frame { height: 60vh; }
}
