.qjc-auth {
  position: relative;
  flex: 0 0 auto;
}

.qjc-auth [hidden],
.qjc-auth-modal[hidden],
.qjc-auth-modal [hidden] {
  display: none !important;
}

.qjc-auth-trigger {
  min-height: 40px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text, #eef4ff);
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.qjc-auth-trigger:hover,
.qjc-auth-trigger:focus-visible,
.qjc-auth-trigger[aria-expanded="true"] {
  background: rgba(125, 211, 252, 0.18);
  border-color: rgba(125, 211, 252, 0.48);
  transform: translateY(-1px);
}

.qjc-auth-trigger:focus-visible,
.qjc-auth-panel a:focus-visible,
.qjc-auth-panel button:focus-visible,
.qjc-auth-modal button:focus-visible,
.qjc-auth-modal input:focus-visible {
  outline: 2px solid var(--accent, var(--brand, #7dd3fc));
  outline-offset: 3px;
}

.qjc-auth-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.1);
}

.qjc-auth[data-state="authenticated"] .qjc-auth-dot {
  background: var(--accent-3, var(--ok, #34d399));
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.12);
}

.qjc-auth[data-state="guest"] .qjc-auth-dot,
.qjc-auth[data-state="idle"] .qjc-auth-dot {
  background: var(--muted, #9fb1ca);
  box-shadow: 0 0 0 5px rgba(159, 177, 202, 0.1);
}

.qjc-auth[data-state="error"] .qjc-auth-dot {
  background: #fb7185;
  box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.12);
}

.qjc-auth-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  color: var(--text, #eef4ff);
  background: rgba(8, 13, 24, 0.97);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(20px);
}

.qjc-auth-kicker {
  margin: 0 0 8px;
  color: var(--accent, var(--brand, #7dd3fc));
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.qjc-auth-title {
  display: block;
  margin-bottom: 7px;
  font-size: 17px;
  line-height: 1.4;
}

.qjc-auth-detail {
  min-height: 24px;
  margin: 0 0 17px;
  color: var(--muted, #9fb1ca);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.qjc-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.qjc-auth-actions a,
.qjc-auth-actions button {
  min-height: 42px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.qjc-auth-actions a:hover,
.qjc-auth-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.qjc-auth-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.qjc-auth-primary {
  grid-column: 1 / -1;
  color: #07101f;
  background: linear-gradient(
    135deg,
    var(--accent, var(--brand, #7dd3fc)),
    var(--accent-3, var(--ok, #34d399))
  );
  border: 0;
}

.qjc-auth-secondary {
  color: var(--text, #eef4ff);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
}

.qjc-auth-danger {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.28);
}

.qjc-auth-note {
  margin: 14px 0 0;
  color: var(--muted, #9fb1ca);
  font-size: 11px;
  line-height: 1.55;
}

.qjc-auth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.qjc-auth-modal-open {
  overflow: hidden;
}

.qjc-auth-modal,
.qjc-auth-modal * {
  box-sizing: border-box;
}

.qjc-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #eef4ff;
  font-family: inherit;
  line-height: 1.5;
}

.qjc-auth-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background:
    radial-gradient(circle at 22% 12%, rgba(56, 189, 248, 0.17), transparent 33%),
    radial-gradient(circle at 82% 82%, rgba(167, 139, 250, 0.14), transparent 36%),
    rgba(2, 6, 16, 0.78);
  border: 0;
  cursor: default;
  backdrop-filter: blur(12px);
}

.qjc-auth-dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(16, 26, 46, 0.98), rgba(7, 13, 27, 0.99)) padding-box,
    linear-gradient(145deg, rgba(125, 211, 252, 0.56), rgba(167, 139, 250, 0.25)) border-box;
  border: 1px solid transparent;
  border-radius: 26px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.58);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.42) transparent;
}

.qjc-auth-dialog::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -70px;
  width: 210px;
  height: 210px;
  pointer-events: none;
  background: rgba(56, 189, 248, 0.13);
  border-radius: 50%;
  filter: blur(35px);
}

.qjc-auth-dialog-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 46px 1fr 36px;
  align-items: start;
  gap: 14px;
  margin-bottom: 22px;
}

.qjc-auth-brand-mark {
  width: 46px;
  height: 46px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.qjc-auth-brand-mark i {
  display: block;
  border-radius: 5px;
}

.qjc-auth-brand-mark i:nth-child(1) { background: #84cc16; }
.qjc-auth-brand-mark i:nth-child(2) { background: #0ea5e9; }
.qjc-auth-brand-mark i:nth-child(3) { background: #facc15; }
.qjc-auth-brand-mark i:nth-child(4) { background: #a21caf; }

.qjc-auth-dialog-heading span {
  display: block;
  margin: 1px 0 3px;
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.qjc-auth-dialog-heading h2 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(21px, 4vw, 26px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.qjc-auth-dialog-heading p {
  margin: 5px 0 0;
  color: #9fb1ca;
  font-size: 13px;
  line-height: 1.55;
}

.qjc-auth-dialog-close {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c8d5e8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  font: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.qjc-auth-dialog-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.qjc-auth-modal-alert {
  position: relative;
  z-index: 1;
  margin: -5px 0 16px;
  padding: 11px 13px;
  color: #dceeff;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.55;
}

.qjc-auth-modal-alert[data-type="success"] {
  color: #d1fae5;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
}

.qjc-auth-modal-alert[data-type="warning"] {
  color: #fef3c7;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.28);
}

.qjc-auth-modal-alert[data-type="error"] {
  color: #ffe4e6;
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.3);
}

.qjc-auth-modal-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 18px;
  padding: 4px;
  background: rgba(2, 6, 18, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.qjc-auth-modal-tabs button {
  min-height: 40px;
  padding: 8px 12px;
  color: #91a3bd;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
/* 点击登录后的输入窗口文本颜色 */
.qjc-auth-modal-tabs button[aria-selected="true"] {
  color: #f5fbff;
  background: rgba(125, 211, 252, 0.14);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.22);
}

.qjc-auth-modal-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin: 0;
}

.qjc-auth-modal-form label {
  display: grid;
  gap: 7px;
  margin: 0;
}

.qjc-auth-modal-form label > span,
.qjc-auth-account-line > span {
  color: #b7c6da;
  font-size: 12px;
  font-weight: 750;
}

.qjc-auth-modal-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: #f3f8ff;
  caret-color: #7dd3fc;
  background: rgba(4, 9, 21, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 13px;
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.qjc-auth-modal-form input::placeholder {
  color: #687a96;
}

.qjc-auth-modal-form input:hover {
  border-color: rgba(125, 211, 252, 0.36);
}

.qjc-auth-modal-form input:focus {
  background: rgba(7, 15, 31, 0.88);
  border-color: rgba(125, 211, 252, 0.7);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.09);
}

.qjc-auth-modal-form input:disabled,
.qjc-auth-modal-form button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.qjc-auth-challenge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 155px;
  align-items: end;
  gap: 10px;
}

.qjc-auth-challenge > div {
  min-height: 48px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  color: #e7f6ff;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 13px;
  text-align: center;
}

.qjc-auth-challenge > div > span {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.qjc-auth-challenge button {
  padding: 0;
  color: #7dd3fc;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.qjc-auth-submit,
.qjc-auth-modal-secondary {
  min-height: 48px;
  padding: 11px 16px;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}
/* 底部“安全登录”“创建账户”“确认修改”按钮风格 */
.qjc-auth-submit {
  color: #05121f;
  background: linear-gradient(135deg, #7dd3fc, #5eead4);
  border: 0;
  box-shadow: 0 12px 28px rgba(45, 212, 191, 0.14);
}

.qjc-auth-modal-secondary {
  color: #dbe9fb;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.qjc-auth-submit:hover,
.qjc-auth-modal-secondary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.qjc-auth-password-rules {
  display: grid;
  gap: 5px;
  margin: -2px 0 1px;
  padding: 0;
  color: #91a3bd;
  font-size: 11px;
  line-height: 1.45;
  list-style: none;
}

.qjc-auth-password-rules li::before {
  content: "\2713";
  margin-right: 7px;
  color: #5eead4;
  font-weight: 900;
}

.qjc-auth-account-line {
  min-height: 47px;
  padding: 9px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(125, 211, 252, 0.07);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 13px;
}

.qjc-auth-account-line strong {
  color: #e9f7ff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.qjc-auth-modal-form-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.qjc-auth-security-note,
.qjc-auth-dialog-footnote {
  color: #8294ae;
  font-size: 10px;
  line-height: 1.55;
}

.qjc-auth-security-note {
  margin: -2px 0 0;
  text-align: center;
}

.qjc-auth-dialog-footnote {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  text-align: center;
}

/* 认证入口加入后，在中等宽度下提前切换到折叠导航。 */
@media (max-width: 1080px) {
  .site-header {
    border-radius: 24px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    display: none;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    background: rgba(8, 13, 24, 0.97);
    border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
    border-radius: 22px;
    backdrop-filter: blur(18px);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    text-align: center;
  }

  .qjc-auth {
    width: 100%;
  }

  .qjc-auth-trigger {
    width: 100%;
  }

  .qjc-auth-panel {
    position: static;
    width: 100%;
    margin-top: 9px;
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  .qjc-auth-modal {
    align-items: end;
    padding: 0;
  }

  .qjc-auth-dialog {
    width: 100%;
    max-height: min(90vh, 760px);
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }

  .qjc-auth-dialog-header {
    grid-template-columns: 42px 1fr 34px;
    gap: 11px;
    margin-bottom: 18px;
  }

  .qjc-auth-brand-mark {
    width: 42px;
    height: 42px;
  }

  .qjc-auth-challenge {
    grid-template-columns: minmax(0, 1fr) 130px;
  }
}

@media (max-width: 420px) {
  .qjc-auth-actions,
  .qjc-auth-modal-form-actions {
    grid-template-columns: 1fr;
  }

  .qjc-auth-primary {
    grid-column: auto;
  }

  .qjc-auth-challenge {
    grid-template-columns: 1fr;
  }

  .qjc-auth-challenge > div {
    grid-template-columns: 1fr auto;
    justify-items: stretch;
    text-align: left;
  }

  .qjc-auth-challenge button {
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qjc-auth-trigger,
  .qjc-auth-actions a,
  .qjc-auth-actions button,
  .qjc-auth-modal-form input,
  .qjc-auth-submit,
  .qjc-auth-modal-secondary {
    transition: none;
  }
}

/* 账户面板中的“登录 / 注册”按钮 */
.qjc-auth .qjc-auth-actions a.qjc-auth-primary,
.qjc-auth .qjc-auth-actions a.qjc-auth-primary:visited {
  color: #052e16;
  background: linear-gradient(135deg, #64c8ec 0%, #12b54e 100%);
  border: 1px solid rgba(134, 239, 172, 0.55);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.2);
}

/* 鼠标经过 */
.qjc-auth .qjc-auth-actions a.qjc-auth-primary:hover {
  color: #052e16;
  background: linear-gradient(135deg, #bbf7d0 0%, #29d367 100%);
}


/* 未登录或服务异常时，让“重新检查”按钮居中 */
.qjc-auth[data-state="checking"] #qjc-auth-refresh,
.qjc-auth[data-state="guest"] #qjc-auth-refresh,
.qjc-auth[data-state="idle"] #qjc-auth-refresh,
.qjc-auth[data-state="error"] #qjc-auth-refresh {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(170px, 100%);
}
@media (max-width: 420px) {
  .qjc-auth[data-state="checking"] #qjc-auth-refresh,
  .qjc-auth[data-state="guest"] #qjc-auth-refresh,
  .qjc-auth[data-state="idle"] #qjc-auth-refresh,
  .qjc-auth[data-state="error"] #qjc-auth-refresh {
    width: 100%;
  }
}
