/* hidden 属性必须真正隐藏：reports.css 里的 display:block 会覆盖它，
   曾导致已废弃的"进入设计预览"测试入口重新露出来。 */
[hidden] {
  display: none !important;
}

/* 登录门禁：未通过身份核验前不渲染后台任何工作区内容。 */
html.gate-locked body > .sidebar,
html.gate-locked body > #main {
  display: none !important;
}

#admin-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f4f7fd;
  background-image: radial-gradient(1200px 600px at 50% -10%, #e3edff 0%, rgba(244, 247, 253, 0) 70%);
}

#admin-gate[hidden] {
  display: none !important;
}

/* 核对态：刷新时先显示中性的"正在核对"，核验通过后直接放行，不闪登录表单。 */
.gate-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #6d7c98;
}

.gate-check p {
  margin: 0;
}

.gate-check .gate-spinner {
  width: 20px;
  height: 20px;
  margin: 0;
  border-width: 2.5px;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e2e9f4;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(16, 36, 74, 0.09);
  padding: 36px 34px 30px;
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.gate-brand img {
  width: 132px;
  display: block;
}

.gate-title {
  font-size: 20px;
  font-weight: 600;
  color: #071239;
  margin: 14px 0 6px;
  letter-spacing: -0.3px;
}

.gate-subtitle {
  font-size: 13px;
  line-height: 1.7;
  color: #6d7c98;
  margin: 0 0 24px;
}

.gate-field {
  display: block;
  margin-bottom: 16px;
}

.gate-field span {
  display: block;
  font-size: 13px;
  color: #55658a;
  margin-bottom: 8px;
}

.gate-field input {
  width: 100%;
  height: 44px;
  border: 1px solid #dbe3f0;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: #16274d;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gate-field input:focus {
  outline: none;
  border-color: #2d6cff;
  box-shadow: 0 0 0 3px rgba(45, 108, 255, 0.12);
}

.gate-field input:disabled {
  background: #f5f7fb;
  color: #90a0ba;
}

.gate-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #5f6f8f;
  margin: 2px 0 20px;
  cursor: pointer;
  user-select: none;
}

.gate-remember input {
  width: 15px;
  height: 15px;
  accent-color: #2d6cff;
  margin: 0;
}

.gate-submit {
  width: 100%;
  height: 46px;
  border: 1px solid #2d6cff;
  border-radius: 8px;
  background: #2d6cff;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(45, 108, 255, 0.22);
  transition: background 0.15s;
}

.gate-submit:hover:not(:disabled) {
  background: #1f57e0;
  border-color: #1f57e0;
}

.gate-submit:disabled {
  background: #b8c6de;
  border-color: #b8c6de;
  box-shadow: none;
  cursor: not-allowed;
}

.gate-status {
  min-height: 20px;
  font-size: 13px;
  line-height: 1.7;
  margin: 14px 0 0;
  color: #6d7c98;
}

.gate-status.error {
  color: #c23c3c;
}

.gate-status.ok {
  color: #12825d;
}

.gate-foot {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid #eef2f8;
  font-size: 12px;
  line-height: 1.8;
  color: #93a1b8;
}

.gate-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  border: 2px solid rgba(109, 124, 152, 0.28);
  border-top-color: #2d6cff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: gate-spin 0.7s linear infinite;
}

/* 侧栏「退出登录」：尺寸沿用 nav a / nav button 的密度规则，这里只清掉按钮默认外观。 */
.sidebar nav > .gate-signout {
  display: flex;
  align-items: center;
  border: 0;
  background: none;
  color: #526184;
  cursor: pointer;
}

.sidebar nav > .gate-signout:hover {
  color: #b42424;
  background: #fdf1f1;
}

.sidebar nav > .gate-signout svg {
  width: calc(21px * var(--mini-admin-density, 1));
  height: calc(21px * var(--mini-admin-density, 1));
  flex: 0 0 auto;
  opacity: 0.65;
}

.sidebar nav > .gate-signout:hover svg {
  opacity: 1;
}

@media (max-width: 760px) {
  .sidebar nav > .gate-signout {
    width: auto;
    min-height: 40px;
    margin: 0;
    padding: 7px 10px;
    gap: 7px;
    font-size: 14px;
  }
}

@keyframes gate-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .gate-card {
    padding: 28px 22px 24px;
    border-radius: 12px;
  }

  .gate-title {
    font-size: 18px;
  }
}
