@import url("/brand/palette.css?v=20261002-palette-1");

:root {
  --page-bg: var(--wx-bg);
  --panel-bg: var(--wx-panel);
  --panel-soft: var(--wx-soft);
  --text: var(--wx-text);
  --muted: var(--wx-muted);
  --blue: var(--wx-primary);
  --blue-hover: var(--wx-link);
  --border: var(--wx-line);
  --footer-border: var(--wx-line);
  --green: #008000;
  --focus: var(--wx-focus);
  --side-menu-active: var(--wx-hover);
  --floating-toolbar-right: max(14px, env(safe-area-inset-right));
  color-scheme: light;
}

/* 900px 正文居中；电脑端工具栏紧邻正文，按钮与正文间隔 16px。 */
@media (min-width: 1021px) {
  :root {
    --floating-toolbar-right: max(14px, env(safe-area-inset-right), calc(50% - 510px));
  }
}

html[data-theme="dark"] {
  --page-bg: var(--wx-bg);
  --panel-bg: var(--wx-panel);
  --panel-soft: var(--wx-soft);
  --text: var(--wx-text);
  --muted: var(--wx-muted);
  --blue: var(--wx-primary);
  --blue-hover: var(--wx-link);
  --border: var(--wx-line);
  --footer-border: var(--wx-line);
  --green: #72dc8a;
  --focus: var(--wx-focus);
  --side-menu-active: var(--wx-hover);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --page-bg: var(--wx-bg);
    --panel-bg: var(--wx-panel);
    --panel-soft: var(--wx-soft);
    --text: var(--wx-text);
    --muted: var(--wx-muted);
    --blue: var(--wx-primary);
    --blue-hover: var(--wx-link);
    --border: var(--wx-line);
    --footer-border: var(--wx-line);
    --green: #72dc8a;
    --focus: var(--wx-focus);
    --side-menu-active: var(--wx-hover);
    color-scheme: dark;
  }
}

html {
  min-width: 0;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#top.side-menu-anchor {
  display: block;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0;
  overflow: hidden;
}

#menue {
  scrollbar-width: thin;
  scrollbar-color: var(--blue) transparent;
}

#menue li.is-side-menu-active,
html[data-theme="dark"] #menue li.is-side-menu-active {
  background-color: var(--side-menu-active) !important;
}

#menue a.is-side-menu-active {
  color: #ffffff !important;
  text-decoration: none;
}

.meinv .class.is-side-menu-target-active,
html[data-theme="dark"] .meinv .class.is-side-menu-target-active {
  background-color: var(--side-menu-active) !important;
}

#header.is-side-menu-target-active #logo table {
  background-color: var(--side-menu-active) !important;
}

/* 栏目说明统一紧接标题左对齐；颜色由后台逐段设置。 */
.meinv .class.section-header {
  display: grid;
  grid-template-columns: 103px minmax(0, 1fr);
  align-items: stretch;
  height: auto;
  min-height: 37px;
  line-height: 1.5;
}
.meinv .class.section-header > strong:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  float: none;
  width: auto;
  height: auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.meinv .class.section-header .section-header__spacer { display: none; }
.meinv .class.section-header > .section-header__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding: 6px 8px;
  gap: 2px 12px;
  text-align: left;
}
.meinv .class.section-header .section-header__content > strong {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  float: none;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 !important;
  padding: 0;
  text-align: left;
  line-height: 1.5;
}
.meinv .class.section-header .section-header__content > a,
.meinv .class.section-header .section-header__content > span,
.meinv .class.section-header .section-header__content > strong a {
  min-width: 0;
  max-width: 100%;
  margin: 0 !important;
  line-height: 1.5 !important;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.meinv .class.section-header .section-header__content .section-header__item,
.meinv .class.section-header .section-header__content .section-header__item * {
  color: var(--section-text-color, #ffffff) !important;
}
.meinv .class.section-header .section-header__content .section-header__item {
  white-space: pre-wrap;
}

/* 夜间模式只替换颜色，不改变参考站的电脑端尺寸与排版。 */
html[data-theme="dark"] body {
  background: var(--page-bg) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] body div,
html[data-theme="dark"] body p,
html[data-theme="dark"] body li,
html[data-theme="dark"] body span,
html[data-theme="dark"] body td,
html[data-theme="dark"] body th,
html[data-theme="dark"] body h1,
html[data-theme="dark"] body h2,
html[data-theme="dark"] body h3 {
  color: var(--text);
}

html[data-theme="dark"] body a,
html[data-theme="dark"] body a:visited {
  color: var(--blue-hover);
}

html[data-theme="dark"] #logo table,
html[data-theme="dark"] .meinv .class,
html[data-theme="dark"] #menue li {
  background: var(--blue) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] #logo p,
html[data-theme="dark"] #logo strong,
html[data-theme="dark"] #logo span {
  background: transparent !important;
}

html[data-theme="dark"] #logo span,
html[data-theme="dark"] .meinv .class,
html[data-theme="dark"] .meinv .class * {
  color: #ffffff !important;
}

html[data-theme="dark"] .meinv .info {
  background: var(--panel-bg) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] #footer {
  border-color: var(--footer-border) !important;
}

html[data-theme="dark"] font[color="green"],
html[data-theme="dark"] font[color="#008000"] {
  color: var(--green) !important;
}

html[data-theme="dark"] font[color="#294461"],
html[data-theme="dark"] font[color="#333333"],
html[data-theme="dark"] font[color="#333"] {
  color: var(--text) !important;
}

.search-fallback {
  display: flex;
  align-items: stretch;
  width: 650px;
  height: 56px;
  margin: 17px 0 17px 25px;
  overflow: hidden;
  border: 1px solid #c9cfd2;
  border-radius: 3px;
  background: var(--panel-bg);
}

.search-fallback__icon {
  display: grid;
  width: 52px;
  place-items: center;
  color: var(--text);
  font-size: 24px;
}

.search-fallback input[type="search"] {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-fallback button {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
}

.search-fallback button:hover {
  filter: brightness(1.1);
}

body[data-page="link"] #footer {
  padding-bottom: 5px;
  font-family: "Times New Roman", serif;
}

.theme-toggle,
.back-to-top {
  position: fixed;
  z-index: 1000;
  box-sizing: border-box;
  display: grid;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  inline-size: 44px !important;
  block-size: 44px !important;
  flex: 0 0 44px;
  padding: 0 !important;
  margin: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.2);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

.theme-toggle svg,
.back-to-top svg {
  display: block;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  color: inherit;
  stroke: currentColor;
}

.theme-toggle {
  top: auto;
  right: var(--floating-toolbar-right);
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 52px);
  left: auto;
  transform: none;
}

.back-to-top {
  right: var(--floating-toolbar-right);
  bottom: max(14px, env(safe-area-inset-bottom));
  left: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.theme-toggle:focus-visible,
.back-to-top:focus-visible,
.search-fallback button:focus-visible,
.search-fallback input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}


/* 同一条导航只使用一套布局；所有文字在链接点击区域内上下居中。 */
.meinv .class.nav-bar {
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  height: auto !important;
  min-height: 37px;
  line-height: 1.4;
}
.meinv .class.nav-bar > strong {
  display: flex;
  flex: 0 0 111px;
  float: none;
  width: auto !important;
  min-width: 0;
  height: auto !important;
}
.meinv .class.nav-bar > .member-entry {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-left: auto;
  padding: 0 8px;
}
.meinv .class.nav-bar a {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 37px;
  padding: 0 9px;
  color: #fff !important;
  font: 13px/1.4 Arial, "Microsoft YaHei", sans-serif;
  white-space: nowrap;
}
.meinv .class.nav-bar a:visited {
  color: #fff !important;
}
.meinv .class.nav-bar > strong a {
  font-weight: 700;
}
.meinv .class.nav-bar > strong:first-child a {
  justify-content: flex-start;
  padding-left: 27px;
}
.meinv .class.nav-bar a font {
  font: inherit;
}
.meinv .class.nav-bar a:hover {
  background: rgba(0, 0, 0, .15);
  text-decoration: underline;
}
.meinv .class.nav-bar a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}


/* 共用配色、内容和导航；小屏通过换行与列数适配，不缩放整页。 */
body {
  margin: 0;
  padding: 6px max(8px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--page-bg);
}
#header, #logo, .meinv, .banner {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
#logo { margin-top: 0; }
#footer {
  box-sizing: border-box;
  width: 100%;
  max-width: 900px;
}
/* 任意尺寸的后台广告完整展示，不使用固定高度或裁剪。 */
.banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin-top: 7px;
  margin-bottom: 0;
}
.banner a { display: block; min-width: 0; line-height: 0; }
.banner img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
}
/* 电脑与手机共用同一列悬浮工具：栏目、夜间模式、返回顶部。 */
#menue {
  box-sizing: border-box;
  display: block;
  position: fixed;
  z-index: 999;
  top: auto;
  right: var(--floating-toolbar-right);
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 104px);
  left: auto;
  width: 43px;
  max-width: 43px;
  max-height: calc(100vh - max(14px, env(safe-area-inset-bottom)) - 116px);
  max-height: calc(100dvh - max(14px, env(safe-area-inset-bottom)) - 116px);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
}
#menue ul { display: block; }
#menue li {
  width: 43px;
  min-width: 0;
  line-height: 25px;
}
#menue a {
  display: block;
  min-height: 25px;
  padding: 0;
  color: #fff;
  font: 13px/25px Arial, "Microsoft YaHei", sans-serif;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1020px) {
  *, *::before, *::after { box-sizing: border-box; }
  body { min-width: 0; font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif; }
  #header, #logo { height: auto; min-height: 54px; }
  #logo table, #logo tbody, #logo tr { display: block; width: 100%; height: auto; }
  #logo table { border-collapse: collapse; background: var(--blue); }
  #logo tr {
    display: grid;
    grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
    align-items: center;
    min-height: 54px;
  }
  #logo td { display: block; min-width: 0; width: auto; padding: 0; }
  #logo a { float: none; width: 100%; height: auto; }
  #logo a img { display: block; width: 100%; max-width: 260px; height: auto; margin: auto; }
  #logo td:last-child { padding: 8px; }
  #logo p, #logo span { font-size: 12px !important; line-height: 1.5 !important; background: transparent !important; }
  #logo span { color: #fff !important; overflow-wrap: anywhere; }

  .meinv .class.nav-bar {
    display: grid;
    grid-template-columns: .7fr 1fr 1fr .9fr;
    /* Keep the member entry reachable beside the floating category menu. */
    padding-right: 60px;
  }
  .meinv .class.nav-bar > strong { width: auto; min-width: 0; }
  .meinv .class.nav-bar > .member-entry { display: contents; }
  .meinv .class.nav-bar a { min-height: 44px; padding: 4px 2px; font-size: 14px; white-space: normal; overflow-wrap: anywhere; text-align: center; }
  .meinv .class.nav-bar > strong:first-child a { justify-content: flex-start; padding-left: 8px; }

  .meinv .class.section-header {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: stretch;
    height: auto;
    min-height: 44px;
    line-height: 1.5;
  }
  .meinv .class.section-header > strong:first-child {
    display: flex;
    align-items: center;
    float: none;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 8px;
    justify-content: flex-start;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .meinv .class.section-header > strong:first-child a { color: #fff; font-size: 14px; line-height: 1.5; }
  .meinv .class.section-header .section-header__spacer { display: none; }
  .meinv .class.section-header > .section-header__content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    padding: 6px 8px;
    gap: 2px 6px;
  }
  .meinv .class.section-header .section-header__content > strong {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    float: none;
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 28px;
    margin: 0 !important;
    padding: 2px 0;
    text-align: left;
    line-height: 1.5;
  }
  .meinv .class.section-header .section-header__content > a,
  .meinv .class.section-header .section-header__content > span,
  .meinv .class.section-header .section-header__content > strong a {
    min-width: 0;
    max-width: 100%;
    margin: 0 !important;
    font-size: 13px;
    line-height: 1.5 !important;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .meinv .info { float: none; width: 100%; padding: 6px 8px; }
  .info > ul:not(.site-search-results) {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    float: none;
    width: 100%;
    gap: 0 6px;
  }
  .info > ul:not(.site-search-results) > li {
    float: none;
    width: auto;
    min-width: 0;
    padding: 0;
    overflow: visible;
    white-space: normal;
    line-height: 1.5;
  }
  .info > ul:not(.site-search-results) > li > a {
    display: flex;
    align-items: center;
    min-height: 26px;
    padding: 2px;
    font-size: 14px;
    line-height: 22px;
    overflow-wrap: anywhere;
  }
  #footer { padding: 8px; line-height: 1.7; overflow-wrap: anywhere; }
  #footer p { line-height: 1.7; }
}
@media (max-width: 699px) {
  .info > ul:not(.site-search-results) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .info > ul:not(.site-search-results) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .meinv .class.nav-bar a { font-size: 13px; }
  .info > ul:not(.site-search-results) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 319px) {
  .info > ul:not(.site-search-results) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Brand colors shared by desktop and mobile. */
body { color: var(--wx-text); }
body a { color: var(--wx-link); }
body a:hover { color: var(--wx-link-hover); }
.meinv .info { border-color:var(--wx-line);background:var(--wx-panel); }
#footer { border-color:var(--wx-line); }
#logo table { background:var(--wx-primary); }
#logo p, #logo span { background:transparent!important; }
#logo span { color:#fff!important; }
#logo p:first-child span { color:#ffdf9b!important; }
