/* 万能PDF工具箱 · 后台样式 */

:root {
  --side-bg: #101828;
  --side-bg-2: #1a2437;
  --side-text: #94a3b8;
  --side-text-active: #ffffff;
  --side-active: #2563eb;
  --page-bg: #f4f6fa;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #1f2937;
}

.admin-shell { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------- 左侧导航 */
.admin-side {
  width: 236px;
  flex: 0 0 236px;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.side-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  flex: 0 0 38px;
}

.side-title { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2; }
.side-sub { color: #64748b; font-size: 11.5px; margin-top: 2px; }

.side-nav { padding: 12px 10px 8px; flex: 1; }

.side-group {
  color: #4b5b73;
  font-size: 11px;
  letter-spacing: .8px;
  padding: 14px 10px 6px;
  font-weight: 600;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--side-text);
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}

.side-item i { font-size: 15px; width: 18px; text-align: center; }
.side-item:hover { background: rgba(255, 255, 255, .06); color: #e2e8f0; }
.side-item.active { background: var(--side-active); color: var(--side-text-active); font-weight: 600; }
.side-item.active i { color: #fff; }

.side-foot { padding: 12px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-logout {
  color: var(--side-text);
  text-decoration: none;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.side-logout:hover { color: #f87171; }

/* ---------------------------------------------------------------- 主区域 */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 16px;
  background: #fff;
  border-bottom: 1px solid #e8ecf3;
}

.page-title { font-size: 19px; font-weight: 700; margin: 0; color: #0f172a; }
.page-subtitle { color: #6b7280; font-size: 13px; margin-top: 4px; }

.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.admin-user {
  display: flex; align-items: center; gap: 7px;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 6px 13px;
  color: #475569;
  font-size: 13px;
}
.admin-user i { font-size: 15px; }

.admin-content { padding: 20px 26px 8px; flex: 1; }
.admin-content > .alert:first-child { margin-top: 0; }

.admin-foot {
  padding: 14px 26px 22px;
  color: #94a3b8;
  font-size: 12px;
}
.admin-foot code { color: #64748b; background: #eef2f7; padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 18px;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #eef2f7;
  font-weight: 600;
  color: #0f172a;
  padding: 13px 18px;
  border-radius: 12px 12px 0 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header .card-head-sub { font-weight: 400; color: #94a3b8; font-size: 12.5px; margin-top: 3px; }
.card-body { padding: 18px; }

/* ---------------------------------------------------------------- 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-icon.blue { background: #e8f0fe; color: #2563eb; }
.stat-icon.green { background: #e7f7ee; color: #16a34a; }
.stat-icon.orange { background: #fff3e6; color: #ea580c; }
.stat-icon.red { background: #fdecec; color: #dc2626; }
.stat-icon.purple { background: #f1ebfd; color: #7c3aed; }
.stat-icon.teal { background: #e3f6f6; color: #0d9488; }
.stat-value { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.1; }
.stat-label { color: #6b7280; font-size: 12.5px; margin-top: 3px; }

/* ---------------------------------------------------------------- 表格 */
.table { margin-bottom: 0; }
.table > thead > tr > th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 12.5px;
  border-bottom: 1px solid #e8ecf3;
  white-space: nowrap;
}
.table > tbody > tr > td { vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: #fafbfd; }
.table td.wrap, .table th.wrap { white-space: normal; word-break: break-word; min-width: 160px; }
.table .muted { color: #94a3b8; }

/* ---------------------------------------------------------------- 微型条形图 */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 132px;
  padding-top: 8px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-stack {
  width: 100%;
  max-width: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100px;
  border-radius: 5px;
  overflow: hidden;
  background: #f1f5f9;
}
.bar-seg { width: 100%; }
.bar-seg.ok { background: #22c55e; }
.bar-seg.fail { background: #ef4444; }
.bar-label { font-size: 10.5px; color: #94a3b8; white-space: nowrap; }

/* ---------------------------------------------------------------- 表单 */
.form-label { font-weight: 600; font-size: 13px; color: #374151; }
.form-text { font-size: 12px; color: #94a3b8; }
.form-section-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
  margin: 6px 0 14px;
  padding-left: 10px;
  border-left: 3px solid #2563eb;
}

/* ---------------------------------------------------------------- 图标预览 */
.icon-preview {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1px solid #e8ecf3;
}
.icon-preview img { max-width: 26px; max-height: 26px; }
.icon-preview.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-preview.sm img { max-width: 20px; max-height: 20px; }

/* ---------------------------------------------------------------- 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #0f172a 0%, #1e293b 55%, #243b6b 100%);
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 34px 32px 28px;
  box-shadow: 0 24px 60px -18px rgba(2, 6, 23, .55);
}
.login-logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  font-size: 25px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.login-title { text-align: center; font-size: 18px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.login-sub { text-align: center; color: #94a3b8; font-size: 12.5px; margin-bottom: 22px; }

/* ---------------------------------------------------------------- 滚动条 */
.admin-side::-webkit-scrollbar { width: 6px; }
.admin-side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; flex: none; height: auto; position: static; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-group { width: 100%; padding-bottom: 2px; }
  .side-item { width: auto; }
  .admin-top { flex-direction: column; align-items: stretch; }
  .admin-content, .admin-top { padding-left: 16px; padding-right: 16px; }
}
