@font-face {
  font-family: 'Mojang';
  src: url('../font/mojang.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { margin:0; padding:0; box-sizing:border-box; }

html { background: #1a1a1a; }

body {
  background: #1a1a1a url('../picture/background.png') center center / cover no-repeat fixed;
  font-family: 'Mojang', 'Consolas', 'Courier New', monospace;
  color: #e8e8e8; line-height: 1.4;
  padding-top: 56px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.82));
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: fixed;
  background: rgba(255, 255, 200, 0.9);
  box-shadow: 0 0 8px 2px rgba(255, 255, 150, 0.6);
  pointer-events: none;
  z-index: 1;
  animation: floatUp linear infinite;
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1) rotate(0deg); opacity: 0; }
  20%  { opacity: 0.8; }
  80%  { opacity: 0.8; }
  100% { transform: translateY(-100vh) scale(1.2) rotate(45deg); opacity: 0; }
}

/* === 全新的 HUD 风格顶栏 === */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: #202020;
  border-bottom: 3px solid #000;
  box-shadow: inset 0 2px 0 #404040, 0 4px 10px rgba(0,0,0,0.5);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px; z-index: 100;
}
.topbar-logo-img {
  height: 36px;
  aspect-ratio: 3 / 1;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.8));
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-link {
  font-family: inherit;
  cursor: pointer;
  font-size: 13px; font-weight: bold; color: #d0d0d0;
  text-decoration: none; padding: 6px 14px;
  border-radius: 4px;
  background: #333333;
  border: 2px solid #000;
  box-shadow: inset 0 2px 0 #555, inset 0 -2px 0 #111;
  text-shadow: 1px 1px 0 #000;
  transition: all 0.1s;
  flex-shrink: 0;
}
.topbar-link:hover { color: #fff; background: #444; }
.topbar-link:active {
  transform: translateY(1px);
  background: #222;
  box-shadow: inset 0 2px 0 #111, inset 0 -2px 0 #333;
}

#authBtn {
  width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center;
  overflow: visible; /* 改为 visible 以显示红点 */
  background: transparent; border: 2px solid transparent; box-shadow: none;
  font-family: inherit; font-weight: bold; color: #fff; font-size: 13px; text-shadow: 1px 1px 0 #000;
  cursor: pointer; border-radius: 4px; transition: all .1s;
  position: relative;
}
#authBtn:not(:has(.user-avatar)) {
  width: auto; padding: 6px 14px; background: #333; border: 2px solid #000;
  box-shadow: inset 0 2px 0 #555, inset 0 -2px 0 #111;
}
#authBtn:active { transform: translateY(1px); background: #222; }

.user-avatar {
  width: 100%; height: 100%; border: 2px solid #000; border-radius: 4px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), inset 0 -2px 0 rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; overflow: hidden; background: #2a2a2a;
  position: relative;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

/* 新增：头像右上角的小红点 */
.avatar-dot {
  display: none;
  position: absolute; top: -6px; right: -6px;
  width: 14px; height: 14px; background: #ff4040;
  border: 2px solid #000; border-radius: 50%;
  z-index: 10;
  animation: msgPulse 1.5s infinite;
}
@keyframes msgPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 64, 64, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 64, 64, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 64, 64, 0); }
}

.user-dropdown {
  position: absolute;
  top: 56px;
  right: 16px;
  background: #2a2a2a;
  border: 2px solid #000;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px #444, 0 4px 0 rgba(0,0,0,0.6);
  z-index: 200;
  min-width: 120px;
  overflow: hidden;
}
.dropdown-header {
  padding: 12px 16px;
  color: #ffd700;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  border-bottom: 2px solid #111;
  text-shadow: 1px 1px 0 #000;
  word-break: break-all;
}
.dropdown-item {
  padding: 12px 16px; color: #d0d0d0; font-size: 13px; font-weight: bold;
  cursor: pointer; text-shadow: 1px 1px 0 #000; text-align: center; font-family: inherit;
}
.dropdown-item:hover { background: #444; color: #fff; }
.dropdown-item:active { background: #222; }

.ad-banner {
  display: none;
  max-width: 1000px;
  margin: 12px auto 0;
  padding: 0 12px;
  position: relative;
  z-index: 2;
}
.ad-banner.show { display: block; }
.ad-banner + .ad-banner { margin-top: 10px; }

.ad-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid #000;
  box-shadow: inset 0 0 0 2px #555, 0 4px 0 rgba(0,0,0,0.6);
  background: #2a2a2a;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.ad-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
  cursor: pointer;
}
.ad-slide.active { opacity: 1; pointer-events: auto; }
.ad-slide img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ad-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,0.78); color: #fff;
  font-size: 11px; font-weight: bold; padding: 3px 8px;
  border-radius: 2px; border: 1px solid #000; letter-spacing: 0.5px; z-index: 2;
  text-shadow: 1px 1px 0 #000;
}
.ad-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.ad-dot {
  width: 10px; height: 10px; background: #4a4a4a; border: 1px solid #000;
  transition: background .2s, width .2s; cursor: pointer;
}
.ad-dot.active { background: #5a8a3a; width: 18px; }

.page-wrap {
  display: flex; justify-content: center; align-items: flex-start;
  min-height: calc(100vh - 56px); padding: 12px;
  position: relative; z-index: 2;
}
.app {
  max-width: 560px; width: 100%;
  background: rgba(32,32,32,0.94);
  border-radius: 4px;
  padding: 20px 16px 24px;
  border: 2px solid #000;
  box-shadow: inset 0 0 0 2px #555, 0 8px 0 rgba(0,0,0,0.45), 0 10px 30px rgba(0,0,0,0.7);
}
.header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; margin-top: 4px;
}
.header h1 { font-size: 22px; font-weight: bold; color: #fff; text-shadow: 2px 2px 0 #000; letter-spacing: 1px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.apply-btn {
  background: #333; color: #fff;
  border: 2px solid #000; border-radius: 4px;
  padding: 6px 14px; font-size: 13px; font-weight: bold;
  cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 2px 0 #555, inset 0 -2px 0 #111;
  text-shadow: 1px 1px 0 #000; transition: all .1s; font-family: inherit;
}
.apply-btn:active { transform: translateY(1px); background: #222; }
.badge {
  background: #5a8a3a;
  padding: 6px 14px; border-radius: 4px;
  font-size: 13px; font-weight: bold; color: #fff;
  border: 2px solid #000;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.4);
  text-shadow: 1px 1px 0 #000;
}

.search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.search-box {
  flex: 1; min-width: 0; background: #1a1a1a;
  border-radius: 4px; padding: 4px 6px 4px 14px;
  display: flex; align-items: center;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.7);
}
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; padding: 10px 0; color: #fff; font-family: inherit;
  width: 100%; min-width: 0;
}
.search-box input::placeholder { color: #7a7a7a; }
.search-btn {
  background: linear-gradient(to bottom, #5a8a3a, #3d6126);
  border: 2px solid #000; border-radius: 4px;
  padding: 0 22px; font-size: 14px; font-weight: bold; color: #fff;
  cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.4), 0 4px 0 #000;
  text-shadow: 1px 1px 0 #000; transition: transform .05s; font-family: inherit; flex-shrink: 0;
}
.search-btn:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.3), 0 0 0 #000;
}

.category-bar {
  overflow-x: auto; padding: 4px 2px 14px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-inner {
  display: inline-flex; position: relative; background: #1a1a1a;
  border: 2px solid #000; border-radius: 4px; padding: 4px;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.6);
}
.cat-slider {
  position: absolute; top: 4px; left: 0; height: calc(100% - 8px);
  background: linear-gradient(to bottom, #5a8a3a, #3d6126); border-radius: 2px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), inset 0 -2px 0 rgba(0,0,0,0.3);
  transition: left .35s cubic-bezier(.4, 0, .2, 1), width .35s cubic-bezier(.4, 0, .2, 1);
  z-index: 1;
}
.cat-btn {
  flex-shrink: 0; background: transparent; color: #b0b0b0; border: none;
  border-radius: 2px; padding: 8px 18px; font-size: 13px; font-weight: bold;
  cursor: pointer; white-space: nowrap; position: relative; z-index: 2;
  transition: color .2s; font-family: inherit; text-shadow: 1px 1px 0 #000;
}
.cat-btn.active { color: #fff; }

.server-list { display: flex; flex-direction: column; gap: 14px; }
.server-item {
  background: #3e3e3e; border: 2px solid #000; border-radius: 4px;
  padding: 16px; box-shadow: inset 0 0 0 2px #5a5a5a, 0 4px 0 rgba(0,0,0,0.4);
}
.item-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.item-title { flex: 1; min-width: 0; }
.item-name {
  font-size: 18px; font-weight: bold; color: #fff;
  text-shadow: 2px 2px 0 #000; letter-spacing: 0.5px;
  word-break: break-word; display: flex; align-items: center; gap: 8px;
}
.btn-like {
  background: #2a2a2a; color: #b0b0b0; border: 1px solid #000; border-radius: 4px;
  padding: 3px 8px; font-size: 12px; font-weight: bold; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.1), inset 0 -2px 0 rgba(0,0,0,0.4);
  text-shadow: 1px 1px 0 #000; transition: all .2s; flex-shrink: 0; font-family: inherit;
}
.btn-like:active { transform: scale(0.95); }
.btn-like.active { background: linear-gradient(to bottom, #5a8a3a, #3d6126); color: #fff; }

.item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.version-tag {
  background: #2a2a2a; padding: 3px 10px; border-radius: 2px; border: 1px solid #000;
  font-size: 11px; font-weight: bold; color: #e8e8e8; text-shadow: 1px 1px 0 #000;
}
.item-ip {
  font-size: 13px; color: #a0a0a0; margin-top: 4px;
  font-family: 'Mojang', 'Consolas', 'Courier New', monospace;
  text-shadow: 1px 1px 0 #000; word-break: break-all;
}
.status {
  padding: 6px 14px; border-radius: 4px; font-size: 12px; font-weight: bold; flex-shrink: 0;
  border: 2px solid #000; box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), inset 0 -2px 0 rgba(0,0,0,0.4);
  text-shadow: 1px 1px 0 #000;
}
.status.online { background: #5a8a3a; color: #fff; }
.status.offline { background: #8a3a3a; color: #fff; }
.status.loading { background: #6c6c6c; color: #ddd; }
.item-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat {
  background: #1a1a1a; border: 1px solid #000; border-radius: 2px; padding: 6px 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: #b0b0b0;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.55); text-shadow: 1px 1px 0 #000;
}
.stat .value { font-weight: bold; color: #ffd700; text-shadow: 1px 1px 0 #000; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 0; border: 2px solid #000; border-radius: 4px;
  padding: 11px 4px; font-size: 13px; font-weight: bold; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.4), 0 3px 0 #000;
  text-shadow: 1px 1px 0 #000; transition: transform .05s; font-family: inherit; color: #fff; white-space: nowrap;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3), 0 0 0 #000; }
.btn-copy { background: #6c6c6c; }
.btn-detail { background: #6c6c6c; }
.btn-join { background: linear-gradient(to bottom, #4a6a8a, #2e4a62); }
.btn-fav { background: #6c6c6c; }
.btn-fav.active { background: linear-gradient(to bottom, #b8860b, #8b6508); color: #fff; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: bold; color: #ddd; margin-bottom: 6px; text-shadow: 1px 1px 0 #000; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 2px solid #000; border-radius: 4px; padding: 11px 13px;
  font-size: 14px; color: #fff; background: #1a1a1a; outline: none; font-family: inherit;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.7);
}
.form-row input::placeholder, .form-row textarea::placeholder { color: #7a7a7a; }
.form-row textarea { min-height: 90px; resize: vertical; }

.modal-mask {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.82); z-index: 999; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal-box {
  background: #3e3e3e; border: 2px solid #000; border-radius: 4px;
  padding: 22px 18px; width: 100%; max-width: 380px; max-height: 90vh; overflow-y: auto;
  box-shadow: inset 0 0 0 2px #5a5a5a, 0 10px 30px rgba(0,0,0,0.85);
}
.modal-title { font-size: 18px; font-weight: bold; color: #fff; margin-bottom: 6px; text-shadow: 2px 2px 0 #000; letter-spacing: 0.5px; }
.modal-sub { font-size: 13px; color: #a0a0a0; margin-bottom: 18px; text-shadow: 1px 1px 0 #000; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.btn-cancel, .btn-submit {
  flex: 1; border: 2px solid #000; border-radius: 4px; padding: 12px;
  font-size: 14px; font-weight: bold; cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.4), 0 4px 0 #000;
  text-shadow: 1px 1px 0 #000; transition: transform .05s; font-family: inherit; color: #fff;
}
.btn-cancel { background: #6c6c6c; }
.btn-submit { background: linear-gradient(to bottom, #5a8a3a, #3d6126); }
.btn-cancel:active, .btn-submit:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3), 0 0 0 #000; }

.no-results { text-align: center; padding: 40px 20px; color: #a0a0a0; font-size: 16px; display: none; text-shadow: 1px 1px 0 #000; }
.footer { text-align: center; font-size: 12px; color: #8a8a8a; margin-top: 24px; padding-top: 16px; border-top: 2px solid #000; box-shadow: inset 0 2px 0 rgba(255,255,255,0.05); text-shadow: 1px 1px 0 #000; }
.hidden { display: none !important; }

.loading-container { text-align: center; padding: 40px 20px; }
.loading-spinner { width: 64px; height: 64px; margin: 0 auto; animation: pickaxe 1.4s ease-in-out infinite; transform-origin: 70% 70%; }
.loading-spinner img { width: 100%; height: 100%; display: block; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 #000); }
.loading-text { font-size: 14px; color: #a0a0a0; margin-top: 14px; text-shadow: 1px 1px 0 #000; }
@keyframes pickaxe { 0% { transform: rotate(-25deg) translateY(0); } 50% { transform: rotate(15deg) translateY(6px); } 100% { transform: rotate(-25deg) translateY(0); } }

.back-to-top { position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 4px; background: #333; color: #fff; border: 2px solid #000; display: none; align-items: center; justify-content: center; box-shadow: inset 0 2px 0 #555, inset 0 -2px 0 #111, 0 4px 0 #000; cursor: pointer; z-index: 999; transition: all .1s; }
.back-to-top.show { display: flex; }
.back-to-top:active { transform: translateY(2px); box-shadow: inset 0 2px 0 #111, 0 0 0 #000; }

@media (min-width: 900px) {
  .app { max-width: 1000px; padding: 28px 32px 36px; }
  .header h1 { font-size: 26px; }
  .server-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .server-item { padding: 20px; }
  .item-name { font-size: 19px; }
  .footer { margin-top: 32px; }
  .ad-banner { max-width: 1000px; }
}
@media (min-width: 1280px) {
  .app { max-width: 1200px; }
  .server-list { grid-template-columns: 1fr 1fr 1fr; }
  .ad-banner { max-width: 1200px; }
}