/* 介山监控 · 登录页 */
:root {
  color-scheme: light;
  --ink: #1b2841;
  --muted: #4e5d74;
  --blue: #304cda;
  --border: #8794a7;
  --error: #a32a21;
  color: var(--ink);
  background: #fff;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, p { margin: 0; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(32px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right))
           calc(24px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
}
.panel { width: 100%; max-width: 400px; margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 8px; line-height: 22px; }
.brand svg { display: block; flex: none; }
.brand b { font-weight: 700; }
.slash { color: #9ba6b6; }
.product { color: var(--muted); font-size: 14px; }
h1 { margin: 28px 0 22px; font-size: 28px; line-height: 36px; font-weight: 700; }

.field + .field { margin-top: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.control {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  line-height: 24px;
}
.control:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 1px; }
.control[aria-invalid="true"] { border-color: var(--error); }
.secret { display: flex; align-items: center; gap: 8px; }
.secret .control { flex: 1 1 0%; }
#pw-toggle {
  flex: none;
  min-width: 52px;
  min-height: 48px;
  padding: 0 9px;
  border: 1px solid #c5cdda;
  border-radius: 8px;
  color: var(--muted);
  background: #f7f8fb;
  font-size: 14px;
  font-weight: 600;
}
.remember {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.remember input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.submit {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-size: 16px;
  font-weight: 600;
}
@media (hover: hover) {
  #pw-toggle:hover { background: #eaf0f8; color: var(--ink); }
  .submit:hover { background: #263fbf; }
}
.submit:active { background: #2237a7; }
.submit:disabled { background: #4359b7; cursor: wait; }
.alert, .field-error { color: var(--error); font-size: 14px; overflow-wrap: anywhere; }
.alert {
  margin-bottom: 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--error);
  border-radius: 4px;
  background: #fff2ef;
}
.field-error { margin-top: 5px; }
.alert:empty, .field-error:empty { display: none; }

@media (min-width: 640px) {
  .wrap { background: #f4f6fa; }
  .panel {
    max-width: 432px;
    margin-block: auto;
    padding: 32px;
    border: 1px solid #dce2eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(26, 40, 65, .06);
  }
}
