/* 牛牛小游戏 - 主样式 | 移动优先、Core Web Vitals 友好 */
:root {
  --color-primary: #c41e3a;
  --color-primary-dark: #9a1830;
  --color-secondary: #1a472a;
  --color-bg: #f8f6f2;
  --color-surface: #fff;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-border: #e5e2dc;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,.08);
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 12px 20px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 100;
  transition: top var(--transition);
}
.skip-link:focus { top: 16px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}
.logo { display: block; }
.logo img { display: block; height: 40px; width: auto; max-width: 160px; object-fit: contain; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--color-text); }
@media (min-width: 768px) { .nav-toggle { display: none; } }

.main-nav ul {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 8px;
}
.main-nav.is-open ul {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  padding: 16px;
  box-shadow: var(--shadow);
}
@media (min-width: 768px) {
  .main-nav ul { display: flex; flex-direction: row; position: static; padding: 0; box-shadow: none; }
  .main-nav a { padding: 8px 14px; border-radius: 8px; }
}
.main-nav a {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 0;
}
.main-nav a:hover, .main-nav a:focus { color: var(--color-primary); }

/* Hero */
.hero {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-secondary) 0%, #2d5a3d 100%);
}
.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.hero-content { position: relative; z-index: 2; padding: 48px 20px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.hero-desc {
  margin: 0 0 24px;
  font-size: 1rem;
  color: rgba(255,255,255,.9);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* 头部：牛牛起源与介绍 */
.hero-intro {
  margin-top: 32px;
  padding: 24px 20px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
.hero-intro-title {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}
.hero-intro-text {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255,255,255,.95);
}
.hero-intro-text:last-child { margin-bottom: 0; }

@media (min-width: 768px) {
  .hero { min-height: 480px; }
  .hero h1 { font-size: 2.25rem; }
  .hero-desc { font-size: 1.125rem; }
  .hero-intro { margin-top: 40px; padding: 28px 32px; }
  .hero-intro-title { font-size: 1.35rem; }
  .hero-intro-text { font-size: 1rem; }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
}
.btn:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: rgba(255,255,255,.2); color: #fff; border: 2px solid #fff; }
.btn-secondary:hover { background: rgba(255,255,255,.3); }
.btn-lg { padding: 16px 32px; font-size: 1.125rem; }

/* Sections */
.section { padding: 48px 0; }
.section-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
}
.section-desc {
  margin: 0 0 28px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.text-center { text-align: center; }
.link-more {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.link-more:hover { text-decoration: underline; }

/* 牛牛游戏详细介绍 */
.intro-content { max-width: 720px; margin: 0 auto; }
.intro-content p { margin: 0 0 16px; }
.intro-content p:last-child { margin-bottom: 0; }

/* 牌型速查 */
.card-type-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.card-type-list li {
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--color-primary);
}
.card-type-list li:last-child { margin-bottom: 0; }

/* 游戏特色与魅力 */
.charm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .charm-list { grid-template-columns: repeat(2, 1fr); } }
.charm-list li {
  padding: 24px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.charm-list h3 { margin: 0 0 8px; font-size: 1.1rem; }
.charm-list p { margin: 0; font-size: 0.95rem; color: var(--color-text-muted); }

/* 理性娱乐提示 */
.tips-content { max-width: 640px; margin: 0 auto; }
.tips-content p { margin: 0; }

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .game-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }

.game-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.game-card a { text-decoration: none; color: inherit; display: block; }
.game-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.game-card-body { padding: 20px; }
.game-card h3 { margin: 0 0 8px; font-size: 1.2rem; }
.game-card p { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); }

/* Blog list */
.blog-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 24px;
}
@media (min-width: 768px) { .blog-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-list { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.blog-card:hover { transform: translateY(-2px); }
.blog-card a { text-decoration: none; color: inherit; display: block; }
.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.blog-card-body { padding: 20px; }
.blog-card h3 { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.4; }
.blog-card p { margin: 0 0 8px; font-size: 0.9rem; color: var(--color-text-muted); }
.blog-card time { font-size: 0.85rem; color: var(--color-text-muted); }

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.features-grid li { padding: 24px 16px; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.features-grid img { margin-bottom: 12px; }
.features-grid h3 { margin: 0 0 8px; font-size: 1.15rem; }
.features-grid p { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); }

/* FAQ preview */
.faq-list { margin: 0 0 20px; padding: 0; list-style: none; max-width: 720px; margin-left: auto; margin-right: auto; }
.faq-list li {
  padding: 20px;
  margin-bottom: 12px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.faq-list h3 { margin: 0 0 10px; font-size: 1.05rem; }
.faq-list p { margin: 0; font-size: 0.95rem; color: var(--color-text-muted); }

/* CTA */
.cta-section {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #2d5a3d 100%);
  color: #fff;
}
.cta-section .section-title,
.cta-section p { color: #fff; }
.cta-section p { margin: 0 0 20px; opacity: .95; }
.cta-section .btn-primary { background: #fff; color: var(--color-secondary); }
.cta-section .btn-primary:hover { background: rgba(255,255,255,.9); }

/* Footer */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,.85);
  padding: 40px 0 24px;
}
.footer-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 28px;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr auto; align-items: start; } }
.footer-brand img { margin-bottom: 8px; filter: brightness(0) invert(1); opacity: .9; }
.footer-brand p { margin: 0; font-size: 0.9rem; }
.footer-nav ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: 0.95rem; }
.footer-nav a:hover { color: #fff; }
.footer-bottom { padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); text-align: center; }
.footer-bottom p { margin: 0; font-size: 0.85rem; opacity: .8; }

/* Page: games.html */
.page-header { padding: 32px 0 24px; text-align: center; }
.page-header h1 { margin: 0 0 8px; font-size: 1.75rem; }
.page-header p { margin: 0; color: var(--color-text-muted); }
.game-category { margin-bottom: 40px; }
.game-category h2 { font-size: 1.35rem; margin: 0 0 20px; padding-bottom: 8px; border-bottom: 2px solid var(--color-primary); }

/* Page: blog list */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { margin-bottom: 24px; }
.article-list a { text-decoration: none; color: inherit; display: block; padding: 20px; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow var(--transition); }
.article-list a:hover { box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.article-list-img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; display: block; }
.article-list h2 { margin: 0 0 8px; font-size: 1.2rem; }
.article-list time { font-size: 0.9rem; color: var(--color-text-muted); }

/* Article single */
.article-header { padding: 32px 0 24px; }
.article-header h1 { margin: 0 0 12px; font-size: 1.75rem; line-height: 1.35; }
.article-header .meta { font-size: 0.9rem; color: var(--color-text-muted); }
.article-content { max-width: 720px; margin: 0 auto; padding: 0 20px 48px; }
.article-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 20px 0; }
.article-featured-img { width: 100%; max-height: 400px; object-fit: cover; margin-bottom: 24px; }
.article-content h2 { font-size: 1.35rem; margin: 28px 0 12px; }
.article-content h3 { font-size: 1.15rem; margin: 20px 0 10px; }
.article-content p { margin: 0 0 16px; }
.article-content ul, .article-content ol { margin: 0 0 16px; padding-left: 1.5em; }

/* FAQ page */
.faq-item { margin-bottom: 20px; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.faq-item summary { padding: 20px; font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; }
.faq-item[open] summary::after { content: '−'; }
.faq-item .answer { padding: 0 20px 20px; color: var(--color-text-muted); }
.faq-item .answer p { margin: 0; }
.faq-accordion { list-style: none; margin: 0; padding: 0; max-width: 720px; margin-left: auto; margin-right: auto; }
.faq-accordion .faq-item { margin-bottom: 12px; }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
