/* ===== 361GO 网站统一顶部菜单栏（site-nav.js 注入） ===== */
/* account.html / tournament.html 等页面未重置 body 默认外边距，注入的 .sn-root 会内缩 8px，
   导致顶部菜单相对首页偏移；统一在此清零，保证所有页面菜单位置一致。 */
html, body { margin: 0; }
.sn-legacy-hide { display: none !important; }
/* 首页 body 是 flex column + align-items:center；包裹层必须显式撑满交叉轴，
   否则菜单栏会收缩到内容宽度并居中，与二级页面左右分开的布局不一致（切页跳动）。 */
.sn-root { width: 100%; align-self: stretch; }
.site-nav {
  /* account.html / tournament.html 没有首页那句全局 box-sizing:border-box，
     不显式声明会让 width:100% 再叠加左右 padding 共 56px，导航栏右端与头像整体右移。 */
  box-sizing: border-box;
  width: 100%; height: 62px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: rgba(10, 15, 30, .92); border-bottom: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.sn-left { display: flex; align-items: center; gap: 16px; min-width: 0; --sn-back-w: 92px; }
.sn-back {
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto;
  width: var(--sn-back-w); height: 30px;
  color: #aab6cc; text-decoration: none; font-size: 13px;
  padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .12);
  transition: background .18s, color .18s;
}
.sn-back-space { visibility: hidden; pointer-events: none; }
.sn-back:hover { background: rgba(255, 255, 255, .08); color: #f0d78c; }
.sn-logo {
  display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto;
  color: inherit; text-decoration: none;
}
.sn-logo img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.sn-logo span {
  font-size: 19px; font-weight: 700; letter-spacing: .5px; white-space: nowrap;
  background: linear-gradient(135deg, #f0d78c, #e8b84b);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sn-links { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.sn-links a {
  display: inline-block; padding: 8px 15px; border-radius: 8px;
  color: #c2cde0; text-decoration: none; font-size: 14px; white-space: nowrap;
  transition: background .18s, color .18s;
}
.sn-links a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sn-links a.on { color: #ffd2a8; background: rgba(237, 159, 100, .16); }
.sn-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.sn-console {
  display: inline-block; padding: 7px 14px; border-radius: 18px;
  color: #f0d78c; text-decoration: none; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(240, 215, 140, .35); background: rgba(240, 215, 140, .08);
  transition: background .18s, transform .18s;
}
.sn-console:hover { background: rgba(240, 215, 140, .18); transform: translateY(-1px); }
.sn-theme {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 18px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  color: #d8e2f2; font-size: 13px; font-family: inherit;
  transition: background .18s, color .18s;
}
.sn-theme svg { width: 15px; height: 15px; }
.sn-theme:hover { background: rgba(255, 255, 255, .13); color: var(--brand); }
.sn-user {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 5px 14px 5px 6px; border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  color: #e8edf7; font-size: 14px; max-width: 200px;
  transition: background .18s;
}
.sn-user:hover { background: rgba(255, 255, 255, .12); }
.sn-avatar {
  position: relative; width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  background: linear-gradient(135deg, #f0d78c, #e8b84b); color: #17202f;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.sn-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sn-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px;
}
.sn-login-txt { color: #f0d78c; font-weight: 600; padding: 0 4px; }
.sn-user-wrap { position: relative; display: flex; align-items: center; }
.sn-user-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 186px; padding: 8px; display: flex; flex-direction: column; gap: 2px;
  background: rgba(16, 23, 42, .98); border: 1px solid rgba(240, 215, 140, .25);
  border-radius: 12px; box-shadow: 0 18px 42px rgba(0, 0, 0, .45); z-index: 80;
}
.sn-user-menu[hidden] { display: none; }
.sn-user-menu a, .sn-user-menu button {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: #d4dded; font-size: 14px; line-height: 1.3; text-align: left;
  text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.sn-user-menu a:hover, .sn-user-menu button:hover { background: rgba(255, 255, 255, .08); color: var(--brand); }
.sn-user-menu button {
  margin-top: 5px; padding-top: 12px; color: #ffb4a8;
  border-top: 1px solid rgba(255, 255, 255, .09); border-radius: 0 0 8px 8px;
}
@media (max-width: 720px) {
  .site-nav { padding: 0 14px; height: 56px; gap: 8px; }
  .sn-left { --sn-back-w: 84px; gap: 8px; }
  .sn-logo span { display: none; }
  .sn-links { gap: 0; margin-left: 0; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sn-links::-webkit-scrollbar { display: none; }
  .sn-links a { flex: 0 0 auto; padding: 7px 9px; font-size: 13px; }
  .sn-back { padding: 5px 7px; }
  .sn-name { max-width: 72px; }
  .sn-console { padding: 6px 10px; }
  .sn-theme { padding: 6px 9px; }
  .sn-theme span { display: none; }
}
@media (max-width: 480px) {
  .sn-links a[data-nav="match"] { display: none; }
}

/* 全站统一的关注区块（首页二维码三栏，注入到每页底部） */
.sn-connect {
  width: min(var(--page-max), calc(100% - var(--page-gutter)));
  margin: 28px auto 0;
  padding: 28px 32px 18px;
  text-align: center;
}
.sn-connect h2 {
  font-size: 24px; letter-spacing: 1px; color: #f4e6c4; margin-bottom: 8px;
}
.sn-connect > p { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.sn-connect-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.sn-connect-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 16px;
}
.sn-connect-card img {
  display: block; width: 132px; height: 132px; object-fit: contain;
  margin: 0 auto 12px; border-radius: 10px;
}
.sn-connect-card h3 { font-size: 15px; color: var(--brand); margin-bottom: 8px; }
.sn-connect-card p { font-size: 13px; line-height: 1.65; color: var(--muted); }
.sn-connect-note { margin-top: 16px; font-size: 12px; color: #8c95aa; }
@media (max-width: 900px) {
  .sn-connect-grid { grid-template-columns: 1fr; }
  .sn-connect { padding: 24px 18px 16px; }
}
@media (max-width: 760px) {
  :root { --page-gutter: 32px; }
  .sn-connect { width: calc(100% - 32px); }
}
