/* ==========================================================================
   kft.3pe.me 后台控制台主题（仅作用于 .admin-layout，不影响登录页 / 客服页 / 用户端）
   按钮按压手感参考 LeiBox "立体按压按钮"（tactile-push-button）
   作者：少荃（抖音：宝龙体育优品小铺）· 来源 https://leibox.pantoria.cn
   本文件为纯 CSS 覆盖层，不改动打包产物结构
   ========================================================================== */

.admin-layout {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6ebf2;
  --surface: #ffffff;
  --bg: #f5f8fc;
  --brand-a: #2563eb;
  --brand-b: #6d28d9;
  --ok: #059669;
  --danger: #e11d48;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-2: 0 2px 6px rgba(15, 23, 42, .06), 0 18px 40px -18px rgba(15, 23, 42, .28);

  background:
    radial-gradient(1200px 520px at 12% -12%, #e8effc 0%, transparent 60%),
    radial-gradient(900px 480px at 96% 4%, #f0e9fd 0%, transparent 58%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%) !important;
  color: var(--ink);
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.admin-layout .topbar {
  position: sticky !important;
  top: 0;
  z-index: 40;
  height: 62px !important;
  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 0 0 20px 20px;
  background:
    linear-gradient(115deg, #0b1120 0%, #14213d 42%, #241a4d 78%, #0b1120 100%) !important;
  box-shadow: 0 12px 30px -18px rgba(11, 17, 32, .85);
  backdrop-filter: saturate(140%) blur(6px);
}

.admin-layout .topbar::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, .55), rgba(196, 181, 253, .55), transparent);
}

.admin-layout .topbar-brand {
  font-size: 16.5px !important;
  font-weight: 800 !important;
  letter-spacing: .2px;
  color: #ffffff !important;
  background: linear-gradient(92deg, #ffffff 12%, #bfdbfe 55%, #ddd6fe 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 10px rgba(129, 140, 248, .35));
}

.admin-layout .topbar-nav { gap: 2px !important; }

.admin-layout .nav-item {
  position: relative;
  padding: 9px 13px !important;
  border-radius: 11px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: .1px;
  color: rgba(226, 232, 240, .82) !important;
  transition: color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.admin-layout .nav-item:hover {
  color: #ffffff !important;
  background: rgba(148, 163, 184, .16) !important;
  transform: translateY(-1px);
}

.admin-layout .nav-item.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--brand-a), #4f46e5 55%, var(--brand-b)) !important;
  box-shadow: 0 8px 22px -10px rgba(79, 70, 229, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.admin-layout .nav-item svg { opacity: .9; }
.admin-layout .nav-item.active svg { opacity: 1; }

.admin-layout .topbar-right { gap: 10px !important; }

.admin-layout .avatar {
  background: linear-gradient(135deg, #38bdf8, #6366f1) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .22), 0 8px 18px -10px rgba(56, 189, 248, .8);
}

.admin-layout .logout-btn {
  border-radius: 11px !important;
  border: 1px solid rgba(226, 232, 240, .28) !important;
  background: rgba(248, 250, 252, .06) !important;
  color: rgba(226, 232, 240, .9) !important;
  font-size: 13px !important;
  padding: 8px 14px !important;
  transition: all .18s ease;
}

.admin-layout .logout-btn:hover {
  background: rgba(225, 29, 72, .16) !important;
  border-color: rgba(244, 114, 182, .6) !important;
  color: #fecdd3 !important;
  transform: translateY(-1px);
}

.admin-layout .menu-toggle {
  color: #e2e8f0 !important;
  border-radius: 10px;
}

/* ---------- 主体 ---------- */
.admin-layout .main-content {
  padding: 26px 24px 40px !important;
}

.admin-layout .content-body {
  max-width: 1280px;
  margin: 0 auto;
}

.admin-layout .user-management {
  background: var(--surface);
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-1);
  padding: 20px 20px 8px;
}

/* ---------- 工具栏 / 按钮 ---------- */
.admin-layout .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px !important;
}

.admin-layout .toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-layout .add-btn {
  border: 0 !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 18px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  letter-spacing: .2px;
  color: #fff !important;
  background: linear-gradient(135deg, #2563eb, #4f46e5 60%, #7c3aed) !important;
  box-shadow:
    0 8px 20px -10px rgba(37, 99, 235, .95),
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -2px 0 rgba(15, 23, 42, .22);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}

.admin-layout .add-btn:hover {
  transform: translateY(-1.5px);
  filter: saturate(112%);
  box-shadow:
    0 14px 26px -12px rgba(37, 99, 235, 1),
    inset 0 1px 0 rgba(255, 255, 255, .3),
    inset 0 -2px 0 rgba(15, 23, 42, .22);
}

.admin-layout .add-btn:active {
  transform: translateY(1px) scale(.985);
  box-shadow:
    0 2px 6px -2px rgba(37, 99, 235, .6),
    inset 0 2px 6px rgba(15, 23, 42, .38);
}

.admin-layout .add-btn.manager-btn {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), inset 0 -2px 0 rgba(15, 23, 42, .06);
}

.admin-layout .add-btn.manager-btn:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}

.admin-layout .add-btn.manager-btn:active {
  background: #eef2f7 !important;
  box-shadow: inset 0 2px 5px rgba(15, 23, 42, .14);
}

/* 搜索框 */
.admin-layout .search-bar {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  background: #f8fafc !important;
  transition: all .2s ease;
}

.admin-layout .search-bar:focus-within {
  background: #fff !important;
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .14);
}

.admin-layout .search-bar input {
  font-size: 13.5px !important;
  color: var(--ink) !important;
}

/* ---------- 表格 ---------- */
.admin-layout .user-table {
  border: 0 !important;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
  margin-top: 4px;
}

.admin-layout .user-table thead th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9) !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 13px 14px !important;
  border-bottom: 1px solid var(--line) !important;
}

.admin-layout .user-table tbody td {
  padding: 14px !important;
  font-size: 13.5px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: var(--ink-2);
}

.admin-layout .user-table tbody tr {
  transition: background .15s ease, box-shadow .15s ease;
}

.admin-layout .user-table tbody tr:hover {
  background: linear-gradient(90deg, #f5f9ff, #faf7ff) !important;
  box-shadow: inset 3px 0 0 0 var(--brand-a);
}

.admin-layout .user-table tbody tr:last-child td { border-bottom: 0 !important; }

/* 操作按钮 */
.admin-layout .action-btn {
  border-radius: 9px !important;
  padding: 6px 13px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border: 1px solid #dbe3ee !important;
  background: #fff !important;
  color: #334155 !important;
  transition: all .16s ease;
}

.admin-layout .action-btn:hover { transform: translateY(-1px); }

.admin-layout .action-btn.edit:hover {
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, .9);
}

.admin-layout .action-btn.delete:hover {
  color: #be123c !important;
  border-color: #fda4af !important;
  background: #fff1f2 !important;
  box-shadow: 0 6px 14px -8px rgba(225, 29, 72, .9);
}

.admin-layout .action-btn:active { transform: translateY(1px) scale(.985); }

/* ---------- 移动端卡片 ---------- */
.admin-layout .user-card {
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow-1);
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
}

.admin-layout .user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.admin-layout .user-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px !important;
  background: linear-gradient(135deg, #f8fbff, #f6f2ff);
  border-radius: 16px 16px 0 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink);
}

.admin-layout .user-card .card-row {
  padding: 9px 16px !important;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px dashed #eef2f7;
}

.admin-layout .user-card .card-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px !important;
}

.admin-layout .user-card .card-actions .action-btn { flex: 1; text-align: center; }

/* ---------- 移动端菜单 ---------- */
.admin-layout .mobile-menu {
  border-right: 1px solid var(--line) !important;
  box-shadow: var(--shadow-2);
}

.admin-layout .mobile-menu-item {
  border-radius: 12px;
  margin: 3px 8px;
  transition: all .16s ease;
}

.admin-layout .mobile-menu-item.active {
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b)) !important;
  color: #fff !important;
}

/* ---------- 细节 ---------- */
.admin-layout ::selection { background: rgba(99, 102, 241, .22); }

.admin-layout ::-webkit-scrollbar { width: 10px; height: 10px; }
.admin-layout ::-webkit-scrollbar-thumb {
  background: #cfd8e6;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.admin-layout ::-webkit-scrollbar-thumb:hover { background: #aab8cd; background-clip: content-box; }

/* 进入动画 */
@keyframes kftRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.admin-layout .user-management { animation: kftRise .38s cubic-bezier(.22, .61, .36, 1) both; }
.admin-layout .user-table tbody tr { animation: kftRise .34s ease both; }
.admin-layout .user-table tbody tr:nth-child(2) { animation-delay: .04s; }
.admin-layout .user-table tbody tr:nth-child(3) { animation-delay: .08s; }
.admin-layout .user-table tbody tr:nth-child(4) { animation-delay: .12s; }
.admin-layout .user-table tbody tr:nth-child(5) { animation-delay: .16s; }

/* 降低动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .admin-layout .user-management,
  .admin-layout .user-table tbody tr { animation: none !important; }
  .admin-layout * { transition: none !important; }
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 768px) {
  .admin-layout .topbar {
    height: 54px !important;
    padding: 0 12px !important;
    border-radius: 0 0 16px 16px;
  }
  .admin-layout .main-content { padding: 16px 12px 28px !important; }
  .admin-layout .user-management { padding: 14px 12px 6px; border-radius: 16px !important; }
  .admin-layout .toolbar { gap: 10px; }
  .admin-layout .add-btn { padding: 9px 15px !important; font-size: 13px !important; }
  .admin-layout .search-bar { width: 100%; }
}

/* ==================== v2 修正：布局宽度与桌面/移动重复渲染 ==================== */

/* 桌面端只保留表格，隐藏同内容的卡片列表（原页面两者同时渲染） */
@media (min-width: 769px) {
  .admin-layout .user-cards.mobile-only { display: none !important; }
}

/* 移动端布局交给 AdminMobilePage，这里只保证平板窄屏不重复 */
@media (max-width: 768px) {
  .admin-layout .user-table.desktop-only { display: none !important; }
}

/* 宽度补全 + 居中 */
.admin-layout .main-content { padding: 0 !important; }

.admin-layout .content-body {
  width: 100% !important;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 32px 48px !important;
  box-sizing: border-box;
}

.admin-layout .user-management {
  width: 100% !important;
  box-sizing: border-box;
}

.admin-layout .user-table { width: 100% !important; }

/* 表格内文字与对齐微调 */
.admin-layout .user-table tbody td:first-child {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.admin-layout .user-table tbody td:nth-child(2) {
  font-weight: 600;
  color: var(--ink);
}

/* 角色标签：仅匹配表格与卡片内的直接 span，避免误伤图标 */
.admin-layout .user-table tbody td span,
.admin-layout .user-card .card-header span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

/* 卡片内整行按钮统一高度 */
.admin-layout .user-card .card-actions .action-btn {
  padding: 9px 12px !important;
  border-radius: 10px !important;
}

/* ==================== v3 细节打磨 ==================== */

/* 卡片顶部渐变细线，呼应顶栏 */
.admin-layout .user-management { position: relative; overflow: hidden; }

.admin-layout .user-management::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #6366f1 38%, #a855f7 68%, #ec4899);
  opacity: .9;
}

/* 行高与呼吸感 */
.admin-layout .user-table tbody td { height: 52px; }

/* 表头两侧圆角 */
.admin-layout .user-table thead th:first-child { border-top-left-radius: 12px; }
.admin-layout .user-table thead th:last-child { border-top-right-radius: 12px; }

/* 金额列等宽数字 */
.admin-layout .user-table tbody td:nth-child(4) {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
}

/* 剩余天数列弱化 */
.admin-layout .user-table tbody td:nth-child(5) { color: #64748b; }

/* 操作列右对齐留白 */
.admin-layout .user-table tbody td:last-child { white-space: nowrap; }
.admin-layout .user-table tbody td:last-child .action-btn + .action-btn { margin-left: 8px; }

/* 搜索图标弱化 */
.admin-layout .search-bar svg { color: #94a3b8; }

/* 页面底部收尾：淡渐变，避免大片死白 */
.admin-layout .content-body::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 28px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* 极淡网格纹理，仅在内容区背后 */
.admin-layout .content-body {
  background-image:
    linear-gradient(rgba(148, 163, 184, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: -1px -1px;
}

/* ==================== v4 移动端壳层（AdminMobilePage / HomePage 共用，限定 .page-wrapper） ==================== */

.page-wrapper {
  background:
    radial-gradient(620px 300px at 8% -6%, #e8effc 0%, transparent 62%),
    radial-gradient(520px 280px at 98% 2%, #f1e9fd 0%, transparent 60%),
    linear-gradient(180deg, #fbfdff 0%, #f4f7fc 100%) !important;
}

.page-wrapper .content { padding: 18px 16px 104px !important; }

.page-wrapper .page-title {
  font-size: 27px !important;
  font-weight: 900 !important;
  letter-spacing: -.7px;
  color: #0f172a !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}

.page-wrapper .info-card {
  border-radius: 18px !important;
  border: 1px solid #e6ebf2 !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 14px 30px -24px rgba(15, 23, 42, .5);
  overflow: hidden;
}

.page-wrapper .info-row {
  padding: 15px 17px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.page-wrapper .info-row:last-child { border-bottom: 0 !important; }

.page-wrapper .tg-notice {
  border-radius: 18px !important;
  border: 1px solid #ece5fb !important;
  background: linear-gradient(135deg, #ffffff 0%, #f8f5ff 100%) !important;
  box-shadow: 0 14px 30px -26px rgba(109, 40, 217, .55);
}

.page-wrapper .tg-title {
  font-weight: 800 !important;
  letter-spacing: -.2px;
}

.page-wrapper .custom-tabbar {
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: saturate(150%) blur(14px);
  box-shadow: 0 -10px 30px -22px rgba(15, 23, 42, .7);
  border-top: 1px solid rgba(226, 232, 240, .8);
}

.page-wrapper .tab-item.active { color: #4f46e5 !important; }

.page-wrapper .tab-item { transition: color .18s ease, transform .18s ease; }
.page-wrapper .tab-item:active { transform: scale(.96); }
