:root {
  --bg: #eef2ef;
  --ink: #17262a;
  --muted: #5f6e70;
  --line: #dfe6e2;
  --navy: #102a30;
  --teal: #0f766e;
  --teal-strong: #0a5e58;
  --card: #ffffff;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(16, 42, 48, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 42, 48, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-shell {
  width: min(1000px, 100%);
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(16, 42, 48, 0.13);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 30px 80px rgba(16, 42, 48, 0.15);
}

.brand-block {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 62px;
  overflow: hidden;
  color: #f7fbfc;
  background: var(--navy);
}

.brand-block::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  border-radius: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(135deg, #000 0%, rgba(0, 0, 0, 0.4) 62%, transparent 100%);
}

.brand-block::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  right: auto;
  height: auto;
  border-radius: 0;
  background: #6fd6c8;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
}

/* 图标本体自带深色底与圆角，这里只裁切不染色，否则两层圆角会错位 */
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: #74d6c9;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-block h1 {
  position: relative;
  z-index: 1;
  max-width: 470px;
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-copy {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 22px 0 0;
  color: #b9cdce;
  font-size: 14px;
  line-height: 1.8;
}

.brand-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
  color: #d8e6e5;
  font-size: 12px;
}

.brand-points span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.brand-points svg {
  width: 15px;
  height: 15px;
  color: #74d6c9;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 50px 34px;
  background: #ffffff;
}

.login-panel h2 {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.form-hint {
  margin: 10px 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
}

.field span {
  color: #405156;
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(15, 118, 110, 0.6);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("/chevron-down.svg?v=a89665de62");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 15px 15px;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

.login-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  padding: 0 17px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  background: var(--teal);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.17);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.login-button:hover {
  background: var(--teal-strong);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
  transform: translateY(-1px);
}

.login-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.login-button svg {
  width: 18px;
  height: 18px;
}

.form-error {
  min-height: 20px;
  margin: -3px 0 11px;
  color: var(--error);
  font-size: 12px;
}

.staff-entry {
  min-height: 41px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 0 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 7px;
  color: var(--teal);
  background: #f4faf8;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.staff-entry:hover {
  border-color: rgba(15, 118, 110, 0.38);
  background: #edf7f4;
}

.app-entry {
  margin-top: 8px;
}

.staff-entry svg {
  width: 15px;
  height: 15px;
}

.staff-entry svg:last-child {
  margin-left: auto;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.security-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--teal);
}

@media (max-width: 820px) {
  .login-page {
    padding: 16px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .brand-block {
    min-height: 250px;
    padding: 36px 32px;
  }

  .brand-block h1 {
    font-size: 30px;
  }

  .brand-copy {
    max-width: 520px;
    margin-top: 16px;
  }

  .brand-points {
    margin-top: 24px;
  }

  .login-panel {
    padding: 36px 28px 28px;
  }
}

@media (max-width: 430px) {
  .login-shell {
    border-radius: 8px;
  }

  .brand-block {
    padding: 28px 22px;
  }

  .brand-copy {
    font-size: 12px;
  }

  .login-panel {
    padding: 30px 20px 22px;
  }

  .login-panel h2 {
    font-size: 24px;
  }
}

/* ── 键盘焦点可见性 ─────────────────────────────────────────────
   上方各控件用 outline:0 关掉默认环、改用 box-shadow 表达鼠标聚焦。
   这里只补 :focus-visible：特异性与元素规则相同、位置更靠后因此生效，
   既让键盘/助残用户看到明确焦点，又不改变鼠标点击时的既有观感。 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal, #0f766e);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 深色页头/侧栏上用浅色环，保证对比度 */
.admin-sidebar :focus-visible,
.admin-topbar :focus-visible,
.portal-header :focus-visible,
.topbar :focus-visible,
.mobile-app-bar :focus-visible {
  outline-color: #7fe3d4;
}

/* ── 动效降级与高对比度兜底 ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Windows 高对比度 / forced-colors 会剥离 box-shadow 并覆盖自定义颜色，
   而本项目的焦点环与状态标签大量依赖二者，这里给出兜底。 */
@media (forced-colors: active) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }

  /* 状态标签不能只靠底色区分，强制补边框 */
  .status-pill,
  .pill,
  .review-approved,
  .review-pending,
  .status-normal,
  .status-abnormal,
  .status-blocked,
  .status-pending,
  .account-active,
  .account-inactive,
  .audit-type-update,
  .audit-type-create,
  .audit-type-review,
  .audit-type-delete,
  .audit-type-auth,
  .audit-type-system {
    border: 1px solid CanvasText;
    forced-color-adjust: none;
  }

  .live-dot {
    forced-color-adjust: none;
  }

  .data-table thead th {
    background: Canvas;
    color: CanvasText;
  }
}
