<!-- 客户管理页面 -->
<view class="page-container">
  <!-- 顶部导航 -->
  <view class="header">
    <view class="status-bar" style="height: {{statusBarHeight}}px;"></view>
    <view class="nav-bar">
      <view class="back-btn" bindtap="onBack">
        <image src="/images/icon-back.png" class="back-icon" mode="aspectFit"></image>
        <text class="back-text">返回</text>
      </view>
    </view>
  </view>

  <!-- 内容区域 -->
  <scroll-view scroll-y class="content-scroll" style="padding-top: {{navHeight}}px;" enhanced show-scrollbar="{{false}}">
    <!-- 账户卡片 -->
    <view class="account-card">
      <view class="account-bg"></view>
      <view class="account-content">
        <view class="account-header">
          <view class="account-icon-wrap">
            <image src="/images/icon-wallet.png" class="account-icon" mode="aspectFit"></image>
          </view>
          <text class="account-title">我的账户</text>
        </view>
        
        <view class="balance-section">
          <text class="balance-label">可提现金额 (元)</text>
          <view class="balance-value">
            <text class="balance-int">{{balanceInt}}</text>
            <text class="balance-dec">.{{balanceDec}}</text>
          </view>
        </view>
        
        <view class="stats-box">
          <view class="stat-row">
            <view class="stat-left">
              <image src="/images/icon-clock.png" class="stat-icon" mode="aspectFit"></image>
              <text class="stat-label">待结算</text>
            </view>
            <text class="stat-value">¥ {{pendingAmount}}</text>
          </view>
          <view class="stat-divider"></view>
          <view class="stat-row">
            <view class="stat-left">
              <image src="/images/icon-check.png" class="stat-icon" mode="aspectFit"></image>
              <text class="stat-label">累计结算</text>
            </view>
            <text class="stat-value">¥ {{totalSettled}}</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 快捷查询 -->
    <view class="search-card">
      <view class="search-header">
        <view class="search-icon-wrap">
          <image src="/images/icon-search.png" class="search-icon" mode="aspectFit"></image>
        </view>
        <text class="search-title">快捷查询</text>
      </view>
      <view class="search-input-wrap">
        <input class="search-input" placeholder="输入ID查资料 / 手机号查订单" bindinput="onSearchInput" value="{{searchQuery}}" />
      </view>
      <button class="search-btn" bindtap="onSearch">搜索</button>
    </view>

    <!-- 统计卡片 -->
    <view class="stats-cards">
      <view class="stat-card active">
        <view class="stat-card-header">
          <text class="stat-card-title">新增客户</text>
          <view class="stat-card-icon-wrap">
            <image src="/images/icon-users.png" class="stat-card-icon" mode="aspectFit"></image>
          </view>
        </view>
        <view class="stat-card-body">
          <text class="stat-card-value">{{newCustomers}}</text>
          <view class="stat-badge success">
            <text>+5%</text>
            <image src="/images/icon-trending-up.png" class="badge-icon" mode="aspectFit"></image>
          </view>
        </view>
        <view class="stat-card-indicator"></view>
      </view>
      
      <view class="stat-card">
        <view class="stat-card-header">
          <text class="stat-card-title">推广订单</text>
          <view class="stat-card-icon-wrap inactive">
            <image src="/images/icon-order.png" class="stat-card-icon" mode="aspectFit"></image>
          </view>
        </view>
        <view class="stat-card-body">
          <text class="stat-card-value inactive">{{promotionOrders}}</text>
          <view class="stat-badge neutral">
            <text>66%转化</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 今日列表 -->
    <view class="list-card">
      <view class="list-header">
        <text class="list-title">今日列表</text>
        <view class="live-badge">
          <view class="live-dot"></view>
          <text class="live-text">实时更新</text>
        </view>
      </view>
      
      <view class="customer-list">
        <view class="customer-item" wx:for="{{customerList}}" wx:key="id" bindtap="onCustomerTap" data-id="{{item.id}}">
          <view class="customer-left">
            <text class="customer-id">{{item.id}}</text>
            <text class="customer-time">{{item.time}}</text>
          </view>
          <view class="customer-right">
            <view class="status-badge {{item.status}}">
              <text>{{item.status === 'success' ? '注册成功' : '待确认'}}</text>
            </view>
            <image src="/images/icon-chevron-right.png" class="chevron-icon" mode="aspectFit"></image>
          </view>
        </view>
      </view>
    </view>

    <view class="bottom-space"></view>
  </scroll-view>
</view>
