/* ══════════════════════════════════════════
 *  AI原点社区 — 管理统计页样式
 *  admin-stats.css
 *  主题色与主应用保持一致：紫罗兰渐变
 * ══════════════════════════════════════════ */

/* ── 整体面板 ── */
.admin-stats-panel {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #6b5cb7 0%, #9b7ed8 40%, #d4a8e8 100%);
  color: #fff;
  font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-stats-panel[hidden] {
  display: none !important;
}

.admin-stats-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(168, 54, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(129, 105, 255, 0.10) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── 头部 ── */
.admin-stats-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 36px 14px;
  flex-shrink: 0;
}

.admin-stats-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 12px rgba(77, 41, 155, 0.25);
  letter-spacing: 1px;
}

.admin-stats-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-stats-refresh-indicator {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.admin-stats-export-btn {
  padding: 9px 28px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.admin-stats-export-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 18px rgba(168, 54, 255, 0.2);
  transform: translateY(-1px);
}

/* ── 筛选栏 ── */
.admin-stats-filters {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 36px 16px;
  flex-shrink: 0;
}

.admin-filter-search {
  flex: 1;
  max-width: 280px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  outline: none;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.admin-filter-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.admin-filter-search:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(168, 54, 255, 0.15);
}

.admin-filter-select {
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  min-width: 140px;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.admin-filter-select:hover,
.admin-filter-select:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.18);
}

.admin-filter-select option {
  background: #7c5cbf;
  color: #fff;
}

.admin-filter-reset {
  padding: 9px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.admin-filter-reset:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* ── 表格容器（固定高度 + 滚动） ── */
.admin-stats-table-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  margin: 0 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

/* 自定义滚动条 */
.admin-stats-table-wrap::-webkit-scrollbar {
  width: 6px;
}

.admin-stats-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.admin-stats-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.admin-stats-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ── 表格 ── */
.admin-stats-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-stats-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.admin-stats-table th {
  padding: 14px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  background: #7b52b5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  user-select: none;
}

/* 表头内公式换行 */
.admin-th-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  line-height: 1.3;
}

.admin-col-sortable {
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.admin-col-sortable:hover {
  color: #fff;
  background: #8b5fbf;
}

.admin-col-active {
  color: #fff !important;
  background: #9362c7 !important;
}

.admin-col-num {
  text-align: center !important;
}

.admin-col-index {
  width: 52px;
  text-align: center;
}

.admin-stats-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.18s;
}

.admin-stats-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.08);
}

.admin-stats-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.admin-stats-table tbody tr:nth-child(even):hover td {
  background: rgba(255, 255, 255, 0.08);
}

.admin-cell-center {
  text-align: center;
}

.admin-cell-bold {
  font-weight: 700;
  color: #f0d6ff;
  text-shadow: 0 0 8px rgba(168, 54, 255, 0.3);
}

/* ── 底部 ── */
.admin-stats-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 36px;
  flex-shrink: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .admin-stats-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 12px;
  }

  .admin-stats-filters {
    flex-wrap: wrap;
    padding: 0 16px 12px;
  }

  .admin-filter-search {
    max-width: 100%;
    width: 100%;
  }

  .admin-stats-table-wrap {
    margin: 0 16px;
  }

  .admin-stats-footer {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
  }
}
