/* 登录 / 注册：暖 off-white 纸面 + 像素直角
   规则：无渐变、无发光、无模糊阴影、圆角为 0、间距全部落在 8px 网格 */

.login {
  --paper: #F7F5F2;
  --panel: #FDFBF8;
  --ink: #2C241E;
  --ink-2: #6B6157;
  --line: #D9D2C6;
  --accent: #C85F28;
  --accent-hover: #B35423;

  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 48px 24px 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath d='M16 0H0v16' fill='none' stroke='%23EDE8E0' stroke-width='1'/%3E%3C/svg%3E");
}

/* ── 像素点阵交互层：位于面板之下，不抢表单焦点 ── */
.pixel-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── 表单容器：2px 实线边框，0 圆角 ── */
.login-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  padding: 40px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 #E4DED2;
}

@media (max-width: 520px) {
  .login-panel { padding: 32px 24px; }
  .login { padding: 32px 24px 0; }
}

/* ── 品牌区：线性爪印 + 实色标题 ── */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.brand-mark {
  display: flex;
  color: var(--ink);
}
.login-title {
  font-family: var(--font-pixel);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
}
.login-tag {
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-2);
}

/* ── 登录 / 注册 切换：激活态为中性深色 ── */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 32px 0 24px;
  background: #EFE9E0;
  border: 2px solid var(--ink);
  border-radius: 0;
}
.login-tab {
  padding: 16px 0;
  font-family: var(--font-pixel);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ink-2);
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
}
.login-tab + .login-tab { border-left: 2px solid var(--ink); }
.login-tab.is-active {
  color: var(--paper);
  background: var(--ink);
}

/* ── 表单 ── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--ink-2);
}

/* ── 输入框：48px 高，仅底部 2px 细线，聚焦时底部转为主色 ── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  display: flex;
  color: var(--ink-2);
  pointer-events: none;
}
.login-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 40px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: #FFFFFF;
  border: none;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  outline: none;
}
.input-wrap.has-action .login-input { padding-right: 48px; }
.login-input::placeholder { color: #A79E92; }
.login-input:focus { border-bottom-color: var(--accent); }

.input-action {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
}
.input-action:hover { color: var(--ink); }

/* ── 错误提示 ── */
.login-error {
  padding: 8px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #8C2F1C;
  background: #FBEEE9;
  border: 2px solid #C2452D;
  border-radius: 0;
}

/* ── 辅助行 ── */
.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.login .mc-check { color: var(--ink); }
.login .mc-check input { accent-color: var(--ink); }
.login-link, .login-switch a {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
}
.login-link:hover, .login-switch a:hover { color: var(--ink); }
.login-switch {
  font-size: 13px;
  text-align: center;
  color: var(--ink-2);
}

/* ── 主按钮：全屏唯一的主色 ── */
.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0;
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 2px;
  color: #FBF6F0;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.login-submit:hover { background: var(--accent-hover); }
.login-submit:active { transform: translate(2px, 2px); }
.login-submit:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}
.btn-label { display: inline-flex; align-items: center; }
.btn-arrow { display: inline-flex; align-items: center; }

/* 加载态：文字与箭头换成像素转轮 */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(251, 246, 240, .4);
  border-top-color: #FBF6F0;
  border-radius: 0;
  animation: btn-spin .6s steps(8, end) infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
.login-submit.is-busy .btn-label,
.login-submit.is-busy .btn-arrow { display: none; }

/* ── 页脚 ── */
.login .site-foot {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px 24px 32px;
  color: #8A8177;
}
.login .site-foot a { color: #8A8177; }
.login .site-foot a:hover { color: var(--ink); }
