/* 卫星页壳层 — 顶栏 .topbar / 底栏 .bottom-bar
 * SSOT: 用户/iching-shared/shell-chrome.css
 * sync-shared.sh → 主页/js、卜易/pages、八字/
 * 数值对齐 主页/css/styles.css .site-header / .bottom-nav
 */

:root {
  /* fallback（卫星页未加载 variables.css 时自给） */
  --bar-bg: #1a1410;
  --ink-3: #8a7a6a;
  --paper: #fdf8f0;
  --accent-2: #c67c3a;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;

  --shell-header-py: 1.25rem;
  --shell-header-px: 1.5rem;
  --shell-header-py-narrow: 1rem;
  --shell-header-px-narrow: 1rem;
  --shell-brand-size: 22px;
  --shell-brand-en-size: 0.78rem;
  --shell-brand-color: var(--ink-3);
  --shell-brand-gap: 0.75rem;
  --shell-brand-gap-stack: 0.2rem;
  --shell-bottom-clearance: 5.5rem;
  --shell-bottom-pad-y: 0.55rem;
  --shell-bottom-pad-x: 0.65rem;
  --shell-bottom-safe: max(1rem, env(safe-area-inset-bottom));
}

/* body 底部留白 — 对齐 bottom-nav clearance */
body,
body.paper-theme {
  padding-bottom: var(--shell-bottom-clearance);
}

/* ── 顶栏 — 外层镜像 .site-header（padding 驱动，无 flex 居中）── */
.topbar {
  position: relative;
  z-index: 3;
  background: var(--bar-bg);
  border-bottom: 1px solid rgba(201, 168, 76, 0.16);
  padding: var(--shell-header-py) var(--shell-header-px);
  flex-shrink: 0;
}

/* inner grid — 镜像 styles.css .site-header__inner */
.topbar .site-header__inner {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  width: 100%;
}

/* 品牌标题 — 须与 主页/css/styles.css L71–155 同步 */
.topbar .site-header__brand-group {
  display: flex;
  align-items: baseline;
  gap: var(--shell-brand-gap);
  min-width: 0;
}

.topbar .brand {
  color: var(--shell-brand-color);
  font-family: var(--font-display);
  font-size: var(--shell-brand-size);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.topbar .brand:hover {
  opacity: 0.9;
  text-decoration: none;
}

.topbar .site-header__en {
  font-family: var(--font-body);
  font-size: var(--shell-brand-en-size);
  font-weight: 300;
  color: var(--shell-brand-color);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .topbar {
    padding: var(--shell-header-py-narrow) var(--shell-header-px-narrow);
  }

  .topbar .site-header__inner {
    align-items: flex-start;
  }

  .topbar .site-header__brand-group {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--shell-brand-gap-stack);
  }

  .topbar .site-header__en {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--shell-brand-color);
  }
}

@media (max-width: 380px) {
  .topbar .brand {
    font-size: 1.05rem;
    letter-spacing: 0.06em;
  }

  .topbar .site-header__en {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
  }
}

/* ── 固定底栏（版权 + 法律链）── */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bar-bg);
  border-top: 1px solid rgba(201, 168, 76, 0.16);
  display: block;
  padding: var(--shell-bottom-pad-y) var(--shell-bottom-pad-x) var(--shell-bottom-safe);
  z-index: 10;
}

.bottom-note {
  color: var(--ink-3);
  font-size: 0.8rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-align: center;
}

.bottom-note a {
  color: var(--ink-3);
  text-decoration: none;
}

.bottom-note a:hover {
  color: var(--paper);
  text-decoration: none;
}

.bottom-legal {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.bottom-legal a {
  color: var(--ink-3);
  text-decoration: none;
  margin: 0 0.35rem;
}

.bottom-legal a:hover {
  color: var(--paper);
  text-decoration: none;
}
