/* Minecraft风格的网站样式 - 基础公用样式 */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --mc-green: #3d8c40;
  --mc-dark-green: #2d6a30;
  --mc-brown: #8b5a2b;
  --mc-dark-brown: #654321;
  --mc-gray: #a0a0a0;
  --mc-dark-gray: #555555;
  --mc-light: #f0f0f0;
  --mc-dark: #222222;
  --mc-dirt: #8d6e40;
  --mc-grass: #5a9c40;
  /* 磨砂玻璃黑色主题 */
  --header-footer-bg: rgba(10, 10, 10, 0.7); /* 半透明黑色背景 */
  --header-footer-border: rgba(255, 255, 255, 0.1); /* 半透明边框 */
  --header-footer-text: #ffffff; /* 白色文字 */
  --header-footer-hover: rgba(255, 255, 255, 0.2); /* 悬停时的半透明白色 */
  /* 侧滑菜单相关变量 */
  --sidebar-width: 280px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1a1a1a;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 20%);
  color: var(--mc-light);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 在移动端允许横向滚动以支持白名单表格 */
@media screen and (max-width: 768px) {
  body {
    overflow-x: visible;
  }
  
  /* 但要确保主要内容不会出现不必要的横向滚动 */
  .content-wrapper {
    overflow-x: hidden;
  }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(45deg, #0a0a0a 25%, transparent 25%, transparent 75%, #0a0a0a 75%),
    linear-gradient(45deg, #0a0a0a 25%, transparent 25%, transparent 75%, #0a0a0a 75%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
  opacity: 0.1;
  z-index: -1;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

main {
  flex: 1;
}

/* Header样式 */
header {
  background-color: var(--header-footer-bg);
  border-bottom: 1px solid var(--header-footer-border);
  padding: 5px 0;
  position: fixed; /* 改为fixed确保一直粘滞在顶部 */
  top: 0;
  left: 0;
  width: 100%; /* 确保宽度占满屏幕 */
  z-index: 1000; /* 提高z-index确保在最上层 */
  backdrop-filter: blur(10px); /* 磨砂玻璃效果 */
  -webkit-backdrop-filter: blur(10px); /* Safari兼容 */
  box-shadow: 
    0 2px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-content {
  display: flex;
  justify-content: space-between; /* 两端对齐 */
  align-items: center;
  width: 100%; /* 确保占满整个header宽度 */
  padding: 0 20px; /* 只使用padding来控制左右间距 */
  margin: 0; /* 移除margin */
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-img {
  height: 60px;
  margin: 5px 0; /* 只保留上下边距 */
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.logo-text {
  height: 60px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin: 0 0 0 20px; /* 只使用margin-left */
}

nav ul li a {
  color: var(--header-footer-text);
  text-decoration: none;
  font-weight: bold;
  padding: 10px 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
}

nav ul li a:hover,
nav ul li a.active {
  background: var(--header-footer-hover);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* 导航图标样式 */
.nav-icon {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  margin: 10px 0;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn.primary {
  background-color: var(--mc-green);
  color: white;
}

.btn.primary:hover {
  background-color: var(--mc-dark-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn.secondary {
  background-color: var(--mc-dark-gray);
  color: white;
}

.btn.secondary:hover {
  background-color: var(--mc-gray);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Footer */
footer {
  background-color: var(--header-footer-bg);
  padding: 25px 0;
  text-align: center;
  border-top: 1px solid var(--header-footer-border);
  margin-top: auto;
  color: var(--header-footer-text);
  backdrop-filter: blur(10px); /* 磨砂玻璃效果 */
  -webkit-backdrop-filter: blur(10px); /* Safari兼容 */
  box-shadow: 
    0 -2px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* 侧滑菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background: var(--header-footer-text);
  border-radius: 10px;
  transition: all 0.3s ease;
  position: relative;
  transform-origin: center;
}

/* 菜单按钮动画效果 */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* 侧滑菜单面板 - 默认隐藏 */
.sidebar {
  position: fixed;
  top: 0;
  right: -var(--sidebar-width);
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--header-footer-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.3s ease;
  padding: 80px 20px 20px;
  overflow-y: auto;
  display: none; /* 默认隐藏 */
}

.sidebar.open {
  right: 0;
  display: block; /* 打开时显示 */
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  margin: 10px 0;
}

.sidebar ul li a {
  display: block;
  color: var(--header-footer-text);
  text-decoration: none;
  font-weight: bold;
  padding: 15px 20px;
  border-radius: 6px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
  background: var(--header-footer-hover);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* 遮罩层 - 默认隐藏 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.open {
  display: block;
  opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .logo-container {
    margin: 1px 0;
    padding: 2px 0;
  }
  
  .logo-img {
    height: 30px;
  }
  
  .logo-text {
    height: 30px;
  }
  
  /* 显示菜单按钮 */
  .menu-toggle {
    display: flex;
  }
  
  /* 隐藏导航栏 */
  nav {
    display: none;
  }
  
  /* 在移动端启用侧边栏和遮罩层的显示逻辑 */
  .sidebar {
    display: none; /* 仍然默认隐藏，通过JS控制显示 */
  }
  
  header {
    padding: 3px 0;
  }
  
  .header-content {
    padding: 0 15px;
  }
  
  nav ul li {
    margin: 0 5px;
  }
  
  nav ul li a {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

/* 桌面端确保隐藏侧边栏和遮罩层 */
@media (min-width: 769px) {
  .sidebar {
    display: none !important;
  }
  
  .overlay {
    display: none !important;
  }
}
