/* 模态框样式 */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-large {
  width: 900px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.form-group .required {
  color: #f5222d;
  margin-right: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 按钮样式 */
.btn-primary {
  padding: 10px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  padding: 10px 24px;
  background: #f5f5f5;
  color: #666;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-text.danger {
  color: #f5222d;
}

/* 详情样式 */
.order-detail-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.order-detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.order-detail-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.detail-row {
  display: flex;
  margin-bottom: 12px;
  font-size: 14px;
}

.detail-row .label {
  width: 120px;
  color: #999;
}

.detail-row .value {
  flex: 1;
  color: #333;
}

.detail-row.total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  font-weight: 500;
  font-size: 16px;
}

.detail-row.total .value {
  color: #f5222d;
  font-size: 18px;
}

/* 表格样式 */
.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.detail-table th {
  background: #fafafa;
  font-weight: 500;
  color: #666;
}

/* 用户详情样式 */
.user-detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.user-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-right: 20px;
  object-fit: cover;
}

.user-info h4 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 500;
}

.user-info p {
  margin: 0 0 8px 0;
  color: #999;
  font-size: 14px;
}

.user-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.user-stat-item {
  background: #fafafa;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.user-stat-item .stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.user-stat-item .stat-label {
  font-size: 14px;
  color: #999;
}

/* 其他样式 */
.product-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
}

.product-name {
  font-weight: 500;
  color: #333;
}

.product-subtitle {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.price {
  color: #f5222d;
  font-weight: 500;
}

.original-price {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  margin-top: 4px;
}

.low-stock {
  color: #f5222d;
  font-weight: 500;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-type {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.user-type.normal {
  background: #e6f7ff;
  color: #1890ff;
}

.user-type.enterprise {
  background: #f6ffed;
  color: #52c41a;
}

.order-no {
  font-family: monospace;
  color: #667eea;
  font-weight: 500;
}

.order-item {
  font-size: 13px;
  line-height: 1.8;
}

.user-phone {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.recent-orders {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  margin-top: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.recent-orders h4 {
  margin: 0 0 20px 0;
  font-size: 16px;
}

.rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
}

.rank-3 {
  background: linear-gradient(135deg, #CD7F32, #8B4513);
}

/* 响应式 */
@media (max-width: 768px) {
  .modal {
    width: 95%;
    max-height: 95vh;
  }

  .modal-large {
    width: 95%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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