/* ==========================================================
   博学屋 · 全站导航与页脚（chrome）
   只负责：顶栏 / 移动顶栏 / 移动底栏 / 页脚。
   不改正文样式，类名统一 bwc-*，避免和 style.css / v4.css 冲突。
   ========================================================== */

:root {
  --bwc-page: #F7F4EC;
  --bwc-paper: #FFFEFB;
  --bwc-paper2: #F1EDE2;
  --bwc-ink: #181613;
  --bwc-ink2: #3E3A33;
  --bwc-muted: #6B6558;   /* AA：原 #8A8375 只有 3.4:1 */
  --bwc-line: #DED7C7;
  --bwc-line2: #EDE7D9;
  --bwc-brand: #1F3D33;
  --bwc-brand2: #2C5647;
  --bwc-danger: #A32E22;
  --bwc-serif: "Songti SC", "STSong", "SimSun", "Source Han Serif SC", "Noto Serif CJK SC", Georgia, serif;
  --bwc-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
}

/* 全站辅助文字统一加深一档（AA 修复，只影响颜色，不改字号行高） */
:root { --muted: #6B6558; }

/* ---------------- 桌面顶栏 ---------------- */
.bwc-top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247, 244, 236, .96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bwc-line);
}
.bwc-topin {
  max-width: 1120px; margin: 0 auto; padding: 0 22px; height: 60px;
  display: flex; align-items: center; gap: 34px; box-sizing: border-box;
}
.bwc-logo {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--bwc-serif); font-size: 22px; font-weight: 600;
  letter-spacing: .08em; color: var(--bwc-ink); text-decoration: none; flex: 0 0 auto;
}
.bwc-logo:hover { color: var(--bwc-ink); }
.bwc-nav { display: flex; align-items: stretch; gap: 26px; flex: 1; height: 60px; min-width: 0; }
.bwc-nav a {
  display: flex; align-items: center; gap: 5px; height: 60px;
  font-family: var(--bwc-sans); font-size: 16px; line-height: 1;
  color: var(--bwc-ink); text-decoration: none;
  border-bottom: 2px solid transparent; box-sizing: border-box; white-space: nowrap;
}
.bwc-nav a:hover { color: var(--bwc-brand); }
.bwc-nav a.on { font-weight: 600; border-bottom-color: var(--bwc-brand); }
.bwc-badge {
  font-family: var(--bwc-sans); font-style: normal; font-size: 12px;
  font-weight: 600; color: var(--bwc-danger);
}
.bwc-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.bwc-tools a {
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; color: var(--bwc-ink); text-decoration: none;
}
.bwc-tools a:hover { color: var(--bwc-brand); }
.bwc-tools .bwc-user { font-size: 14px; color: var(--bwc-muted); padding: 0 6px; min-width: 0; }
.bwc-tools .bwc-user.on { color: var(--bwc-ink); }

/* ---------------- 移动顶栏 / 底栏 ---------------- */
.bwc-mhead { display: none; }
.bwc-mnav { display: none; }

/* ---------------- 页脚 ---------------- */
.bwc-foot {
  margin-top: 64px; background: var(--bwc-paper2);
  border-top: 1px solid var(--bwc-line); font-family: var(--bwc-sans);
}
.bwc-footin {
  max-width: 1120px; margin: 0 auto; padding: 40px 22px 26px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px 36px;
  box-sizing: border-box;
}
.bwc-fbrand .bwc-logo { font-size: 20px; }
.bwc-fbrand p { margin: 10px 0 0; font-size: 14px; color: var(--bwc-muted); line-height: 1.9; }
.bwc-fkf { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.bwc-fkf img { width: 84px; height: 84px; background: #fff; border: 1px solid var(--bwc-line); display: block; }
.bwc-fkf span { font-size: 12px; color: var(--bwc-muted); line-height: 1.9; }
.bwc-fcol h2 {
  font-size: 12px; font-weight: 500; letter-spacing: .12em; color: var(--bwc-muted);
  margin: 2px 0 12px; font-family: var(--bwc-sans);
}
.bwc-fcol a { display: block; font-size: 14px; color: var(--bwc-ink2); line-height: 1.7; padding: 5px 0; text-decoration: none; }
.bwc-fcol a:hover { color: var(--bwc-brand); }
.bwc-fbot {
  max-width: 1120px; margin: 0 auto; padding: 14px 22px 0;
  border-top: 1px solid var(--bwc-line);
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between;
  font-size: 12px; color: var(--bwc-muted); box-sizing: border-box;
}
.bwc-fbot span { line-height: 1.9; }

/* ---------------- 老页面：内容版心是 980，导航/页脚跟着 980 对齐 ---------------- */
.bwc-old .bwc-topin, .bwc-old .bwc-footin, .bwc-old .bwc-fbot { max-width: 980px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .bwc-footin { grid-template-columns: 1fr 1fr; gap: 26px 24px; padding: 32px 22px 22px; }
  .bwc-fbrand { grid-column: 1 / -1; }
  .bwc-fcol:last-child { grid-column: 1 / -1; }
  .bwc-fcol:last-child a { display: inline-block; width: 49%; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .bwc-top { display: none; }
  .bwc-mhead {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 8px 0 16px; box-sizing: border-box;
    background: var(--bwc-page); border-bottom: 1px solid var(--bwc-line);
    position: sticky; top: 0; z-index: 60;
  }
  .bwc-mhead .bwc-logo { font-size: 20px; }
  .bwc-mhead .bwc-mtools { display: flex; align-items: center; }
  .bwc-mhead .bwc-mtools a {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; color: var(--bwc-ink);
  }
  .bwc-mnav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--bwc-paper); border-top: 1px solid var(--bwc-line);
    padding-bottom: env(safe-area-inset-bottom);
    margin: 0; list-style: none;
  }
  .bwc-mnav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; height: 60px; font-size: 12px; color: var(--bwc-muted);
    text-decoration: none; line-height: 1;
  }
  .bwc-mnav a.on { color: var(--bwc-brand); font-weight: 600; }
  .bwc-mnav svg { width: 22px; height: 22px; }
  .bwc-mnav i { position: relative; display: flex; font-style: normal; }
  .bwc-mnav em {
    position: absolute; top: -4px; right: -8px; font-style: normal;
    font-size: 12px; line-height: 16px; min-width: 16px; text-align: center;
    color: #fff; background: var(--bwc-danger); border-radius: 8px; padding: 0 3px;
  }
  .bwc-foot { margin-top: 40px; }
  .bwc-footin { padding: 26px 14px 20px; }
  .bwc-fbot { padding: 12px 14px 0; }
}
@media (max-width: 460px) {
  .bwc-footin { grid-template-columns: 1fr 1fr; gap: 22px 16px; padding: 24px 14px 18px; }
  .bwc-fcol a { font-size: 13px; }
}
