/* ==========================================================================
   字帖站 · 主题外观统一层（Kadence 页眉 / 页脚）
   目标：让站点页眉页脚与字帖内容区的暖米色调、宋体标题、赤陶强调色一致。
   只改颜色、字体、边框与间距，不改动主题结构。
   ========================================================================== */

/* ---------- 1. 全局色板：覆盖 Kadence 默认的蓝色系 ---------- */
html:root {
  --global-palette1: #155b43;
  --global-palette2: #24785a;
  --global-palette3: #24332c;
  --global-palette4: #34433a;
  --global-palette5: #4e5851;
  --global-palette6: #788078;
  --global-palette7: #eff2ea;
  --global-palette8: #f7f6f1;
  --global-palette9: #ffffff;
  --zt-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
}

html body { background: #f7f6f1; }

/* 页面主体：与页眉同一暖底，卡片（白）自然浮起；只作用于外层与内容区，
   避免把页眉 / 页脚内部的 .site-container 也染成米色（页眉中间会浮出一块色斑）。
   用 html body 前缀提高特异性，压过主题内联的白色背景 */
html body .wp-site-blocks,
html body .site,
html body .content-container.site-container,
html body .content-area { background: #f7f6f1; }

/* Kadence 给文章容器（article.entry.content-bg）刷了纯白，会把整块内容区盖成白色，
   这里让它透明，露出外层米色 */
html body article.entry.content-bg,
html body .entry-content-wrap { background: transparent; }

/* Kadence 给 article.entry 自带下投影（1px 15px 15px -10px 黑 5%），
   文章容器底边与页脚横线重合，阴影溢出到横线下方形成上下色差——去掉 */
html body article.entry { box-shadow: none !important; }

/* ---------- 2. 页眉 ---------- */
/* 用 body 前缀压过 Kadence 内联样式（#masthead{background:#fff}） */
body #masthead.site-header {
  background: #fffdf8;
  border-bottom: 0.8px solid #e7e1d5;
  /* 参考站的清晰界限：近邻深投影 + 远端柔影，内容滚过时分层明显 */
  box-shadow: 0 1px 0 rgba(231, 225, 213, 0.55), 0 8px 18px -8px rgba(36, 51, 44, 0.06);
}

/* 吸顶状态保持同样的底色与阴影，不因主题的 sticky 样式变浅 */
body #masthead.site-header.item-is-stuck,
body #masthead.site-header.kadence-sticky-header {
  background: #fffdf8;
  box-shadow: 0 1px 0 rgba(231, 225, 213, 0.55), 0 8px 18px -8px rgba(36, 51, 44, 0.06);
}

/* Kadence 吸顶时真正悬浮的是 .site-header-inner-wrap（item-is-fixed），
   它默认无边框无阴影——滚动时线消失的根源，这里补齐同样的边线与阴影 */
body #masthead .site-header-inner-wrap.kadence-sticky-header.item-is-fixed {
  background: #fffdf8;
  border-bottom: 0.8px solid #e7e1d5;
  box-shadow: 0 1px 0 rgba(231, 225, 213, 0.55), 0 8px 18px -8px rgba(36, 51, 44, 0.06);
}

body #masthead .site-header-row-container-inner,
body #masthead .site-header-inner-wrap,
body #masthead .site-header-wrap { background: transparent; }

/* 吸顶后 Kadence 会给 .kadence-sticky-header（含 item-is-stuck）刷纯白，
   页眉会突然变浅，这里强制与常态一致的米白（主题用了更高特异性，故用 !important） */
body #masthead .site-header-inner-wrap.kadence-sticky-header,
body #masthead .site-header-wrap.child-is-fixed,
body #masthead .kadence-sticky-header.item-is-fixed > .site-header-row-container-inner { background: #fffdf8 !important; }

/* 页眉内容宽度与站点内容一致（1240 外框 + 20 内边距），
   与首页 .zt-home、模板目录 .zt-index、生成页 .zt-shell 左右边界对齐；仅桌面端生效 */
@media (min-width: 1025px) {
  body #masthead .site-container {
    max-width: 1240px;
    padding-left: 20px;
    padding-right: 20px;
    background: transparent;
  }
}

#masthead .site-main-header-inner-wrap { min-height: 78px; }

/* 站点标题：主标题宋体 + 下方小字 slogan（与 logo 组成品牌块） */
#masthead .site-title-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 1px;
}

#masthead .site-title {
  margin: 0;
  font-family: var(--zt-serif);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 2px;
  color: #24332c;
}

#masthead .site-title-wrap::after {
  content: "让练字更简单";
  margin-top: 3px;
  margin-left: 1px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 3px;
  color: #7c857e;
  white-space: nowrap;
}

/* logo 与文字的间距：与原型品牌块一致（11px） */
#masthead .site-branding { gap: 11px; }
#masthead .site-branding .brand { margin-right: 0; }

/* 手机端与原型的小尺寸一致 */
@media (max-width: 1024px) {
  #masthead .site-title { font-size: 18px; }
  #masthead .site-title-wrap::after { font-size: 8px; letter-spacing: 1px; }
  #masthead .site-branding { gap: 8px; }
  #masthead .brand img.custom-logo { width: 34px; height: 34px; }
}

#masthead .brand img.custom-logo {
  width: 39px;
  height: 39px;
  border-radius: 10px;
  /* 浅色描边一圈（不占布局、不挤图片） */
  box-shadow: 0 0 0 1px #e8e2d7;
}

/* 主导航 */
#masthead .main-navigation .primary-menu-container > ul > li > a {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #4e5851;
  padding: 0.5em 0.85em;
  border-radius: 8px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

#masthead .main-navigation .primary-menu-container > ul > li > a:hover {
  color: #24785a;
  background: #eff5ee;
}

#masthead .main-navigation .primary-menu-container > ul > li.current-menu-item > a,
#masthead .main-navigation .primary-menu-container > ul > li.current-page-ancestor > a,
#masthead .main-navigation .primary-menu-container > ul > li.current-menu-parent > a {
  color: #24332c;
}

/* 下拉菜单 */
#masthead .main-navigation .sub-menu {
  background: #fffdf9;
  border: 1px solid #e7e1d5;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(41, 44, 38, 0.09);
  padding: 8px;
  min-width: 190px;
}

#masthead .main-navigation .sub-menu a {
  font-size: 13.5px;
  font-weight: 500;
  color: #4e5851;
  border-radius: 8px;
  padding: 8px 10px;
}

#masthead .main-navigation .sub-menu a:hover {
  background: #eff5ee;
  color: #24785a;
}

/* 页眉按钮：按原型「会员」金色按钮 */
body #main-header .header-button {
  background: #fff4df;
  color: #8e6423;
  border: 1px solid #f0dfbd;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  box-shadow: none;
  transition: background-color 0.18s ease;
}

body #main-header .header-button:hover { background: #fbe9c9; color: #8e6423; }

/* 移动端汉堡按钮 / 关闭按钮 */
#masthead .mobile-toggle-open-container .menu-toggle,
#masthead .mobile-toggle-open-container .menu-toggle:hover { color: #24332c; }

#masthead .mobile-navigation { background: #fffdf8; }

/* ---------- 3. 页脚 ---------- */
/* 底色完全交给 body，页脚自身不上色，避免与内容区出现色差 */
#colophon.site-footer {
  background: transparent;
  border-top: 1px solid #e7e1d5;
  color: #5b5f5a;
  box-shadow: none;
}

#colophon .site-footer-row-container-inner,
#colophon .site-footer-inner-wrap { background: transparent; }

/* 页脚内部容器不再各带底色，否则中间与两侧出现色差 */
#colophon .site-container,
#colophon .site-footer-row-container,
#colophon .site-footer-row,
#colophon .site-footer-row-container-inner,
#colophon .site-footer-inner-wrap,
#colophon .site-middle-footer-inner-wrap,
#colophon .site-top-footer-inner-wrap,
#colophon .site-bottom-footer-inner-wrap { background: transparent; }

#colophon .site-middle-footer-inner-wrap,
#colophon .site-top-footer-inner-wrap { padding: 20px 0 14px; }

/* 页脚内容宽度与页眉 / 正文对齐（1240 外框 + 20 内边距） */
@media (min-width: 1025px) {
  #colophon .site-container {
    max-width: 1240px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

#colophon .widget .wp-block-heading,
#colophon .widget-title {
  font-family: var(--zt-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #24332c;
}

#colophon .widget,
#colophon .widget p { color: #788078; font-size: 13.5px; line-height: 1.75; }

/* 链接：原来的深红 #a21717 → 与内容一致的暖灰 / 赤陶 */
#colophon a,
#colophon .site-footer-row .footer-html a,
#colophon .widget a { color: #788078; transition: color 0.18s ease; }

#colophon a:hover,
#colophon .site-footer-row .footer-html a:hover,
#colophon .widget a:hover { color: #24785a; }

#colophon .site-footer-section:not(:last-child):after { background: #e7e1d5; }

/* 版权条：与整条页脚同底色，只留一条全宽分隔线，避免中间一块变色的色差 */
#colophon .site-bottom-footer-wrap {
  width: 100%;
  max-width: none;
  background: transparent;
  border-top: 0;
}

/* 桌面端分界线与原型 1:1：只在内容容器（1240）内，不到屏幕两端 */
@media (min-width: 1025px) {
  #colophon.site-footer { border-top: 0; }
  #colophon .site-bottom-footer-inner-wrap { border-top: 1px solid #e7e1d4; }
}

#colophon .site-bottom-footer-inner-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 11px 20px;
  font-size: 12.5px;
  color: #8a8f8c;
}

#colophon .site-bottom-footer-inner-wrap a { color: #8a8f8c; }
#colophon .site-bottom-footer-inner-wrap a:hover { color: #24785a; }

/* 桌面端页脚：改为参考站的极简单行（左版权 / 中功能词 / 右说明），
   隐藏品牌 + 二维码那一整行，只保留一条分隔线 */
@media (min-width: 1025px) {
  #colophon .site-middle-footer-wrap { display: none; }

  #colophon .site-bottom-footer-inner-wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 20px 20px;
    font-size: 12.5px;
    line-height: 1.6;
  }

  #colophon .site-bottom-footer-inner-wrap .site-footer-bottom-section-1 {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
  }

  #colophon .site-bottom-footer-inner-wrap .footer-html {
    text-align: left;
    min-width: 0;
  }

  #colophon .site-bottom-footer-inner-wrap .footer-html p { margin: 0; }

  #colophon .site-bottom-footer-inner-wrap::before {
    content: "描红 · 笔顺 · 拼音 · 作文纸 · 英语练习";
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    color: #8b9188;
  }

  #colophon .site-bottom-footer-inner-wrap::after {
    content: "专为幼小学生设计 · 免费使用";
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    color: #8b9188;
  }
}

/* ---------- 4. 移动端微调 ---------- */
@media (max-width: 1024px) {
  #masthead { border-bottom: 1px solid #e7e1d5; }
  #masthead .site-title { font-size: 16.5px; }
  #masthead .brand img.custom-logo { width: 32px; height: 32px; border-radius: 8px; }
  #main-header .header-button { font-size: 13px; padding: 8px 16px; }
  #colophon .site-middle-footer-inner-wrap,
  #colophon .site-top-footer-inner-wrap { padding: 18px 0 12px; }
}

/* ---------- 5. 手机端工具页：主题容器不再留内边距，内容真正铺满 ---------- */
@media (max-width: 900px) {
  body.zt-m-app .content-area,
  body.zt-m-app #primary,
  body.zt-m-app .entry-content,
  body.zt-m-app .entry-content-wrap,
  body.zt-m-app .site-container {
    max-width: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ---------- 页眉右上角：登录 / 个人中心 ---------- */
body #main-header .zt-hdr-auth {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  margin-right: 10px;
  border: 1px solid #e0d8c8;
  border-radius: 999px;
  background: #fffdf8;
  color: #24332c;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

body #main-header .zt-hdr-auth:hover {
  border-color: #155b43;
  color: #155b43;
  background: #f4f7f4;
}

@media (max-width: 1024px) {
  body #main-header .zt-hdr-auth { height: 34px; padding: 0 13px; font-size: 13px; margin-right: 6px; }
}
