/* ============================================
   CloudNova Manager (Member Center)
   Tech dark + accent blue, aligned with homepage
   Framework: Vue 3 + Element Plus (CDN)
   ============================================ */

:root {
  /* 质感深色系：略提亮基底，偏冷灰蓝，避免纯黑一片 */
  --cn-dark-1: #12151c;
  --cn-dark-2: #171a22;
  --cn-dark-3: #1c2029;
  --cn-dark-4: #252a35;
  --cn-dark-5: #2e3440;
  --cn-border: rgba(255, 255, 255, 0.10);
  --cn-border-hover: rgba(255, 255, 255, 0.16);
  /* Text hierarchy */
  --cn-text-title: rgba(244, 244, 250, 0.97);
  --cn-text-primary: rgba(228, 231, 240, 0.92);
  --cn-text-secondary: rgba(163, 170, 186, 0.95);
  --cn-text-muted: rgba(120, 128, 145, 0.95);
  --cn-accent: #3b82f6;
  --cn-accent-light: #60a5fa;
  --cn-accent-glow: rgba(59, 130, 246, 0.22);
  --cn-gradient-accent: linear-gradient(135deg, var(--cn-accent) 0%, var(--cn-accent-light) 100%);
  --cn-radius-md: 10px;
  --cn-radius-lg: 16px;
  --cn-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.22);
  --cn-shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.32);
  /* 卡片：略亮 + 轻微高光边，层次更清晰 */
  --cn-card-bg: linear-gradient(
    165deg,
    rgba(38, 42, 54, 0.88) 0%,
    rgba(28, 31, 40, 0.92) 45%,
    rgba(24, 27, 35, 0.95) 100%
  );
  --cn-card-border: rgba(255, 255, 255, 0.09);
  --cn-surface-glow: rgba(59, 130, 246, 0.06);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--cn-text-primary) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* 多层背景：主色 + 光斑 + 细网格，打破单调 */
  background-color: var(--cn-dark-1);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 130, 246, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 50%, rgba(139, 92, 246, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 0% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 28%),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
}

/* 仅作用于装饰层，避免对含文字的主区域做 transform（会导致文字发糊） */
@keyframes mgrBgFloat {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

/* ---------- Element Plus theme tuning ---------- */
/* 双重:root提升权重，强制覆盖Element Plus内置变量 */
:root:root {
  --el-bg-color: rgba(20, 20, 25, 0.70);
  --el-bg-color-overlay: rgba(26, 26, 34, 0.96);
  --el-text-color-primary: var(--cn-text-primary) !important;
  --el-text-color-regular: rgba(156, 163, 175, 1) !important;
  --el-text-color-secondary: var(--cn-text-secondary) !important;
  --el-border-color: rgba(255, 255, 255, 0.10) !important;
  --el-border-color-light: rgba(255, 255, 255, 0.08) !important;
  --el-fill-color-blank: rgba(28, 31, 40, 0.45) !important;
  --el-fill-color: rgba(255, 255, 255, 0.05) !important;
  --el-color-primary: var(--cn-accent) !important;
  --el-color-primary-light-3: rgba(59, 130, 246, 0.65) !important;
  --el-color-primary-light-5: rgba(59, 130, 246, 0.45) !important;
  --el-color-primary-light-7: rgba(59, 130, 246, 0.25) !important;
  --el-color-success: #10b981 !important;
  --el-color-warning: #f59e0b !important;
  --el-color-danger: #ef4444 !important;
  --el-border-radius-base: 10px !important;
  --el-box-shadow-light: 0 10px 28px rgba(0,0,0,0.35) !important;
}

.el-popper,
.el-overlay {
  backdrop-filter: blur(10px);
}

.el-dialog,
.el-drawer {
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--cn-shadow-lg);
}

.el-message.mgr-message {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(42, 46, 58, 0.96) 0%, rgba(30, 34, 44, 0.98) 100%);
  color: var(--cn-text-primary) !important;
  box-shadow: var(--cn-shadow-md);
}

/* ---------- Shell layout ---------- */
#app {
  min-height: 100vh;
}

.mgr-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.mgr-aside {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(
    180deg,
    rgba(30, 34, 44, 0.95) 0%,
    rgba(22, 25, 32, 0.92) 50%,
    rgba(18, 21, 28, 0.94) 100%
  );
  border-right: 1px solid var(--cn-card-border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.mgr-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.3rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mgr-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cn-gradient-accent);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.08);
}

.mgr-brand-name {
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--cn-text-title) !important;
}

.mgr-brand-sub {
  color: var(--cn-text-muted) !important;
  font-size: 0.85rem;
  margin-top: 2px;
}

.mgr-menu-scroll {
  padding: 0.75rem 0.6rem;
  flex: 1;
}

.mgr-menu {
  border-right: none !important;
  background: transparent !important;
}

.mgr-menu .el-sub-menu__title,
.mgr-menu .el-menu-item {
  border-radius: 12px;
  margin: 0.25rem 0;
  height: 44px;
  line-height: 44px;
  color: var(--cn-text-primary) !important;
}

.mgr-menu .el-sub-menu__title:hover,
.mgr-menu .el-menu-item:hover {
  background: rgba(59, 130, 246, 0.08) !important;
  color: var(--cn-text-title) !important;
}

.mgr-menu .el-menu-item.is-active {
  background: rgba(59, 130, 246, 0.12) !important;
  color: var(--cn-text-title) !important;
}

.mgr-aside-footer {
  padding: 1rem 1.1rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mgr-balance {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.mgr-balance .label {
  font-size: 0.82rem;
  color: var(--cn-text-muted) !important;
}

.mgr-balance .value {
  margin-top: 0.25rem;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--cn-text-primary) !important;
}

.mgr-cta {
  width: 100%;
  border-radius: 12px;
  background: var(--cn-gradient-accent);
  border: none;
  color: #fff !important;
}

.mgr-main {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.25rem 1.25rem 2.5rem;
}

/* 柔光动效只画在伪元素上，正文不参与合成变换，避免发糊 */
.mgr-main::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 520px at 72% 18%, rgba(59, 130, 246, 0.10) 0%, transparent 68%),
    radial-gradient(ellipse 760px 480px at 28% 72%, rgba(139, 92, 246, 0.06) 0%, transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 22%);
  animation: mgrBgFloat 14s ease-in-out infinite;
}

.mgr-main > * {
  position: relative;
  z-index: 1;
}

.mgr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--cn-card-border);
  border-radius: 18px;
  background: var(--cn-card-bg);
  box-shadow:
    var(--cn-shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.mgr-page-title .title {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--cn-text-title) !important;
}

.mgr-page-title .desc {
  color: var(--cn-text-muted) !important;
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

/* 返回首页链接 */
.mgr-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  margin-right: 0.75rem;
  border: 1px solid var(--cn-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cn-text-secondary) !important;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mgr-home-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--cn-border-hover);
  color: var(--cn-text-primary) !important;
  transform: translateY(-1px);
}

.mgr-home-link i {
  font-size: 0.95rem;
}

.mgr-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mgr-search {
  width: 320px;
}

.mgr-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  user-select: none;
  color: var(--cn-text-secondary) !important;
}

.mgr-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--cn-gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: #fff !important;
}

.mgr-user .name {
  font-weight: 800;
  color: var(--cn-text-primary) !important;
}

.mgr-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  user-select: none;
  color: var(--cn-text-secondary) !important;
  transition: all 0.25s ease;
}

.mgr-theme:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(59, 130, 246, 0.06);
  color: var(--cn-text-title) !important;
}

.mgr-theme-grid {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 1rem;
  align-items: center;
}

.mgr-theme-swatch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.mgr-theme-swatch .sw {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.03);
}

.mgr-theme-swatch .k {
  color: var(--cn-text-muted) !important;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 900;
}

.mgr-theme-swatch .v {
  margin-top: 0.2rem;
  color: var(--cn-text-title) !important;
  font-weight: 900;
}

.mgr-content {
  margin-top: 1.1rem;
}

.mgr-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1rem;
}

.mgr-card {
  border: 1px solid var(--cn-card-border);
  border-radius: 18px;
  background: var(--cn-card-bg);
  backdrop-filter: blur(14px);
  box-shadow:
    var(--cn-shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.mgr-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

.mgr-card-head .h {
  font-weight: 900;
  color: var(--cn-text-title) !important;
}

.mgr-card-body {
  padding: 1rem 1.1rem 1.1rem;
}

/* 安全设置区域文字配色优化 */
.mgr-card-body .el-alert__title {
    color: rgb(239 141 0)
}
.mgr-card-body .el-alert__description {
  color: var(--cn-text-secondary) !important;
}

.mgr-filters {
  display: grid;
  grid-template-columns: 1fr 180px 120px;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.mgr-filters .el-date-editor {
  width: 100%;
}

.mgr-table {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Element Plus table dark skin (fix readability) */
.mgr-table.el-table {
  --el-table-bg-color: rgba(13, 13, 18, 0.35);
  --el-table-tr-bg-color: rgba(13, 13, 18, 0.10);
  --el-table-header-bg-color: rgba(34, 34, 45, 0.72);
  --el-table-row-hover-bg-color: rgba(59, 130, 246, 0.10);
  --el-table-border-color: rgba(255, 255, 255, 0.06);
  --el-table-text-color: var(--cn-text-primary) !important;
  --el-table-header-text-color: rgba(240, 240, 245, 0.92) !important;
  background: rgba(13, 13, 18, 0.20) !important;
}

.mgr-table.el-table .el-table__inner-wrapper,
.mgr-table.el-table .el-table__header-wrapper,
.mgr-table.el-table .el-table__body-wrapper,
.mgr-table.el-table .el-scrollbar__wrap,
.mgr-table.el-table .el-scrollbar__view {
  background: transparent !important;
}

.mgr-table.el-table .el-table__header,
.mgr-table.el-table .el-table__body {
  background: transparent !important;
}

.mgr-table .el-table__header-wrapper th.el-table__cell {
  background: linear-gradient(180deg, rgba(46, 52, 66, 0.88) 0%, rgba(36, 40, 52, 0.92) 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cn-text-title) !important;
  font-weight: 800;
}

.mgr-table .el-table__body-wrapper td.el-table__cell {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(13, 13, 18, 0.12) !important;
  color: var(--cn-text-primary) !important;
}

/* 强制表格文字颜色生效 */
.mgr-table.el-table .cell,
.mgr-table.el-table .el-table__header .cell {
  color: inherit !important;
}

.mgr-table.el-table--striped .el-table__body tr.el-table__row--striped > td.el-table__cell {
  background: rgba(255, 255, 255, 0.02) !important;
}

.mgr-table.el-table .el-table__body tr:hover > td.el-table__cell {
  background: rgba(59, 130, 246, 0.10) !important;
}

.mgr-table .el-table__empty-block {
  background: rgba(13, 13, 18, 0.20);
}

.mgr-table .el-table__empty-text {
  color: var(--cn-text-muted) !important;
}

.mgr-cell-text {
  color: var(--cn-text-primary) !important;
  font-weight: 800;
}

.mgr-cell-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mgr-cell-title {
  color: var(--cn-text-title) !important;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.mgr-cell-sub {
  color: var(--cn-text-secondary) !important;
  font-size: 0.82rem;
  line-height: 1.4;
}

.mgr-form {
  max-width: 520px;
}

.mgr-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}


/* 安全设置按钮全局样式优化 */
.mgr-actions .mgr-security-btn {
  height: 36px;
  line-height: 1;
  border-width: 1px;
}
/* 匹配提醒框的warning plain按钮hover效果 */
.mgr-actions .el-button--warning.is-plain:hover {
  background-color: #fdf6ec;
  border-color: #f5dab1;
  color: #e6a23c;
}
/* danger plain按钮hover效果优化 */
.mgr-actions .el-button--danger.is-plain:hover {
  background-color: #fef0f0;
  border-color: #fbc4c4;
  color: #f56c6c;
}

/* 按钮基础交互优化 */
.mgr-kv {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.mgr-kv .item {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.mgr-kv .k {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cn-text-muted) !important;
  font-weight: 900;
}

.mgr-kv .v {
  margin-top: 0.25rem;
  color: var(--cn-text-secondary) !important;
  line-height: 1.65;
}

.amount-plus { color: rgba(167, 243, 208, 0.95) !important; font-weight: 900; }
.amount-minus { color: rgba(252, 165, 165, 0.95) !important; font-weight: 900; }

/* Subtle interactive motion */
.el-button {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.el-button:hover {
  transform: translateY(-1px);
}

.el-button--primary:hover {
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.08), 0 16px 32px rgba(0,0,0,0.28);
}

/* Bootstrap icon spacing helper (avoid needing bootstrap CSS) */
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }

/* 响应式适配 */
@media (max-width: 1100px) {
  .mgr-grid { grid-template-columns: 1fr; }
  .mgr-search { width: 220px; }
  .mgr-filters { grid-template-columns: 1fr 160px 120px; }
}

@media (max-width: 860px) {
  .mgr-shell { grid-template-columns: 1fr; }
  .mgr-aside { position: relative; height: auto; }
  .mgr-search { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mgr-main::before {
    animation: none !important;
    opacity: 1 !important;
  }
  .mgr-card,
  .el-button,
  .mgr-theme {
    transition: none !important;
  }
  .mgr-card:hover,
  .el-button:hover {
    transform: none !important;
  }
}