:root {
  --primary: #c0392b;
  --primary-dark: #922b21;
  --accent: #e74c3c;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #2c2c2c;
  --text-muted: #777;
  --border: #e0e0e0;
  --sidebar-width: 280px;
}

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

body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ===== HEADER ===== */
header {
  background: var(--primary);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
}
.logo span { color: #ffd700; }

nav { display: flex; gap: 4px; }
nav a {
  color: rgba(255,255,255,0.9);
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}
nav a:hover, nav a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
}

.search-bar {
  display: flex;
  gap: 6px;
}
.search-bar input {
  padding: 7px 12px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  width: 180px;
}
.search-bar button {
  padding: 7px 14px;
  background: var(--primary-dark);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.search-bar button:hover { background: #7b241c; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 24px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* ===== ARTICLE CARD ===== */
.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.tag-category { background: var(--primary); color: #fff; }
.tag-game { background: #2980b9; color: #fff; }
.tag-date { color: var(--text-muted); font-size: 13px; }

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); text-decoration: none; }

.card-summary { color: #555; font-size: 14px; line-height: 1.6; }

/* ===== SIDEBAR ===== */
.sidebar {}

.sidebar-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}
.sidebar-title {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.sidebar-list { list-style: none; }
.sidebar-list li {
  border-bottom: 1px solid var(--border);
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s;
}
.sidebar-list a:hover {
  background: #fef9f9;
  color: var(--primary);
  text-decoration: none;
}
.sidebar-list .count {
  background: #eee;
  color: var(--text-muted);
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 10px;
}

/* ===== ARTICLE PAGE ===== */
.article-page {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
}
.article-page h1 {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 12px;
}
.article-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}
.article-content { line-height: 1.85; }
.article-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 12px;
  padding: 8px 14px;
  border-left: 4px solid var(--primary);
  background: #fdf2f1;
}
.article-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--primary-dark);
}
.article-content p { margin-bottom: 14px; }
.article-content ul, .article-content ol {
  margin: 12px 0 12px 24px;
}
.article-content li { margin-bottom: 6px; }
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.article-content th {
  background: var(--primary);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
}
.article-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
}
.article-content tr:nth-child(even) td { background: #fafafa; }
.article-content strong { color: var(--primary-dark); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  padding: 10px 14px;
  border-left: 4px solid var(--primary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title a { font-size: 13px; font-weight: 400; color: var(--primary); }

/* ===== HERO BANNER ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #922b21 100%);
  color: #fff;
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 0;
}
.hero h2 { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
.hero p { font-size: 15px; opacity: 0.9; }

/* ===== EMPTY STATE ===== */
.empty { text-align: center; padding: 48px; color: var(--text-muted); }

/* ===== LOADING ===== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid #eee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
footer {
  background: #1a1a1a;
  color: #aaa;
  text-align: center;
  padding: 20px;
  font-size: 13px;
  margin-top: 40px;
}
footer a { color: #ccc; }

/* ===== GAME LIST PAGE ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.game-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.game-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.game-card h3 { font-size: 15px; margin-bottom: 6px; color: var(--text); }
.game-card .game-maker { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.game-card .game-type { font-size: 12px; background: #eee; padding: 2px 8px; border-radius: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  nav { order: 3; width: 100%; overflow-x: auto; }
  .search-bar input { width: 120px; }
  .article-page { padding: 18px 16px; }
}
