/* ============================================================
   桌面版布局（单机 EXE / 大屏）
   覆盖手机端布局层：左侧导航 + 内容区顶栏 + 主内容
   ============================================================ */

/* ---------- 全局：全屏应用布局 ---------- */
html, body { height: 100%; overflow: hidden; }
#app {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  background: var(--bg);
}

/* ---------- 左侧导航 ---------- */
#sideNav.hidden { display: none; }
#sideNav {
  width: 220px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
  color: #fff;
  padding: 14px 10px;
  overflow-y: auto;
  box-shadow: 4px 0 18px rgba(30, 58, 138, .18);
  z-index: 30;
}
#sideNav .nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; padding: 6px 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin-bottom: 12px;
}
#sideNav .nav-brand .logo { font-size: 24px; }
#sideNav .nav-user {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border-radius: 14px; padding: 10px 12px; margin-bottom: 14px;
}
#sideNav .nav-user.off { justify-content: center; opacity: .85; }
#sideNav .nu-av { font-size: 26px; line-height: 1; }
#sideNav .nu-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sideNav .nu-pts { margin-left: auto; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.2); border-radius: 99px; padding: 2px 8px; }
#sideNav .nav-sec { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
#sideNav .nav-sec.sub { border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; }
#sideNav .nav-item {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: rgba(255,255,255,.82);
  padding: 10px 12px; border-radius: 12px; font-size: 14px;
  text-align: left; width: 100%; background: none; border: none; cursor: pointer;
  transition: background .15s, transform .1s;
}
#sideNav .nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
#sideNav .nav-item:active { transform: scale(.97); }
#sideNav .nav-item.on { background: rgba(255,255,255,.2); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 #facc15; }
#sideNav .ni-ic { font-size: 19px; line-height: 1; width: 24px; text-align: center; }
#sideNav .nav-foot {
  margin-top: auto; padding: 10px 8px 0;
  font-size: 11px; color: rgba(255,255,255,.55);
  border-top: 1px solid rgba(255,255,255,.12);
}

/* ---------- 内容区 ---------- */
#content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}
#topBar {
  position: static;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(30, 64, 175, .05);
  min-height: 54px;
}
#topBar .bar-title { font-size: 17px; font-weight: 700; color: var(--ink); }
#topBar .side { display: flex; align-items: center; gap: 10px; }
#topBar .pts {
  background: #eef2ff; color: var(--blue); border-radius: 99px;
  padding: 5px 12px; font-weight: 700; font-size: 14px;
}
#topBar .avatar { font-size: 26px; line-height: 1; }
#topBar .bar-sound {
  background: #f1f5f9; border-radius: 10px; font-size: 16px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#topBar .bar-sound:hover { background: #e2e8f0; }
#topBar.hidden, #bottomNav.hidden { display: none; }

/* ---------- 主内容滚动区 ---------- */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 40px;
}
#main .screen.active {
  max-width: 1080px;
  margin: 0 auto;
}
/* 后台管理页：不受内容宽度限制，随屏幕放大/全宽展示 */
#main .screen.active.admin-screen {
  max-width: none;
  margin: 0;
}

/* ---------- 隐藏手机端元素 ---------- */
#bottomNav { display: none !important; }

/* ---------- 大屏下页面网格桌面化 ---------- */
.menu-grid { grid-template-columns: repeat(3, 1fr); }
.menu-item { padding: 22px 16px; }
.menu-item .m-ic { font-size: 44px; }

.level-map { grid-template-columns: repeat(6, 1fr); }
.level-node { aspect-ratio: 1/0.9; }

.stats-grid { grid-template-columns: repeat(4, 1fr); }

/* 闯关地图/首页卡片在大屏下更舒展 */
.hero { padding: 26px 22px; }
.hero .hello { font-size: 22px; }
.hero .hello b { font-size: 30px; }
.hero .pts-num { font-size: 46px; }

/* 答题页：题目卡片更宽，选项两列 */
.q-card { max-width: 860px; margin: 0 auto 12px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 考试页：题号导航横向排布 */
.exam-nav { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; padding: 10px; background: #f8fafc; border-radius: 12px; }

/* 弹窗在桌面居中，宽度加大 */
.modal-box { width: min(480px, 90vw); }

/* 家长/管理后台表格容器自适应 */
.panel { max-width: 1080px; margin: 0 auto; }

/* 商城网格桌面化 */
.shop-grid { grid-template-columns: repeat(3, 1fr); }
