:root {
  --app-bg: #f6f8fb;
  --card-border: #e7ecf3;
  --text-main: #1f2a37;
  --text-muted: #6b7280;
  --brand: #0d6efd;
  --brand-soft: #eef5ff;
  --success-soft: #edf9f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--app-bg) 100%);
  color: var(--text-main);
  font-family: "Noto Sans SC", sans-serif;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #0d6efd 0%, #66a3ff 100%);
  color: #fff;
}

.hero-wrap {
  background:
    linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(13, 202, 240, 0.04)),
    #ffffff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.92rem;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.85;
  max-width: 46rem;
}

.hero-summary {
  border-radius: 1.5rem;
}

.summary-item + .summary-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
}

.summary-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.dashboard-card,
.section-card {
  border-radius: 1.35rem;
}

.dashboard-icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.dashboard-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.dashboard-value {
  margin-top: 0.45rem;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.dashboard-time {
  font-size: 1.05rem;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.section-tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-title {
  margin-bottom: 0.35rem;
  font-size: 1.75rem;
  font-weight: 800;
}

.section-desc {
  margin-bottom: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.library-mode-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.mode-chip-cache {
  background: #eef2f7;
  color: #475569;
}

.mode-chip-live {
  background: #e8f3ff;
  color: #0d6efd;
}

.mode-chip-search {
  background: #ecfdf3;
  color: #198754;
}

.library-mode-hint {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.form-control,
.form-select,
.input-group-text {
  border-color: #d9e2ef;
}

.form-control,
.form-select {
  min-height: 3rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #8ab4ff;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.12);
}

.game-card {
  height: 100%;
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  background: #fff;
  padding: 0.9rem;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: #bcd3ff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.game-card.is-active {
  border-color: #86b7fe;
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
}

.game-card-main {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.game-cover {
  width: 3.3rem;
  height: 3.3rem;
  flex: 0 0 3.3rem;
  border-radius: 0.9rem;
  object-fit: cover;
  border: 1px solid #e5eaf2;
  background: #f8fafc;
}

.game-cover-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #72a8ff 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

.game-card-body {
  min-width: 0;
  flex: 1 1 auto;
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
}

.game-card h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-meta {
  margin-top: 0.35rem;
  color: #8090a7;
  font-size: 0.78rem;
  word-break: break-all;
}

.game-card p {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card small {
  display: block;
  margin-top: 0.55rem;
  color: #8a94a6;
  font-size: 0.78rem;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 4.6rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-ready {
  background: var(--success-soft);
  color: #198754;
}

.badge-pending {
  background: #fff3cd;
  color: #a16207;
}

.pager-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-info {
  color: var(--text-muted);
  font-weight: 600;
}

.status-box {
  min-height: 18rem;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  background: #fbfcfe;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.game-detail {
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.detail-ident {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.detail-cover {
  width: 4.4rem;
  height: 4.4rem;
  flex: 0 0 4.4rem;
  border-radius: 1rem;
  object-fit: cover;
  border: 1px solid var(--card-border);
  background: #f8fafc;
}

.detail-cover-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #72a8ff 100%);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.detail-title-row h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.detail-desc {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.detail-grid div,
.detail-extra-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  background: #fff;
}

.detail-grid span,
.detail-extra-title {
  display: block;
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-bottom: 0.35rem;
}

.detail-grid strong {
  display: block;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.55;
  word-break: break-all;
}

.detail-extra-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
  margin-top: 1rem;
}

.detail-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.detail-link:hover {
  text-decoration: underline;
}

.detail-muted {
  color: var(--text-muted);
}

.detail-gallery {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.detail-gallery a {
  flex: 0 0 auto;
}

.detail-gallery img {
  width: 6rem;
  height: 6rem;
  border-radius: 0.9rem;
  object-fit: cover;
  border: 1px solid var(--card-border);
  background: #f8fafc;
}

.tips-list {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 0.95rem;
}

.tips-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--text-muted);
  line-height: 1.7;
}

.tips-list i {
  color: var(--brand);
  margin-top: 0.22rem;
}

.app-footer {
  background: #ffffff;
}

.footer-brand p,
.footer-copy {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.footer-links a {
  color: #475569;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--brand);
}

@media (max-width: 991.98px) {
  .section-title {
    font-size: 1.45rem;
  }

  .hero-summary {
    margin-top: 0.5rem;
  }

  .detail-grid,
  .detail-extra-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767.98px) {
  .display-5 {
    font-size: 2rem;
  }

  .game-cover {
    width: 3rem;
    height: 3rem;
    flex-basis: 3rem;
  }

  .pager-toolbar,
  .footer-links {
    justify-content: center;
  }

  .detail-ident,
  .detail-grid,
  .detail-extra-grid {
    grid-template-columns: 1fr;
  }

  .detail-ident {
    flex-direction: column;
  }

  .detail-cover {
    width: 4rem;
    height: 4rem;
    flex-basis: 4rem;
  }

  .footer-brand,
  .footer-copy {
    text-align: center;
  }
}


/* Public client catalogue: backend controls and operational diagnostics are intentionally not rendered here. */
.client-hero { overflow: hidden; }
.client-library { min-height: 28rem; }
.client-game-card { display: flex; min-height: 11.75rem; flex-direction: column; justify-content: space-between; }
.game-category { flex: 0 0 auto; max-width: 7.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.22rem 0.5rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 0.72rem; font-weight: 700; }
.client-card-action { margin-top: 1rem; }
.client-card-action .btn { min-height: 2.65rem; border-radius: 0.75rem; font-weight: 700; }
.client-notice { margin-bottom: 1rem; padding: 0.75rem 0.95rem; border-radius: 0.75rem; font-size: 0.92rem; }
.client-notice-info { background: var(--brand-soft); color: #0b5ed7; }
.client-notice-success { background: var(--success-soft); color: #147a3f; }
.client-notice-error { background: #fff2f2; color: #c32f2f; }
.client-empty { display: flex; min-height: 15rem; flex-direction: column; align-items: center; justify-content: center; gap: 0.65rem; border: 1px dashed #cfd9e8; border-radius: 1rem; color: var(--text-muted); }
.client-empty i { color: var(--brand); font-size: 2rem; }
.client-empty strong { color: var(--text-main); }
.client-about { color: var(--text-muted); font-size: 0.95rem; }
.client-about i { margin-right: 0.4rem; color: #f05454; }
@media (max-width: 575.98px) { .client-game-card { min-height: 10.5rem; } .game-category { max-width: 5.5rem; } }

/* Mobile WeChat open tag must occupy the same space as the normal action button. */
wx-open-launch-weapp.h5-open-launch { display: block; width: 100%; min-height: 42px; }
