:root {
  --bg-page: #f3f5f9;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --brand: #2563eb;
  --brand-soft: #eff6ff;
  --brand-strong: #1d4ed8;
  --accent: #0d9488;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --font-sans: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Noto Sans SC", sans-serif;

  --el-font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Noto Sans SC", sans-serif;

  --el-color-primary: #2563eb;
  --el-color-primary-light-3: #60a5fa;
  --el-color-primary-light-5: #93c5fd;
  --el-color-primary-light-7: #bfdbfe;
  --el-color-primary-light-8: #dbeafe;
  --el-color-primary-light-9: #eff6ff;
  --el-color-primary-dark-2: #1d4ed8;
  --el-text-color-primary: #1f2937;
  --el-text-color-regular: #4b5563;
  --el-text-color-secondary: #6b7280;
  --el-text-color-placeholder: #9ca3af;
  --el-border-color: #e5e7eb;
  --el-border-color-light: #eef2f6;
  --el-border-color-lighter: #f3f4f6;
  --el-fill-color-blank: #ffffff;
  --el-bg-color: #ffffff;
  --el-bg-color-page: #f3f5f9;
  --el-bg-color-overlay: #ffffff;
  --el-mask-color: rgba(15, 23, 42, 0.36);
  --el-box-shadow-light: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
}

.boot-loading {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

.admin-sidebar {
  width: 240px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.22s ease;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.03);
}

.admin-sidebar.is-collapsed {
  width: 72px;
}

.sidebar-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.admin-sidebar.is-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.sidebar-brand .logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand .brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.admin-sidebar .el-scrollbar {
  flex: 1;
  height: 0;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-sidebar.is-collapsed .sidebar-footer {
  justify-content: center;
}

.sidebar-version {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
}

.admin-header {
  height: 64px;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.header-user:hover {
  background: #f3f4f6;
}

.header-user-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

.admin-content {
  flex: 1;
  padding: 22px 24px 32px;
  overflow-y: auto;
}

.page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.muted {
  color: var(--text-muted);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  letter-spacing: -0.3px;
}

.rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #f3f4f6;
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-name {
  font-weight: 600;
  color: var(--text-primary);
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 32%),
    radial-gradient(circle at bottom left, rgba(13, 148, 136, 0.1), transparent 28%),
    #f3f5f9;
}

.login-card {
  width: 420px;
  padding: 40px 36px 32px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.name-link {
  font-weight: 700;
  color: var(--brand);
}

.price-text {
  font-weight: 700;
  color: #059669;
}

.bonus-text {
  color: #d97706;
  font-weight: 600;
}

.token-text {
  color: #7c3aed;
  font-weight: 600;
}

.code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #4f46e5;
  font-size: 12px;
}

.video-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: #111827;
}

/* Element Plus overrides */
.el-menu {
  border-right: none !important;
  background: transparent !important;
  padding: 8px 0 16px;
}

.el-menu-item,
.el-sub-menu__title {
  height: 42px !important;
  line-height: 42px !important;
  margin: 2px 10px;
  border-radius: 8px;
  color: #4b5563 !important;
}

.el-sub-menu .el-menu-item {
  min-width: auto !important;
  padding-left: 48px !important;
}

.el-menu-item.is-active {
  color: var(--brand) !important;
  background: var(--brand-soft) !important;
  font-weight: 600;
}

.el-menu-item:hover,
.el-sub-menu__title:hover {
  background: #f3f4f6 !important;
  color: var(--text-primary) !important;
}

.el-menu--collapse .el-menu-item,
.el-menu--collapse .el-sub-menu__title {
  margin: 4px 8px !important;
  padding: 0 8px !important;
}

.el-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}

.el-card__header {
  border-bottom: 1px solid #f3f4f6 !important;
  padding: 14px 18px !important;
  color: var(--text-primary);
  font-weight: 700;
}

.el-card__body {
  padding: 18px;
}

.el-table {
  --el-table-header-bg-color: #f8fafc;
  --el-table-tr-bg-color: #ffffff;
  --el-table-row-hover-bg-color: #f8fafc;
  --el-table-border-color: #eef2f6;
  --el-table-text-color: #1f2937;
  --el-table-header-text-color: #6b7280;
  border-radius: 10px;
  overflow: hidden;
}

.el-table th.el-table__cell {
  color: #6b7280;
  font-weight: 600;
  background: #f8fafc !important;
  height: 46px;
}

.el-table td.el-table__cell {
  height: 52px;
}

.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
  background: #f8fafc !important;
}

.el-dialog {
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16) !important;
}

.el-dialog__header {
  margin-right: 0 !important;
  padding: 16px 20px 12px !important;
  border-bottom: 1px solid var(--border-color);
  background: #fff;
}

.el-dialog__title {
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.el-dialog__body {
  padding: 18px 20px !important;
  background: #fafbfc;
}

.el-dialog__footer {
  padding: 12px 20px 16px !important;
  border-top: 1px solid var(--border-color);
  background: #fff;
}

.el-pagination {
  --el-pagination-button-color: var(--text-secondary);
  --el-pagination-button-bg-color: #fff;
}

.el-breadcrumb__inner {
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}

.el-breadcrumb__item:last-child .el-breadcrumb__inner {
  color: var(--text-primary) !important;
}

.el-button--primary {
  --el-button-bg-color: var(--brand);
  --el-button-border-color: var(--brand);
  --el-button-hover-bg-color: var(--brand-strong);
  --el-button-hover-border-color: var(--brand-strong);
}

.el-button {
  font-weight: 600;
}

.el-input__wrapper,
.el-textarea__inner,
.el-select .el-input__wrapper {
  box-shadow: 0 0 0 1px #e5e7eb inset !important;
  background: #fff !important;
}

.el-input__wrapper.is-focus,
.el-select .el-input.is-focus .el-input__wrapper {
  box-shadow: 0 0 0 1px var(--brand) inset !important;
}

.el-form-item__label {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}

.el-tabs__item {
  color: var(--text-secondary);
  font-weight: 500;
}

.el-tabs__item.is-active {
  color: var(--brand);
  font-weight: 700;
}

.el-tabs__active-bar {
  background-color: var(--brand);
}

.el-tabs__nav-wrap::after {
  background-color: #eef2f6;
}

.robot-tabs .el-tabs__header {
  margin-bottom: 8px;
}

.soul-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.soul-group {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px 8px;
  margin-bottom: 12px;
}

.soul-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.soul-dim {
  display: grid;
  grid-template-columns: 92px 1fr 44px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.soul-dim-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.soul-dim-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.soul-dim-value {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.persona-preview {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  max-height: 280px;
  overflow: auto;
}

.el-tag {
  border-radius: 999px;
}

.el-dropdown-menu {
  border-radius: 10px !important;
  padding: 6px !important;
}

.el-dropdown-menu__item {
  border-radius: 6px;
}

.el-popper.is-light,
.el-popover,
.el-message-box {
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-md) !important;
}

.el-loading-mask {
  background-color: rgba(255, 255, 255, 0.72) !important;
}

.el-alert {
  border-radius: 10px;
}

.el-overlay {
  background-color: rgba(15, 23, 42, 0.36) !important;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

html,
body,
#app,
.el-button,
.el-input,
.el-table,
.el-menu,
.el-dialog,
.el-form-item__label,
.el-pagination,
.el-tag,
.el-message,
.el-select,
input,
textarea,
button {
  font-family: var(--font-sans) !important;
}

.user-wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.user-wallet-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
}

.user-wallet-card .label {
  font-size: 13px;
  color: var(--text-secondary);
}

.user-wallet-card .num {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.user-wallet-card.gold .num {
  color: #d97706;
}

.user-wallet-card.diamond .num {
  color: #2563eb;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.profile-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
}

.profile-card .k {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.profile-card .v {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  word-break: break-word;
}

@media (max-width: 768px) {
  .user-wallet-grid {
    grid-template-columns: 1fr;
  }

  .admin-content {
    padding: 16px 12px 24px;
  }

  .admin-header {
    padding: 0 12px;
  }

  .header-user-name {
    display: none;
  }

  .login-card {
    width: calc(100% - 32px);
    padding: 28px 20px;
  }
}
