/* 基础样式与变量定义 */

/* 按钮样式 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: 2px solid var(--primary);
    background-color: var(--dark);
    color: #e0e0ff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary);
}

.ping-btn {
    border-color: #00ff9d;
}

.ping-btn:hover {
    box-shadow: 0 0 15px #00ff9d;
}

.speed-btn {
    border-color: var(--secondary);
}

.speed-btn:hover {
    box-shadow: 0 0 15px var(--secondary);
}

/* 响应式按钮 */
@media (max-width: 600px) {
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 80%;
        text-align: center;
    }
}
:root {
  --primary: #00f3ff;
  --secondary: #7d7dff;
  --dark: #050a14;
  --darker: #03060c;
  --surface: rgba(10, 20, 35, 0.85);
  --accent: #0aff9d;
  --glow-primary: 0 0 10px var(--primary), 0 0 20px rgba(0, 243, 255, 0.3);
  --glow-secondary: 0 0 10px var(--secondary), 0 0 20px rgba(125, 125, 255, 0.3);
}

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

body {
  background: var(--dark);
  color: #e0e0ff;
  font-family: 'Rajdhani', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(0, 243, 255, 0.05) 0%, transparent 70%),
    linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  min-height: 100vh;
}

/* 网格布局 */
.grid-container {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 2rem 5%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

/* 节点卡片样式 */
.node-card {
  background: var(--surface);
  border: 1px solid rgba(0, 243, 255, 0.1);
  border-radius: 8px;
  padding: 1.2rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.node-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.node-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(0, 243, 255, 0.3);
}

.node-card:hover::before {
  transform: scaleX(1);
}

.node-card:active {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.node-code {
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  word-break: break-all;
  letter-spacing: 0.5px;
  text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.node-loc {
  font-size: 0.9rem;
  color: #a0a0ff;
  opacity: 0.8;
}

/* 地区标题 */
.region-title {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--accent);
  text-shadow: 0 0 8px rgba(10, 255, 157, 0.3);
}

/* 页眉样式 */
.cyber-header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
  overflow: hidden;
}

.cyber-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: textGlow 2s infinite alternate;
}

@keyframes textGlow {
  0% {
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.3);
  }
  100% {
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.8), 0 0 30px rgba(0, 243, 255, 0.5);
  }
}

.subtitle {
  color: #a0a0ff;
  font-size: 1rem;
  opacity: 0.8;
  position: relative;
  z-index: 2;
}

/* 故障艺术效果 */
.glitch-container {
  position: relative;
  display: inline-block;
}

.glitch-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  opacity: 0.05;
  z-index: 1;
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* 通知提示 */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 20, 35, 0.95);
  padding: 0.8rem 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(0, 243, 255, 0.2);
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast.visible {
  opacity: 1;
}

/* 背景网格效果 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 243, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: -1;
  animation: gridFlow 20s linear infinite;
}

@keyframes gridFlow {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 20px;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .cyber-header h1 {
    font-size: 2rem;
  }
  .grid-container {
    padding: 1.5rem 3%;
    gap: 1rem;
  }
  .node-card {
    padding: 1rem;
  }
  .region-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .cyber-header h1 {
    font-size: 1.8rem;
  }
  .subtitle {
    font-size: 0.9rem;
  }
  .node-code {
    font-size: 0.9rem;
  }
  .node-loc {
    font-size: 0.85rem;
  }
}

/* 加载动画 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--primary);
  animation: pulse 1.5s infinite;
}