/* ==========================================================================
   platform.css — 管理平台 / 文件预览弹窗 / 附件列表 / 轻提示
   ========================================================================== */

/* ==========================================================================
   1. 文件预览弹窗
   ========================================================================== */

.pv-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.pv-mask.is-open {
  display: flex;
}

.pv-dialog {
  width: min(1100px, 94vw);
  height: min(780px, 90vh);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeUp 0.25s ease;
}

.pv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.pv-head__main {
  min-width: 0;
}

.pv-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.5;
  word-break: break-all;
}

.pv-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.5;
  word-break: break-all;
}

.pv-actions {
  flex: none;
  display: flex;
  gap: 8px;
}

/* 通用迷你按钮（预览弹窗 / 管理台共用） */
.pv-btn,
.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2) !important;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pv-btn:hover,
.btn-mini:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  background: var(--primary-soft);
}

.pv-btn--primary,
.btn-mini--primary {
  background: linear-gradient(135deg, #2b5cff, #12b5a5);
  border: none;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(37, 87, 214, 0.22);
}

.pv-btn--primary:hover,
.btn-mini--primary:hover {
  background: linear-gradient(135deg, #2b5cff, #12b5a5);
  color: #fff !important;
  filter: brightness(1.06);
}

.btn-mini--danger:hover {
  border-color: var(--red);
  color: var(--red) !important;
  background: var(--red-soft);
}

.btn-mini[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.pv-body {
  flex: 1;
  min-height: 0;
  background: var(--surface-2);
  position: relative;
}

.pv-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

.pv-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.pv-image img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  background: #fff;
}

.pv-text {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 20px 26px;
  background: var(--surface);
}

.pv-text pre {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}

.pv-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  color: var(--text-2);
}

.pv-state .big {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-1);
}

.pv-state p {
  font-size: 13px;
  line-height: 1.8;
  max-width: 600px;
  margin: 0;
}

.pv-state svg {
  color: var(--text-3);
}

.pv-state .pv-btn {
  margin-top: 6px;
}

.pv-spin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: pvspin 0.8s linear infinite;
}

@keyframes pvspin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   2. 轻提示
   ========================================================================== */

.dash-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 12px);
  z-index: 300;
  background: #17233d;
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 80vw;
}

.dash-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dash-toast--ok { background: #15803d; }
.dash-toast--err { background: #b91c1c; }

/* ==========================================================================
   3. 附件列表（模块页内嵌）
   ========================================================================== */

.att-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.att-row:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.att-row__no {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.att-row.is-bound .att-row__no {
  background: linear-gradient(135deg, #2b5cff, #12b5a5);
  color: #fff;
}

.att-row__main {
  min-width: 0;
}

.att-row__file {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.5;
}

.att-row__sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-row__status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.att-row__go {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.att-row:hover .att-row__go {
  opacity: 1;
}

.att-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.att-badge--none { color: var(--text-3); background: var(--surface-3); }
.att-badge--up { color: #15803d; background: #d3f2de; }
.att-badge--path { color: var(--primary); background: var(--primary-soft); }
.att-badge--demo { color: var(--amber); background: var(--amber-soft); }

/* ==========================================================================
   4. 管理平台页面
   ========================================================================== */

.plat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.plat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.plat-stats {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.plat-stat {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.plat-stat b {
  color: var(--text-1);
  font-family: var(--font-num);
}

.plat-table th:first-child,
.plat-table td:first-child {
  width: 46px;
  text-align: center;
}

.plat-table .cell-file {
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.55;
}

.plat-table .cell-sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.5;
}

.plat-ops {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.plat-pathrow td {
  background: var(--surface-2) !important;
  padding: 10px 12px;
}

.plat-pathrow .row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.plat-pathrow input {
  flex: 1;
  min-width: 240px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-1);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.plat-pathrow input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 87, 214, 0.12);
}

.plat-pathrow .hint {
  width: 100%;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}

.plat-scroll {
  max-height: 620px;
  overflow-y: auto;
}

.plat-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

@media (max-width: 860px) {
  .att-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }
  .att-row__go { display: none; }
}
