/*
 * DataSeal 管理台样式
 * 定位：内网运维工具，不是营销页面 —— 信息密度优先、层级清晰、
 * 关键告警（灾备健康度）必须第一眼抓住注意力。
 * 无外部字体/图标资源；系统字体栈覆盖 macOS / Windows 中文渲染。
 */

:root {
  /* 中性色阶：偏冷的石板灰，区别于默认背景色，专业而不生冷 */
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-sunken: #f6f8fb;
  --border: #dde3ec;
  --border-strong: #c7d0dd;

  --text: #101828;
  --text-muted: #5b6577;
  --text-faint: #8996a9;

  --primary: #2451c4;
  --primary-hover: #1c3fa0;
  --primary-tint: #eaf0fd;

  --ok: #147a52;
  --ok-bg: #e6f6ee;
  --ok-border: #a9e0c4;

  --warn: #9a5b00;
  --warn-bg: #fdf1dd;
  --warn-border: #f0c576;

  --danger: #b8231f;
  --danger-bg: #fbe9e8;
  --danger-border: #f0a9a6;
  --danger-strong: #7a1512;

  --navy: #0c1526;
  --navy-alt: #16233b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Cascadia Mono", monospace;
}

* {
  box-sizing: border-box;
}

/*
 * The browser's own [hidden] rule lives in the user-agent origin, so ANY
 * author-origin `display` declaration silently beats it: `.login-form
 * { display: flex }` on a `<form hidden>` leaves the form fully visible.
 * The login page toggles whole screens with the hidden attribute, so the
 * failure mode is every screen rendering stacked at once. Restate the rule in
 * the author origin, with !important so a later `display` cannot resurrect it.
 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: var(--primary);
}

/* ---------------------------------------------------------------- */
/* 按钮                                                              */
/* ---------------------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-strong);
}

.btn-danger-text {
  color: #f3b3b0;
}
.btn-danger-text:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.14);
  color: #ffd4d2;
}

.btn-block {
  width: 100%;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 12px;
  border-radius: 5px;
}

/* ---------------------------------------------------------------- */
/* 登录页                                                            */
/* ---------------------------------------------------------------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 15%, #16233b 0%, #0c1526 55%, #08101d 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 36px 32px 28px;
  animation: login-rise 0.4s ease both;
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.login-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #16336e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.login-brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.login-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 6px 0 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.field input,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
}

.field input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.login-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13px;
}

/* Ticking seconds appended to a rate-limit message; kept off the message text. */
.login-error-countdown {
  margin-left: 0.25em;
}

.login-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

/* ---------------------------------------------------------------- */
/* 顶部导航                                                          */
/* ---------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 20px;
  background: var(--navy);
  color: #e7ebf3;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), #16336e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.topbar-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-admin {
  font-size: 13px;
  color: #b7c0d4;
  margin-right: 6px;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------------------------------------------------------------- */
/* 页面布局                                                          */
/* ---------------------------------------------------------------- */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ---------------------------------------------------------------- */
/* 灾备健康度卡片                                                     */
/* ---------------------------------------------------------------- */

.dr-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
  overflow: hidden;
  animation: card-rise 0.35s ease both;
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dr-card-inner {
  padding: 18px 22px 20px;
}

.dr-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.dr-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .dr-rows {
    grid-template-columns: 1fr;
  }
}

.dr-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dr-row-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.dr-row-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dr-row-body {
  flex: 1 1 auto;
  min-width: 0;
}

.dr-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.dr-row-name {
  font-weight: 700;
  font-size: 14px;
}

.dr-row-msg {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.dr-row-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dr-backup-result {
  font-size: 12.5px;
  color: var(--ok);
  font-family: var(--font-mono);
}

.dr-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
}

/* 状态色：ok/warn 走中性告警语汇；critical 必须夺目 —— 这是
   "再不处理就要永久丢数据"的信号，不能被当成普通提示忽略掉。 */
.dr-row.status-ok {
  border-color: var(--ok-border);
  background: var(--ok-bg);
}
.dr-row.status-ok .dr-badge {
  background: var(--ok-border);
  color: var(--ok);
}
.dr-row.status-ok .dr-row-icon {
  color: var(--ok);
}

/* 服务端没回这一项时的中性外观：不是"正常"，也不是"出事了"，就是"没答上来"。
   用告警色会让人去查一个不存在的故障，用正常色会把一段缺失伪装成一切安好。 */
.dr-row.status-unknown {
  border-color: var(--border-strong);
  background: var(--surface-sunken);
}
.dr-row.status-unknown .dr-badge {
  background: var(--border-strong);
  color: var(--text-muted);
}
.dr-row.status-unknown .dr-row-icon {
  color: var(--text-muted);
}

.dr-row.status-warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}
.dr-row.status-warn .dr-badge {
  background: var(--warn-border);
  color: var(--warn);
}
.dr-row.status-warn .dr-row-icon {
  color: var(--warn);
}

.dr-row.status-critical {
  border-color: var(--danger);
  background: var(--danger-bg);
  box-shadow: 0 0 0 1px var(--danger) inset;
}
.dr-row.status-critical .dr-badge {
  background: var(--danger);
  color: #fff;
}
.dr-row.status-critical .dr-row-icon {
  color: var(--danger);
}
.dr-row.status-critical .dr-row-name {
  color: var(--danger-strong);
}
.dr-row.status-critical .dr-row-msg {
  color: var(--danger-strong);
  font-weight: 500;
}

/* 恢复包 critical：让整张卡片都变成警报状态，视觉上不可能被忽略。 */
.dr-card.critical {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger), var(--shadow-pop);
}
.dr-card.critical .dr-card-inner {
  background: linear-gradient(180deg, var(--danger-bg) 0%, var(--surface) 140px);
}
.dr-card.critical .dr-title {
  color: var(--danger-strong);
}
.dr-card.critical .status-critical .dr-row-icon svg {
  animation: pulse-warn 1.8s ease-in-out infinite;
}

@keyframes pulse-warn {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* 设备失联卡片：标题与阈值输入同排，输入框窄于默认宽度 */
.lost-title {
  margin-bottom: 0;
}

.lost-threshold {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.lost-threshold input {
  width: 6em;
}

/* ---------------------------------------------------------------- */
/* 标签页                                                            */
/* ---------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 18px;
}

.tab-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  animation: panel-fade 0.18s ease both;
}

@keyframes panel-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- */
/* 卡片 / 面板                                                       */
/* ---------------------------------------------------------------- */

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.panel-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ---------------------------------------------------------------- */
/* 表格                                                              */
/* ---------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
}

thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-sunken);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface-sunken);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 置灰按钮 + 它为什么置灰。disabled 的按钮不派发鼠标事件，自己的 title 在多数
   浏览器里弹不出来，所以 title 挂在外层这个 span 上，理由本身还原样写在按钮下面
   ——「一个既不能点、又不说原因的按钮」会被当成页面坏了。 */
.btn-blocked {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.btn-blocked-why {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.3;
}

.empty-row td {
  text-align: center;
  color: var(--text-faint);
  padding: 28px 14px;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-amber {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}
.badge-green {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}
.badge-grey {
  background: var(--surface-sunken);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}
.badge-red {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-online {
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--ok-bg);
}
.dot-offline {
  background: var(--text-faint);
}
.online-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.online-flag.is-online {
  color: var(--ok);
  font-weight: 600;
}

/* ---------------------------------------------------------------- */
/* 表单行 / 邀请码 / 审计筛选                                          */
/* ---------------------------------------------------------------- */

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.inline-form .field {
  min-width: 140px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

@media (max-width: 1080px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

.invite-result {
  display: none;
  margin: 4px 0 20px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  border: 1px solid #b7cbf5;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: card-rise 0.3s ease both;
}

.invite-result.show {
  display: flex;
}

.invite-code-block {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--navy);
  user-select: all;
}

.invite-result-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 异常审计行：左侧红色强调条 + 淡红底，一眼能从表格里挑出来 */
tr.audit-anomaly td {
  background: var(--danger-bg);
}
tr.audit-anomaly td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}
tr.audit-anomaly:hover td {
  background: #f7d9d8;
}

.hint-text {
  font-size: 12px;
  color: var(--text-faint);
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* The row already carries the bottom margin, so a title inside it must not add
   a second one. This lives here rather than in a style="" attribute because the
   Content-Security-Policy on the console (style-src 'self') blocks inline style
   attributes as well as inline <style> blocks. */
.toolbar-row .panel-card-title {
  margin-bottom: 0;
}

/* 证书即将到期：与审计异常行同一套红/黄告警语汇里的"需要关注"级别 */
tr.cert-expiring-soon td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

/* ---------------------------------------------------------------- */
/* 策略表单                                                          */
/* ---------------------------------------------------------------- */

.policy-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px 20px;
  align-items: start;
}

@media (max-width: 760px) {
  .policy-form {
    grid-template-columns: 1fr;
  }
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text);
  padding-top: 22px;
}

.field-checkbox input {
  width: 16px;
  height: 16px;
}

.policy-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.policy-form-error {
  font-size: 13px;
  color: var(--danger);
}

/* 成功回执用绿色。和上面共用一个 <span> 时颜色是唯一的区别，一句红色的「已保存」
   会被读成失败，然后管理员再点一次保存。 */
.policy-form-ok {
  font-size: 13px;
  color: var(--ok);
}

/* 灾备卡片里的可执行命令：红色告警必须给出能直接照做的动作 */
.dr-cmd { margin-top: 10px; }
.dr-cmd-line {
  display: flex; align-items: center; gap: 8px;
  background: #0c1526; border-radius: 6px; padding: 8px 10px;
}
.dr-cmd-line code {
  flex: 1; color: #e6edf7; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; word-break: break-all;
}
.dr-cmd-line .btn-copy {
  flex: none; background: #2451c4; color: #fff; border: 0; border-radius: 5px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.dr-cmd-line .btn-copy:hover { background: #1c40a0; }
.dr-cmd-note { margin: 6px 0 0; font-size: 12px; color: #5b6b77; line-height: 1.6; }

.setup-qr { display: flex; justify-content: center; margin: 12px 0; }
.setup-qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }

/* 群机器人未配置：黄色"需要关注"，不是红色告警 —— 它不会让文件解不开，
   但会让审批人错过申请。发送失败时复用上面的 .dr-card.critical 红色。 */
.dr-card.warn {
  border-color: var(--warn-border);
  box-shadow: 0 0 0 1px var(--warn-border), var(--shadow-card);
}
.dr-card.warn .dr-card-inner {
  background: linear-gradient(180deg, var(--warn-bg) 0%, var(--surface) 90px);
}
.dr-card.warn .dr-title {
  color: var(--warn);
}

/* 表格里的部门单元格是可点的：让它看起来可点，而不是一段普通文字。 */
td .btn-ghost {
  padding: 2px 6px;
  font-size: 12.5px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* 行内下拉（审批人改部门）与表格行高对齐 */
td select {
  font-family: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

/* 角色渲染的第一道闸：JS 把 data-role 写成 admin 之前，管理员专属区块一律不显示。
   审批人页面上这些区块永远不会闪现，管理员付出的代价只是首屏晚一拍出现 —— 少显示
   总比多显示安全。JS 之后仍会把它们逐个 hidden，两道是有意的。 */
body:not([data-role="admin"]) [data-role="admin"] {
  display: none !important;
}

/* 历史列表的两个筛选下拉并排 */
/* 筛选条：整行占满，排在标题行下面、表格上面。align-items: flex-end 让带
   标签的下拉/输入框与旁边光秃秃的按钮底边对齐。 */
.filter-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* 文件行：文件名 + 状态徽章 + 「预览」「下载加密文件」。按钮和徽章要能跟着换行走，
   否则一条五个文件的申请会把「文件」列撑成一条永远看不完的横线。 */
.export-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 2px 0;
}

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

/* 文件开头那条 [hidden] { display: none !important } 压得住这里的 display: flex
   （!important 与先后顺序无关），所以弹层默认那个 hidden 属性是真的能藏住它的。 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 18px 20px;
}

/* 预览的表格自己滚动：200 行 × 50 列不该把整张卡片撑到屏幕外面去。 */
.modal-table {
  margin-top: 10px;
  max-height: 60vh;
  overflow: auto;
}

/* 预览表格没有表头，每一格都是员工文件里的原文，所以窄一点、密一点，
   并且不换行 —— 一格里的长文本换行会把整张表撕成锯齿状。 */
.modal-table td {
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
