/* 统一盒模型，避免宽度 + padding 把布局挤爆 */
*, *::before, *::after { box-sizing: border-box; }

/* 让 header/nav/main 的内容有左右安全边距，并居中 */
:root {
  --site-max-width: 1200px;
  --gutter: 24px;
}

/* 让内容区（含 sidebar）和页脚之间留一段距离 */
.main-wrapper {
  padding-bottom: 96px;   /* 你想空多大就改这里 */
  padding-top: 48px;
}

/* 如果你的 footer 自带上贴边，也可以额外加 */
.site-footer {
  margin-top: 0;
}



/* Drupal 常见容器：layout-container（classy/stable） */
.layout-container {
  max-width: var(--site-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}


.container {
  max-width: var(--site-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.layout-main {
  display: flex;
  gap: 40px;
}

.layout-content {
  flex: 1;
  min-width: 0;
}

.layout-sidebar {
  width: 320px;
}

.layout-sidebar .sidebar-inner{
  background: #eee;/* 你可以微调到更接近原站 */
  border-radius: 8px;
  padding: 22px;
}


.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.header-right{
  display:flex;
  align-items:center;
  gap: 22px;
}

.header-nav {
  margin-top: 2px;
}

.site-header {
  position: relative;
}

.header-background {
  position: absolute;
  inset: 0;
  background: url('../images/header_banner.jpg') no-repeat center;
  background-size: cover;
  opacity: 1;
  z-index: 0;
}

.header-inner {
  position: relative;
  z-index: 1;
}

/* ===== 窄屏：内容在上，sidebar 在内容下方、页脚上方 ===== */
@media (max-width: 850px) {

  /* 1) 让主区域变成一列 */
  .layout-main,
  .layout-main-wrapper,
  .main-wrapper .container {
    display: flex;
    flex-direction: column;
  }

  /* 2) 强制顺序：内容 -> sidebar */
  .layout-content,
  .main-content {
    order: 1;
  }

  /* 你的 sidebar 可能叫这些类，先都覆盖掉 */
  .layout-sidebar,
  .layout-sidebar-first,
  .layout-sidebar-second,
  .sidebar,
  aside[role="complementary"] {
    order: 2;
    margin-top: 24px;      /* 内容和 sidebar 之间空一段 */
  }

  /* 3) footer 自然在后面（如果 footer 在同一个 flex 容器里，确保它更后） */
  .site-footer,
  footer[role="contentinfo"] {
    order: 3;
    margin-top: 24px;      /* sidebar 和 footer 再空一段 */
  }
}




/* 每个折叠块 */
.tde-h2-collapsible {
  margin: 0 0 18px 0;
}

/* 标题按钮 */
.tde-h2-toggle {
  background: transparent !important;
  color: inherit !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;

  padding: 8px 0 !important;
  margin: 0 !important;

  font: inherit !important;
  text-transform: none !important;
  letter-spacing: normal !important;

  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}

/* 键盘可用性：给个焦点样式 */
main .tde-h2-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}


/* 标题文字 */
.tde-h2-title {
  font-weight: 700;
  font-size: 24px; /* 你可按原站调 */
  line-height: 1.15;
  flex: 1;
}

/* 右侧小三角 */
.tde-h2-icon::before {
  content: "\00A0\00A0\00A0\00A0▼";
  font-size: 14px;
  opacity: 0.7;
  margin-left: auto;
  
}

/* 展开时换图标 */
.tde-h2-collapsible.is-open .tde-h2-icon::before {
  content: "\00A0\00A0\00A0\00A0▲";
}

/* 内容区域 */
.tde-h2-content {
  display: none;
  padding: 6px 0 0 0;
}

.tde-h2-content.is-open {
  display: block;
}





/* 整个图片模块 */
article.media.media--type-image.media--view-mode-full {
  margin: 20px auto 30px;
  max-width: 900px;
}

/* 图片 */
article.media.media--type-image.media--view-mode-full img {
  display: block;
  width: 100%;
  height: auto;
}

/* 图注容器 */
.field--name-field-caption {
  margin-top: 0;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6em 0.9em;
  background: rgba(0,0,0,0.08);
  border-top: 1px solid #c8c8c8;
}

/* 图注文字 */
.field--name-field-caption .field__item {
  line-height: 1.4;
}

/* ====== 导航daohang按钮白底 ====== */

#block-tde-daohang .menu > li > a {

  background: #ffffff;
}

#block-tde-daohang .menu > li {
  margin-right: 2px;   /* 控制按钮之间的空隙 */
}

/* 所有子级菜单（2级及以下）每一项白底 */
#block-tde-daohang ul.menu ul.menu > li {
  background: #ffffff;
}

/* 让 a 填满整个区域 */
#block-tde-daohang ul.menu ul.menu > li > a,
#block-tde-daohang ul.menu ul.menu > li > span {
  display: block;
  padding: 10px 16px;
  background: #ffffff;
}
/* ====== 子菜单整体增加灰色阴影 ====== */

#block-tde-daohang ul.menu ul.menu {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border-radius: 4px;

  position: absolute;   /* 确保是浮层 */
  z-index: 9999;        /* 提升层级 */
}



/* 悬浮时轻微加深 */
#block-tde-daohang ul.menu ul.menu > li:hover {
  background: #f5f5f5;
}

/* header的logo会在屏幕缩窄时缩小 */

header #block-tde-site-branding .site-logo img {
  max-width: min(30vw, 335px);
}

/*header的主菜单会在屏幕缩窄时隐藏*/
@media (max-width: 850px) {
  #block-tde-main-menu {
    display: none;
  }
}

/*手册页的正文的p，首行缩进2em*/
.node--type-book .node__content p {
  text-indent: 2em;
}


/*不显示“由*** 编辑于 *****等字样”*/
.node__meta {
  display: none;
}

/*让输入框和“搜索”按钮不重叠*/
/* 搜索区块整体 */
.search-block-form #search-block-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* 输入框容器 */
.search-block-form .form-item-keys {
  flex: 1;
  margin: 0;
  min-width: 0;
}

/* 搜索输入框 */
.search-block-form #edit-keys {
  width: 100%;
  min-width: 160px;
  box-sizing: border-box;
}

/* 按钮容器 */
.search-block-form .form-actions {
  margin: 0;
  flex-shrink: 0;
}

/* 搜索按钮 */
.search-block-form #edit-submit {
  white-space: nowrap;
  box-sizing: border-box;
}


