/* ============================================================
 * old-blogs 公共头尾样式
 * ============================================================
 * 这个 CSS 文件通过 <link> 加载，在 VitePress 主题样式之前。
 * 使用 CSS 变量 --site-header-h 来统一控制布局偏移。
 * ============================================================
 */

:root {
  --Bg-Primary: #ffffff;
  --Bg-Primary70: rgba(255, 255, 255, 0.7);
  --Bg-Tertiary: #ffffff;
  --Separators-S1: rgba(0, 0, 0, 0.13);
  --Fills-F1: rgba(0, 0, 0, 0.03);
  --Fills-F1-hover: rgba(0, 0, 0, 0.06);
  --Fills-F1-active: rgba(0, 0, 0, 0.08);
  --Labels-Primary: rgba(0, 0, 0, 0.9);
  --Labels-Primary-hover: rgba(0, 0, 0, 0.903);
  --Labels-Primary-active: rgba(0, 0, 0, 0.905);
  --Labels-Secondary: rgba(0, 0, 0, 0.6);
  --Labels-Tertiary: rgba(0, 0, 0, 0.45);
  --Always-Black: #000000;
  --Always-White: #ffffff;
  --Colors-KMBlue: #1783ff;
  --Colors-KMBlue-hover: rgba(22, 127, 247, 1);
  --Colors-KMBlue-active: rgba(22, 124, 242, 1);
  /* header 默认高度，JS 会根据实际渲染更新 */
  --site-header-h: 65px;
}

/* ── 页面布局 ──────────────────────────────────────────── */
body {
  margin: 0;
  padding-top: var(--site-header-h);
}

/* ── #site-header（注入的全局 header）────────────────────── */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(6px);
  background-color: var(--Bg-Primary70);
}

#site-header.header-border {
  border-bottom: 0.5px solid var(--Separators-S1);
}

/* ── #app 层叠上下文 ──────────────────────────────────────
 * 让 #app 建立独立层叠上下文，内部 z-index 不会超过 header
 */
body #app {
  position: relative;
  z-index: 0;
}

body #app .k2-report {
  margin-top: calc(72px + var(--site-header-h));
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body #app .k2-report .research-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 0 72px;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

body #app .k2-report .research-hero.research-hero-compact {
  padding: 8px 0 32px;
}

body #app .k2-report .research-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

body #app .k2-report .research-breadcrumb {
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  gap: 6px;
  row-gap: 6px;
  font-family: 'PingFang SC', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 26px;
  color: var(--Labels-Tertiary);
}

body #app .k2-report .research-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

body #app .k2-report .research-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--Labels-Tertiary);
  text-decoration: none;
}

body #app .k2-report .research-breadcrumb a:hover {
  color: var(--Colors-KMBlue);
}

body #app .k2-report .research-breadcrumb-back {
  display: inline-flex;
  align-items: center;
  margin-right: 0;
  width: 16px;
  justify-content: center;
  font-size: 16px;
  line-height: 16px;
  color: var(--Labels-Tertiary);
}

/* ── 禁用 sticky（chat-compare / code-cli-container） ───────── */
body #app .chat-compare .nav,
body #app .chat-compare .panel-header-container,
body #app .code-cli-container .code-cli-terminal .header-container,
body #app .code-cli-container .terminal-header-container {
  position: static;
  top: auto;
}

#site-header .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1440px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media screen and (min-width: 768px) {
  #site-header .header-container {
    padding: 16px 48px;
  }
}

@media screen and (min-width: 1024px) {
  #site-header .header-container {
    padding: 16px 80px;
  }
}

#site-header .header-logo-link {
  display: block;
  height: 20px;
}

#site-header .header-logo {
  height: 20px;
  width: auto;
  display: block;
}

#site-header .header-center {
  flex: 1 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#site-header .header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

#site-header .header-nav-item {
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

#site-header .header-nav-item a {
  text-decoration: none;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--Labels-Secondary);
}

#site-header .header-nav-item:hover {
  background: var(--Fills-F1);
}

#site-header .header-nav-item:hover a {
  color: var(--Labels-Primary);
  font-weight: 500;
}

#site-header .header-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  background-color: var(--Labels-Primary);
  text-decoration: none;
  color: var(--Bg-Primary);
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

#site-header .header-button:hover {
  background-color: var(--Labels-Primary-hover);
}

#site-header .header-button:active {
  background-color: var(--Labels-Primary-active);
}

#site-header .features-nav-item,
#site-header .research-nav-item {
  position: relative;
}

#site-header .dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background-color: var(--Bg-Tertiary);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
  min-width: 280px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#site-header .header-nav-item:hover .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

#site-header .header-nav-item.is-open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

#site-header .research-menu {
  min-width: 260px;
}

#site-header .dropdown-menu-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}

#site-header .dropdown-menu-item:hover {
  background-color: var(--Fills-F1-hover);
}

#site-header .dropdown-menu-item:active {
  background-color: var(--Fills-F1-active);
}

#site-header .research-menu-item {
  padding: 10px 12px;
}

#site-header .dropdown-menu-item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 7.273px;
  background-color: var(--Fills-F1);
  display: flex;
  align-items: center;
  justify-content: center;
}

#site-header .icon-placeholder {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: var(--Always-Black);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#site-header .dropdown-menu-item-icon-img {
  width: 20px;
  height: 20px;
  display: block;
}

#site-header .dropdown-menu-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
}

#site-header .dropdown-menu-item-title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--Labels-Primary);
  margin-bottom: 0;
}

#site-header .dropdown-menu-item-description {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: var(--Labels-Secondary);
  margin-top: 2px;
}

@media screen and (max-width: 768px) {
  #site-header .header-center {
    display: none;
  }
}

.footer {
  background: #121212;
  width: 100%;
  margin-top: 100px;
  border-top: 0.5px solid var(--Separators-S1);
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 48px;
  display: flex;
  flex-direction: row;
  gap: 96px;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .footer-container {
    padding: 104px 80px;
  }
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 48px;
    padding: 48px 24px;
  }
}

.footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  flex-grow: 1;
}

.footer-logo {
  height: 32px;
  width: auto;
  display: block;
}

.footer-social {
  display: none;
  align-items: center;
  gap: 15px;
}

.footer-social.is-visible {
  display: flex;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  background-color: rgba(255, 255, 255, 0.15);
  text-decoration: none;
  transition: background-color 0.2s;
}

.social-link:hover {
  background-color: rgba(255, 255, 255, 0.3136);
}

.social-icon {
  width: 16px;
  height: 16px;
}

.footer-nav {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .footer-nav {
    gap: 32px;
  }
}

.footer-nav-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 130px;
}

.footer-nav-header {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: white;
  padding-bottom: 16px;
  margin: 0;
}

.footer-nav-link {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav-link:hover {
  color: white;
}

/* ── Markdown 段落左对齐 ───────────────────────────────── */
.markdown .paragraph,
.paragraph {
  text-align: left;
}
