/* ============================================================
   DH111 导航 · 新首页布局样式
   颜色全部取自全站主题变量（themes.css）：后台「首页风格」/ 自动换肤一变，
   新首页的配色、节日窗花祥云、四季风物会同步变化；布局仍由本文件独占，
   不改动 base.css / themes.css，原站（办公导航、后台、会员中心）外观不变。
   每个 var() 都带 fallback：主题 CSS 未加载时仍是原来的简约绿，不会白屏。
   规格：格子 150×50、每行 4 个；底部友情链接 100×30 纯文字。
   ============================================================ */
:root{
  --dh-bg:var(--bg,#f4f8f5);
  --dh-surface:var(--surface,#ffffff);
  --dh-line:var(--border,#dce9e0);
  --dh-text:var(--text,#17281f);
  --dh-text2:var(--text2,#61756a);
  --dh-primary:var(--primary,#137a54);
  --dh-primary-soft:var(--soft,#e8f5ee);
  --dh-gold:#c8952f;
  --dh-shadow:var(--shadow,0 10px 30px rgba(20,80,55,.08));
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
/* 保持简单选择器：themes.css 里 [data-theme] body 的优先级更高，
   因此节日红底 / 四季渐变得以覆盖这里的基础底色。 */
body{
  display:block;min-height:100vh;background:var(--dh-bg);color:var(--dh-text);
  font:15px/1.7 "Microsoft YaHei","PingFang SC",system-ui,-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
.dh-wrap{width:100%;max-width:760px;margin:0 auto;padding:0 20px}

/* ---------- 顶栏 ---------- */
.dh-top{border-bottom:1px solid var(--dh-line);background:rgba(255,255,255,.86);backdrop-filter:blur(8px)}
.dh-top-in{display:flex;align-items:center;justify-content:space-between;gap:16px;height:62px}
.dh-brand{display:flex;align-items:center;gap:10px;font-size:19px;font-weight:800;letter-spacing:.5px}
.dh-brand-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;
  background:var(--dh-primary);color:var(--on-primary,#fff);font-size:15px;font-weight:800}
.dh-brand em{color:var(--dh-primary);font-style:normal}
.dh-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dh-nav a{display:inline-flex;align-items:center;gap:5px;padding:7px 12px;border-radius:9px;
  font-size:13px;font-weight:600;color:var(--dh-text2);border:1px solid transparent;transition:.18s}
.dh-nav a:hover{color:var(--dh-primary);background:var(--dh-primary-soft)}
.dh-nav a.is-primary{border-color:var(--dh-primary);color:var(--dh-primary)}
.dh-nav a.is-primary:hover{background:var(--dh-primary);color:var(--on-primary,#fff)}

/* ---------- 顶栏第二行：后台「导航菜单」（menus 表，与办公导航同源） ---------- */
.dh-menu-wrap{border-top:1px solid var(--dh-line);padding-top:8px;padding-bottom:9px}
.dh-menu{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 6px}
.dh-menu-link{display:inline-flex;align-items:center;padding:4px 11px;border-radius:8px;
  font-size:12.5px;font-weight:600;color:var(--dh-text2);white-space:nowrap;transition:.16s}
.dh-menu-link:hover{color:var(--dh-primary);background:var(--dh-primary-soft)}
.dh-menu-link.is-current,.dh-menu-link.is-current:hover{
  color:var(--on-primary,#fff);background:var(--dh-primary)}

/* ---------- 格子上方：公众号全部文章轮巡（与办公导航共用 .mp-inline 组件） ---------- */
.dh-home .mp-inline{margin:2px 0 12px}
.dh-home .mp-inline-head{margin-bottom:12px}
.dh-home .mp-inline-grid{gap:10px}
.dh-home .mp-inline-item{padding:12px 11px;gap:7px;border-radius:10px}
.dh-home .mp-inline-title{font-size:13px;line-height:1.5}
.dh-home .mp-inline-link{font-size:11px}
.dh-home .mp-inline-empty{font-size:12px}
.dh-home .mp-inline-ctrl{margin-top:10px;gap:8px}
.dh-home .mp-inline-btn{width:25px;height:25px;font-size:17px}
.dh-home .mp-inline-count{font-size:11px}

/* ---------- 主视觉 ---------- */
.dh-hero{text-align:center;padding:52px 0 28px}
.dh-kicker{display:inline-block;padding:4px 13px;border-radius:20px;background:var(--dh-primary-soft);
  color:var(--dh-primary);font-size:12px;font-weight:700;letter-spacing:1px}
.dh-title{margin:16px 0 8px;font-size:38px;line-height:1.25;font-weight:800;letter-spacing:1px}
.dh-title em{font-style:normal;color:var(--dh-primary)}
.dh-sub{margin:0;color:var(--dh-text2);font-size:14px}
.dh-search{position:relative;display:flex;align-items:center;gap:10px;max-width:420px;margin:24px auto 0;
  height:46px;padding:0 14px;background:var(--dh-surface);border:1px solid var(--dh-line);
  border-radius:12px;box-shadow:var(--dh-shadow)}
.dh-search:focus-within{border-color:var(--dh-primary)}
.dh-search svg{width:18px;height:18px;flex:none;color:var(--dh-text2)}
.dh-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--dh-text);font-size:15px}
.dh-search kbd{font:12px ui-monospace,Consolas,monospace;color:var(--dh-text2);
  border:1px solid var(--dh-line);border-radius:5px;padding:1px 6px}

/* ---------- 格子区：每行 4 个 × 150×50 ---------- */
.dh-section{padding:22px 0 10px}
.dh-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 16px}
.dh-section-head h2{margin:0;font-size:17px;font-weight:800;display:flex;align-items:center;gap:9px}
.dh-section-head h2::before{content:"";width:4px;height:16px;border-radius:3px;background:var(--dh-primary)}
.dh-count{font-size:12px;color:var(--dh-text2)}
.dh-grid{display:grid;grid-template-columns:repeat(4,150px);gap:12px;justify-content:center}
.dh-tile{
  position:relative;display:flex;align-items:center;gap:9px;
  width:150px;height:50px;padding:0 10px;overflow:hidden;
  background:var(--dh-surface);border:1px solid var(--dh-line);border-radius:10px;
  box-shadow:0 2px 8px rgba(20,80,55,.04);transition:transform .16s,border-color .16s,box-shadow .16s;
}
.dh-tile:hover{transform:translateY(-2px);border-color:var(--dh-primary);box-shadow:0 8px 20px rgba(20,80,55,.13)}
.dh-tile-ico{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:8px;
  background:var(--dh-primary-soft);color:var(--dh-primary);font-size:13px;font-weight:800}
.dh-tile-txt{min-width:0;flex:1}
.dh-tile-title{display:block;font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dh-tile-desc{display:block;font-size:10px;color:var(--dh-text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px}
.dh-hot{position:absolute;top:3px;right:5px;font-size:9px;line-height:1;color:var(--dh-gold);font-weight:700}
.dh-tile.is-top::after{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--dh-gold)}
.dh-empty{grid-column:1/-1;text-align:center;padding:34px 12px;color:var(--dh-text2);
  background:var(--dh-surface);border:1px dashed var(--dh-line);border-radius:12px;font-size:13px}

/* ---------- 分页：服务端 hidden + JS 无刷新切换，两条路都能翻页 ---------- */
.dh-section{scroll-margin-top:16px}
/* .dh-tile / .dh-pager 自带 display，必须显式压过 UA 的 [hidden] 规则 */
.dh-tile[hidden],.dh-pager[hidden],.dh-empty[hidden]{display:none !important}
.dh-pager{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;
  margin:20px 0 4px;padding-top:16px;border-top:1px dashed var(--dh-line)}
.dh-page{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:30px;
  padding:0 9px;border:1px solid var(--dh-line);border-radius:8px;background:var(--dh-surface);
  color:var(--dh-text2);font-size:12px;text-decoration:none;transition:.16s}
.dh-page:hover{border-color:var(--dh-primary);color:var(--dh-primary)}
.dh-page.is-current{background:var(--dh-primary);border-color:var(--dh-primary);color:var(--on-primary,#fff);font-weight:700;cursor:default}
.dh-page.is-disabled{opacity:.45;pointer-events:none}
.dh-page-nav{padding:0 12px}
.dh-page-dots{padding:0 2px;color:var(--dh-text2);font-size:12px}
.dh-page-info{flex-basis:100%;margin-top:8px;text-align:center;font-size:11px;color:var(--dh-text2)}

/* ---------- 底部友情链接：100×30 纯文字小格 ---------- */
.dh-links{padding:30px 0 16px}
.dh-links-head{display:flex;align-items:center;gap:10px;margin:0 0 12px;font-size:13px;font-weight:700;color:var(--dh-text2)}
.dh-links-head::after{content:"";flex:1;height:1px;background:var(--dh-line)}
.dh-links-grid{display:flex;flex-wrap:wrap;gap:8px}
.dh-link{
  display:inline-flex;align-items:center;justify-content:center;
  width:100px;height:30px;padding:0 6px;overflow:hidden;
  background:var(--dh-surface);border:1px solid var(--dh-line);border-radius:5px;
  font-size:11px;color:var(--dh-text2);white-space:nowrap;text-overflow:ellipsis;
  transition:.16s;
}
.dh-link:hover{color:var(--dh-primary);border-color:var(--dh-primary);background:var(--dh-primary-soft)}
.dh-links-empty{font-size:12px;color:var(--dh-text2)}

/* ---------- 页脚 / 提示 ---------- */
.dh-tip{margin:18px 0 0;padding:12px 14px;border-radius:10px;background:var(--dh-primary-soft);
  color:var(--dh-text2);border:1px solid var(--dh-line);font-size:12px;line-height:1.8}
.dh-foot{margin-top:34px;padding:18px 0 30px;border-top:1px solid var(--dh-line);
  text-align:center;color:var(--dh-text2);font-size:12px}
.dh-foot a{color:var(--dh-primary)}
.dh-foot-links{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:8px}

/* ---------- 响应式 ---------- */
@media(max-width:700px){
  .dh-wrap{padding:0 14px}
  .dh-top-in{height:auto;min-height:58px;flex-wrap:wrap;padding:10px 0}
  .dh-brand{font-size:17px}
  .dh-nav a{padding:6px 9px;font-size:12px}
  .dh-menu{justify-content:flex-start}
  .dh-menu-link{padding:4px 9px;font-size:12px}
  .dh-hero{padding:34px 0 20px}
  .dh-title{font-size:28px}
  .dh-grid{grid-template-columns:repeat(3,150px);gap:9px}
}
@media(max-width:500px){
  .dh-grid{grid-template-columns:repeat(2,150px);gap:9px}
  .dh-link{width:100px}
  .dh-pager{gap:5px}
  .dh-page{min-width:28px;height:28px;padding:0 6px;font-size:11px}
  .dh-page-nav{padding:0 8px}
  .dh-home .mp-inline-item{padding:10px 9px}
  .dh-home .mp-inline-title{font-size:12px}
}

/* ---------- 跟随全站主题：装饰层置底 + 节日深色顶栏对比度 ---------- */
.dh-top,.dh-wrap{position:relative;z-index:1}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-top{
  background:var(--header-bg,rgba(255,255,255,.86));
  color:#fff8e6;border-bottom:2px solid rgba(255,222,120,.45);
}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-nav a{color:rgba(255,248,230,.92)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-nav a:hover{color:#fff;background:rgba(255,255,255,.14)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-nav a.is-primary{border-color:rgba(255,236,170,.85);color:#fff8e6}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-nav a.is-primary:hover{background:rgba(255,255,255,.18);color:#fff}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-brand-mark{
  background:linear-gradient(135deg,#fff0b8,#ffc94e 55%,#ed9a24);color:#5c1006}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-kicker{background:rgba(255,255,255,.16);color:#fff8e6}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-title em{color:#ffe08a}
/* 深底节日主题（元旦 / 春节 / 中秋 / 国庆）：页面级说明文字改浅色，
   避免沿用 --text / --text2 的深色造成红底上「看不见字」；
   卡片、输入框、页码、提示框本身是米白底，仍用深色字，不在这里改。 */
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) :is(
      .dh-title, .dh-sub, .dh-section-head h2, .dh-count,
      .dh-links-head, .dh-page-info, .dh-page-dots,
      .dh-links-empty, .dh-foot){color:#fff8e6}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-foot a{color:#ffe08a}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-section-head h2::before{background:#ffe08a}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-links-head::after{background:rgba(255,236,170,.45)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-pager{border-top-color:rgba(255,236,170,.4)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-kicker{
  background:rgba(255,240,196,.18);color:#fff8e6;border:1px solid rgba(255,236,170,.5)}
/* 深底节日主题：第二行导航菜单与文章区块标题也要换成浅色，卡片本身仍是米白底 */
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-menu-wrap{
  border-top-color:rgba(255,236,170,.4)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-menu-link{
  color:rgba(255,248,230,.92)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-menu-link:hover{
  color:#fff;background:rgba(255,255,255,.14)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-menu-link.is-current{
  color:#5c1006;background:rgba(255,236,170,.92)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline .section-head h2{
  color:#fff8e6}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline .section-bar{
  background:#ffe08a}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline .section-count a{
  color:#ffe08a}
/* 深底节日主题：轮巡控制条也要换成浅色，避免暗红字压在深红底上看不清 */
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline-btn{
  background:rgba(255,255,255,.12);border-color:rgba(255,236,170,.45);color:#fff8e6}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline-btn:hover{
  color:#ffe08a;border-color:#ffe08a}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline-dot{
  background:rgba(255,248,230,.42)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline-dot.is-active{
  background:#ffe08a}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline-count{
  color:rgba(255,248,230,.86)}
:is([data-theme="newyear"],[data-theme="springfestival"],
    [data-theme="midautumn"],[data-theme="nationalday"]) .dh-home .mp-inline-count b{
  color:#ffe08a}
