/* ============================================================
   昼夜工坊 游戏网站 · site styles
   Production CSS for the deployable H5 game portal.
   Self-contained: imports the consolidated token snapshot,
   then plain semantic classes — no React/Babel at runtime.
   ============================================================ */

@import url("./tokens.css");

/* ---------- i18n visibility (no-JS shows Chinese) ---------- */
[data-lang="en"] { display: none; }
html.lang-en [data-lang="zh"] { display: none; }
html.lang-en [data-lang="en"] { display: block; }
.langbtn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; min-width: 46px; padding: 0 12px;
  border: 1.5px solid var(--border-default); background: var(--surface-card);
  border-radius: 999px; font-weight: 700; font-size: 0.85rem; color: var(--text-strong);
  cursor: pointer; font-family: var(--font-body);
}
.langbtn:hover { background: var(--slate-50); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--bg-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--text-strong); line-height: 1.15; letter-spacing: -0.015em; margin: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Skip link (a11y) ---------- */
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200; }
.skip:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.site-header__logo { display: flex; align-items: center; }
.site-nav { display: flex; gap: 2px; margin-left: 8px; }
.site-nav a {
  color: var(--text-body); font-weight: 600; font-size: 0.95rem;
  padding: 8px 14px; border-radius: 10px; text-decoration: none;
}
.site-nav a:hover { background: var(--slate-100); color: var(--text-strong); }
.site-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.site-header__cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 0 22px; height: 46px; border-radius: 14px; border: none; cursor: pointer;
  text-decoration: none; transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); box-shadow: var(--shadow-brand); }
.btn--accent { background: var(--accent); color: var(--slate-900); }
.btn--accent:hover { background: var(--accent-hover); box-shadow: var(--shadow-amber); }
.btn--ghost { background: transparent; color: var(--text-body); }
.btn--ghost:hover { background: var(--slate-100); }
.btn--secondary { background: var(--surface-card); color: var(--text-strong); border: 1.5px solid var(--border-default); box-shadow: var(--shadow-xs); }
.btn--secondary:hover { background: var(--slate-50); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 0.9rem; border-radius: 11px; }
.btn--lg { height: 54px; padding: 0 30px; font-size: 1.12rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; }
.badge--brand { background: var(--brand-soft); color: var(--brand); }
.badge--mint { background: var(--mint-100); color: var(--mint-600); }
.badge--coral { background: var(--coral-500); color: #fff; }
.badge--amber { background: var(--accent); color: var(--slate-900); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; color: #fff;
  background: linear-gradient(120deg, var(--indigo-700) 0%, var(--indigo-900) 55%, var(--slate-900) 100%);
  padding: 52px 52px; margin-top: 28px;
}
.hero::before { content:""; position:absolute; right:-70px; top:-70px; width:320px; height:320px; border-radius:50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,184,31,0.55), rgba(255,184,31,0) 65%); }
.hero__eyebrow { display:inline-block; white-space:nowrap; background: var(--accent); color: var(--slate-900); font-weight:800; font-size:0.72rem; letter-spacing:0.05em; padding:5px 12px; border-radius:999px; margin-bottom:16px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; max-width: 600px; }
.hero h1 .accent { color: var(--accent); }
.hero p { margin-top: 16px; font-size: 1.12rem; color: var(--indigo-100); max-width: 500px; }
.hero__actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero__actions .btn--secondary { background: rgba(255,255,255,0.10); color:#fff; border:1.5px solid rgba(255,255,255,0.28); box-shadow:none; }
.hero__actions .btn--secondary:hover { background: rgba(255,255,255,0.18); }

/* ---------- Section heads ---------- */
.section { margin-top: 52px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section__head h2 { font-size: 1.6rem; font-weight: 800; }
.section__head a { font-weight: 600; font-size: 0.92rem; }
.eyebrow { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- Game grid + cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.game-card {
  display: flex; flex-direction: column; background: var(--surface-card);
  border: 1px solid var(--border-subtle); border-radius: 20px; overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.game-card__cover { position: relative; aspect-ratio: 4/3; display:flex; align-items:center; justify-content:center; }
.game-card__cover svg { width: 56px; height: 56px; color: rgba(255,255,255,0.92); }
.game-card__badge { position: absolute; top: 10px; left: 10px; }
.game-card__play { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background: rgba(14,18,32,0); transition: background var(--dur) var(--ease-out); }
.game-card__play span { width:52px; height:52px; border-radius:50%; background: var(--accent); color: var(--slate-900); display:flex; align-items:center; justify-content:center; padding-left:3px; box-shadow: var(--shadow-amber); transform: scale(0.4); opacity:0; transition: transform var(--dur) var(--ease-pop), opacity var(--dur) var(--ease-out); }
.game-card:hover .game-card__play { background: rgba(14,18,32,0.26); }
.game-card:hover .game-card__play span { transform: scale(1); opacity: 1; }
.game-card__body { padding: 12px 14px 14px; }
.game-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; color: var(--text-strong); }
.game-card__meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.game-card__cat { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); background: var(--surface-sunken); padding: 3px 9px; border-radius: 999px; }
.game-card__rate { display:inline-flex; align-items:center; gap:4px; font-size:0.85rem; font-weight:700; color: var(--text-strong); }
.game-card__rate svg { width: 14px; height: 14px; color: var(--amber-400); }

/* Cover gradient palettes */
.cv-indigo { background: linear-gradient(135deg,#5b61e8,#33379c); }
.cv-mint   { background: linear-gradient(135deg,#2dd4bf,#0d9488); }
.cv-amber  { background: linear-gradient(135deg,#ffb81f,#f65a4a); }
.cv-coral  { background: linear-gradient(135deg,#ff7a6b,#e03e2e); }
.cv-blue   { background: linear-gradient(135deg,#818cf8,#4f58e0); }
.cv-violet { background: linear-gradient(135deg,#7c84f4,#33379c); }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display:inline-flex; align-items:center; height:36px; padding:0 16px; border-radius:999px; font-weight:600; font-size:0.92rem; color: var(--text-body); background: var(--surface-card); border:1.5px solid var(--border-subtle); cursor:pointer; text-decoration:none; }
.chip:hover { background: var(--slate-100); text-decoration:none; }
.chip[aria-current="true"], .chip.is-active { background: var(--brand); color:#fff; border-color: var(--brand); }

/* ---------- Play page ---------- */
.play-head { display:flex; align-items:center; gap:16px; margin-top:28px; flex-wrap:wrap; }
.play-head h1 { font-size: 2rem; font-weight: 800; }
.play-head .badge { vertical-align: middle; }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-top: 24px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }

.play-stage {
  margin: 22px 0; background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: 24px; box-shadow: var(--shadow-md); padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.play-toolbar { display:flex; align-items:center; justify-content:space-between; width:100%; gap:16px; flex-wrap:wrap; }
.score-pills { display:flex; gap:12px; }
.score-pill { background: var(--surface-sunken); border-radius: 14px; padding: 8px 16px; text-align:center; min-width: 84px; }
.score-pill .k { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.score-pill .v { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--text-strong); }

/* ---------- Content prose (AdSense value) ---------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.5rem; font-weight: 800; margin: 38px 0 12px; }
.prose h3 { font-size: 1.18rem; font-weight: 700; margin: 26px 0 8px; }
.prose p { margin: 0 0 14px; color: var(--text-body); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; color: var(--text-body); }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text-strong); }
.prose kbd { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-sunken); border:1px solid var(--border-default); border-bottom-width:2px; border-radius:6px; padding: 2px 7px; color: var(--text-strong); }
.prose .lead { font-size: 1.14rem; color: var(--text-muted); }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--border-subtle); border-radius: 14px; padding: 4px 18px; margin-bottom: 10px; background: var(--surface-card); }
.faq summary { cursor: pointer; font-weight: 700; color: var(--text-strong); padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display:none; }
.faq summary::after { content: "+"; float: right; color: var(--text-muted); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 14px; margin: 0; color: var(--text-body); }

/* ---------- Ad slot (AdSense placeholder) ---------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  margin: 32px auto; max-width: 970px; min-height: 100px;
  border: 1px dashed var(--border-default); border-radius: 14px;
  background: var(--surface-sunken); color: var(--text-faint);
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; text-align:center;
}
.ad-slot[data-filled] { border: none; background: transparent; }

/* ---------- Info pages ---------- */
.page-hero { padding: 44px 0 8px; }
.page-hero h1 { font-size: 2.4rem; font-weight: 800; }
.page-hero p { color: var(--text-muted); font-size: 1.1rem; margin-top: 10px; max-width: 640px; }
.updated { font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Contact form ---------- */
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.field label { font-weight:600; font-size:0.92rem; color: var(--text-strong); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--text-strong);
  background: var(--surface-card); border: 1.5px solid var(--border-default); border-radius: 12px;
  padding: 11px 14px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; background: var(--slate-900); color: var(--slate-300); }
.site-footer__top { display: flex; gap: 48px; flex-wrap: wrap; padding: 48px 0 32px; }
.site-footer__brand { flex: 1 1 260px; min-width: 240px; }
.site-footer__brand p { margin-top: 16px; font-size: 0.9rem; color: var(--slate-400); max-width: 300px; }
.footer-col { min-width: 140px; }
.footer-col h4 { color: #fff; font-size: 0.9rem; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--slate-400); font-size: 0.9rem; padding: 5px 0; }
.footer-col a:hover { color: #fff; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,0.08); }
.site-footer__bottom .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 18px 20px; }
.site-footer__bottom span { font-size: 0.78rem; color: var(--slate-500); }

/* ---------- Blog / Articles ---------- */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.art-card { display: flex; flex-direction: column; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 20px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.art-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.art-card__cover { height: 150px; display: flex; align-items: center; justify-content: center; position: relative; }
.art-card__cover svg { width: 56px; height: 56px; color: rgba(255,255,255,0.92); }
.art-card__kicker { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.92); color: var(--slate-800); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; }
.art-card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.art-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.25; color: var(--text-strong); }
.art-card__excerpt { font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; flex: 1; }
.art-card__meta { font-size: 0.8rem; color: var(--text-faint); font-weight: 600; }

/* Article reading layout */
.article { max-width: 740px; margin: 0 auto; }
.article__head { padding: 36px 0 8px; }
.article__kicker { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.article__head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.1; margin: 12px 0 10px; }
.article__meta { font-size: 0.9rem; color: var(--text-faint); display: flex; gap: 12px; flex-wrap: wrap; }
.article__cover { height: 180px; border-radius: 20px; margin: 22px 0 8px; display: flex; align-items: center; justify-content: center; }
.article__cover svg { width: 64px; height: 64px; color: rgba(255,255,255,0.92); }
.article__body { font-size: 1.06rem; line-height: 1.75; color: var(--text-body); }
.article__body h2 { font-size: 1.55rem; font-weight: 800; margin: 40px 0 14px; }
.article__body h3 { font-size: 1.2rem; font-weight: 700; margin: 28px 0 8px; color: var(--text-strong); }
.article__body p { margin: 0 0 18px; }
.article__body ul, .article__body ol { margin: 0 0 18px; padding-left: 24px; }
.article__body li { margin: 8px 0; }
.article__body strong { color: var(--text-strong); }
.article__body blockquote { margin: 22px 0; padding: 14px 22px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 12px 12px 0; color: var(--text-body); }
.article__body figure { margin: 24px 0; }
.article__body .callout { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 20px 22px; margin: 24px 0; box-shadow: var(--shadow-xs); }
.article__body .callout h3 { margin-top: 0; }
.article__body table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 0.95rem; }
.article__body th, .article__body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); }
.article__body th { font-weight: 700; color: var(--text-strong); background: var(--surface-sunken); }
.article__body code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-sunken); padding: 2px 6px; border-radius: 6px; color: var(--brand-active); }
.article__playcta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(120deg, var(--indigo-700), var(--slate-900)); color: #fff; border-radius: 20px; padding: 24px 28px; margin: 36px 0; }
.article__playcta h3 { color: #fff; font-size: 1.25rem; margin: 0 0 4px; }
.article__playcta p { color: var(--indigo-100); margin: 0; font-size: 0.95rem; }
.article__tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 28px 0; }
.article__tags .badge { background: var(--surface-sunken); color: var(--text-muted); }
.author { display: flex; align-items: center; gap: 12px; padding: 20px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); margin: 30px 0; }
.author__av { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.author__name { font-weight: 700; color: var(--text-strong); font-size: 0.95rem; }
.author__role { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero { padding: 36px 26px; }
  .play-stage { padding: 16px; border-radius: 18px; }
  .section { margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Cookie consent (CMP) ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200; max-width: 640px; margin: 0 auto; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 18px; box-shadow: var(--shadow-lg, 0 18px 50px rgba(20,24,40,0.22)); padding: 20px 22px; display: none; }
.consent.show { display: block; animation: consentUp var(--dur, 0.32s) var(--ease-out, cubic-bezier(.2,.7,.3,1)); }
@keyframes consentUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.consent__title { font-weight: 700; color: var(--text-strong); font-size: 1.02rem; margin-bottom: 6px; }
.consent__text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 14px; }
.consent__text a { color: var(--brand); text-decoration: underline; }
.consent__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.consent__actions .btn { flex: 0 0 auto; }
@media (max-width: 520px) { .consent__actions .btn { flex: 1 1 auto; justify-content: center; } }
