/* ===== 反诈互动系统 公共样式基线 ===== */
:root {
  --blue-900: #071c3e;
  --blue-700: #0a2a5e;
  --blue-600: #114a9e;
  --blue-500: #1d6ae5;
  --gold: #ffb703;
  --gold-deep: #f77f00;
  --red: #e63946;
  --green: #2a9d8f;
  --ink: #16233a;
  --line: #e3e9f2;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(10, 42, 94, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; font-weight: 600; transition: transform .06s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--blue-500), var(--blue-600)); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #5a3200; }
.btn-green { background: linear-gradient(135deg, #2fbf9d, var(--green)); color: #fff; }
.btn-red { background: linear-gradient(135deg, #f4626d, var(--red)); color: #fff; }
.btn-ghost { background: #eef2f8; color: var(--blue-700); }
.btn-outline { background: transparent; border: 2px solid var(--blue-500); color: var(--blue-500); }

.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #e8f0fe; color: var(--blue-600);
}
.badge-gold { background: #fff3d6; color: #9a6a00; }
.badge-green { background: #dcf5ef; color: #157a6a; }
.badge-red { background: #fde3e5; color: #c1121f; }
.badge-gray { background: #eceff4; color: #5b6470; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}

.avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  background: var(--blue-500); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; flex: none;
}

.toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%);
  background: rgba(10, 25, 50, .88); color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 14px; z-index: 999; max-width: 80vw;
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

.empty { color: #8a94a6; text-align: center; padding: 28px 0; font-size: 14px; }

/* SSE 断线告警横幅（common.js 动态插入） */
#sse-offline-banner {
  position: fixed; left: 0; right: 0; top: 0; z-index: 9999;
  background: #c1121f; color: #fff; text-align: center;
  padding: 10px 14px; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(193, 18, 31, .45);
  animation: toastIn .25s ease;
}

/* 弹层 */
.mask {
  position: fixed; inset: 0; background: rgba(5, 15, 35, .62); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 420px;
  max-height: 84vh; overflow: auto;
}
.modal h3 { margin-bottom: 12px; font-size: 17px; }

/* ===== 全局自适应基线 ===== */
/* 视口单位兜底：iOS Safari 地址栏收缩时用 svh/dvh（新浏览器），旧浏览器回落 100vh */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}
/* 手机：模态框与弹层全宽 */
@media (max-width: 480px) {
  .mask { padding: 12px; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-width: 100%; max-height: 88dvh; }
  .btn { min-height: 44px; } /* Apple 触控目标最小尺寸 */
}
/* 尊重用户系统字号偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
