/* ============================================================
 * 红羊羊思政信息化平台 - 登录页样式
 * ============================================================ */
:root {
  --red-900: #450a0a;
  --red-800: #7f1d1d;
  --red-700: #991b1b;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --gold: #fbbf24;
  --cream: #fdf6ec;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(130deg, #450a0a, #7f1d1d 35%, #b91c1c 70%, #dc2626);
  background-size: 180% 180%;
  animation: bgFlow 16s ease-in-out infinite alternate;
  overflow: hidden;
  position: relative;
}

@keyframes bgFlow {
  0%   { background-position: 0% 30%; }
  100% { background-position: 100% 70%; }
}

/* ---------- 背景装饰 ---------- */
.bg-decor { position: absolute; inset: 0; pointer-events: none; }

.bg-char {
  position: absolute;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.045);
  user-select: none;
}
.bg-char.c1 { font-size: 24vw; top: -6vw;  left: -3vw; }
.bg-char.c2 { font-size: 17vw; bottom: -5vw; right: 6vw; }
.bg-char.c3 { font-size: 12vw; top: 8vw;   right: 24vw; color: rgba(255,255,255,0.035); }

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(255,255,255,.04));
  filter: blur(1px);
  bottom: -180px;
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  8%   { opacity: 1; }
  100% { transform: translateY(-110vh) translateX(40px) scale(1.15); opacity: 0; }
}
.bubble.b1 { width: 90px;  height: 90px;  left: 8%;  animation-duration: 17s; animation-delay: 0s; }
.bubble.b2 { width: 46px;  height: 46px;  left: 24%; animation-duration: 13s; animation-delay: 4s; }
.bubble.b3 { width: 120px; height: 120px; left: 46%; animation-duration: 21s; animation-delay: 2s; }
.bubble.b4 { width: 60px;  height: 60px;  left: 68%; animation-duration: 15s; animation-delay: 7s; }
.bubble.b5 { width: 34px;  height: 34px;  left: 82%; animation-duration: 11s; animation-delay: 1s; }
.bubble.b6 { width: 74px;  height: 74px;  left: 92%; animation-duration: 19s; animation-delay: 5s; }

/* ---------- 整体布局 ---------- */
.login-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 72px;
  padding: 40px;
}

/* ---------- 左侧品牌区 ---------- */
.brand-panel { max-width: 470px; animation: fadeUp 0.8s ease both; }

.mascot {
  width: 172px;
  display: block;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.28));
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(-1.5deg); }
}

.brand-title {
  margin-top: 8px;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 8px;
  background: linear-gradient(180deg, #ffffff 30%, #ffd8a8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}

.brand-sub {
  margin-top: 6px;
  font-size: 18px;
  letter-spacing: 7px;
  opacity: 0.92;
}

.brand-line {
  width: 76px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), #f87171);
  margin: 20px 0;
}

.brand-points { display: flex; gap: 12px; list-style: none; }

.brand-points li {
  padding: 8px 18px;
  font-size: 14px;
  letter-spacing: 2px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  transition: 0.25s;
}
.brand-points li:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.brand-desc {
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.9;
  opacity: 0.75;
}

/* ---------- 登录卡片 ---------- */
.login-card {
  width: 420px;
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 38px 40px 28px;
  color: #333;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both 0.15s;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(42px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card.shake { animation: shake 0.45s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.card-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(90deg, var(--red-600), #f59e0b);
}

.card-logo { text-align: center; margin-bottom: 18px; }

.logo-mascot {
  width: 56px;
  display: block;
  margin: 0 auto 4px;
  animation: bob 3.4s ease-in-out infinite;
}

.logo-name {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 5px;
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  margin-top: 4px;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: #9ca3af;
}

/* 身份切换 */
.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  background: #f3f4f6;
  border-radius: 14px;
  margin-bottom: 22px;
}

.role-tab {
  border: none;
  background: transparent;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #6b7280;
  cursor: pointer;
  transition: 0.25s;
}
.role-tab:hover { color: var(--red-700); }
.role-tab.active {
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

/* 输入框 */
.field { position: relative; margin-bottom: 16px; }

.field input {
  width: 100%;
  padding: 13px 44px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: #1f2937;
  background: #fafafa;
  outline: none;
  transition: 0.25s;
}
.field input:focus {
  border-color: var(--red-600);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.field .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: #9ca3af;
  transition: 0.25s;
  pointer-events: none;
}
.field input:focus ~ .icon { color: var(--red-600); }

.pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  transition: 0.2s;
}
.pwd-toggle:hover { color: var(--red-700); background: #f3f4f6; }
.pwd-toggle svg { width: 18px; height: 18px; }
.pwd-toggle .eye, .pwd-toggle .eye-off { display: none; }
.pwd-toggle .eye { display: block; }
.pwd-toggle.showing .eye { display: none; }
.pwd-toggle.showing .eye-off { display: block; }

/* 记住账号 / 忘记密码 */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 18px;
  font-size: 13.5px;
  color: #6b7280;
}

.chk { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.chk input { width: 15px; height: 15px; accent-color: var(--red-600); cursor: pointer; }

.link { color: var(--red-700); text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* 登录按钮 */
.btn-login {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 10px;
  text-indent: 10px;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.4);
  transition: 0.25s;
  position: relative;
  overflow: hidden;
}
.btn-login::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(220, 38, 38, 0.5); }
.btn-login:hover::after { left: 130%; }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.75; cursor: default; transform: none; }

.spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 提示消息 */
.login-msg {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13.5px;
  text-align: center;
  color: transparent;
}
.login-msg.error { color: var(--red-600); animation: fadeUp 0.3s ease; }
.login-msg.ok    { color: #16a34a; animation: fadeUp 0.3s ease; }

/* 错误状态表情 */
.login-msg .msg-sheep {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: -8px;
  margin-right: 6px;
  animation: sheepOops 0.7s ease;
}
@keyframes sheepOops {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-14deg); }
  55%      { transform: rotate(10deg); }
  80%      { transform: rotate(-5deg); }
}

/* 演示账号 */
.demo {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e5e7eb;
}
.demo > p {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.demo-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.demo-chips button {
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12px;
  font-family: inherit;
  color: #6b7280;
  cursor: pointer;
  transition: 0.2s;
}
.demo-chips button:hover {
  border-color: var(--red-600);
  color: var(--red-600);
  background: #fef2f2;
  transform: translateY(-1px);
}

/* 动画与响应式 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .brand-panel { display: none; }
  .login-wrap { gap: 0; }
}
@media (max-width: 480px) {
  .login-card { width: 92vw; padding: 30px 22px 22px; }
}
