/* ==========================================================================
   Oxford Child Theme - 主样式表 v1.9
   基于 OPGDI 参考站真实截图取色 + demo 确认 + Blocksy 适配
   更新 v1.9：Search 按钮改造采用更高优先级选择器 + CSS 变量覆盖
   ========================================================================== */


/* ==========================================================================
   1. Google Fonts
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400;1,700&family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');


/* ==========================================================================
   2. 设计 Tokens（CSS 变量）- 基于真实取色
   ========================================================================== */
:root {
  /* ----- 主色系（Oxford Blue 官方品牌色）----- */
  --ct-color-primary: #002147;          /* Oxford Blue */
  --ct-color-primary-hover: #2a6492;
  --ct-color-primary-light: #e6ebf2;

  /* ----- 酒红色系（顶/底使用不同深度，参考站实测）----- */
  --ct-color-wine-top: #862433;         /* 顶部 Top Bar（Oxford 大学条）*/
  --ct-color-wine-deep: #701e2c;        /* 页脚（明显更深）*/
  --ct-color-wine-darker: #5a1823;      /* hover 更深 */
  /* 兼容老变量（指向顶部色）*/
  --ct-color-wine: #862433;
  --ct-color-wine-hover: #701e2c;

  /* ----- 金黄色系（按钮 vs 菜单当前项 - 参考站实测）----- */
  --ct-color-gold-main: #ffe296;        /* 浅黄 - 按钮主色（Link to website 按钮）*/
  --ct-color-gold-hover: #ffec9f;       /* 极浅黄 - 菜单 hover 背景 */
  --ct-color-gold-current: #fcce51;     /* 深金黄 - 菜单 current 项背景 */
  /* 兼容老变量 */
  --ct-color-gold: #ffe296;
  --ct-color-gold-light: #ffec9f;
  --ct-color-gold-lightest: #ffec9f;

  /* ----- 棕色（链接 active / 按钮文字色）----- */
  --ct-color-brown: #694002;

  /* ----- OPGDI logo 深红（给文字 logo 备用）----- */
  --ct-color-red-logo: #9b2c2c;

  /* ----- 中性色 ----- */
  --ct-color-text: #444444;              /* 参考站正文色 */
  --ct-color-text-muted: #666666;
  --ct-color-text-light: #8a8a8a;
  --ct-color-heading: #002147;           /* 标题用牛津蓝 */

  /* ----- 背景 ----- */
  --ct-color-bg: #ffffff;
  --ct-color-bg-alt: #f0f0ec;            /* 参考站浅背景米色 */
  --ct-color-bg-dark: #002147;           /* 版权条深蓝 */

  /* ----- 边框 ----- */
  --ct-color-border: #e6e6e1;
  --ct-color-border-dark: #c8c8c0;

  /* ----- 字体（参考站用 Lora 衬线 + Open Sans 无衬线）----- */
  --ct-font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --ct-font-body: 'Lora', Georgia, 'Times New Roman', serif;
  --ct-font-footer: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* ----- 字号（参考站真实值）----- */
  --ct-fs-h1: 2.45rem;       /* 39.2px */
  --ct-fs-h2: 2rem;          /* 32px */
  --ct-fs-h3: 1.65rem;       /* 26.4px */
  --ct-fs-h4: 1.4rem;        /* 22.4px */
  --ct-fs-h5: 1.2rem;        /* 19.2px */
  --ct-fs-h6: 1rem;          /* 16px 斜体 */
  --ct-fs-body: 1rem;
  --ct-fs-nav: 1.15rem;      /* 18.4px */
  --ct-fs-small: 0.875rem;
  --ct-fs-xs: 0.75rem;

  /* ----- 行高 ----- */
  --ct-lh-tight: 1.2;
  --ct-lh-normal: 1.5;
  --ct-lh-loose: 1.7;

  /* ----- 间距 ----- */
  --ct-space-xs: 0.5rem;
  --ct-space-sm: 1rem;
  --ct-space-md: 1.5rem;
  --ct-space-lg: 2.5rem;
  --ct-space-xl: 4rem;
  --ct-space-2xl: 5rem;

  /* ----- 容器（用 Blocksy 变量控制，在 外观→自定义→Layout 设置）----- */
  --ct-container-max: 100%;
  --ct-container-padding: var(--theme-content-edge-spacing, 5vw);

  /* ----- 圆角（参考站几乎全是直角）----- */
  --ct-radius-sm: 0;
  --ct-radius-md: 0;
  --ct-radius-lg: 0;

  /* ----- 阴影 ----- */
  --ct-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --ct-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --ct-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  --ct-transition: 0.25s ease;
}

/* 小屏响应 */
@media (max-width: 1200px) {
  :root { --ct-container-padding: 40px; }
}
@media (max-width: 768px) {
  :root { --ct-container-padding: 20px; }
}


/* ==========================================================================
   3. 全局基础
   ========================================================================== */
body.oxford-theme {
  font-family: var(--ct-font-body);
  font-size: var(--ct-fs-body);
  line-height: var(--ct-lh-normal);
  color: var(--ct-color-text);
  background: var(--ct-color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ==========================================================================
   4. 标题（参考站：Regular 400，不是 Bold！）
   注意：.entry-title 和 .page-title 不在这里设置，
   由 Blocksy 面板 Card Options → Design 标签控制
   ========================================================================== */
.oxford-theme h1,
.oxford-theme h2:not(.entry-title):not(.page-title),
.oxford-theme h3,
.oxford-theme h4,
.oxford-theme h5,
.oxford-theme h6 {
  font-family: var(--ct-font-heading);
  color: var(--ct-color-heading);
  line-height: var(--ct-lh-tight);
  font-weight: 400;
  letter-spacing: normal;
  margin-top: 0;
  margin-bottom: var(--ct-space-sm);
}

.oxford-theme h1 { font-size: var(--ct-fs-h1); }
.oxford-theme h2:not(.entry-title) { font-size: var(--ct-fs-h2); }
.oxford-theme h3 { font-size: var(--ct-fs-h3); }
.oxford-theme h4 { font-size: var(--ct-fs-h4); }
.oxford-theme h5 { font-size: var(--ct-fs-h5); }
.oxford-theme h6 { font-size: var(--ct-fs-h6); font-style: italic; }

@media (max-width: 768px) {
  .oxford-theme h1 { font-size: 1.9rem; }
  .oxford-theme h2:not(.entry-title) { font-size: 1.6rem; }
  .oxford-theme h3 { font-size: 1.4rem; }
  .oxford-theme h4 { font-size: 1.2rem; }
  .oxford-theme h5 { font-size: 1.1rem; }
}

strong, b { font-weight: bold; }


/* ==========================================================================
   5. 链接
   ========================================================================== */
.oxford-theme a {
  color: var(--ct-color-primary-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--ct-transition);
}

.oxford-theme a:hover {
  color: var(--ct-color-brown);
}

/* 这些区域的链接不加下划线 */
.oxford-theme nav a,
.oxford-theme .ct-header a,
.oxford-theme .ct-footer a,
.oxford-theme .academic-card a,
.oxford-theme .entry-title a {
  text-decoration: none;
}

/* 卡片标题链接颜色由 Blocksy 面板控制，不在这里覆盖 */
.oxford-theme .entry-title a,
.oxford-theme .entry-title a:visited {
  color: inherit;
  text-decoration: none;
}
.oxford-theme .entry-title a:hover {
  color: inherit;
}


/* ==========================================================================
   6. Header - 三层结构
   ========================================================================== */

/* ==========================================================================
   Top Row — 酒红顶条 (终极版高度锁定)
   关键发现：Blocksy 把 --height 应用在 [data-row] > div（即 .ct-container）上：
     [data-row] > div { min-height: var(--shrink-height, var(--height)); }
   所以必须同时锁定 [data-row="top"] 自身 + 子 div 的 min-height
   ========================================================================== */

/* 1. Top Row 本身严格锁定 70px（覆盖 Blocksy --height 变量） */
.oxford-theme #header [data-row="top"],
.oxford-theme [data-row="top"] {
  background: #862433 !important;
  color: #ffffff !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 70px !important;
  height: 70px !important;
  max-height: 70px !important;
  --height: 70px !important;
  --shrink-height: 70px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* 2. Top Row 的子 div（.ct-container）也锁定 70px — 这是关键！
      Blocksy 在子 div 上设置 min-height: var(--height) */
.oxford-theme #header [data-row="top"] > div,
.oxford-theme [data-row="top"] > div,
.oxford-theme [data-row="top"] > .ct-container {
  min-height: 70px !important;
  height: 70px !important;
  max-height: 70px !important;
  max-width: var(--theme-normal-container-max-width, 1600px) !important;
  width: var(--theme-container-width, 90vw) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* 3. 强制所有内层 flex 容器左对齐 */
.oxford-theme [data-row="top"] [data-column],
.oxford-theme [data-row="top"] [data-column="start"],
.oxford-theme [data-row="top"] [data-column="middle"],
.oxford-theme [data-row="top"] [data-column="end"],
.oxford-theme [data-row="top"] [data-items],
.oxford-theme [data-row="top"] [data-items="primary"],
.oxford-theme [data-row="top"] .ct-header-text,
.oxford-theme [data-row="top"] .entry-content,
.oxford-theme [data-row="top"] .entry-content.is-layout-flow {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: left !important;
  width: auto !important;
  max-height: 70px !important;
  height: 70px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
  overflow: hidden !important;
}

/* 4. p 标签也左对齐 + 不撑高 */
.oxford-theme [data-row="top"] p {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  width: auto !important;
  max-height: 70px !important;
  line-height: 54px !important;
  display: inline-block !important;
}

/* 5. Logo 链接 */
.oxford-theme [data-row="top"] a {
  color: #ffffff !important;
  text-decoration: none !important;
  display: inline-block !important;
  line-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 6. Logo 图片 — 严格固定 173x54 */
.oxford-theme [data-row="top"] img {
  display: block !important;
  width: 173px !important;
  height: 54px !important;
  max-width: 173px !important;
  max-height: 54px !important;
  min-width: 173px !important;
  min-height: 54px !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  vertical-align: middle !important;
}

/* 7. 移动端缩小 */
@media (max-width: 768px) {
  .oxford-theme #header [data-row="top"],
  .oxford-theme [data-row="top"] {
    min-height: 56px !important;
    height: 56px !important;
    max-height: 56px !important;
    --height: 56px !important;
    --shrink-height: 56px !important;
  }
  .oxford-theme [data-row="top"] > div,
  .oxford-theme [data-row="top"] > .ct-container {
    min-height: 56px !important;
    height: 56px !important;
    max-height: 56px !important;
  }
  .oxford-theme [data-row="top"] [data-column],
  .oxford-theme [data-row="top"] [data-items],
  .oxford-theme [data-row="top"] .ct-header-text,
  .oxford-theme [data-row="top"] .entry-content {
    max-height: 56px !important;
    height: 56px !important;
  }
  .oxford-theme [data-row="top"] img {
    width: 130px !important;
    height: 40px !important;
    max-width: 130px !important;
    max-height: 40px !important;
    min-width: 130px !important;
    min-height: 40px !important;
  }
}

/* Top Bar — Content Block 实现已废弃，改用 Blocksy Header Builder 的 Top Row
   .opgdi-topbar 相关规则已删除（之前为 Content Block 路径准备的，现在不再使用） */

/* Layer 2: 白色 - Logo + 搜索 */
.oxford-theme [data-row="middle"] {
  background: #ffffff;
  padding: 20px 0;
}

/* Layer 3: 白色 - 菜单 */
.oxford-theme [data-row="bottom"] {
  background: #ffffff;
  border-bottom: 1px solid var(--ct-color-border);
}


/* ==========================================================================
   7. 主导航菜单
   ========================================================================== */
.oxford-theme .ct-main-navigation > ul > li > a {
  font-family: var(--ct-font-body);
  font-size: var(--ct-fs-nav);
  font-weight: 400;
  padding: 16px 24px;
  color: #000000;
  transition: all var(--ct-transition);
}

.oxford-theme .ct-main-navigation > ul > li > a:hover {
  color: var(--ct-color-brown);
  background: var(--ct-color-gold-hover);
}

/* 当前菜单项：深金黄背景 + 棕色字（参考站实测 #fcce51）*/
.oxford-theme .ct-main-navigation > ul > li.current-menu-item > a,
.oxford-theme .ct-main-navigation > ul > li.current-menu-ancestor > a,
.oxford-theme .ct-main-navigation > ul > li.current_page_item > a {
  background: var(--ct-color-gold-current);
  color: var(--ct-color-brown);
}

/* 下拉菜单 */
.oxford-theme .ct-main-navigation .sub-menu {
  background: #ffffff;
  border-top: none;
  box-shadow: var(--ct-shadow-md);
  border-radius: 0;
  padding: 0;
  min-width: 260px;
}

.oxford-theme .ct-main-navigation .sub-menu a {
  padding: 14px 20px;
  font-size: var(--ct-fs-nav);
  font-weight: 400;
  color: #000000;
  border-left: none;
  transition: all var(--ct-transition);
}

.oxford-theme .ct-main-navigation .sub-menu a:hover {
  background: var(--ct-color-gold-hover);
  color: var(--ct-color-brown);
  border-left-color: transparent;
}


/* ==========================================================================
   8. 面包屑 — 全页面统一（跨浏览器兼容，不依赖 :has() 选择器）
   面包屑通过 Content Block hook:1756 注入：
     article.entry-content.is-layout-constrained
       > section#gspb_row-id-gsbp-b596667.wp-block-greenshift-blocks-row
         > div.gspb_row__content (GreenShift inline: margin:0 auto, width:100%)
           > div#gspb_col-id-gsbp-21d4f35
             > nav.ct-breadcrumbs (Blocksy 默认)

   关键问题：
   1. WP 全局 .is-layout-constrained 限制子元素 max-width + margin: auto
   2. GreenShift inline CSS 给 .gspb_row__content 加 margin: 0 auto
   3. article 自身可能有 max-width
   解决：把面包屑 Content Block 整条全宽 + 左对齐（突破所有限制）
   ========================================================================== */

/* 1. 包裹面包屑的 article 整体不要 max-width */
.oxford-theme article#post-1756 {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.oxford-theme article#post-1756 > .entry-content,
.oxford-theme article#post-1756 > .entry-content.is-layout-constrained {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 2. 外层 GreenShift Section：突破 is-layout-constrained 限制，全宽左对齐 */
.oxford-theme #gspb_row-id-gsbp-b596667,
.oxford-theme article#post-1756 #gspb_row-id-gsbp-b596667 {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* 3. GreenShift 内部 .gspb_row__content：1600 内居中（跟 Header menu 同基准）*/
.oxford-theme #gspb_row-id-gsbp-b596667 > .gspb_row__content {
  max-width: var(--theme-normal-container-max-width, 1600px) !important;
  width: var(--theme-container-width, 90vw) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
  justify-content: flex-start !important;
}

/* 4. 内层 Column */
.oxford-theme #gspb_col-id-gsbp-21d4f35 {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 5. nav.ct-breadcrumbs 文字样式 + 左对齐 */
.oxford-theme .ct-breadcrumbs,
.oxford-theme nav.ct-breadcrumbs {
  font-size: 0.9em !important;
  font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
  margin: 16px 0 16px !important;
  padding: 0 !important;
  color: #555 !important;
  text-transform: none !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
  text-align: left !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.oxford-theme .ct-breadcrumbs a,
.oxford-theme nav.ct-breadcrumbs a {
  color: #555 !important;
  text-decoration: none !important;
  text-transform: none !important;
  font-weight: 400 !important;
  font-size: inherit !important;
}

.oxford-theme .ct-breadcrumbs a:hover,
.oxford-theme nav.ct-breadcrumbs a:hover {
  color: #002147 !important;
  text-decoration: underline !important;
}

/* 面包屑内所有 span / 分隔符不大写不加粗 */
.oxford-theme .ct-breadcrumbs span,
.oxford-theme .ct-breadcrumbs .ct-breadcrumb-separator,
.oxford-theme .ct-breadcrumbs .first-item,
.oxford-theme .ct-breadcrumbs .last-item,
.oxford-theme nav.ct-breadcrumbs span {
  text-transform: none !important;
  font-weight: 400 !important;
  font-size: inherit !important;
  color: inherit !important;
}

/* 当前页（最后一项）颜色稍深 */
.oxford-theme .ct-breadcrumbs .last-item,
.oxford-theme .ct-breadcrumbs span[aria-current="page"] {
  color: #333 !important;
}

/* 分隔符 SVG 图标 */
.oxford-theme .ct-breadcrumbs svg.ct-icon {
  width: 14px !important;
  height: 14px !important;
  vertical-align: middle !important;
  margin: 0 6px !important;
  fill: currentColor !important;
}


/* ==========================================================================
   10. 区块通用
   ========================================================================== */
.section-padding {
  padding: var(--ct-space-2xl) 0;
}

.section-alt {
  background: var(--ct-color-bg-alt);
}

.section-header {
  margin-bottom: var(--ct-space-lg);
  max-width: 720px;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--ct-font-body);
  font-size: var(--ct-fs-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ct-color-wine-top);
  margin-bottom: var(--ct-space-xs);
}


/* ==========================================================================
   12. 学术卡片（通用）
   ========================================================================== */
.academic-card {
  background: #ffffff;
  border: 1px solid var(--ct-color-border);
  border-radius: 0;
  overflow: hidden;
  transition: transform var(--ct-transition), box-shadow var(--ct-transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.academic-card:hover {
  box-shadow: var(--ct-shadow-md);
}

.academic-card__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ct-color-bg-alt);
}

.academic-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.academic-card__body {
  padding: var(--ct-space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.academic-card__meta {
  font-size: var(--ct-fs-small);
  color: var(--ct-color-text-muted);
  margin-bottom: var(--ct-space-xs);
  font-style: italic;
}

.academic-card__title {
  font-size: var(--ct-fs-h4);
  margin-bottom: var(--ct-space-xs);
  line-height: var(--ct-lh-tight);
  font-weight: 400;
}

.academic-card__title a {
  color: var(--ct-color-heading);
}

.academic-card__title a:hover {
  color: var(--ct-color-brown);
}

.academic-card__excerpt {
  font-size: var(--ct-fs-body);
  color: var(--ct-color-text);
  margin-bottom: var(--ct-space-sm);
}


/* ==========================================================================
   14. 按钮
   ========================================================================== */
.oxford-theme .wp-block-button__link,
.ct-button,
.oxford-theme button.button,
.oxford-theme input[type="submit"] {
  font-family: var(--ct-font-body);
  font-size: var(--ct-fs-body);
  font-weight: 400;
  padding: 12px 24px;
  border-radius: 0;
  text-decoration: none;
  display: inline-block;
  transition: all var(--ct-transition);
  border: 2px solid var(--ct-color-gold-main);
  background: var(--ct-color-gold-main);
  color: var(--ct-color-brown);
  cursor: pointer;
}

.oxford-theme .wp-block-button__link:hover,
.ct-button--primary:hover,
.oxford-theme button.button:hover {
  background: var(--ct-color-gold-current);
  border-color: var(--ct-color-gold-current);
  color: var(--ct-color-brown);
}

/* Outline 按钮 */
.ct-button--outline,
.oxford-theme .is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--ct-color-primary);
  border-color: var(--ct-color-primary);
}

.ct-button--outline:hover,
.oxford-theme .is-style-outline .wp-block-button__link:hover {
  background: var(--ct-color-primary);
  color: #ffffff;
}

/* 文字按钮 */
.ct-button--link {
  background: none;
  color: var(--ct-color-primary);
  padding: 0;
  font-weight: 400;
  border: none;
}

.ct-button--link::after {
  content: ' ›';
  transition: transform var(--ct-transition);
  display: inline-block;
}

.ct-button--link:hover::after {
  transform: translateX(4px);
}


/* ==========================================================================
   15. 搜索框（改造 Blocksy Search 按钮为"输入框+按钮"样式）
   ========================================================================== */

/* 
   说明：Blocksy Search 的 DOM 是一个 <button class="ct-header-search ct-toggle">，
   不是 <form>。我们通过 CSS 伪元素和更高优先级选择器把它改造成
   "白色输入框 + 金黄按钮" 的外观。
   
   关键：使用 [data-items] 父级 + 多个类名提升优先级，覆盖 Blocksy 默认样式。
*/

/* ---------- 容器：按钮本身变成整体的"表单"容器 ---------- */
#header [data-items] button.ct-header-search.ct-toggle,
.ct-header [data-id="search"] button.ct-toggle,
button.ct-header-search {
  width: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
  height: 46px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  position: relative !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  overflow: visible !important;
  transition: border-color 0.2s !important;
}

/* hover 时显示淡灰色边框，让"输入框"更有形 */
#header [data-items] button.ct-header-search.ct-toggle:hover,
button.ct-header-search:hover {
  border-color: #ddd !important;
}

/* ---------- "假输入框"：用 ::before 伪元素画白色输入区 ---------- */
#header [data-items] button.ct-header-search.ct-toggle::before,
button.ct-header-search::before {
  content: 'Search' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  right: 52px !important;
  bottom: 0 !important;
  background: #ffffff !important;
  padding: 0 14px !important;
  display: flex !important;
  align-items: center !important;
  font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
  font-size: 15px !important;
  color: #999 !important;
  box-sizing: border-box !important;
  text-align: left !important;
  letter-spacing: normal !important;
}

/* ---------- "假放大镜"：用 ::after 伪元素叠在右侧黄色区域显示对称放大镜 ----------
   原因：svg.ct-icon 元素本身不能可靠渲染 background-image
   方案：用 button::after 伪元素绘制放大镜，叠在 svg 上面 */
#header [data-items] button.ct-header-search.ct-toggle::after,
button.ct-header-search::after {
  content: '' !important;
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 52px !important;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAyMTQ3IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIvPjxwYXRoIGQ9Im0yMSAyMS00LjMtNC4zIi8+PC9zdmc+") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

/* ---------- 把原本的 "Search" label 文字隐藏 ---------- */
#header [data-items] button.ct-header-search .ct-label,
button.ct-header-search .ct-label {
  display: none !important;
  visibility: hidden !important;
}

/* ---------- SVG 图标：变成金黄色方块按钮 ---------- */
#header [data-items] button.ct-header-search .ct-icon,
#header [data-items] button.ct-header-search svg.ct-icon,
button.ct-header-search .ct-icon {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 52px !important;
  height: 44px !important;
  background: #ffe296 !important;
  color: #002147 !important;
  fill: #002147 !important;
  padding: 12px 16px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  transition: background 0.2s !important;
}

/* ICON 对称化修复：用 background-image 注入对称放大镜 SVG，隐藏 Blocksy 默认不对称的 SVG
   Blocksy 默认放大镜 path 在 viewBox 0-15 内重心偏右下，视觉不居中
   这里换成 Material Design 风格的对称放大镜（圆心 11,11，把手 21,21 对称居中）*/
#header [data-items] button.ct-header-search .ct-icon,
button.ct-header-search .ct-icon {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAyMTQ3IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIvPjxwYXRoIGQ9Im0yMSAyMS00LjMtNC4zIi8+PC9zdmc+") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
}

/* 隐藏 Blocksy 默认 SVG 内部的 path（保留 svg.ct-icon 作为黄色背景框 + 显示 background-image 的对称放大镜）*/
#header [data-items] button.ct-header-search svg.ct-icon path,
button.ct-header-search svg.ct-icon path {
  fill: transparent !important;
  stroke: transparent !important;
}

/* hover 时按钮变深金黄 — 只改背景色，不再注入额外放大镜（::after 伪元素的放大镜一直显示，不需要 hover 时再加一个）*/
#header [data-items] button.ct-header-search:hover .ct-icon,
button.ct-header-search:hover .ct-icon {
  background-color: #fcce51 !important;
}

/* SVG path 颜色 — 改成 transparent 隐藏 Blocksy 默认不对称的 SVG path，显示上面注入的对称 background-image */
#header [data-items] button.ct-header-search svg path,
#header [data-items] button.ct-header-search .ct-icon path,
button.ct-header-search svg path {
  fill: transparent !important;
  stroke: transparent !important;
}

/* ---------- 覆盖 Blocksy 主题的 CSS 变量（更高优先级）---------- */
#header [data-items] button.ct-header-search,
button.ct-header-search {
  --theme-link-initial-color: #002147 !important;
  --theme-text-color: #002147 !important;
  --theme-icon-size: 20px !important;
}


/* ==========================================================================
   18. Footer - 两层结构
   ========================================================================== */

/* 上层：深酒红 #701e2c */
.oxford-theme .ct-footer {
  background: var(--ct-color-wine-deep);
  color: #ffffff;
  font-size: var(--ct-fs-body);
  font-family: var(--ct-font-footer);
}

.oxford-theme .ct-footer * {
  font-family: var(--ct-font-footer);
}

.oxford-theme .ct-footer h3,
.oxford-theme .ct-footer h4 {
  color: #ffffff;
  font-family: var(--ct-font-footer);
  font-size: 18px;
  font-weight: bold;
  margin-bottom: var(--ct-space-sm);
  padding-bottom: 0;
  border-bottom: none;
}

.oxford-theme .ct-footer a {
  color: #ffffff;
  text-decoration: none;
}

.oxford-theme .ct-footer a:hover {
  color: var(--ct-color-gold-current);
  text-decoration: underline;
}

.oxford-theme .ct-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.oxford-theme .ct-footer li {
  margin-bottom: 6px;
}

/* 下层：Oxford Blue 版权条 */
.oxford-theme .ct-footer [data-row="bottom"],
.oxford-theme .ct-footer-copyright {
  background: var(--ct-color-primary);
  color: #ffffff;
  padding: 16px 0;
  text-align: center;
  font-size: var(--ct-fs-small);
}

.oxford-theme .ct-footer [data-row="bottom"] a,
.oxford-theme .ct-footer-copyright a {
  color: #ffffff;
  text-decoration: none;
}

.oxford-theme .ct-footer [data-row="bottom"] a:hover,
.oxford-theme .ct-footer-copyright a:hover {
  text-decoration: underline;
}


/* ==========================================================================
   19. 无障碍
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--ct-color-wine-top);
  color: #fff;
  padding: var(--ct-space-xs) var(--ct-space-sm);
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus { top: 0; }

.oxford-theme a:focus-visible,
.oxford-theme button:focus-visible,
.oxford-theme input:focus-visible,
.oxford-theme textarea:focus-visible,
.oxford-theme select:focus-visible {
  outline: 2px solid var(--ct-color-gold-current);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ==========================================================================
   20. 响应式
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --ct-space-2xl: 3rem;
    --ct-space-xl: 2.5rem;
  }

  .section-padding {
    padding: var(--ct-space-xl) 0;
  }

  .oxford-theme .ct-main-navigation > ul > li > a {
    padding: 12px 16px;
  }
}


/* ==========================================================================
   21. 工具类
   ========================================================================== */
.text-primary { color: var(--ct-color-primary); }
.text-wine { color: var(--ct-color-wine-top); }
.text-gold { color: var(--ct-color-gold-current); }
.text-brown { color: var(--ct-color-brown); }
.text-muted { color: var(--ct-color-text-muted); }

.bg-alt { background: var(--ct-color-bg-alt); }
.bg-dark { background: var(--ct-color-bg-dark); color: #fff; }
.bg-wine { background: var(--ct-color-wine-top); color: #fff; }
.bg-gold { background: var(--ct-color-gold-current); color: var(--ct-color-primary); }

.uppercase-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--ct-fs-xs);
  font-weight: 600;
}


/* ==========================================================================
   22. Sidebar 宽度由 .has-sidebar / .no-sidebar body class 控制
   见下方 Section 27
   ========================================================================== */

/* Sidebar Widget 标题 */
body.post-type-archive-news .ct-sidebar .widget-title,
body.post-type-archive-magazine .ct-sidebar .widget-title,
body.post-type-archive-person .ct-sidebar .widget-title {
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #002147 !important;
    border-bottom: 2px solid #002147 !important;
    padding-bottom: 6px !important;
    margin-bottom: 10px !important;
    text-transform: none !important;
}

/* Sidebar 链接样式 */
body.post-type-archive-news .ct-sidebar a,
body.post-type-archive-magazine .ct-sidebar a {
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
    font-size: 14px !important;
    color: #444 !important;
    text-decoration: none !important;
}

body.post-type-archive-news .ct-sidebar a:hover,
body.post-type-archive-magazine .ct-sidebar a:hover {
    color: #694002 !important;
}


/* ==========================================================================
   23. 侧边栏菜单样式（全部 class 驱动，无内联样式）
   ========================================================================== */

/* 容器 */
.opgdi-sidebar-nav {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    box-sizing: border-box;
}

/* 列表重置 */
.opgdi-sidebar-nav__list,
.opgdi-sidebar-nav__sublist {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 列表项分隔线 */
.opgdi-sidebar-nav__item {
    border-bottom: 2px solid #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 链接 — 基础样式 */
.opgdi-sidebar-nav__link {
    display: block !important;
    padding: 14px 16px !important;
    color: #694002 !important;
    font-size: 18px !important;
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    background: #ffe296 !important;
    transition: background 0.15s, color 0.15s !important;
    box-sizing: border-box !important;
}

/* 子菜单链接 */
.opgdi-sidebar-nav__link--child {
    padding-left: 30px !important;
    font-size: 16px !important;
}

/* 当前项 */
.opgdi-sidebar-nav__link--active {
    background: #fcce51 !important;
    font-weight: 700 !important;
}

/* hover */
.opgdi-sidebar-nav__link:hover {
    background: #fcce51 !important;
    color: #694002 !important;
    font-weight: 700 !important;
}

/* 链接 + 箭头并排 */
.opgdi-sidebar-nav__link-wrap {
    display: flex !important;
    align-items: stretch !important;
}

.opgdi-sidebar-nav__link-wrap .opgdi-sidebar-nav__link {
    flex: 1 !important;
}

/* 展开/收起箭头按钮 */
.opgdi-sidebar-nav__toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    background: #ffe296 !important;
    border: none !important;
    border-left: 2px solid #ffffff !important;
    color: #694002 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: background 0.15s, transform 0.2s !important;
}

.opgdi-sidebar-nav__toggle:hover {
    background: #fcce51 !important;
}

/* 箭头旋转：展开时朝上 */
.opgdi-sidebar-nav__item--open > .opgdi-sidebar-nav__link-wrap > .opgdi-sidebar-nav__toggle {
    transform: rotate(180deg);
}

/* 子菜单默认收起 */
.opgdi-sidebar-nav__item--has-children > .opgdi-sidebar-nav__sublist {
    display: none !important;
}

/* 展开时显示 */
.opgdi-sidebar-nav__item--open > .opgdi-sidebar-nav__sublist {
    display: block !important;
}

/* 子菜单项样式：浅背景 + 缩进（参考对标站） */
.opgdi-sidebar-nav__link--child {
    padding-left: 30px !important;
    font-size: 16px !important;
    background: #fff8e6 !important;
}


/* ==========================================================================
   24. 搜索框灰色边框（需求 #7）
   ========================================================================== */
#header [data-items] button.ct-header-search.ct-toggle::before,
button.ct-header-search::before {
    border: 1px solid #bbbbbb !important;
    border-right: none !important;
}
#header [data-items] button.ct-header-search .ct-icon,
button.ct-header-search .ct-icon {
    border: 1px solid #bbbbbb !important;
    border-left: none !important;
}
#header [data-items] button.ct-header-search:hover::before,
button.ct-header-search:hover::before {
    border-color: #888 !important;
}
#header [data-items] button.ct-header-search:hover .ct-icon,
button.ct-header-search:hover .ct-icon {
    border-color: #888 !important;
}


/* ==========================================================================
   27. 隐藏 sidebar：首页 / Contact / VSP（需求 #1, #2）
   ========================================================================== */

/* ==========================================================================
   27. Sidebar 显示控制（按 body class）
   PHP 在 body 上添加 .has-sidebar 或 .no-sidebar
   .no-sidebar 的页面：news/publication/magazine/event 单页 + 首页 + Contact
   .has-sidebar 的页面：research 单页 + programmes 单页 + 各归档页 + About 等
   ========================================================================== */

/* 无 sidebar 页面：彻底隐藏 sidebar 区域，内容区占满
   注意：这里去掉 .single 限定，让所有 no-sidebar 页面（包括首页、Page、404）都生效 */
body.no-sidebar .ct-sidebar {
    display: none !important;
}

body.no-sidebar .ct-container[data-sidebar] {
    --sidebar-width: 0px !important;
    --sidebar-gap: 0px !important;
    grid-template-columns: 1fr !important;
}

/* 有 sidebar 页面：sidebar 25% 宽度（参考站 col-sm-3）
   注意：这里去掉 .single 限定，让 has-sidebar 单页 + 列表页 + About 等所有页面 sidebar 都 25%
   保证视觉一致性 */
body.has-sidebar .ct-container[data-sidebar] {
    --sidebar-width: 25% !important;
    --sidebar-gap: 30px !important;
}


/* People 归档页网格响应式 */
@media (max-width: 768px) {
    .opgdi-people-group div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 1024px) and (min-width: 769px) {
    .opgdi-people-group div[style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* ==========================================================================
   32. 移动端 Header 搜索按钮修复（问题 #3）
   移动端搜索只显示放大镜图标 + 金黄背景，不显示假输入框
   ========================================================================== */

@media (max-width: 689px) {
    /* 移动端：搜索按钮收缩为纯图标 */
    #header [data-items] button.ct-header-search.ct-toggle,
    .ct-header [data-id="search"] button.ct-toggle,
    button.ct-header-search {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        border: none !important;
        background: transparent !important;
    }

    /* 隐藏假输入框 */
    #header [data-items] button.ct-header-search.ct-toggle::before,
    button.ct-header-search::before {
        display: none !important;
    }

    /* 图标占满按钮 */
    #header [data-items] button.ct-header-search .ct-icon,
    #header [data-items] button.ct-header-search svg.ct-icon,
    button.ct-header-search .ct-icon {
        width: 44px !important;
        height: 44px !important;
        right: 0 !important;
        top: 0 !important;
        padding: 10px !important;
        border: none !important;
        border-radius: 0 !important;
    }

    /* 移动端：::after 伪元素（放大镜图标）跟 button 同宽 44px，让放大镜居中 */
    #header [data-items] button.ct-header-search.ct-toggle::after,
    button.ct-header-search::after {
        width: 44px !important;
    }

    /* 移动端 top bar 保持紧凑 */
    .oxford-theme [data-row="top"] {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    /* 移动端 middle row 去掉多余 padding */
    .oxford-theme [data-row="middle"] {
        padding: 10px 0 !important;
    }
}


/* ==========================================================================
   33. Footer 全屏样式修复（问题 #4）
   将内联样式移到 CSS 中，确保移动端兼容
   Content Blocks 直接用 class 调用即可
   ========================================================================== */

/* Footer 主区块（替代内联 div style） */
.opgdi-footer-main {
    background: #701e2c;
    padding: 40px 95px;
    box-sizing: border-box;
    width: 100%;
}

.opgdi-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    max-width: var(--theme-normal-content-max-width, 1600px);
    margin: 0 auto;
}

.opgdi-footer-grid h3 {
    color: #fff !important;
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
    font-size: 18px !important;
    font-weight: bold !important;
    margin: 0 0 16px !important;
}

.opgdi-footer-grid ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.opgdi-footer-grid li {
    margin-bottom: 6px !important;
}

.opgdi-footer-grid a {
    color: #fff !important;
    text-decoration: none !important;
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
    font-size: 15px !important;
}

.opgdi-footer-grid a:hover {
    color: #fcce51 !important;
    text-decoration: underline !important;
}

.opgdi-footer-grid p {
    color: #fff !important;
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
    font-size: 15px !important;
    margin: 0 0 8px !important;
}

/* Footer 移动端响应式 */
@media (max-width: 900px) {
    .opgdi-footer-main {
        padding: 30px 40px;
    }
    .opgdi-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 600px) {
    .opgdi-footer-main {
        padding: 24px 20px;
    }
    .opgdi-footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}


/* ==========================================================================
   34. 详情单页修复（问题 #5）
   全部由 cpt-pages.css 按 CPT 类型精确控制
   不再使用 body.single 通用选择器，避免影响普通文章
   ========================================================================== */


/* ==========================================================================
   35. 大屏兼容（≥1920px / ≥2560px）
   注：用户需求"全宽靠左"，主内容区不再限制最大宽度
   仅 Header 内的 row 容器保留居中（保持 Logo/导航/搜索框排版美观）
   主内容区的全宽规则在 Section 36 处理
   ========================================================================== */
@media (min-width: 1920px) {
  /* Header 内的 row 容器：居中限制 1600px（避免 Logo/导航在 4K 屏拉太开） */
  .oxford-theme #header [data-row="middle"] > .ct-container,
  .oxford-theme #header [data-row="bottom"] > .ct-container {
    max-width: 1600px !important;
    margin: 0 auto !important;
  }
}

@media (min-width: 2560px) {
  /* Header 内的 row 容器：超大屏限制 1920px */
  .oxford-theme #header [data-row="middle"] > .ct-container,
  .oxford-theme #header [data-row="bottom"] > .ct-container {
    max-width: 1920px !important;
    margin: 0 auto !important;
  }
}


/* ==========================================================================
   36. 主内容容器全宽靠左（用户需求：所有内容贴左，不居中）
   Blocksy 默认 .ct-container 有 max-width: 1290px + margin: auto
   覆盖为 max-width: 100% + padding 5vw（保留左右间距，但不居中）

   关键：Blocksy 还有 [class*="ct-container"] > article 规则
   会通过 --theme-block-max-width 限制 article 宽度
   必须把 article 自己的 max-width 也设成 100%

   注意：不要影响 Header 内的 .ct-container（Top Row / Middle Row）
   注意：用 body.single 限定，只对详情页生效
         首页 / Archive 列表 / Page 走 Blocksy 默认 (1600 max-width 居中)

   ⚠️ 拆分两类：
   • has-sidebar（research/programmes 单页）：全宽贴左（昨天稳定状态）
   • no-sidebar（news/event/magazine/publication 单页）：保持在 1600 内居中（跟 Header menu 对齐）
   ========================================================================== */

/* has-sidebar 单页：全宽贴左（昨天的样子，不变）*/
.oxford-theme body.single.has-sidebar #main-container > .ct-container,
.oxford-theme body.single.has-sidebar #main-container > .ct-container-full,
.oxford-theme body.single.has-sidebar #main > .ct-container,
.oxford-theme body.single.has-sidebar #main > .ct-container-full,
.oxford-theme body.single.has-sidebar main > .ct-container,
.oxford-theme body.single.has-sidebar main > .ct-container-full,
.oxford-theme body.single.has-sidebar #main-container .ct-container[data-sidebar],
.oxford-theme body.single.has-sidebar #main-container .ct-container:not(.ct-header .ct-container) {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

/* no-sidebar 单页：保持在 Maximum Site Width (1600) 内居中（跟 Header menu 对齐）*/
.oxford-theme body.single.no-sidebar #main-container > .ct-container,
.oxford-theme body.single.no-sidebar #main-container > .ct-container-full,
.oxford-theme body.single.no-sidebar #main > .ct-container,
.oxford-theme body.single.no-sidebar #main > .ct-container-full,
.oxford-theme body.single.no-sidebar main > .ct-container,
.oxford-theme body.single.no-sidebar main > .ct-container-full,
.oxford-theme body.single.no-sidebar #main-container .ct-container[data-sidebar],
.oxford-theme body.single.no-sidebar #main-container .ct-container:not(.ct-header .ct-container) {
    width: var(--theme-container-width, 90vw) !important;
    max-width: var(--theme-normal-container-max-width, 1600px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

/* 关键修复：覆盖 Blocksy 的 [class*="ct-container"] > article 规则
   原规则：
     [class*="ct-container"] > article {
       --theme-block-max-width: var(--has-wide, var(--theme-normal-container-max-width));
       margin-inline: var(--has-boxed-structure, auto);
       max-width: var(--has-boxed-structure, var(--theme-boxed-content-max-width));
     }
   导致 article 自己也被居中限宽

   ⚠️ 拆分两类（跟 ct-container-full 一致）：
   • has-sidebar：article 100% 全宽贴左（昨天稳定状态）
   • no-sidebar：让 Blocksy 默认 (max-width 1600 居中) 生效，不要强制覆盖
   */

/* has-sidebar：article 强制 100% 全宽贴左 */
.oxford-theme body.single.has-sidebar #main-container [class*="ct-container"] > article,
.oxford-theme body.single.has-sidebar #main-container [class*="ct-container"] > article[class*="post"] {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    --theme-block-max-width: 100% !important;
    --theme-block-width: 100% !important;
    --wp--style--global--content-size: 100% !important;
    --wp--style--global--wide-size: 100% !important;
}

/* 单页内容区 entry-content 全宽（突破 is-layout-constrained 居中限宽）
   关键：必须在 entry-content 自己上设 CSS 变量，不能只靠 article 继承
   因为 Chrome 在某些场景对 :where() 选择器内的 var() 取值不会向上继承 */
.oxford-theme body.single.has-sidebar main .entry-content,
.oxford-theme body.single.no-sidebar main .entry-content,
.oxford-theme body.single.has-sidebar main .entry-content.is-layout-constrained,
.oxford-theme body.single.no-sidebar main .entry-content.is-layout-constrained,
.oxford-theme body.single.has-sidebar main .entry-content.is-layout-flow,
.oxford-theme body.single.no-sidebar main .entry-content.is-layout-flow {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    --theme-block-max-width: 100% !important;
    --theme-block-width: 100% !important;
    --wp--style--global--content-size: 100% !important;
    --wp--style--global--wide-size: 100% !important;
}

/* entry-content 内的子元素也不要被 WP/Blocksy 居中限宽
   覆盖两条规则：
   1. WP 全局 .is-layout-constrained > :where(...) { max-width: ...; margin: auto !important }
   2. Blocksy .is-layout-constrained > :where(...) { width: var(--theme-block-width) }
   注意：Blocksy 用的是 width，所以必须强制 width: 100%（不只是 max-width） */
.oxford-theme body.single.has-sidebar main .entry-content > *,
.oxford-theme body.single.no-sidebar main .entry-content > *,
.oxford-theme body.single.has-sidebar main .entry-content.is-layout-constrained > *,
.oxford-theme body.single.no-sidebar main .entry-content.is-layout-constrained > *,
.oxford-theme body.single.has-sidebar main .entry-content.is-layout-flow > *,
.oxford-theme body.single.no-sidebar main .entry-content.is-layout-flow > * {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 但是 .alignleft / .alignright / .alignfull 这些块除外，不强制 width: 100%
   它们应该保留自己的对齐行为 */
.oxford-theme body.single.has-sidebar main .entry-content > .alignleft,
.oxford-theme body.single.no-sidebar main .entry-content > .alignleft,
.oxford-theme body.single.has-sidebar main .entry-content > .alignright,
.oxford-theme body.single.no-sidebar main .entry-content > .alignright {
    width: auto !important;
    max-width: 50% !important;
}

/* 标题区 hero-section.is-width-constrained 也突破限宽
   原 Blocksy 规则: .is-width-constrained { margin-inline: auto; max-width: var(--theme-block-max-width) } */
.oxford-theme body.single.has-sidebar main .hero-section,
.oxford-theme body.single.no-sidebar main .hero-section,
.oxford-theme body.single.has-sidebar main .hero-section.is-width-constrained,
.oxford-theme body.single.no-sidebar main .hero-section.is-width-constrained {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
}

.oxford-theme body.single.has-sidebar main .hero-section .entry-header,
.oxford-theme body.single.no-sidebar main .hero-section .entry-header {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
}

/* 大屏 ≥1920px / ≥2560px：拆分两类
   • has-sidebar：保持全宽贴左
   • no-sidebar：保持在 1600 内居中（对齐 Header menu）*/
@media (min-width: 1920px) {
  /* has-sidebar 全宽贴左 */
  .oxford-theme body.single.has-sidebar #main-container > .ct-container,
  .oxford-theme body.single.has-sidebar #main-container > .ct-container-full,
  .oxford-theme body.single.has-sidebar #main-container .ct-container[data-sidebar] {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* no-sidebar 1600 居中 */
  .oxford-theme body.single.no-sidebar #main-container > .ct-container,
  .oxford-theme body.single.no-sidebar #main-container > .ct-container-full,
  .oxford-theme body.single.no-sidebar #main-container .ct-container[data-sidebar] {
    max-width: var(--theme-normal-container-max-width, 1600px) !important;
    width: var(--theme-container-width, 90vw) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
@media (min-width: 2560px) {
  /* has-sidebar 全宽贴左 */
  .oxford-theme body.single.has-sidebar #main-container > .ct-container,
  .oxford-theme body.single.has-sidebar #main-container > .ct-container-full,
  .oxford-theme body.single.has-sidebar #main-container .ct-container[data-sidebar] {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* no-sidebar 1600 居中 */
  .oxford-theme body.single.no-sidebar #main-container > .ct-container,
  .oxford-theme body.single.no-sidebar #main-container > .ct-container-full,
  .oxford-theme body.single.no-sidebar #main-container .ct-container[data-sidebar] {
    max-width: var(--theme-normal-container-max-width, 1600px) !important;
    width: var(--theme-container-width, 90vw) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}


/* ==========================================================================
   37. 文章单页内容贴左 0 间距（用户需求）
   仅针对 6 个 CPT 单页（news/event/magazine/publication/programme/research）
   不影响首页、列表页、其他页面
   ========================================================================== */
.oxford-theme body.single.has-sidebar main .entry-header,
.oxford-theme body.single.no-sidebar main .entry-header,
.oxford-theme body.single.has-sidebar main .entry-content,
.oxford-theme body.single.no-sidebar main .entry-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* entry-content 内的 p 元素 — 贴左 0 间距 */
.oxford-theme body.single.has-sidebar main .entry-content p,
.oxford-theme body.single.no-sidebar main .entry-content p {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}


/* ==========================================================================
   38. 搜索弹窗（#search-modal）— Input + Button 视觉修复
   - 修复 1.1：input 底部多 1 像素（高度跟 button 不齐）
   - 修复 1.2：黄色按钮内放大镜 ICON 切掉一块（padding 不够）
   ========================================================================== */

/* 搜索弹窗：让外观跟 Header 搜索框一致 — 白底输入框 + 黄色方块按钮 + 对称放大镜 */

/* 弹窗整体：flex 布局让 input 和 button 同行同高（不动 max-width / margin，保留 Blocksy 弹窗原居中布局）*/
#search-modal .ct-search-form {
    display: flex !important;
    align-items: stretch !important;
}

/* Input：白底 + 1px 全边框 + 跟 button 等高 */
#search-modal .ct-search-form input.modal-field {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    height: 56px !important;
    background: #ffffff !important;
    border: 1px solid #e6e6e1 !important;
    border-right: none !important;
    border-radius: 0 !important;
    color: #002147 !important;
    font-size: 16px !important;
    line-height: normal !important;
    vertical-align: middle !important;
    /* 覆盖 Blocksy 的变量 */
    --theme-form-field-border-width: 1px !important;
    --theme-form-field-height: 56px !important;
    --theme-form-font-size: 16px !important;
}

/* 控件容器：从 absolute 改为 static，让 button 跟 input 同行 */
#search-modal .ct-search-form .ct-search-form-controls {
    position: static !important;
    top: auto !important;
    inset-inline-end: auto !important;
    display: flex !important;
    align-items: stretch !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 黄色方块 Button：default + hover 都显示对称放大镜 */
#search-modal .ct-search-form button[type="submit"],
#search-modal .ct-search-form-controls button {
    align-self: stretch !important;
    width: 56px !important;
    min-width: 56px !important;
    height: 56px !important;
    box-sizing: border-box !important;
    background-color: #ffe296 !important;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAyMTQ3IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIvPjxwYXRoIGQ9Im0yMSAyMS00LjMtNC4zIi8+PC9zdmc+") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 20px 20px !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    /* 覆盖 Blocksy 的圆形 button 变量 */
    --theme-button-border-radius: 0 !important;
}

/* 隐藏 Blocksy 默认 SVG path（让 background-image 的对称放大镜显示）*/
#search-modal .ct-search-form button[type="submit"] .ct-icon,
#search-modal .ct-search-form button[type="submit"] svg,
#search-modal .ct-search-form-controls button .ct-icon,
#search-modal .ct-search-form-controls button svg {
    visibility: hidden !important;
}


/* ==========================================================================
   39. Header Row 限宽修复（任何浏览器 / 任何缩放都遵守 Maximum Site Width）

   问题背景：
   - Blocksy Header Builder 的 Main Row + Bottom Row（Default 容器结构）
     在 Chrome 4K 100% 缩放、笔记本 50%-67% 缩放等场景下，
     未正确遵守 General → Layout → Maximum Site Width（1600px）。
   - 表现：Logo / Search / 菜单 散开到屏幕两侧，与主体内容左右边界错位。
   - Edge 因跟随系统 DPI 缩放，innerWidth 通常 < 1600，所以表现正常。

   解决方案：
   - 用宽泛选择器强制 Header 内所有 row 子容器限到 1600px 居中。
   - !important 用于覆盖 Header Builder 的内联样式 / Blocksy 默认 CSS 变量。

   注意：
   - 该规则也会影响 Top Row（红条 + Oxford Logo），但 Top Row 内
     Logo 本就居中显示，无副作用。
   - 与 36 节"主内容容器全宽靠左"的设计哲学保持一致：
     主体内容贴左，Header Row 限到 1600 居中（Header Builder 原本设计）。
   ========================================================================== */
body.oxford-theme .ct-header > * > *,
body.oxford-theme .ct-header section > div,
body.oxford-theme .ct-header [class*="row"] > div,
body.oxford-theme #header > * > div,
body.oxford-theme #header section > div {
    max-width: 1600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}
