/* ========== 登录/注册页样式（login.html） ========== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,230,230,.6) 0%, transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(255,200,200,.5) 0%, transparent 50%),
    linear-gradient(160deg, #fff5f4 0%, #ffe3e1 100%);
  color: #333;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  font-size: 14px;
}

.page {
  width: 100%;
  max-width: 400px;
}

/* LOGO 标题 */
.brand {
  text-align: center;
  margin-bottom: 26px;
}
.brand .logo {
  display: inline-flex;
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff4d4f, #d0021b);
  color: #fff;
  align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 20px rgba(208,2,27,.28);
  margin-bottom: 14px;
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #222;
}
.brand p {
  margin: 4px 0 0;
  color: #999;
  font-size: 12px;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
  overflow: hidden;
}

/* Tab 切换 */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
}
.auth-tab {
  flex: 1; text-align: center;
  padding: 14px 0 12px;
  font-size: 15px; color: #666; cursor: pointer;
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
  font-weight: 500;
}
.auth-tab.active {
  color: #d0021b; font-weight: 600;
  border-bottom-color: #d0021b;
}

/* 表单 */
.form-wrap { padding: 22px 22px 26px; }
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }

.row { margin-bottom: 14px; }
.row label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}
.row input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fafafa;
  transition: border-color .15s, background .15s;
}
.row input:focus {
  border-color: #d0021b;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(208,2,27,.06);
}
.row input::placeholder { color: #bbb; }

/* 验证码行 */
.captcha-row {
  display: flex; gap: 8px; align-items: stretch;
}
.captcha-row input {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fafafa;
  letter-spacing: 2px;
}
.captcha-row input:focus {
  border-color: #d0021b; background: #fff;
  box-shadow: 0 0 0 3px rgba(208,2,27,.06);
}
.captcha-img {
  flex: 0 0 118px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background: #f5f5f5;
  cursor: pointer;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
  font-size: 12px; color: #999;
  transition: border-color .15s;
}
.captcha-img:hover { border-color: #d0021b; }
.captcha-img img { width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; }

/* 按钮 */
.submit-btn {
  width: 100%;
  padding: 13px 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff4d4f, #d0021b);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(208,2,27,.25);
  transition: transform .1s;
}
.submit-btn:active { transform: scale(.99); }
.submit-btn:disabled {
  background: #ccc; box-shadow: none; cursor: not-allowed;
}

/* 底部提示 */
.foot-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: #bbb;
  line-height: 1.8;
}
.foot-hint b { color: #d0021b; font-weight: 500; }

.link-back {
  text-align: center;
  margin-top: 14px;
}
.link-back a {
  color: #999;
  font-size: 12px;
  text-decoration: none;
}
.link-back a:active { color: #d0021b; }

/* Toast */
.toast {
  position: fixed;
  top: 40px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.8);
  color: #fff;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 9999;
  display: none;
  max-width: 85%;
  text-align: center;
}
.toast.show { display: block; animation: t-in .2s; }


/* ========== 移动端优化 ========== */
/* 小屏手机 (≤375px) */
@media (max-width: 375px) {
  .page { padding: 20px 16px; }
  .logo { width: 60px; height: 60px; font-size: 28px; }
  .brand h1 { font-size: 19px; }
  .brand p { font-size: 12px; }
  .card { padding: 16px 14px; }
  .auth-tab { padding: 12px 0; font-size: 14px; }
  .row label { font-size: 13px; }
  .row input { font-size: 15px; padding: 10px 8px; }
  .captcha-row input { font-size: 15px; }
  .captcha-img { width: 90px; height: 38px; }
  .submit-btn { font-size: 15px; padding: 11px; }
  .foot-hint { font-size: 12px; }
}

/* 大屏手机 (376px-414px) */
@media (max-width: 414px) {
  .page { padding: 24px 20px; }
  .card { padding: 18px 16px; }
  .row input { font-size: 16px; }
  .captcha-row input { font-size: 16px; }
}

/* 平板/桌面 (768px+) - 限制内容宽度居中 */
@media (min-width: 768px) {
  .page { max-width: 400px; margin: 0 auto; }
  body { background: linear-gradient(180deg, #d0021b 0%, #d0021b 40%, #efefef 40%); min-height: 100vh; }
  .brand { margin-bottom: 20px; }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
  .page { padding: 12px 20px; }
  .logo { width: 48px; height: 48px; font-size: 22px; margin-bottom: 6px; }
  .brand h1 { font-size: 18px; margin-bottom: 2px; }
  .brand p { font-size: 12px; margin-bottom: 12px; }
  .card { padding: 14px; }
  .auth-tabs { margin-bottom: 12px; }
  .auth-tab { padding: 8px 0; }
  .row { margin-bottom: 10px; }
}
@keyframes t-in { from { opacity: 0; transform: translate(-50%, -10px);} to { opacity: 1; transform: translate(-50%, 0);} }
