/* ============================================================
   登录页「大屏门厅」设计系统 (auth-screen.css)
   适用：login.html（独立文件；auth-ticket.css 留作回滚不引用）
   方向：登录页是驾驶舱的门厅——满版深空数据场 + 居中大标题带 + 登录卡
   同源：全部引 variables.css 令牌（--surface/--text/--color-primary），
        色板（emerald/amber/…）与明暗主题自动跟随，和大屏/业务页完全一致
   控件语法 = cockpit.css：卡片 12px · 按钮/输入 8px · 徽章 pill · KPI 式层级
   动效手感：数据场——入场"点亮"，聚焦"通电"，提交"加载"
   ============================================================ */

/* ---------- 场景 ---------- */
.bs-scene {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 32px;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

/* ---------- 背景数据场：网格 + 弧线 + 光点 ---------- */
.bs-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  animation: bs-fade 0.5s ease-out both;
}

.bs-grid {
  position: absolute;
  inset: 0;
  opacity: 0.5; /* 实景之上网格再退半档，避免噪线 */
  background-image:
    linear-gradient(to right, rgba(148, 197, 255, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 197, 255, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 105% 95% at 50% 42%, #000 42%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 105% 95% at 50% 42%, #000 42%, transparent 100%);
}

/* ---------- 实景垫底：暮色中的图书馆（来源 hzu.edu.cn，本地 login-bg.jpg） ---------- */
.bs-photo {
  position: absolute;
  inset: 0;
  background: url("../images/login-bg.jpg") center 62% / cover no-repeat;
  filter: saturate(0.72) brightness(0.8) blur(2.5px);
  transform: scale(1.045); /* 藏住虚化边缘 */
}
.bs-photo::after {
  content: "";
  position: absolute;
  inset: -8px; /* 抵消 scale 边缘 */
}
/* 暗色：墨蓝压暗成"暮色馆舍"——画面必须退后，只留建筑轮廓 */
[data-theme="dark"] .bs-photo::after {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.9) 0%,
    rgba(15, 23, 42, 0.72) 30%,
    rgba(15, 23, 42, 0.68) 58%,
    rgba(15, 23, 42, 0.88) 100%
  );
}
/* 浅色：白纱提亮降存在感，深色文字照常可读 */
[data-theme="light"] .bs-photo::after {
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0.9) 0%,
    rgba(248, 250, 252, 0.7) 30%,
    rgba(248, 250, 252, 0.74) 58%,
    rgba(248, 250, 252, 0.92) 100%
  );
}
[data-theme="light"] .bs-photo { filter: saturate(0.7) brightness(1.08) blur(2.5px); }
[data-theme="light"] .bs-grid,
:not([data-theme="dark"]) .bs-grid {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
}

/* 深空辉光：暗色下的两团环境光（大气的底），跟随色板主色；::after 保证叠在实景之上 */
[data-theme="dark"] .bs-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(14, 165, 233, 0.10), transparent 65%),
    radial-gradient(820px 560px at 12% 108%, color-mix(in srgb, var(--color-primary, #059669) 12%, transparent), transparent 65%);
}
[data-theme="dark"] .bs-grid {
  background-image:
    linear-gradient(to right, rgba(148, 197, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 197, 255, 0.05) 1px, transparent 1px);
}

.bs-arcs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* 标题带内对弧线做减淡，避免噪线穿过文字 */
  mask-image: linear-gradient(to bottom, #000 14%, rgba(0, 0, 0, 0.3) 22%, rgba(0, 0, 0, 0.3) 38%, #000 50%);
  -webkit-mask-image: linear-gradient(to bottom, #000 14%, rgba(0, 0, 0, 0.3) 22%, rgba(0, 0, 0, 0.3) 38%, #000 50%);
}
.bs-arcs .bs-arc--primary { stroke: color-mix(in srgb, var(--color-primary, #059669) 62%, transparent); }
.bs-arcs .bs-ticks { stroke: color-mix(in srgb, var(--color-primary, #059669) 45%, transparent); }
[data-theme="dark"] .bs-arcs .bs-arc--primary { stroke: color-mix(in srgb, var(--color-primary, #059669) 75%, transparent); }
[data-theme="dark"] .bs-arcs .bs-arc--sky { stroke: rgba(14, 165, 233, 0.34); }
[data-theme="dark"] .bs-arcs .bs-ticks { stroke: color-mix(in srgb, var(--color-primary, #059669) 55%, transparent); }
[data-theme="light"] .bs-arcs ellipse { stroke-opacity: 0.55; }

.bs-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: bs-breathe 5s ease-in-out infinite;
}
/* 光点布在弧线上，避开中央内容带 */
.bs-dot--1 {
  left: 18%; top: 48%;
  background: #0EA5E9;
  box-shadow: 0 0 12px 2px rgba(14, 165, 233, 0.55);
}
.bs-dot--2 {
  left: 80%; top: 58%;
  background: var(--color-primary, #059669);
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--color-primary, #059669) 55%, transparent);
  animation-delay: 1.6s;
}
.bs-dot--3 {
  left: 14%; top: 40%;
  width: 4px; height: 4px;
  background: #8B5CF6;
  box-shadow: 0 0 10px 2px rgba(139, 92, 246, 0.5);
  animation-delay: 3.2s;
}
[data-theme="light"] .bs-dot { opacity: 0.7; }

/* ---------- 主题切换 ---------- */
.bs-theme-toggle {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--surface-1);
  border: 1px solid var(--surface-3);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.bs-theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---------- 标题带 ---------- */
.bs-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 40px;
}

.bs-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(var(--primary-rgb, 5, 150, 105), 0.12);
  border: 1px solid rgba(var(--primary-rgb, 5, 150, 105), 0.3);
  color: var(--color-primary, #059669);
  animation: bs-rise 0.45s var(--bs-ease, cubic-bezier(0.2, 0.7, 0.3, 1)) 0.08s both;
}
.bs-logo svg { width: 34px; height: 34px; }

.bs-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 20px;
}

.bs-title {
  margin: 0;
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  line-height: 1.15;
  color: var(--text-primary);
  animation: bs-title-in 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) 0.14s both;
}

/* 演示版标记：danger 令牌，红角标最醒目 */
.bs-demo {
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  line-height: 22px;
  color: var(--color-danger, #EF4444);
  background: color-mix(in srgb, var(--color-danger, #EF4444) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-danger, #EF4444) 45%, transparent);
  animation: bs-rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.22s both;
}

.bs-en {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--text-muted);
  white-space: nowrap;
  animation: bs-rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.2s both;
}

.bs-slogan {
  margin: 14px 0 0;
  font-size: 13.5px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--text-secondary);
  animation: bs-rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.24s both;
}

.bs-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-primary, #059669);
  background: rgba(var(--primary-rgb, 5, 150, 105), 0.12);
  border: 1px solid rgba(var(--primary-rgb, 5, 150, 105), 0.3);
  animation: bs-rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.28s both;
}
/* 徽章状态点：系统在线的呼吸 */
.bs-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: bs-online 2.6s ease-in-out infinite;
}

/* ---------- 登录卡（cockpit KPI 卡语法） ---------- */
.bs-card {
  position: relative;
  z-index: 1;
  width: min(404px, 100%);
  background: var(--surface-1);
  border: 1px solid var(--surface-3);
  border-radius: 12px;
  padding: 30px 34px 28px;
  box-shadow: 0 24px 64px -28px rgba(2, 8, 23, 0.55);
  animation: bs-rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.32s both;
}
[data-theme="light"] .bs-card { box-shadow: 0 16px 48px -20px rgba(15, 23, 42, 0.14); }

/* 顶部数据线：主色单色系统线（舱口基准线），上有周期扫过的数据光段 */
.bs-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  right: 28px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary, #059669) 50%, transparent);
  opacity: 0.9;
}
.bs-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  opacity: 0;
  animation: bs-glint 5.2s cubic-bezier(0.4, 0, 0.2, 1) 2.2s infinite;
}

.bs-cardtitle {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

/* ---------- flash 提示 ---------- */
.bs-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid;
  border-left-width: 3px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  animation: bs-alert-in 0.22s ease-out both;
}
.bs-alert svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.bs-alert--danger  { background: rgba(239, 68, 68, 0.10);  border-color: rgba(239, 68, 68, 0.45);  color: #F87171; }
.bs-alert--success { background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.45); color: #34D399; }
.bs-alert--info    { background: rgba(59, 130, 246, 0.10); border-color: rgba(59, 130, 246, 0.45); color: #60A5FA; }
.bs-alert--warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.5);  color: #FBBF24; }
[data-theme="light"] .bs-alert--danger  { background: #FEF2F2; border-color: rgba(220, 38, 38, 0.35);  color: #B91C1C; }
[data-theme="light"] .bs-alert--success { background: #ECFDF5; border-color: rgba(5, 150, 105, 0.35);  color: #047857; }
[data-theme="light"] .bs-alert--info    { background: #EFF6FF; border-color: rgba(37, 99, 235, 0.35);  color: #1D4ED8; }
[data-theme="light"] .bs-alert--warning { background: #FFFBEB; border-color: rgba(217, 119, 6, 0.4);   color: #92400E; }

/* ---------- 表单（通电语法：聚焦亮起主色描边） ---------- */
.bs-form { margin-top: 2px; }

.bs-field + .bs-field { margin-top: 16px; }

.bs-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.bs-input {
  display: block;
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-0);
  border: 1px solid var(--surface-3);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bs-input::placeholder { color: var(--text-muted); }
.bs-input:focus {
  border-color: var(--color-primary, #059669);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 5, 150, 105), 0.14);
}
.bs-field:focus-within .bs-label { color: var(--color-primary, #059669); }
.bs-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--surface-0) inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
}

/* ---------- 按钮（cockpit 主按钮语法 + 悬停扫光） ---------- */
.bs-btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 12px 16px;
  background: var(--color-primary, #059669);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.bs-btn::before {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 34%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}
.bs-btn:hover { background: var(--color-primary-hover, #047857); }
.bs-btn:hover::before { animation: bs-sheen 0.7s ease; }
.bs-btn:active { transform: scale(0.985); }
.bs-btn:focus-visible,
.bs-link:focus-visible,
.bs-theme-toggle:focus-visible {
  outline: 2px solid var(--color-primary, #059669);
  outline-offset: 2px;
}

/* 提交加载态：文字淡出、spinner 接管（数据加载语法） */
.bs-btn--submit.is-loading {
  color: transparent;
  pointer-events: none;
}
.bs-btn--submit.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bs-spin 0.7s linear infinite;
}

/* ---------- 票脚提示 ---------- */
.bs-casnote {
  margin: 4px 0 2px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.bs-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.bs-link {
  color: var(--color-primary, #059669);
  text-decoration: none;
  transition: opacity 0.15s;
}
.bs-link:hover { opacity: 0.85; text-decoration: underline; }

/* ---------- 三栏特色（KPI 带语法：编号索引 + 界格分隔） ---------- */
.bs-feats {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  animation: bs-rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.42s both;
}
.bs-feat { padding: 2px 22px; border-left: 1px solid var(--surface-3); }
.bs-feat:first-child { border-left: none; padding-left: 0; }
.bs-feat__no {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--color-primary, #059669);
  font-variant-numeric: tabular-nums;
}
.bs-feat__title {
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.bs-feat__desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 动效 ---------- */
@keyframes bs-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bs-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bs-alert-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bs-breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.25); }
}
@keyframes bs-spin {
  to { transform: rotate(360deg); }
}
@keyframes bs-online {
  0%, 100% { opacity: 0.55; box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 5, 150, 105), 0.4); }
  50%      { opacity: 1;    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 5, 150, 105), 0); }
}
@keyframes bs-glint {
  0%   { transform: translateX(0);        opacity: 0; }
  8%   { opacity: 0.9; }
  42%  { transform: translateX(560%);     opacity: 0; }
  100% { transform: translateX(560%);     opacity: 0; }
}
@keyframes bs-sheen {
  from { transform: translateX(-120%) skewX(-18deg); }
  to   { transform: translateX(460%)  skewX(-18deg); }
}
/* 弧线能量脉冲：光段沿弧线流向舱口（主弧 13s / 天青弧 21s） */
.bs-pulse {
  fill: none;
  stroke-dasharray: 150 4250;
  stroke-dashoffset: 0;
  opacity: 0;
}
.bs-pulse--a {
  stroke: color-mix(in srgb, var(--color-primary, #059669) 90%, transparent);
  animation: bs-flow-a 13s linear infinite 2s;
}
.bs-pulse--b {
  stroke: rgba(14, 165, 233, 0.85);
  stroke-dasharray: 120 5190;
  animation: bs-flow-b 21s linear infinite 7s;
}
[data-theme="light"] .bs-pulse { opacity: 1; }
[data-theme="light"] .bs-pulse--a { stroke: color-mix(in srgb, var(--color-primary, #059669) 65%, transparent); }
[data-theme="light"] .bs-pulse--b { stroke: rgba(14, 165, 233, 0.55); }
@keyframes bs-flow-a { from { stroke-dashoffset: 4400; opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes bs-flow-b { from { stroke-dashoffset: 5310; opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }

/* 标题入场：字距由松到紧的"落定"（仪式感） */
.bs-title {
  animation-name: bs-title-in;
  animation-duration: 0.55s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  animation-delay: 0.14s;
  animation-fill-mode: both;
}
@keyframes bs-title-in {
  from { opacity: 0; transform: translateY(14px); letter-spacing: 0.26em; }
  to   { opacity: 1; transform: translateY(0);    letter-spacing: 0.14em; }
}

@media (prefers-reduced-motion: reduce) {
  .bs-bg, .bs-logo, .bs-title, .bs-demo, .bs-en, .bs-slogan, .bs-badge, .bs-card,
  .bs-feats, .bs-alert {
    animation: none;
  }
  .bs-dot, .bs-pulse, .bs-card::after, .bs-btn::before, .bs-badge::before { animation: none; }
  .bs-btn::before { display: none; }
  .bs-btn--submit.is-loading::after { animation-duration: 1.2s; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .bs-scene { padding: 44px 20px 24px; }
  .bs-theme-toggle { top: 16px; right: 16px; }
  .bs-hero { margin-bottom: 30px; }
  .bs-logo { width: 52px; height: 52px; }
  .bs-title { font-size: 36px; }
  .bs-en { letter-spacing: 0.24em; text-indent: 0.24em; white-space: normal; }
  .bs-card { padding: 26px 22px 24px; }
  .bs-card::before { left: 20px; right: 20px; }
  /* 移动端光点重布：避开徽章行与卡片 */
  .bs-dot--1 { left: 7%; top: 62%; }
  .bs-dot--2 { left: 88%; top: 22%; }
  .bs-dot--3 { display: none; }

  /* 三栏特色改单列安静清单 */
  .bs-feats { grid-template-columns: 1fr; width: min(404px, 100%); margin-top: 26px; }
  .bs-feat {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 9px 2px;
    border-left: none;
    border-top: 1px solid var(--surface-3);
  }
  .bs-feat:first-child { border-top: none; padding-top: 0; }
  .bs-feat__title { margin: 0; }
  .bs-feat__desc { margin: 0; }
}
