/* =========================================================
   ai-chat-sidebar-account.css
   Account popup menu / Settings modal / Edit profile modal
   从 ai-chat-sidebar.css 中提取
   ========================================================= */

/* --- Account popup menu --- */
.sidebar-account-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 220px;
  background: #fff;
  border-radius: calc(12px * var(--corner-k));
  box-shadow: var(--menu-shadow);   /* hairline ring dropped: menus carry no outer border */
  padding: 6px 0;
  z-index: 999;
}
.sidebar-account-menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
}
.sidebar-account-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  corner-shape: round;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  padding-top: 2px; /* 视觉修正：大写字母偏上，下移2px居中 */
}
.sidebar-account-menu-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-account-menu-name {
  font-weight: 500;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.3;
}
.sidebar-account-menu-username {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-account-menu-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 4px 0;
}
.sidebar-account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #1a1a1a;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
}
.sidebar-account-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
}
.sidebar-account-menu-icon svg {
  width: var(--icon-size) !important;
  height: var(--icon-size) !important;
}
html:not([data-input="touch"]) .sidebar-account-menu-item:hover{
  background: rgba(0,0,0,0.04);
}
.sidebar-account-menu-item:active {
  background: rgba(0,0,0,0.04);
}
.sidebar-account-menu-logout {
  color: #e53935;
}
/* --- Account menu: language picker with right flyout --- */
.sidebar-account-menu-lang-row .sidebar-account-menu-item {
  justify-content: flex-start;
}
.sidebar-account-menu-lang-chevron {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: rgba(0,0,0,0.35);
}
.sidebar-account-menu-lang-chevron .chevron-icon {
  width: var(--chevron-trigger-size);
  height: var(--chevron-trigger-size);
}
.sidebar-account-menu-lang-options {
  position: fixed;
  min-width: 160px;
  background: #fff;
  border-radius: calc(12px * var(--corner-k));
  box-shadow: var(--menu-shadow);   /* hairline ring dropped: menus carry no outer border */
  padding: 6px 0;
  z-index: 10001;
}
.sidebar-account-menu-lang-options[hidden] {
  display: none;
}
.sidebar-account-menu-lang-option {
  padding: 8px 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: background 0.1s;
}
html:not([data-input="touch"]) .sidebar-account-menu-lang-option:hover{
  background: rgba(0,0,0,0.04);
}
.sidebar-account-menu-lang-option:active {
  background: rgba(0,0,0,0.04);
}
.sidebar-account-menu-lang-option.active {
  color: #1a1a1a;
  font-weight: 500;
}
/* Settings button reset in account menu */
button.sidebar-account-menu-item {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
}

/* --- Sidebar account button (avatar + name/email) --- */
.sidebar-account-btn-full {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  border: none;
  cursor: pointer;
  width: 100%;
  font: inherit;
  background: none;
  padding: 6px 8px 6px 12px;   /* 退回整体右移3px：底部账户 Duo 左右回 12/8 */
}
.sidebar-account-btn-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  corner-shape: round;
  background: #1a1a1a;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  padding-top: 1px;
  background-size: cover;
  background-position: center;
}
.sidebar-account-btn-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  pointer-events: none;
}
.sidebar-account-btn-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-account-btn-email {
  font-size: 11px;
  color: rgba(0,0,0,0.4);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Sidebar collapsed: icon-only account button --- */
.chat-sidebar.collapsed .sidebar-account-btn-name {
  display: none;
}
.chat-sidebar.collapsed .sidebar-account-btn-full {
  justify-content: center;
  padding: 0;
  gap: 0;
}
/* Mobile: restore name + left-align when "collapsed" (drawer mode) */
@media (max-width: 768px), (max-height: 500px) {
  .chat-sidebar.collapsed .sidebar-account-btn-name {
    display: inline !important;
  }
  .chat-sidebar.collapsed .sidebar-account-btn-full {
    justify-content: flex-start !important;
    padding: 6px 0 !important;
    gap: 10px !important;
  }
}

