/* ============================================================
   B2c 登录浮层 + 连接态微件（加法层，复用 style.css 的设计 token）
   —— 不改 style.css 一字；仅新增登录/项目选择/登出/连接提示的样式。
   视觉沿用冷光琉璃：深空底 + 青 accent + 玻璃拟态 blur。
   ============================================================ */

.ai-disclosure-badge {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 25;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(95, 230, 247, 0.34);
  background: rgba(5, 16, 31, 0.72);
  color: rgba(232, 242, 255, 0.82);
  font-size: 12px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* 商用入口不展示视觉调试按钮；元素保留给渲染器初始化，避免改动视觉内核。 */
.commercial-mode #stateSwitch,
.commercial-mode #demoToggleWrap {
  display: none !important;
}

/* 全屏登录浮层：默认隐藏，JS 判无有效 token 时加 .show */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 90% at 50% 20%, rgba(12, 29, 54, 0.72) 0%, rgba(5, 11, 24, 0.9) 70%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.login-overlay.show { display: flex; }

/* 玻璃卡片 */
.login-card {
  width: min(360px, 100%);
  padding: 30px 26px 26px;
  border-radius: 20px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 18px 60px rgba(0, 8, 24, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
}

.login-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 6px;
}
.login-sub {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 22px;
}

.login-field {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}
.login-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: rgba(8, 18, 34, 0.55);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.03em;
  font-family: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}
.login-field input::placeholder { color: var(--text-faint); }
.login-field input:focus {
  outline: none;
  border-color: rgba(95, 230, 247, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.login-btn {
  width: 100%;
  margin-top: 6px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(95, 230, 247, 0.5);
  background: linear-gradient(180deg, #5fe6f7 0%, var(--accent) 100%);
  color: #04121f;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.32);
}
.login-btn:hover { transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

.login-error {
  min-height: 16px;
  margin-top: 14px;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: #ffb27a;
  text-align: center;
}

.consent-card { text-align: left; }
.consent-card .login-title { text-align: center; }
.consent-copy {
  margin: 12px 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.consent-check input { margin-top: 3px; accent-color: var(--accent); }
.consent-actions { display: flex; gap: 10px; margin-top: 18px; }
.consent-actions .login-btn { margin-top: 0; flex: 1; }
.btn-secondary {
  flex: 0 0 88px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: rgba(12, 26, 48, 0.5);
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
}

/* 项目选择（多项目时显示；单项目自动跳过） */
.login-projects {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 8px;
}
.login-projects.show { display: flex; }
.proj-btn {
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid var(--glass-line);
  background: rgba(12, 26, 48, 0.5);
  color: var(--text-dim);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}
.proj-btn:hover { color: var(--text); }
.proj-btn.active {
  color: #04121f;
  background: linear-gradient(180deg, #5fe6f7 0%, var(--accent) 100%);
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.32);
  font-weight: 600;
}

/* 右上角登出 / 身份微件：默认隐藏，登录后显示 */
.session-widget {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 6;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 6px 22px rgba(0, 8, 24, 0.3);
}
.session-widget.show { display: inline-flex; }
.session-name {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  appearance: none;
  border: 1px solid var(--glass-line);
  background: rgba(12, 26, 48, 0.5);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.24s ease, border-color 0.24s ease;
}
.logout-btn:hover { color: var(--text); border-color: rgba(95, 230, 247, 0.4); }

@media (max-width: 560px) {
  .login-card { padding: 26px 20px 22px; }
  .session-name { max-width: 30vw; }
}
