:root {
  --bg-color: #020d1f;
  --secondary-color: rgba(10, 26, 51, 0.85);
  --accent-color: #ffd617;
  --text-color: #ffffff;
  --muted-text: #cfd9e8;
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
}

/* ===== 背景 ===== */

#stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* ===== NAV（核心修复点）===== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: rgba(2, 13, 31, 0.3);
  backdrop-filter: blur(6px);
  z-index: 20;
  overflow: hidden;
}

/* 左边 logo 固定 */
nav .logo {
  flex: 0 0 auto;
}

nav .logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}

/* 右边菜单（重点优化） */
nav ul {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  list-style: none;
  padding-left: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

nav ul::-webkit-scrollbar {
  display: none;
}

nav ul li {
  flex: 0 0 auto;
}

nav ul a {
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.3s;
}

nav ul a:hover {
  color: var(--accent-color);
}

/* ===== HERO ===== */

.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 100px;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 20px;
}

.hero p {
  color: var(--muted-text);
  margin-bottom: 25px;
}

/* ===== BUTTON ===== */

.button {
  display: inline-block;
  padding: 12px 26px;
  background: var(--accent-color);
  color: #000;
  text-decoration: none;
  font-weight: bold;
}

/* ===== SECTION ===== */

.section {
  max-width: 1200px;
  margin: auto;
  padding: 80px 30px;
}

.section h2 {
  margin-bottom: 20px;
  font-size: 2.2rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--secondary-color);
  padding: 22px;
}

/* ===== FOOTER ===== */

.footer {
  text-align: center;
  padding: 20px;
  color: #888;
}

/* ===== 移动端 ===== */

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  nav ul {
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: visible;
  }

  .hero h1 {
    font-size: 2.6rem;
  }
}
