<!--登录页面-->
<view class="login-container">
  <!-- 背景装饰 -->
  <view class="bg-decoration">
    <view class="bg-circle bg-circle-1"></view>
    <view class="bg-circle bg-circle-2"></view>
    <view class="bg-circle bg-circle-3"></view>
  </view>

  <!-- 顶部Logo区域 -->
  <view class="logo-section">
    <image class="logo" src="/images/logo.png" mode="aspectFit"></image>
    <text class="app-name">智慧养殖管理</text>
    <text class="app-desc">专业的畜牧养殖管理平台</text>
  </view>

  <!-- 登录区域 -->
  <view class="login-section">
    <view class="login-card">
      <view class="card-header">
        <text class="welcome-title">欢迎使用</text>
        <text class="welcome-desc">请登录您的账号开始使用</text>
      </view>

      <view class="login-methods">
        <!-- 微信登录按钮 -->
        <button 
          class="login-btn wx-login-btn"
          open-type="getUserProfile"
          bindgetuserprofile="onGetUserInfo"
          loading="{{loading}}"
          disabled="{{loading}}"
        >
          <image class="btn-icon" src="/images/icons/wechat.png" mode="aspectFit"></image>
          <text class="btn-text">{{loading ? '登录中...' : '微信快速登录'}}</text>
        </button>

        <!-- 兼容旧版本的登录方式 -->
        <button 
          wx:if="{{!canIUse}}"
          class="login-btn wx-login-btn"
          open-type="getUserInfo"
          bindgetuserinfo="onGetUserInfo"
          loading="{{loading}}"
          disabled="{{loading}}"
        >
          <image class="btn-icon" src="/images/icons/wechat.png" mode="aspectFit"></image>
          <text class="btn-text">{{loading ? '登录中...' : '微信快速登录'}}</text>
        </button>

        <!-- 游客模式 -->
        <view class="guest-login">
          <text class="guest-text">暂不登录，</text>
          <text class="guest-link" bindtap="onSkipLogin">以游客身份浏览</text>
        </view>
      </view>
    </view>
  </view>

  <!-- 底部协议 -->
  <view class="agreement-section">
    <text class="agreement-text">登录即表示同意</text>
    <text class="agreement-link" bindtap="onUserAgreement">《用户协议》</text>
    <text class="agreement-text">和</text>
    <text class="agreement-link" bindtap="onPrivacyPolicy">《隐私政策》</text>
  </view>

  <!-- 功能特色展示 -->
  <view class="features-section">
    <view class="feature-item">
      <image class="feature-icon" src="/images/icons/farm.png" mode="aspectFit"></image>
      <text class="feature-text">养殖场管理</text>
    </view>
    <view class="feature-item">
      <image class="feature-icon" src="/images/icons/animal.png" mode="aspectFit"></image>
      <text class="feature-text">动物档案</text>
    </view>
    <view class="feature-item">
      <image class="feature-icon" src="/images/icons/health.png" mode="aspectFit"></image>
      <text class="feature-text">健康监控</text>
    </view>
    <view class="feature-item">
      <image class="feature-icon" src="/images/icons/chart.png" mode="aspectFit"></image>
      <text class="feature-text">数据统计</text>
    </view>
  </view>
</view>