/* =========================================================
   伟川建筑 · 登录页
   ========================================================= */

* { box-sizing: border-box; }

:root {
  --ink: #0f1c2e;
  --muted: #64748b;
  --line: #e6ebf1;
  --accent: #f59e0b;
  --navy: #0b2033;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background: #f2f5f9;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }
a { color: inherit; }
button, input { font-family: inherit; }
button { cursor: pointer; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
  min-height: 100vh;
}

/* ---------------- 左侧品牌区 ---------------- */

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 34px clamp(32px, 5vw, 76px) 30px;
  overflow: hidden;
  color: #e8f0f8;
  background:
    radial-gradient(700px 520px at 8% 8%, rgba(245, 158, 11, 0.16), transparent 62%),
    radial-gradient(620px 600px at 100% 100%, rgba(56, 189, 248, 0.12), transparent 60%),
    linear-gradient(145deg, #081b2c 0%, #0d2740 52%, #123652 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(120deg, #000 15%, transparent 78%);
  -webkit-mask-image: linear-gradient(120deg, #000 15%, transparent 78%);
  pointer-events: none;
}

.brand-glow {
  position: absolute;
  right: -140px;
  bottom: -180px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.24), transparent 65%);
  pointer-events: none;
}

.brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #142033;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 12px 26px -12px rgba(245, 158, 11, 0.85);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 19px; letter-spacing: 0.02em; }
.brand-text small { margin-top: 4px; color: #7f99b0; font-size: 10.5px; letter-spacing: 0.12em; }

.version {
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #8fa8bd;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 48px 0;
  max-width: 600px;
}

.eyebrow {
  display: inline-block;
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.brand-copy h1 {
  margin-top: 18px;
  font-size: clamp(38px, 4.4vw, 58px);
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.brand-copy h1 em {
  position: relative;
  color: #fbbf24;
  font-style: normal;
}

.brand-copy h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  z-index: -1;
}

.brand-copy > p {
  max-width: 480px;
  margin-top: 20px;
  color: rgba(214, 229, 241, 0.68);
  font-size: 14px;
  line-height: 1.85;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 26px;
  max-width: 520px;
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li { display: flex; gap: 11px; align-items: flex-start; }

.feature-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.09);
  color: #fbbf24;
  flex: none;
}

.feature-icon svg { width: 17px; height: 17px; }
.feature-list strong { display: block; color: #eaf2f9; font-size: 12.5px; font-weight: 600; }
.feature-list span { display: block; margin-top: 3px; color: #7f99b0; font-size: 10.5px; line-height: 1.6; }

.brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #5f7d96;
  font-size: 10px;
  flex-wrap: wrap;
}

/* ---------------- 右侧登录区 ---------------- */

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px clamp(24px, 4vw, 56px);
  background:
    radial-gradient(700px 500px at 100% 0%, rgba(245, 158, 11, 0.07), transparent 60%),
    #f4f6f9;
}

.login-card { width: min(410px, 100%); }

.mobile-brand { display: none; }

.login-kicker {
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.login-card h2 {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.login-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

#login-form { margin-top: 28px; }

.login-field { display: block; margin-bottom: 16px; }
.login-field > span {
  display: block;
  margin-bottom: 7px;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
}

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

.login-field input::placeholder { color: #b3c0cf; }
.login-field input:focus { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.13); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  transform: translateY(-50%);
}

.password-toggle:hover { background: #f1f5f9; color: #475569; }
.password-toggle svg { width: 17px; height: 17px; }

.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #17243a;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 26px -12px rgba(245, 158, 11, 0.85);
  transition: transform 0.16s, box-shadow 0.16s, opacity 0.16s;
}

.login-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(245, 158, 11, 0.9); }
.login-submit:disabled { opacity: 0.65; cursor: wait; }
.login-submit svg { width: 17px; height: 17px; }

.demo-box {
  margin-top: 26px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.68);
}

.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.demo-head strong { color: #334155; font-size: 11.5px; font-weight: 650; }
.demo-head span { color: #94a3b8; font-size: 10px; }

.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }

.demo-account {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.demo-account:hover { border-color: #fcd34d; background: #fffdf7; transform: translateY(-1px); }
.demo-role { color: #b45309; font-size: 9px; font-weight: 650; letter-spacing: 0.03em; }
.demo-account strong { color: #1e293b; font-size: 11.5px; font-weight: 650; }
.demo-account small { color: #94a3b8; font-size: 9.5px; }
.demo-admin { grid-column: span 2; flex-direction: row; align-items: center; gap: 8px; }
.demo-admin strong { margin-left: 2px; }
.demo-admin small { margin-left: auto; }

.login-foot {
  margin-top: 18px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1020px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 22px; }
  .mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
  .mobile-brand .brand-mark { width: 42px; height: 42px; font-size: 20px; }
  .mobile-brand strong { display: block; font-size: 17px; }
  .mobile-brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
  .login-card { width: min(430px, 100%); }
}

@media (max-width: 520px) {
  .login-panel { align-items: flex-start; padding-top: 26px; }
  .login-card h2 { font-size: 24px; }
  .feature-list { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-admin { grid-column: auto; }
  .demo-account { flex-direction: row; align-items: center; gap: 8px; }
  .demo-account small { margin-left: auto; }
}

/* ---------------- 钉钉免登入口：默认 hidden，由 login.js 按后端配置显示 ---------------- */
.dingtalk-entry { margin-top: 18px; }
.dingtalk-entry[hidden] { display: none; }
.dingtalk-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}
.dingtalk-divider::before,
.dingtalk-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.dingtalk-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: #1677ff;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}
.dingtalk-button:hover { background: #0f5fd8; }
.dingtalk-button:active { background: #0d4fb3; }
.dingtalk-button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.dingtalk-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
