/* ==========================================================================
   nonohome.cloud 主站 —— 一站一页的「门户」样式
   --------------------------------------------------------------------------
   设计取向（2026-10 二期，用户选定）：苹果的排版与留白 + 小米的暖色。
     · 排版：大字号、宽字距的 eyebrow、克制的分隔线、大量呼吸空间
     · 颜色：暖白底 + 焦糖橙主色，深色顶栏压住整个页面
     · 结构：顶栏（一级菜单 + mega menu 下拉）/ Hero / 分组卡片 / 关于 / 页脚
     · 适配：手机与电脑**分别排版**（不是把电脑版等比缩小）
         - 手机 < 720px：汉堡菜单 + 抽屉；Hero 单列；卡片单列
         - 中屏 720–1023px：无 mega menu（空间不够），改两列卡片
         - 电脑 ≥ 1024px：横向菜单 + 悬停下拉面板；Hero 左对齐；卡片三列

   零依赖：不引字体、不引框架、不引图标库（图标用 emoji 与内联 SVG）。
   ========================================================================== */

/* ==========================================================================
   滚动进场动画（苹果官网那种：进入视口时从下往上淡入，同组元素逐个错峰）
   --------------------------------------------------------------------------
   ## 怎么做的
   1. 元素平时是 opacity:0 + translateY(28px)，进入视口后由 JS 加 `.is-in`
      触发过渡到正常位置；同一个容器里的兄弟元素按 `--i` 错峰 85ms。
   2. 一旦进场就**不再撤掉**（苹果也是这个行为：回头滚上去不会重新播放，
      否则页面会像抽搐）。
   3. 🔴 **必须有 JS 才隐藏**：`.reveal` 的初始隐藏态挂在 `html.js` 下，
      这样禁用 JS / 脚本报错时内容是正常显示的 —— 不能为了动画牺牲可读性。
   4. `prefers-reduced-motion: reduce` 时全部直接显示（文件末尾已有全局兜底，
      这里再显式写一遍，因为动画是"内容不可见"级别的，不能只靠兜底）。
   5. 过渡在 `.is-in` 上而不是 `.reveal` 上：元素被揭示后就不再持有过渡属性，
      滚动时不会因为样式重算而抖动。
   ========================================================================== */
html.js .reveal {
  opacity: 0;
  /**
   * 🔴 未揭示的块**不接受一切指针事件**：页面初始化那几百毫秒里，
   *    用户手指/鼠标落在它上面就会发生"卡片能上下拖动""猛地左滑卡片消失"。
   *    这类 bug 只在"打开页面立刻操作"时出现，正是用户报的现象。
   */
  pointer-events: none;
}
html.js .reveal.is-in {
  opacity: 1;
  pointer-events: auto;
}

/* 卡片"从下往上浮出"的位移由 JS 用 Web Animations API 播放（见 portal.js 的 initReveal）。
   这里不再写 CSS 动画：那条路试过一次，选择器层级稍有出入就静默不生效，
   而 WAAPI 可以直接用 getAnimations() 断言"动画真的在跑"。 */
/* 大块区域（整个分组）用同样的曲线，但位移动得多一点，像苹果那样"抬起来" */
html.js .reveal-block { opacity: 0; pointer-events: none; }
html.js .reveal-block.is-in {
  opacity: 1;
  pointer-events: auto;
  transition: opacity .7s cubic-bezier(.28, .11, .32, 1);
}


/* 用户要求减少动效：全部立即可见，不做任何位移 */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal,
  html.js .reveal-block {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    pointer-events: auto !important;
  }

}

/* ---------------------------------------------------------------- 设计令牌 */
:root {
  /* 颜色 */
  --ink:        #221b16;
  --ink-2:      #4a4038;
  --ink-3:      #7d7269;
  --bg:         #fffaf4;
  --bg-2:       #f6ede2;
  --surface:    #ffffff;
  --line:       rgba(34, 27, 22, .09);
  --line-2:     rgba(34, 27, 22, .16);
  --primary:    #f4711f;
  --primary-2:  #e2621a;
  --primary-ink:#c0500f;
  --accent:     #f7b731;
  --tint:       rgba(244, 113, 31, .10);
  --dark:       #1c1613;
  --dark-2:     #2a211c;

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* 阴影（两层：贴地的一层 + 扩散的一层，比单层大模糊更"实"） */
  --sh-1: 0 1px 2px rgba(34, 27, 22, .05), 0 2px 8px rgba(34, 27, 22, .04);
  --sh-2: 0 2px 6px rgba(34, 27, 22, .07), 0 12px 28px rgba(34, 27, 22, .09);
  --sh-3: 0 6px 16px rgba(34, 27, 22, .10), 0 24px 56px rgba(34, 27, 22, .14);

  /* 节奏 */
  --pad-x: 20px;
  --topbar-h: 60px;
  --maxw: 1180px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC",
          "HarmonyOS Sans SC", "MiSans", "Segoe UI", "Microsoft YaHei", "Noto Sans SC",
          system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------- [hidden]
 * 🔴 这一条不是装饰，是修 bug 的（2026-10-11 用无头浏览器看出来的）：
 *    `hidden` 属性只在浏览器默认样式表里是 `display: none`，
 *    任何作者样式里的 `display` 都会盖掉它 —— 而下面 `.guest-actions`
 *    `.user-actions` 为了排按钮写了 `display: inline-flex`。
 *    结果：**没登录时"我的账号"下拉框照样显示**（顶栏多出一行「我」），
 *    手机抽屉里也凭空多出一块登录后才会有的账户区。
 *    截图之前所有自动检查都是绿的 —— 它们只查"该出现的出现了"，
 *    不查"不该出现的没出现"。所以这里给 [hidden] 一个兜底。
 */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body.shell {
  margin: 0;
  min-height: 100dvh;
  /* 关掉滚动锚定：内容分块长出来时浏览器会"锚"住可视元素并挪滚动位置，
     在首页表现为刷新后位置跳动（见 portal.js 里 scrollRestoration 的说明） */
  overflow-anchor: none;
  /* 下拉到底/顶时不要触发浏览器自己的回弹与下拉刷新，免得像"卡片被拽了一下" */
  overscroll-behavior-y: contain;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; }
a { color: inherit; }
code {
  font-family: var(--mono);
  font-size: .86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(34, 27, 22, .06);
  word-break: break-word;
}

/* 键盘可达性：只给键盘焦点画圈，鼠标点击不画 */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: fixed;
  top: -100px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------ 通用排版件 */
.eyebrow {
  margin: 0 0 10px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary-ink);
}
.shell-section__title {
  margin: 0;
  font-size: clamp(1.4rem, 4.4vw, 2.1rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 700;
}

/* -------------------------------------------------------------- 按钮 */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--btn-h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn--sm { --btn-h: 34px; padding: 0 15px; font-size: .86rem; }
.btn--lg { --btn-h: 50px; padding: 0 30px; font-size: 1rem; }
.btn--block { width: 100%; }

.btn--solid {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(226, 98, 26, .32);
}
.btn--ghost {
  background: rgba(255, 255, 255, .72);
  border-color: var(--line-2);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn--solid:hover { box-shadow: 0 5px 18px rgba(226, 98, 26, .42); }
.btn--ghost:hover { background: #fff; border-color: var(--line-2); box-shadow: var(--sh-1); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ==========================================================================
   顶栏 + 一级菜单（电脑端 mega menu / 手机端汉堡）
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(28, 22, 19, .92);
  color: #fff;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.topbar.is-stuck {
  background: rgba(24, 19, 16, .86);
  box-shadow: 0 8px 24px rgba(28, 22, 19, .22);
}
.topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 品牌：乐高风的 NONO 积木标 + 全大写橙色字 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand__logo { height: 26px; width: auto; display: block; }
.brand__word {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  white-space: nowrap;
}
/* 页脚的标：小一号、跟页脚文字同色 */
.footer__logo { height: 22px; width: auto; display: block; }

/* 一级菜单（电脑端） */
.shell-nav { display: none; flex: 1 1 auto; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/**
 * 每个一级菜单一个 `<li>`，**自己带面板**。
 * 之前所有 item 共用一个整幅面板，于是"从一个菜单移到另一个"时
 * 面板会有交叉淡入淡出的重叠帧 → 看起来一闪一闪（用户报的 bug）。
 * 现在每 item 一个面板：移动 = 关旧的、开新的，没有重叠。
 */
.nav-item { position: relative; }

/* 链接 + 小箭头合并成一个胶囊：悬停/聚焦时**只有一块**背景 */
.nav-pill {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding-right: 4px;
  border-radius: var(--r-full);
  transition: background-color .18s ease;
}
.nav-item.is-open > .nav-pill,
.nav-item:hover > .nav-pill,
.nav-item:focus-within > .nav-pill { background: rgba(255, 255, 255, .12); }
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 6px 0 14px;
  font-size: .94rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: color .18s ease;
}
.nav-item.is-open > .nav-link,
.nav-item:hover > .nav-link,
.nav-item:focus-within > .nav-link { color: #fff; }
.nav-link__caret { width: 9px; height: 6px; opacity: .65; }

/**
 * 一级菜单旁边的"展开二级菜单"按钮。
 * 一级菜单本身是链接（点击进二级页），所以开合面板另给一个明确的小按钮：
 * 键盘 Tab 得到、触屏点得到 —— 不再依赖鼠标悬停。
 */
.nav-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: none;
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
  transition: color .18s ease;
}
.nav-item:hover .nav-caret,
.nav-item.is-open .nav-caret,
.nav-item:focus-within .nav-caret { color: #fff; }
.nav-caret svg { width: 9px; height: 6px; }

/* mega menu 面板：挂在顶栏下方整幅铺开（苹果/小米那套） */
.topbar {
  /**
   * 顶栏到底再往下延伸 `--topbar-menu-gap`，把"顶栏底边 → 面板顶边"那段空隙
   * 也算进顶栏的命中区域。
   *
   * 为什么需要：面板是 `position: fixed; top: var(--topbar-h)`，
   * 而顶栏里的按钮底边只到 51px、面板顶边在 64px —— 中间 13px 属于两者之外，
   * 鼠标穿过去时会先触发顶栏的 mouseleave 把面板关掉（实测："在 y=52 处菜单被关掉了"）。
   * 让顶栏多覆盖这一段，鼠标就一直在"悬挂区"里。
   */
  --topbar-menu-gap: 14px;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--topbar-menu-gap);
}

.mega {
  /**
   * 🔴 用 `position: fixed` 贴住**视口**，而不是相对那个只有 78px 宽的 `<li>`。
   *
   * 之前写 `position: absolute; left: 50%; transform: translateX(-50%)` 时，
   * 偏移父元素是 `<li>`（有 position:relative），于是 `left: 50%` = 39px、
   * `translateX(-50%)` 减掉的是**整幅面板宽的一半** → 面板被推到视口外
   * （实测：left = -147、right = 1033，视口 1425 —— 两边都没到）。
   *
   * 现在：`left: 0; right: 0; top: var(--topbar-h)` —— 左右顶到视口两端、
   * 顶边正好在顶栏下沿（顶栏是 sticky 且高度固定，所以这个值就是它的底边）。
   */
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  width: auto;
  z-index: 55;
  /**
   * 浮出动画改成 **clip-path 由上往下展开**（原来是从上方 -14px 位移下来）。
   * 位移那版会让面板顶边在动画期间跑到顶栏底边**上面**（实测差 14px），
   * 也就是用户截图里"浮出时盖住黑色区域"的那个瞬间。
   * clip-path 只裁自己，顶边永远钉在顶栏下沿，观感一样是"从上沿展开"。
   */
  clip-path: inset(0 0 100% 0);
  transform: none;
  padding: 0 var(--pad-x) 26px;
  background: rgba(255, 253, 250, .97);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-3);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  /* 关：瞬间消失（避免两个面板同时可见 → 闪） */
  transition: none;
}

.nav-item.is-open > .mega {
  opacity: 1;
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition:
    opacity .2s ease,
    clip-path .28s cubic-bezier(.28, .11, .32, 1);
}

.mega__inner { max-width: var(--maxw); margin: 0 auto; }
/* ⌨️ 键盘用户：面板里按 Esc 关（JS 处理），这里只保证焦点样式不被裁掉 */
.mega .mega__item:focus-visible { outline-offset: -2px; }
.mega__head {
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.mega__title { margin: 0; font-size: .95rem; font-weight: 700; }
.mega__desc { margin: 2px 0 0; font-size: .82rem; color: var(--ink-3); }
.mega__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mega__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background-color .16s ease, transform .16s ease;
}
.mega__item:hover { background: var(--bg-2); transform: translateX(2px); }
.mega__item[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.mega__icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  border-radius: 11px;
  background: linear-gradient(150deg, #fff2e2, #ffe3c9);
  border: 1px solid rgba(226, 98, 26, .12);
}
.mega__text { min-width: 0; }
.mega__name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .95rem;
  font-weight: 650;
  line-height: 1.35;
}
.mega__desc-line { display: block; font-size: .82rem; color: var(--ink-3); line-height: 1.5; }

/* 徽标 */
.badge {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--tint);
  color: var(--primary-ink);
  border: 1px solid rgba(226, 98, 26, .16);
}
.badge--soon { background: rgba(34, 27, 22, .06); color: var(--ink-3); border-color: var(--line); }

/* 顶栏右侧动作区 */
.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.guest-actions { display: none; align-items: center; gap: 8px; }
.topbar .btn--ghost { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .22); color: #fff; }
.topbar .btn--ghost:hover { background: rgba(255, 255, 255, .18); }

/* 账号头像 + 下拉 */
.user-actions { position: relative; display: none; }
.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 4px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .18s ease;
}
.avatar-btn:hover { background: rgba(255, 255, 255, .18); }
.avatar-btn__name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-btn__caret { opacity: .7; transition: transform .2s ease; }
.avatar-btn[aria-expanded="true"] .avatar-btn__caret { transform: rotate(180deg); }

.avatar {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--primary), var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.avatar--lg { width: 38px; height: 38px; font-size: 1rem; }

.account-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 70;
  width: 250px;
  padding: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  color: var(--ink);
  animation: menu-in .18s ease;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.account-menu__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.account-menu__id { min-width: 0; }
.account-menu__id strong { display: block; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__id small { color: var(--ink-3); font-size: .76rem; }
.account-menu__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: inherit;
  font: inherit;
  font-size: .9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu__item:hover { background: var(--bg-2); }
.account-menu__item--danger { color: #c0392b; }

/* 汉堡按钮（手机） */
.menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .10);
  cursor: pointer;
}
.menu-btn__bar {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform .24s ease, opacity .18s ease;
}
.menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   手机端抽屉
   ========================================================================== */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 22, 19, .45);
  backdrop-filter: blur(3px);
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 90;
  width: min(88vw, 380px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: var(--sh-3);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: drawer-in .28s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes drawer-in { from { transform: translateX(100%); } }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.drawer__close {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.drawer__auth { display: grid; gap: 9px; padding: 16px 18px; }
.drawer__auth[hidden] { display: none; }
.drawer__me {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
}
.drawer__me-text strong { display: block; font-size: .95rem; }
.drawer__me-text small { color: var(--ink-3); font-size: .78rem; }

.drawer__nav { padding: 6px 10px 16px; }
.dgroup { border-bottom: 1px solid var(--line); }
.dgroup:last-child { border-bottom: 0; }
.dgroup__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 10px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.dgroup__caret { color: var(--ink-3); transition: transform .22s ease; }
.dgroup.is-open .dgroup__caret { transform: rotate(180deg); }
.dgroup__panel { display: none; padding: 0 0 10px; }
.dgroup.is-open .dgroup__panel { display: block; }
.dlink {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background-color .16s ease;
}
.dlink:active, .dlink:hover { background: var(--bg-2); }
.dlink[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.dlink__emoji {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border-radius: 10px;
  background: linear-gradient(150deg, #fff2e2, #ffe3c9);
}
.dlink__text { min-width: 0; }
.dlink__name { display: flex; align-items: center; gap: 7px; font-size: .95rem; font-weight: 620; }
.dlink__desc { display: block; font-size: .78rem; color: var(--ink-3); line-height: 1.45; }
.dlink--home { color: var(--ink-2); font-weight: 600; }

.drawer__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: .84rem;
  color: var(--ink-3);
}
.drawer__foot a { color: var(--ink-2); text-decoration: none; }
.drawer__foot a:hover { color: var(--primary-ink); }

/* ==========================================================================
   首屏 Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  max-width: 100vw;
  padding: clamp(46px, 9vw, 104px) var(--pad-x) clamp(40px, 7vw, 84px);
  background:
    radial-gradient(120% 90% at 50% -10%, #fff6ea 0%, rgba(255, 246, 234, 0) 62%),
    linear-gradient(180deg, #fffaf4 0%, #fdf4ea 100%);
  border-bottom: 1px solid var(--line);
}
.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.hero__glow--a {
  width: 46vw; height: 46vw; max-width: 520px; max-height: 520px;
  top: -18%; right: -8%;
  background: radial-gradient(circle, rgba(247, 183, 49, .42), rgba(247, 183, 49, 0) 70%);
}
.hero__glow--b {
  width: 40vw; height: 40vw; max-width: 460px; max-height: 460px;
  bottom: -22%; left: -10%;
  background: radial-gradient(circle, rgba(244, 113, 31, .30), rgba(244, 113, 31, 0) 70%);
}
/* 极淡的网格：给大留白一点"质感"，不抢内容 */
.hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 27, 22, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 27, 22, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: var(--maxw); margin: 0 auto; text-align: center; }
/* 二级页的头部：与首页 hero 同一套视觉，只是矮一点 */
.hero--compact { padding: clamp(30px, 5vw, 46px) var(--pad-x) clamp(22px, 3.4vw, 34px); }
.hero--compact .hero__title { font-size: clamp(1.7rem, 5.5vw, 2.6rem); }

.hero__title {
  margin: 0;
  font-size: clamp(1.9rem, 6.4vw, 3.6rem);
  line-height: 1.16;
  letter-spacing: -.035em;
  font-weight: 800;
  background: linear-gradient(96deg, #2a211c 0%, #6b4a2c 58%, var(--primary-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  max-width: 40em;
  margin: 18px auto 0;
  font-size: clamp(.98rem, 2.4vw, 1.14rem);
  line-height: 1.75;
  color: var(--ink-2);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}
/**
 * 标题里的换行控制：**手机和电脑都要在逗号后断行**。
 * 用户 2026-10-11 两次反馈：先是要手机端断行，然后电脑端又断了 → 结论是两边都断。
 * 所以这里不再写 display 开关（第一版写反过、第二版只改了一半），
 * 直接让 <br> 永远生效 —— 少一个会写错的开关。
 */


/* ---------------------------------------------------------------- 图标
   有些图标是从小游戏站抠过来的**内联 SVG**（见 src/portal/icons.mjs），
   尺寸按小游戏站那边来（38px），两处看到的大小才一致；菜单与抽屉里小一号。 */
.icon-svg { display: block; width: 38px; height: 38px; }
.mega__icon .icon-svg,
.dlink__emoji .icon-svg { width: 30px; height: 30px; }

/* ---------------------------------------------------------------- 一级菜单大卡
   每个一级菜单一张：深色渐变 + 按分类换色调（--cat-hue）。
   刻意与下面的白色站点卡不同风格 —— 用户明确要"和下面不一样、别太单调"。 */
.site-groups--lead { margin-bottom: clamp(34px, 5vw, 52px); }
/* 一级菜单那一行标题：比普通分组标题大一点、下面留白多一点 */
.group__head--lead .group__title { font-size: 1.3rem; }
.group__head--lead { margin-bottom: 20px; }

.cat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px 22px;
  border-radius: var(--r-xl);
  text-decoration: none;
  color: #fff;
  background:
    radial-gradient(130% 110% at 88% -10%,
      hsl(var(--cat-hue, 26) 88% 58% / .52) 0%,
      hsl(var(--cat-hue, 26) 80% 46% / .16) 46%,
      rgba(255, 255, 255, 0) 72%),
    linear-gradient(152deg, #241c17 0%, #3b2a1d 54%, #56341f 100%);
  box-shadow: var(--sh-2);
  transition: transform .26s cubic-bezier(.28, .11, .32, 1), box-shadow .3s ease;
}
.cat-card::after {
  content: "";
  position: absolute;
  width: 240px; height: 240px;
  right: -72px; bottom: -104px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--cat-hue, 26) 90% 62% / .34), rgba(0, 0, 0, 0) 68%);
  pointer-events: none;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.cat-card__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 17px;
  font-size: 1.8rem;
  line-height: 1;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.cat-card__name {
  position: relative;
  font-size: clamp(1.35rem, 4.6vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.cat-card__desc {
  position: relative;
  color: rgba(255, 255, 255, .74);
  font-size: .92rem;
  line-height: 1.6;
}
.cat-card__go {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: .86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .8);
}
.cat-card__arrow {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .14);
  font-size: .95rem;
  transition: transform .26s cubic-bezier(.28, .11, .32, 1), background-color .2s ease;
}
.cat-card:hover .cat-card__arrow { transform: translateX(4px); background: rgba(255, 255, 255, .24); }
.cat-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ==========================================================================
   区块容器（首页与二级页共用）
   ========================================================================== */
.shell-section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(46px, 8vw, 82px) var(--pad-x);
}
.shell-section--tight { padding-top: clamp(30px, 5vw, 48px); }
.shell-section__head { text-align: center; margin-bottom: 30px; }
.shell-section__desc { margin: 10px auto 0; max-width: 34em; color: var(--ink-3); font-size: .95rem; }


/* 分组（学习 / 小游戏 / 旅游计划）
   🔴 必须写 grid-template-columns: minmax(0, 1fr) 并给子项 min-width:0：
      `display:grid` 不写列定义时，隐式列是 auto —— 会**按内容撑开**。
      而卡片轨道的内容（flex 横排、不换行）天生比屏幕宽，
      于是整页被撑出横向滚动条（真踩过：4 种视口全部溢出，文档宽 1263 而视口只有 390）。
      `minmax(0, 1fr)` 让列宽受容器约束，轨道才能在自己的盒子里滚动。 */
.site-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(30px, 5vw, 46px);
}
.site-groups > * { min-width: 0; }
/* 🔴 递归都要 min-width:0：grid 项（.group）设了还不够 ——
   .rail-mask / .card-rail 是它的后代，它们自己不收缩的话，
   整个 grid 列照样被内容撑宽（真踩过：/study/ 手机端文档宽 598 > 视口 390）。 */
.site-groups .rail-mask,
.site-groups .card-rail,
.site-groups .group__head,
.shell-section .rail-mask,
.shell-section .card-rail { min-width: 0; max-width: 100%; }
.group__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.group__head .rail-nav { margin-left: auto; }
/* 两侧箭头：只在电脑端出现（手机上是原生滑动，不需要） */
.rail-nav { display: none; gap: 6px; margin-left: auto; }
.rail-btn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, opacity .16s ease;
}
.rail-btn:hover { background: var(--bg-2); color: var(--ink); border-color: var(--line-2); }
.rail-btn:disabled { opacity: .35; cursor: default; }
.rail-btn:disabled:hover { background: var(--surface); color: var(--ink-2); }
.group__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
/* 卡片区标题 + 一句话简介整体是链接：点它进该分类的二级页 */
.group__link {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-sm);
}
.group__link:hover .group__title { color: var(--primary-ink); }
.group__link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.group__title::before {
  content: "";
  width: 4px; height: 17px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.group__desc { color: var(--ink-3); font-size: .85rem; }
.group__count { margin-left: auto; color: var(--ink-3); font-size: .78rem; }

/* 横向滚动轨道：手机上是原生滑动，电脑上靠两侧箭头。
   苹果官网那种"露出下一张一角"的观感就来自这里的卡片宽度 < 轨道宽度。 */
.card-rail {
  display: flex;
  min-width: 0;
  max-width: 100%;
  /**
   * ⚠️ 这里**不要**写 `touch-action: pan-y`。
   * 我上一轮为了修"上滑时卡片被拖动"加过它，结果 `pan-y` 的语义是
   * "只允许纵向平移" —— 横向滑动**也被禁掉了**，轨道直接滑不动
   * （用户第二天就报回来："这个 bug 不仅没修好，而且横向没法滑动了"）。
   * 嵌套滚动容器（横向轨道套在纵向页面里）本来就是浏览器自己处理得很好的场景，
   * 保持默认 `auto` 即可。真正要防的"往下拽触发回弹/下拉刷新"由
   * body 的 `overscroll-behavior-y: contain` 负责。 */
  gap: 14px;
  margin: 0;
  /* 左右各留一点内边距，滚动时卡片不会贴着屏幕边缘 */
  padding: 4px 0 10px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.card-rail::-webkit-scrollbar { display: none; }
.card-rail {
  align-items: flex-start; /* 不让 flex 把卡片拉成同高，高度交给 aspect-ratio */
}
.card-rail > li {
  flex: 0 0 auto;
  width: min(74vw, 262px);
  scroll-snap-align: start;
}
/* 到两端时给个很淡的渐隐，暗示"边上还有东西" */
.rail-mask {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

/**
 * 卡片框：**统一的 3:4 竖版**。
 *
 * 🔴 为什么用 `aspect-ratio` 而不是写死高度：
 *    卡片的文字多少不一（简介有一行的也有三行的），写死高度早晚会有一张溢出或留一大块空白。
 *    `aspect-ratio` 让"比例"和"内容多少"解耦 —— 不管里面几行字，卡片永远是 3:4。
 *    用户 2026-10-11 的要求：现在的横版 4:3 在手机上看比例不协调，要竖版 3:4。
 */
.card-frame {
  aspect-ratio: 3 / 4;
  height: auto;
  min-height: 0;
}
.rail-mask::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 10px;
  width: 34px;
  pointer-events: none;
  /* 只在"右边确实还有卡片"时出现（JS 按 scrollLeft/scrollWidth 算），
     而且做得很淡：露一角已经能说明问题，重渐变会把最后一张卡洗白。 */
  opacity: 0;
  transition: opacity .2s ease;
  background: linear-gradient(90deg, rgba(255, 250, 244, 0), rgba(255, 250, 244, .92));
}
.rail-mask:not(.is-at-end)::after { opacity: 1; }

/* 站点卡：图标磁贴 + 标题 + 一句话 + 箭头 */
.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .26s ease, border-color .2s ease;
}
.site-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity .22s ease;
}
.site-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.site-card:hover::before { opacity: 1; }
.site-card[aria-disabled="true"] { opacity: .72; pointer-events: none; }
.site-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.site-card__icon {
  width: 58px; height: 58px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  border-radius: 16px;
  background: linear-gradient(150deg, #fff2e2, #ffe1c4);
  border: 1px solid rgba(226, 98, 26, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.site-card__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.site-card__desc { margin: 0; color: var(--ink-3); font-size: .94rem; line-height: 1.68; flex: 1 1 auto; }
.site-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--ink-3);
}
.site-card__path { font-family: var(--mono); font-size: .74rem; color: var(--primary-ink); word-break: break-all; }
.site-card__arrow { font-size: 1rem; color: var(--primary); transition: transform .22s ease; }
.site-card:hover .site-card__arrow { transform: translateX(4px); }

/* 键盘焦点：整卡描边（不用默认 outline，免得被圆角裁掉） */
.site-card:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint), var(--sh-2); }
.feature:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 「更多站点」兜底区：在册但没写进菜单的站点 */
.loose {
  margin-top: clamp(30px, 5vw, 46px);
  padding: 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .55);
}
.loose__head { margin: 0 0 14px; font-size: .95rem; font-weight: 700; color: var(--ink-2); }
.loose__note { margin: 0 0 16px; font-size: .82rem; color: var(--ink-3); }
.loose .site-card { background: var(--bg); }

/* ==========================================================================
   关于
   ========================================================================== */
.about {
  display: grid;
  gap: 26px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #fff4e6 0%, #fdece0 100%);
  border: 1px solid rgba(226, 98, 26, .14);
}
.about__text p { margin: 12px 0 0; color: var(--ink-2); line-height: 1.78; font-size: .95rem; }
.about__meta { color: var(--ink-3) !important; font-size: .84rem !important; }
.about__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; align-content: start; }
.about__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(226, 98, 26, .10);
  font-size: .88rem;
  color: var(--ink-2);
}
.about__list span { flex: 0 0 auto; }

/* ==========================================================================
   页脚
   ========================================================================== */
/**
 * 手机：改成**竖向 flex 单列**并全部居中。
 * 不用 grid 塌缩：`1fr` 列在窄屏上仍可能被内容的 min-content 挤到很窄
 * （真踩过：导航链接被压成 14px 宽，变成一字一行），flex 单列没有这个问题。
 */
.footer {
  margin-top: clamp(30px, 6vw, 60px);
  background: var(--dark);
  color: rgba(255, 255, 255, .72);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px var(--pad-x) calc(34px + env(safe-area-inset-bottom));
  /* 三列：品牌 | 导航（居中） | 版权（靠右）；备案信息作为第四项占满整行 */
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px 22px;
  font-size: .85rem;
}
.footer__brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.footer__nav a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.footer__nav a:hover { color: var(--accent); }
.footer__copy { margin: 0; color: rgba(255, 255, 255, .5); font-size: .8rem; text-align: right; }

/**
 * 备案信息（京ICP备2026067016号-1）
 * 用户要求：页面底部**居中**、手机与电脑都要点得到、不能遮挡或溢出。
 *   · `grid-column: 1 / -1` 独占一整行（不会被品牌/版权挤到边上）
 *   · `justify-self: center` + `text-align: center` 居中
 *   · 链接 inline-block + padding：手机上也点得到
 *   · `word-break: break-word`：极窄屏也不会把页面撑宽
 */
.footer__legal {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  text-align: center;
  font-size: .78rem;
  line-height: 1.6;
}
.footer__legal a {
  display: inline-block;
  padding: 4px 2px;
  color: rgba(255, 255, 255, .62);
  text-decoration: none;
  word-break: break-word;
}
.footer__legal a:hover { color: var(--accent); text-decoration: underline; }


@media (max-width: 719px) {
  .footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer__nav { justify-content: center; }
  .footer__copy { text-align: center; }
}

/* ==========================================================================
   吐司提示
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 120;
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 12px 20px;
  border-radius: var(--r-full);
  background: rgba(28, 22, 19, .94);
  color: #fff;
  font-size: .88rem;
  box-shadow: var(--sh-3);
  animation: toast-in .24s cubic-bezier(.32, .72, 0, 1);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ==========================================================================
   断点：720px（平板竖屏）/ 1024px（电脑）
   ========================================================================== */
@media (min-width: 720px) {
  :root { --pad-x: 32px; }

  .card-rail { gap: 18px; }
  .card-rail > li { width: min(44vw, 280px); }
  .cat-card { padding: 26px 24px; }
  .about { grid-template-columns: 1.35fr 1fr; padding: 36px; }
  .footer__inner { padding-top: 42px; padding-bottom: 42px; }
}

@media (min-width: 1024px) {
  :root { --pad-x: 40px; --topbar-h: 64px; }
  /* 电脑端：横向菜单 + mega menu，汉堡与抽屉整体退场 */
  .shell-nav { display: block; margin-left: 14px; }
  .menu-btn, .drawer, .scrim { display: none !important; }
  .guest-actions, .user-actions { display: inline-flex; }
  .rail-nav { display: flex; }
  /**
   * 电脑端卡片宽度**必须让内容装不下**，否则轨道滚不动、就没有左右滑动的效果。
   * 容器 1100px：3 张 380 + 2 个 18 间隔 = 1176 > 1100 → 有 76px 可滑，
   * 第 4 张露一角、箭头可用。
   * （前两版分别写 280/340：3 张 + 间隔都没超过 1100，测出来
   *   `scrollWidth == clientWidth`、箭头全灰 —— 用户要的"左右滑动"等于没做。
   *   宽度是按"必须装不下"倒推的，不是拍脑袋定的。）
   */
  .card-rail > li { width: 380px; }
  .hero__inner { text-align: left; }
  .hero__sub { margin-left: 0; }
  .hero__cta { justify-content: flex-start; }
  .shell-section__head { text-align: left; margin-bottom: 34px; }
  .shell-section__desc { margin-left: 0; }
  .hero { padding-top: 92px; padding-bottom: 76px; }
  .hero__title { font-size: clamp(2.6rem, 4vw, 3.9rem); }
  .mega__list { grid-template-columns: repeat(var(--mega-cols, 4), minmax(0, 1fr)); }
}

/* 大屏：Hero 略微收紧，避免标题被拉得太散 */
@media (min-width: 1440px) {
  .hero__title { font-size: 4rem; }
}

/* ==========================================================================
   偏好与降级
   ========================================================================== */

/* 用户要求减少动效：全部关掉（含抽屉/下拉的位移动画） */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* 不支持 backdrop-filter 的老浏览器：顶栏改不透明，否则文字会糊在内容上 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: #1c1613; }
  .mega { background: #fffdfa; }
  .scrim { background: rgba(28, 22, 19, .6); }
}

/* 打印：去掉装饰，只留链接文本 */
@media print {
  .topbar, .drawer, .scrim, .toast, .hero__glow, .hero__grid-bg, .footer { display: none !important; }
  body.shell { background: #fff; }
  .site-card, .feature { box-shadow: none; border: 1px solid #ccc; }
}

/* ================================================================== *
 * 小朋友专区（2026-10-26）
 * 参考儿童 App 的通用做法：大色块、大圆角、大字号、厚阴影、单一动作。
 * 只在首页出现；二级页靠 .page-category 隐藏。
 * ================================================================== */
.kidzone {
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 0 20px;
}

.kidzone__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.kidzone__badge { font-size: 22px; line-height: 1; }

.kidzone__title {
  margin: 0;
  font-size: 22px;
  letter-spacing: .02em;
}

.kidzone__desc {
  margin: 0;
  font-size: 13.5px;
  opacity: .72;
}

.kidzone__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.kid-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .12), 0 14px 26px rgba(60, 40, 10, .16);
  transition: transform .16s ease, box-shadow .16s ease;
  min-height: 148px;
}
.kid-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 rgba(0, 0, 0, .12), 0 18px 30px rgba(60, 40, 10, .2); }
.kid-card:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }

.kid-card__face {
  font-size: 40px;
  line-height: 1;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  opacity: .95;
}
.kid-card__title { font-size: 21px; font-weight: 800; letter-spacing: .02em; }
.kid-card__sub { font-size: 13px; opacity: .9; }
.kid-card__go {
  margin-top: auto;
  align-self: start;
  font-size: 13.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, .26);
  border-radius: 999px;
  padding: 5px 12px;
}

.kid-card--pinyin { background: linear-gradient(140deg, #63c08a, #2f7d5b); }
.kid-card--poem { background: linear-gradient(140deg, #f2b455, #d98616); }
.kid-card--game { background: linear-gradient(140deg, #8f7ce6, #6a4fd0); }

.page-category .kidzone { display: none; }

@media (max-width: 860px) {
  .kidzone__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kid-card--game { grid-column: 1 / -1; min-height: 120px; }
}

@media (max-width: 560px) {
  .kidzone { padding: 0 14px; }
  .kidzone__grid { gap: 10px; }
  .kid-card { padding: 14px; border-radius: 18px; min-height: 128px; }
  .kid-card__face { font-size: 32px; }
  .kid-card__title { font-size: 18px; }
  .kid-card__sub { font-size: 12px; }
}
