/* ============================================
   全局重置与基础样式
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   页面容器
   ============================================ */

.container {
  background-color: #fff;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ============================================
   顶部导航栏
   ============================================ */

.page-header {
  background-color: rgb(255, 255, 255);
  color: rgb(0, 0, 0);
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-header .title {
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

/* ============================================
   轮播图 Banner
   ============================================ */

.swiper-container {
  margin: 0.9375rem 0.625rem;
  position: relative;
  border-radius: 0.625rem;
  overflow: hidden;
}

.banner-swiper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 45%;
  overflow: hidden;
}

.swiper-slides {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  transition: transform 0.4s ease;
}

.swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.banner-item {
  width: 100%;
  height: 100%;
}

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

.swiper-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.swiper-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.swiper-dot.active {
  background: #4a90e2;
}

/* ============================================
   公告通知栏
   ============================================ */

.notice-section {
  margin: 0.625rem;
  background: #eef0fa;
  border-radius: 0.46875rem;
  overflow: hidden;
}

.notice-container {
  display: flex;
  align-items: center;
  padding: 0.625rem;
  min-height: 2.5rem;
}

.notice-icon {
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.46875rem;
  flex-shrink: 0;
}

.notice-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 1.25rem;
  line-height: 1.25rem;
}

.notice-text {
  white-space: nowrap;
  font-size: 0.875rem;
  color: #6478b1;
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
}

.notice-text.scrolling {
  animation: scrollNotice 15s linear infinite;
}

@keyframes scrollNotice {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ============================================
   功能按钮区（南宫官网 + 客服/公告/邀请）
   ============================================ */

.button-group-section {
  background: #fff;
  border-radius: 0.625rem;
  padding: 0.9375rem;
}

.top-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-area {
  flex: 1;
}

.main-title {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.function-buttons {
  display: flex;
  align-items: center;
  gap: 0.9375rem;
}

.function-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.5rem;
  cursor: pointer;
}

.btn-icon {
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 50%;
  background: #f0f0f0;
  margin-bottom: 0.25rem;
  overflow: hidden;
}

.btn-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-text {
  font-size: 0.75rem;
  color: #666;
}

/* ============================================
   游戏区块（旗下平台 / 特色活动）
   ============================================ */

.game-section {
  margin: 0.9375rem 0.625rem;
  background: #fff;
  border-radius: 0.625rem;
  padding: 0.9375rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9375rem;
}

.section-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title-img {
  height: 1.25rem;
  width: auto;
}

.section-h1 {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.section-more {
  width: 4.6875rem;
  height: auto;
  cursor: pointer;
}

.section-more img {
  width: 100%;
  height: auto;
}

/* ============================================
   游戏卡片列表（3列网格）
   ============================================ */

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.game-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8f9fc;
  border-radius: 0.625rem;
  padding: 0.75rem 0.5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.game-tag {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.5rem;
  height: auto;
  z-index: 2;
}

.game-tag img {
  width: 100%;
  height: auto;
}

.game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.game-icon {
  width: 3.125rem;
  height: 3.125rem;
  border-radius: 0.625rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info {
  width: 100%;
  margin-bottom: 0.5rem;
}

.game-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.1875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-desc {
  font-size: 0.6875rem;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-btn {
  display: inline-block;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 1rem;
  border-radius: 1.25rem;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

/* ============================================
   热门活动区块
   ============================================ */

.activity-section {
  margin: 0.9375rem 0.625rem;
  background: #fff;
  border-radius: 0.625rem;
  padding: 0.9375rem;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.activity-card {
  border-radius: 0.625rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  height: 7.5rem;
}

.activity-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.activity-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.activity-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 0.625rem;
}

.activity-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  width: 85%;
}

.activity-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.activity-desc {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* ============================================
   底部 TabBar
   ============================================ */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  z-index: 999;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.tabbar-inner {
  display: flex;
  height: 50px;
}

a.tabbar-item {
  text-decoration: none;
  color: inherit;
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 3px;
}

.tabbar-icon {
  width: 24px;
  height: 24px;
}

.tabbar-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tabbar-label {
  font-size: 10px;
  color: #7a7e83;
  line-height: normal;
}

.tabbar-item.active .tabbar-label {
  color: #4a90e2;
}

/* ============================================
   公告弹窗
   ============================================ */

.modal-overlay {
  position: fixed;
  z-index: 9999;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 1rem;
  width: 85%;
  max-width: 22rem;
  padding: 1.5rem;
  text-align: center;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
}

.modal-content {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #7c4dff, #536dfe);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
}

.modal-btn:active {
  opacity: 0.85;
}

/* Toast 提示 */

.toast {
  position: fixed;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 1.5rem;
  font-size: 0.875rem;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* ============================================
   游戏页面 (games.html)
   ============================================ */

.games-page {
  padding-bottom: 0.5rem;
}

.games-layout {
  display: flex;
  min-height: calc(100vh - 2.75rem - 3.125rem);
}

.games-categories {
  width: 7.5rem;
  min-width: 7.5rem;
  background: #f8f9fa;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-item {
  height: 3.125rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.75rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  background-image: url(/skin/images/free_off.png);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100%;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.category-item.active {
  color: #fff;
  background-image: url(/skin/images/free_on.png);
}

.games-list {
  flex: 1;
  padding: 0.75rem 0.625rem;
  overflow-y: auto;
  background: #f0f4f7;
}

.games-list .game-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

/* ============================================
   工具页面 (tools.html)
   ============================================ */

.tools-page {
  padding: 0.75rem;
  background: #f5f7fa;
  min-height: calc(100vh - 2.75rem - 3.125rem);
}

.tools-section {
  margin-bottom: 1.25rem;
}

.tools-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.75rem;
  padding-left: 0.125rem;
}

.tool-card {
  display: flex;
  align-items: center;
  padding: 1rem 1.125rem;
  border-radius: 0.875rem;
  margin-bottom: 0.625rem;
  cursor: pointer;
  transition: transform 0.15s;
  color: #fff;
}

.tool-card.card-blue {
  background: linear-gradient(135deg, #4285f4, #1e3a8a);
}

.tool-card.card-navy {
  background: linear-gradient(135deg, #1e40af, #0f172a);
}

.tool-card.card-purple {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
}

.tool-card:active {
  transform: scale(0.98);
}

.tool-card-icon {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 0.875rem;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 1rem;
  background: rgba(255, 255, 255, 0.2);
}

.tool-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-card-content {
  flex: 1;
  min-width: 0;
}

.tool-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.tool-card-desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
}

.tool-card-arrow {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* ============================================
   联系页面 (contact.html)
   ============================================ */

.contact-page {
  padding: 0.75rem;
  background: #f5f7fa;
  min-height: calc(100vh - 2.75rem - 3.125rem);
}

.contact-header-box {
  text-align: center;
  padding: 1.75rem 1.25rem;
  margin-bottom: 1rem;
}

.contact-header-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.contact-header-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #222;
  margin-bottom: 0.75rem;
}

.contact-header-desc {
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
  line-height: 1.7;
  text-align: left;
  padding: 0;
}

.contact-cards {
  margin-bottom: 1rem;
}

.contact-card {
  display: block;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  background: #fff;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.15s;
}

.contact-card:active {
  transform: scale(0.98);
}

.contact-card-title {
  font-size: 1.1875rem;
  font-weight: 800;
  color: #222;
  margin-bottom: 0.5rem;
}

.contact-card-value {
  font-size: 0.9375rem;
  color: #999;
  margin-bottom: 1rem;
}

.contact-card-btn {
  display: inline-block;
  padding: 0.4375rem 1.5rem;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 1.25rem;
  cursor: pointer;
}

.service-info {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #fff;
  border-radius: 0.75rem;
  margin-top: 0.75rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.service-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.service-time {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e88e5;
  margin-bottom: 0.25rem;
}

.service-desc {
  font-size: 0.875rem;
  color: #999;
}

/* ============================================
   工具类
   ============================================ */

.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
