/* Source-aligned portal skin. Loaded after the legacy stylesheet. */
:root {
  --portal-blue: #20a3df;
  --portal-blue-dark: #118fc9;
  --portal-orange: #ff6900;
  --portal-bg: #f3f3f3;
  --portal-surface: #fff;
  --portal-border: #dedede;
  --portal-border-soft: #e9e9e9;
  --portal-text: #555;
  --portal-muted: #888;
  --portal-width: 920px;
}

html,
body {
  margin: 0;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
.game-card,
.ranking-item,
.m-game-card,
.category-item,
.m-cat-item {
  cursor: pointer;
}

.pc-layout {
  min-height: 100vh;
  background: var(--portal-bg);
}

.portal-utility {
  height: 34px;
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  color: #777;
  font-size: 12px;
}

.portal-utility-inner,
.navbar-inner,
.main-layout,
.footer-section,
.pc-layout > .notices-container,
.top-banner {
  width: min(var(--portal-width), calc(100% - 28px));
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.portal-utility-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-utility-links {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.portal-utility a {
  color: #777;
  font-size: 12px;
}

.portal-utility a:hover {
  color: var(--portal-orange);
}

.navbar {
  position: relative;
  height: 88px;
  background: #fff;
  border-bottom: 1px solid #e4e4e4;
  box-shadow: none;
}

.navbar-inner {
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  min-width: 238px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--portal-orange);
  white-space: nowrap;
}

.logo .site-name {
  color: var(--portal-orange);
  font-size: 27px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.logo small {
  color: var(--portal-orange);
  font-size: 11px;
  font-weight: 700;
}

.search-box {
  width: 290px;
  height: 38px;
  flex: 0 0 290px;
  display: flex;
  border: 1px solid #d8d8d8;
  border-radius: 3px;
  background: #fff;
  box-shadow: none;
  overflow: visible;
}

.search-box input {
  min-width: 0;
  height: 36px;
  padding: 0 13px;
  border: 0;
  background: #fff;
  color: #555;
  font-size: 13px;
}

.search-box input:focus {
  outline: 1px solid var(--portal-blue);
  outline-offset: -1px;
}

.search-btn {
  width: 72px;
  height: 38px;
  flex: 0 0 72px;
  margin: -1px -1px -1px 0;
  border: 0;
  border-radius: 3px;
  background: var(--portal-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.search-btn:hover {
  background: var(--portal-blue-dark);
  transform: none;
}

.header-game-strip {
  min-width: 232px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-game-item {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border: 1px solid #eee;
  border-radius: 7px;
  overflow: hidden;
  background: #eee;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .12);
}

.header-game-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.nav-menu {
  margin-left: auto;
  gap: 0;
}

.nav-menu > .nav-item:not(.user-btn),
.nav-menu > .theme-toggle {
  display: none;
}

.nav-item.user-btn,
.nav-item.user-btn.logged-in {
  min-width: 68px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--portal-orange) !important;
  border-radius: 3px;
  background: #fff !important;
  color: var(--portal-orange) !important;
  box-shadow: none;
}

.nav-avatar {
  width: 22px;
  height: 22px;
}

.top-banner {
  height: 112px;
  margin-top: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--portal-border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.top-banner.placeholder {
  display: none;
}

.top-banner:not(.placeholder) {
  display: block;
}

.main-layout {
  margin-top: 0;
  margin-bottom: 22px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 0;
  align-items: start;
  background: #fff;
  border: 1px solid var(--portal-border);
  box-shadow: none;
}

.sidebar {
  grid-column: 1 / -1;
  width: auto;
  position: static;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.sidebar .sidebar-section {
  display: none;
}

.sidebar .sidebar-section:first-child {
  display: block;
  margin: 0;
}

.sidebar .sidebar-section:not(:first-child) {
  display: none !important;
}

.sidebar-title {
  display: none;
}

.category-list {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  align-items: stretch;
  gap: 0;
  padding: 0 10px;
  overflow: hidden;
  background: var(--portal-blue);
}

.category-item {
  min-width: 0;
  width: 100%;
  height: 42px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.category-item:hover,
.category-item.active {
  background: #fff;
  color: var(--portal-blue-dark);
}

.category-keywords {
  min-height: 142px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  padding: 14px 18px 13px;
  border-bottom: 1px solid var(--portal-border-soft);
  background: #fff;
}

.category-keyword-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.category-keyword-row strong {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid #91cae5;
  background: #f7fcff;
  color: #168ec8;
  font-size: 12px;
  font-weight: 500;
}

.category-keyword-row button {
  max-width: 82px;
  min-width: 0;
  flex: 0 1 auto;
  padding: 0;
  border: 0;
  background: none;
  color: #777;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-keyword-row button:nth-of-type(2n) {
  color: #ef7d35;
}

.category-keyword-row button:hover {
  color: var(--portal-orange);
}

.featured-rail {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  padding: 16px 7px 14px;
  border-bottom: 1px solid var(--portal-border);
  background: #fff;
}

.featured-game-rail {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, 76px);
  grid-auto-columns: 75px;
  gap: 8px 5px;
  overflow: hidden;
  scroll-behavior: smooth;
}

.featured-arrow {
  width: 26px;
  height: 46px;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--portal-blue);
  font-size: 27px;
  line-height: 1;
}

.featured-arrow:hover {
  color: var(--portal-blue-dark);
}

.featured-game-item {
  width: 75px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: #555;
  font-size: 11px;
  text-align: center;
}

.featured-game-item img {
  width: 52px;
  height: 52px;
  display: block;
  margin: 0 auto 5px;
  border-radius: 7px;
  background: #eee;
  object-fit: cover;
}

.featured-game-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  grid-column: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.games-header {
  height: 52px;
  margin: 0;
  padding: 0 16px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--portal-border);
  background: #fff;
}

.games-title {
  display: none;
}

.tab-group {
  margin: 0;
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: none;
}

.tab-btn {
  min-width: 74px;
  height: 52px;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: #555;
  font-size: 14px;
  font-weight: 600;
}

.tab-btn.active,
.tab-btn:hover {
  border-bottom-color: var(--portal-blue);
  background: none;
  color: var(--portal-blue);
  box-shadow: none;
}

.portal-game-count {
  display: flex;
  align-items: center;
  color: #777;
  font-size: 12px;
  white-space: nowrap;
}

.portal-game-count strong {
  margin: 0 3px;
  color: var(--portal-blue);
  font-weight: 500;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 20px 10px;
  min-height: 310px;
  padding: 22px 16px 18px;
  background: #fff;
}

.game-card {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  overflow: visible;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.game-card-image {
  width: 62px;
  height: 62px;
  margin: 0 auto 6px;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
}

.game-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.game-card-info {
  padding: 0;
}

.game-card-title {
  height: 32px;
  color: #555;
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.game-card-meta {
  display: none;
}

.top-badge,
.new-badge {
  top: 2px;
  right: 2px;
  left: auto;
  max-width: calc(100% - 4px);
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: none;
}

.ranking-sidebar {
  grid-column: 2;
  width: auto;
  position: static;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--portal-border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.side-ad {
  height: 104px;
  margin: 10px;
  border-radius: 3px;
  box-shadow: none;
  overflow: hidden;
}

.side-ad:not(.has-image) {
  display: none;
}

.side-ad img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ranking-section {
  margin: 0;
  padding: 13px 11px 15px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.ranking-title {
  padding: 0 0 11px;
  border-bottom: 1px solid #e5e5e5;
  color: #444;
  font-size: 16px;
  font-weight: 700;
}

.ranking-list {
  display: block;
}

.ranking-item {
  min-height: 46px;
  display: grid;
  grid-template-columns: 18px 38px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.ranking-item:hover {
  background: #f8f8f8;
}

.ranking-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.ranking-num {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #ececec;
  color: #666;
  font-size: 10px;
}

.ranking-item:nth-child(1) .ranking-num {
  background: #ffd51e;
  color: #7f6500;
}

.ranking-item:nth-child(2) .ranking-num {
  background: #dfe3e6;
  color: #555;
}

.ranking-item:nth-child(3) .ranking-num {
  background: #e99a43;
  color: #fff;
}

.ranking-name {
  min-width: 0;
  color: #555;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-info {
  min-width: 0;
}

.ranking-rating {
  display: none;
}

.pagination {
  min-height: 64px;
  padding: 15px 12px 20px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.page-info {
  color: #888;
  font-size: 11px;
}

.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #666;
}

.page-btn.active,
.page-btn:hover:not(:disabled) {
  border-color: var(--portal-orange);
  background: var(--portal-orange);
  color: #fff;
}

.footer-section {
  margin-top: 0;
  margin-bottom: 20px;
  padding: 17px;
  border: 1px solid var(--portal-border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.pc-layout > .notices-container {
  display: none !important;
}

.pc-layout > .notices-container .notice-banner {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #f0d7cc;
  border-radius: 0;
  background: #fff8f4;
  color: #6c625e;
  font-size: 12px;
}

.pc-layout > .notices-container .notice-content {
  min-width: 0;
  gap: 7px;
  font-size: 12px;
}

.freeplay-banner {
  width: min(var(--portal-width), calc(100% - 28px));
  margin: 8px auto;
  border-radius: 0;
}

.contact-fab {
  width: 44px;
  height: 44px;
  right: 18px;
  bottom: 18px;
  background: var(--portal-blue);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 20px 10px;
  min-height: 310px;
  padding: 22px 16px 18px;
  background: #fff;
}

.skeleton-grid .skeleton-card,
.m-skeleton-grid .m-skeleton-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.skeleton-grid .skeleton-img {
  width: 62px;
  height: 62px;
  margin: 0 auto 7px;
  border-radius: 8px;
}

.skeleton-grid .skeleton-text,
.skeleton-grid .skeleton-text-sm {
  width: 76%;
  height: 8px;
  margin: 5px auto 0;
}

[data-theme="dark"] body,
[data-theme="dark"] .pc-layout,
[data-theme="dark"] .mobile-layout {
  background: var(--portal-bg);
  color: var(--portal-text);
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .main-layout,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .main-content,
[data-theme="dark"] .ranking-sidebar,
[data-theme="dark"] .games-header,
[data-theme="dark"] .games-grid,
[data-theme="dark"] .game-card,
[data-theme="dark"] .ranking-section,
[data-theme="dark"] .ranking-item {
  background: #fff;
  color: var(--portal-text);
}

@media (min-width: 901px) {
  .pc-layout {
    display: block !important;
  }

  .mobile-layout {
    display: none !important;
  }
}

@media (max-width: 1040px) and (min-width: 901px) {
  :root {
    --portal-width: 880px;
  }

  .header-game-strip {
    display: none;
  }

  .logo {
    min-width: 250px;
  }

  .search-box {
    width: 330px;
    flex-basis: 330px;
  }
}

@media (max-width: 900px) {
  body {
    background: #f4f4f4;
  }

  .pc-layout {
    display: none !important;
  }

  .mobile-layout {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: 60px;
    display: block !important;
    background: #f4f4f4;
    box-shadow: 0 0 0 1px #e5e5e5;
  }

  .m-navbar {
    position: relative;
    height: 58px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #e3e3e3;
    backdrop-filter: none;
  }

  .m-logo {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--portal-orange);
    white-space: nowrap;
  }

  .m-logo .site-name {
    color: var(--portal-orange);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
  }

  .m-logo small {
    color: var(--portal-orange);
    font-size: 9px;
    font-weight: 700;
  }

  .m-user-btn,
  .m-user-btn.logged-in {
    min-width: 56px;
    height: 32px;
    padding: 0 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--portal-orange);
    border-radius: 3px;
    background: #fff;
    color: var(--portal-orange);
    font-size: 11px;
  }

  .m-nav-avatar {
    width: 21px;
    height: 21px;
  }

  .m-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px;
    padding: 11px 14px;
    background: #fff;
  }

  .m-search input {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid #dcdcdc;
    border-radius: 3px;
    background: #fff;
    color: #555;
    font-size: 13px;
  }

  .m-search input:focus {
    outline: 1px solid var(--portal-blue);
    outline-offset: -1px;
  }

  .m-search button {
    height: 36px;
    border: 0;
    border-radius: 3px;
    background: var(--portal-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
  }

  .m-stats {
    display: none;
  }

  .m-notices {
    display: none !important;
  }

  .mobile-layout .notice-banner {
    height: 34px;
    min-height: 34px;
    padding: 5px 9px;
    border: 0;
    border-top: 1px solid #f0ddd4;
    border-bottom: 1px solid #f0ddd4;
    border-radius: 0;
    background: #fff8f4;
    overflow: hidden;
  }

  .mobile-layout .notice-content {
    min-width: 0;
    gap: 6px;
    color: #6c625e;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
  }

  .mobile-layout .notice-content strong {
    flex: 0 0 auto;
    font-size: 10px;
  }

  .mobile-layout .notice-content span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-layout .notice-close {
    flex: 0 0 auto;
  }

  .mobile-layout .freeplay-banner {
    width: auto;
    margin: 7px 10px;
    padding: 7px 9px;
    border-radius: 3px;
    font-size: 10px;
  }

  .m-categories {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 7px 6px;
    padding: 12px 10px;
    margin: 0;
    overflow: visible;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
  }

  .m-cat-item {
    min-width: 0;
    width: auto;
    height: 36px;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e2e8;
    border-radius: 5px;
    background: #edf5fa;
    color: #65727a;
    font-size: 10px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  }

  .m-cat-item.active {
    border-color: var(--portal-orange);
    background: var(--portal-orange);
    color: #fff;
  }

  .m-banner {
    height: 48px;
    margin: 10px 14px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: #239ee4;
    color: #fff;
    box-shadow: 0 2px 6px rgba(21, 126, 190, .2);
    overflow: hidden;
  }

  .m-banner h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
  }

  .m-banner.has-image {
    height: 52px;
    background: #fff;
    box-shadow: none;
  }

  .m-banner.has-image a,
  .m-banner.has-image img {
    width: 100%;
    height: 100%;
    display: block;
  }

  .m-banner.has-image img {
    object-fit: cover;
  }

  .m-tab-switch {
    min-height: 50px;
    margin: 0;
    padding: 0 12px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid #e2e2e2;
    border-bottom: 1px solid #e2e2e2;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .m-tab-buttons {
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 7px;
  }

  .m-tab-btn {
    min-width: 64px;
    height: 50px;
    padding: 0 4px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: #555;
    font-size: 12px;
    font-weight: 600;
  }

  .m-tab-btn.active {
    border-bottom-color: var(--portal-blue);
    background: none;
    color: var(--portal-blue);
    box-shadow: none;
  }

  .m-game-total {
    display: flex;
    align-items: center;
    color: #777;
    font-size: 10px;
    white-space: nowrap;
  }

  .m-game-total strong {
    margin: 0 2px;
    color: var(--portal-blue);
    font-weight: 500;
  }

  .m-games,
  .m-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px 7px;
    min-height: 420px;
    padding: 16px 11px 18px;
    background: #fff;
  }

  .m-game-card {
    position: relative;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
    overflow: visible;
  }

  .m-game-card:active {
    transform: scale(.96);
    background: transparent;
  }

  .m-game-thumb {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto 5px;
    border-radius: 50%;
    background: #eee;
    object-fit: cover;
  }

  .m-game-name {
    height: 28px;
    color: #555;
    font-size: 10px;
    line-height: 14px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .m-top-badge,
  .m-new-badge {
    top: 0;
    right: 3px;
    left: auto;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 7px;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: none;
  }

  .m-skeleton-grid .skeleton-img {
    width: 48px;
    height: 48px;
    margin: 0 auto 7px;
    border-radius: 50%;
  }

  .m-skeleton-grid .skeleton-text {
    width: 70%;
    height: 7px;
    margin: 0 auto;
  }

  .m-pagination {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 8px 16px;
    border-bottom: 1px solid #ddd;
    background: #fff;
  }

  .m-pagination button {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #666;
    font-size: 12px;
  }

  .m-pagination button.active {
    border-color: var(--portal-orange);
    background: var(--portal-orange);
    color: #fff;
  }

  .m-pagination button:disabled {
    background: #fafafa;
    color: #bbb;
  }

  .m-footer {
    margin: 0;
    padding: 13px 12px 68px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .m-tab-bar {
    width: min(100%, 520px);
    height: 58px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #ddd;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .05);
  }

  .m-tab-item {
    color: #777;
    font-size: 10px;
  }

  .m-tab-item.active {
    color: var(--portal-orange);
  }

  .m-tab-item .tab-icon {
    width: 19px;
    height: 19px;
  }

  #mThemeToggle,
  .contact-fab {
    display: none;
  }

  [data-theme="dark"] .m-navbar,
  [data-theme="dark"] .m-search,
  [data-theme="dark"] .m-categories,
  [data-theme="dark"] .m-tab-switch,
  [data-theme="dark"] .m-games,
  [data-theme="dark"] .m-game-card,
  [data-theme="dark"] .m-pagination,
  [data-theme="dark"] .m-footer,
  [data-theme="dark"] .m-tab-bar {
    background: #fff;
    color: var(--portal-text);
  }
}

@media (max-width: 430px) {
  .m-tab-switch {
    padding: 0 9px;
  }

  .m-tab-buttons {
    gap: 4px;
  }

  .m-tab-btn {
    min-width: 59px;
    font-size: 11px;
  }

  .m-game-total {
    font-size: 9px;
  }
}

/* 在线聊天与APP下载：与门户的蓝橙色系统保持一致 */
.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 1200;
  min-width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 12px;
  background: var(--portal-blue);
  color: #fff;
  box-shadow: 0 6px 18px rgba(17,143,201,.28);
  font-size: 10px;
  line-height: 1;
}

.chat-fab:hover {
  background: var(--portal-blue-dark);
  transform: translateY(-1px);
}

.chat-popup {
  position: fixed;
  right: 18px;
  bottom: 130px;
  z-index: 1199;
  width: min(360px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 170px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d7e3e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(26,62,79,.2);
}

.chat-popup.show { display: flex; }

.chat-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8eef1;
  background: #f7fbfd;
}

.chat-popup-header strong,
.chat-popup-header span { display: block; }
.chat-popup-header strong { color: #315466; font-size: 15px; }
.chat-popup-header span { margin-top: 3px; color: #8a9aa3; font-size: 11px; }
.chat-close,
.app-download-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #80909a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #fbfcfd;
}

.chat-empty {
  padding: 44px 20px;
  color: #9aa8af;
  font-size: 13px;
  text-align: center;
}

.chat-message { display: flex; flex-direction: column; margin: 0 0 12px; }
.chat-message.from-user { align-items: flex-end; }
.chat-message.from-admin { align-items: flex-start; }
.chat-bubble {
  max-width: 82%;
  padding: 9px 11px;
  border-radius: 10px;
  color: #42535c;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.from-user .chat-bubble { background: #e7f5fb; }
.from-admin .chat-bubble { background: #fff1e8; }
.chat-message time { margin-top: 4px; color: #a5b0b5; font-size: 10px; }

.chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e8eef1;
  background: #fff;
}
.chat-compose textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: 8px 9px;
  border: 1px solid #d7e3e9;
  border-radius: 8px;
  outline: none;
  color: #42535c;
  font-size: 13px;
}
.chat-compose textarea:focus { border-color: var(--portal-blue); }
.chat-compose button {
  height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: var(--portal-orange);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.app-download-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(24,40,49,.34);
}
.app-download-modal.show { display: grid; }
.app-download-dialog {
  position: relative;
  width: min(380px, 100%);
  padding: 24px;
  border: 1px solid #d7e3e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(24,40,49,.2);
}
.app-download-dialog h3 { margin: 0; color: #315466; font-size: 20px; }
.app-download-dialog p { margin: 8px 0 18px; color: #7c8d96; font-size: 13px; }
.app-download-close { position: absolute; top: 10px; right: 10px; }
.app-download-links { display: grid; gap: 8px; }
.app-download-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid #e1ebef;
  border-radius: 8px;
  color: #315466;
  font-size: 13px;
  text-decoration: none;
}
.app-download-links a:hover { border-color: var(--portal-blue); color: var(--portal-blue-dark); }

@media (max-width: 700px) {
  .chat-fab {
    right: 14px;
    bottom: 72px;
    min-width: 44px;
    height: 44px;
    border-radius: 11px;
  }
  .chat-popup {
    right: 10px;
    bottom: 68px;
    width: calc(100vw - 20px);
    height: min(510px, calc(100vh - 96px));
  }
}

@media (max-width: 370px) {
  .m-logo .site-name {
    font-size: 20px;
  }

  .m-user-btn,
  .m-user-btn.logged-in {
    min-width: 50px;
    padding: 0 7px;
  }

  .m-games,
  .m-skeleton-grid {
    gap: 14px 5px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .m-game-total {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
