<scroll-view class="page" scroll-y>
  <view class="shell">
    <view class="hero">
      <view class="hero__eyebrow">CMR Backend</view>
      <view class="hero__title">登录</view>
      <view class="hero__desc">先把小程序登录态接到 backend，再进入首页和活动页。</view>
    </view>

    <view class="panel">
      <view class="panel__title">连接配置</view>
      <view class="field">
        <view class="field__label">Backend Base URL</view>
        <input class="field__input" value="{{backendBaseUrl}}" bindinput="handleBaseUrlInput" />
      </view>
      <view class="field">
        <view class="field__label">Device Key</view>
        <input class="field__input" value="{{deviceKey}}" bindinput="handleDeviceKeyInput" />
      </view>
      <view class="field">
        <view class="field__label">开发登录 Code</view>
        <input class="field__input" value="{{loginCode}}" bindinput="handleLoginCodeInput" />
      </view>
      <view class="actions">
        <button class="btn btn--primary" bindtap="handleLoginWithDevCode">开发码登录</button>
        <button class="btn btn--secondary" bindtap="handleLoginWithWechat">wx.login 登录</button>
        <button class="btn btn--ghost" bindtap="handleClearLoginState">清空登录态</button>
      </view>
    </view>

    <view class="panel">
      <view class="panel__title">状态</view>
      <view class="status">{{statusText}}</view>
    </view>
  </view>
</scroll-view>
