/* ============================================================
   BBLACK · 绳缚作品集  —  Neo-Brutalism
   ============================================================ */

/* 自托管 Space Grotesk：latin 变量子集，单个 21.8KB 文件覆盖 300–700 字重。
   只含拉丁字形，中文自动回落到系统字体 —— 不再下载任何 CJK 网络字体。 */
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-var-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  /* 只保留拉丁 + 常用标点，避免中文去匹配这个字体 */
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0A0A0A;
  --fg: #F4F4F0;
  --accent: #C7F23D;       /* 霓虹绿 */
  --muted: #9A9A92;
  --line: #C7F23D;         /* 硬边框色 */
  --panel: #111111;
  --sidebar-w: 248px;

  /* 纯拉丁/数字场景（logo、编号、英文小标题） */
  --font-latin: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  /* 正文：拉丁走自托管字体，中文走系统字体栈，零网络开销 */
  --font-base: "Space Grotesk", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- 总布局：左栏 + 内容 ---------- */
.layout {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

/* ---------- 左侧导航 ---------- */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 2px solid var(--line);
  background: var(--bg);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  z-index: 20;
}

.brand { display: flex; flex-direction: column; gap: 6px; }
.brand-mark {
  font-family: var(--font-base);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 1px;
  color: var(--accent);
}
.brand-sub {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--muted);
  text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: block;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border: 2px solid transparent;
  color: var(--fg);
  transition: background .12s linear, color .12s linear, border-color .12s linear;
}
.nav-link:hover {
  border-color: var(--line);
  color: var(--accent);
}
.nav-link.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sf-safe {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: balance;
}

/* ---------- 主内容 ---------- */
.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0 80px;
}

/* Hero */
.hero {
  padding: 72px 56px 56px;
  border-bottom: 2px solid var(--line);
}
.hero-body {
  display: flex;
  align-items: center;
  gap: 56px;
  flex-wrap: wrap;
}
.hero-left {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero-eyebrow {
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0;
}
.hero-manifesto {
  font-family: var(--font-base);
  font-weight: 900;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.14;
  letter-spacing: -1px;
  margin: 0;
}
.hero-desc {
  max-width: 560px;
  font-size: 16px;
  line-height: 1.75;
  color: #D8D8D0;
  margin: 0;
}
.hero-meta {
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 4px 0 0;
  text-transform: uppercase;
}

/* ---------- 板块 ---------- */
.section {
  padding: 64px 56px 24px;
  scroll-margin-top: 24px;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 36px;
}
.section-title {
  font-family: var(--font-base);
  font-weight: 700;
  font-size: 30px;
  margin: 0;
  letter-spacing: 1px;
}
.section-en {
  font-family: var(--font-latin);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
}
.section-intro {
  max-width: 680px;
  color: #C9C9C0;
  margin: -12px 0 28px;
}

/* ---------- 知识文章 ---------- */
.articles { display: flex; flex-direction: column; gap: 48px; }
.article {
  border: 2px solid var(--line);
  padding: 28px 30px;
  background: var(--panel);
}
.article-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.article-no {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 14px;
  color: var(--bg);
  background: var(--accent);
  padding: 3px 9px;
  letter-spacing: 1px;
}
.article-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}
.article-body p { margin: 0 0 14px; }
.article-body strong { color: var(--accent); font-weight: 700; }
.article-note {
  font-size: 14px;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.article-img {
  display: block;
  width: 100%;
  max-width: 560px;
  margin-top: 18px;
  border: 2px solid var(--line);
}
.res-list { margin: 0 0 14px; padding-left: 20px; }
.res-list li { margin-bottom: 10px; }
.res-list a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.res-list a:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* ---------- 作品画廊 ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.g-item {
  margin: 0;
  border: 2px solid var(--line);
  background: var(--panel);
  transition: transform .12s linear;
}
.g-item:hover { transform: translate(-3px, -3px); }
.g-item img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-bottom: 2px solid var(--line);
  cursor: zoom-in;
  transition: opacity .28s ease;
}
.g-item figcaption {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--fg);
}

/* ---------- 画廊折叠：默认隐藏，点击「查看更多」才加载 ---------- */
.gallery > .is-more,
.contact-gallery > .is-more { display: none; }

.g-more {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--panel);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: background .12s linear, color .12s linear, transform .12s linear;
}
.g-more:hover {
  background: var(--accent);
  color: #0A0A0A;
  transform: translate(-3px, -3px);
}
.g-more:active { transform: translate(0, 0); }
.g-more[hidden] { display: none; }

.g-more-n {
  font-size: 11px;
  letter-spacing: 1px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  opacity: .75;
}

/* 展开后逐张淡入，避免「啪」地全部跳出来 */
.g-item img.is-fading,
.contact-gallery img.is-fading { opacity: 0; }

/* ---------- 绳缚知识（可折叠手风琴） ---------- */
.k-list { display: flex; flex-direction: column; gap: 12px; }
.k-item { border: 2px solid var(--line); background: var(--panel); }
.k-item-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}
.k-item-head:hover { background: rgba(199, 242, 61, .08); }
.k-item.open .k-item-head { background: var(--accent); color: var(--bg); }
.k-no {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 13px;
  color: var(--bg);
  background: var(--accent);
  padding: 3px 9px;
  letter-spacing: 1px;
  flex: 0 0 auto;
}
.k-item.open .k-no { background: var(--bg); color: var(--accent); }
.k-title { flex: 1 1 auto; }
.k-plus { font-size: 22px; line-height: 1; transition: transform .15s linear; }
.k-item.open .k-plus { transform: rotate(45deg); }

.k-content { display: none; border-top: 2px solid var(--line); }
.k-item.open .k-content { display: block; }
.k-content-inner { padding: 18px 20px 22px; }
.k-content-inner p { margin: 0 0 14px; }
.k-content-inner p:last-child { margin-bottom: 0; }
.k-content-inner strong { color: var(--accent); font-weight: 700; }
.k-content-inner .article-note {
  font-size: 14px;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.k-content-inner .article-img {
  display: block;
  width: 100%;
  max-width: 560px;
  margin-top: 18px;
  border: 2px solid var(--line);
}

/* ---------- 联系 / 客服微信 ---------- */
.contact-wechat { display: flex; flex-direction: column; gap: 16px; max-width: 340px; }
.wechat-label {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent);
}
.wechat-frame {
  border: 2px solid var(--line);
  background: var(--panel);
  line-height: 0;
  transition: transform .12s linear;
}
.wechat-frame:hover { transform: translate(-3px, -3px); }
.wechat-frame img { width: 100%; height: auto; display: block; }
.wechat-id { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wechat-id-key {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
}
.wechat-id-value {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--bg);
  background: var(--accent);
  border: 2px solid var(--accent);
  padding: 4px 14px;
  cursor: pointer;
  line-height: 1.2;
  transition: background .15s linear, color .15s linear, transform .12s linear;
}
.wechat-id-value:hover { background: var(--bg); color: var(--accent); }
.wechat-id-hint { font-size: 12.5px; color: var(--muted); }

.contact-disclaimer {
  max-width: 640px;
  margin: 0 0 28px;
  padding: 14px 18px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-left-width: 6px;
  color: #D8D8D0;
  font-size: 15px;
  line-height: 1.7;
}

.contact-gallery {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-width: 760px;
}
.contact-gallery img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  border: 2px solid var(--line);
  background: var(--panel);
  cursor: zoom-in;
  transition: transform .12s linear, opacity .28s ease;
}
.contact-gallery img:hover { transform: translate(-2px, -2px); }

/* ---------- 留言板 ---------- */
.gb-intro {
  max-width: 680px;
  margin: 0 0 26px;
  font-size: 15px;
  color: #D8D8D0;
}
.gb-form { max-width: 680px; }
.gb-field { margin-bottom: 20px; }
.gb-input--name { max-width: 320px; }
.gb-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.gb-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  background: var(--panel);
  color: var(--fg);
  border: 2px solid #2A2A2A;
  border-radius: 0;
  font: inherit;
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.15s;
}
.gb-textarea:focus { outline: none; border-color: var(--accent); }
.gb-textarea::placeholder { color: #67675F; }

.gb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}
.gb-count {
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.gb-btn {
  padding: 11px 26px;
  background: var(--accent);
  color: #0A0A0A;
  border: 2px solid var(--accent);
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.gb-btn:hover:not(:disabled) { background: transparent; color: var(--accent); }
.gb-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gb-btn--ghost { background: transparent; color: var(--accent); }
.gb-btn--ghost:hover:not(:disabled) { background: var(--accent); color: #0A0A0A; }
.gb-btn--sm { padding: 7px 14px; font-size: 12.5px; }

/* 蜜罐：真人不可见，机器人会填 */
.gb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gb-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.gb-status.is-ok { color: var(--accent); }
.gb-status.is-err { color: #FF6B5A; }

.gb-admin {
  max-width: 680px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #222;
}
.gb-admin-toggle {
  padding: 4px 0;
  background: none;
  border: 0;
  color: #55554F;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
}
.gb-admin-toggle:hover { color: var(--accent); }
.gb-admin-panel { margin-top: 16px; }

.gb-login { display: flex; gap: 10px; max-width: 430px; }
.gb-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: var(--panel);
  border: 2px solid #2A2A2A;
  border-radius: 0;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}
.gb-input:focus { outline: none; border-color: var(--accent); }

.gb-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
}
.gb-total {
  margin-right: auto;
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--muted);
}
.gb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}
.gb-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--panel);
  border: 2px solid #232323;
}
.gb-item-body { flex: 1; min-width: 0; }
.gb-item-name {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.gb-item-text {
  margin: 0 0 8px;
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.gb-item-time {
  font-size: 11.5px;
  letter-spacing: 1px;
  color: #67675F;
}
.gb-del {
  flex: 0 0 auto;
  padding: 5px 10px;
  background: none;
  border: 1px solid #3A3A3A;
  color: #8A8A82;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.gb-del:hover { border-color: #FF6B5A; color: #FF6B5A; }
.gb-empty { padding: 18px 0; font-size: 13.5px; color: var(--muted); }

/* ---------- 内容管理（上传照片 / 知识） ---------- */
.cm {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #222;
}

.cm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #232323;
}
.cm-tab {
  padding: 10px 18px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: #6E6E66;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: color 0.12s linear, border-color 0.12s linear;
}
.cm-tab:hover { color: var(--fg); }
.cm-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.cm-pane { padding-top: 22px; }

.cm-field { margin-bottom: 18px; }
.cm-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.cm-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #6E6E66;
}

.cm-select {
  width: 100%;
  max-width: 460px;
  padding: 10px 12px;
  background: var(--panel);
  border: 2px solid #2A2A2A;
  border-radius: 0;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.cm-select:focus { outline: none; border-color: var(--accent); }

/* .gb-input 原本是给横向 flex 表单用的（flex:1），这里在纵向里得自己定宽 */
.cm-field .gb-input {
  flex: none;
  display: block;
  width: 100%;
  max-width: 460px;
}

/* 文件选择：把原生 input 藏起来，用标签自己画 */
.cm-file {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  cursor: pointer;
}
.cm-file-btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 2px solid var(--line);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: background 0.12s linear, color 0.12s linear;
}
.cm-file:hover .cm-file-btn { background: var(--accent); color: #0A0A0A; }
.cm-file input:focus-visible + .cm-file-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.cm-actions { display: flex; gap: 10px; margin-top: 4px; }

.cm-textarea { width: 100%; min-height: 180px; }

.cm-sub {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #232323;
}
.cm-sub-title {
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg);
}
.cm-sub-meta { margin-left: auto; font-size: 11.5px; letter-spacing: 1px; color: #67675F; }

/* 已上传照片：缩略图网格 */
.cm-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.cm-photo { position: relative; border: 2px solid #232323; background: var(--panel); }
.cm-photo img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  filter: grayscale(0.35);
}
.cm-photo:hover img { filter: none; }
.cm-photo-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: #67675F;
}
.cm-photo-tag {
  padding: 1px 5px;
  border: 1px solid #3A3A3A;
  color: var(--muted);
}
.cm-photo-del {
  margin-left: auto;
  padding: 1px 6px;
  background: none;
  border: 1px solid #3A3A3A;
  color: #8A8A82;
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
.cm-photo-del:hover:not(:disabled) { border-color: #FF6B5A; color: #FF6B5A; }
.cm-photo-del:disabled { opacity: 0.4; cursor: not-allowed; }

/* 已上传知识条目 */
.cm-articles { display: flex; flex-direction: column; gap: 8px; }
.cm-art {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 14px;
  background: var(--panel);
  border: 2px solid #232323;
}
.cm-art-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  color: var(--fg);
}
.cm-art-time { flex: 0 0 auto; font-size: 11px; letter-spacing: 1px; color: #67675F; }

.cm-empty { padding: 10px 0; font-size: 13px; color: var(--muted); }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 64px;
  padding: 32px 56px;
  border-top: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logo {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
}
.footer-copy { font-size: 12.5px; color: var(--muted); letter-spacing: 1px; }

/* ---------- 浏览量 ---------- */
.view-counter {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 56px 40px;
  font-family: var(--font-latin);
}
.vc-label {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.vc-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, .94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border: 2px solid var(--accent);
}
.lightbox-close {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 46px;
  height: 46px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: var(--fg); }

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .15s linear, transform .15s linear, visibility .15s;
  z-index: 60;
}
.to-top:hover { background: var(--bg); color: var(--accent); }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- 移动端菜单按钮（默认隐藏） ---------- */
.menu-toggle { display: none; }

/* ---------- 响应式：窄屏把左栏移到底部/顶部 ---------- */
@media (max-width: 860px) {
  /* 竖排时桌面端的 align-items:flex-start 会让 .content 按内容撑宽，
     在手机上导致整页横向溢出（可左右拖动），这里必须重置 */
  .layout { flex-direction: column; align-items: stretch; }
  .sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
    height: auto;
    border-right: none;
    border-bottom: 2px solid var(--line);
    padding: 22px 20px;
    gap: 22px;
  }
  .sidebar-foot { margin-top: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .nav-link { padding: 9px 14px; }
  .hero { padding: 48px 22px 36px; }
  .hero-body { flex-direction: column; align-items: flex-start; gap: 32px; }
  .section { padding: 44px 22px 16px; }
  .footer { padding: 28px 22px; }
  .contact-gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .contact-gallery img { height: 130px; }
  .view-counter { padding: 16px 22px 32px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .g-item img { height: 180px; }
  .article { padding: 22px 20px; }
}
