/* ============================================================
 * login.css — 会员登录页独占
 * ------------------------------------------------------------
 * 2026-10-12 重构: 参照后台管理登录页(admin/src/styles/login.css)重做。
 *   原为深色单栏卡片 + 吉祥物"小奈"; 现改为浅色企业分栏 —
 *   浅中性页底 + 深海军蓝"画框"外壳 + 白底左右分栏卡片(左品牌栏/右表单)
 *   + 赭金渐变主按钮。配色字面取自后台登录页实测值。
 *   - 吉祥物"小奈"移除, login-anim.js 从页面移除(脚本首行 if(!mascot)return)。
 *   - 表单控件在本页作用域内覆盖成浅色, member.css 本体(深色)不改,
 *     其它会员页(控制台/充值/设备)仍是深色, 不受影响。
 *   - 下方 chat-* 段落是登录页 chat-widget.js 注入面板样式, 沿用旧深色, 保留。
 * 依赖: member.css 的 :root token(仅 chat 段落借用 --cyan/--nl100/--brand)。
 * ============================================================ */

/* 登录页补充 token, 仅供下方 chat 面板沿用(会员端调色板本体在 member.css)。 */
:root {
  --cyan: var(--brand);
  --nl100: #C5D1E0;
}

/* ---------- 页面: 浅中性底, 居中承载分栏卡片 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #F3F5F9 0%, #E9EDF3 58%, #E4E9F0 100%);
  /* 抬到 member.css 的 body::after 全局噪点(z-index:0 fixed)之上, 浅色页不带暗底颗粒 */
  position: relative;
  z-index: 1;
  /* 兜底前景: 防未显式着色的文字继承 body 的白色(#F5F7FA) 在浅底上不可见 */
  color: #1E2A3A;
}

/* ---------- 外层深海军蓝"画框"(四周留 24px 内衬) ---------- */
.login-shell {
  width: min(880px, 100%);
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0A1930 0%, #122A48 55%, #0E223C 100%);
  box-shadow: 0 30px 80px -30px rgba(11, 30, 61, 0.45);
}

/* ---------- 卡片本体: 白底 + 左右分栏 ----------
   注: member.css 残留旧 .login-card(max-width:400/padding/暗底border/box-shadow),
   本文件加载更晚但需显式声明同名属性才能覆盖, 故这里复位宽度与内边距。 */
.login-card {
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 520px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: none;
}

/* ---------- 左: 品牌栏 ---------- */
.login-brand {
  position: relative;
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 40px;
  color: #ffffff;
  background: linear-gradient(160deg, #0D1F38 0%, #153153 100%);
  overflow: hidden;
}
/* 两枚柔光圆点, 呼应品牌"太阳"意象, 纯装饰不可交互 */
.login-brand::before,
.login-brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-brand::before {
  width: 300px; height: 300px; right: -100px; top: -90px;
  background: radial-gradient(circle at 32% 32%, rgba(243, 160, 76, 0.20), rgba(243, 160, 76, 0) 70%);
}
.login-brand::after {
  width: 260px; height: 260px; left: -90px; bottom: -80px;
  background: radial-gradient(circle, rgba(62, 96, 152, 0.42), rgba(62, 96, 152, 0) 70%);
}
.login-brand__head,
.login-brand__body,
.login-brand__foot {
  position: relative;
  z-index: 1;
}
.login-brand__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-brand__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
/* 公司 logo 字标: 深海军蓝底上经 brightness(0) invert(1) 强制反白 */
.login-brand__logo {
  display: block;
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}
.login-brand__wordmark i {
  font-style: normal;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.18em;
}
.login-brand__title {
  margin: 40px 0 12px;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
}
.login-brand__desc {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.60);
}
.login-brand__feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-brand__feats li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.86);
}
.feat-ico {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  flex-shrink: 0;
}
.feat-ico svg { width: 16px; height: 16px; }
.feat-ico--blue { background: rgba(76, 141, 246, 0.16); color: #6BA4F8; }
.feat-ico--green { background: rgba(47, 191, 106, 0.16); color: #46CE86; }
.feat-ico--purple { background: rgba(155, 107, 240, 0.18); color: #B08BF5; }
.login-brand__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.52);
}
.login-brand__foot svg { width: 13px; height: 13px; }

/* ---------- 右: 登录表单 ---------- */
.login-main {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #ffffff;
}
.login-inner {
  width: 100%;
  max-width: 320px;
}
.login-main__title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: #1E2A3A;
}
.login-main__sub {
  margin: 0 0 24px;
  font-size: 13px;
  color: #6B7280;
}

/* ---------- 登录方式 Tab(验证码 / 密码): 浅底分段控件 ---------- */
.login-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #EEF2F7;
  border: 1px solid #E1E7EF;
  border-radius: 10px;
  margin-bottom: 20px;
}
.login-tab {
  flex: 1;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #6B7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.login-tab:hover { color: #1E2A3A; }
.login-tab.is-active {
  background: #ffffff;
  color: #0E223C;
  box-shadow: 0 1px 3px rgba(11, 30, 61, 0.12), 0 0 0 1px rgba(11, 30, 61, 0.05);
}
.login-tab-panel[hidden] { display: none; }

/* ---------- 表单控件: 登录作用域覆盖成浅色(member.css 本体不动) ---------- */
.login-form .member-form-group { margin-bottom: 16px; }
.login-form .member-form-label {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
}
.login-form .member-form-req { color: #E5484D; margin-left: 2px; }
.login-form .member-input,
.login-form .member-select {
  width: 100%;
  padding: 11px 12px;
  background: #F6F8FB;
  border: 1px solid #E6EAF0;
  border-radius: 10px;
  color: #1E2A3A;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.login-form .member-input:hover,
.login-form .member-select:hover { border-color: #D6DEE9; }
.login-form .member-input:focus,
.login-form .member-select:focus {
  outline: none;
  background: #ffffff;
  border-color: #E58522;
  box-shadow: 0 0 0 3px rgba(229, 133, 34, 0.14);
}
.login-form .member-input::placeholder { color: #9AA6B4; }
.login-form .member-input--code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.1em;
  text-align: center;
  font-size: 15px;
}
.login-form .member-form-help {
  color: #6B7280;
  font-size: 12px;
  margin-top: 6px;
}
/* 密码强度提示(找回密码页): 同特异度靠后覆盖, 浅底上取可读的红/绿/橙 */
.login-form .member-form-help--error { color: #D9534F; }
.login-form .member-form-help--ok { color: #2E9E5B; }
.login-form .member-form-help--warn { color: #B4741F; }

/* 验证码行: 输入框 + 获取按钮 */
.login-code-row { display: flex; gap: 8px; }
.login-code-row .member-input--code { flex: 1; }
.login-form #send-btn {
  min-width: 112px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid #E6EAF0;
  border-radius: 10px;
  color: #E58522;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.login-form #send-btn:hover:not(:disabled) { border-color: #E58522; background: rgba(229, 133, 34, 0.06); }
.login-form #send-btn:disabled { color: #9AA6B4; background: #F6F8FB; cursor: not-allowed; }

/* ---------- 主按钮: 赭金渐变 + 柔光投影, 字距拉开呈"登 录" ---------- */
.login-btn {
  width: 100%;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 10px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #ffffff;
  background: linear-gradient(135deg, #F3A04C, #E58522);
  box-shadow: 0 10px 22px -8px rgba(229, 133, 34, 0.55);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.login-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #F6AC5C, #EA9030);
  box-shadow: 0 12px 26px -8px rgba(229, 133, 34, 0.62);
}
.login-btn:not(:disabled):active { background: linear-gradient(135deg, #E8933A, #D97A18); }
.login-btn:disabled {
  background: #E6EAF0;
  color: #9AA6B4;
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------- 链接 ---------- */
.login-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: #6B7280;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}
.login-link:hover { color: #E58522; }
.login-link--inline {
  display: inline;
  margin: 0 0 0 2px;
  color: #E58522;
}
.login-link--inline:hover { text-decoration: underline; }

/* 注册引导行: 登录主体不变, 仅把“可注册”变得可见(默认登录在前) */
.login-register-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: #6B7280;
}

/* ---------- Dev 测试号提示块(本地/内网才显示), 退到中性背景层 ---------- */
.dev-hint {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed #D6DEE9;
  border-radius: 10px;
  background: #F6F8FB;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  color: #6B7280;
  line-height: 1.55;
}
.dev-hint__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.dev-hint__tag {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #D6DEE9;
  border-radius: 4px;
  color: #9AA6B4;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.dev-hint__title { color: #6B7280; }
.dev-hint__val { color: #374151; }
.dev-hint__fill {
  margin-top: 8px;
  padding: 4px 10px;
  border: 1px solid #E6EAF0;
  border-radius: 8px;
  background: #ffffff;
  color: #E58522;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}
.dev-hint__fill:hover { border-color: #E58522; }

/* ---------- 窄屏: 隐藏品牌栏, 表单占满 ---------- */
@media (max-width: 820px) {
  .login-page { padding: 20px 14px; }
  .login-shell { padding: 16px; }
  .login-card { min-height: 0; }
  .login-brand { display: none; }
  .login-main { flex: 1 1 100%; padding: 32px 24px; }
}

/* ============================================================
 * AI 客服弹窗 (chat-widget.js 注入) — 沿用旧深色, 与分栏卡片无关
 * ============================================================ */
.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 540px;
  max-height: calc(100vh - 40px);
  background: var(--bg-1);
  border: 1px solid var(--border, rgba(122, 140, 166, 0.18));
  border-radius: 16px;
  box-shadow:
    0 24px 64px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px color-mix(in srgb, var(--brand) 5%, transparent),
    0 0 40px -8px color-mix(in srgb, var(--cyan) 18%, transparent);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  font-family: inherit;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
  pointer-events: none;
}
.chat-panel:not([hidden]) {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.chat-panel[hidden] { display: none; }

.chat-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    linear-gradient(135deg, color-mix(in srgb, var(--cyan) 10%, transparent), color-mix(in srgb, var(--nl100) 5%, transparent));
  border-bottom: 1px solid var(--border, rgba(122, 140, 166, 0.12));
}
.chat-panel__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan, #A9C4E8), var(--nl100, #5F95AC));
  color: #061226;
  font-weight: 700;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 25%, transparent);
  flex-shrink: 0;
}
.chat-panel__title { flex: 1; min-width: 0; }
.chat-panel__name { font-size: 14px; font-weight: 600; color: var(--text-0, #F5F7FA); }
.chat-panel__status { font-size: 11px; color: var(--text-2, #7A8CA6); margin-top: 2px; }
.chat-panel__close {
  background: transparent;
  border: 0;
  color: var(--text-2, #7A8CA6);
  font-size: 22px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.chat-panel__close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-0, #F5F7FA); }

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-panel__messages::-webkit-scrollbar { width: 6px; }
.chat-panel__messages::-webkit-scrollbar-thumb { background: rgba(122, 140, 166, 0.18); border-radius: 3px; }

.chat-msg {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-msg--assistant {
  align-self: flex-start;
  background: var(--bg-2, rgba(11, 30, 61, 0.6));
  color: var(--text-0, #F5F7FA);
  border-top-left-radius: 3px;
}
.chat-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--cyan, #A9C4E8), var(--brand-deep, #5F95AC));
  color: #fff;
  border-top-right-radius: 3px;
}
.chat-msg--system {
  align-self: center;
  background: transparent;
  color: var(--text-2, #7A8CA6);
  font-size: 12px;
  padding: 6px 10px;
}
.chat-msg--typing::after {
  content: '●';
  display: inline-block;
  margin-left: 4px;
  animation: chat-typing 1s ease-in-out infinite;
  color: var(--text-2);
}
@keyframes chat-typing {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

.chat-panel__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
}
.chat-suggestion {
  background: transparent;
  border: 1px solid var(--border, rgba(122, 140, 166, 0.18));
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-1, #CBD3DE);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.chat-suggestion:hover {
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border-color: color-mix(in srgb, var(--cyan) 35%, transparent);
  color: var(--brand-hover, #C5D1E0);
}

.chat-panel__input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border, rgba(122, 140, 166, 0.12));
  background: rgba(0, 0, 0, 0.15);
}
.chat-panel__input textarea {
  flex: 1;
  resize: none;
  background: var(--bg-2, rgba(11, 30, 61, 0.5));
  border: 1px solid var(--border, rgba(122, 140, 166, 0.18));
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-0, #F5F7FA);
  font-family: inherit;
  outline: none;
  max-height: 120px;
  min-height: 36px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-panel__input textarea:focus {
  border-color: color-mix(in srgb, var(--cyan) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 12%, transparent);
}
.chat-panel__input button {
  background: linear-gradient(135deg, var(--cyan, #A9C4E8), var(--brand-deep, #5F95AC));
  border: 0;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  align-self: flex-end;
  height: 36px;
  transition: all 0.15s ease;
}
.chat-panel__input button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--cyan) 50%, transparent);
}
.chat-panel__input button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .chat-panel {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: none;
  }
}
