/* ==========================================================
   清欢资源中心 - 管理后台样式（叠加在 style.css 之上）
   ========================================================== */

/* 分片上传进度条 */
.upload-progress {
  margin: 1rem 0 0.25rem;
  padding: 0.85rem 1rem;
  background: #F0F4F2;
  border: 1px solid #E7E5E4;
  border-radius: 12px;
}
.upload-progress-track {
  width: 100%;
  height: 8px;
  background: #E7E5E4;
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3A6B5F, #5E9787);
  border-radius: 999px;
  transition: width 200ms ease;
}
.upload-progress-text {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #57534E;
  text-align: right;
}

/* ---------- 登录页 ---------- */
.admin-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(143, 191, 178, 0.22), transparent 60%),
    radial-gradient(700px 380px at 10% 110%, rgba(58, 107, 95, 0.1), transparent 55%),
    var(--bg);
}

.login-scene { width: min(400px, 92vw); padding: 40px 0; }

.login-card { padding: 36px 34px 30px; box-shadow: var(--shadow-lg); animation: fadeUp 0.6s ease both; }

.login-brand { text-align: center; margin-bottom: 26px; }

.login-brand .brand-seal { margin: 0 auto 12px; width: 48px; height: 48px; font-size: 24px; border-radius: 14px; }

.login-brand h1 { font-size: 20px; letter-spacing: 0.04em; }

.login-brand p { font-size: 12.5px; color: var(--text-faint); letter-spacing: 0.28em; text-indent: 0.28em; margin-top: 4px; }

.login-card .field { margin-bottom: 16px; }

.login-card .btn-block { margin-top: 6px; padding: 12px; }

/* ---------- 后台通用 ---------- */
.admin-wrap { padding: 32px 0 70px; }

.admin-narrow { max-width: 780px; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.admin-page-title { font-size: 24px; font-weight: 700; }

.admin-topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card { padding: 20px 22px; }

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-label { font-size: 12.5px; color: var(--text-faint); margin-bottom: 4px; }

.stat-value { font-size: 26px; font-weight: 700; color: var(--primary-dark); }

/* ---------- 面板 / 表格 ---------- */
.admin-panel { padding: 24px; }

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-panel-head h2 { font-size: 17px; font-weight: 600; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }

.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }

.table thead th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  background: var(--bg-soft);
  white-space: nowrap;
}

.table tbody tr { transition: background 0.18s ease; }

.table tbody tr:hover { background: rgba(143, 191, 178, 0.06); }

.table tbody tr:last-child td { border-bottom: none; }

.cell-strong { font-weight: 600; }

.cell-muted { color: var(--text-faint); font-size: 13px; }

.cell-empty { text-align: center; color: var(--text-faint); padding: 34px 16px !important; }

.cell-right { text-align: right; white-space: nowrap; }

.cell-right .btn { margin-left: 6px; }

/* ---------- 表单 ---------- */
#resource-form .field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--text-muted);
}

.field-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

.form-error { color: var(--danger); font-size: 13px; margin: 4px 0 12px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.input-file { padding: 8px; }

/* 单选卡片 */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.radio-card { cursor: pointer; }

.radio-card input { position: absolute; opacity: 0; }

.radio-card-body {
  display: block;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: var(--transition);
}

.radio-card-body strong { display: block; font-size: 14.5px; margin-bottom: 3px; }

.radio-card-body em { font-style: normal; font-size: 12.5px; color: var(--text-faint); line-height: 1.5; display: block; }

.radio-card input:checked + .radio-card-body {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(143, 191, 178, 0.12), rgba(58, 107, 95, 0.05));
  box-shadow: 0 0 0 3px rgba(143, 191, 178, 0.15);
}

.radio-card:hover .radio-card-body { border-color: var(--primary-light); }

.checkbox-field { display: flex; align-items: center; }

.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-muted); cursor: pointer; }

.checkbox-label input { accent-color: var(--primary); width: 16px; height: 16px; }
