/* 脑力加油站 · 共享样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #2c2c2c;
  background: #fafaf7;
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(45,125,110,.1);
  overflow-x: hidden;
}
a { color: #2d7d6e; text-decoration: none; transition: color .2s; }
a:hover { color: #1a5349; text-decoration: underline; }

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.topbar-logo { font-weight: 700; color: #2d7d6e; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-logo-icon {
  display: inline-block; width: 28px; height: 28px;
  background: linear-gradient(135deg, #2d7d6e, #4aab98);
  border-radius: 8px; line-height: 28px; text-align: center;
  color: #fff; font-size: 16px;
}
.topbar-nav { display: flex; gap: 20px; }
.topbar-nav a { color: #555; font-size: 14px; padding: 4px 8px; border-radius: 4px; }
.topbar-nav a:hover { background: #f0f7f4; text-decoration: none; }
.topbar-nav a.active { background: #f0f7f4; color: #2d7d6e; }
.topbar-cta {
  background: #2d7d6e; color: #fff !important;
  padding: 8px 18px; border-radius: 6px; font-size: 14px;
  text-decoration: none !important; flex-shrink: 0;
}
.topbar-cta:hover { background: #1a5349; }

/* 移动端汉堡菜单 */
.topbar-menu {
  display: none;
  background: none; border: none;
  font-size: 24px; color: #2d7d6e;
  cursor: pointer; padding: 4px 8px;
}
.topbar-mobile-nav {
  display: none;
  position: fixed; top: 56px; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid #eee;
  flex-direction: column;
  padding: 12px 20px;
  z-index: 99;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.topbar-mobile-nav.open { display: flex; }
.topbar-mobile-nav a {
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 15px;
}
.topbar-mobile-nav a:last-child { border-bottom: none; }

/* 按钮 */
.btn {
  display: inline-block; padding: 12px 28px;
  border-radius: 8px; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: all .2s; border: none;
  text-decoration: none; text-align: center;
  min-height: 44px; /* iOS 推荐触摸最小区域 */
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: #2d7d6e; color: #fff; }
.btn-primary:hover { background: #1a5349; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,125,110,.3); }
.btn-secondary { background: #fff; color: #2d7d6e; border: 2px solid #2d7d6e; }
.btn-secondary:hover { background: #f0f7f4; }
.btn-ghost { background: transparent; color: #666; border: 1px solid #ddd; }
.btn-ghost:hover { background: #f5f5f5; }
.btn-large { padding: 16px 40px; font-size: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 卡片 */
.card {
  background: #fff; border-radius: 12px;
  border: 1px solid #eef0ed;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* 游戏舞台 */
.game-stage {
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
}
.game-card {
  width: 100%; max-width: 640px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  border: 1px solid #eef0ed;
  padding: 32px;
  text-align: center;
}
.game-title {
  font-size: 24px; font-weight: 700;
  color: #1a1a1a; margin-bottom: 8px;
}
.game-subtitle {
  font-size: 14px; color: #888; margin-bottom: 24px;
}
.game-meta {
  display: flex; justify-content: center; gap: 24px;
  margin: 20px 0; padding: 16px;
  background: #f7f9f8; border-radius: 8px;
  flex-wrap: wrap;
}
.meta-item { text-align: center; }
.meta-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.1em; }
.meta-value { font-size: 20px; font-weight: 700; color: #2d7d6e; margin-top: 2px; }

/* 信息框 */
.info-box {
  margin: 24px 0; padding: 16px 20px;
  background: linear-gradient(135deg, #fef9e7 0%, #fef4d3 100%);
  border-left: 4px solid #f0a500;
  border-radius: 0 8px 8px 0;
  font-size: 14px; color: #5a4504;
}
.info-box.success {
  background: linear-gradient(135deg, #e8f7ed 0%, #d8f0e0 100%);
  border-left-color: #2d7d6e;
  color: #1a5349;
}
.info-box.error {
  background: linear-gradient(135deg, #fde7e7 0%, #fbd5d5 100%);
  border-left-color: #d94c4c;
  color: #8a1f1f;
}

/* 进度条 */
.progress {
  width: 100%; height: 8px;
  background: #eef0ed; border-radius: 4px;
  overflow: hidden; margin: 16px 0;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, #2d7d6e, #4aab98);
  transition: width .3s;
}

/* 雷达图 */
.radar-container {
  position: relative;
  width: 320px; height: 320px;
  margin: 24px auto;
}
.radar-svg { width: 100%; height: 100%; }
.radar-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.radar-center .num {
  font-size: 32px; font-weight: 700; color: #2d7d6e;
}
.radar-center .label {
  font-size: 11px; color: #888;
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* 页脚 */
footer {
  text-align: center; padding: 32px 20px;
  background: #2a2a2a; color: #aaa;
  margin-top: 80px;
}
footer a { color: #aaa; margin: 0 12px; }
footer p { font-size: 13px; margin: 6px 0; }

/* 工具类 */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 16px; }
.color-primary { color: #2d7d6e; }
.color-muted { color: #888; }
.font-bold { font-weight: 700; }

/* 难度选择器 */
.difficulty-picker {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin: 20px 0;
  padding: 12px;
  background: #f7f9f8;
  border-radius: 8px;
}
.difficulty-picker-label {
  width: 100%; text-align: center;
  font-size: 13px; color: #888;
  margin-bottom: 4px;
}
.difficulty-btn {
  background: #fff; border: 2px solid #eef0ed;
  color: #555; padding: 8px 14px;
  border-radius: 6px; font-size: 13px;
  cursor: pointer; font-weight: 600;
  min-width: 48px; min-height: 44px;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.difficulty-btn:hover { border-color: #2d7d6e; color: #2d7d6e; }
.difficulty-btn.active {
  background: #2d7d6e; color: #fff;
  border-color: #2d7d6e;
}
.difficulty-btn.auto { color: #888; }

/* 维度筛选 */
.dim-filter {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  margin: 0 0 24px;
  padding: 12px;
  background: #fff; border-radius: 12px;
  border: 1px solid #eef0ed;
}
.dim-filter-btn {
  background: #fafaf7; border: 2px solid transparent;
  color: #555; padding: 8px 14px;
  border-radius: 999px; font-size: 13px;
  font-weight: 500; cursor: pointer;
  transition: all .15s;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}
.dim-filter-btn:hover {
  border-color: #2d7d6e; color: #2d7d6e;
  background: #f0f7f4;
}
.dim-filter-btn.active {
  background: #2d7d6e; color: #fff;
  border-color: #2d7d6e;
}

/* 印章动效 */
.stamp {
  display: inline-block;
  padding: 12px 24px;
  border: 4px double #d94c4c;
  color: #d94c4c;
  font-weight: 700;
  font-size: 18px;
  border-radius: 8px;
  transform: rotate(-6deg);
  opacity: 0;
  animation: stampIn .6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  background: rgba(217,76,76,.05);
  letter-spacing: 0.2em;
}
@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-6deg) scale(2); }
  60% { opacity: 1; transform: rotate(-6deg) scale(.9); }
  100% { opacity: 1; transform: rotate(-6deg) scale(1); }
}
.stamp-small {
  padding: 6px 12px;
  font-size: 12px;
  border-width: 2px;
}

/* 响应式 - 平板 */
@media (max-width: 1024px) {
  .game-card { max-width: 90%; }
}

/* 响应式 - 手机 */
@media (max-width: 768px) {
  /* 顶部导航：折叠为汉堡菜单 */
  .topbar { padding: 10px 16px; }
  .topbar-nav { display: none; }
  .topbar-menu { display: inline-block; }
  .topbar-logo { font-size: 15px; }
  .topbar-logo-icon { width: 26px; height: 26px; line-height: 26px; font-size: 14px; }
  .topbar-cta { padding: 6px 14px; font-size: 13px; }

  /* 按钮 */
  .btn { padding: 10px 20px; font-size: 15px; }
  .btn-large { padding: 14px 32px; font-size: 16px; }

  /* 游戏舞台 */
  .game-stage { padding: 12px; min-height: calc(100vh - 50px); }
  .game-card { padding: 20px 16px; border-radius: 12px; }
  .game-title { font-size: 20px; }
  .game-subtitle { font-size: 13px; margin-bottom: 16px; }
  .game-meta {
    gap: 12px; padding: 12px;
    flex-wrap: wrap;
  }
  .meta-value { font-size: 18px; }
  .meta-label { font-size: 10px; }

  /* 信息框 */
  .info-box { padding: 12px 14px; font-size: 13px; margin: 16px 0; }

  /* 雷达图 */
  .radar-container { width: 260px; height: 260px; }

  /* 难度选择器 */
  .difficulty-btn {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 42px;
  }
  .difficulty-picker { gap: 6px; padding: 10px; }

  /* 印章 */
  .stamp { font-size: 16px; padding: 10px 18px; }
  .stamp-small { font-size: 11px; padding: 4px 10px; }

  /* 文字大小 */
  body { font-size: 15px; line-height: 1.7; }
}

/* 响应式 - 小屏手机 */
@media (max-width: 480px) {
  .topbar-logo { font-size: 14px; }
  .game-card { padding: 16px 12px; }
  .game-title { font-size: 18px; }
  .radar-container { width: 220px; height: 220px; }
  .btn { padding: 10px 18px; font-size: 14px; }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .game-stage { padding: 10px; }
  .game-card { padding: 16px; }
}

/* 减少动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 打印 */
@media print {
  .topbar, footer, .btn { display: none !important; }
  body { background: #fff; }
}

/* 成就徽章 */
.achievement-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 12px 0 16px;
}
.ach-tab {
  background: #fafaf7; border: 1px solid #eef0ed;
  color: #555; padding: 6px 14px;
  border-radius: 999px; font-size: 13px;
  cursor: pointer; transition: all .15s;
  font-weight: 500;
  min-height: 36px;
}
.ach-tab:hover { border-color: #2d7d6e; color: #2d7d6e; }
.ach-tab.active {
  background: #2d7d6e; color: #fff;
  border-color: #2d7d6e;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.ach-item {
  background: #f7f9f8;
  border: 2px solid #eef0ed;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  position: relative;
  opacity: 0.45;
  transition: all .3s;
}
.ach-item.unlocked {
  opacity: 1;
  background: #fff;
  border-color: #2d7d6e;
  box-shadow: 0 2px 12px rgba(45,125,110,.15);
}
.ach-icon { font-size: 36px; margin-bottom: 8px; }
.ach-name { font-weight: 600; font-size: 14px; color: #333; margin-bottom: 4px; }
.ach-desc { font-size: 11px; color: #888; line-height: 1.4; min-height: 30px; }
.ach-check {
  position: absolute; top: 8px; right: 8px;
  background: #2d7d6e; color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.ach-lock {
  position: absolute; top: 8px; right: 8px;
  font-size: 14px;
  opacity: 0.4;
}

/* 成就解锁 Toast */
.ach-toast {
  position: fixed; top: 80px; right: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(45,125,110,.25);
  border-left: 4px solid #2d7d6e;
  display: flex; align-items: center; gap: 12px;
  z-index: 1000;
  min-width: 280px; max-width: 360px;
  transform: translateX(120%);
  transition: transform .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ach-toast.show { transform: translateX(0); }
.ach-toast-icon { font-size: 36px; }
.ach-toast-content { flex: 1; }
.ach-toast-title {
  font-size: 11px; color: #2d7d6e; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.ach-toast-name { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.ach-toast-desc { font-size: 12px; color: #888; margin-top: 2px; }

@media (max-width: 768px) {
  .achievement-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }
  .ach-item { padding: 12px 8px; }
  .ach-icon { font-size: 28px; }
  .ach-name { font-size: 12px; }
  .ach-desc { font-size: 10px; min-height: 24px; }
  .ach-toast {
    top: auto; bottom: 20px; right: 10px; left: 10px;
    min-width: auto; max-width: none;
  }
}