:root {
  --bg: #0b0b0c;
  --panel: #0e0e0f;
  --panel-2: #131315;
  --line: #29292c;
  --line-strong: #3b3b3e;
  --text: #ece9e2;
  --muted: #96918a;
  --muted-2: #6f6b65;
  --brass: #c6a66e;
  --brass-hover: #d6b77f;
  --red: #c65c5c;
  --font-cn: "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-cn);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(198, 166, 110, .28); color: #fff; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(410px, .82fr);
  background: var(--bg);
}

.login-brand {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 54px clamp(36px, 5vw, 84px) 54px clamp(72px, 9vw, 168px);
  background: #0b0b0c;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .26;
  background-image:
    linear-gradient(to right, rgba(236, 233, 226, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(236, 233, 226, .04) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,.82), transparent 78%);
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.82), transparent 78%);
}

.brand-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7vh;
  width: 100%;
  height: min(24vh, 220px);
  pointer-events: none;
  opacity: .62;
}
.brand-line path {
  fill: none;
  stroke: #403b32;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.brand-lockup {
  position: relative;
  z-index: 1;
}

.brand-lockup h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(38px, 4.2vw, 62px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: .015em;
}

.brand-en {
  margin: 16px 0 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .32em;
}

.brand-lockup::after {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  margin-top: 24px;
  background: var(--brass);
  opacity: .85;
}

.login-panel {
  min-height: 100vh;
  background: var(--panel);
  display: grid;
  place-items: center;
  padding: 48px clamp(28px, 5vw, 72px);
}

.login-form-wrap {
  width: min(356px, 100%);
}

.form-head {
  margin-bottom: 30px;
}
.form-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 550;
  letter-spacing: .03em;
}

.field { display: block; margin-bottom: 18px; }
.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .04em;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 9px 12px;
  color: var(--text);
  background: #0a0a0b;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-cn);
  font-size: 14px;
  outline: none;
  transition: border-color .14s ease, background-color .14s ease;
}
.field input:hover { border-color: var(--line-strong); }
.field input:focus {
  border-color: var(--brass);
  background: #0c0c0d;
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #0a0a0b inset;
  transition: background-color 9999s ease-out;
}

.login-error {
  min-height: 18px;
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}
.login-error:empty { display: none; }

.login-btn {
  width: 100%;
  height: 46px;
  margin-top: 2px;
  border: 1px solid var(--brass);
  border-radius: 3px;
  background: var(--brass);
  color: #17130d;
  cursor: pointer;
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  transition: background-color .14s ease, border-color .14s ease;
}
.login-btn:hover { background: var(--brass-hover); border-color: var(--brass-hover); }
.login-btn:active { background: #b8965f; border-color: #b8965f; }
.login-btn:focus-visible,
.field input:focus-visible {
  outline: 1px solid var(--brass);
  outline-offset: 3px;
}

.login-foot {
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .08em;
}

@media (max-width: 860px) {
  body { overflow-y: auto; }
  .login-shell { display: block; width: 100%; overflow: hidden; }
  .login-brand { width: 100%; }
  .login-brand {
    min-height: 228px;
    padding: 30px 26px 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    justify-content: flex-end;
  }
  .brand-grid { opacity: .2; background-size: 74px 74px; }
  .brand-line {
    bottom: 0;
    height: 122px;
    opacity: .45;
  }
  .brand-lockup h1 { font-size: 34px; }
  .brand-en { margin-top: 11px; font-size: 9px; letter-spacing: .28em; }
  .brand-lockup::after { margin-top: 17px; width: 28px; }
  .login-panel {
    display: block;
    min-height: calc(100vh - 228px);
    padding: 36px 24px 52px;
  }
  .login-form-wrap { width: 100%; max-width: 420px; margin: 0 auto; }
  .form-head { margin-bottom: 26px; }
}

@media (max-width: 420px) {
  .login-brand { min-height: 196px; padding: 24px 20px 22px; }
  .brand-lockup h1 { font-size: 30px; }
  .brand-line { height: 96px; opacity: .36; }
  .login-panel { min-height: calc(100vh - 196px); padding: 30px 20px 44px; }
  .field input, .login-btn { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* 维护提示（为空时不占位） */
.login-notice {
  margin: 10px 0 2px;
  padding: 9px 12px;
  border: 1px solid #6a4a1d;
  border-radius: 4px;
  background: rgba(217, 164, 65, .08);
  color: #e7c88d;
  font-size: 12px;
  line-height: 1.5;
}
.login-notice:empty { display: none; }