* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f5f7;
  color: #1f2328;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.brand { font-weight: 700; font-size: 18px; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 14px; }

.wrap { max-width: 1080px; margin: 24px auto; padding: 0 16px; }

.card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 20px 24px; margin-bottom: 20px;
}
.card h1, .card h2 { margin: 0 0 14px; font-size: 18px; }

.btn {
  display: inline-block; padding: 8px 14px; border-radius: 8px;
  border: 1px solid #d1d5db; background: #fff; color: #1f2328;
  font-size: 14px; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: #b91c1c; border-color: #fca5a5; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: 5px 10px; font-size: 13px; }

/* 上传表单 */
.upload-form { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.upload-form .field { display: flex; flex-direction: column; gap: 6px; }
.upload-form .field label { font-size: 13px; color: #57606a; }
.upload-form input[type=file] { padding: 6px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.upload-form input[type=text], .upload-form select {
  padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}
.upload-form .field.submit { justify-content: flex-end; }

/* 表格 */
.table-scroll { overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.file-table th, .file-table td {
  padding: 10px 12px; border-bottom: 1px solid #eef0f3; text-align: left;
  vertical-align: middle;
}
.file-table th { background: #fafbfc; font-weight: 600; color: #57606a; white-space: nowrap; }
.file-table tr:hover td { background: #fafbfc; }
.fname { white-space: nowrap; }
.actions { white-space: nowrap; }
.actions .btn { margin-right: 4px; }

.link-input {
  width: 320px; max-width: 100%; padding: 6px 8px; font-size: 12px;
  border: 1px solid #d1d5db; border-radius: 6px; background: #f9fafb; color: #57606a;
}

.muted { color: #6b7280; font-size: 13px; }
.msg.err { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; padding: 8px 12px; border-radius: 8px; margin: 0 0 8px; }
.msg.ok  { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 8px 12px; border-radius: 8px; margin: 0 0 8px; }

/* 标签 */
.tag {
  display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px;
  background: #eef2ff; color: #3730a3; margin-left: 4px; vertical-align: middle;
}
.tag.danger { background: #fef2f2; color: #b91c1c; }

/* 登录/注册页 */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #eef2ff, #f8fafc);
}
.auth-card {
  width: 360px; max-width: 92vw; background: #fff; padding: 28px;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.auth-card h1 { font-size: 20px; margin: 0 0 18px; }
.auth-card label { display: block; font-size: 14px; margin-bottom: 14px; color: #374151; }
.auth-card input {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-card .muted { text-align: center; margin-top: 16px; }

/* 后台统计卡片 */
.grid-cards {
  display: grid; gap: 16px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.stat-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 18px; text-align: center;
}
.stat-num { font-size: 24px; font-weight: 700; color: #1f2328; }
.stat-label { font-size: 13px; color: #6b7280; margin-top: 6px; }