/* ============================================================
   OneGeo 站点自定义样式
   由 scripts/inject-site-assets.js 注入到每个页面 </head> 前，
   不改主题文件，主题升级不会被覆盖。

   以下三段是从洹拓站（HuanTor_Home/source/css/site.css）搬过来的
   「主题补丁配套样式」，因为本次同步的主题补丁（二级菜单、新闻横向卡
   +真分页、页脚列数自适应）依赖它们，缺了样式这些功能就是裸 HTML。
   洹拓自己的品牌视觉组件（统计条/时间轴/FAQ/组织架构/chips）没有搬过来。

   新增本站样式请往本文件后面加，不要动 themes/ 里的 style.css。
   ============================================================ */

/* ---------- 导航二级菜单（menu.children） ----------
   结构由主题 header.ejs 按 menu.children 渲染：li.menu-has-children > a + ul.sub-menu。
   桌面靠 hover 与键盘 focus 展开；移动端抽屉里直接平铺展开，不玩折叠。 */
.site-nav li { position: relative; }
.menu-has-children > a { display: flex; align-items: center; }
.menu-has-children > a .icon { margin-left: 5px; font-size: .78em; opacity: .75; transition: transform .2s ease; }
.menu-has-children:hover > a .icon,
.menu-has-children:focus-within > a .icon { transform: rotate(180deg); }
/* 选择器一律带 .site-nav 前缀：主题的 `.site-nav ul { gap: 6px }` 是(0,1,1)，
   单写 .sub-menu 只有(0,1,0)，压不住它，子项之间会被撑出 6px 缝 */
.site-nav .sub-menu {
  position: absolute; top: 100%; left: 0; z-index: 120;
  min-width: 158px; padding: 7px; margin-top: 8px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
/* 鼠标从一级项移到面板要穿过这 8px 空隙；用面板自己的伪元素把这段补成热区，
   否则经过空隙时 li 失去 :hover，面板会在半路收起来 */
.site-nav .sub-menu::before {
  content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px;
}
.menu-has-children:hover > .sub-menu,
.menu-has-children:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a {
  padding: 9px 12px; border-radius: 8px; font-size: 14.5px; white-space: nowrap;
}
/* 一级 + 二级菜单：悬浮与"当前项"都不要主题那层圆角底色，只留字色与字重。
   选择器写成 `.site-nav ul a` 才压得住主题的 `.site-nav a:hover` / `.site-nav a.active`。 */
.site-nav ul a:hover, .site-nav ul a.active { background: none; }
.site-nav .sub-menu a:hover { color: var(--primary); }
.site-nav .sub-menu a.active { font-weight: 600; }

/* ---------- 新闻列表（/news/）横向卡 ----------
   主题原版是三列竖卡，一卡只有 260px 宽，标题两行、摘要一行。
   改成一行一条：标题横跨整幅在上 → 配图左下、摘要在右 → 日期/分类/阅读全文
   压在右列最底那一行，与配图底边对齐。
   只命中 .page-content 里带 .ht-news 的页面（news.ejs 出的列表），
   首页 section-news 仍是主题原版的三列卡。 */
.page-content:has(.ht-news) { max-width: var(--container); }
.ht-news { display: flex; flex-direction: column; gap: 14px; }
.ht-news__item {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: border-color .2s ease, box-shadow .2s ease;
}
.ht-news__item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
/* 标题与摘要都写成 .ht-news 前缀：主题的 .page-content h2 / .page-content p
   是"标签+类"选择器（0,1,1），单类压不住，会被它塞进 24px 字号和一条 border-bottom。 */
.ht-news .ht-news__title { margin: 0; padding: 0; border: 0; font-size: 21px; line-height: 1.5; }
.ht-news .ht-news__title a { color: var(--text); }
.ht-news .ht-news__title a:hover { color: var(--primary); }
.ht-news__main { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.ht-news__cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--bg-tint); }
.ht-news__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.ht-news__item:hover .ht-news__cover img { transform: scale(1.05); }
.ht-news__ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--muted); background: linear-gradient(135deg, var(--primary-soft), var(--bg-tint));
}
.ht-news__text { display: flex; flex-direction: column; min-width: 0; }
.ht-news .ht-news__desc {
  margin: 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.85;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.ht-news__foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.ht-news__meta { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.ht-news__more { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--primary); }
.ht-news__more .icon { transition: transform .2s ease; }
.ht-news__more:hover .icon { transform: translateX(4px); }
/* 分页沿用主题的 .pagination / .pagination__item，这里只补两处主题没有的：
   页码之间的省略号占位，和下面那行"第 N / M 页"的说明 */
.ht-news__gap { font-size: 14px; color: var(--muted); margin: 0 -4px; }
.page-content .ht-news__pager-info { text-align: center; margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 页脚列数自适应 ----------
   主题把 .footer-main 写死成四列，站点配置里加减列数时会掉行。
   改成 flex 换行：品牌两倍权重、链接列一份、联系方式一份半，窄屏自己折。 */
.footer-main { display: flex; flex-wrap: wrap; gap: 36px 32px; }
.footer-main > .footer-brand { flex: 2 1 260px; }
.footer-main > .footer-col { flex: 1 1 130px; }
.footer-main > .footer-col:has(.footer-contact) { flex: 1.8 1 210px; }

/* ---------- 响应式 ---------- */
/* 窄屏放不下"图左 + 文右"两列，退回竖排：整幅配图在上、摘要与元信息在下 */
@media (max-width: 860px) {
  .ht-news__item { padding: 16px; }
  .ht-news__main { grid-template-columns: 1fr; gap: 14px; }
  .ht-news .ht-news__title { font-size: 18px; }
  .ht-news .ht-news__desc { -webkit-line-clamp: 4; }

  /* 移动端抽屉菜单：二级项直接平铺展开（抽屉里没有 hover），条目变多后允许滚动。
     主题的抽屉断点也是 860px，这里跟它对齐。 */
  .site-nav.is-open { max-height: 82vh; overflow-y: auto; }
  .site-nav .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; margin: 0; padding: 0 0 8px 12px;
    background: transparent; border: none; border-radius: 0; box-shadow: none; transition: none;
  }
  .site-nav .sub-menu::before { display: none; }
  .site-nav .sub-menu a { padding: 10px 12px; font-size: 15px; border-radius: 0 8px 8px 0; border-left: 2px solid var(--border); }
  .site-nav .sub-menu a.active { border-left-color: var(--primary); }
  .menu-has-children > a .icon { display: none; }
}
@media (max-width: 720px) {
  .footer-main > .footer-brand, .footer-main > .footer-col { flex: 1 1 100%; }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ht-news__cover img, .ht-news__more .icon,
  .menu-has-children > a .icon { transition: none !important; }
}
