/* =========================================
   基础变量与重置 (同级平铺目录版)
   ========================================= */
:root {
  --bg-gradient-top: #e6cd92;
  --bg-gradient-bottom: #83d5ae;
  --sidebar-bg: #2c2d31;
  --border-color: #222222;
  --active-yellow: #ffd743;
  --card-radius: 20px;
  --border-width: 4px;
  
  /* 游戏卡片专属背景色 */
  --color-sudoku: #55a8cd;
  --color-gomoku: #d1b894;
  --color-2048: #9275d3;
  --color-watermelon: #8cb970;
  --color-tetris: #4a679a;
  --color-bridge: #b55e5b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
  display: flex;
  height: 100vh;
  background: linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg-gradient-bottom) 100%);
  overflow: hidden;
}

/* =========================================
   侧边导航栏
   ========================================= */
.sidebar {
  width: 100px;
  background-color: var(--sidebar-bg);
  border-right: 8px solid #f29c38;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  position: relative;
  z-index: 10;
  box-shadow: 5px 0 15px rgba(0,0,0,0.2);
}

.settings-btn {
  width: 48px;
  height: 48px;
  background-color: #ffb732;
  border: var(--border-width) solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--border-color);
  transition: transform 0.1s, box-shadow 0.1s;
}

.settings-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--border-color);
}

.nav-item {
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: var(--border-width) solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-item svg {
  width: 32px;
  height: 32px;
  fill: #a0a0a0;
  transition: fill 0.2s;
}

.nav-item.active, .nav-item:hover {
  background-color: var(--active-yellow);
  border-color: var(--border-color);
  box-shadow: 0 4px 0 var(--border-color);
}

.nav-item.active svg, .nav-item:hover svg {
  fill: var(--border-color);
}

.nav-item.text-nav {
  font-weight: 900;
  font-size: 20px;
  color: #a0a0a0;
  transition: color 0.2s;
}

.nav-item.active.text-nav, .nav-item:hover.text-nav {
  color: var(--border-color);
}

/* =========================================
   主内容区与游戏网格
   ========================================= */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  position: relative;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 30px;
  padding-bottom: 40px;
}

/* =========================================
   游戏卡片样式
   ========================================= */
.game-card-link {
  text-decoration: none;
  display: block;
  outline: none;
}

.game-card {
  position: relative;
  aspect-ratio: 4 / 4.5;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 0 var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.1s, box-shadow 0.1s;
}

.game-card-link:active .game-card {
  transform: translateY(8px);
  box-shadow: 0 0 0 var(--border-color);
}

.bg-sudoku { background-color: var(--color-sudoku); }
.bg-gomoku { background-color: var(--color-gomoku); }
.bg-2048 { background-color: var(--color-2048); }
.bg-watermelon { background-color: var(--color-watermelon); }
.bg-tetris { background-color: var(--color-tetris); }
.bg-bridge { background-color: var(--color-bridge); }

.svg-icon {
  width: 65%;
  height: 65%;
  margin-bottom: 20px;
}

.game-title {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  -webkit-text-stroke: 2.5px var(--border-color);
  letter-spacing: 2px;
  z-index: 10;
}

/* =========================================
   子游戏页专用样式
   ========================================= */
.game-stage-wrapper {
  width: 100%;
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-canvas-area {
  width: 85%;
  height: 75%;
  border: var(--border-width) solid var(--border-color);
  background-color: #ffffff;
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 0 var(--border-color);
  position: relative;
  overflow: hidden;
}