:root {
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(12px);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
  --primary-color: #3B82F6;
  --text-dark: #1E293B;
  --text-light: #64748B;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --bg-gradient: linear-gradient(135deg, #E2E8F0 0%, #F1F5F9 100%);
}

body {
  background: var(--bg-gradient) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-dark);
}

/* Global Container Override */
.template, .el-container, .home-main {
  background: transparent !important;
}

.home-main {
  padding: 24px !important;
}

/* Glass Card Utility */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.12);
}

/* Main Layout Grid */
.main-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
}

/* User Info Section (Welcome Card) */
.user-info-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 40px;
  min-height: 120px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(240,249,255,0.85) 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
}

.welcome-illustration {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 400px;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200'%3E%3Cdefs%3E%3ClinearGradient id='grad1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%23e0f2fe;stop-opacity:0.3' /%3E%3Cstop offset='100%25' style='stop-color:%23bae6fd;stop-opacity:0.1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M200,150 Q250,50 350,120 T400,100 V200 H0 V180 Q100,220 200,150' fill='url(%23grad1)' /%3E%3Ccircle cx='320' cy='60' r='40' fill='%23bae6fd' opacity='0.2' /%3E%3Ccircle cx='50' cy='40' r='20' fill='%23e0f2fe' opacity='0.4' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
}

.welcome-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 1;
  flex: 1;
}

.welcome-sub-row {
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-quote {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  font-weight: 400;
  line-height: 1.5;
}

.quick-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.badge-item:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.welcome-right {
  display: flex;
  align-items: stretch;
  gap: 0; /* 使用 v-divider 控制间距 */
  position: relative;
  z-index: 1;
  padding-right: 20px;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 16px 24px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.asset-item {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 120px;
}

.asset-item:first-child {
  padding-left: 0;
}

.asset-item:last-child {
  padding-right: 0;
}

.asset-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.asset-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.2;
  font-feature-settings: "tnum";
}

.asset-val small {
  font-size: 14px;
  font-weight: 600;
  margin-right: 4px;
  color: #64748b;
}

.asset-sub {
  font-size: 12px;
  color: #94a3b8;
}

.v-divider {
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.06), transparent);
  margin: 0;
}

.cert-item {
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.cert-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.cert-status-pill.active {
  background: #ecfdf5;
  color: #10b981;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 140px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.stat-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 48px;
  height: 48px;
  opacity: 0.1;
}

/* Product List */
.products-section {
  padding: 24px;
  min-height: 300px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Table Overrides */
.el-table {
  background: transparent !important;
}
.el-table tr, .el-table th, .el-table td {
  background: transparent !important;
}
.el-table::before {
  display: none;
}
.el-table th.is-leaf {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.el-table td {
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* Bottom Grid (Referral, etc) */
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

.bottom-card {
  padding: 24px 24px 32px;
  height: 100%;
}

@media (max-width: 768px) {
  .home-main {
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom)) !important;
  }

  .main-content-grid {
    gap: 14px;
  }

  .glass-card:hover {
    transform: none;
  }

  .user-info-section {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    min-height: unset;
  }

  .welcome-illustration {
    display: none;
  }

  .welcome-left {
    gap: 10px;
  }

  .welcome-text h3 {
    font-size: 18px;
    line-height: 1.2;
    margin: 0;
  }

  .welcome-sub-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .quick-badges {
    gap: 8px;
  }

  .badge-item {
    padding: 6px 10px;
    border-radius: 10px;
  }

  .welcome-right {
    padding: 12px;
    border-radius: 14px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .asset-item {
    padding: 0;
    min-width: unset;
    flex: 1;
  }

  .asset-val {
    font-size: 20px;
  }

  .v-divider {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-card {
    height: auto;
    min-height: 112px;
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .products-section {
    padding: 16px;
  }

  .home-main .el-button--mini,
  .home-main .el-button--small {
    font-size: 12px !important;
    padding: 6px 10px !important;
    height: 30px !important;
  }

  .home-main .el-button--mini.is-round {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .home-main .el-button--small {
    padding: 7px 12px !important;
    height: 32px !important;
  }

  .home-main .el-button [class^="el-icon-"] {
    margin-right: 4px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .section-title {
    font-size: 16px;
  }

  .el-table__header-wrapper,
  .el-table__body-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .bottom-card {
    padding: 16px;
    height: auto;
  }
}

/* Button Overrides */
.el-button--primary {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  transition: all 0.2s ease;
}

.el-button--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Sidebar Glass Effect (Try to target if possible) */
.aside-menu, .el-aside {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.3) !important;
}
