/*会员中心样式*/
.member-center-container {
    display: flex;
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.left-section {
    flex: 0 0 280px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* 增加轻微阴影提升层次感 */
    transition: box-shadow 0.3s ease;
}

.left-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 悬停时增强阴影 */
}

.right-section {
    flex: 1;
    padding: 25px; /* 增加内边距提升呼吸感 */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#view-info {
    line-height: 2; /* 增加行高提升可读性 */
    margin-bottom: 20px;
    color: #555; /* 调整文字颜色增强可读性 */
}

#edit-info-form {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

#edit-info-form input {
    width: 100%;
    padding: 10px 12px; /* 增加输入框内边距 */
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#edit-info-form input:focus {
    border-color: #4CAF50; /* 聚焦时边框变色 */
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2); /* 聚焦光晕效果 */
    outline: none;
}

#edit-info-form button {
    margin-right: 10px;
    padding: 9px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#edit-info-form button[type="submit"] {
    background-color: #4CAF50;
    color: white;
    border: none;
}

#edit-info-form button[type="submit"]:hover {
    background-color: #45a049;
    transform: translateY(-1px); /* 轻微上浮效果 */
}

#edit-info-form button[type="button"] {
    background-color: #f1f1f1;
    color: #666;
    border: none;
}

#edit-info-form button[type="button"]:hover {
    background-color: #e5e5e5;
}

/* 头像容器样式优化 */
.avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0 30px; /* 增加底部间距 */
}

#avatar-preview {
  width: 130px; /* 略微增大头像 */
  height: 130px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  border: 2px solid #eee;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

#avatar-preview:hover {
  transform: scale(1.03); /* 悬停放大效果 */
  border-color: #4CAF50;
}

.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0,0,0,0.5);
  color: white;
  text-align: center;
  padding: 6px 0; /* 增加 padding 提升可读性 */
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0 0 50% 50%;
}

#save-avatar-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 12px; /* 调整间距 */
}

#save-avatar-btn:hover:not(:disabled) {
  background-color: #45a049;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 操作结果提示样式增强 */
#operation-result {
  text-align: center;
  margin: 15px 0;
  padding: 10px 15px;
  border-radius: 4px;
  display: none;
  transition: opacity 0.3s ease;
}

#operation-result.text-green-600 {
  background-color: #dff0d8;
  color: #3c763d;
  border: 1px solid #d6e9c6;
}

#operation-result.text-red-600 {
  background-color: #f2dede;
  color: #a94442;
  border: 1px solid #ebccd1;
}

/* 欢迎语样式 */
.welcome-message {
  display: inline;
  margin: 0 5px;
  font-weight: bold;
  color: #333;
}

#username-level {
  text-align: center;
  margin: 10px 0 20px;
  color: #666;
}

/* 会员中心收藏产品样式优化 */
.favorites-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px; /* 增大间距 */
  margin-top: 20px;
}

.favorite-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
}

.favorite-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.favorite-item img {
  width: 100%;
  height: 130px; /* 增大图片高度 */
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
}

.favorite-item a {
  color: #333;
  text-decoration: none;
  display: block;
  line-height: 1.5;
  margin-bottom: 8px;
}

.favorite-item.operate {
  margin-top: 10px;
}

.favorite-item.operate a {
  color: #f44336;
  display: inline-block;
  transition: color 0.3s ease;
}

.favorite-item.operate a:hover {
  color: #d32f2f;
  text-decoration: underline;
}

/* 直属会员列表样式优化 */
.direct-members-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

/* 响应式调整：中等屏幕显示2列 */
@media (max-width: 992px) {
  .direct-members-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.direct-member-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 18px;
  background-color: #fafafa;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.direct-member-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}

.direct-member-item p {
  margin: 8px 0;
  color: #555;
}

.direct-member-item.operate {
  margin-top: 15px;
  text-align: right;
}

.direct-member-item.operate a {
  color: #007bff;
  text-decoration: none;
  margin-left: 15px;
  transition: color 0.3s ease;
}

.direct-member-item.operate a:hover {
  text-decoration: underline;
  color: #0056b3;
}

/* 直属会员项样式优化 */
.direct-member-item {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.direct-member-item p {
    margin: 5px 0;
    line-height: 1.6;
}

.direct-member-item.p {
    color: #666;
}


/* 左侧个人信息样式调整 */
.member-info-left {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}



/* 邀请链接容器调整 */
.invite-link-container {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

#invite-link {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

#invite-link:focus {
    border-color: #4CAF50;
    outline: none;
}

.invite-link-container button {
    padding: 0 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.invite-link-container button:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

/* 加载状态样式优化 */
.loading {
    text-align: center;
    padding: 30px 0;
    color: #666;
    position: relative;
}

.loading::after {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #4CAF50;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: 20px;
    margin-left: -10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



@media (max-width: 768px) {
    .member-center-container {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    .left-section, .right-section {
        flex: none;
        width: 100%;
        padding: 15px;
    }
    
    /* 移动端调整网格布局 */
    .direct-members-list, .favorites-list {
        grid-template-columns: 1fr;
    }
    
    .invite-link-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .invite-link-container button {
        width: 100%;
        padding: 10px;
    }
}

/* 小屏设备额外适配 */
@media (max-width: 480px) {
    #avatar-preview {
        width: 110px;
        height: 110px;
    }
    
    .left-section, .right-section {
        padding: 12px;
    }
    
    .direct-member-item, .favorite-item {
        padding: 10px;
    }
}