/* ===== Game Page Styles ===== */
.page-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 80vh; gap: 18px;
  color: var(--text-muted);
}

/* ===== Game Hero ===== */
.game-hero {
  position: relative; overflow: hidden;
  background: var(--bg-card2);
  padding: 56px 0 0;
  border-bottom: 1px solid var(--border);
}
.game-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(124,109,250,0.18) 0%, transparent 65%);
}
.game-hero-bg-emoji {
  position: absolute; right: 4%; top: 50%; transform: translateY(-50%);
  font-size: 14rem; opacity: 0.06; pointer-events: none;
  animation: float 7s ease-in-out infinite;
}
.game-hero-inner {
  position: relative; z-index: 1;
  max-width: 1280px; margin: 0 auto; padding: 0 24px 40px;
}
.game-hero-top { display: flex; align-items: flex-start; gap: 28px; margin-bottom: 28px; }
.game-cover {
  width: 130px; height: 170px; border-radius: var(--radius);
  background: linear-gradient(135deg, #111118, #1a1030);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; flex-shrink: 0;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; position: relative;
}
.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-hero-bg-emoji img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  display: block;
}
.game-info { flex: 1; }
.game-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.game-tag {
  padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 600;
  background: rgba(124,109,250,0.15); color: var(--primary); border: 1px solid rgba(124,109,250,0.25);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.game-tag.platform { background: rgba(52,211,153,0.12); color: var(--success); border-color: rgba(52,211,153,0.25); }
.game-title { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 900; color: white; margin-bottom: 6px; letter-spacing: -1px; }
.game-subtitle { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 16px; }
.game-meta { display: flex; flex-wrap: wrap; gap: 20px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.meta-value { font-size: 13px; color: var(--text); font-weight: 600; }
.meta-rating { color: var(--accent); }

.game-hero-stats {
  display: flex; gap: 0;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.hero-stat { flex: 1; padding: 14px 18px; text-align: center; border-right: 1px solid var(--border); }
.hero-stat:last-child { border-right: none; }
.hero-stat-value { font-size: 1.4rem; font-weight: 800; color: white; display: block; letter-spacing: -0.5px; }
.hero-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Page Nav */
.game-nav {
  background: rgba(9,9,15,0.92); backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 64px; z-index: 100;
}
.game-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
}
.game-nav-inner::-webkit-scrollbar { display: none; }
.game-nav-item {
  padding: 13px 18px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); white-space: nowrap; cursor: pointer;
  border-bottom: 2px solid transparent; transition: var(--transition);
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit; letter-spacing: 0.2px;
}
.game-nav-item:hover { color: var(--text); }
.game-nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== Main Layout ===== */
.game-main {
  max-width: 1280px; margin: 0 auto; padding: 36px 24px;
  display: grid; grid-template-columns: 1fr 300px; gap: 28px;
}
.game-content { min-width: 0; }

/* Sections */
.section-block { margin-bottom: 36px; }
.section-block-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding-bottom: 14px; border-bottom: 2px solid var(--border);
}
.section-icon { font-size: 1.3rem; }
.section-block-title { font-size: 1.15rem; font-weight: 800; color: white; letter-spacing: -0.3px; }
.section-block-desc { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.articles-grid { display: flex; flex-direction: column; gap: 8px; }
.article-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px;
  padding: 18px 18px; border-radius: var(--radius-sm);
  background: var(--bg-glass); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--text);
}
.article-item:hover { background: rgba(124,109,250,0.08); border-color: var(--border-hover); transform: translateX(4px); }
.article-index {
  width: 34px; height: 34px; border-radius: 7px; flex-shrink: 0;
  background: rgba(124,109,250,0.15); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--primary);
}
.article-info { flex: 1; min-width: 0; }
.article-title { font-size: 15px; font-weight: 700; color: white; margin-bottom: 4px; line-height: 1.4; }
.article-summary { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.article-arrow { color: var(--text-dim); font-size: 20px; flex-shrink: 0; }
.article-views { font-size: 13px; color: var(--text-dim); flex-shrink: 0; }

/* ===== Characters ===== */
.characters-section { margin-bottom: 36px; }
.characters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.character-card {
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: var(--transition); text-align: center;
}
.character-card:hover { border-color: var(--border-hover); background: rgba(124,109,250,0.08); transform: translateY(-3px); }
.char-avatar {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 10px;
  background: linear-gradient(135deg, rgba(124,109,250,0.25), rgba(168,139,250,0.2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; border: 2px solid var(--border);
}
.char-name { font-size: 13px; font-weight: 700; color: white; margin-bottom: 3px; }
.char-title { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.char-badges { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.char-badge {
  padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700;
  background: rgba(124,109,250,0.15); color: var(--primary); text-transform: uppercase; letter-spacing: 0.3px;
}
.char-badge.rarity-Legendary, .char-badge.rarity-Mythic { background: rgba(251,191,36,0.15); color: var(--warning); }
.char-badge.rarity-Origin { background: rgba(244,114,182,0.15); color: #f472b6; }

/* Character detail modal */
.char-detail { padding: 4px; }
.char-detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.char-detail-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, rgba(124,109,250,0.3), rgba(168,139,250,0.2)); display: flex; align-items: center; justify-content: center; font-size: 2.2rem; border: 2px solid var(--primary); flex-shrink: 0; }
.char-detail-info h3 { font-size: 1.2rem; color: white; margin-bottom: 3px; font-weight: 800; letter-spacing: -0.3px; }
.char-detail-info p { color: var(--text-muted); font-size: 13px; }
.char-desc { background: var(--bg-glass); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; color: var(--text-muted); font-size: 14px; line-height: 1.75; border: 1px solid var(--border); }
.char-section-title { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; margin-top: 16px; }
.char-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.char-skill-tag { padding: 5px 12px; border-radius: 50px; background: rgba(124,109,250,0.15); border: 1px solid rgba(124,109,250,0.25); color: var(--primary); font-size: 12px; font-weight: 600; }
.char-tips-box { background: rgba(52,211,153,0.07); border: 1px solid rgba(52,211,153,0.2); border-radius: var(--radius-sm); padding: 14px; }
.char-tips-box p { color: var(--success); font-size: 13px; line-height: 1.7; }

/* ===== Sidebar ===== */
.game-sidebar { position: sticky; top: 120px; height: fit-content; display: flex; flex-direction: column; gap: 16px; }

.sidebar-card {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.sidebar-card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-card-title { font-size: 15px; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-card-body { padding: 16px; }

.quick-nav { display: flex; flex-direction: column; gap: 4px; }
.quick-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  background: var(--bg-glass); border: 1px solid transparent;
  cursor: pointer; transition: var(--transition); color: var(--text-muted);
  font-size: 13px; font-weight: 500;
}
.quick-nav-item:hover { border-color: var(--border-hover); color: var(--text); background: rgba(124,109,250,0.08); }
.quick-nav-icon { font-size: 0.9rem; }

.tips-list { display: flex; flex-direction: column; gap: 8px; }
.tip-item {
  padding: 10px; border-radius: var(--radius-sm);
  display: flex; gap: 8px; align-items: flex-start;
}
.tip-item.beginner { background: rgba(52,211,153,0.07); border: 1px solid rgba(52,211,153,0.18); }
.tip-item.advanced { background: rgba(251,191,36,0.07); border: 1px solid rgba(251,191,36,0.18); }
.tip-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.tip-text { font-size: 12px; color: var(--text-muted); line-height: 1.55; }

.info-table { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.info-key { font-size: 13px; color: var(--text-dim); flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.5px; }
.info-val { font-size: 14px; color: var(--text); text-align: right; font-weight: 600; line-height: 1.45; }

/* ===== Article Modal ===== */
.article-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: flex-start; justify-content: center; padding: 20px;
}
.article-modal.show { display: flex; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(6px); }
.modal-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 780px; max-height: 90vh;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; margin-top: 36px;
}
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-header h2 { font-size: 1.1rem; color: white; font-weight: 800; letter-spacing: -0.3px; }
.modal-close {
  width: 34px; height: 34px; border-radius: 6px;
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 15px; cursor: pointer;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; font-size: 15px; line-height: 1.8; }

/* Markdown rendering */
.modal-body h1, .modal-body h2, .modal-body h3 { color: white; font-weight: 800; margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); letter-spacing: -0.5px; }
.modal-body h2 { font-size: 1.15rem; }
.modal-body h3 { font-size: 0.95rem; border-bottom: none; color: #a78bfa; padding-bottom: 0; }
.modal-body p { margin-bottom: 14px; color: var(--text-muted); }
.modal-body ul, .modal-body ol { padding-left: 22px; margin-bottom: 14px; }
.modal-body li { margin-bottom: 7px; color: var(--text-muted); }
.modal-body strong { color: var(--accent); font-weight: 700; }
.modal-body em { color: #a78bfa; font-style: italic; }
.modal-body code { background: rgba(124,109,250,0.1); padding: 2px 7px; border-radius: 4px; font-size: 0.88em; color: var(--primary); border: 1px solid rgba(124,109,250,0.2); }
.modal-body pre { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; margin-bottom: 16px; }
.modal-body blockquote { border-left: 3px solid var(--primary); padding-left: 16px; color: var(--text-muted); margin: 16px 0; font-style: italic; }
.modal-body hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.markdown-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0 22px;
  border-radius: 10px;
  border: 1px solid rgba(124,109,250,0.25);
  background: transparent;
}
.markdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
/* 表头 */
.markdown-table th {
  padding: 12px 16px;
  background: rgba(124,109,250,0.2);
  color: #d4cfff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-align: left;
  border-bottom: 1px solid rgba(124,109,250,0.35);
  white-space: nowrap;
}
.markdown-table th:first-child { border-radius: 10px 0 0 0; }
.markdown-table th:last-child  { border-radius: 0 10px 0 0; }
/* 单元格 */
.markdown-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  vertical-align: top;
}
/* 斑马纹 */
.markdown-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.03);
}
/* 悬停高亮 */
.markdown-table tbody tr:hover td {
  background: rgba(124,109,250,0.1);
  transition: background 0.15s;
}
/* 第一列 — 关键词列加强色 */
.markdown-table td:first-child {
  color: #c4baff;
  font-weight: 600;
  white-space: nowrap;
}
.markdown-table tbody tr:last-child td { border-bottom: none; }

/* Error page */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 14px; color: var(--text-muted); }
.error-page .error-icon { font-size: 4.5rem; }
.error-page h2 { font-size: 1.4rem; color: white; font-weight: 800; }
.error-page .btn-back { padding: 10px 24px; border-radius: var(--radius-sm); background: var(--primary); color: white; text-decoration: none; font-weight: 700; transition: var(--transition); }
.error-page .btn-back:hover { background: var(--primary-dark); }

/* ===== AdSense ===== */
.ad-inline { display: none; }
.sidebar-ad-card { display: none; }
.google-auto-placed,
ins.adsbygoogle,
iframe[id^="google_ads_iframe"],
iframe[id^="aswift_"],
div[id^="aswift_"] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .game-main { grid-template-columns: 1fr; }
  .game-sidebar { position: static; }
}
@media (max-width: 640px) {
  .page-loading { min-height: 70vh; height: auto; padding: 48px 16px; }
  .nav-breadcrumb { display: none; }
  .navbar {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .nav-container {
    height: 56px;
    gap: 12px;
  }
  .nav-logo { min-width: 0; }
  .logo-text {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-link {
    padding: 8px 10px;
    font-size: 13px;
  }
  .game-hero {
    padding: 28px 0 0;
  }
  .game-hero::before {
    background: radial-gradient(ellipse at 40% 0%, rgba(124,109,250,0.2) 0%, transparent 72%);
  }
  .game-hero-bg-emoji {
    right: -18%;
    top: 18%;
    transform: none;
    font-size: 9rem;
    opacity: 0.045;
    animation: none;
  }
  .game-hero-inner {
    padding: 0 16px 24px;
  }
  .game-hero-top {
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
  }
  .game-cover {
    width: 92px;
    height: 122px;
    border-radius: 12px;
    font-size: 2.8rem;
  }
  .game-info {
    min-width: 0;
  }
  .game-tags {
    gap: 6px;
    margin-bottom: 8px;
  }
  .game-tag {
    max-width: 100%;
    padding: 2px 8px;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .game-title {
    font-size: clamp(1.45rem, 7vw, 2rem);
    line-height: 1.15;
    margin-bottom: 5px;
  }
  .game-subtitle {
    font-size: 13px;
    margin-bottom: 12px;
  }
  .game-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }
  .meta-label { font-size: 9px; }
  .meta-value { font-size: 12px; }
  .game-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 12px;
  }
  .hero-stat {
    min-width: 0;
    padding: 12px 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .hero-stat:nth-child(2n) { border-right: none; }
  .hero-stat:nth-last-child(-n + 2) { border-bottom: none; }
  .hero-stat-value { font-size: 1.2rem; }
  .hero-stat-label { font-size: 10px; }
  .game-nav {
    top: 56px;
  }
  .game-nav-inner {
    padding: 0 16px;
  }
  .game-nav-item {
    padding: 12px 14px;
    font-size: 12px;
  }
  .game-main {
    padding: 26px 16px;
    gap: 22px;
  }
  .section-block {
    margin-bottom: 28px;
  }
  .section-block-header {
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .section-block-title {
    font-size: 1.05rem;
  }
  .section-block-desc {
    display: none;
  }
  .article-item {
    align-items: flex-start;
    gap: 10px;
    min-height: 78px;
    padding: 15px;
  }
  .article-index {
    width: 32px;
    height: 32px;
  }
  .article-title { font-size: 15px; }
  .article-summary { font-size: 13px; }
  .article-summary {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .article-views {
    display: none;
  }
  .characters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .character-card {
    padding: 14px 10px;
  }
  .game-sidebar {
    gap: 12px;
  }
  .quick-nav-card {
    display: none;
  }
  .sidebar-card-header {
    padding: 13px 15px;
  }
  .sidebar-card-body {
    padding: 14px;
  }
  .info-row {
    gap: 12px;
  }
  .info-key { font-size: 13px; }
  .info-val { font-size: 14px; }
  .article-modal {
    align-items: stretch;
    padding: 0;
  }
  .modal-content {
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100vh;
    height: 100dvh;
    margin-top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .modal-header {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }
  .modal-header h2 {
    font-size: 1rem;
    line-height: 1.35;
    padding-right: 12px;
  }
  .modal-close {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }
  .modal-body {
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    font-size: 14px;
    line-height: 1.75;
  }
  .modal-body h1,
  .modal-body h2,
  .modal-body h3 {
    margin: 20px 0 10px;
  }
}
@media (min-width: 641px) and (max-width: 768px) {
  .game-hero { padding: 36px 0 0; }
  .game-cover { width: 100px; height: 132px; font-size: 3rem; }
  .game-title { font-size: 1.7rem; }
  .game-hero-stats { flex-wrap: wrap; }
  .hero-stat { min-width: 50%; }
  .characters-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .article-modal { padding: 12px; }
  .modal-content { margin-top: 0; max-height: 95vh; }
  .nav-breadcrumb { display: none; }
}

/* Breadcrumb */
.nav-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.breadcrumb-link { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.breadcrumb-link:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-dim); }
#breadcrumbGame { color: var(--text); font-weight: 600; }

@keyframes float { 0%,100% { transform: translateY(-50%); } 50% { transform: translateY(calc(-50% - 18px)); } }
