<!-- pages/edit/edit.wxml -->
<view class="xiugai-page">
  
  <!-- 头像区域（未改动） -->
  <view class="avatar-section">
  <view class="avatar-container {{isAvatarActive ? 'active' : ''}}">
    <!-- 新增：头像包装器，把头像+光晕包在一起，和提示文字隔离 -->
    <view class="avatar-image-wrapper">
      <image class="avatar-image" src="{{avatarUrl}}" mode="aspectFill"></image>
      <view class="avatar-halo"></view>
    </view>
    <view class="avatar-hint">点击更换头像</view>
  </view>
  <button 
    class="avatar-trigger-button"
    open-type="chooseAvatar"
    bindchooseavatar="onChooseAvatar"
    hover-class="none"
  ></button>
</view>
  
  <!-- 表单区域 -->
  <view class="form-section">
    <!-- UID（只读） -->
    <view class="form-item">
      <view class="item-label">UID</view>
      <view class="item-value readonly">{{uid || '••••••'}}</view>
    </view>
    
    <!-- 昵称（可编辑） -->
    <view class="form-item">
      <view class="item-label">昵称</view>
      <view class="input-container">
        <input 
          class="item-input {{nicknameError ? 'error' : ''}}" 
          type="text" 
          placeholder="请输入昵称"
          placeholder-class="placeholder"
          maxlength="20"
          value="{{nicheng}}"
          bindinput="onNicknameInput"
        />
        <view class="error-hint" wx:if="{{nicknameError}}">{{nicknameError}}</view>
      </view>
    </view>
    
    <!-- 手机号（只读展示，不可修改） -->
    <view class="form-item">
      <view class="item-label">手机号</view>
      <view class="item-value readonly">{{phone || '未绑定'}}</view>
    </view>
  </view>
  
  <!-- 保存按钮（未改动） -->
  <button 
    class="save-btn" 
    bindtap="onSave"
    hover-class="btn-hover"
    disabled="{{isSaving || !hasChanges}}"
  >
    <view class="btn-content">
      {{isSaving ? '保存中...' : '确认保存'}}
      <view class="btn-sparkle" wx:if="{{!isSaving}}"></view>
    </view>
  </button>
  
  <view class="safe-area"></view>
  <global-notification id="global-notification" />
</view>