/* catdsn.com/game — 列表与详情（对齐 jidiyouxi 类浅色卡片风格） */
:root {
  --bg: #e9e9e9;
  --card: #fff;
  --text: #1a1a1a;
  --muted: #8c8c8c;
  --accent: #3b5bdb;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --header-h: 56px;
}

* {
  box-sizing: border-box;
}
body.game-site {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.top-strip {
  background: linear-gradient(90deg, #c9713a, #e8a068);
  color: #fff;
  font-size: 13px;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-strip .site {
  font-weight: 600;
}

.site-header {
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: inline-block;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
}
.nav a {
  color: #333;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}
.nav a:hover {
  background: #f0f0f0;
}
.nav .badge {
  font-size: 11px;
  background: #ff4d4f;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.search-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.search-wrap input {
  width: 220px;
  max-width: 40vw;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
}

.filter-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 8px;
}
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}
.tags-row a,
.tags-row button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  font-family: inherit;
}
.tags-row a.active,
.tags-row button.active {
  font-weight: 700;
  text-decoration: underline;
}
.sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 13px;
  color: var(--muted);
}
.sort-row button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
  padding: 4px 0;
}
.sort-row button.active {
  color: var(--accent);
  font-weight: 600;
}

.grid-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 20px 40px;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.game-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.thumb {
  aspect-ratio: 16 / 9;
  background: #ddd;
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-body {
  padding: 12px 14px 14px;
}
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.title-row h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  flex: 1;
}
.rating {
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 2px 0;
}
.meta .dl {
  margin-left: 6px;
}

.pagination-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px 16px 48px;
}
.pagination-bar button {
  min-width: 40px;
  height: 36px;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.pagination-bar button.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.pagination-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 16px;
}

/* 详情页 */
.article-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.article-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.article-card .cover-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  aspect-ratio: 16/9;
  background: #eee;
}
.article-card .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card h1 {
  margin: 0 0 12px;
  font-size: 22px;
}
.article-card .tags {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.article-card .tag {
  background: #f5f5f5;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
}
.article-card .note {
  margin-top: 20px;
  padding: 12px;
  background: #fafafa;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
}
.article-card .note.subtle {
  font-size: 12px;
  color: #999;
}

/* 来源站同步的正文（scrape_detail 写入） */
.article-body {
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.post-block {
  margin-bottom: 28px;
}
.post-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #222;
  line-height: 1.4;
}
.post-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.post-img {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}
.post-img img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}
.post-img figcaption {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 4px 0;
}
.post-content {
  font-size: 15px;
  line-height: 1.75;
  color: #333;
  word-break: break-word;
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
}
.more-posts {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}
.post-empty {
  padding: 16px;
  background: #fff9f0;
  border: 1px solid #ffe7ba;
  border-radius: 8px;
  font-size: 14px;
  color: #8a6d3b;
  margin-bottom: 12px;
}
