/* ==========================================================================
   烟花欢迎页 —— 样式
   深色夜空 + 烟花 + 城市天际线，数据卡片毛玻璃质感
   ========================================================================== */

.fw-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.fw-skyline {
  position: fixed;
  left: 0; bottom: 0;
  width: 100%;
  height: 190px;
  z-index: 2;
  pointer-events: none;
}

.fw-ripple-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.firework-body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #050B18;
  color: #E8EEF7;
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.firework-body::before {
  /* 夜空渐层 */
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, #1B3B66 0%, transparent 60%),
    linear-gradient(180deg, #071228 0%, #0B1D3A 40%, #123055 75%, #1A4470 100%);
}

/* ---------- 内容层 ---------- */
.fw-wrap {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 32px;
}

/* ==================== 顶部状态条 ==================== */
.fw-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-wrap: wrap;
  gap: 12px;
}

.fw-brand { display: flex; align-items: center; gap: 12px; }
.fw-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #E8A020, #F5C86A);
  color: #071228;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  box-shadow: 0 4px 18px rgba(232, 160, 32, .32);
}
.fw-brand-txt { display: flex; flex-direction: column; line-height: 1.3; }
.fw-brand-txt b { font-size: 16px; color: #fff; font-weight: 600; }
.fw-brand-txt i {
  font-size: 10.5px; color: #7A93AB;
  font-style: normal; letter-spacing: .8px; text-transform: uppercase;
}

.fw-topbar-right { display: flex; align-items: center; gap: 22px; }

.fw-db-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  padding: 5px 13px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #C0D0E0;
}
.fw-db-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #1E9E6A;
  box-shadow: 0 0 8px #1E9E6A;
  animation: dbPulse 2.2s ease-in-out infinite;
}
.fw-db-chip.bad .dot { background: #D64545; box-shadow: 0 0 8px #D64545; }
.fw-db-chip.bad { color: #F5A9A9; border-color: rgba(214, 69, 69, .35); }

/* 演示模式标识（琥珀色，和正常状态区分开） */
.fw-db-chip.demo .dot {
  background: #E8A020;
  box-shadow: 0 0 8px #E8A020;
}
.fw-db-chip.demo {
  color: #FFD98A;
  border-color: rgba(232, 160, 32, .45);
  background: rgba(232, 160, 32, .12);
}

@keyframes dbPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.fw-link { color: #9FB6CC; font-size: 13px; text-decoration: none; transition: color .2s; }
.fw-link:hover { color: #E8A020; text-decoration: none; }

.fw-user { display: flex; align-items: center; gap: 10px; }
.fw-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 600;
  border: 1.5px solid rgba(255, 255, 255, .16);
}
.fw-user-txt { display: flex; flex-direction: column; line-height: 1.3; }
.fw-user-txt b { font-size: 13.5px; color: #fff; font-weight: 600; }
.fw-user-txt i { font-size: 11.5px; color: #7A93AB; font-style: normal; }

/* ==================== 主视觉 ==================== */
.fw-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.fw-hero { text-align: center; max-width: 860px; }

/* 成功对勾（描边动画） */
.fw-check { margin: 0 auto 26px; animation: fwCheckIn .8s cubic-bezier(.34, 1.56, .64, 1) both; }
.fw-check svg { display: block; margin: 0 auto; }
.fw-check-circle {
  stroke-dasharray: 152;
  stroke-dashoffset: 152;
  animation: fwDash .8s .1s ease-out forwards;
}
.fw-check-mark {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: fwDash .45s .65s ease-out forwards;
}

@keyframes fwCheckIn {
  from { opacity: 0; transform: scale(.6) rotate(-14deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes fwDash { to { stroke-dashoffset: 0; } }

/* 主文案 —— 渐变发光 + 逐字浮现 */
.fw-title {
  font-size: 48px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 20px;
  background: linear-gradient(100deg, #FFD98A 0%, #FFFFFF 32%, #FFD98A 60%, #F5A84A 100%);
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fwShimmer 5s linear infinite;
  text-shadow: 0 0 46px rgba(232, 160, 32, .22);
}
@keyframes fwShimmer {
  to { background-position: 240% center; }
}

.fw-subtitle {
  font-size: 16px;
  color: #A9C0D6;
  margin-bottom: 14px;
}
.fw-subtitle b { color: #FFD98A; font-weight: 600; }

.fw-db-warn {
  display: inline-block;
  background: rgba(214, 69, 69, .14);
  border: 1px solid rgba(214, 69, 69, .38);
  color: #F5B8B8;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
}
.fw-db-warn.demo {
  background: rgba(232, 160, 32, .14);
  border-color: rgba(232, 160, 32, .42);
  color: #FFD98A;
}

/* ---------- 数据总览卡 ---------- */
.fw-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 36px 0 30px;
}

.fw-stat {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 6px;
  padding: 22px 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all .3s;
  animation: fwFloatUp .7s ease-out both;
}
.fw-stat:hover {
  background: rgba(232, 160, 32, .1);
  border-color: rgba(232, 160, 32, .45);
  transform: translateY(-4px);
}
.fw-stat:nth-child(1) { animation-delay: .15s; }
.fw-stat:nth-child(2) { animation-delay: .25s; }
.fw-stat:nth-child(3) { animation-delay: .35s; }
.fw-stat:nth-child(4) { animation-delay: .45s; }

@keyframes fwFloatUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fw-stat-num {
  display: block;
  font-size: 33px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  font-family: "DIN Alternate", Consolas, monospace;
  text-shadow: 0 0 22px rgba(232, 160, 32, .3);
}
.fw-stat-label {
  display: block;
  font-size: 13px;
  color: #8FA8C0;
  margin-top: 7px;
}

/* ---------- 近 7 日柱状图 ---------- */
.fw-chart {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  padding: 22px 26px 20px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fwFloatUp .7s .55s ease-out both;
}
.fw-chart-title {
  font-size: 13.5px;
  color: #8FA8C0;
  text-align: left;
  margin-bottom: 18px;
  letter-spacing: .5px;
}
.fw-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 132px;
}
.fw-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.fw-bar-val {
  font-size: 12px;
  color: #FFD98A;
  margin-bottom: 6px;
  font-family: Consolas, monospace;
  font-weight: 600;
}
.fw-bar-track {
  width: 100%;
  max-width: 46px;
  flex: 1;
  display: flex;
  align-items: flex-end;
}
.fw-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #FFD98A, #E8A020);
  border-radius: 3px 3px 0 0;
  height: 0;
  transition: height 1.1s cubic-bezier(.2, .9, .3, 1);
  box-shadow: 0 0 16px rgba(232, 160, 32, .3);
}
.fw-bar-label {
  font-size: 11.5px;
  color: #7A93AB;
  margin-top: 9px;
}

/* ---------- 按钮 ---------- */
.fw-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fwFloatUp .7s .65s ease-out both;
}
.fw-btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 32px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .2);
  color: #D6E2EE;
  font-size: 15px;
  text-decoration: none;
  transition: all .24s;
  background: rgba(255, 255, 255, .04);
}
.fw-btn:hover {
  border-color: rgba(232, 160, 32, .6);
  color: #FFD98A;
  background: rgba(232, 160, 32, .09);
  transform: translateY(-2px);
  text-decoration: none;
}
.fw-btn-primary {
  background: linear-gradient(135deg, #E8A020, #F5A84A);
  border-color: transparent;
  color: #071228;
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(232, 160, 32, .34);
}
.fw-btn-primary:hover {
  background: linear-gradient(135deg, #F5C86A, #FFC14D);
  color: #071228;
  box-shadow: 0 10px 30px rgba(232, 160, 32, .46);
}

/* ==================== 底部 ==================== */
.fw-footbar {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 20px 0;
  animation: fwFloatUp .7s .75s ease-out both;
}
.fw-foot-title {
  font-size: 12px;
  color: #6E8699;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.fw-recent {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.fw-recent-item { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.fw-dot-ok {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #1E9E6A;
  box-shadow: 0 0 7px #1E9E6A;
  flex-shrink: 0;
}
.fw-r-name { color: #DCE7F1; }
.fw-r-meta { color: #7A93AB; font-size: 12px; font-family: Consolas, monospace; }

.fw-hint {
  text-align: center;
  color: #6E8699;
  font-size: 13px;
  padding: 16px 0 22px;
  animation: fwFloatUp .7s .85s ease-out both;
}

/* ---------- 点击涟漪 ---------- */
.fw-ripple {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 160, 32, .75);
  transform: translate(-50%, -50%);
  animation: fwRipple .95s ease-out forwards;
}
@keyframes fwRipple {
  from { width: 12px; height: 12px; opacity: 1; }
  to   { width: 190px; height: 190px; opacity: 0; }
}

/* ==================== 登录页新增样式 ==================== */
/* 数据库错误提示框 */
.alert {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.7;
}
.alert-error {
  background: #FDF0F0;
  border: 1px solid #F5CACA;
  color: #A83232;
}
.alert-warn {
  background: #FDF8EC;
  border: 1px solid #F2E0B8;
  color: #8A6520;
}
.alert-title { font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.alert-body { color: inherit; opacity: .92; }
.alert-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, .1);
  font-size: 12.5px;
  opacity: .82;
}
.alert code, .login-tips code {
  background: rgba(0, 0, 0, .06);
  border: 1px solid rgba(0, 0, 0, .09);
  padding: 1px 6px;
  border-radius: 2px;
  font-family: Consolas, monospace;
  font-size: 12px;
}

/* 演示账号表格 */
.tips-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12.5px;
}
.tips-table td {
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--gray);
}
.tips-table td:nth-child(1) {
  font-family: Consolas, monospace;
  color: var(--navy);
  font-weight: 600;
  width: 78px;
}
.tips-table td:nth-child(2) {
  font-family: Consolas, monospace;
  color: var(--steel);
  width: 120px;
}
.tips-table td:nth-child(3) { color: var(--gray-light); }

.tips-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(0, 0, 0, .1);
  font-size: 12.5px;
}
.tips-foot b { color: var(--navy); }

/* 按钮禁用态 */
.login-btn:disabled {
  background: #B8C4D0;
  cursor: not-allowed;
}
.login-btn:disabled:hover { background: #B8C4D0; }

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  .fw-stats { grid-template-columns: repeat(2, 1fr); }
  .fw-title { font-size: 32px; }
  .fw-wrap { padding: 0 20px; }
  .fw-topbar { height: auto; padding: 14px 0; }
}

@media (max-width: 560px) {
  .fw-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fw-title { font-size: 25px; }
  .fw-stat-num { font-size: 25px; }
  .fw-subtitle { font-size: 14px; }
  .fw-actions { flex-direction: column; }
  .fw-btn { width: 100%; justify-content: center; }
  .fw-chart-bars { gap: 6px; height: 110px; }
  .fw-bar-val { font-size: 10.5px; }
  .fw-recent { flex-direction: column; gap: 10px; }
  .fw-topbar-right { width: 100%; justify-content: space-between; gap: 12px; }
}

/* 尊重用户的"减少动画"系统偏好 */
@media (prefers-reduced-motion: reduce) {
  .fw-title { animation: none; }
  .fw-check, .fw-stat, .fw-chart, .fw-actions, .fw-footbar, .fw-hint {
    animation: none;
  }
  .fw-check-circle, .fw-check-mark { animation: none; stroke-dashoffset: 0; }
  .fw-db-chip .dot { animation: none; }
}
