:root {
  --primary: #4361ee;
  --primary-light: #4895ef;
  --primary-dark: #3a56d4;
  --secondary: #7209b7;
  --accent: #f72585;
  --success: #4cc9f0;
  --dark: #212529;
  --light: #f8f9fa;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  min-height: 100vh;
  color: var(--dark);
}

#global-topbar {
  height: 70px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

#n {
  height: 50px;
  width: 50px;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light);
  border: 2px solid var(--gray-light);
}

#n:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}

#n:active {
  background: var(--primary-dark);
  transform: scale(0.95);
}

#ni {
  width: 24px;
  height: 24px;
  filter: brightness(0.7);
}

#n:hover #ni {
  filter: brightness(1);
}

a.github {
  height: 50px;
  aspect-ratio: 1;
  background: url(/icon/github.svg) center / contain;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 20px;
}

.a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  padding: 25px 20px;
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.a:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
  color: var(--primary);
}

.a:hover::before {
  transform: scaleX(1);
}

.app-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: var(--dark);
  transition: var(--transition);
  line-height: 1.4;
}

.a:hover .app-title {
  color: var(--primary);
  transform: scale(1.05);
}

.coming-soon {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  color: var(--gray);
  cursor: not-allowed;
  border: 1px dashed var(--gray-light);
}

.coming-soon:hover {
  transform: none;
  box-shadow: var(--shadow);
  color: var(--gray);
  border-color: var(--gray-light);
}

.coming-soon .app-title::after {
  content: " (即将上线)";
  font-size: 0.75rem;
  font-weight: normal;
  display: block;
  margin-top: 5px;
}

.header-content {
  text-align: center;
  margin: 40px auto 0;
  max-width: 800px;
  padding: 0 20px;
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
}

.header-content p {
  font-size: 1.1rem;
  color: var(--gray);
  line-height: 1.6;
  margin: 0;
}

/* 为不同应用添加独特的悬停颜色 */
.a:nth-child(1):hover { border-color: #4361ee; }
.a:nth-child(2):hover { border-color: #f72585; }
.a:nth-child(3):hover { border-color: #4cc9f0; }
.a:nth-child(4):hover { border-color: #7209b7; }
.a:nth-child(5):hover { border-color: #3a0ca3; }
.a:nth-child(6):hover { border-color: #2ec4b6; }
.a:nth-child(7):hover { border-color: #ff9e00; }

/* 加载动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.a {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.a:nth-child(1) { animation-delay: 0.1s; }
.a:nth-child(2) { animation-delay: 0.2s; }
.a:nth-child(3) { animation-delay: 0.3s; }
.a:nth-child(4) { animation-delay: 0.4s; }
.a:nth-child(5) { animation-delay: 0.5s; }
.a:nth-child(6) { animation-delay: 0.6s; }
.a:nth-child(7) { animation-delay: 0.7s; }

@media screen and (max-width: 768px) {
  .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin: 40px auto;
  }
  
  .a {
    height: 110px;
    padding: 20px 15px;
  }
  
  .header-content h1 {
    font-size: 2rem;
  }
  
  .app-title {
    font-size: 1rem;
  }
}

@media screen and (max-width: 425px) {
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .a {
    height: 100px;
    padding: 15px 10px;
  }
  
  .app-title {
    font-size: 0.9rem;
  }
  
  .header-content h1 {
    font-size: 1.8rem;
  }
  
  .header-content p {
    font-size: 1rem;
  }
  
  #global-topbar {
    height: 60px;
    padding: 0 15px;
  }
  
  #n {
    height: 44px;
    width: 44px;
  }
  
  #ni {
    width: 20px;
    height: 20px;
  }
}