/* GoWay 游戏中心 - 全站样式 */
:root {
  --bg: #0b0e17;
  --bg2: #10141f;
  --card: #161b2c;
  --card2: #1c2338;
  --line: #262e47;
  --text: #e8ecf5;
  --muted: #8b93a7;
  --accent: #6c7bff;
  --accent2: #22d3ee;
  --hot: #ff5d5d;
  --gold: #ffb84d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 400px at 85% -10%, rgba(108, 123, 255, .12), transparent),
    radial-gradient(700px 350px at -10% 10%, rgba(34, 211, 238, .08), transparent);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ============ 头部 ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 14, 23, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: .5px; flex-shrink: 0; }
.logo .logo-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  font-size: 19px;
  box-shadow: 0 4px 14px rgba(108, 123, 255, .45);
}
.logo em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.main-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 7px 11px; border-radius: 9px; color: var(--muted);
  font-size: 14px; white-space: nowrap; transition: .18s;
}
.main-nav a:hover { color: var(--text); background: var(--card); }
.main-nav a.active { color: #fff; background: linear-gradient(135deg, rgba(108,123,255,.25), rgba(34,211,238,.18)); }

.header-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; flex-shrink: 0; }
.header-search input { background: none; border: none; outline: none; color: var(--text); font-size: 14px; width: 150px; }
.header-search input::placeholder { color: var(--muted); }
.header-search button { background: none; border: none; color: var(--muted); font-size: 15px; }
.header-search button:hover { color: var(--accent2); }

.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 9px; color: var(--text); font-size: 18px; padding: 5px 11px; }

/* ============ 通用组件 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 10px 22px;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), #8a5cf6);
  box-shadow: 0 6px 18px rgba(108, 123, 255, .35);
  transition: .18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(108, 123, 255, .45); }
.btn.ghost { background: var(--card); border: 1px solid var(--line); box-shadow: none; color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.small { padding: 7px 16px; font-size: 13.5px; border-radius: 8px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge.hot { background: rgba(255, 93, 93, .16); color: var(--hot); }
.badge.new { background: rgba(34, 211, 238, .14); color: var(--accent2); }
.badge.cat { background: rgba(108, 123, 255, .16); color: #aab4ff; }

.section { margin: 34px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 21px; display: flex; align-items: center; gap: 9px; }
.section-head h2::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.section-head .more { color: var(--muted); font-size: 13.5px; }
.section-head .more:hover { color: var(--accent2); }

.ad-slot {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); text-align: center; padding: 22px;
  font-size: 13px; letter-spacing: 1px;
  background: repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(255,255,255,.015) 12px, rgba(255,255,255,.015) 24px);
}

/* ============ 分类 chips ============ */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.chip {
  padding: 8px 18px; border-radius: 20px; font-size: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); transition: .18s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { color: #fff; background: linear-gradient(135deg, var(--accent), #8a5cf6); border-color: transparent; }

/* ============ 游戏卡片 ============ */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.game-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .2s; display: block;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(108, 123, 255, .55); box-shadow: var(--shadow); }
.game-cover {
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  font-size: 58px; position: relative; user-select: none;
}
.game-cover .play-hint {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10, 12, 22, .45); opacity: 0; transition: .2s; color: #fff; font-size: 15px; font-weight: 600;
}
.game-card:hover .play-hint { opacity: 1; }
.game-cover .cover-tag { position: absolute; top: 8px; left: 8px; }
.game-cover .cover-hot { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(11,14,23,.75); padding: 2px 8px; border-radius: 12px; }
.game-card .g-body { padding: 10px 12px 12px; }
.game-card .g-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card .g-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ============ 首页 Hero ============ */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.hero-card {
  position: relative; border-radius: 18px; overflow: hidden; min-height: 230px;
  display: flex; align-items: flex-end; padding: 22px; border: 1px solid var(--line);
  transition: .2s;
}
.hero-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.hero-card .hc-emoji { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 110px; filter: drop-shadow(0 12px 24px rgba(0,0,0,.4)); }
.hero-card .hc-tag { position: absolute; top: 14px; left: 16px; }
.hero-card h3 { font-size: 24px; margin-bottom: 6px; }
.hero-card p { color: rgba(232, 236, 245, .75); font-size: 13.5px; max-width: 62%; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============ 资讯/攻略卡片 ============ */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; transition: .2s; display: flex; flex-direction: column; gap: 8px; }
.post-card:hover { border-color: rgba(34, 211, 238, .5); transform: translateY(-3px); }
.post-card h3 { font-size: 16px; line-height: 1.45; }
.post-card h3 a:hover { color: var(--accent2); }
.post-card p { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .p-meta { color: var(--muted); font-size: 12px; display: flex; gap: 12px; align-items: center; margin-top: auto; }

/* 列表条目 */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-item { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; transition: .2s; }
.post-item:hover { border-color: rgba(34, 211, 238, .5); }
.post-item .pi-emoji { width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 26px; }
.post-item h3 { font-size: 15.5px; margin-bottom: 4px; }
.post-item h3 a:hover { color: var(--accent2); }
.post-item p { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.post-item .pi-meta { color: var(--muted); font-size: 12px; margin-top: 5px; display: flex; gap: 12px; }

/* ============ 文章页 ============ */
.article-wrap { max-width: 780px; margin: 26px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 38px; }
.article-wrap .a-tag { margin-bottom: 12px; }
.article-wrap h1 { font-size: 26px; line-height: 1.4; margin-bottom: 12px; }
.article-wrap .a-meta { color: var(--muted); font-size: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.article-content { font-size: 15.5px; color: #cfd6e4; }
.article-content h2 { font-size: 19px; margin: 26px 0 12px; color: var(--text); }
.article-content h3 { font-size: 16.5px; margin: 20px 0 10px; color: var(--text); }
.article-content p { margin-bottom: 14px; }
.article-content ul, .article-content ol { margin: 0 0 14px 22px; }
.article-content li { margin-bottom: 7px; }
.article-content strong { color: var(--gold); }

.breadcrumb { color: var(--muted); font-size: 13px; margin: 18px 0; }
.breadcrumb a:hover { color: var(--accent2); }

/* ============ 游戏页 ============ */
.game-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.game-stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.game-hud { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.hud-item { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; font-size: 13px; color: var(--muted); }
.hud-item b { color: var(--text); font-size: 17px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.game-hud .spacer { flex: 1; }

.game-box { position: relative; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow: hidden; min-height: 300px; }
.game-box canvas { max-width: 100%; height: auto; touch-action: none; border-radius: 6px; }

.overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10, 12, 22, .78); backdrop-filter: blur(3px); z-index: 5; text-align: center; padding: 20px;
}
.overlay .ov-inner h3 { font-size: 26px; margin-bottom: 10px; }
.overlay .ov-inner p { color: var(--muted); margin-bottom: 18px; font-size: 14px; }
.overlay.hidden { display: none; }

.game-help { margin-top: 14px; color: var(--muted); font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; }
.game-help kbd {
  background: var(--card2); border: 1px solid var(--line); border-bottom-width: 2.5px;
  border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--text); font-family: inherit;
}

.game-side { display: flex; flex-direction: column; gap: 20px; }
.side-block h2 { font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side-block h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.side-games { display: flex; flex-direction: column; gap: 10px; }
.side-game { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; transition: .18s; }
.side-game:hover { border-color: rgba(108, 123, 255, .55); }
.side-game .sg-cover { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; }
.side-game .sg-name { font-size: 14px; font-weight: 600; }
.side-game .sg-meta { color: var(--muted); font-size: 12px; }

.game-info { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.game-info h2 { font-size: 18px; margin-bottom: 12px; }
.game-info p { color: #cfd6e4; font-size: 14.5px; }
.info-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: 13.5px; }
.info-meta .stars { color: var(--gold); letter-spacing: 2px; }

/* 移动端方向键 */
.touch-pad { display: none; margin-top: 14px; justify-content: center; gap: 10px; }
.touch-pad button {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-size: 20px; user-select: none; touch-action: manipulation;
}
.touch-pad button:active { background: var(--accent); }

/* ============ 页脚 ============ */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: var(--bg2); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding: 38px 0 30px; }
.footer-inner h4 { font-size: 15px; margin-bottom: 12px; }
.footer-inner p { color: var(--muted); font-size: 13px; }
.footer-inner ul { list-style: none; }
.footer-inner li { margin-bottom: 8px; }
.footer-inner li a { color: var(--muted); font-size: 13.5px; }
.footer-inner li a:hover { color: var(--accent2); }
.copyright { border-top: 1px solid var(--line); padding: 16px 0; text-align: center; color: var(--muted); font-size: 12.5px; }

.to-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 90;
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 18px;
  opacity: 0; pointer-events: none; transition: .25s;
  box-shadow: var(--shadow);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--accent); border-color: transparent; }

.empty-tip { text-align: center; color: var(--muted); padding: 50px 0; font-size: 14.5px; }

/* ============ 响应式 ============ */
@media (max-width: 920px) {
  .game-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-card .hc-emoji { font-size: 80px; }
}
@media (max-width: 720px) {
  .main-nav { position: static; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 10px; }
  .menu-btn { display: block; }
  .main-nav { display: none; order: 3; width: 100%; }
  .main-nav.open { display: flex; flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr; }
  .hero-card p { max-width: 55%; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .article-wrap { padding: 24px 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .touch-pad.enabled { display: flex; flex-wrap: wrap; }
  .header-search input { width: 100px; }
}
