/* =========================================
 * 气来了 Web 管理端登录页 —— 卡通钢瓶版（V4 + 调整）
 * 4 个紧挨排列的彩色钢瓶：
 *  - 高度各不相同（最矮→最高）
 *  - 胖瘦各不相同
 *  - 用 flex + 负 margin 实现身体前后重叠
 *  - 最高的紫瓶 z-index 最小（在最后面）
 *  - 紫瓶特别高：360 + 180 = 540px
 * 右侧登录上方使用上传的火焰 Logo（带轻微跳动动画）
 * ========================================= */

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

:root {
  --bg-left: #ece6f5;
  --bg-right: #f5f5f7;
  --text-primary: #1a1a1a;
  --text-secondary: #5c5c66;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --btn-primary: #1f2024;
  --error: #dc2626;

  --c-yellow: #f4d35e;
  --c-green:  #22c55e;
  --c-orange: #ff7a59;
  --c-purple: #8b5cf6;
  --c-wechat: #07c160;

  --cap-dark: #2a2a2a;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Helvetica Neue", "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  color: var(--text-primary);
  background: #ffffff;
  overflow: hidden;
}

.page {
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 600px;
}

/* ============== 左侧：钢瓶角色区 ============== */
.characters {
  flex: 1.1;
  position: relative;
  background: var(--bg-left);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottles-row {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 0 30px;
}

.bottle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  transform-origin: bottom center;
  will-change: transform;
  transition: filter 0.3s ease;
}

.bottle + .bottle {
  margin-left: -50px;
}

.bottle.purple {
  width: 110px;
  z-index: 1;
}

.bottle.purple .bottle-cap   { width: 60%; height: 14px; }
.bottle.purple .bottle-body  { width: 100%; height: 540px; }
.bottle.purple .bottle-base  { width: 55%; height: 10px; }

.bottle.green {
  width: 140px;
  z-index: 2;
}

.bottle.green .bottle-cap   { width: 65%; height: 16px; }
.bottle.green .bottle-body  { width: 100%; height: 384px; }
.bottle.green .bottle-base  { width: 60%; height: 10px; }

.bottle.yellow {
  width: 170px;
  z-index: 3;
}

.bottle.yellow .bottle-cap   { width: 70%; height: 18px; }
.bottle.yellow .bottle-body  { width: 100%; height: 240px; }
.bottle.yellow .bottle-base  { width: 70%; height: 14px; }

.bottle.orange {
  width: 210px;
  z-index: 4;
}

.bottle.orange .bottle-cap   { width: 75%; height: 20px; }
.bottle.orange .bottle-body  { width: 100%; height: 200px; }
.bottle.orange .bottle-base  { width: 75%; height: 16px; }

.bottle-cap {
  position: relative;
  background: var(--cap-dark);
  border-radius: 8px 8px 4px 4px;
  margin-bottom: -4px;
  z-index: 2;
}

.cap-handle {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 14px;
  border: 4px solid var(--cap-dark);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: transparent;
}

.bottle-body {
  position: relative;
  border-radius: 28% 28% 18% 18% / 18% 18% 14% 14%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 38px;
  box-shadow: inset -8px 0 16px rgba(0, 0, 0, 0.12),
              inset 8px 0 16px rgba(255, 255, 255, 0.2);
}

.bottle.yellow .bottle-body { background: var(--c-yellow); }
.bottle.green  .bottle-body { background: var(--c-green); }
.bottle.orange .bottle-body { background: var(--c-orange); }
.bottle.purple .bottle-body { background: var(--c-purple); }

.bottle-stripe {
  position: absolute;
  top: 18%;
  left: 12%;
  right: 12%;
  height: 18%;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  z-index: 0;
}

.bottle-face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 78%;
  height: 32px;
  margin-bottom: 8px;
  transform-origin: bottom center;
  transition: transform 0.3s ease;
  will-change: transform;
}

.eye {
  position: relative;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  overflow: hidden;
  transition: height 0.18s ease, margin-top 0.18s ease;
}

.pupil {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #111111;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out;
}

.mouth {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 5px;
  border-radius: 0 0 10px 10px;
  background: #1a1a1a;
  z-index: 2;
}

.mouth.smile {
  height: 4px;
  background: #1a1a1a;
  border-radius: 0 0 14px 14px;
}

.bottle-base {
  background: var(--cap-dark);
  border-radius: 2px;
  margin-top: -2px;
  z-index: 1;
}

.bottle.eyes-closed .eye {
  height: 3px;
  border-radius: 2px;
  margin-top: 7px;
}

.bottle.eyes-closed .pupil {
  display: none;
}

.bottle.eyes-closed .mouth {
  height: 3px;
  width: 22px;
  bottom: 18%;
}

/* ============== 右侧：表单（垂直居中） ============== */
.login-pane {
  position: relative;          /* 供 .system-title 绝对定位 */
  flex: 1;
  background: var(--bg-right);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 64px;
  overflow-y: auto;
}

.login-content {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
}

/* ====== 端名标题（固定在右半部分左上角，不参与垂直居中） ====== */
.system-title {
  position: absolute;
  top: 24px;
  left: 32px;
  z-index: 5;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #174468;
  background: rgba(23, 68, 104, 0.08);
  border-left: 3px solid #174468;
  padding: 6px 12px;
  border-radius: 2px;
  user-select: none;
  box-shadow: 0 2px 4px rgba(23, 68, 104, 0.06);
}

/* ====== 品牌 Logo（用户上传的火焰图） ====== */
.brand-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.brand-logo img {
  display: block;
  width: 144px;
  height: 144px;
  margin: -18px 0 -22px;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform-origin: 50% 72%;
  will-change: transform;
  animation: flame-jump 2.4s ease-in-out infinite;
}

/* 轻微上跳并在落地时压缩，模拟火焰跳动，避免干扰登录操作。 */
@keyframes flame-jump {
  0%, 18%, 100% {
    transform: translateY(0) scale(1);
  }
  38% {
    transform: translateY(-7px) rotate(-1deg) scaleX(0.97) scaleY(1.05);
  }
  52% {
    transform: translateY(-8px) rotate(1deg) scaleX(0.98) scaleY(1.04);
  }
  72% {
    transform: translateY(0) scaleX(1.04) scaleY(0.96);
  }
  82% {
    transform: translateY(-2px) scaleX(0.99) scaleY(1.01);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo img {
    animation: none;
  }
}

.welcome {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 32px;
  letter-spacing: 0.5px;
  text-align: center;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border-strong);
  padding: 8px 0;
  transition: border-color 0.2s;
}

.field-input-wrap:focus-within {
  border-bottom-color: var(--c-purple);
}

.field-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  height: 24px;
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  margin-left: 8px;
  transition: color 0.2s;
}

.field-toggle:hover { color: var(--text-primary); }

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-top: 4px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
}

.checkbox input { display: none; }

.checkbox-mark {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  position: relative;
  transition: all 0.15s;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkbox input:checked + .checkbox-mark {
  background: var(--c-purple);
  border-color: var(--c-purple);
}

.checkbox input:checked + .checkbox-mark::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.forgot-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
}

.forgot-link:hover { color: var(--c-purple); }

.login-btn {
  margin-top: 10px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--btn-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: opacity 0.15s, transform 0.1s;
}

.login-btn:hover:not(:disabled) { opacity: 0.92; }
.login-btn:active:not(:disabled) { transform: scale(0.99); }
.login-btn:disabled { cursor: not-allowed; opacity: 0.7; }

.btn-text { transition: opacity 0.2s; }
.btn-spinner {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}

.login-btn.loading .btn-text { opacity: 0; }
.login-btn.loading .btn-spinner { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  font-size: 12px;
  color: var(--error);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s;
}

.form-error.show {
  max-height: 96px;
  padding: 8px 12px;
  opacity: 1;
}

.wechat-btn {
  margin-top: 6px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--c-wechat);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s, transform 0.1s;
}

.wechat-btn:hover { filter: brightness(1.05); }
.wechat-btn:active { transform: scale(0.99); }

.page-footer {
  margin-top: 28px;
  display: flex;
  gap: 22px;
  font-size: 11px;
  color: var(--text-muted);
}

.page-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.page-footer a:hover { color: var(--c-purple); }

@media (max-width: 960px) {
  .characters { display: none; }
  .login-pane { padding: 40px 32px; }
}

@media (max-width: 480px) {
  .login-pane { padding: 32px 22px; }
  .welcome { font-size: 26px; }
}