:root {
  --primary-color: #6a5acd; /* スレートブルー */
  --secondary-color: #ff7f50; /* コーラル */
  --text-color: #333;
  --bg-color: #f8f9fa;
  --header-bg: #ffffff;
  --header-text: #333;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition-speed: 0.3s;
  --max-content-width: 1200px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.05) 1px, transparent 0);
  background-size: 30px 30px;
}

/* ヘッダー */
.header {
  background-color: var(--header-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 1rem 2rem;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-item {
  text-decoration: none;
  color: var(--header-text);
  font-weight: 500;
  transition: all var(--transition-speed);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  position: relative;
}

.nav-item:hover {
  color: var(--primary-color);
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: all var(--transition-speed);
  transform: translateX(-50%);
}

.nav-item:hover::after {
  width: 80%;
}

/* アクティブなナビゲーションアイテム */
.nav-item.active {
  color: var(--primary-color);
}

.nav-item.active::after {
  width: 80%;
}

/* コンテンツラッパー */
.content-wrapper {
  max-width: var(--max-content-width);
  margin: 2rem auto;
  padding: 0 2rem;
}

/* セクションスタイル */
.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.section-header p {
  font-size: 1.1rem;
  color: #666;
}

/* カードグリッド */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-content {
  padding: 1.5rem;
}

.card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.card p {
  color: #666;
  margin-bottom: 1rem;
}

.card a {
  color: inherit;
  text-decoration: none;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--primary-color);
  font-weight: 500;
  transition: all var(--transition-speed);
  text-decoration: none;
}

.card-link:hover {
  color: var(--secondary-color);
}

/* ボタンスタイル */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-speed);
  text-decoration: none;
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

/* モバイルメニュー */
.mobile-menu-button {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

.mobile-menu-button span {
  width: 100%;
  height: 2px;
  background-color: var(--header-text);
  transition: all var(--transition-speed);
}

/* 特定のカテゴリのアクティブスタイル */
.top-active { background-color: var(--primary-color); color: white !important; }
.articles-active { background-color: #3498db; color: white !important; }
.games-active { background-color: #e74c3c; color: white !important; }
.gamedev-active { background-color: #9b59b6; color: white !important; }
.tools-active { background-color: #2ecc71; color: white !important; }
.novels-active { background-color: #f39c12; color: white !important; }

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
  .header-inner {
    padding: 1rem;
  }
  
  .mobile-menu-button {
    display: flex;
  }
  
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--header-bg);
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
  }
  
  .main-nav.show {
    display: flex;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
}
