/* ======== 全局變數 ======== */
:root {
  --bg: #0d1117;
  --card-bg: rgba(20,25,35,0.85);
  --text: #cdd9f4;
  --accent: #4f46e5;
  --accent-glow: #6366f1;
}

/* ======== 全局樣式 ======== */
body {
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ======== Header ======== */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #0f1724, #161b2a);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 2rem;
  margin: 0;
  letter-spacing: 1px;
}

/* ======== Navigation ======== */
nav {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  transition: all 0.3s;
}

nav a:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ======== Main ======== */
main {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  position: relative;
  z-index: 1; /* 確保卡片在粒子上層 */
}

/* ======== 卡片 ======== */
.card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
}

/* ======== 標題與文字 ======== */
h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p, li {
  line-height: 1.6;
}

/* ======== 連結 ======== */
a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s;
}

a:hover {
  text-decoration: underline;
  color: #8b5cf6;
}

/* ======== 背景 Canvas ======== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ======== 響應式 ======== */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
}
