/* 全站顶栏 · 标题居中 + 导航与正文左对齐同宽 */

html {
  scrollbar-gutter: stable;
  margin: 0;
  padding: 0;
}

:root {
  --site-nav-blue: #1881eb;
  --site-nav-blue-dark: #1577d2;
  --site-nav-active: #d6183b;
  --site-nav-active-dark: #b81232;
  --site-nav-h: 44px;
  /* 非 shell 旧页 fallback；shell 页以 .site-layout--shell 底线变量为准 */
  --site-page-max: 1080px;
  --site-page-gutter: 16px;
}

/* 已废弃：宽版不再加宽，数值见 site-layout-baseline.js */
.site-layout--wide {
  --site-page-gutter: 16px;
}

.site-page-shell {
  width: 100%;
  max-width: var(--site-page-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-page-gutter);
  padding-right: var(--site-page-gutter);
  box-sizing: border-box;
}

/* 标题区：灰底限宽，与导航、正文同列 */
.site-hero {
  text-align: center;
  padding: 16px 0 0;
  background: #fff;
}

.site-hero-panel {
  background: linear-gradient(160deg, #eef2ff 0%, #f4f6fa 45%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 20px 16px 16px;
}

.site-layout--wide .site-hero-panel {
  padding: 24px 28px 20px;
}

.site-hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3.6vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.site-hero-sub {
  margin: 0 auto;
  color: #64748b;
  font-size: clamp(0.88rem, 2vw, 1rem);
  line-height: 1.6;
  max-width: 42em;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.site-hero .disclaimer {
  margin: 10px auto 0;
  max-width: 42em;
  text-align: left;
}

/* 导航：与 .site-page-shell 同宽，Tab 左对齐 */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-bottom: 10px;
  background: #fff;
  margin-top: 0;
}

.site-nav-shell {
  width: 100%;
  background: linear-gradient(180deg, var(--site-nav-blue) 0%, var(--site-nav-blue-dark) 100%);
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-top: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.site-nav-inner {
  display: flex;
  align-items: stretch;
  min-height: var(--site-nav-h);
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  padding: 0 16px 0 18px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.site-nav-brand:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.site-nav-tabs {
  display: flex;
  flex: 1;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav-tabs::-webkit-scrollbar {
  display: none;
}

.site-nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(14px, 2.8vw, 28px);
  color: #fff;
  font-size: clamp(0.84rem, 2vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  background: transparent;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.site-nav-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.1);
}

.site-nav-tab.is-active {
  background: linear-gradient(180deg, var(--site-nav-active) 0%, var(--site-nav-active-dark) 100%);
  z-index: 2;
}

.site-nav-tab.is-active::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 0;
  width: 20px;
  height: 100%;
  background: var(--site-nav-active-dark);
  transform: skewX(-24deg);
  z-index: -1;
}

.site-nav-tab.is-active + .site-nav-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: rgba(255, 255, 255, 0.88);
  transform: skewX(-24deg);
  z-index: 3;
}

.site-nav-util {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.site-nav-util:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.site-nav-util.is-active {
  color: #fff;
  font-weight: 600;
}

/* 宽版子页正文与顶栏同 gutter */
.site-layout--wide .container,
.site-layout--wide .wrap,
.site-layout--wide .portal {
  max-width: var(--site-page-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-page-gutter);
  padding-right: var(--site-page-gutter);
  box-sizing: border-box;
}

.site-layout--wide .container,
.site-layout--wide .wrap {
  padding-top: var(--site-page-gutter);
  padding-bottom: var(--site-page-gutter);
}

@media (max-width: 640px) {
  :root {
    --site-page-gutter: 12px;
  }

  .site-nav-brand {
    display: none;
  }

  .site-nav-tab {
    padding: 0 14px;
  }

  .site-nav-util {
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .site-hero {
    padding: 18px 0 14px;
  }
}

/* ── 全站左·中两栏底线────────────────
 * 左 168 + 中自适应 = 最大 1200px
 * 数值源：web/site-layout-baseline.js · 模块 CSS 勿覆写、勿 display:none 侧栏
 * ──────────────────────────────────────────────────────────── */

.site-layout--shell {
  --site-sidebar-w: 0;
  --site-page-max: 1200px;
  --site-page-gutter: 16px;
  --site-topbar-h: 56px;
  --site-topbar-bg: #1881eb;
  --site-shell-bg: #eef1f5;
  min-height: 100vh;
}

body.site-layout.site-layout--shell {
  margin: 0;
  padding: 0;
  background: var(--site-shell-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 16px;
}

body.site-layout.site-layout--shell *,
body.site-layout.site-layout--shell *::before,
body.site-layout.site-layout--shell *::after {
  box-sizing: border-box;
}

body.site-layout.site-layout--shell .site-body-wrap {
  flex: 1 0 auto;
  margin: 0;
  padding: 0;
}

.site-topbar,
#siteTopbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: var(--site-topbar-h);
  min-height: var(--site-topbar-h);
  max-height: var(--site-topbar-h);
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  overflow: visible;
  background: var(--site-topbar-bg);
  box-shadow: none;
}

.site-topbar-inner {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  max-width: var(--site-page-max);
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* ── 顶栏内嵌导航 tab ── */
.site-topbar-tabs {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: 8px;
}
.site-topbar-tabs::-webkit-scrollbar { display: none; }

.site-topbar-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(12px, 2.4vw, 24px);
  color: rgba(255,255,255,.88);
  font-size: clamp(.82rem, 1.8vw, .92rem);
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  background: transparent;
  transition: background .15s ease;
  flex-shrink: 0;
}
.site-topbar-tab:hover:not(.is-active) {
  background: rgba(255,255,255,.1);
}
.site-topbar-tab.is-active {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-weight: 800;
}

.site-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  padding-left: 16px;
  line-height: 1;
}

.site-topbar-logo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  color: #1881eb;
  font-size: 1.1rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: -0.02em;
}

.site-topbar-brand:hover {
  color: rgba(255, 255, 255, 0.94);
}

.site-topbar-spacer {
  flex: 0;
}

/* 全站顶栏股票搜索（雪球式：右对齐圆角白底） */
.site-topbar-inner--jishu {
  padding-right: 16px;
}

.site-topbar-search-wrap {
  flex: 0 0 auto;
  width: 260px;
  max-width: 260px;
  margin: 0 16px 0 0;
}

.site-topbar-search {
  width: 100%;
}

.site-topbar-search-combobox {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 10px 0 16px;
  background: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: none;
}

.site-topbar-search-combobox:focus-within {
  box-shadow: none;
}

.site-topbar-search-combobox input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  outline: none !important;
  font-size: 0.9rem;
  line-height: 1.2;
  color: #333;
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.site-topbar-search-combobox input[type="search"]:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.site-topbar-search-combobox input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.site-topbar-search-combobox input[type="search"]::placeholder {
  color: #aaa;
  font-size: 0.92rem;
}

.site-topbar-search-go {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 -4px 0 4px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-topbar-search-go:hover {
  color: #666;
  background: rgba(0, 0, 0, 0.04);
}

.site-topbar-search-go svg {
  display: block;
  width: 17px;
  height: 17px;
}

.site-topbar-search-dropdown.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 1200;
  max-height: 380px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  background: #fff;
}

.site-topbar-search-dropdown .search-dropdown__head {
  padding: 8px 14px 6px;
  font-size: 0.75rem;
  color: #94a3b8;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.site-topbar-search-dropdown .search-dropdown__item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  border: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.4;
}

.site-topbar-search-dropdown .search-dropdown__item:hover,
.site-topbar-search-dropdown .search-dropdown__item.selected {
  background: #f0f7ff;
  color: #1881eb;
}

.site-topbar-search-dropdown .search-dropdown__item:last-child {
  border-bottom: none;
}

.site-topbar-search-dropdown .search-dropdown__item .match {
  color: #ea580c;
  font-style: normal;
  font-weight: 600;
}

.site-topbar-search-dropdown .search-dropdown__code {
  color: #94a3b8;
}

.site-topbar-search-dropdown .search-dropdown__empty {
  padding: 14px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.site-topbar-user-slot {
  position: relative;
  flex-shrink: 0;
  margin-right: 20px;
  z-index: 2;
}

.site-topbar-user-wrap {
  position: relative;
}

.site-topbar-user {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: opacity 0.15s ease;
}

.site-topbar-user--trigger {
  cursor: default;
}

.site-topbar-user-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 10px;
  background: transparent;
  z-index: 1200;
}

.site-topbar-user-menu-panel {
  position: relative;
  min-width: 128px;
  padding: 4px 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
}

.site-topbar-user-menu-panel::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(15, 23, 42, 0.04);
}

.site-topbar-user-wrap:hover .site-topbar-user-menu,
.site-topbar-user-wrap:focus-within .site-topbar-user-menu {
  display: block;
}

.site-topbar-user-menu-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 18px;
  border: none;
  background: none;
  color: #0f172a;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.site-topbar-user-menu-item:hover,
.site-topbar-user-menu-item:focus {
  background: #f1f5f9;
  color: #0f172a;
  outline: none;
}

.site-topbar-user-menu-item--logout {
  font-family: inherit;
}

.site-topbar-user:hover,
.site-topbar-user:focus,
.site-topbar-user:active,
.site-topbar-user:visited {
  color: #fff;
  text-decoration: none;
}

.site-topbar-user:hover {
  opacity: 0.82;
}

.site-topbar-maintain {
  display: inline-flex;
  align-items: center;
  margin-right: 20px;
  padding: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: opacity 0.15s ease;
}

.site-topbar-maintain:hover {
  color: #fff;
  opacity: 0.82;
}

.site-topbar-maintain.is-active {
  font-weight: 600;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-body-wrap {
  width: 100%;
  background: var(--site-shell-bg);
  min-height: calc(100vh - var(--site-topbar-h));
}

.site-app-shell {
  display: flex;
  align-items: stretch;
  max-width: var(--site-page-max);
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - var(--site-topbar-h));
  box-sizing: border-box;
  background: var(--site-shell-bg);
}

.site-sidebar {
  display: none !important;
}

/* 维护页保留侧栏（模块导航） */
.site-sidebar[data-active="maintain"] {
  display: block !important;
  flex: 0 0 var(--site-sidebar-w);
  width: var(--site-sidebar-w);
  background: #fff;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  position: sticky;
  top: var(--site-topbar-h);
  align-self: flex-start;
  max-height: calc(100vh - var(--site-topbar-h));
  overflow-y: auto;
  padding: 8px 0 16px;
}

.site-sidebar-nav {
  display: flex;
  flex-direction: column;
}

.site-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  color: #334155;
  text-decoration: none;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: background 0.12s ease, color 0.12s ease;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.site-sidebar-link--back {
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.site-sidebar-nav--maintain .site-sidebar-link--maintain + .site-sidebar-link--maintain {
  margin-top: 0;
}

.site-sidebar-link:hover {
  background: rgba(6, 104, 184, 0.06);
  color: var(--site-nav-blue);
}

.site-sidebar-link.is-active {
  color: var(--site-nav-blue);
  background: rgba(6, 104, 184, 0.1);
  border-left-color: var(--site-nav-blue);
  font-weight: 600;
}

.site-sidebar-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #64748b;
  background: transparent;
  border-radius: 6px;
}

.site-sidebar-link.is-active .site-sidebar-icon {
  background: rgba(37, 99, 235, 0.1);
}

.site-main {
  flex: 1;
  min-width: 0;
  padding: 16px 16px 28px;
  box-sizing: border-box;
  background: var(--site-shell-bg);
}

.site-layout--shell .site-main .wrap,
.site-layout--shell .site-main .portal,
.site-layout--shell .site-main .container {
  max-width: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.page-head {
  margin-bottom: 14px;
}

.page-head-title {
  margin: 0 0 6px;
  font-size: 1.32rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.page-head-sub {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.page-head .disclaimer {
  margin-top: 8px;
  font-size: 0.78rem;
}

.site-layout--shell .page-head {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 8px;
  padding: 16px 20px;
}

.site-layout--shell .page-head.portal-hero {
  text-align: left;
}

.site-layout--shell .page-head .portal-hero-badges {
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .site-layout--shell {
    --site-sidebar-w: 0;
  }

  .site-topbar-brand {
    font-size: 0.95rem;
    gap: 8px;
  }

  .site-topbar-logo {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .site-topbar-user-slot {
    margin-right: 14px;
  }

  .site-topbar-user {
    font-size: 0.9rem;
  }

  .site-topbar-tab {
    padding: 0 12px;
    font-size: .8rem;
  }

  .site-topbar-brand {
    padding-left: 10px;
  }
}

/* —— 全站页脚（雪球式居中说明） —— */

.site-footer {
  flex-shrink: 0;
  width: 100%;
  background: #f5f6f8;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.site-footer-inner {
  max-width: var(--site-page-max);
  margin: 0 auto;
  padding: 22px 16px 28px;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.85;
  color: #8a9199;
}

.site-footer-links {
  margin: 0 0 8px;
}

.site-footer-links a {
  color: #4d7599;
  text-decoration: none;
}

.site-footer-links a:hover {
  text-decoration: underline;
}

.site-footer-links span {
  margin: 0 8px;
  color: #c0c4cc;
}

.site-footer-status {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: #64748b;
}

.site-footer-status--warn {
  color: #b45309;
}

.site-footer-status--error {
  color: #b91c1c;
}

.site-footer-disclaimer {
  margin: 0 0 6px;
}

.site-footer-copy {
  margin: 0;
  color: #9ca3af;
}

/* ── 维护页水平模块导航 ── */
.maintain-subnav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.maintain-subnav::-webkit-scrollbar { display: none; }
.maintain-subnav-back {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--site-nav-blue);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 4px;
}
.maintain-subnav-back:hover { background: rgba(6,104,184,.06); }
.maintain-subnav-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 500;
  color: #475569;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.maintain-subnav-btn:hover { background: rgba(6,104,184,.05); color: var(--site-nav-blue); }
.maintain-subnav-btn.is-active {
  background: var(--site-nav-blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(37,99,235,.25);
}
