/* oa-ui.css — 拖拽上传与预览弹层 */

/* ---------- 拖拽上传 ---------- */

.dropzone {
  position: relative;
  border: 1.5px dashed var(--rule);
  border-radius: 8px;
  background: var(--sunken);
  padding: 22px 18px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  margin-top: 6px;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: solid;
}

/* 原生 input 盖满整个区域但不可见，点哪儿都能触发 */
.dropzone input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
}

.drop-invite { text-align: center; pointer-events: none; }
.drop-invite b { display: block; font-size: 14.5px; font-weight: 600; }
.drop-invite span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.drop-invite u { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.drop-invite small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 8px; letter-spacing: .02em; }

.dropzone.has-files .drop-invite b { font-size: 13px; }
.dropzone.has-files .drop-invite span,
.dropzone.has-files .drop-invite small { display: none; }

.drop-files { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }

.drop-file {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 8px 10px;
}

.drop-thumb {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--sunken);
  display: flex; align-items: center; justify-content: center;
}
.drop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drop-thumb.is-type {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  letter-spacing: .03em;
}

.drop-meta { min-width: 0; }
.drop-meta b {
  display: block; font-size: 13.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drop-meta span { font-size: 12px; color: var(--muted); }

/* ---------- 文档缩略图 ---------- */

.doc-thumb {
  width: 40px; height: 52px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--surface);
  flex: 0 0 40px;
  margin-right: 12px;
}

.record [data-thumb] { display: flex; align-items: flex-start; }

/* ---------- 预览弹层 ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 14, 20, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  transition: opacity .15s;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.viewer.open { opacity: 1; }

.viewer-box {
  background: var(--surface);
  border-radius: 10px;
  width: min(980px, 100%);
  height: min(90vh, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
  transform: translateY(8px);
  transition: transform .15s;
}
.viewer.open .viewer-box { transform: none; }

.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  flex: 0 0 auto;
}
.viewer-top b {
  font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer-top span { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.viewer-top a { font-size: 13px; }

.viewer-close {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 500;
}
.viewer-close:hover { background: var(--sunken); filter: none; }

.viewer-body {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.viewer-body iframe { width: 100%; height: 100%; border: 0; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
/* 点图看原尺寸（证件照要看清细节），再点缩回 */
.viewer-body.zoomed { display: block; }
.viewer-body.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }

@media (max-width: 640px) {
  .viewer { padding: 0; }
  .viewer-box { height: 100%; width: 100%; border-radius: 0; }
}
