/* ============================================
   控制台首页 - 全新设计
   ============================================ */

#home .main-card.home-dashboard {
  max-width: none;
  background: transparent !important;
  padding: 0 !important;
}

#home .home-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 4px 24px;
  box-sizing: border-box;
}

#home .home-card {
  background: #fff;
  border: 1px solid var(--beautify-border, #e8ecf4);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

#home .home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

#home .home-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--beautify-text-primary, #1a2233);
  letter-spacing: -0.01em;
}

#home .home-link {
  color: var(--color-primary, #4361ee);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

#home .home-link:hover {
  opacity: 0.8;
}

#home .home-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#home .home-more:hover {
  background: rgba(var(--color-primary-rgb, 67, 97, 238), 0.1);
  color: var(--color-primary, #4361ee);
}

/* ---- 按钮 ---- */
#home .home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#home .home-btn--primary {
  background: var(--color-primary, #4361ee);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 67, 97, 238), 0.28);
}

#home .home-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--color-primary-rgb, 67, 97, 238), 0.35);
}

#home .home-btn--ghost {
  background: #fff;
  color: var(--color-primary, #4361ee);
  border: 1px solid var(--beautify-border, #e8ecf4);
}

#home .home-btn--ghost:hover {
  border-color: var(--color-primary, #4361ee);
  background: rgba(var(--color-primary-rgb, 67, 97, 238), 0.04);
}

#home .home-btn--sm {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
}

/* ---- 欢迎区 ---- */
#home .home-welcome {
  padding: 24px 28px;
  background: linear-gradient(135deg, #f8faff 0%, #ffffff 55%, #f5f8ff 100%);
}

#home .home-welcome-main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

#home .home-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary, #4361ee), #6366f1);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(var(--color-primary-rgb, 67, 97, 238), 0.3);
}

#home .home-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#home .home-user-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

#home .home-username {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--beautify-text-primary, #1a2233);
  letter-spacing: -0.02em;
}

#home .home-level {
  font-size: 13px;
  font-weight: 500;
}

#home .home-user-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#home .home-tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

#home .home-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

#home .home-badge--ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

#home .home-badge--warn,
#home .home-badge--muted {
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
}

#home .home-badge--warn:hover,
#home .home-badge--muted:hover {
  background: rgba(var(--color-primary-rgb, 67, 97, 238), 0.08);
  color: var(--color-primary, #4361ee);
}

#home .home-welcome-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(232, 236, 244, 0.8);
}

#home .home-contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#home .home-contact-label {
  font-size: 12px;
  color: #94a3b8;
}

#home .home-contact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--beautify-text-primary, #1a2233);
  word-break: break-all;
}

#home .home-contact-item .home-link {
  margin-top: 2px;
  font-size: 12px;
}

/* ---- 快捷统计 ---- */
#home .home-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

#home .home-stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 18px 16px;
  background: #fff;
  border: 1px solid var(--beautify-border, #e8ecf4);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: all 0.22s ease;
  overflow: hidden;
}

#home .home-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: rgba(var(--color-primary-rgb, 67, 97, 238), 0.2);
}

#home .home-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

#home .home-stat-card--ticket::before { background: #6366f1; }
#home .home-stat-card--order::before { background: #f59e0b; }
#home .home-stat-card--host::before { background: #10b981; }
#home .home-stat-card--due::before { background: #ef4444; }

#home .home-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 22px;
}

#home .home-stat-card--ticket .home-stat-icon {
  background-color: rgba(99, 102, 241, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='1.8'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
}

#home .home-stat-card--order .home-stat-icon {
  background-color: rgba(245, 158, 11, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='1.8'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
}

#home .home-stat-card--host .home-stat-icon {
  background-color: rgba(16, 185, 129, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='1.8'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E");
}

#home .home-stat-card--due .home-stat-icon {
  background-color: rgba(239, 68, 68, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}

#home .home-stat-body {
  flex: 1;
  min-width: 0;
}

#home .home-stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--beautify-text-primary, #1a2233);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

#home .home-stat-label {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

#home .home-stat-link {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 11px;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#home .home-stat-card:hover .home-stat-link {
  opacity: 1;
}

/* ---- 主网格 ---- */
#home .home-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

#home .home-main-left,
#home .home-main-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ---- 资产概览 ---- */
#home .home-finance {
  padding: 22px 24px;
}

#home .home-finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

#home .home-balance-card,
#home .home-credit-card {
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--beautify-border, #e8ecf4);
  background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
}

#home .home-balance-card {
  background: linear-gradient(145deg, rgba(var(--color-primary-rgb, 67, 97, 238), 0.06) 0%, #ffffff 100%);
  border-color: rgba(var(--color-primary-rgb, 67, 97, 238), 0.15);
}

#home .home-balance-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#home .home-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#home .home-balance-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--beautify-text-primary, #1a2233);
  letter-spacing: -0.02em;
}

#home .home-balance-num--sm {
  font-size: 22px;
}

#home .home-voucher-tip {
  margin-top: 12px;
  font-size: 12px;
  color: #64748b;
}

#home .home-credit-tag {
  display: inline-flex;
  height: 20px;
  padding: 0 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

#home .home-credit-tag--ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

#home .home-consume-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

#home .home-consume-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

#home .home-consume-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

#home .home-consume-dot--primary { background: var(--color-primary, #4361ee); }
#home .home-consume-dot--muted { background: #cbd5e1; }
#home .home-consume-dot--purple { background: #8b5cf6; }

#home .home-consume-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

#home .home-consume-trend--up {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

#home .home-consume-trend--down {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

#home .home-consume-value {
  color: var(--beautify-text-primary, #1a2233);
  font-size: 15px;
}

/* ---- 产品列表 ---- */
#home .home-products {
  padding: 22px 24px;
}

#home .home-table-wrap {
  border: 1px solid var(--beautify-border, #e8ecf4);
  border-radius: 12px;
  overflow: hidden;
}

#home .home-table {
  width: 100%;
  border-collapse: collapse;
}

#home .home-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid var(--beautify-border, #e8ecf4);
}

#home .home-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--beautify-text-primary, #1a2233);
  border-bottom: 1px solid #f1f5f9;
}

#home .home-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

#home .home-table tbody tr:hover {
  background: #f8fafc;
}

#home .home-table tbody tr:last-child td {
  border-bottom: none;
}

#home .home-table td.is-danger {
  color: #ef4444;
  font-weight: 500;
}

#home .home-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 56px;
  text-align: center;
}

#home .home-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: #f1f5f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.5'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E") center / 28px no-repeat;
}

#home .home-empty h4 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--beautify-text-primary, #1a2233);
}

#home .home-empty p {
  margin: 0 0 20px;
  font-size: 13px;
  color: #64748b;
  max-width: 320px;
}

/* ---- 右侧：安全 / 工单 / 公告 ---- */
#home .home-security,
#home .home-tickets,
#home .home-news {
  padding: 20px;
}

#home .home-security-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

#home .home-security-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 10px;
  border: 1px solid var(--beautify-border, #e8ecf4);
  background: #f8fafc;
  text-decoration: none;
  transition: all 0.2s ease;
}

#home .home-security-item:hover {
  border-color: rgba(var(--color-primary-rgb, 67, 97, 238), 0.25);
  background: rgba(var(--color-primary-rgb, 67, 97, 238), 0.04);
  transform: translateY(-1px);
}

#home .home-security-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-color: rgba(var(--color-primary-rgb, 67, 97, 238), 0.1);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
}

#home .home-security-icon--api {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234361ee' stroke-width='1.8'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E");
}

#home .home-security-icon--group {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234361ee' stroke-width='1.8'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
}

#home .home-security-icon--ssh {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234361ee' stroke-width='1.8'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

#home .home-security-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--beautify-text-primary, #1a2233);
  text-align: center;
}

#home .home-ticket-list,
#home .home-news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#home .home-ticket-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#home .home-ticket-item:hover {
  background: #f8fafc;
}

#home .home-ticket-status {
  flex-shrink: 0;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 24px;
  white-space: nowrap;
}

#home .home-ticket-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--beautify-text-primary, #1a2233);
  line-height: 1.4;
}

#home .home-ticket-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #94a3b8;
}

#home .home-news-item {
  padding: 12px 12px 12px 14px;
  border-left: 3px solid var(--color-primary, #4361ee);
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.15s ease;
}

#home .home-news-item:hover {
  background: rgba(var(--color-primary-rgb, 67, 97, 238), 0.06);
}

#home .home-news-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary, #4361ee);
}

#home .home-news-title {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--beautify-text-primary, #1a2233);
  line-height: 1.45;
}

#home .home-news-type {
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
}

/* ---- 微信浮标 ---- */
#home .wx-code {
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  border: 1px solid var(--beautify-border, #e8ecf4);
}

/* ---- 响应式 ---- */
@media screen and (max-width: 1280px) {
  #home .home-main-grid {
    grid-template-columns: 1fr;
  }

  #home .home-main-right {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media screen and (max-width: 992px) {
  #home .home-welcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #home .home-quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 750px) {
  #home .home-welcome {
    padding: 16px 14px;
  }

  #home .home-welcome-main {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  #home .home-user-block {
    min-width: 0;
    flex: 1;
  }

  #home .home-username {
    font-size: 16px !important;
    line-height: 1.35 !important;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  #home .home-user-top {
    flex-wrap: wrap;
    gap: 6px;
  }

  #home .home-welcome-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  #home .home-quick-stats {
    grid-template-columns: 1fr !important;
  }

  #home .home-contact-item {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  #home .home-contact-value {
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  #home .home-main-grid {
    grid-template-columns: 1fr !important;
  }

  #home .home-main-right {
    grid-template-columns: 1fr !important;
  }
}

@media screen and (max-width: 640px) {
  #home .home-welcome {
    padding: 18px 16px;
  }

  #home .home-welcome-main {
    flex-direction: column;
    align-items: flex-start;
  }

  #home .home-welcome-grid,
  #home .home-quick-stats {
    grid-template-columns: 1fr;
  }

  #home .home-finance,
  #home .home-products,
  #home .home-security,
  #home .home-tickets,
  #home .home-news {
    padding: 16px;
  }

  #home .home-balance-num {
    font-size: 24px;
  }

  #home .home-main-right {
    grid-template-columns: 1fr;
  }
}
