/* =========================================================
 * HomeGrove 全局「返回主页」悬浮按钮
 * 由总入口 app.py 的 BackHomeMiddleware 注入到所有页面
 * （首页自身除外）；样式自包含，不依赖各页面的变量。
 * ========================================================= */
.hg-back-home {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 100; /* 高于各页面顶栏/提示，低于各应用弹窗遮罩 */
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 18px 0 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid #f0e8dc;
  color: #d05a33;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(120, 90, 60, 0.18);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.hg-back-home:hover {
  transform: translateY(-2px);
  border-color: #e8734a;
  box-shadow: 0 10px 24px rgba(232, 115, 74, 0.28);
}
.hg-back-home:active { transform: scale(0.96); }
.hg-back-home:focus-visible { outline: 3px solid #e8734a; outline-offset: 2px; }

/* 手机 / 平板：略小、贴安全区，仍在拇指热区 */
@media (max-width: 640px) {
  .hg-back-home {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    height: 44px;
    padding: 0 15px 0 12px;
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hg-back-home { transition: none; }
}
