/* ===== 手机端登录页专用样式 v94 升级版 ===== */
@media (max-width: 768px) {
  /* 登录页整体：渐变背景 + 装饰元素 */
  .login-page {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    background: linear-gradient(160deg, var(--primary) 0%, #818cf8 40%, var(--bg) 40%);
    position: relative;
    overflow: hidden;
  }
  .login-page::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
  }
  .login-page::after {
    content: '';
    position: absolute;
    top: 40px;
    left: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
  }

  .login-card {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 36px 24px 48px;
    padding-bottom: max(48px, env(safe-area-inset-bottom, 0px) + 24px);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.1);
    background: var(--bg-card);
    margin: 0;
    position: relative;
    z-index: 1;
    animation: slideUp 0.4s cubic-bezier(.32,.72,.38,1);
  }

  @keyframes slideUp {
    from { transform: translateY(50px); opacity: 0.5; }
    to   { transform: translateY(0);   opacity: 1; }
  }

  .login-logo {
    margin-bottom: 20px;
    animation: fadeIn 0.5s 0.15s both;
  }
  .login-logo svg {
    width: 64px !important;
    height: 64px !important;
    color: var(--primary);
  }

  .login-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.3px;
    animation: fadeIn 0.5s 0.2s both;
  }
  .login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    animation: fadeIn 0.5s 0.25s both;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* 输入框 */
  .login-form-group {
    margin-bottom: 20px;
    animation: fadeIn 0.5s both;
  }
  .login-form-group:nth-child(1) { animation-delay: 0.3s; }
  .login-form-group:nth-child(2) { animation-delay: 0.35s; }
  .login-form-group:nth-child(3) { animation-delay: 0.4s; }

  .login-form-group .label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: var(--text);
  }

  .login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    height: 54px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  }
  .login-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
    background: var(--bg-card);
  }

  .login-input-wrap .input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0 0 10px !important;
    font-size: 16px !important;
    height: 100%;
    flex: 1;
    min-width: 0;
    outline: none !important;
    color: var(--text);
  }
  .login-input-wrap .input::placeholder {
    color: var(--text-tertiary);
  }

  .login-input-icon {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
  }

  /* 密码可见切换 */
  .login-toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
  }
  .login-toggle-password:active {
    background: var(--bg-hover);
    color: var(--text);
  }

  /* 验证码区域 */
  .login-captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .login-captcha-row .input {
    flex: 1;
    height: 54px;
    font-size: 16px !important;
  }
  #mobileCaptchaImg {
    height: 54px !important;
    width: 110px !important;
    border-radius: 12px;
    object-fit: contain;
    background: var(--bg);
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  #mobileCaptchaImg:active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  }

  /* 错误提示 */
  .login-error-box {
    background: rgba(239,68,68,0.08);
    color: #ef4444;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shakeIn 0.3s ease-out;
  }
  .login-error-box::before {
    content: '⚠';
    font-size: 16px;
    flex-shrink: 0;
  }
  @keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
  }

  /* 登录按钮 */
  .login-btn {
    width: 100%;
    height: 54px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 12px;
    margin-top: 4px;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.2s;
  }
  .login-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
  }
  .login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }

  /* 退出按钮 */
  .login-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.5s 0.55s both;
  }
  .login-actions .btn-text {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s;
  }
  .login-actions .btn-text:active {
    background: var(--bg-hover);
    color: var(--text);
  }

  /* 暗色模式登录页 */
  [data-theme="dark"] .login-page {
    background: linear-gradient(160deg, #4338ca 0%, #6366f1 40%, var(--bg) 40%);
  }
  [data-theme="dark"] .login-page::before,
  [data-theme="dark"] .login-page::after {
    background: rgba(255,255,255,0.03);
  }
}