/* ============================================================
   管理后台
   ============================================================ */

.admin-body { min-height: 100vh; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 34px 30px 26px; box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 14px;
}
.brand-mark.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 17px; margin-bottom: 4px; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.login-card > p { margin: -6px 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field > span i { font-style: normal; font-weight: 500; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 11px 13px; font-size: 14.5px; outline: 0; transition: border-color .16s, box-shadow .16s;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: #cfbfa6; box-shadow: 0 0 0 4px rgba(234, 100, 55, .1); }

.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.remember input { width: 16px; height: 16px; accent-color: var(--teal); }

.btn.block { width: 100%; justify-content: center; background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.block:hover { background: #0c4a3d; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #d9562c; }
.btn:disabled { opacity: 1; pointer-events: none; background: #e9e2d5; border-color: #e0d7c7; color: #9aa39d; box-shadow: none; }

.login-error { color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; }
.login-back { text-align: center; font-size: 13px; color: var(--muted); text-decoration: none; margin-top: 4px; }
.login-back:hover { color: var(--ink); }

/* ---------- 顶栏 ---------- */
.admin-top { background: rgba(244, 239, 230, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.admin-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; }
.brand-mark.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 11.5px; }
.admin-main { padding: 22px 20px 60px; }

/* ---------- 统计 ---------- */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; box-shadow: var(--shadow-1);
}
.stat-card span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-card b { font-size: 26px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat-card small { font-size: 12px; color: var(--muted); margin-left: 3px; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-1); padding: 20px; margin-bottom: 16px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 16.5px; letter-spacing: -.2px; }
.panel-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.panel-head p.storage-note { margin-top: 8px; padding: 8px 11px; background: #fff7e8; border: 1px solid #f0dfb9; border-radius: 9px; color: #6f5620; max-width: 46em; line-height: 1.6; }

/* ---------- 拖拽区 ---------- */
.dropzone {
  border: 2px dashed #d9cebb; border-radius: 16px; background: #fcfaf6;
  padding: 30px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: all .18s; outline: 0;
}
.dropzone:hover, .dropzone:focus-visible { border-color: #c5b39a; background: #fffdf9; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.005); }
.dz-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; margin-bottom: 4px; }
.dz-icon svg { width: 24px; height: 24px; }
.dropzone b { font-size: 14.5px; }
.dropzone span { font-size: 12.5px; color: var(--muted); }

/* ---------- 待上传队列 ---------- */
.queue { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.queue:empty { display: none; }
.q-item {
  display: flex; align-items: center; gap: 11px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
}
.q-badge { width: 34px; height: 38px; border-radius: 8px; font-size: 10px; flex: none; display: grid; place-items: center; font-weight: 800; }
.q-name { flex: 1; min-width: 0; }
.q-name b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-name span { font-size: 11.5px; color: var(--muted); }
.q-remove { border: 0; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; font-size: 15px; flex: none; }
.q-remove:hover { background: #f3e7e2; color: var(--danger); }
.q-item .mini-progress { height: 3px; border-radius: 2px; background: #e6ddce; overflow: hidden; margin-top: 5px; }
.q-item .mini-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.q-item.done .mini-progress i { background: var(--ok); }
.q-item.fail { border-color: #ecc9c1; background: #fdf3f0; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.upload-summary { font-size: 13px; color: var(--muted); }
.upload-summary b { color: var(--ink); }

.progress { margin-top: 14px; display: flex; align-items: center; gap: 12px; }
.progress-bar { flex: 1; height: 8px; background: #eee6d8; border-radius: 99px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #f09a6f); transition: width .2s; }
.progress span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; }

/* ---------- 列表 ---------- */
.list-tools { display: flex; gap: 8px; align-items: center; }
.list-tools input {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px;
  background: #fff; outline: 0; width: 190px;
}
.list-tools input:focus { border-color: #cfbfa6; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid #f1ebe0; vertical-align: middle; font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfaf6; }

.cell-file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-file .q-badge { width: 30px; height: 34px; font-size: 9.5px; }
.cell-title { min-width: 0; }
.cell-title b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.cell-title span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.cell-cat { font-size: 12px; }
.cell-cat .cat-pill { white-space: nowrap; }
.cell-muted { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-act { text-align: right; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 30px; height: 30px;
  display: grid; place-items: center; color: var(--ink-2); transition: all .15s;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { border-color: #cfbfa6; background: var(--bg-soft); }
.icon-btn.danger:hover { border-color: #e8c4bb; background: #fdf1ed; color: var(--danger); }
.table-empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- 编辑弹窗 ---------- */
.edit-panel { width: min(520px, 100%); }
.edit-panel .modal-body { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .stat-card:last-child { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 16px 14px 48px; }
  .admin-top-inner { padding: 10px 14px; }
  .header-actions .ghost-btn span { display: none; }
  .header-actions .ghost-btn { padding: 8px; }
  .table { min-width: 0; }
  .table th.hide-sm, .table td.hide-sm, .table th.hide-md, .table td.hide-md { display: none; }
  .table th, .table td { padding: 9px 6px; }
  .cell-title b, .cell-title span { max-width: 46vw; }
  .upload-actions { flex-direction: column; align-items: stretch; }
  .upload-actions .btn { justify-content: center; }
  .upload-summary { text-align: center; }
  .list-tools input { width: 130px; }
  .panel { padding: 16px; }
}


/* 兜底：任何元素带 hidden 都必须隐藏（防被 display 规则覆盖） */
[hidden] { display: none !important; }
