body {
  position: relative;
}

body {
  background-image: url('./background.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
}

.header { position: sticky; top: 0; backdrop-filter: blur(12px); background: rgba(255, 255, 255, .75); border-bottom: 1px solid rgba(0,0,0,.08); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.header__inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }

.header h1 { color: #1e293b; font-size: 20px; margin: 0; text-shadow: 0 1px 2px rgba(255,255,255,.8); padding-left: 20px; }
.login { display: flex; gap: 12px; align-items: center; margin-left: 0px; }
.login__form { display: flex; gap: 8px; }
.login__info { display: flex; gap: 8px; align-items: center; }
.hidden { display: none; }

main.container { padding: 8px 0 8px; }
.card { background: rgba(255, 255, 255, 0.25); border: 1px solid rgba(148,163,184,.25); border-radius: 12px; padding: 16px 16px 8px 16px; color: #334155; margin-bottom: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04); backdrop-filter: blur(8px); }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h2, .card h3 { color: #0f172a; }

.actions { display: flex; gap: 10px; align-items: center; }

.input { height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(148,163,184,.35); background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); color: #1e293b; outline: none; transition: all .2s ease; }
.input::placeholder { color: #94a3b8; }
.input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); background: #fff; }

.btn { height: 28px; line-height: 28px; padding: 0 8px; display: inline-block; font-size: 12px; border-radius: 8px; border: 1px solid rgba(148,163,184,.35); background: rgba(248, 250, 252, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); color: #334155; cursor: pointer; transition: all .2s ease; font-weight: 500; outline: none; }
.btn:hover { border-color: #94a3b8; background: #f1f5f9; transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #3b82f6, #06b6d4); border: none; color: #fff; font-size: 11px; padding: 0 8px; white-space: nowrap; }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,.3); }

.table-wrap { overflow: auto; border-radius: 10px; border: 1px solid rgba(148,163,184,.25); background: rgba(255,255,255,0.35);
  backdrop-filter: blur(15px) saturate(160%);
  -webkit-backdrop-filter: blur(15px) saturate(160%); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; table-layout: fixed; }
.table th:nth-child(1), .table td:nth-child(1) { width: 32%; }
.table th:nth-child(2), .table td:nth-child(2) { width: 10%; text-align: center; }
.table th:nth-child(3), .table td:nth-child(3) { width: 37%; }
.table th:nth-child(4), .table td:nth-child(4) { width: 31%; }
.table th:nth-child(5), .table td:nth-child(5) { width: 15%; text-align: center; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(148,163,184,.18); vertical-align: middle; }
.table thead th { position: sticky; top: 0; background: rgba(241, 245, 249, 0.6); z-index: 10;
  backdrop-filter: blur(10px);
.online-count { font-weight: 400; color: #475569; font-size: 0.85em; }
  -webkit-backdrop-filter: blur(10px); color: #1d4ed8; font-weight: 600; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(219, 234, 254, .5); }
.table tbody tr:nth-child(even) { background: rgba(248, 250, 252, .4); }
.table td .ip { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; color: #334155; }

.grid { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 10px; }

.help { color: #64748b; margin-top: 0; }
.help summary { cursor: pointer; font-weight: 500; }

.footer { border-top: 1px solid rgba(148,163,184,.2); color: #64748b; padding: 8px 0 8px; background: rgba(255,255,255,0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px); border-radius: 0 0 12px 12px; margin: -16px -16px 8px -16px; padding-left: 16px; padding-right: 16px; }

/* 快速搜索按钮样式 */
.quick-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.quick-filters #refresh-btn { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 6px;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  margin-left: 4px;
}

.quick-filters .input {
  height: 34px;
  width: 180px;
  font-size: 13px;
  margin-right: 4px;
}

.quick-filters__label {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  margin-right: 4px;
}

.quick-filter-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(224, 242, 254, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #1d4ed8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.quick-filter-btn:hover {
  border-color: #3b82f6;
  background: rgba(191, 219, 254, .85);
  color: #1e40af;
  transform: translateY(-1px);
}

.quick-filter-btn:active {
  transform: translateY(0);
}

.quick-filter-btn.active {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px rgba(59,130,246,.35);
}

.quick-filter-btn--clear {
  background: rgba(241, 245, 249, .85);
  color: #64748b;
  border-color: rgba(148,163,184,.25);
}

.quick-filter-btn--clear:hover {
  background: rgba(226, 232, 240, .9);
  border-color: #94a3b8;
  color: #334155;
}

/* 2x2网格布局 */
.room-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.room-row {
  align-items: flex-start;
  display: flex;
  gap: 8px;
}

/* 房间区域基础样式 */
.room-section {
  flex: 1;
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 10px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-icon {
  font-size: 16px;
}

.table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(15px) saturate(160%);
  -webkit-backdrop-filter: blur(15px) saturate(160%);
  max-height: 400px;
}

.table { width: 100%; border-collapse: collapse; min-width: 400px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(148,163,184,.18); vertical-align: middle; }
.table thead th { position: sticky; top: 0; background: rgba(241, 245, 249, 0.6); z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); color: #1d4ed8; font-weight: 600; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(219, 234, 254, .5); }
.table tbody tr:nth-child(even) { background: rgba(248, 250, 252, .4); }
.table td .ip { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; color: #334155; font-size: 12px; }

.no-rooms {
  text-align: center;
  color: #94a3b8;
  padding: 32px 16px;
  font-size: 13px;
  background: rgba(248, 250, 252, .5);
  border-radius: 8px;
  margin-top: 12px;
}

/* 无限火力区域样式 - 红色系 */
#infinite-fire-section .section-title {
  color: #dc2626;
  background: rgba(254, 226, 226, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid #ef4444;
}

#infinite-fire-section .section-icon {
  color: #ef4444;
}

/* 纯净对抗区域样式 - 蓝色系 */
#pure-battle-section .section-title {
  color: #2563eb;
  background: rgba(219, 234, 254, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid #3b82f6;
}

#pure-battle-section .section-icon {
  color: #3b82f6;
}

/* 其他房间区域样式 - 全宽显示 */
#other-section {
  flex: none;
  width: 100%;
}

#other-section .section-title {
  color: #7c3aed;
  background: rgba(221, 214, 254, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid #8b5cf6;
}

#other-section .section-icon {
  color: #8b5cf6;
}

#other-section .table-wrap {
  max-height: 500px;
}

/* 确保服务器信息可以复制 */
.srv-name, .table td {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

/* 备案号不可复制 */
.icp-info a,
.icp-info span {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}
/* 多特区域样式 - 绿色系 */
#duote-section .section-title {
  color: #16a34a;
  background: rgba(220, 252, 231, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid #22c55e;
}

#duote-section {
}

#duote-section .section-icon {
  color: #22c55e;
}

/* 全部房间区域样式 - 紫色系（全宽显示） */
#all-rooms-section {
  flex: none;
  width: 100%;
  margin-top: 8px;
}

#all-rooms-section .section-title {
  color: #7c3aed;
  background: rgba(221, 214, 254, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid #8b5cf6;
}

#all-rooms-section .section-icon {
  color: #8b5cf6;
}

/* 纯净战役区域样式 - 橙色系 */
#special-infected-section {
}

#special-infected-section .section-title {
  color: #ea580c;
  background: rgba(254, 235, 200, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid #f97316;
}

#special-infected-section .section-icon {
  color: #f97316;
}

/* 编辑标签按钮样式 */
.btn-edit-tag {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  padding: 4px 6px; min-width: 60px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  margin-right: 5px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-edit-tag:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* ==================== 移动端响应式优化 ==================== */
@media screen and (max-width: 768px) {
  .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .table th:nth-child(1), .table td:nth-child(1) { width: 40%; }
  .table th:nth-child(2), .table td:nth-child(2) { width: 15%; }
  .table th:nth-child(3), .table td:nth-child(3) { width: 25%; }
  .table th:nth-child(4), .table td:nth-child(4) { width: 6%; }
  main.container { padding: 12px 8px 8px; }
  .card { padding: 12px; border-radius: 8px; margin-bottom: 12px; }
  .header h1 { font-size: 16px; }
  .header__inner { flex-wrap: wrap; gap: 8px; }
  .login__form { flex-wrap: wrap; }
  .login__form input { flex: 1; min-width: 80px; }
  .quick-filters { gap: 6px; padding: 8px 0; }
  .quick-filters__label { width: 100%; margin-bottom: 4px; }
  .quick-filters .input { width: 100%; height: 36px; margin-bottom: 8px; }
  .quick-filter-btn { height: 34px; padding: 0 10px; font-size: 12px; }
  #refresh-btn { margin-top: 4px; }
  .room-container { gap: 12px; margin-top: 12px; }
  .room-row { flex-direction: column; gap: 12px; }
  .room-section { width: 100% !important; flex: none !important; }
  .section-title { font-size: 13px; padding: 6px 10px; margin-bottom: 8px; }
  .table-wrap { border-radius: 6px; max-height: 300px; }
  .table { font-size: 12px; min-width: 500px; }
  .table th, .table td { padding: 6px 8px; }
  .table thead th { font-size: 11px; padding: 8px 6px; }
  .table td:first-child { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table td .ip { font-size: 10px; }
  .btn { height: 26px; line-height: 26px; padding: 0 6px; font-size: 11px; min-width: 50px; }
  .btn-edit-tag { min-width: 50px; padding: 3px 4px; font-size: 10px; }
  .no-rooms { padding: 20px 12px; font-size: 12px; }
  .footer { padding: 12px 12px 8px; font-size: 11px; }
  .footer small { font-size: 10px; }
}
@media screen and (max-width: 480px) {
  main.container { padding: 8px 4px 8px; }
  .card { padding: 8px; border-radius: 6px; }
  .header h1 { font-size: 14px; }
  .login__form input { height: 32px !important; font-size: 12px; }
  .login__form button { height: 32px !important; }
  .quick-filter-btn { height: 30px; padding: 0 8px; font-size: 11px; }
  .table { font-size: 11px; min-width: 400px; }
  .table th, .table td { padding: 5px 6px; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .table th:nth-child(1), .table td:nth-child(1) { width: 45%; }
  .table th:nth-child(2), .table td:nth-child(2) { width: 20%; }
  .table th:nth-child(4), .table td:nth-child(4) { width: 6%; }

  .btn { height: 24px; line-height: 24px; padding: 0 6px; font-size: 11px; min-width: 44px; }
  .section-title { font-size: 12px; padding: 5px 8px; }
}
@media (hover: none) and (pointer: coarse) {
  .btn { min-width: 44px; min-height: 44px; height: auto; line-height: 1.2; padding: 8px 12px; }
  .quick-filter-btn { min-height: 44px; }
  .quick-filters .input { min-height: 44px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ==================== 雪花飘落特效 ==================== */
.snow-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; overflow: hidden;
}
.snowflake {
  position: absolute; color: #fff;
  animation: snowfall linear infinite; opacity: 0.8;
}
@keyframes snowfall {
  0% { transform: translateY(-20px) rotate(0deg) translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.7; }
  100% { transform: translateY(100vh) rotate(360deg) translateX(20px); opacity: 0; }
}
/* ==================== Custom Server Query ==================== */
.custom-server-section {
  margin-top: 12px;
  padding: 10px 12px;
  background: transparent;
  border-radius: 8px;
  border: none;
}
.custom-server-input-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.custom-server-input-wrap .input {
  flex: 1;
  min-width: 200px;
  height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  box-sizing: border-box;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(248, 250, 252, 0.6);
  color: #334155;
  font-size: 14px;
  outline: none;
}
.btn.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 0 16px;
  height: 38px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn.success:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
.btn.success:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.7;
}
.custom-server-result {
  margin-top: 10px;
  padding: 8px 12px;
  background: transparent;
  border-radius: 6px;
}
.result-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.result-label {
  color: #64748b;
  font-weight: 600;
}
.result-name {
  color: #1e293b;
  font-weight: 600;
}
.result-sep {
  color: #94a3b8;
}
.result-players, .result-map {
  color: #1e293b;
}
/* Mobile responsive for custom server section */
@media screen and (max-width: 768px) {
  .custom-server-section {
    padding: 8px;
  }
  .custom-server-input-wrap {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .custom-server-input-wrap .input {
    flex: 1;
    min-width: unset;
    height: 34px;
    font-size: 12px;
  }
  .custom-server-input-wrap .btn {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 8px;
    font-size: 11px;
    min-width: unset;
    white-space: nowrap;
  }
  .result-info {
    flex-wrap: wrap;
    gap: 4px;
  }
}

}

/* 自定义查询输入框和按钮样式 - 与快速搜索框一致 */
.custom-server-input {
  height: 32px !important;
  width: 180px !important;
  font-size: 13px !important;
  margin-right: 4px;
}

#custom-query-btn {
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
}

#custom-join-btn {
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  min-width: 80px !important;
}

/* 自定义查询标签样式 */
.custom-label {
  display: inline-block;
  vertical-align: middle;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  margin-right: 8px;
}

/* 移动端样式 - 标签换行，输入框按钮同行 */
@media screen and (max-width: 768px) {
  .custom-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #64748b;
  }
  .custom-server-section {
    padding: 6px 8px;
  }
  .custom-server-input-wrap {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    align-items: center;
  }
  .custom-server-input-wrap .input {
    flex: 1;
    min-width: 80px;
    height: 34px;
    padding: 0 6px;
    font-size: 12px;
    box-sizing: border-box;
    border-radius: 4px;
  }
  .custom-server-input-wrap .btn {
    flex-shrink: 0;
    height: 34px !important;
    line-height: 36px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    white-space: nowrap;
    border-radius: 4px;
  }
  #custom-query-btn {
    min-width: 70px;
  }
  #custom-join-btn {
    display: none;
    min-width: 60px;
  }
}

/* ==================== 统一的手动查询区域样式 ==================== */
/* PC端 */
.custom-server-section {
  display: flex !important;
  align-items: center !important;
  margin-top: 12px;
  padding: 8px 0;
}
.custom-server-input-wrap .input {
  flex: 1;
  min-width: 200px;
  height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 14px;
}
.custom-server-input-wrap .btn {
  height: 38px;
  line-height: 38px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 6px;
  box-sizing: border-box;
  border: 1px solid rgba(148,163,184,.35);
}

/* 移动端 */
@media screen and (max-width: 768px) {
  .custom-server-section {
    display: block !important;
    margin-top: 10px;
    padding: 6px 0;
  }
  .custom-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #64748b;
  }
  .custom-server-input-wrap {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    align-items: center;
  }
  .custom-server-input-wrap .input {
    flex: 1;
    min-width: 80px;
    height: 36px;
    padding: 0 8px;
    font-size: 12px;
    border-radius: 4px;
    box-sizing: border-box;
  }
  .custom-server-input-wrap .btn {
    flex-shrink: 0;
    height: 36px !important;
    line-height: 36px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    border-radius: 4px;
    white-space: nowrap;
  }
  #custom-query-btn {
    min-width: 70px;
  }
  #custom-join-btn {
    display: none;
    min-width: 60px;
  }
}

/* 超小屏幕 */
@media screen and (max-width: 480px) {
  .custom-server-input-wrap .input {
    min-width: 60px;
    font-size: 11px;
    padding: 0 6px;
  }
  .custom-server-input-wrap .btn {
    padding: 0 8px !important;
    font-size: 11px !important;
  }
}

/* Loading Skeleton */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
}

.skeleton-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: rgba(255,255,255,0.8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton-text {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  margin: 0;
}

.server-offline { opacity: 0.55; }
.server-offline td { color: #888 !important; }
.server-offline .ip { color: #999 !important; }
.server-offline .btn.primary { background: #666 !important; pointer-events: none; }
