/* ═══════════════════════════════════════
   身份模块：顶部徽章 + 身份填写弹窗
   ═══════════════════════════════════════ */

/* 顶部身份徽章 */
.identity-badge {
  display: none;
  align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px;
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border: 1.5px solid #fde68a;
  border-radius: 999px;
  margin-right: 10px;
}
.identity-badge.visible { display: inline-flex; }
.idb-avatar {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; font-weight: 800; font-size: 13px;
  border-radius: 50%;
  flex-shrink: 0;
}
.idb-text {
  display: flex; flex-direction: column;
  font-size: 12px; line-height: 1.2;
  max-width: 180px;
}
.idb-text strong { color: var(--ink); font-size: 13px; font-weight: 800; }
.idb-text em {
  color: var(--muted); font-style: normal; font-size: 11px;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.idb-switch {
  border: none; background: transparent;
  font-size: 16px; color: var(--muted);
  padding: 4px 8px; border-radius: 50%;
  transition: all 0.2s;
}
.idb-switch:hover { background: #fff; color: var(--brand); }

/* 身份弹窗：更有仪式感 */
#identityModal .modal-box {
  max-width: 460px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
#identityModal .modal-head {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #fff;
  padding: 28px 28px 24px;
  text-align: center;
  border-bottom: none;
}
#identityModal .modal-head h3 {
  font-size: 22px; margin: 0 0 6px;
  font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#identityModal .modal-head p {
  margin: 0; opacity: 0.85; font-size: 13px;
}
.identity-form { padding: 28px; }
.identity-form .field { margin-bottom: 16px; }
.identity-form label {
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.identity-form label .emoji { font-size: 16px; }
.identity-form input {
  height: 44px; font-size: 15px;
}
.identity-form .hint {
  margin-top: 16px;
  padding: 10px 12px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  font-size: 12px; color: #78350f; line-height: 1.5;
}
#identitySubmit {
  width: 100%; height: 48px;
  font-size: 16px; font-weight: 800;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #fff; border: none; border-radius: 10px;
  margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
#identitySubmit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);
}
#identitySubmit:disabled { opacity: 0.6; cursor: wait; }

/* ══ 登录/注册 双 tab 样式 ══ */
.auth-tabs {
  display: flex; gap: 0;
  padding: 0 28px; margin-top: -2px;
  background: linear-gradient(180deg, #115e59 0%, #0f766e 100%);
}
.auth-tab {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.auth-tab:hover { color: #fff; background: rgba(255,255,255,0.08); }
.auth-tab.active {
  color: #fff;
  border-bottom-color: #fbbf24;
  background: rgba(255,255,255,0.12);
}
.auth-body {
  padding: 22px 28px 24px;
  max-height: 72vh;
  overflow-y: auto;
}
.auth-panel { display: none; }
.auth-panel.active { display: block; animation: authFadeIn 0.18s ease; }
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-panel .field { margin-bottom: 14px; }
.auth-panel label {
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.auth-panel label .emoji { font-size: 16px; }
.auth-panel input {
  width: 100%;
  height: 42px;
  font-size: 15px;
  padding: 0 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-panel input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.auth-panel button#loginSubmit,
.auth-panel button#signupSubmit {
  width: 100%; height: 46px;
  font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #fff; border: none; border-radius: 10px;
  margin-top: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.auth-panel button#loginSubmit:hover:not(:disabled),
.auth-panel button#signupSubmit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);
}
.auth-panel button:disabled { opacity: 0.6; cursor: wait; }

.auth-switch-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}
.auth-switch-hint a {
  color: #0f766e;
  font-weight: 700;
  text-decoration: none;
}
.auth-switch-hint a:hover { text-decoration: underline; }

.auth-error {
  display: none;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  font-size: 13px;
  color: #991b1b;
  line-height: 1.5;
}
.auth-error.visible { display: block; animation: authFadeIn 0.15s ease; }

.auth-body .hint {
  margin-top: 16px;
  padding: 10px 12px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  font-size: 12px; color: #78350f; line-height: 1.5;
}

@media (max-width: 600px) {
  .idb-text { max-width: 120px; }
  .identity-badge { padding: 3px 4px; }
  .auth-tabs { padding: 0 16px; }
  .auth-body { padding: 18px 16px 20px; }
}
