/* ============================================================
 * 文件站专属样式
 * 复用门户的 CSS 变量（--primary, --card, --border 等）
 * ============================================================ */

/* ---- 基础 ---- */
.fs-body { background: var(--bg, #f6f7fb); min-height: 100vh; display: flex; flex-direction: column; }
.fs-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; width: 100%; box-sizing: border-box; flex: 1; }

/* ---- 顶栏微调 ---- */
.fs-topbar .brand { font-size: 16px; font-weight: 700; }

/* ---- 工具栏 ---- */
.fs-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.fs-search {
  display: flex; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap;
}
.fs-search input[type="text"] {
  flex: 1; min-width: 180px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--card);
}
.fs-search select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--card); min-width: 120px;
}
.fs-search button {
  padding: 10px 20px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 14px; cursor: pointer;
}
.fs-search .fs-clear {
  padding: 10px 16px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-size: 14px;
}
.fs-search .fs-clear:hover { color: var(--text); }

/* ---- 按钮 ---- */
.fs-btn-primary {
  display: inline-block; padding: 10px 20px; border-radius: 10px;
  background: var(--primary); color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 500; border: none; cursor: pointer;
}
.fs-btn-primary:hover { background: var(--primary-dark); }
.fs-btn-secondary {
  display: inline-block; padding: 10px 18px; border-radius: 10px;
  background: var(--surface-1); color: var(--text); text-decoration: none;
  font-size: 14px; border: 1px solid var(--border);
}
.fs-btn-ghost {
  display: inline-block; padding: 8px 14px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.fs-btn-ghost:hover { color: var(--text); }

/* ---- 统计 ---- */
.fs-stats {
  color: var(--muted); font-size: 13px; margin-bottom: 16px;
}
.fs-stats b { color: var(--text); }

/* ---- 表格 ---- */
.fs-table-wrap { background: var(--card); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.fs-table { width: 100%; border-collapse: collapse; }
.fs-table thead th {
  text-align: left; padding: 12px 14px; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.fs-table tbody td {
  padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.fs-table tbody tr:last-child td { border-bottom: none; }
.fs-table tbody tr:hover { background: var(--surface-1); }

.fs-col-icon { width: 40px; font-size: 22px; text-align: center; }
.fs-col-name { min-width: 260px; }
.fs-col-size { width: 100px; color: var(--muted); }
.fs-col-uploader { width: 100px; color: var(--muted); }
.fs-col-date { width: 160px; color: var(--muted); font-size: 13px; }
.fs-col-dl { width: 70px; color: var(--muted); text-align: right; }
.fs-col-ops { width: 140px; }

.fs-fname { color: var(--text); text-decoration: none; font-weight: 500; }
.fs-fname:hover { color: var(--primary); }

.fs-vis {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px;
  margin-left: 8px; font-weight: 500;
}
.fs-vis-public { background: #dcfce7; color: #166534; }
.fs-vis-member { background: #dbeafe; color: #1e40af; }
.fs-vis-admin  { background: #fee2e2; color: #991b1b; }

.fs-col-ops a {
  color: var(--primary); text-decoration: none; margin-right: 10px; font-size: 13px;
}
.fs-col-ops a:hover { text-decoration: underline; }

/* ---- 空 ---- */
.fs-empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.fs-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ---- 分页 ---- */
.fs-pager {
  display: flex; justify-content: center; align-items: center;
  gap: 16px; margin-top: 24px; font-size: 14px; color: var(--muted);
}
.fs-pager a { color: var(--primary); text-decoration: none; }
.fs-pager a:hover { text-decoration: underline; }

/* ---- 详情页 ---- */
.fs-detail-info {
  display: flex; gap: 20px; padding: 24px;
  background: var(--card); border-radius: 14px; border: 1px solid var(--border);
  margin-bottom: 20px;
}
.fs-detail-icon { font-size: 56px; line-height: 1; }
.fs-detail-meta { flex: 1; min-width: 0; }
.fs-detail-name { font-size: 18px; margin: 0 0 12px; word-break: break-all; }
.fs-detail-row {
  display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px;
  margin-bottom: 16px;
}
.fs-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- 预览 ---- */
.fs-preview {
  background: var(--card); border-radius: 14px; border: 1px solid var(--border);
  overflow: hidden;
}
.fs-preview-label {
  padding: 12px 20px; background: var(--surface-1); border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
}
.fs-preview-body { padding: 20px; text-align: center; }
.fs-preview-body img { max-width: 100%; max-height: 600px; border-radius: 8px; }
.fs-preview-body video { max-width: 100%; max-height: 600px; border-radius: 8px; }
.fs-preview-body audio { width: 100%; }
.fs-preview-body iframe { width: 100%; height: 70vh; border: none; }
.fs-preview-body pre {
  text-align: left; background: var(--surface-1); padding: 16px; border-radius: 8px;
  overflow-x: auto; font-size: 13px; max-height: 500px; overflow-y: auto;
}
.fs-no-preview {
  text-align: center; padding: 40px; color: var(--muted);
  background: var(--card); border-radius: 14px; border: 1px dashed var(--border);
}

/* ---- 上传页 ---- */
.fs-upload-card {
  max-width: 640px; margin: 0 auto; padding: 28px;
  background: var(--card); border-radius: 14px; border: 1px solid var(--border);
}
.fs-upload-card h1 { margin: 0 0 12px; font-size: 20px; }
.fs-upload-hint { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.fs-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.fs-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
.fs-field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--card);
}

.fs-dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 40px 20px;
  text-align: center; cursor: pointer; transition: all .15s; background: var(--surface-1);
}
.fs-dropzone:hover, .fs-dropzone.hover { border-color: var(--primary); background: var(--primary-soft, #eff6ff); }
.fs-dropzone-icon { font-size: 48px; margin-bottom: 10px; }
.fs-dropzone > div { font-size: 15px; color: var(--text); }
.fs-dropzone-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

.fs-file-list { margin-top: 16px; }
.fs-file-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--surface-1); border-radius: 8px; margin-bottom: 6px;
  font-size: 13px;
}
.fs-fsize { color: var(--muted); font-size: 12px; }

.fs-upload-submit { margin-top: 20px; width: 100%; padding: 14px; font-size: 15px; }

/* ---- Alert ---- */
.fs-alert {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}
.fs-alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.fs-alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---- Admin ---- */
.fs-admin-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.fs-admin-header h1 { margin: 0; font-size: 18px; }
.fs-admin-header-right { display: flex; gap: 10px; }
.fs-link-del { color: #dc2626 !important; }
.fs-link-del:hover { color: #991b1b !important; }

/* ---- Toast ---- */
.fs-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 24px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 14px;
  animation: toastIn .3s ease;
}
.fs-toast.fade { opacity: 0; transition: opacity .4s; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---- Footer ---- */
.fs-footer {
  margin-top: auto; padding: 20px; text-align: center; color: var(--muted);
  font-size: 12px; border-top: 1px solid var(--border); background: var(--card);
}
.fs-footer a { color: var(--primary); text-decoration: none; margin-left: 12px; }
.fs-denied { text-align: center; padding: 100px 20px; color: var(--muted); font-size: 18px; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .fs-toolbar { flex-direction: column; align-items: stretch; }
  .fs-search { flex-wrap: wrap; }
  .fs-search input[type="text"] { min-width: 120px; }
  .fs-table { font-size: 13px; }
  .fs-table thead th { display: none; }
  .fs-table tbody td {
    display: block; padding: 8px 12px; border-bottom: none;
  }
  .fs-table tbody tr {
    display: block; padding: 12px 0; border-bottom: 1px solid var(--border);
  }
  .fs-col-icon { width: auto; text-align: left; font-size: 24px; }
  .fs-col-name { min-width: 0; }
  .fs-detail-info { flex-direction: column; text-align: center; }
  .fs-detail-icon { font-size: 48px; }
  .fs-detail-row { justify-content: center; }
  .fs-upload-grid { grid-template-columns: 1fr; }
  .fs-admin-header { flex-direction: column; gap: 10px; align-items: stretch; }
}
