/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background: #f0f2f5;
  overflow-x: hidden;
  width: 100%;
}

a { color: #1677ff; text-decoration: none; }

/* ========== Container ========== */
.container { display: flex; flex-direction: column; min-height: 100vh; }

/* ========== 品牌区（云计算学习主题） ========== */
.brand-section {
  background: linear-gradient(135deg, #0d1b3e 0%, #1677ff 50%, #0958d9 100%);
  padding: 32px 20px 28px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.brand-section::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -200px; right: -150px;
}
.brand-section::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -100px; left: -80px;
}

.brand-content { position: relative; z-index: 1; }

.logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.logo-icon { font-size: 32px; }
.logo-text { font-size: 22px; font-weight: 700; letter-spacing: 1px; }

.brand-content h1 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.brand-desc { font-size: 13px; opacity: 0.85; line-height: 1.6; margin-bottom: 16px; }

.brand-features {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
}
.brand-features .feature {
  font-size: 12px; opacity: 0.8;
  display: flex; align-items: center; gap: 4px;
}
.brand-features .feature span { font-size: 16px; }

/* ========== 表单区 ========== */
.form-section {
  flex: 1;
  background: #fff;
  padding: 20px 16px 24px;
  display: flex;
  justify-content: center;
}

.form-wrapper { width: 100%; max-width: 380px; }

/* ========== Tabs ========== */
.tabs { display: flex; border-bottom: 1px solid #e8e8e8; margin-bottom: 20px; }
.tab {
  flex: 1; padding: 10px 0; border: none; background: none;
  font-size: 14px; color: #999; cursor: pointer; position: relative;
}
.tab.active { color: #1677ff; font-weight: 600; }
.tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 50%;
  transform: translateX(-50%); width: 60%; height: 2px;
  background: #1677ff; border-radius: 1px;
}

/* ========== 登录模式切换 ========== */
.login-modes { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid #e8e8e8; border-radius: 8px; overflow: hidden; }
.mode-btn {
  flex: 1; padding: 8px 0; border: none; background: #fff;
  font-size: 13px; color: #666; cursor: pointer; transition: all 0.2s;
}
.mode-btn.active { background: #1677ff; color: #fff; }

/* 子模式（密码/验证码） */
.login-sub-modes { display: flex; gap: 0; margin-bottom: 14px; }
.sub-mode-btn {
  padding: 4px 0; margin-right: 16px; border: none; background: none;
  font-size: 13px; color: #999; cursor: pointer; position: relative;
}
.sub-mode-btn.active { color: #1677ff; font-weight: 500; }
.sub-mode-btn.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 100%; height: 2px; background: #1677ff; border-radius: 1px;
}

/* ========== 表单元素 ========== */
.auth-form { display: none; }
.auth-form.active { display: block; }
.hidden { display: none !important; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #333; margin-bottom: 6px; font-weight: 500; }

.form-group input[type="tel"],
.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 16px; color: #333; background: #fff;
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,0.1); }
.form-group input.error { border-color: #ff4d4f; }
.error-msg { display: block; font-size: 12px; color: #ff4d4f; margin-top: 4px; min-height: 18px; }

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; height: 44px; }
.send-code-btn {
  flex-shrink: 0; height: 44px; padding: 0 12px;
  border: 1px solid #1677ff; border-radius: 6px;
  background: #fff; color: #1677ff; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.send-code-btn:disabled { border-color: #d9d9d9; color: #999; background: #f5f5f5; cursor: not-allowed; }

/* ========== 提交按钮 ========== */
.submit-btn {
  width: 100%; height: 48px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
  color: #fff; font-size: 16px; font-weight: 500;
  cursor: pointer; margin-top: 8px;
}
.submit-btn:active { opacity: 0.85; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.switch-text { text-align: center; margin-top: 14px; font-size: 13px; color: #999; }

/* ========== Toast ========== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 8px; font-size: 14px;
  z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 85%; text-align: center;
}
.toast.success { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; }
.toast.error { background: #fff2f0; border: 1px solid #ffccc7; color: #ff4d4f; }
.toast.info { background: #e6f4ff; border: 1px solid #91caff; color: #1677ff; }
.toast.hidden { display: none; }

/* ========== 验证码弹窗 ========== */
.code-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.code-modal {
  background: #fff; border-radius: 16px; padding: 28px 20px;
  text-align: center; max-width: 340px; width: 88%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.code-modal-title { font-size: 18px; font-weight: 600; color: #1a1a1a; margin-bottom: 4px; }
.code-modal-desc { font-size: 11px; color: #bbb; margin-bottom: 20px; }
.code-modal-code {
  font-size: 40px; font-weight: 700; letter-spacing: 6px;
  color: #1677ff; font-family: 'Courier New', monospace;
  background: #f0f5ff; padding: 12px 16px;
  border-radius: 12px; margin-bottom: 8px; user-select: all;
}
.code-modal-hint { font-size: 12px; color: #999; margin-bottom: 20px; }
.code-modal-close {
  padding: 10px 32px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #1677ff, #0958d9);
  color: #fff; font-size: 15px; cursor: pointer;
}

/* ========== 平板及以上 ========== */
@media (min-width: 860px) {
  .container { flex-direction: row; }

  .brand-section {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 40px;
  }
  .brand-section::before { width: 600px; height: 600px; top: -200px; right: -200px; }
  .brand-section::after { width: 400px; height: 400px; bottom: -100px; left: -100px; }
  .brand-content h1 { font-size: 32px; }
  .brand-desc { font-size: 15px; line-height: 1.8; }
  .brand-features { gap: 28px; }
  .brand-features .feature { font-size: 14px; }
  .logo { margin-bottom: 28px; }
  .logo-icon { font-size: 38px; }
  .logo-text { font-size: 26px; }

  .form-section { width: 460px; min-width: 460px; padding: 40px; }
  .form-group input { height: 40px; font-size: 14px; }
  .submit-btn { height: 44px; }
  .send-code-btn { height: 40px; }
  .code-row input { height: 40px; }
}
