/* ==========================================================================
   仙影智能自查系统 — 明亮毛玻璃设计系统 (Glassmorphism Light)
   版本: v4 彻底重设计
   风格: 白底 + 磨砂玻璃 + 蓝色弥散光源 · 通透高级 · 像 iOS/Apple 原生
   ========================================================================== */

/* ===== 设计令牌 ===== */
:root {
  /* 主色 - 通透青蓝 */
  --brand: #2563eb;
  --brand-2: #3b82f6;
  --brand-3: #0ea5e9;
  --brand-4: #22d3ee;
  --cyan: #06b6d4;

  --grad: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #22d3ee 120%);
  --grad-soft: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
  --grad-glass: linear-gradient(160deg, rgba(59,130,246,0.14) 0%, rgba(14,165,233,0.06) 100%);

  /* 弥散光源色 */
  --glow-blue: rgba(59,130,246,0.18);
  --glow-cyan: rgba(34,211,238,0.16);
  --glow-purple: rgba(139,92,246,0.10);

  /* 功能色 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;

  /* 中性色（轻微冷调） */
  --bg: #eef2f8;
  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;

  /* 面：原先这些是散在各处的硬编码 #fff，抽成变量便于统一调整 */
  --surface-solid: #ffffff;
  --surface-soft:  rgba(255,255,255,0.55);
  --surface-input: rgba(255,255,255,0.72);

  /* 玻璃 */
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.7);
  --glass-shadow: 0 8px 32px rgba(30,58,138,0.10), 0 1px 3px rgba(30,58,138,0.06);

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 12% -10%, var(--glow-blue) 0%, transparent 45%),
    radial-gradient(900px 500px at 100% 0%, var(--glow-cyan) 0%, transparent 50%),
    radial-gradient(800px 600px at 50% 110%, var(--glow-purple) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
/* 原生下拉框：显式给 background-color 和 color。
   否则系统处于深色模式时，浏览器可能按系统配色渲染出"深底深字"，看不清。
   顺带把 option 也带上——下拉展开的列表用的是 option 自己的配色，不是 select 的。 */
select {
  background-color: var(--surface-input);
  color: var(--text-1);
}
option {
  background-color: var(--surface-solid);
  color: var(--text-1);
}
a { color: var(--brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-3); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.6); }

/* ==========================================================================
   认证页 — 品牌登录 (登录/注册/找回)
   ========================================================================== */
.auth-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding: clamp(16px, 4vw, 40px);
  position: relative;
  background:
    radial-gradient(700px 500px at 15% 10%, var(--glow-blue) 0%, transparent 50%),
    radial-gradient(600px 500px at 85% 85%, var(--glow-cyan) 0%, transparent 50%),
    linear-gradient(180deg, #eef4fc 0%, #f6f9fe 100%);
}

.login-container,
.register-container,
.reset-container,
.auth-box {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--glass-shadow), 0 20px 60px rgba(30,58,138,0.12);
  animation: floatIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-container { width: min(430px, 94vw); max-width: 430px; }
.register-container { width: min(510px, 94vw); max-width: 510px; }
.reset-container { width: min(430px, 94vw); max-width: 430px; }
.auth-box { max-width: 460px; padding: 0; }
.auth-box h2 { font-size: 1.7rem; font-weight: 700; color: var(--text-1); text-align: center; margin-bottom: 8px; letter-spacing: -0.02em; }
.auth-box .sub { font-size: 0.82rem; color: var(--text-3); text-align: center; margin-bottom: 24px; }

/* 认证头 - 通透渐变 */
.auth-card-header {
  padding: 40px 24px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--grad);
  color: #fff;
}
.auth-card-header::before {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
}
.auth-card-header::after {
  content: '';
  position: absolute; bottom: -50%; left: -15%;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
}
.auth-card-header .auth-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,255,255,0.4);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; margin-bottom: 14px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.5);
  overflow: hidden; position: relative; z-index: 1;
}
.auth-card-header .auth-icon img { width: 100%; height: 100%; object-fit: cover; }
.auth-card-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; position: relative; z-index: 1; color: #fff; }
.auth-card-header .auth-sub { font-size: 0.76rem; color: rgba(255,255,255,0.85); position: relative; z-index: 1; }
.auth-card-header .auth-sub i { margin: 0 5px; color: rgba(255,255,255,0.9); }

/* 认证主体 */
.auth-card-body { padding: 30px 26px 28px; }
.auth-card-body .input-group { margin-bottom: 18px; }
.auth-card-body .input-group label {
  display: block; margin-bottom: 7px; color: var(--text-2);
  font-size: 0.82rem; font-weight: 600;
}
.auth-card-body .input-group label i { color: var(--brand); width: 14px; }
.auth-card-body .input-group input {
  width: 100%; padding: 13px 16px;
  background: var(--surface-input);
  border: 1.5px solid rgba(148,163,184,0.28);
  border-radius: var(--r-md); font-size: 0.95rem; outline: none;
  color: var(--text-1); transition: all 0.25s;
  backdrop-filter: blur(8px);
}
.auth-card-body .input-group input:focus {
  background: var(--surface-solid); border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}
.auth-card-body .input-group input::placeholder { color: var(--text-4); }

/* 表单通用 */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 7px; color: var(--text-2); font-size: 0.85rem; font-weight: 600; }
.form-group label i { color: var(--brand); margin-right: 4px; width: 14px; }
.form-group input {
  width: 100%; padding: 13px 16px;
  background: var(--surface-input);
  border: 1.5px solid rgba(148,163,184,0.28);
  border-radius: var(--r-md); font-size: 0.95rem; outline: none;
  color: var(--text-1); transition: all 0.2s;
}
.form-group input:focus { background: var(--surface-solid); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,0.12); }
.form-group .tips { font-size: 0.72rem; color: var(--text-3); margin-top: 5px; }

/* 提交按钮 */
.auth-submit-btn, .profile-submit-btn {
  width: 100%; padding: 14px; position: relative; overflow: hidden;
  background: var(--grad); border: none; border-radius: var(--r-md); color: #fff;
  font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 22px rgba(37,99,235,0.3);
}
.auth-submit-btn::after, .profile-submit-btn::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transition: left 0.3s ease, opacity 0.15s ease;
  opacity: 0; pointer-events: none;
}
.auth-submit-btn:hover::after, .profile-submit-btn:hover::after { opacity: 1; }
.auth-submit-btn:active::after, .profile-submit-btn:active::after { opacity: 0; left: -100%; transition: none; }
.auth-submit-btn:hover, .profile-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(37,99,235,0.4); }
.auth-submit-btn:hover::after, .profile-submit-btn:hover::after { left: 120%; }
.auth-submit-btn:active, .profile-submit-btn:active { transform: scale(0.98); }
.auth-submit-btn:disabled, .profile-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* 认证底部 */
.auth-footer {
  text-align: center; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid rgba(148,163,184,0.2); color: var(--text-3); font-size: 0.84rem;
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap;
}
.auth-footer a {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); font-weight: 600; font-size: 0.86rem;
  text-decoration: none; padding: 8px 18px;
  border: 1.5px solid rgba(37,99,235,0.28); border-radius: 999px;
  background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(14,165,233,0.06) 100%);
  overflow: hidden; white-space: nowrap;
  transition: all .3s cubic-bezier(.22,.8,.36,1);
  animation: authLinkIn .5s cubic-bezier(.22,.8,.36,1) backwards;
}
.auth-footer a:nth-of-type(1) { animation-delay: .08s; }
.auth-footer a:nth-of-type(2) { animation-delay: .16s; }
.auth-footer a::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  opacity: 0; transition: opacity .3s ease; z-index: 0;
}
.auth-footer a > * { position: relative; z-index: 1; }
.auth-footer a:hover {
  color: #fff; border-color: transparent; transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}
.auth-footer a:hover::after { opacity: 1; }
.auth-footer a:active { transform: translateY(0) scale(.96); }
.auth-footer a i { font-size: 0.8rem; transition: transform .3s ease; }
.auth-footer a:hover i { transform: translateX(3px); }

@keyframes authLinkIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .auth-footer a { padding: 7px 15px; font-size: 0.84rem; }
}

.footer-link { text-align: center; margin-top: 20px; color: var(--text-3); font-size: 0.85rem; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.footer-link a { color: var(--brand); font-size: 0.9rem; font-weight: 500; }
.footer-link a:hover { text-decoration: underline; }

/* 消息 */
.error-msg {
  background: rgba(254,242,242,0.8); color: #dc2626;
  padding: 12px 16px; border-radius: var(--r-md); text-align: center;
  margin-bottom: 18px; font-size: 0.88rem; border: 1px solid rgba(254,202,202,0.7);
  backdrop-filter: blur(6px);
}
.success-msg {
  background: rgba(236,253,245,0.8); color: #059669;
  padding: 12px 16px; border-radius: var(--r-md); text-align: center;
  margin-bottom: 18px; font-size: 0.88rem; border: 1px solid rgba(167,243,208,0.7);
  backdrop-filter: blur(6px);
}
.auth-card-body .error-msg, .auth-card-body .success-msg { margin-bottom: 16px; }

/* 验证码 */
.captcha-row { display: flex; gap: 12px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-text {
  background: rgba(226,232,240,0.6); padding: 12px 16px; border-radius: var(--r-md);
  text-align: center; font-weight: 700; font-size: 1rem;
  min-width: 110px; border: 1px solid rgba(148,163,184,0.3); color: var(--brand);
}
.honeypot { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; }

/* 邮箱验证码：输入框 + 获取按钮 同行，与 .captcha-row 视觉一致 */
.code-row { display: flex; gap: 10px; align-items: center; }
.code-row input { flex: 1; min-width: 0; }
.code-btn {
  flex-shrink: 0; padding: 0 16px; height: 46px; min-width: 116px;
  border: 1px solid rgba(37,99,235,0.28); border-radius: var(--r-md);
  background: rgba(37,99,235,0.08); color: var(--brand);
  font-size: .84rem; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.code-btn:hover:not(:disabled) { background: rgba(37,99,235,0.15); border-color: rgba(37,99,235,0.45); }
.code-btn:active:not(:disabled) { transform: scale(.97); }
.code-btn:disabled { opacity: .55; cursor: not-allowed; }
.code-hint { margin-top: 7px; font-size: .74rem; color: var(--warning, #f59e0b); }
@media (max-width: 420px) {
  .code-btn { min-width: 100px; padding: 0 12px; font-size: .78rem; }
}

/* ==========================================================================
   通用组件
   ========================================================================== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--glass-shadow);
  margin-bottom: 18px; overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(30,58,138,0.14); }
.card-error { background: var(--surface-solid); border-color: rgba(239,68,68,0.4); }
.card-error-inner { padding: 12px 24px; color: #dc2626; font-weight: 600; }
.card-alert { background: rgba(255,251,235,0.8); border: 1.5px solid rgba(251,191,36,0.5) !important; margin-bottom: 16px; }

.card-title { font-size: 1rem; font-weight: 700; color: var(--text-1); cursor: pointer; }
.card-header { padding: 14px 20px; background: var(--surface-soft); border-bottom: 1px solid rgba(148,163,184,0.15); }
.card-header .card-title { font-size: 1rem; font-weight: 700; color: var(--text-1); }
.card-content { padding: 20px; }
.card-content.collapsed { display: none; }
.card-body { padding: 16px 20px; }
.card-body.collapsed { display: none; }

/* 按钮 */
.btn {
  display: inline-block; padding: 6px 16px; border-radius: var(--r-sm);
  font-size: 0.78rem; border: none; cursor: pointer; transition: all 0.2s; font-weight: 600;
}
.btn-block { width: 100%; padding: 13px; border: none; border-radius: var(--r-md); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 12px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.28); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:disabled { background: #b6c6ea; cursor: not-allowed; box-shadow: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-default { background: var(--surface-input); border: 1px solid rgba(148,163,184,0.3); color: var(--text-2); }
.btn-default:hover { background: var(--surface-solid); color: var(--brand); border-color: var(--brand); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-sm { padding: 4px 12px; font-size: 0.72rem; }
.btn-secondary {
  flex: 1; background: var(--surface-input); border: 1.5px solid rgba(148,163,184,0.3);
  padding: 11px 0; border-radius: var(--r-md); color: var(--text-2);
  font-weight: 600; font-size: 0.9rem; cursor: pointer; text-align: center; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--surface-solid); border-color: var(--brand); color: var(--brand); }

.action-buttons { display: flex; gap: 10px; margin-top: 0; flex-wrap: wrap; }
.action-buttons .btn-primary {
  flex: 1; background: var(--grad); border: none; padding: 12px 0;
  border-radius: var(--r-md); color: #fff; font-weight: 700; font-size: 0.92rem;
  cursor: pointer; text-align: center; min-width: 110px;
  box-shadow: 0 6px 18px rgba(37,99,235,0.28); transition: all 0.3s;
}
.action-buttons .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37,99,235,0.36); }
.action-buttons .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.action-buttons .btn-primary:active { transform: scale(0.97); }

/* 表格 */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; }
th, td { border-bottom: 1px solid rgba(148,163,184,0.15); padding: 11px 12px; text-align: left; }
th {
  background: rgba(237,242,250,0.7);
  font-weight: 700; color: var(--text-2);
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.4px;
}
td { vertical-align: middle; color: var(--text-2); }
tbody tr { transition: background 0.15s; }
tbody tr:hover td { background: rgba(59,130,246,0.04); }

.action-icons { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.action-icons button {
  color: var(--text-2); font-size: 0.68rem; padding: 4px 10px; border-radius: 7px;
  background: var(--surface-input); border: 1px solid rgba(148,163,184,0.3); cursor: pointer; transition: all 0.15s;
}
.action-icons button:hover { background: rgba(59,130,246,0.08); border-color: var(--brand); color: var(--brand); }
.action-icons button.danger { color: var(--danger); }
.action-icons button.danger:hover { background: rgba(239,68,68,0.06); border-color: var(--danger); }
.action-icons .count-click {
  font-weight: 800; font-size: 1.3rem; color: var(--brand); cursor: pointer;
  padding: 2px 8px; border-radius: 7px; min-width: 40px;
  display: inline-block; text-align: center; background: transparent; border: 1px dashed transparent;
}
.action-icons .count-click:hover { background: rgba(59,130,246,0.08); border-color: var(--brand); }
.action-icons .count-click.editing { border-color: var(--brand); background: rgba(59,130,246,0.08); }
.action-icons .count-input {
  width: 60px; padding: 3px 6px; border: 1px solid var(--brand); border-radius: 7px;
  font-size: 0.9rem; text-align: center; font-weight: 700; color: var(--brand); display: none; background: var(--surface-solid);
}
.user-btn { display: inline-block; font-size: 0.68rem; padding: 4px 10px; border-radius: 7px; text-decoration: none; font-weight: 600; transition: all 0.15s; }
.user-btn.act-edit { color: var(--warning); border: 1px solid var(--warning); background: rgba(255,251,235,0.7); }
.user-btn.act-edit:hover { background: var(--warning); color: #fff; }
.user-btn.act-del { color: var(--danger); border: 1px solid var(--danger); background: rgba(254,242,242,0.7); }
.user-btn.act-del:hover { background: var(--danger); color: #fff; }

/* 分页 */
.pagination { display: flex; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.pagination-container { width: 100%; }
.pagination a {
  background: var(--surface-input); border: 1px solid rgba(148,163,184,0.3);
  padding: 5px 11px; border-radius: 8px; text-decoration: none;
  color: var(--text-2); font-size: 0.72rem; cursor: pointer; transition: all 0.15s;
}
.pagination a:hover { background: rgba(59,130,246,0.08); border-color: var(--brand); color: var(--brand); }
.pagination a.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(37,99,235,0.28); }

/* 标签栏 */
.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid rgba(148,163,184,0.2); padding-bottom: 8px; }
.tab-btn {
  background: var(--surface-soft); border: 1px solid rgba(148,163,184,0.3);
  border-radius: 18px; padding: 5px 16px; color: var(--text-2);
  text-decoration: none; font-size: 0.72rem; cursor: pointer; font-weight: 600; transition: all 0.2s;
}
.tab-btn:hover { background: rgba(59,130,246,0.08); border-color: var(--brand); color: var(--brand); }
.tab-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(37,99,235,0.28); }

/* 加载 / Toast / 返回 */
.loading-placeholder { text-align: center; padding: 30px; color: var(--text-3); font-size: 0.88rem; }
.loading-placeholder .spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid rgba(148,163,184,0.3); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: var(--r-md); color: #fff; z-index: 99999;
  font-size: 0.88rem; box-shadow: var(--glass-shadow); display: none;
  animation: toastIn 0.3s; font-weight: 600;
  backdrop-filter: blur(10px);
}
@keyframes toastIn { from { transform: translateX(-50%) translateY(-20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.toast.success { background: rgba(16,185,129,0.9); }
.toast.error { background: rgba(239,68,68,0.9); }
.toast.info { background: rgba(37,99,235,0.9); }

.back-btn {
  display: inline-block; margin-bottom: 15px; padding: 8px 16px;
  background: var(--grad); color: #fff; border-radius: var(--r-sm);
  text-decoration: none; box-shadow: 0 4px 12px rgba(37,99,235,0.28); transition: all 0.2s;
}
.back-btn:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }

/* ==========================================================================
   用户仪表盘
   ========================================================================== */
.dashboard-body {
  background:
    radial-gradient(1000px 500px at 10% -5%, var(--glow-blue) 0%, transparent 45%),
    radial-gradient(800px 400px at 100% 0%, var(--glow-cyan) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  padding: 28px 20px 48px;
  min-height: 100vh;
}
.container { max-width: 1000px; margin: 0 auto; }

/* Hero — 通透渐变玻璃 */
.hero-card {
  position: relative; overflow: hidden;
  background: var(--grad);
  border-radius: var(--r-xl);
  padding: 28px 24px 22px; margin-bottom: 18px; color: #fff;
  box-shadow: 0 20px 50px rgba(37,99,235,0.35), 0 4px 12px rgba(37,99,235,0.15);
}
.hero-card::before {
  content: ''; position: absolute; top: -80px; right: -50px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
}
.hero-card::after {
  content: ''; position: absolute; bottom: -60px; left: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
}
.hero-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; margin-bottom: 22px; }
.hero-user { display: flex; align-items: center; gap: 14px; }
.hero-avatar {
  width: 58px; height: 58px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.5);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
/* .hero-info 之前没有定义样式，导致问候语和用户名各自左对齐。
   用户名长度不一，"下午好"跟着左对齐时中线对不上，看着是歪的。
   这里让 info 成为纵向 flex，宽度由内容里较宽的那个决定（通常是用户名），
   问候语再在这条宽度上居中 —— 于是它的中心就和用户名的中心对齐了。
   min-width:0 是为了让超长用户名能正常收缩换行，不把卡片撑破。 */
.hero-info {
  /* 用 grid 而不是 flex-column：VIP 徽标放进第 2 列后，
     它就不再参与第 1 列（问候语居中基准）的宽度计算。
     否则基准会是「用户名+徽标」，问候语整体右移半个徽标宽 —— 实测偏右 27.2px，
     且用户名越短越明显（短名时问候语中心会跑到名字右缘之外）。
     这样也不需要把徽标宽度写死。 */
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: start;
  min-width: 0;
}
.hero-greeting { grid-column: 1; grid-row: 1; }
.hero-name { grid-column: 1; grid-row: 2; }
.hero-vip-badge { grid-column: 2; grid-row: 2; }
.hero-greeting {
  font-size: 0.75rem; color: rgba(255,255,255,0.8); margin-bottom: 3px;
}
/* 只有"登录后"的问候语（下午好/早上好…）按用户名宽度居中。
   未登录时这行显示的是站点名，保持原来的左对齐 —— 所以单独加类，不共用规则。 */
.hero-greeting-user {
  text-align: center;
  /* width:0 + min-width:100% 让问候语不参与第1列的宽度计算：
     否则用户名比"下午好"还短时（1~2 个字符），列宽会被问候语撑大，
     中心又偏右 4px。这样列宽恒等于用户名宽度，问候语再在其中居中。 */
  width: 0;
  min-width: 100%;
  white-space: nowrap;
}
.hero-name {
  font-size: 1.3rem; font-weight: 800; color: #fff;
  overflow-wrap: anywhere;   /* 超长用户名（尤其英文）不撑破卡片 */
}
.hero-actions { display: flex; gap: 8px; }
.hero-link {
  display: inline-flex; width: 40px; height: 40px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.16); color: #fff;
  text-decoration: none; font-size: 0.88rem; transition: all 0.25s;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
}
.hero-link:hover { background: rgba(255,255,255,0.3); color: #fff; transform: scale(1.08); }
.hero-link-out { background: rgba(239,68,68,0.3); border-color: rgba(255,255,255,0.2); }
.hero-link-out:hover { background: rgba(239,68,68,0.5); }

.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; position: relative; z-index: 1; margin-bottom: 16px; }
.hero-stat {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 18px; padding: 16px 10px; text-align: center;
  backdrop-filter: blur(10px); transition: all 0.3s;
}
.hero-stat:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }
.hero-stat-icon { font-size: 1rem; color: rgba(255,255,255,0.9); margin-bottom: 6px; }
.hero-stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1.1; }
.hero-stat-label { font-size: 0.62rem; color: rgba(255,255,255,0.75); font-weight: 600; margin-top: 3px; }

.hero-progress { position: relative; z-index: 1; margin-bottom: 20px; }
.hero-progress-bar { height: 8px; border-radius: 8px; background: rgba(255,255,255,0.2); overflow: hidden; position: relative; }
.hero-progress-fill {
  position: relative;
  height: 100%; border-radius: 8px; min-width: 0;
  background: linear-gradient(90deg, #ffffff, #a5f3fc);
  transition: width 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
  box-shadow: 0 0 14px rgba(255,255,255,0.6);
  overflow: hidden;
}
.hero-progress-fill::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: shimmer 1.8s ease-in-out infinite;
}
@keyframes shimmer { 0% { left: -40%; } 100% { left: 110%; } }

.hero-recharge-btn {
  width: 100%; padding: 13px 0; border: none; border-radius: 16px;
  background: rgba(255,255,255,0.18); color: #fff; font-size: 0.92rem; font-weight: 700;
  cursor: pointer; position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,0.3); letter-spacing: 0.5px; transition: all 0.3s;
  backdrop-filter: blur(6px);
}
.hero-recharge-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-2px); }
.hero-recharge-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.hero-recharge-btn i { margin-right: 8px; }

/* 查询区 */
.query-section { padding: 24px; }
.query-section .query-label {
  font-size: 1rem; font-weight: 800; color: var(--text-1); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.query-section .query-label i {
  display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; border-radius: 9px; font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.query-input-wrap { position: relative; margin-bottom: 16px; }
.query-input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-4); font-size: 1rem; z-index: 1; transition: color 0.3s; }
.query-input-wrap:focus-within .query-input-icon { color: var(--brand); }
.query-input {
  width: 100%; padding: 15px 16px 15px 46px; font-size: 0.98rem;
  border: 1.5px solid rgba(148,163,184,0.3); border-radius: 16px; outline: none;
  background: var(--surface-input); transition: all 0.3s;
}
.query-input:focus { border-color: var(--brand); background: var(--surface-solid); box-shadow: 0 0 0 4px rgba(37,99,235,0.12); }
.query-input:disabled { background: rgba(226,232,240,0.5); cursor: not-allowed; opacity: 0.6; }
.query-input::placeholder { color: var(--text-4); }
.query-tip-text { font-size: 0.72rem; color: var(--text-4); }
.query-tip-row { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; justify-content: center; align-items: center; text-align: center; }

/* 历史 */
.history-card { padding: 20px 24px; }
.history-title {
  font-size: 0.95rem; font-weight: 800; color: var(--text-1);
  margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center;
}
.history-title i { color: var(--success); margin-right: 5px; }
.history-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 28px; }
.history-item {
  background: var(--surface-input); border: 1.5px solid rgba(148,163,184,0.25); border-radius: 22px;
  padding: 8px 18px; font-size: 0.8rem; color: var(--text-2); cursor: pointer;
  transition: all 0.25s; font-weight: 600;
}
.history-item:hover {
  background: rgba(59,130,246,0.08); border-color: var(--brand); color: var(--brand);
  transform: translateY(-2px);
}
.clear-history { font-size: 0.72rem; color: var(--text-4); cursor: pointer; padding: 4px 12px; border-radius: 12px; transition: all 0.2s; }
.clear-history:hover { color: var(--danger); background: rgba(239,68,68,0.06); }

/* 结果 */
.result-card { padding: 24px; }
.result-header { display: flex; justify-content: space-between; align-items: center; align-content: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px 24px; }
.result-title { font-size: 0.95rem; font-weight: 800; color: var(--text-1); display: inline-flex; align-items: center; line-height: 1; white-space: nowrap; flex-shrink: 0; flex-basis: 100%; }
.result-title i { color: var(--warning); margin-right: 6px; }
.result-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; flex: 1; justify-content: space-between; min-width: 0; }
.result-search-group {
  display: flex; align-items: center; background: var(--surface-soft);
  border: 1.5px solid rgba(148,163,184,0.25); border-radius: 12px; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 36px;
  flex-shrink: 0;
}
.result-search-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.result-search-icon { padding: 0 0 0 14px; color: var(--text-4); font-size: 0.8rem; display: flex; align-items: center; line-height: 1; }
.result-search-group:focus-within .result-search-icon { color: var(--brand); }
.result-search-group input { border: none; outline: none; background: transparent; padding: 0 8px; font-size: 0.8rem; color: var(--text-1); width: 200px; min-width: 120px; height: 34px; line-height: normal; flex: 0 1 auto; }
.result-search-group input::placeholder { color: var(--text-4); font-size: 0.74rem; }
.result-search-group button { border: none; background: transparent; cursor: pointer; padding: 0 12px; color: var(--text-4); font-size: 0.72rem; border-left: 1px solid rgba(148,163,184,0.2); transition: all 0.2s; display: flex; align-items: center; justify-content: center; line-height: 1; flex-shrink: 0; }
.result-search-group button:hover:not(:disabled) { color: var(--brand); background: rgba(59,130,246,0.06); }
.result-search-group button:disabled { opacity: 0.3; cursor: not-allowed; }
.result-copy-btn {
  background: rgba(255,251,235,0.7); border: 1.5px solid rgba(251,191,36,0.4);
  padding: 0 16px; border-radius: 12px; font-size: 0.76rem; cursor: pointer;
  color: #b45309; font-weight: 600; transition: all 0.25s; white-space: nowrap;
  height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-sizing: border-box; line-height: 1; flex-shrink: 0;
}
.result-copy-btn:hover { background: var(--warning); color: #fff; border-color: var(--warning); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }
.result-box {
  background: var(--surface-soft); border-radius: 16px; padding: 24px 20px;
  font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.7; white-space: pre-wrap;
  word-break: break-word; color: var(--text-2); max-height: 420px; overflow-y: auto;
  border: 1px solid rgba(148,163,184,0.2); border-top: 3px solid var(--brand);
}
.result-box pre { margin: 0; font-family: inherit; font-size: inherit; color: inherit; white-space: pre-wrap; }
.result-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 0; gap: 12px; }
.result-placeholder-icon { font-size: 2.5rem; color: rgba(148,163,184,0.5); margin-bottom: 4px; }
.result-placeholder-text { font-size: 0.88rem; color: var(--text-4); line-height: 1.7; text-align: center; }
.highlight { background-color: rgba(34,211,238,0.35); color: #082f49; border-radius: 3px; padding: 0 2px; }
.current-highlight { background-color: var(--warning); color: #fff; }

/* 邀请卡 */
.invite-card {
  background: var(--surface-soft);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: var(--r-lg); padding: 18px; margin: 12px 0;
  backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow); position: relative; overflow: hidden;
}
.invite-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.invite-head-icon {
  width: 46px; height: 46px; border-radius: 14px; background: var(--grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0; box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.invite-head-text { flex: 1; min-width: 0; }
.invite-head-title { font-size: 0.9rem; font-weight: 800; color: var(--text-1); display: block; }
.invite-head-desc { font-size: 0.7rem; color: var(--text-3); display: block; margin-top: 2px; }
.invite-head-desc strong { color: #b45309; font-weight: 800; }
.invite-badge { font-size: 0.7rem; color: #059669; background: rgba(236,253,245,0.8); padding: 6px 14px; border-radius: 20px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.invite-progress-section { margin-bottom: 4px; position: relative; }
.invite-progress-bar { height: 8px; background: rgba(148,163,184,0.2); border-radius: 5px; overflow: visible; margin-bottom: 8px; position: relative; }
.invite-progress-fill { height: 100%; background: var(--grad); border-radius: 5px; transition: width 0.8s; box-shadow: inset 0 1px 0 rgba(255,255,255,0.3); }
.invite-progress-steps { position: absolute; top: 0; left: 0; right: 0; height: 100%; pointer-events: none; }
.invite-step-dot {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-solid); border: 2px solid rgba(148,163,184,0.4); transform: translate(-50%, -50%);
  transition: all 0.5s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.invite-step-dot.filled { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.2); }
.invite-progress-info { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.invite-progress-text { font-size: 0.8rem; font-weight: 800; color: var(--brand); }
.invite-progress-tip { font-size: 0.7rem; color: var(--text-3); }
.invite-progress-tip strong { color: #b45309; font-weight: 800; }
.invite-progress-tip.done { color: #059669; font-weight: 700; }
.invite-progress-daily { font-size: 0.68rem; color: var(--text-3); width: 100%; margin-top: 4px; padding: 7px 10px; background: rgba(224,242,254,0.6); border-radius: 8px; text-align: center; }
.invite-progress-daily strong { color: var(--brand); font-weight: 800; }
.invite-continue-btn {
  width: 100%; margin-top: 8px; padding: 10px 0; border: none; border-radius: 12px;
  background: var(--grad); color: #fff; font-size: 0.8rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(37,99,235,0.28);
}
.invite-continue-btn:hover { transform: translateY(-1px); }
.invite-share { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(148,163,184,0.2); padding-top: 12px; margin-top: 4px; }
.invite-share-label { font-size: 0.72rem; color: var(--text-3); white-space: nowrap; }
.invite-share-main {
  margin-left: auto; padding: 8px 22px; border: none; border-radius: 12px;
  background: var(--grad); color: #fff; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(37,99,235,0.28);
}
.invite-share-main:hover { transform: translateY(-1px); }

/* 广告卡 */
.ad-card {
  background: var(--surface-soft); border: 1px solid rgba(148,163,184,0.2);
  border-radius: 12px; padding: 0 14px; margin: 10px 0; height: 36px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; transition: box-shadow 0.2s; overflow: hidden;
  backdrop-filter: blur(8px);
}
.ad-card:hover { box-shadow: 0 4px 12px rgba(37,99,235,0.1); }
.ad-tag { font-size: 0.62rem; color: #fff; background: var(--grad); padding: 2px 8px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; font-weight: 700; }
.ad-slide-wrap { flex: 1; height: 100%; position: relative; overflow: hidden; }
.ad-slide-item { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; gap: 8px; opacity: 0; transform: translateY(8px); transition: all 0.4s; pointer-events: none; }
.ad-slide-item.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ad-slide-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 8px; width: 100%; }
.ad-slide-title { font-size: 0.76rem; font-weight: 600; color: var(--text-1); white-space: nowrap; }
.ad-dots { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.ad-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(148,163,184,0.4); cursor: pointer; transition: all 0.3s; }
.ad-dot.active { background: var(--brand); width: 16px; border-radius: 3px; }

/* 访问统计 */
.visit-stats { display: flex; justify-content: center; gap: 24px; padding: 14px 0; font-size: 0.72rem; color: var(--text-4); margin-top: 8px; }
.visit-stats span { display: flex; align-items: center; gap: 4px; }
.visit-stats i { font-size: 0.78rem; color: var(--brand); }

/* 分享弹窗 */
.share-dialog {
  background: var(--surface-solid); border-radius: var(--r-lg); width: 90%; max-width: 360px;
  box-shadow: var(--glass-shadow); padding: 26px 22px; animation: modalIn 0.25s;
  backdrop-filter: blur(20px);
}
.share-dialog-header { text-align: center; margin-bottom: 20px; }
.share-dialog-icon { display: inline-block; width: 48px; height: 48px; line-height: 48px; border-radius: 50%; background: rgba(59,130,246,0.1); color: var(--brand); font-size: 1.15rem; margin-bottom: 8px; }
.share-dialog-header h3 { font-size: 1.05rem; font-weight: 800; color: var(--text-1); margin: 0 0 4px; }
.share-dialog-header p { font-size: 0.74rem; color: var(--text-3); margin: 0; }
.share-dialog-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.share-option { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid rgba(148,163,184,0.25); border-radius: 12px; cursor: pointer; transition: all 0.15s; }
.share-option:hover { background: rgba(59,130,246,0.05); border-color: var(--brand); }
.share-option-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.share-option-icon.qq { background: rgba(224,242,254,0.8); color: #0284c7; }
.share-option-icon.wechat { background: rgba(220,252,231,0.8); color: #16a34a; }
.share-option-icon.copy { background: rgba(59,130,246,0.1); color: var(--brand); }
.share-option-text { display: flex; flex-direction: column; gap: 2px; }
.share-option-title { font-size: 0.84rem; font-weight: 700; color: var(--text-1); }
.share-option-desc { font-size: 0.7rem; color: var(--text-3); }
.share-dialog-footer { text-align: center; }
.share-close-btn { padding: 10px 34px; border: none; border-radius: 10px; background: rgba(226,232,240,0.7); color: var(--text-2); font-size: 0.82rem; cursor: pointer; transition: all 0.2s; }
.share-close-btn:hover { background: rgba(226,232,240,1); }

/* 促销卡 */
.promo-card {
  background: var(--surface-soft); border: 1.5px solid rgba(148,163,184,0.2);
  border-radius: var(--r-lg); padding: 18px 24px; margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  backdrop-filter: blur(10px);
}
.promo-link { background: var(--grad); color: #fff; padding: 12px 30px; border-radius: 30px; text-decoration: none; font-weight: 700; font-size: 0.9rem; transition: 0.3s; box-shadow: 0 4px 16px rgba(37,99,235,0.3); white-space: nowrap; }
.promo-link:hover { color: #fff; transform: translateY(-2px); }
.free-link { color: var(--brand); text-decoration: none; font-size: 0.74rem; font-weight: 600; padding: 5px 14px; border-radius: 14px; background: rgba(37,99,235,0.06); }
.free-link:hover { background: rgba(37,99,235,0.12); }

/* 友链独立卡片 */
.friend-links-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(240,247,255,0.68));
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: var(--r-xl);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 12px 40px rgba(37,99,235,0.08), 0 2px 8px rgba(37,99,235,0.05);
  padding: 22px 24px 24px;
  margin: 26px 0 20px;
  overflow: hidden;
  animation: friendCardIn 0.7s cubic-bezier(0.22,1,0.36,1) both;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), box-shadow 0.4s;
}
.friend-links-card:hover { transform: translateY(-4px); box-shadow: 0 22px 55px rgba(37,99,235,0.15), 0 4px 12px rgba(37,99,235,0.08); }
@keyframes friendCardIn { 0% { opacity: 0; transform: translateY(26px) scale(0.97); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* 卡片环境光晕 */
.friend-links-card-glow {
  position: absolute; top: -70px; right: -50px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(14,165,233,0.28), rgba(34,211,238,0.12) 55%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 5s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.2); opacity: 1; } }

/* 头部 */
.friend-links-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; position: relative; z-index: 1;
}
.friend-links-header-icon {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 1.05rem;
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
  position: relative; overflow: hidden;
}
.friend-links-header-icon::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: iconShine 2.6s ease-in-out infinite;
}
@keyframes iconShine { 0% { transform: translateX(-110%); } 55%,100% { transform: translateX(110%); } }
.friend-links-header-text { flex: 1; min-width: 0; }
.friend-links-title { font-size: 1rem; font-weight: 800; color: var(--text-1); letter-spacing: 0.3px; }
.friend-links-sub { font-size: 0.68rem; color: var(--text-4); margin-top: 3px; }
.friend-links-badge {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.28);
  color: #059669; font-size: 0.68rem; font-weight: 700;
  animation: badgeFloat 3s ease-in-out infinite;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s;
}
.friend-links-badge:hover { background: rgba(16,185,129,0.18); border-color: rgba(16,185,129,0.45); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.2); }
.friend-links-badge i { font-size: 0.7rem; }
@keyframes badgeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* 友链列表: grid 等宽布局保证按钮左右对齐 */
.friend-links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  position: relative; z-index: 1;
}
.friend-link-item {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 10px 14px;
  min-width: 0;
  background: var(--surface-input);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 14px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-2);
  text-decoration: none; transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  box-shadow: 0 2px 6px rgba(37,99,235,0.04);
  opacity: 1;
  animation: friendItemIn 0.55s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: calc(0.25s + var(--d, 0ms));
}
@keyframes friendItemIn { 0% { opacity: 0; transform: translateY(16px) scale(0.92); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.friend-link-item::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.85) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.7s ease;
}
.friend-link-item:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 20px rgba(37,99,235,0.18); background: var(--surface-solid); }
.friend-link-item:hover::before { transform: translateX(120%); }
.friend-link-item:hover .friend-link-item-icon,
.friend-link-item:hover .friend-link-item-char { transform: rotate(-10deg) scale(1.12); }
.friend-link-item:hover .friend-link-item-arrow { opacity: 1; transform: translate(2px,-2px); }
.friend-link-item-icon {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(37,99,235,0.08); color: var(--brand); font-size: 0.78rem;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.friend-link-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.friend-link-item-arrow { opacity: 0; font-size: 0.62rem; color: var(--brand); transition: all 0.3s; margin-left: auto; flex-shrink: 0; }

/* 无图标友链项: 首字圆形标识 (与 icon span 完全等宽高等, 保证对齐) */
.friend-link-item-char {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(14,165,233,0.14));
  color: var(--brand); font-size: 0.82rem; font-weight: 800;
  line-height: 1; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@media (max-width: 600px) {
  .friend-links-card { padding: 18px 16px 20px; margin: 20px 0 16px; }
  .friend-links-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .friend-link-item { padding: 8px 12px; font-size: 0.76rem; }
  /* 移动端保留合作徽章, 缩小适配 */
  .friend-links-badge { display: inline-flex; padding: 4px 9px; font-size: 0.62rem; gap: 4px; }
  .friend-links-badge i { font-size: 0.62rem; }
  .friend-links-header { gap: 8px; }
  .friend-links-header-icon { width: 38px; height: 38px; font-size: 0.95rem; }
  .friend-links-sub { display: none; }
}

/* 尊重系统减少动态效果设置: 关闭动画保证内容可见 */
@media (prefers-reduced-motion: reduce) {
  .friend-links-card { animation: none; }
  .friend-links-card-glow { animation: none; }
  .friend-links-header-icon::after { animation: none; }
  .friend-links-badge { animation: none; }
  .friend-link-item { animation: none; opacity: 1; }
}

/* ==========================================================================
   个人资料
   ========================================================================== */
.profile-page { padding: 24px 20px; min-height: 100vh; }
.profile-page .container { max-width: 600px; }
.profile-card {
  width: 100%; max-width: 540px; margin: 0 auto;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-xl); overflow: hidden;
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--glass-shadow);
}
.profile-header { background: var(--grad); padding: 36px 24px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.profile-header::before { content: ''; position: absolute; top: -60%; right: -40%; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%); }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.5); margin-bottom: 12px; object-fit: cover; position: relative; z-index: 1; }
.profile-header h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; position: relative; z-index: 1; }
.profile-header .profile-sub { font-size: 0.76rem; color: rgba(255,255,255,0.8); position: relative; z-index: 1; }
.profile-body { padding: 28px 26px; }
.profile-body .form-group { margin-bottom: 18px; }
.profile-body .form-group label { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 0.82rem; font-weight: 600; }
.profile-body .form-group label i { color: var(--brand); width: 14px; }
.profile-body .form-group input {
  width: 100%; padding: 13px 16px; background: var(--surface-input);
  border: 1.5px solid rgba(148,163,184,0.28); border-radius: var(--r-md);
  font-size: 0.9rem; outline: none; color: var(--text-1); transition: all 0.2s;
}
.profile-body .form-group input:focus { background: var(--surface-solid); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
.profile-body .tips { font-size: 0.72rem; color: var(--text-3); margin-top: 4px; }
.profile-footer { text-align: center; padding: 0 24px 24px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.profile-footer a { color: var(--text-2); text-decoration: none; font-size: 0.86rem; padding: 9px 18px; border-radius: 10px; background: var(--surface-input); transition: all 0.2s; }
.profile-footer a:hover { background: rgba(59,130,246,0.1); color: var(--brand); }

/* ==========================================================================
   管理后台
   ========================================================================== */
.admin-body {
  background:
    radial-gradient(1000px 500px at 10% -5%, var(--glow-blue) 0%, transparent 45%),
    var(--bg);
  background-attachment: fixed;
  padding: 16px 12px 24px; font-size: 14px; color: var(--text-1); min-height: 100vh;
}
.admin-container { max-width: 1000px; margin: 0 auto; }

.top-header {
  background: var(--grad); border-radius: var(--r-lg); padding: 18px 24px; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  box-shadow: 0 16px 40px rgba(37,99,235,0.3); position: relative; overflow: hidden;
}
.top-header::before { content: ''; position: absolute; top: -60px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%); }
.top-header::after { content: ''; position: absolute; bottom: -40px; left: 20%; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%); }
.header-left { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.header-logo {
  width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 1.3rem; box-shadow: 0 4px 16px rgba(0,0,0,0.15); flex-shrink: 0; overflow: hidden;
  backdrop-filter: blur(6px);
}
.header-logo img { width: 100%; height: 100%; object-fit: cover; }
.header-info h1 { color: #fff; font-size: 1.05rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.header-badge { display: inline-block; font-size: 0.56rem; font-weight: 600; background: rgba(255,255,255,0.25); color: #fff; padding: 3px 9px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.35); }
.header-info p { color: rgba(255,255,255,0.85); font-size: 0.7rem; margin: 3px 0 0; }
.header-actions { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.header-btn { color: #fff; text-decoration: none; font-size: 0.76rem; padding: 8px 14px; border-radius: 9px; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.25); transition: all 0.2s; display: flex; align-items: center; gap: 5px; }
.header-btn:hover { background: rgba(255,255,255,0.3); color: #fff; }
.header-btn.logout { background: rgba(239,68,68,0.35); border-color: rgba(255,255,255,0.2); }
.header-btn.logout:hover { background: rgba(239,68,68,0.55); }

.top-nav {
  display: none; gap: 3px; padding: 6px; margin: 12px 0 20px;
  background: var(--glass-bg); border-radius: 16px;
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow); position: relative; z-index: 2;
}
.top-nav-item {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 8px; border-radius: 12px; text-decoration: none;
  color: var(--text-2); font-size: 0.82rem; font-weight: 600; transition: all 0.2s;
}
.top-nav-item:hover { background: rgba(59,130,246,0.08); color: var(--brand); }
.top-nav-item.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.3); }
.top-nav-item i { font-size: 0.88rem; }

.page { display: none; }
.page.active { display: block; animation: pageIn 0.3s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-card {
  background: var(--glass-bg); border-radius: var(--r-lg); border: 1px solid var(--glass-border);
  overflow: hidden; margin-bottom: 14px; backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);
}
.page-card .card-title {
  padding: 14px 18px; background: var(--surface-soft);
  border-bottom: 1px solid rgba(148,163,184,0.15); font-weight: 700; font-size: 0.92rem; color: var(--text-1);
}
.page-card .card-title span { font-weight: 400; font-size: 0.72rem; color: var(--text-3); }
.page-card .card-body { padding: 16px 18px; }

/* 统计网格 */
/* 过滤栏 */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter-bar input, .filter-bar select {
  padding: 7px 12px; border: 1px solid rgba(148,163,184,0.3); border-radius: 8px;
  font-size: 0.76rem; outline: none; background: var(--surface-input);
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); background: var(--surface-solid); }
.filter-bar button { padding: 7px 14px; border-radius: 8px; font-size: 0.76rem; border: none; cursor: pointer; }

/* 卡密统计 */
.cards-stats {
  background: var(--surface-input); border: 1px solid rgba(148,163,184,0.2);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; text-align: center;
  backdrop-filter: blur(8px);
}
.cards-stats span { font-weight: 700; font-size: 0.86rem; margin: 0 12px; }
.cards-stats .total { color: var(--brand); }
.cards-stats .unused { color: var(--success); cursor: pointer; }
.cards-stats .used { color: var(--text-3); cursor: pointer; }
.cards-stats span:hover { opacity: 0.7; }

/* 底部导航 / FAB */
.bottom-nav {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface-solid);
  border-top: 1px solid rgba(148,163,184,0.2);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 999;
  justify-content: space-around; backdrop-filter: blur(20px);
  box-shadow: 0 -4px 20px rgba(30,58,138,0.06);
}
.bottom-nav .nav-item {
  display: flex; flex-direction: column; align-items: center; text-decoration: none;
  color: var(--text-3); font-size: 0.5rem; padding: 2px 0; min-width: 48px; border: none; background: none; cursor: pointer;
}
.bottom-nav .nav-item.active { color: var(--brand); }
.bottom-nav .nav-item:active { transform: scale(0.92); }
.bottom-nav .nav-icon { font-size: 1.25rem; line-height: 1.3; }
.bottom-nav .nav-label { font-size: 0.52rem; margin-top: 3px; font-weight: 600; }

.fab-group { display: none; position: fixed; bottom: 70px; right: 14px; flex-direction: column; gap: 8px; z-index: 998; }
.fab-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none;
  box-shadow: var(--glass-shadow); display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #fff; font-size: 0.46rem; cursor: pointer; transition: all 0.2s;
  backdrop-filter: blur(10px);
}
.fab-btn:active { transform: scale(0.9); }
.fab-btn .fab-icon { font-size: 1.15rem; }
.fab-btn.primary { background: var(--grad); }
.fab-btn.success { background: linear-gradient(135deg, #10b981, #06b6d4); }

/* ==========================================================================
   弹窗
   ========================================================================== */
.modal-mask {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15,23,42,0.35); display: flex; align-items: center; justify-content: center;
  z-index: 1000; visibility: hidden; opacity: 0; transition: 0.2s;
  backdrop-filter: blur(6px);
}
.modal-mask.active { visibility: visible; opacity: 1; }
.modal-mask.show { display: flex; }

.modal-container {
  background: var(--surface-solid); border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--r-lg); padding: 28px 24px; width: 90%; max-width: 400px;
  backdrop-filter: blur(24px);
  box-shadow: var(--glass-shadow); animation: modalIn 0.25s;
}
.modal-container h3 { font-size: 1.15rem; margin-bottom: 10px; font-weight: 800; color: var(--text-1); }
.modal-container p { font-size: 0.86rem; color: var(--text-3); margin-bottom: 16px; }
.modal-container input {
  width: 100%; padding: 13px 16px; border: 1.5px solid rgba(148,163,184,0.3); border-radius: 12px;
  margin: 12px 0; font-size: 0.95rem; outline: none; transition: all 0.3s; text-align: center; letter-spacing: 1px;
  font-weight: 600; background: var(--surface-input);
}
.modal-container input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
.modal-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal-btn {
  padding: 11px 22px; border-radius: 12px; border: 1px solid rgba(148,163,184,0.3); cursor: pointer;
  background: var(--surface-input); font-size: 0.88rem; font-weight: 600; transition: all 0.2s;
}
.modal-btn:hover { background: rgba(59,130,246,0.06); border-color: var(--brand); color: var(--brand); }
.modal-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.modal-btn.primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 4px 14px rgba(37,99,235,0.28); }
.modal-btn.primary:hover { transform: translateY(-1px); }
.buy-link-btn { background: linear-gradient(135deg, #10b981, #06b6d4); color: #fff; border: none; box-shadow: 0 4px 14px rgba(6,182,212,0.3); }
.buy-link-btn:hover { transform: translateY(-1px); }

/* 公告弹窗 */
/* ===== 公告弹窗（dashboard SPA）· 版式 =====
   结构：头部（图标+标题+关闭）→ 正文 → 链接按钮组 → 底部确认。
   链接按钮是多元式公告的主 CTA：后台按「文字 | 链接 | 图标」逐行填写。 */
/* ===== 公告弹窗（dashboard SPA）· 版式 =====
   结构：顶部品牌渐变条 → 头部（图标+标题+关闭）→ 可滚动正文（底部渐隐）
        → 链接按钮组 → 底部确认。
   链接按钮是多元式公告的主 CTA：后台填空式添加，前台渲染为整块可点卡片。
   注意：确认按钮的禁用态由 announceScrolled 驱动，勿退回纯 CSS 的滚动门。 */
.ann-dialog { position: relative; width: 92%; max-width: 440px; max-height: 85vh; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface-solid); box-shadow: 0 28px 70px rgba(15,23,42,0.26), 0 2px 8px rgba(15,23,42,0.06); overflow: hidden; animation: annIn .4s cubic-bezier(.22,1,.36,1) both; }
@keyframes annIn { from { opacity: 0; transform: translateY(22px) scale(.95); } to { opacity: 1; transform: none; } }
.ann-head { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 56px 20px; background: linear-gradient(180deg, rgba(37,99,235,0.1) 0%, rgba(14,165,233,0.045) 52%, rgba(255,255,255,0) 100%); }
.ann-head::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(rgba(37,99,235,0.1) 1px, transparent 1px); background-size: 14px 14px; -webkit-mask-image: radial-gradient(ellipse 76% 100% at 50% 0%, #000, transparent 72%); mask-image: radial-gradient(ellipse 76% 100% at 50% 0%, #000, transparent 72%); }
.ann-badge { position: relative; flex: none; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 21px; box-shadow: 0 8px 20px rgba(37,99,235,0.34); }
.ann-badge::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(37,99,235,0.16); }
.ann-title { position: relative; margin: 0; font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; color: var(--text-1); }
.ann-close { position: absolute; top: 15px; right: 15px; z-index: 4; width: 32px; height: 32px; border: none; border-radius: 50%; background: rgba(30,58,138,0.07); color: #3b4a8f; font-size: 14px; cursor: pointer; display: grid; place-items: center; transition: background .22s, transform .22s; }
.ann-close:hover { background: rgba(30,58,138,0.15); transform: rotate(90deg); }
.ann-scroll { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.ann-scroll::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 88%); transition: opacity .3s; }
.ann-scroll.at-end::after { opacity: 0; }
.ann-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 22px 12px; color: var(--text-2); font-size: .87rem; line-height: 1.9; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; }
.ann-body::-webkit-scrollbar { width: 5px; }
.ann-body::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(37,99,235,0.22); }
.ann-links { flex: 0 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 22px 0; scrollbar-width: thin; }
.ann-links::-webkit-scrollbar { width: 5px; }
.ann-links::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(37,99,235,0.22); }
.ann-link { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid rgba(37,99,235,0.16); border-radius: 15px; background: linear-gradient(135deg, rgba(37,99,235,0.055), rgba(34,211,238,0.03)); text-decoration: none; transition: border-color .22s, background .22s, transform .22s, box-shadow .22s; }
.ann-link:hover { border-color: rgba(37,99,235,0.4); background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(34,211,238,0.06)); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(37,99,235,0.13); }
.ann-link:active { transform: translateY(0) scale(.99); }
.ann-link-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 13px; box-shadow: 0 4px 10px rgba(37,99,235,0.26); }
.ann-link-tx { flex: 1; min-width: 0; }
.ann-link-tx b { display: block; font-size: .88rem; font-weight: 700; color: var(--text-1); }
.ann-link-tx small { display: block; margin-top: 3px; font-size: .7rem; color: #5b6b82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-link-arrow { flex: none; font-size: .72rem; color: var(--brand); opacity: .6; transition: transform .22s, opacity .22s; }
.ann-link:hover .ann-link-arrow { transform: translateX(3px); opacity: 1; }
.ann-foot { flex: none; padding: 16px 22px 22px; }
.ann-btn { width: 100%; padding: 13px 0; border: none; border-radius: 14px; background: var(--grad); color: #fff; font-size: .92rem; font-weight: 700; cursor: pointer; box-shadow: 0 9px 22px rgba(37,99,235,0.3); transition: filter .22s, transform .22s, box-shadow .22s; }
.ann-btn:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 11px 26px rgba(37,99,235,0.36); }
.ann-btn:active:not(:disabled) { transform: scale(.985); }
.ann-btn:disabled { background: rgba(148,163,184,0.22); color: #5b6b82; box-shadow: none; cursor: default; }
.ann-dialog a:focus-visible, .ann-dialog button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 420px) { .ann-dialog { width: 94%; max-height: 88vh; } .ann-head { padding: 22px 52px 17px; } .ann-badge { width: 50px; height: 50px; margin-bottom: 12px; font-size: 19px; } .ann-body { padding: 17px 17px 10px; } .ann-links { padding: 12px 17px 0; } .ann-foot { padding: 14px 17px 18px; } }
@media (prefers-reduced-motion: reduce) { .ann-dialog { animation: none; } .ann-close, .ann-link, .ann-link-arrow, .ann-btn { transition: none; } .ann-close:hover, .ann-link:hover, .ann-link:hover .ann-link-arrow { transform: none; } }
@keyframes bounceHint { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.bounce-hint { animation: bounceHint 1.2s ease-in-out infinite; display: inline-block; }

/* 管理端弹窗 */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15,23,42,0.35); z-index: 1000; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.modal-overlay.show { display: flex; }
.modal-content {
  --modal-pad: 22px;   /* 标题条要按同一个值做满宽/内缩，抽成变量避免两处写死后失配 */
  background: var(--surface-solid); border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--r-lg); padding: var(--modal-pad); width: 92%; max-width: 440px;
  max-height: 90vh; overflow-y: auto; animation: modalIn 0.3s;
  backdrop-filter: blur(24px); box-shadow: var(--glass-shadow);
}
@keyframes modalIn { from { transform: scale(0.92) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-content h3 { margin-bottom: 12px; font-size: 1.02rem; border-bottom: 1px solid rgba(148,163,184,0.2); padding-bottom: 10px; font-weight: 800; color: var(--text-1); }
/* 弹窗标题条 + 右上角关闭按钮
   为什么标题条要 sticky：.modal-content 是 max-height:90vh + overflow-y:auto，
   内容一长就会滚动。关闭按钮若绝对定位会被滚出视野、等于没加；
   做成 sticky 标题条后，无论滚到哪、切到哪个标签页，X 都点得到。
   负 margin 抵消 .modal-content 的 22px padding，让标题条满宽贴住弹窗顶边。 */
/* 有标题条的弹窗：顶部内边距交给标题条自己管。
   不能靠负 margin 把标题条拉到弹窗顶 —— sticky 元素不得超出包含块的内容盒，
   Firefox/Chrome 都会把 -22px 夹回内容盒顶，结果是标题条下移、
   弹窗顶部留出 22px 的缝，滚动时内容从缝里穿过去（实测：负 margin 时 23px，static 时 1px）。 */
.modal-content.has-head { padding-top: 0; }
.modal-head {
  position: sticky; top: 0; z-index: 3;
  /* 顶对齐而不是垂直居中：这样标题距离弹窗顶边恰好等于 --modal-pad，
     与无标题条时完全一致，任何宽度下都不需要补偿值。 */
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 0 calc(-1 * var(--modal-pad)) 14px;
  padding: var(--modal-pad) var(--modal-pad) 12px;
  background: var(--surface-solid);
  border-bottom: 1px solid rgba(148,163,184,0.2);
}
.modal-head h3 { margin: 0; padding: 0; border-bottom: 0; }
.modal-close {
  flex: 0 0 auto; width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(148,163,184,0.35); border-radius: 50%;
  background: var(--surface-solid); color: var(--text-3);
  font-size: 0.92rem; line-height: 1; cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.modal-close:hover { background: rgba(148,163,184,0.14); color: var(--text-1); border-color: rgba(148,163,184,0.55); }
.modal-close:active { background: rgba(148,163,184,0.22); }
.modal-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .modal-close { transition: none; } }

/* 5 个「居中标题」弹窗（.safety-modal-header：签到/邀请/广告/安全/友链）同样要有右上角 X。
   这里不改成左右布局，保留原来的居中排版：
   只把标题条变成粘顶，X 用绝对定位钉在标题条右上角（sticky 是定位元素，可作包含块）。
   容器 padding-top 同样归零交给标题条，理由见 .modal-head 上方注释。 */
.modal-content.has-head .safety-modal-header {
  position: sticky; top: 0; z-index: 3;
  margin: 0 calc(-1 * var(--modal-pad)) 16px;
  padding: var(--modal-pad) var(--modal-pad) 12px;
  background: var(--surface-solid);
}
.modal-content.has-head .safety-modal-header .modal-close {
  position: absolute; top: var(--modal-pad); right: var(--modal-pad);
}

/* 弹窗内滚动条：长弹窗右侧会多出一条灰条，用户觉得难看 —— 隐藏掉。
   只藏滚动条本身，overflow-y:auto 照旧，滚轮/触摸照样能滚；
   配合上面的 sticky 标题条，「下面还有内容」依然看得出来。
   注意这里不写 overflow-x:hidden —— 那会把真的横向溢出内容变成够不到。 */
.modal-content { scrollbar-width: none; -ms-overflow-style: none; }
.modal-content::-webkit-scrollbar { width: 0; height: 0; display: none; }
.safety-modal-header { text-align: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(148,163,184,0.2); }
.safety-modal-header h3 { margin: 6px 0 2px; font-size: 1.05rem; border-bottom: none; padding-bottom: 0; }
.safety-modal-header i { display: inline-block; background: rgba(59,130,246,0.1); width: 42px; height: 42px; line-height: 42px; border-radius: 50%; margin-bottom: 4px; color: var(--brand); }
.modal-content .form-group { margin-bottom: 12px; }
.modal-content label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.8rem; color: var(--text-1); }
.modal-content input, .modal-content select, .modal-content textarea {
  width: 100%; padding: 8px 12px; border: 1px solid rgba(148,163,184,0.3); border-radius: 8px;
  font-size: 0.85rem; outline: none; background: var(--surface-input);
}
.modal-content input:focus, .modal-content select:focus, .modal-content textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); background: var(--surface-solid); }
.modal-content input[type="checkbox"] { width: auto; }

/* 安全弹窗 */
#safetyModal { display: none; visibility: hidden; opacity: 0; }
#safetyModal.active { display: flex; visibility: visible; opacity: 1; }
.safety-dialog { background: var(--surface-solid); border-radius: var(--r-lg); width: 90%; max-width: 480px; backdrop-filter: blur(24px); box-shadow: var(--glass-shadow); padding: 28px 24px; }
.safety-dialog-header { text-align: center; margin-bottom: 16px; }
.safety-dialog-icon { display: inline-block; width: 50px; height: 50px; line-height: 50px; border-radius: 50%; background: rgba(59,130,246,0.1); color: var(--brand); font-size: 1.3rem; margin-bottom: 8px; }
.safety-dialog-header h3 { font-size: 1.05rem; color: var(--text-1); margin: 4px 0 0; font-weight: 800; }
.safety-dialog-body { max-height: 40vh; overflow-y: auto; font-size: 0.86rem; color: var(--text-2); line-height: 1.7; padding: 14px; background: var(--surface-soft); border-radius: 10px; margin-bottom: 20px; }
.safety-dialog-footer { text-align: center; }
.safety-btn { padding: 11px 36px; border: none; border-radius: 12px; background: var(--grad); color: #fff; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all 0.2s; box-shadow: 0 6px 18px rgba(37,99,235,0.3); }
.safety-btn:hover:not(:disabled) { transform: translateY(-1px); }
.safety-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   设置页
   ========================================================================== */
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.settings-btn {
  display: flex; align-items: center; width: 100%; padding: 15px 16px; border: none;
  background: var(--surface-input); cursor: pointer; font-size: 0.86rem; border-radius: var(--r-md);
  text-align: left; color: var(--text-1); border: 1px solid rgba(148,163,184,0.2);
  backdrop-filter: blur(10px); transition: all 0.2s;
}
.settings-btn:hover { color: var(--brand); transform: translateY(-1px); border-color: var(--brand); box-shadow: 0 6px 18px rgba(30,58,138,0.1); }
.settings-btn-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-right: 14px; font-size: 1.05rem; flex-shrink: 0; background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
.settings-btn-label { flex: 1; font-weight: 600; }
.settings-btn-arrow { color: var(--text-4); font-size: 0.78rem; margin-left: 8px; }
.settings-btn:hover .settings-btn-arrow { color: var(--brand); }

/* ---- 分组容器（把 16 项按主题分块，页面不再是一条长列表） ---- */
.stg-wrap { display: flex; flex-direction: column; gap: 14px; }
.stg-grp {
  background: rgba(248,250,252,0.6); border: 1px solid rgba(148,163,184,0.18);
  border-radius: var(--r-lg); overflow: hidden;
}
.stg-hd {
  display: flex; align-items: center; gap: 7px; padding: 9px 13px;
  background: var(--surface-input); border-bottom: 1px solid rgba(148,163,184,0.16);
}
.stg-hd i { font-size: 0.72rem; color: var(--brand); }
.stg-hd h4 { font-size: 0.76rem; font-weight: 800; color: var(--text-1); letter-spacing: 0.01em; }
.stg-hd small { margin-left: auto; font-size: 0.6rem; color: var(--text-4); font-weight: 600; }
.stg-bd { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
/* 分组后按钮改用更紧凑的样式（原来的 15px 内边距是为长列表留的） */
.stg-bd .settings-btn { padding: 9px 11px; font-size: 0.81rem; background: var(--surface-solid); }
.stg-bd .settings-btn-icon { width: 30px; height: 30px; border-radius: 9px; margin-right: 10px; font-size: 0.8rem; box-shadow: none; }
.stg-bd .settings-btn-label { font-weight: 600; }
.stg-bd .settings-btn-arrow { font-size: 0.7rem; }
@media (min-width: 860px) {
  /* 宽屏时同组内按钮并排，进一步压缩高度 */
  .stg-bd { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
}

.cleanup-section { background: var(--surface-soft); border-radius: 12px; padding: 15px; margin-bottom: 10px; border: 1px solid rgba(148,163,184,0.2); }
.cleanup-section-title { font-size: 0.84rem; font-weight: 700; color: var(--text-1); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(148,163,184,0.2); }
.cleanup-section-title i { margin-right: 6px; color: var(--brand); }
.cleanup-btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cleanup-btn { padding: 6px 12px; border-radius: 8px; font-size: 0.74rem; border: 1px solid rgba(148,163,184,0.3); background: var(--surface-input); color: var(--text-2); cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.cleanup-btn:hover { background: var(--surface-solid); border-color: rgba(148,163,184,0.5); }
.cleanup-btn i { margin-right: 3px; font-size: 0.66rem; }
.cleanup-btn.danger { color: var(--danger); border-color: rgba(254,202,202,0.7); background: rgba(254,242,242,0.7); }
.cleanup-btn.danger:hover { background: #fee2e2; }
.cleanup-date-row { display: flex; gap: 6px; align-items: center; }
.cleanup-date-row label { font-size: 0.72rem; color: var(--text-3); white-space: nowrap; }
.cleanup-date-row input[type="date"] { flex: 1; padding: 6px 8px; border: 1px solid rgba(148,163,184,0.3); border-radius: 8px; font-size: 0.74rem; background: var(--surface-input); outline: none; }
.cleanup-date-row input[type="date"]:focus { border-color: var(--brand); }
.cleanup-hint { font-size: 0.62rem; color: var(--text-4); margin-top: 8px; text-align: center; }

/* 日志标签 / 状态点 */
.log-api-tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 0.56rem; font-weight: 700; }
.log-api-tag.api1 { background: rgba(59,130,246,0.1); color: var(--brand); }
.log-api-tag.api2 { background: rgba(236,253,245,0.8); color: #059669; }
.log-api-tag.unknown { background: rgba(226,232,240,0.7); color: var(--text-3); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.status-dot.unused { background: var(--success); }
.status-dot.used { background: var(--text-4); }

.avatar-area { text-align: center; margin-bottom: 24px; }
.profile-content { padding: 24px; }

/* 移动端卡片（JS 动态生成的内联样式容器） */
.mobile-card { display: none; }
.mobile-card > div {
  background: var(--surface-input) !important;
  border: 1px solid rgba(148,163,184,0.22) !important;
  border-radius: 14px !important;
  padding: 12px !important; margin-bottom: 10px !important;
  backdrop-filter: blur(10px);
}
.mobile-card > div strong { color: var(--text-1); }

/* ==========================================================================
   响应式
   ========================================================================== */
.desktop-table { display: block; }
.mobile-card { display: none; }

@media (min-width: 769px) {
  .desktop-table { display: block !important; }
  .mobile-card { display: none !important; }
  .bottom-nav { display: none !important; }
  .fab-group { display: none !important; }
  .top-nav { display: flex !important; }
}

@media (max-width: 768px) {
  .desktop-table { display: none !important; }
  .mobile-card { display: block !important; }
  .bottom-nav { display: flex !important; }
  .fab-group { display: flex !important; }
  .top-nav { display: none !important; }
}

/* 平板 */
@media (max-width: 768px) {
  .admin-body { padding: 8px 8px 60px; font-size: 13px; }
  .dashboard-body { padding: 16px 12px 60px; }
  .top-header { padding: 14px 14px; border-radius: var(--r-lg); margin-bottom: 12px; }
  .header-logo { width: 36px; height: 36px; font-size: 1rem; border-radius: 12px; }
  .header-btn { font-size: 0.68rem; padding: 6px 10px; }
  .top-nav-item { font-size: 0.7rem; padding: 9px 4px; gap: 4px; }
  .top-nav-item i { font-size: 0.8rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar form { display: flex; flex-direction: column; gap: 6px; }
  .filter-bar input, .filter-bar select { width: 100%; }
  .page-card .card-title { font-size: 0.84rem; padding: 10px 14px; }
  .page-card .card-body { padding: 10px 12px; }
  .ov-row { padding: 4px 10px; }
  .ov-v { font-size: 0.86rem; }
  .ov-ph { padding: 8px 10px; }
  .cards-stats span { font-size: 0.76rem; margin: 0 6px; }
  .flex-between { flex-direction: column; align-items: stretch; }
  .tab-bar { justify-content: center; }
  .tab-btn { font-size: 0.68rem; padding: 4px 12px; }
  .pagination { justify-content: center; }
  .pagination a { padding: 4px 9px; font-size: 0.7rem; }
  .modal-content { --modal-pad: 16px; width: 95%; padding: var(--modal-pad); }
  .hero-stats { gap: 8px; }
  .hero-stat { padding: 12px 6px; }
  .hero-stat-num { font-size: 1.3rem; }
}

/* 手机 */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .auth-container { padding: clamp(12px, 4vw, 24px); align-items: center !important; }
  .auth-card-header { padding: 26px 18px 20px; }
  .auth-card-header .auth-icon { width: 54px; height: 54px; font-size: 1.5rem; }
  .auth-card-body { padding: 22px 18px 18px; }
  .hero-top { flex-direction: column; text-align: center; gap: 12px; }
  .hero-actions { justify-content: center; }
  .hero-avatar { width: 48px; height: 48px; }
  .hero-name { font-size: 1.1rem; }
  .hero-stats { grid-template-columns: repeat(3,1fr); gap: 6px; }
  .hero-stat { padding: 10px 4px; }
  .hero-stat-num { font-size: 1.15rem; }
  .hero-stat-label { font-size: 0.56rem; }
  .action-buttons { flex-direction: column; }
  .action-buttons .btn-primary { width: 100%; }
  .query-section, .card { padding: 16px !important; }
  .history-card, .result-card { padding: 16px !important; }
  .result-box { padding: 18px 14px; min-height: 120px; }
  .result-toolbar { justify-content: space-between; flex-wrap: nowrap; }
  .result-search-group { flex: 1 1 auto; min-width: 180px; margin-right: 8px; }
  .result-search-group input { width: 100%; min-width: 0; }
  .promo-card { flex-direction: column; text-align: center; padding: 14px 16px; }
  .promo-link { width: 100%; text-align: center; }
  .modal-container { width: 94%; padding: 22px 18px; }
  .profile-page { padding: 12px; }
  .profile-header { padding: 28px 18px; }
  .profile-body { padding: 22px 18px; }
}

/* 小屏 */
/* 超窄屏 400px 已并入 420px：两者只差 20px，手机宽度普遍在 360–430px，
   分开写只会让同一条规则散在两处、改一处忘一处。 */
@media (max-width: 420px) {
  .visit-stats { gap: 14px; }
  /* 超窄屏: 徽章紧凑显示 */
  .friend-links-badge { padding: 3px 8px; }
  .friend-links-title { font-size: 0.92rem; }
}

/* 大屏 */
@media (min-width: 1200px) {
  .container, .admin-container { max-width: 1100px; }
}

@media print {
  .bottom-nav, .fab-group, .hero-actions, .ad-card, .invite-share { display: none !important; }
  body { background: var(--surface-solid); }
}
/* ==========================================================================
   全站板块动画增强 v50
   ========================================================================== */

/* ---- 登录/注册/忘记密码: 认证卡片入场 + 头部流光 ---- */
.login-container,
.register-container,
.reset-container {
  animation: blockRiseIn 0.65s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes blockRiseIn {
  0% { opacity: 0; transform: translateY(28px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 认证图标: 持续呼吸悬浮 */
.auth-card-header .auth-icon {
  animation: iconBob 3.2s ease-in-out infinite;
}
@keyframes iconBob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 认证头部: 流光斜扫 */
.auth-card-header::before {
  animation: headerShine 6s linear infinite;
}
@keyframes headerShine {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* 认证输入组: 错峰滑入 */
.auth-card-body .input-group {
  opacity: 0;
  animation: groupSlideIn 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
.auth-card-body .input-group:nth-child(1) { animation-delay: 0.12s; }
.auth-card-body .input-group:nth-child(2) { animation-delay: 0.2s; }
.auth-card-body .input-group:nth-child(3) { animation-delay: 0.28s; }
.auth-card-body .input-group:nth-child(4) { animation-delay: 0.36s; }
.auth-card-body .input-group:nth-child(5) { animation-delay: 0.44s; }
@keyframes groupSlideIn {
  0% { opacity: 0; transform: translateX(-18px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* 提交按钮: 呼吸光晕 */
.auth-submit-btn, .profile-submit-btn {
  animation: btnBreathe 3s ease-in-out infinite;
}
@keyframes btnBreathe {
  0%,100% { box-shadow: 0 8px 22px rgba(37,99,235,0.3); }
  50% { box-shadow: 0 8px 30px rgba(37,99,235,0.5); }
}

/* 认证页底部链接: 微动 */
.auth-footer { animation: fadeInUp 0.6s ease 0.5s both; }
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- 个人资料页 ---- */
.profile-card { animation: blockRiseIn 0.65s cubic-bezier(0.22,1,0.36,1) both; }
.profile-avatar { animation: iconBob 3.5s ease-in-out infinite; }
.profile-header::before { animation: headerShine 7s linear infinite; }
.profile-body .form-group {
  opacity: 0;
  animation: groupSlideIn 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
.profile-body .form-group:nth-child(1) { animation-delay: 0.15s; }
.profile-body .form-group:nth-child(2) { animation-delay: 0.24s; }
.profile-body .form-group:nth-child(3) { animation-delay: 0.33s; }
.profile-body .form-group:nth-child(4) { animation-delay: 0.42s; }
.profile-body .form-group:nth-child(5) { animation-delay: 0.51s; }
.profile-footer { animation: fadeInUp 0.6s ease 0.55s both; }

/* ---- 管理后台 ---- */
/* 总览页新版式（.ov-hero / .ov-panel）的入场由内联样式里的关键帧驱动，
   .stats-grid/.stat-card 已不再被任何页面使用，原逐卡错峰规则一并移除。 */


/* 设置项: 分组错峰滑入（原来按 16 个按钮逐条延迟，分组后那样会太拖） */
.stg-grp {
  opacity: 0;
  animation: groupSlideIn 0.45s cubic-bezier(0.22,1,0.36,1) forwards;
}
.stg-grp:nth-child(1) { animation-delay: 0.06s; }
.stg-grp:nth-child(2) { animation-delay: 0.12s; }
.stg-grp:nth-child(3) { animation-delay: 0.18s; }
.stg-grp:nth-child(4) { animation-delay: 0.24s; }
.stg-grp:nth-child(5) { animation-delay: 0.3s; }

/* 页签切换: 淡入 */
.page.active { animation: pageFade 0.4s ease both; }
@keyframes pageFade {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* rz 页表格: 行悬停滑动 */
.table-responsive table tbody tr { transition: all 0.25s; }
.table-responsive table tbody tr:hover { background: rgba(37,99,235,0.05); transform: translateX(3px); }
.rz-container, .rz-page .card { animation: blockRiseIn 0.6s cubic-bezier(0.22,1,0.36,1) both; }

/* 尊重系统减少动态设置 */
@media (prefers-reduced-motion: reduce) {
  .login-container, .register-container, .reset-container,
  .auth-card-header .auth-icon, .auth-card-header::before,
  .auth-card-body .input-group, .auth-submit-btn, .profile-submit-btn,
  .auth-footer, .profile-card, .profile-avatar, .profile-header::before,
  .profile-body .form-group, .profile-footer,
  .ov-hero-cell, .ov-panel, .stg-grp {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== 游客模式 · 登录/分享引导(蓝主题) ===== */
.hero-auth-btn {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  justify-content: center; padding: 6px 14px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.2px;
  border-radius: 999px; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  text-decoration: none; white-space: nowrap;
  overflow: hidden; font-family: inherit;
}
.hero-auth-btn i { font-size: 11px; line-height: 1; }

/* 登录 = 主按钮: 实心渐变 */
.guest-login-btn {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff; border: 1px solid rgba(255,255,255,.3);
  box-shadow: 0 3px 10px rgba(37,99,235,.35);
}
.guest-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37,99,235,.45);
}
.guest-login-btn:active { transform: translateY(1px); box-shadow: 0 1px 4px rgba(37,99,235,.3); }

/* 注册 = 次按钮: 玻璃描边 */
.guest-register-btn {
  background: rgba(255,255,255,.14);
  color: #fff; border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.guest-register-btn:hover {
  background: rgba(255,255,255,.24);
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.85);
}
.guest-register-btn:active { transform: translateY(1px); }

/* 游客登录提示弹窗(系统蓝主题) */
.guest-login-dialog {
  position: relative; width: min(420px, 92%);
  background: var(--surface-input);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 22px; padding: 34px 30px 28px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(30, 58, 138, .18);
  animation: modalIn .28s ease;
  will-change: transform, opacity;
  transition: opacity .25s ease, transform .25s ease;
}
.guest-login-icon {
  width: 60px; height: 60px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .32);
}
.guest-login-dialog h3 { margin: 0 0 8px; font-size: 19px; color: #1e3a8a; }
.guest-login-dialog p { margin: 0 auto 22px; font-size: 14px; color: #49639b; max-width: 300px; line-height: 1.6; }
.guest-login-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.guest-login-btn-primary {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 22px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff; font-size: 14px; font-weight: 600;
  border: none; border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
  transition: transform .25s ease, box-shadow .25s ease;
}
.guest-login-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(37, 99, 235, .38); }
.guest-login-btn-ghost {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 22px;
  background: rgba(37, 99, 235, .08); color: #2563eb; font-size: 14px; font-weight: 600;
  border: 1.5px solid rgba(37, 99, 235, .3); border-radius: 999px; cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}
.guest-login-btn-ghost:hover { background: rgba(37, 99, 235, .15); transform: translateY(-2px); }
.guest-login-close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(30, 58, 138, .08); color: #3b4a8f; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s ease, transform .25s ease;
}
.guest-login-close:hover { background: rgba(30, 58, 138, .16); transform: rotate(90deg); }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
  .hero-auth-btn { padding: 5px 12px; font-size: 12px; gap: 4px; }
  .guest-register-btn { padding: 8px 14px; }
  .guest-login-dialog { padding: 28px 20px 22px; }
  .guest-login-actions { flex-direction: column; }
  .guest-login-btn-primary, .guest-login-btn-ghost { width: 100%; justify-content: center; }
}
/* ===== SPA toast ===== */
.toast-msg{display:none;position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:9999;background:linear-gradient(135deg,rgba(37,99,235,.95),rgba(14,165,233,.95));color:#fff;padding:11px 22px;border-radius:12px;box-shadow:0 6px 20px rgba(37,99,235,.35);font-size:14px;font-weight:600;max-width:90vw;text-align:center;animation:toastIn .3s ease,toastOut .3s ease 2.2s forwards;pointer-events:none}
.toast-msg.error{background:linear-gradient(135deg,rgba(239,68,68,.95),rgba(244,63,94,.95));box-shadow:0 6px 20px rgba(239,68,68,.35)}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,-12px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes toastOut{from{opacity:1}to{opacity:0}}

/* ===== SPA 积分不足提示 ===== */
.no-point-tip{display:flex;flex-direction:column;align-items:center;gap:12px;padding:20px 16px;margin:12px 0 4px;background: var(--surface-input);border:1px solid rgba(239,68,68,0.28);border-radius:14px;backdrop-filter:blur(10px);animation:blockRiseIn .4s both}
.no-point-msg{color:#ef4444;font-size:0.92rem;font-weight:700;text-align:center;margin:0;display:flex;align-items:center;gap:8px}
.no-point-msg i{font-size:1.05rem;color:#ef4444}
.no-point-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 36px;border:none;border-radius:12px;background:var(--grad);color:#fff;font-size:0.92rem;font-weight:700;cursor:pointer;box-shadow:0 6px 18px rgba(37,99,235,0.3);transition:all .2s}
.no-point-btn:hover{filter:brightness(1.07);transform:translateY(-1px)}
.no-point-btn:active{transform:scale(0.97)}
.no-point-btn i{font-size:0.95rem}

/* SPA toast 显示控制 */
.toast-msg.visible{display:block}

/* ===== SPA 弹窗（积分不足 / 会员制升级）· 版式 =====
   按钮蓝一律取系统主题变量（--grad / --brand），改主题时自动跟随。
   徽章图标保留黄色（--warning 系），与蓝按钮形成"会员 = 金色"的语义分工。
   按钮层级：-primary 蓝实心 > -secondary 蓝描边 > -ghost 灰描边
   （-ghost 当前无模板引用，保留为第三层级备用；本区块曾出现「用了但没定义」的塌陷，勿删）。
   关闭用右上角 .nopoint-close（同 .guest-login-close 惯例）。
   注意：dashboard.php 曾有同名内联样式覆盖本区块，已删除；新增规则一律写在这里。 */
.nopoint-dialog{position:relative;overflow:hidden;background:linear-gradient(168deg,#ffffff 0%,#f7fbff 100%);border:1px solid rgba(255,255,255,0.9);border-radius:22px;width:92%;max-width:380px;text-align:center;padding:32px 26px 22px;backdrop-filter:blur(24px);box-shadow:0 24px 60px rgba(15,23,42,0.18),inset 0 1px 0 rgba(255,255,255,0.9);animation:nopointIn .38s cubic-bezier(.22,1,.36,1) both}
@keyframes nopointIn{from{opacity:0;transform:translateY(22px) scale(.94)}to{opacity:1;transform:translateY(0) scale(1)}}
.nopoint-ornament{position:absolute;top:-70px;right:-56px;width:190px;height:190px;border-radius:50%;background:radial-gradient(circle,rgba(37,99,235,0.13),rgba(14,165,233,0.07) 55%,transparent 72%);pointer-events:none}
.nopoint-icon-wrap{position:relative;width:78px;height:78px;margin:0 auto 16px;border-radius:50%;background:linear-gradient(135deg,rgba(255,255,255,0.95),rgba(255,255,255,0.7));display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 6px rgba(245,158,11,0.14),0 10px 24px rgba(245,158,11,0.22)}
.nopoint-icon{width:60px;height:60px;border-radius:50%;background:linear-gradient(135deg,#f59e0b,#f97316);display:flex;align-items:center;justify-content:center;color:#fff;font-size:1.5rem;box-shadow:0 6px 16px rgba(245,158,11,0.34)}
.nopoint-title{position:relative;font-size:1.14rem;color:#0f172a;margin:0 0 10px;font-weight:700}
.nopoint-desc{position:relative;font-size:0.88rem;color:#475569;line-height:1.72;margin:0 0 22px;text-wrap:pretty}
.nopoint-desc strong{color:#0f172a;font-weight:700}
.nopoint-actions{position:relative;display:flex;flex-direction:column;gap:9px}
.nopoint-btn-primary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:13px 0;border:none;border-radius:13px;background:var(--grad);color:#fff;font-size:0.95rem;font-weight:700;cursor:pointer;box-shadow:0 8px 22px rgba(37,99,235,0.32);transition:filter .2s,transform .2s,box-shadow .2s}
.nopoint-btn-primary:hover{filter:brightness(1.08);transform:translateY(-2px);box-shadow:0 12px 28px rgba(37,99,235,0.4)}
.nopoint-btn-primary:active{transform:scale(.98)}
.nopoint-btn-primary i{font-size:1rem}
.nopoint-btn-secondary i,.nopoint-btn-ghost i{font-size:1rem}
.nopoint-btn-secondary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 0;border:1px solid rgba(37,99,235,0.26);border-radius:13px;background:rgba(37,99,235,0.06);color:var(--brand);font-size:0.92rem;font-weight:700;cursor:pointer;transition:background .2s,border-color .2s,transform .2s}
.nopoint-btn-secondary:hover{background:rgba(37,99,235,0.11);border-color:rgba(37,99,235,0.42);transform:translateY(-1px)}
.nopoint-btn-secondary:active{transform:scale(.975)}
.nopoint-btn-ghost{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:11px 0;border:1px solid rgba(148,163,184,0.35);border-radius:13px;background: var(--surface-soft);color:#475569;font-size:0.88rem;font-weight:600;cursor:pointer;transition:background .2s,color .2s,border-color .2s,transform .2s}
.nopoint-btn-ghost:hover{background:#f1f5f9;color:#1e293b;border-color:rgba(148,163,184,0.5)}
.nopoint-btn-ghost:active{transform:scale(.975)}
.nopoint-close{position:absolute;top:14px;right:16px;z-index:2;width:34px;height:34px;border:none;border-radius:50%;background:rgba(30,58,138,0.08);color:#3b4a8f;font-size:15px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .25s ease,transform .25s ease}
.nopoint-close:hover{background:rgba(30,58,138,0.16);transform:rotate(90deg)}
.nopoint-dialog button:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
@media (max-width:420px){.nopoint-dialog{padding:28px 20px 18px}.nopoint-icon-wrap{width:70px;height:70px;margin-bottom:14px}.nopoint-icon{width:54px;height:54px;font-size:1.35rem}.nopoint-title{font-size:1.06rem}}
@media (prefers-reduced-motion:reduce){.nopoint-dialog{animation:none}.nopoint-btn-primary,.nopoint-btn-primary:hover,.nopoint-btn-primary:active,.nopoint-btn-secondary,.nopoint-btn-secondary:active,.nopoint-btn-ghost,.nopoint-btn-ghost:active,.nopoint-close,.nopoint-close:hover{transition:none;transform:none}}

/* ==========================================================================
   数据总览图表（admin-charts.js 专用，前缀 ch-）
   图表全部是手写内联 SVG：站点 CSP 为 script-src 'self'，外链图表库会被拦。
   ========================================================================== */
.ch-chart { width: 100%; }

.ch-legend {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 8px; font-size: 0.72rem; color: var(--text-3);
}
.ch-legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ch-mark { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }

.ch-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid-line { stroke: rgba(148,163,184,0.22); stroke-width: 1; shape-rendering: crispEdges; }
.ch-axis { stroke: rgba(148,163,184,0.45); stroke-width: 1; shape-rendering: crispEdges; }
.ch-tick, .ch-xlab { fill: var(--text-4); font-size: 9px; }
.ch-ballab { fill: var(--text-3); font-size: 9px; font-weight: 600; }
.ch-ballab.is-zero { fill: var(--text-4); font-weight: 400; }

.ch-line {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1400;
  animation: chDraw 0.9s ease-out both;
}
@keyframes chDraw { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
.ch-hit { cursor: pointer; }
.ch-dot { transition: r 0.15s ease; }
.ch-pt:hover .ch-dot { r: 4; }
.ch-bar { transition: opacity 0.15s ease; }
.ch-bar:hover { opacity: 0.82; }
.ch-ballab, .ch-dot, .ch-bar, .ch-bar-zero, .ch-empty { animation: chFade 0.5s ease-out both; }
@keyframes chFade { from { opacity: 0; } to { opacity: 1; } }
.ch-bar-zero { fill: rgba(148,163,184,0.45); }

.ch-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ch-donut-box { flex: 0 0 160px; width: 160px; max-width: 46%; }
.ch-arc { transition: opacity 0.15s ease; animation: chArcIn 0.7s ease-out both; }
.ch-arc:hover { opacity: 0.75; }
@keyframes chArcIn { from { opacity: 0; } to { opacity: 1; } }
.ch-donut-total { fill: var(--text-1); font-size: 19px; font-weight: 700; }
.ch-donut-cap { fill: var(--text-4); font-size: 9px; }

.ch-lg-list { flex: 1 1 160px; min-width: 0; font-size: 0.74rem; }
.ch-lg-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.ch-lg-name { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-lg-val { margin-left: auto; color: var(--text-1); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch-lg-val em { color: var(--text-4); font-style: normal; font-weight: 400; }

.ch-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 140px; color: var(--text-4); font-size: 0.78rem;
}

.ch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.ch-grid > .page-card { margin-bottom: 0; min-width: 0; }

/* 统计页：.ov-grid（5 个主题面板）下面紧跟 .ch-grid（图表卡）。
   两者原本都没有纵向 margin，相邻板块会零间距贴在一起 —— 补一个上边距。
   只针对紧跟 .ov-grid 的那一行图表卡，避免 .ch-grid-4 也被加、叠成 30px。 */
.ov-grid + .ch-grid { margin-top: 16px; }
@media (max-width: 1100px) { .ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ch-donut-wrap { gap: 12px; }
  .ch-donut-box { flex-basis: 130px; width: 130px; max-width: 42%; }
}

/* 天数切换：分段控件。放在卡片标题下方，不和标题抢视觉重心 */
.ch-switch { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: 10px;
  background: rgba(241,245,249,0.9); border: 1px solid rgba(148,163,184,0.22); border-radius: 9px; }
.ch-sw-btn {
  padding: 3px 11px; border: 0; border-radius: 7px; background: transparent;
  font-family: inherit; font-size: 0.7rem; font-weight: 700; color: var(--text-3);
  cursor: pointer; transition: background .16s ease, color .16s ease;
}
.ch-sw-btn:hover { color: var(--brand); }
.ch-sw-btn.active { background: var(--surface-solid); color: var(--brand); box-shadow: 0 1px 3px rgba(15,23,42,0.1); }

@media (prefers-reduced-motion: reduce) {
  .ch-line, .ch-bar, .ch-bar-zero, .ch-ballab, .ch-dot, .ch-arc, .ch-empty { animation: none; }
  .ch-line { stroke-dasharray: none; }
  .ch-dot, .ch-bar, .ch-arc { transition: none; }
}

/* ===== 邮箱与注册设置弹窗 ===== */
.switch-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 0.78rem;
  color: var(--text-2); font-weight: 400; cursor: pointer; line-height: 1.5; }
.switch-row input[type="checkbox"] { margin: 2px 0 0; flex-shrink: 0; width: 15px; height: 15px;
  accent-color: var(--brand); cursor: pointer; }
.modal-select { width: 100%; padding: 10px 12px; border: 1px solid rgba(148,163,184,0.35);
  border-radius: var(--r-md); font-size: 0.82rem; font-family: inherit; color: var(--text-1);
  background: var(--surface-solid); outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.modal-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.input-hint { margin-top: 6px; font-size: 0.72rem; color: var(--text-4); line-height: 1.55; }
.modal-hr { border: 0; border-top: 1px solid rgba(148,163,184,0.2); margin: 16px 0 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row-2 { grid-template-columns: 1fr; } }

.mail-result { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md);
  font-size: 0.76rem; line-height: 1.6; word-break: break-word; }
.mail-result.ok  { background: rgba(16,185,129,0.1);  color: #047857; border: 1px solid rgba(16,185,129,0.3); }
.mail-result.err { background: rgba(239,68,68,0.08);  color: #b91c1c; border: 1px solid rgba(239,68,68,0.28); }

.mail-logs-sum { font-size: 0.74rem; color: var(--text-3); padding-bottom: 8px;
  border-bottom: 1px solid rgba(148,163,184,0.18); margin-bottom: 6px; }
.mail-logs-empty { padding: 32px 0; text-align: center; color: var(--text-4); font-size: 0.8rem; }
.mail-logs-list { max-height: 46vh; overflow-y: auto; }
.mail-log-row { display: flex; gap: 9px; align-items: flex-start; padding: 9px 2px;
  border-bottom: 1px dashed rgba(148,163,184,0.16); }
.mail-log-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.mail-log-dot.ok  { background: var(--success); }
.mail-log-dot.err { background: var(--danger); }
.mail-log-main { flex: 1; min-width: 0; }
.mail-log-top { display: flex; gap: 7px; align-items: baseline; flex-wrap: wrap; }
.mail-log-top b { font-size: 0.76rem; color: var(--text-1); word-break: break-all; }
.mail-log-top em { font-style: normal; font-size: 0.64rem; font-weight: 700; color: var(--brand);
  background: rgba(37,99,235,0.09); padding: 1px 6px; border-radius: 5px; }
.mail-log-sub { font-size: 0.7rem; color: var(--text-4); margin-top: 2px; }
.mail-log-err { font-size: 0.69rem; color: #b91c1c; margin-top: 3px; word-break: break-word; line-height: 1.5; }
.mail-log-time { font-size: 0.66rem; color: var(--text-4); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* 找回密码：QQ / 邮箱 双通道切换 */
.via-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 3px;
  background: rgba(241,245,249,0.9); border: 1px solid rgba(148,163,184,0.22);
  border-radius: var(--r-md); }
.via-tab { flex: 1; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  font-family: inherit; font-size: 0.78rem; font-weight: 700; color: var(--text-3);
  cursor: pointer; transition: background .16s ease, color .16s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.via-tab:hover { color: var(--brand); }
.via-tab.active { background: var(--surface-solid); color: var(--brand); box-shadow: 0 1px 3px rgba(15,23,42,0.1); }

/* 构成环形图一行四张：它们都是「部分占整体」，等宽并排才便于横向对比。
   这一档卡片较窄（约 260px），所以把图例压到环下方整宽显示，
   而不是硬挤在环右侧 —— 右侧只剩 ~120px，中文标签会被省略号切掉。 */
.ch-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ch-grid-4 .ch-donut-wrap { flex-direction: column; align-items: stretch; gap: 10px; }
.ch-grid-4 .ch-donut-box { align-self: center; flex: 0 0 auto; width: 138px; max-width: 100%; }
.ch-grid-4 .ch-lg-list { flex: 0 0 auto; font-size: 0.7rem; }
.ch-grid-4 .ch-lg-row { padding: 2px 0; }
.ch-grid-4 .ch-lg-name { flex: 1 1 auto; }
@media (max-width: 1100px) { .ch-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .ch-grid-4 { grid-template-columns: 1fr; }
  .ch-grid-4 .ch-donut-box { width: 156px; }
}
/* 趋势图是唯一的时间序列，需要横向空间，占两列 */
.ch-span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .ch-span-2 { grid-column: span 2; } }
@media (max-width: 700px) { .ch-span-2 { grid-column: span 1; } }

/* ===== 故障补偿弹窗 =====
   宽度比常规弹窗大：体检要放表格、补天数要放预览名单，440px 里挤不下。
   三块内容用 tab 分开而不是一路往下堆 —— 这是「决策前看清影响面」的工具，
   一次只呈现一个判断，不该让人滚动着找按钮。 */
.cmp-modal { max-width: 560px; }

.cmp-tabs { display: flex; gap: 4px; margin: 2px 0 16px; padding: 4px;
  background: rgba(148,163,184,0.1); border-radius: var(--r-md); }
.cmp-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 6px; border: none; border-radius: var(--r-sm); background: transparent;
  font-family: inherit; font-size: 0.76rem; font-weight: 700; color: var(--text-3);
  cursor: pointer; transition: background .16s, color .16s; }
.cmp-tab:hover { color: var(--text-1); }
.cmp-tab.active { background: var(--surface-solid); color: var(--brand); box-shadow: 0 1px 3px rgba(15,23,42,0.08); }

.cmp-pane { display: none; }
.cmp-pane.active { display: block; }

.cmp-range { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cmp-range label { font-size: 0.75rem; font-weight: 700; color: var(--text-2); }

.cmp-body { min-height: 90px; }
.cmp-loading { text-align: center; padding: 26px 0; font-size: 0.76rem; color: var(--text-4); }
.cmp-empty { text-align: center; padding: 24px 14px; font-size: 0.76rem; color: var(--text-3);
  line-height: 1.7; background: rgba(148,163,184,0.07); border-radius: var(--r-md); }

/* 失败率：这是「要不要补偿」的核心判断依据，所以给足视觉权重 */
.cmp-health { display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 0 12px; border-radius: var(--r-md); margin-bottom: 12px; }
.cmp-health.good { background: rgba(16,185,129,0.09); }
.cmp-health.warn { background: rgba(245,158,11,0.11); }
.cmp-health.bad  { background: rgba(239,68,68,0.1); }
.cmp-health-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cmp-health.good .cmp-health-num { color: var(--success); }
.cmp-health.warn .cmp-health-num { color: var(--warning); }
.cmp-health.bad  .cmp-health-num { color: var(--danger); }
.cmp-health-lb { font-size: 0.68rem; color: var(--text-3); margin-top: 2px; letter-spacing: .04em; }
.cmp-health-meta { font-size: 0.75rem; color: var(--text-2); line-height: 1.7; text-align: center; }
.cmp-health-verdict { margin-top: 6px; font-size: 0.74rem; font-weight: 700; color: var(--text-1); }

.cmp-sub { font-size: 0.7rem; font-weight: 800; color: var(--text-3); letter-spacing: .04em;
  margin: 14px 0 7px; }

.cmp-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp-tbl { width: 100%; border-collapse: collapse; font-size: 0.73rem; }
.cmp-tbl th { text-align: left; padding: 7px 9px; font-size: 0.66rem; font-weight: 800;
  color: var(--text-3); background: rgba(148,163,184,0.09); white-space: nowrap; }
.cmp-tbl td { padding: 7px 9px; border-bottom: 1px solid rgba(148,163,184,0.14); color: var(--text-1); }
.cmp-tbl tr:last-child td { border-bottom: none; }
.cmp-bad { color: var(--danger); font-weight: 700; }
.cmp-days { color: var(--success); font-weight: 800; }
.cmp-tbl tr.cmp-revoked td { color: var(--text-4); }
.cmp-badge { display: inline-block; padding: 2px 8px; border-radius: var(--r-full);
  font-size: 0.62rem; font-weight: 700; background: rgba(148,163,184,0.2); color: var(--text-3); }
.cmp-revoke { padding: 3px 10px; border: 1px solid rgba(239,68,68,.5); border-radius: var(--r-sm);
  background: var(--surface-solid); color: var(--danger); font-family: inherit; font-size: 0.65rem;
  font-weight: 700; cursor: pointer; }
.cmp-revoke:hover { background: rgba(239,68,68,.06); }

/* 预览：执行前必须让人一眼看到「会影响多少」 */
.cmp-preview { margin: 4px 0 12px; }
.cmp-hit { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-radius: var(--r-md);
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  font-size: 0.8rem; color: var(--text-1); }
.cmp-hit b { color: var(--danger); font-size: 1.05rem; }
.cmp-hit-line { font-size: 0.74rem; color: var(--text-2); padding: 5px 13px 0; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 5px; max-height: 108px; overflow-y: auto; }
.cmp-chip { padding: 3px 9px; border-radius: var(--r-full); background: rgba(37,99,235,0.08);
  color: var(--brand); font-size: 0.68rem; font-weight: 600; }

.cmp-days-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cmp-days-input { width: 90px; padding: 10px 12px; border: 1px solid rgba(148,163,184,0.35);
  border-radius: var(--r-md); font-size: 0.86rem; font-family: inherit; font-weight: 700;
  color: var(--text-1); background: var(--surface-solid); outline: none; }
.cmp-quick { padding: 8px 12px; border: 1px solid rgba(148,163,184,0.35); border-radius: var(--r-md);
  background: var(--surface-solid); color: var(--text-2); font-family: inherit; font-size: 0.72rem;
  font-weight: 700; cursor: pointer; transition: all .16s; }
.cmp-quick:hover { border-color: var(--brand); color: var(--brand); background: rgba(37,99,235,.05); }

.cmp-warn { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--r-md);
  background: rgba(37,99,235,0.06); font-size: 0.73rem; color: var(--text-2); line-height: 1.65; }
.cmp-warn i { color: var(--brand); margin-top: 2px; flex-shrink: 0; }
.cmp-tip { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md);
  background: rgba(245,158,11,0.08); font-size: 0.73rem; color: var(--text-2); line-height: 1.65; }
.cmp-tip i { color: var(--warning); margin-top: 2px; flex-shrink: 0; }

@media (max-width: 520px) {
  .cmp-modal { max-width: 100%; }
  .cmp-tab { font-size: 0.7rem; padding: 8px 4px; }
  .cmp-tab i { display: none; }      /* 窄屏只留文字，避免三个 tab 挤成两行 */
  .cmp-days-input { width: 74px; }
}


/* ===== iOS 聚焦缩放修复 =====
   iOS Safari 的规则：输入框计算字号 < 16px 时，一聚焦就自动放大整页，且不会自动缩回。
   本站输入框用的是 0.8rem，而 body 是 14px → 0.8 × 14 = 11.2px，远低于 16px，
   所以手机上点查询框每次都会"跳一下"。移动端统一提到 16px，
   桌面端字号完全不变（桌面没有这个限制，改了反而变丑）。
   顺带的好处：手机上输入的字更容易看清。 */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
  select,
  textarea {
    font-size: 16px;
  }
}


/* ===== 键盘焦点圈（可访问性）=====
   站内原本只有公告弹窗给链接/按钮做了焦点圈，其余按钮、导航、页签都没有，
   键盘 Tab 时看不出当前停在哪个元素上。
   这里只补「操作类」元素；表单输入框保留原来的 :focus
   （输入框点一下就该高亮，那是输入反馈，不是焦点指示）。 */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.settings-btn:focus-visible,
.hero-link:focus-visible,
.hero-auth-btn:focus-visible,
.hero-recharge-btn:focus-visible,
.side-nav a:focus-visible,
.bottom-nav a:focus-visible,
.top-nav a:focus-visible,
.card-title:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
