/* ==========================================================
   DipuOne SCADA — 登录页专用样式
   ========================================================== */

/* ---------- 页面基础 ---------- */
html, body {
  min-height: 100vh;
  overflow-x: hidden;
}
body {
  background:
    radial-gradient(ellipse 70% 60% at 30% 20%, rgba(34,211,238,0.10), transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(52,211,153,0.05), transparent 60%),
    var(--bg-void);
}

/* ---------- 四角装饰 ---------- */
.page-corner {
  position: fixed;
  width: 24px; height: 24px;
  pointer-events: none;
  z-index: 10;
}
.page-corner.top-left    { top: 16px; left: 16px;  border-top: 2px solid var(--cyan-500); border-left: 2px solid var(--cyan-500); }
.page-corner.top-right   { top: 16px; right: 16px; border-top: 2px solid var(--cyan-500); border-right: 2px solid var(--cyan-500); }
.page-corner.bottom-left { bottom: 16px; left: 16px;  border-bottom: 2px solid var(--cyan-500); border-left: 2px solid var(--cyan-500); }
.page-corner.bottom-right{ bottom: 16px; right: 16px; border-bottom: 2px solid var(--cyan-500); border-right: 2px solid var(--cyan-500); }

/* ---------- 顶部状态栏 ---------- */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line-hair);
  background: linear-gradient(180deg, rgba(5,16,28,0.9), rgba(5,16,28,0.4));
  backdrop-filter: blur(8px);
  z-index: 5;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--cyan-500);
}
.brand-name {
  font-family: var(--f-display);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.12em;
}
.brand-sub {
  font-size: 11px; color: var(--text-tertiary);
  letter-spacing: 0.04em;
  padding-left: 10px;
  border-left: 1px solid var(--line-hair);
}
.top-stats {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
}
.stat-item {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary);
}
.stat-item .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.stat-item .dot.online {
  background: var(--green-500);
  box-shadow: 0 0 6px var(--green-glow);
}
.stat-item.version {
  color: var(--text-tertiary);
  padding: 2px 8px;
  border: 1px solid var(--line-hair);
  background: rgba(34,211,238,0.04);
}

/* ---------- 主布局 ---------- */
.login-main {
  display: grid;
  grid-template-columns: 1.05fr 420px;
  gap: 56px;
  align-items: center;
  min-height: 100vh;
  padding: 72px 48px 48px;
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
}

/* 装饰性背景：雷达 + 网格扫描 */
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.login-bg-radar {
  position: absolute;
  width: 720px;
  height: 720px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.42;
}
.login-bg-radar svg { width: 100%; height: 100%; display: block; }
.login-bg-radar .spin-ring {
  animation: rotate-ring 22s linear infinite;
  transform-origin: center;
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 360px at 50% 50%, transparent 0%, rgba(5,16,28,0.55) 70%, rgba(5,16,28,0.85) 100%);
  pointer-events: none;
}

/* ---------- 左侧品牌区 ---------- */
.brand-section {
  display: block;
  position: relative;
  z-index: 1;
}
.brand-content {
  width: 100%;
}
/* 隐藏旧版内联雷达（保留 CSS 选择器，避免误用） */
.brand-section .radar-deco { display: none; }
.hero-title.left-aligned {
  text-align: left;
  padding: 0;
}
.hero-title.left-aligned h1 {
  font-size: 36px;
  letter-spacing: 0.18em;
  gap: 16px;
}
.hero-title.left-aligned h1::before {
  width: 60px;
  background: linear-gradient(90deg, var(--cyan-500), transparent);
}
.hero-title.left-aligned h1::after { display: none; }
.hero-title.left-aligned .sub {
  text-align: left;
  margin-top: 10px;
}
.brand-desc {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}
.brand-desc p {
  display: flex; align-items: center; gap: 12px;
}
.brand-desc p::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--line-base);
}

/* 系统 KPI 小卡片 */
.system-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 40px;
}
.mini-kpi {
  padding: 14px;
  background: rgba(34,211,238,0.04);
  border: 1px solid var(--line-hair);
  border-left: 2px solid var(--cyan-500);
  position: relative;
}
.mini-kpi::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 16px; height: 16px;
  border-top: 1px solid var(--cyan-500);
  border-right: 1px solid var(--cyan-500);
  opacity: 0.4;
}
.mk-label {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mk-value {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--cyan-300);
  line-height: 1;
  text-shadow: 0 0 10px var(--cyan-glow);
}
.mk-unit {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: 4px;
  text-shadow: none;
}

/* 装饰雷达（旧 inline 用，已不再启用） */
.radar-deco { display: none; }

/* ---------- 实时认证日志 ---------- */
/* 系统能力卡片 */
.capability-grid {
  margin-top: 28px;
  padding: 14px 16px 14px;
  background: linear-gradient(180deg, rgba(34,211,238,0.05), rgba(12,29,46,0.45));
  border: 1px solid var(--line-hair);
  position: relative;
}
.capability-grid::before,
.capability-grid::after {
  content: '';
  position: absolute;
  width: 16px; height: 1px;
  background: var(--cyan-500);
  box-shadow: 0 0 4px var(--cyan-glow);
}
.capability-grid::before { top: -1px; left: -1px; }
.capability-grid::after  { bottom: -1px; right: -1px; }
.cap-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--line-hair);
}
.cap-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-family: var(--f-display);
}
.cap-en {
  color: var(--cyan-400);
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 600;
  font-family: var(--f-mono);
}
.cap-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.cap-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  position: relative;
  transition: background 200ms;
}
.cap-card::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--cyan-500);
  box-shadow: 0 0 4px var(--cyan-glow);
  transition: height 220ms, top 220ms;
  transform: translateY(-50%);
}
.cap-card:hover::before { height: 70%; }
.cap-card:hover { background: rgba(34,211,238,0.04); }
.cap-icon {
  flex: none;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  background: rgba(5,16,28,0.6);
  color: var(--cyan-400);
}
.cap-icon svg { width: 16px; height: 16px; }
.cap-text { flex: 1; min-width: 0; }
.cap-name {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--f-display);
  margin-bottom: 2px;
}
.cap-desc {
  color: var(--text-tertiary);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ---------- 服务健康状态 ---------- */
.service-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.srv-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 14px;
  border: 1px solid var(--line-hair);
  background: linear-gradient(90deg, rgba(34,211,238,0.06), transparent);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  position: relative;
}
.srv-pill::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 60%;
  transform: translateY(-50%);
  background: var(--green-500);
  box-shadow: 0 0 4px var(--green-glow);
}
.srv-led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 6px var(--green-glow);
  animation: pulse-glow 2.4s ease-in-out infinite;
  flex: none;
}
.srv-name {
  color: var(--text-primary);
  font-size: 11px;
  letter-spacing: 0.04em;
  font-family: 'Inter', system-ui, sans-serif;
}
.srv-en {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  font-weight: 600;
}

/* ---------- 右侧登录区 ---------- */
.login-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.login-card {
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.login-card .panel-inner {
  padding: 26px 24px 18px;
}

/* ---------- 登录方式切换 ---------- */
.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--line-soft);
  background: var(--bg-surface);
}
.login-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 0;
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.04em;
  position: relative;
  transition: all 180ms;
}
.login-tab + .login-tab { border-left: 1px solid var(--line-hair); }
.login-tab:hover { color: var(--text-primary); background: rgba(34,211,238,0.06); }
.login-tab.active {
  background: rgba(34,211,238,0.15);
  color: var(--cyan-300);
  box-shadow: inset 0 0 16px rgba(34,211,238,0.12);
}
.login-tab svg { flex-shrink: 0; }

/* ---------- 表单 ---------- */
.login-form.hidden { display: none; }
.form-group { margin-bottom: 18px; }
.form-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.form-label svg { color: var(--cyan-500); }

.input-group {
  position: relative;
  display: flex; align-items: center;
  border: 1px solid var(--line-base);
  background: rgba(5,16,28,0.6);
  transition: all 180ms;
}
.input-group:focus-within {
  border-color: var(--cyan-500);
  box-shadow: var(--glow-cyan-sm);
}
.input-group .input {
  border: none;
  background: transparent;
  flex: 1;
  padding: 9px 12px;
}
.toggle-pwd {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0 10px;
  display: inline-flex; align-items: center;
  transition: color 180ms;
}
.toggle-pwd:hover { color: var(--cyan-400); }

.form-options {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  font-size: 11px;
}
.checkbox-label {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}
.checkbox-label input { display: none; }
.check-box {
  width: 14px; height: 14px;
  border: 1px solid var(--line-base);
  background: rgba(5,16,28,0.6);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 180ms;
}
.check-box::after {
  content: '';
  width: 6px; height: 6px;
  background: var(--cyan-500);
  opacity: 0;
  transition: opacity 180ms;
}
.checkbox-label input:checked + .check-box {
  border-color: var(--cyan-500);
  box-shadow: var(--glow-cyan-sm);
}
.checkbox-label input:checked + .check-box::after { opacity: 1; }
.check-text { font-size: 11px; }
.forgot-link {
  color: var(--cyan-400);
  text-decoration: none;
  font-size: 11px;
  transition: color 180ms;
}
.forgot-link:hover { color: var(--cyan-300); text-decoration: underline; }

.login-submit {
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 0.08em;
  justify-content: center;
}

/* ---------- 钉钉扫码区域 ---------- */
.qr-area {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0;
}
.qr-frame {
  position: relative;
  width: 180px; height: 180px;
  border: 1px solid var(--line-soft);
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
}
.qr-frame::before,
.qr-frame::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--cyan-500);
}
.qr-frame::before  { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.qr-frame::after   { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.qr-svg { display: block; }

.qr-tip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.qr-tip strong {
  color: var(--cyan-300);
  font-weight: 500;
}
.qr-tip svg { color: var(--cyan-500); flex-shrink: 0; }

.qr-timer {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.timer-count {
  color: var(--cyan-300);
  font-weight: 500;
  min-width: 22px;
  text-align: center;
}
.refresh-qr {
  margin-left: 4px;
}

.dingtalk-info .info-text {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.7;
  text-align: center;
}
.dingtalk-info .info-text.small {
  margin-top: 4px;
}
.dingtalk-info .info-text a {
  color: var(--cyan-400);
  text-decoration: none;
}
.dingtalk-info .info-text a:hover { text-decoration: underline; }

/* ---------- 页脚 ---------- */
.login-footer {
  margin-top: 20px;
}
.footer-links {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 11px;
  margin-bottom: 8px;
}
.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 180ms;
}
.footer-links a:hover { color: var(--cyan-400); }
.footer-links .sep { color: var(--line-hair); }
.footer-copy {
  text-align: center;
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}

/* ---------- Hero Eyebrow ---------- */
.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan-400);
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.eyebrow-tick {
  width: 28px; height: 1px;
  background: var(--cyan-500);
  box-shadow: var(--glow-cyan-sm);
  position: relative;
}
.eyebrow-tick::after {
  content: '';
  position: absolute;
  right: -3px; top: -2px;
  width: 5px; height: 5px;
  background: var(--cyan-500);
  box-shadow: 0 0 6px var(--cyan-glow);
  transform: rotate(45deg);
}

/* ---------- 安全连接条 ---------- */
.secure-bar {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 auto 12px;
  border: 1px solid var(--line-base);
  background:
    linear-gradient(90deg, rgba(52,211,153,0.08), rgba(34,211,238,0.04));
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.sb-icon {
  display: inline-flex;
  color: var(--green-500);
}
.sb-label {
  color: var(--green-500);
  font-weight: 600;
}
.sb-divider {
  width: 1px; height: 12px;
  background: var(--line-soft);
  margin: 0 2px;
}
.sb-tech {
  flex: 1;
  color: var(--text-tertiary);
  font-size: 9px;
  letter-spacing: 0.12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-status {
  color: var(--cyan-300);
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 500;
}
.sb-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 4px var(--green-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ---------- 卡片扫描线动画 ---------- */
.login-card { position: relative; }
.panel-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.panel-scan::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(34,211,238,0.5) 30%,
    var(--cyan-300) 50%,
    rgba(34,211,238,0.5) 70%,
    transparent);
  box-shadow: 0 0 8px var(--cyan-glow);
  animation: panel-scan-y 6s linear infinite;
}
@keyframes panel-scan-y {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(420px); opacity: 0; }
}
.panel-inner { position: relative; z-index: 2; }

/* ---------- 登录步骤指示 ---------- */
.login-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 4px 4px;
  position: relative;
}
.ls-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
  position: relative;
}
.ls-num {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border: 1px solid var(--line-soft);
  background: var(--bg-base);
  position: relative;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.ls-step.active .ls-num {
  color: var(--cyan-300);
  border-color: var(--cyan-500);
  background: rgba(34,211,238,0.12);
  box-shadow: var(--glow-cyan-sm);
}
.ls-text {
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
  color: var(--text-secondary);
}
.ls-text i {
  font-style: normal;
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}
.ls-step.active .ls-text { color: var(--text-primary); }
.ls-step.active .ls-text i { color: var(--cyan-400); }
.ls-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-hair), var(--line-soft), var(--line-hair));
  margin: 0 8px;
  position: relative;
  align-self: flex-start;
  margin-top: 13px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .login-main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 80px;
  }
  .brand-section { flex-direction: column; text-align: center; }
  .hero-title.left-aligned { text-align: center; }
  .hero-title.left-aligned h1::before { display: none; }
  .hero-title.left-aligned .sub { text-align: center; }
  .brand-desc p { justify-content: center; }
  .brand-desc p::before { display: none; }
  .system-kpis { max-width: 480px; margin-left: auto; margin-right: auto; }
  .radar-deco { display: none; }
  .login-section { order: -1; }
  .hero-eyebrow { justify-content: center; }
}
@media (max-width: 520px) {
  .login-main { padding: 70px 12px 20px; }
  .top-bar { padding: 8px 12px; }
  .brand-sub { display: none; }
  .top-stats { gap: 8px; font-size: 10px; }
  .stat-item.version { display: none; }
  .system-kpis { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .mini-kpi { padding: 8px; }
  .mk-label { font-size: 9px; }
  .mk-value { font-size: 13px; }
  .login-card .panel-inner { padding: 20px 16px 16px; }
  .login-steps .ls-text i { display: none; }
  .login-steps .ls-num { font-size: 11px; }
  .secure-bar { padding: 6px 10px; gap: 6px; }
  .secure-bar .sb-tech { display: none; }
  .secure-bar .sb-divider { display: none; }
  .hero-eyebrow { font-size: 10px; }
  .hero-title h1 { font-size: 32px; }
  .hero-title .sub { font-size: 12px; }
  .brand-desc p { font-size: 12px; }
  .capability-grid { padding: 10px 12px; margin-top: 18px; }
  .cap-cards { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .cap-card { padding: 6px 4px; }
  .cap-icon { width: 26px; height: 26px; }
  .cap-icon svg { width: 14px; height: 14px; }
  .cap-name { font-size: 11px; }
  .cap-desc { font-size: 9px; }
  .service-status { gap: 6px; flex-wrap: wrap; }
  .srv-pill { font-size: 10px; padding: 4px 8px; }
  /* 二维码区调整 */
  .qr-frame, #dingtalk-qr-container { max-width: 100%; }
  .footer-links { font-size: 10px; gap: 6px; flex-wrap: wrap; justify-content: center; }
}

/* 极窄屏（<= 360px）进一步压缩 */
@media (max-width: 360px) {
  .system-kpis { grid-template-columns: 1fr 1fr; }
  .cap-cards { grid-template-columns: 1fr; }
  .hero-title h1 { font-size: 28px; }
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .radar-deco .spin-ring,
  .scan-line::after {
    animation: none !important;
  }
}
