/* 我的：账号卡片与功能入口 */

.profile-identity .profile-user {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-account-button {
  flex-shrink: 0;
  max-width: 120px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy-dark);
  background: var(--blue-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.profile-account-notice {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-account-notice:empty {
  display: none;
}

.profile-menu-link {
  color: inherit;
  text-decoration: none;
}

.profile-menu-link:hover {
  background: var(--blue-soft);
}


/* 登录与注册：居中弹窗 */

body.account-dialog-open {
  overflow: hidden;
}

.account-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* 登录弹窗：遮住后方课程、练习和历史内容 */

.account-dialog::backdrop {
  background: #f6f8fc;
  opacity: 1;
}

.account-dialog [hidden] {
  display: none !important;
}

.account-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.account-dialog-heading h2 {
  margin: 0;
  font-size: 24px;
}

.account-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--warm-white);
  font-size: 24px;
  cursor: pointer;
}


/* 登录与注册：表单 */

.account-form,
.account-field {
  display: grid;
  gap: 8px;
}

.account-form {
  gap: 16px;
}

.account-field label {
  font-size: 14px;
  font-weight: 700;
}

.account-field input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--warm-white);
  font: inherit;
  font-size: 16px;
}

.account-field small {
  color: var(--muted);
  font-size: 12px;
}

.account-submit {
  min-height: 44px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--navy-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.account-switch {
  display: block;
  margin: 18px auto 0;
  padding: 6px;
  border: 0;
  color: var(--navy-dark);
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.account-message {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-message:empty {
  display: none;
}

.account-dialog button:disabled,
.profile-account-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.account-dialog :focus-visible,
.profile-account-button:focus-visible,
.profile-menu-link:focus-visible {
  outline: 2px solid var(--navy-dark);
  outline-offset: 3px;
}


/* 我的：窄屏账号卡片 */

@media (max-width: 380px) {
  .profile-identity {
    flex-wrap: wrap;
  }

  .profile-account-button {
    margin-left: auto;
  }
}

/* 登录与注册：密码显示与隐藏按钮 */

.account-password-wrapper {
  position: relative;
  min-width: 0;
}

.account-password-wrapper input {
  padding-right: 54px;
}

.account-password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.account-password-toggle svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.account-password-toggle .account-eye-slash {
  display: none;
}

.account-password-toggle.is-visible .account-eye-slash {
  display: block;
}

.account-password-toggle:hover {
  color: var(--navy-dark);
  background: var(--blue-soft);
}

/* 避免 Edge 自带的小眼睛与我们的按钮重复 */

.account-password-wrapper input::-ms-reveal {
  display: none;
}

/* 我的：没有管理权限时隐藏考试管理入口 */

.profile-menu-link[hidden] {
  display: none !important;
}

/* 词汇旧记录导入弹窗：按钮排列 */

.account-import-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.account-import-actions .account-switch {
  margin: 0;
}