/* 账户概览页面样式 */

/* 用户头部 */
.customer-header {
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.avatar-container {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.customer-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
}

.avatar-placeholder i {
  font-size: 36px;
  color: var(--primary-color);
}

.customer-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.customer-header h5 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0;
}

.customer-header small {
  color: var(--text-secondary);
}

/* 会员信息卡片 */
.member-info-card {
  background: linear-gradient(135deg, #fff7ed 0%, #fff1e6 100%);
  border: 1px solid #ffecd2;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.level-badge-wrapper .level-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
}

.level-points {
  text-align: center;
}

.level-points small {
  font-size: 11px;
  color: var(--text-tertiary);
}

.points-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--warning-color);
}

/* 核心数据统计网格 */
.core-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  color: white;
}

.stat-icon-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.stat-icon-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 订单状态统计 */
.order-stats-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.order-stats-section .stat-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  transition: all 0.3s ease;
}

.order-stats-section .stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
}

.order-stats-section .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.order-stats-section .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 财务概况 */
.finance-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.finance-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.finance-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.finance-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.finance-value.text-primary {
  color: var(--primary-color);
}

/* 待办事项提醒 */
.todo-reminders {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-primary);
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item i {
  font-size: 16px;
  flex-shrink: 0;
}

.todo-item strong {
  color: var(--primary-color);
  margin: 0 2px;
}

.todo-item .btn-link {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 12px;
}

/* 优惠券列表 */
.coupons-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.coupons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coupon-item {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.coupon-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
}

.coupon-item.coupon-expiring-soon {
  border-color: #ffc107;
  background: linear-gradient(to right, #fff9e6, var(--bg-primary));
}

.coupon-left {
  flex: 0 0 90px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  color: white;
  text-align: center;
}

.coupon-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.coupon-currency {
  font-size: 14px;
  font-weight: 500;
}

.coupon-unit {
  font-size: 12px;
  font-weight: 500;
}

.coupon-free-shipping {
  font-size: 14px;
  font-weight: 600;
}

.coupon-condition {
  font-size: 11px;
  opacity: 0.9;
}

.coupon-right {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.coupon-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.coupon-expire {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.coupon-expire i {
  font-size: 12px;
}

/* 赊销订单管理 */
.credit-order-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.credit-order-stats {
  margin-bottom: 12px;
}

.credit-stat-card {
  background: linear-gradient(135deg, #fff7ed, #fff1e6);
  border: 1px solid #ffecd2;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.credit-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
}

.credit-stat-info {
  flex: 1;
}

.credit-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.credit-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--warning-color);
}

.credit-stat-value.text-warning {
  color: #f59e0b;
}

.credit-order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credit-order-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.3s ease;
}

.credit-order-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
}

.credit-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.credit-order-no {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.credit-order-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.credit-order-status.status-0 {
  background: #fff7ed;
  color: #f59e0b;
}

.credit-order-status.status-1,
.credit-order-status.status-2 {
  background: #eff6ff;
  color: #3b82f6;
}

.credit-order-status.status-3 {
  background: #fef3c7;
  color: #f59e0b;
}

.credit-order-status.status-4 {
  background: #dcfce7;
  color: #22c55e;
}

.credit-order-status.status-5 {
  background: #f3f4f6;
  color: #6b7280;
}

.credit-order-status.status-overdue {
  background: #fef2f2;
  color: #ef4444;
}

.credit-order-body {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.credit-order-amount,
.credit-order-remain {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.credit-order-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.credit-order-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.credit-order-remain.text-danger .credit-order-value {
  color: #ef4444;
}

.credit-order-footer {
  padding: 12px 16px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.credit-order-due {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.credit-order-due i {
  font-size: 12px;
}

.credit-order-due.text-danger {
  color: #ef4444;
}

/* 快捷入口 */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.quick-action-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
  background: var(--bg-primary);
}

.quick-action-item i {
  font-size: 22px;
  color: var(--primary-color);
}

.quick-action-item span {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.quick-action-item .badge {
  margin-left: 4px;
  font-size: 10px;
  padding: 1px 6px;
  min-width: 16px;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .core-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-card {
    padding: 12px 8px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

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

  .finance-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .core-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 10px 6px;
    gap: 8px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

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

  .stat-label {
    font-size: 11px;
  }

  .order-stats-section .stat-value {
    font-size: 18px;
  }

  .finance-value {
    font-size: 18px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .quick-action-item {
    padding: 12px 6px;
  }

  .quick-action-item i {
    font-size: 18px;
  }

  .quick-action-item span {
    font-size: 11px;
  }
}

/* 暗色主题适配 */
[data-theme="dark"] .member-info-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-color: var(--border-color);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .order-stats-section .stat-item,
[data-theme="dark"] .finance-item {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .order-stats-section .stat-item:hover,
[data-theme="dark"] .quick-action-item:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
}

[data-theme="dark"] .todo-item {
  background: var(--bg-primary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .coupon-item {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .coupon-item.coupon-expiring-soon {
  background: linear-gradient(to right, #1a1a1a, var(--bg-primary));
  border-color: #ffc107;
}

[data-theme="dark"] .coupon-name {
  color: var(--text-primary);
}

[data-theme="dark"] .credit-stat-card {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border-color: var(--border-color);
}

[data-theme="dark"] .credit-order-item {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .credit-order-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .credit-order-footer {
  background: var(--bg-secondary);
}

[data-theme="dark"] .credit-order-no {
  color: var(--text-primary);
}

[data-theme="dark"] .credit-order-value {
  color: var(--text-primary);
}

[data-theme="dark"] .credit-order-status.status-0 {
  background: #1a1a1a;
  color: #f59e0b;
}

[data-theme="dark"] .credit-order-status.status-1,
[data-theme="dark"] .credit-order-status.status-2 {
  background: #1a1a1a;
  color: #3b82f6;
}

[data-theme="dark"] .credit-order-status.status-3 {
  background: #1a1a1a;
  color: #f59e0b;
}

[data-theme="dark"] .credit-order-status.status-4 {
  background: #1a1a1a;
  color: #22c55e;
}

[data-theme="dark"] .credit-order-status.status-5 {
  background: #1a1a1a;
  color: #6b7280;
}

[data-theme="dark"] .credit-order-status.status-overdue {
  background: #1a1a1a;
  color: #ef4444;
}

[data-theme="dark"] .quick-action-item {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .quick-action-item span {
  color: var(--text-secondary);
}

[data-theme="dark"] .quick-action-item i {
  color: var(--primary-color);
}
.info-card h5,
.info-card h6 {
  color: var(--text-primary);
}

.info-card .border-bottom {
  border-bottom-color: var(--border-color);
}

.order-nav {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.order-nav-item {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  position: relative;
  font-size: 13px;
}
.order-nav-item:hover {
  color: var(--primary-color);
  background: var(--primary-light);
}
.order-nav-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
  background: var(--primary-light);
}
.order-nav-item .count {
  background: var(--gradient-primary);
  color: var(--text-white, #ffffff);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  margin-left: 4px;
  min-width: 18px;
  display: inline-block;
}
.profile-order-stat {
  cursor: pointer;
  transition: all 0.3s ease;
}
.profile-order-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.order-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}
.order-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
}
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}
.order-no {
  color: var(--text-secondary);
  font-size: 12px;
  font-family: 'Courier New', monospace;
}
.order-time {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-left: 8px;
}
.order-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.order-status.pending-pay {
  background: var(--order-pending-pay-bg);
  color: var(--order-pending-pay-text);
}
.order-status.pending-ship {
  background: var(--order-pending-ship-bg);
  color: var(--order-pending-ship-text);
}
.order-status.pending-receive {
  background: var(--order-pending-receive-bg);
  color: var(--order-pending-receive-text);
}
.order-status.completed {
  background: var(--order-completed-bg);
  color: var(--order-completed-text);
}
.order-status.cancelled {
  background: var(--order-cancelled-bg);
  color: var(--order-cancelled-text);
}
.order-items {
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.order-item {
  display: flex;
  gap: 10px;
  padding: 6px 0;
}
.order-item:last-child {
  padding-bottom: 0;
}
.order-item-img {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.order-item-img .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}
.order-item-img .no-image i {
  font-size: 20px;
}
.order-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.order-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-item-specs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}
.order-item-price {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
}
.order-item-qty {
  color: var(--text-secondary);
  font-size: 12px;
}
.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.order-total {
  color: var(--text-secondary);
  font-size: 13px;
}
.order-total .amount {
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 700;
  margin-left: 4px;
}
.order-actions {
  display: flex;
  gap: 6px;
}
.order-actions .btn {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
}
.order-empty {
  text-align: center;
  padding: 40px 20px;
}
.order-empty i {
  font-size: 48px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  opacity: 0.5;
}
.order-empty p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 14px;
}

/* 自定义滚动条 */
.order-items::-webkit-scrollbar {
  width: 4px;
}
.order-items::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 2px;
}
.order-items::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}
.order-items::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* 暗色主题适配 */
[data-theme="dark"] .order-nav {
  background: var(--bg-secondary);
}

[data-theme="dark"] .order-nav-item {
  color: var(--text-secondary);
}

[data-theme="dark"] .order-nav-item:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

[data-theme="dark"] .order-nav-item.active {
  background: var(--primary-light);
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

[data-theme="dark"] .order-nav-item .count {
  background: var(--gradient-primary);
  color: var(--text-white);
}

[data-theme="dark"] .order-card {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .order-card:hover {
  border-color: var(--primary-color);
}

[data-theme="dark"] .order-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .order-no {
  color: var(--text-secondary);
}

[data-theme="dark"] .order-time {
  color: var(--text-tertiary);
}

[data-theme="dark"] .order-item-img {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .order-item-img .no-image {
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}

[data-theme="dark"] .order-item-name {
  color: var(--text-primary);
}

[data-theme="dark"] .order-item-specs {
  color: var(--text-secondary);
}

[data-theme="dark"] .order-item-price {
  color: var(--primary-color);
}

[data-theme="dark"] .order-item-qty {
  color: var(--text-secondary);
}

[data-theme="dark"] .order-footer {
  border-top-color: var(--border-color);
}

[data-theme="dark"] .order-total {
  color: var(--text-secondary);
}

[data-theme="dark"] .order-total .amount {
  color: var(--primary-color);
}

[data-theme="dark"] .order-empty i {
  color: var(--text-tertiary);
}

[data-theme="dark"] .order-empty p {
  color: var(--text-secondary);
}

/* 暗色主题下的 info-card 内容 */
[data-theme="dark"] .info-card h5,
[data-theme="dark"] .info-card h6 {
  color: var(--text-primary);
}

[data-theme="dark"] .info-card .border-bottom {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .info-card .text-muted {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .info-card .stat-value {
  color: var(--text-primary);
}

[data-theme="dark"] .info-card .stat-label {
  color: var(--text-secondary);
}

[data-theme="dark"] .info-card .badge {
  color: var(--text-white) !important;
}

[data-theme="dark"] .info-card .badge.bg-secondary {
  background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .info-card .btn-outline-primary {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: var(--bg-secondary);
}

[data-theme="dark"] .info-card .btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-white);
}

[data-theme="dark"] .info-card .text-success {
  color: var(--success-color) !important;
}
