/* mp.css — 小程序风格全局样式（app.wxss 的网页版，rpx÷2=px） */
:root {
  --ink: #14263a;
  --muted: #687b87;
  --line: rgba(112, 151, 166, 0.16);
  --pearl: #fbfdfd;
  --fog: #6f98bd;
  --blue: #427eaf;
  --mint: #52a892;
  --lavender: #7777b8;
  --orange: #ee795b;
  --card-shadow: 0 5px 14px rgba(43, 76, 91, 0.08);
  --soft-shadow: 0 3.5px 10px rgba(43, 76, 91, 0.065);
  --tabbar-h: 50px;
}

* { margin: 0; padding: 0; }

body {
  background: #edf3f5;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  box-sizing: border-box;
  background-color: #f8fcfd;
  background-image: linear-gradient(rgba(255,255,255,.08), rgba(247,253,253,.06)),
    radial-gradient(circle at 15% 0%, rgba(217,237,247,.55) 0%, rgba(217,237,247,0) 45%),
    radial-gradient(circle at 90% 8%, rgba(232,247,242,.5) 0%, rgba(232,247,242,0) 40%);
  background-repeat: no-repeat;
  box-shadow: 0 0 30px rgba(43, 76, 91, 0.08);
  position: relative;
}

/* 底部 TabBar（完全复刻小程序原生 tabBar：图标+文字，color #7b8a8e / selected #3e7da8 / bg #f9fdfd） */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #f9fdfd;
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 -4px 16px rgba(43, 76, 91, 0.06);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0 4px;
  font-size: 10px;
  color: #7b8a8e;
  text-decoration: none;
}

.tabbar a img { width: 24px; height: 24px; }
.tabbar a .tb-ico-on { display: none; }
.tabbar a.active { color: #3e7da8; }
.tabbar a.active .tb-ico { display: none; }
.tabbar a.active .tb-ico-on { display: block; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  padding: 11px 15px;
  border-radius: 13px;
  background: rgba(24, 46, 58, 0.91);
  color: #fff;
  font-size: 13px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show { opacity: 1; }

/* 按钮点击效果 */
.hover-scale { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.hover-scale:active { transform: scale(0.97) translateY(-1px); }

/* ========== 响应式：平板 / PC 宽屏 ========== */

/* 通用栅格：手机 1 列，平板 2 列，PC 3-4 列自适应 */
.mp-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* PC 顶部导航（仅 ≥1100px 显示，替代底部 tabbar） */
.topnav {
  display: none;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1080px;
  height: 56px;
  box-sizing: border-box;
  padding: 0 24px;
  z-index: 100;
  background: rgba(248, 252, 253, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}

.topnav-brand { display: flex; flex-direction: column; line-height: 1.2; }
.topnav-brand .tb-name { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: 0.5px; }
.topnav-brand .tb-sub { font-size: 10px; color: var(--muted); }

.topnav-links { display: flex; gap: 4px; }
.topnav-links a {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  color: #7b8a8e;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.topnav-links a:hover { background: rgba(66, 126, 175, 0.07); color: #3e7da8; }
.topnav-links a.active { color: #3e7da8; background: rgba(66, 126, 175, 0.12); font-weight: 800; }

/* ≥768px：平板/小笔记本，容器放宽 */
@media (min-width: 768px) {
  .app-shell { max-width: 720px; }
  .tabbar { max-width: 720px; }
  .mp-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ≥1100px：PC 宽屏，顶部导航 + 多列栅格 */
@media (min-width: 1100px) {
  .app-shell { max-width: 1080px; padding-top: 56px; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .mp-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
