/* =============================================================================
 *  02-layout.css — 页面骨架：头部 / 导航 / 主栅格 / 侧栏 / 页脚
 * ========================================================================== */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ------------------------------------------------------------------ 顶部导航 */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 14px;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  box-shadow: var(--shadow-s);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

.nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; }
.nav-link {
  padding: 8px 11px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  color: var(--ink-2); white-space: nowrap;
}
.nav-link:hover { background: var(--paper-3); text-decoration: none; color: var(--ink); }
.nav-link.is-active { background: var(--accent); color: #fff; }
.nav-more { position: relative; }
.nav-more-menu {
  display: none; position: absolute; inset-inline-end: 0; top: 100%;
  min-width: 210px; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; z-index: 70;
}
.nav-more.open .nav-more-menu { display: block; }
.nav-more-menu a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; color: var(--ink-2); }
.nav-more-menu a:hover { background: var(--paper-3); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }

/* 语言选择下拉 */
.lang-select {
  position: relative;
}
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2);
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.lang-btn:hover { background: var(--paper-3); }
.lang-panel {
  display: none; position: absolute; inset-inline-end: 0; top: calc(100% + 6px);
  width: 260px; max-height: 62vh; overflow: auto;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-l); padding: 8px; z-index: 80;
}
.lang-select.open .lang-panel { display: block; }
.lang-search {
  width: 100%; height: 34px; padding: 0 10px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  color: var(--ink); font-family: inherit; font-size: 14px;
}
.lang-item {
  display: flex; justify-content: space-between; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  font-size: 14px; color: var(--ink-2); cursor: pointer; text-align: start;
  font-family: inherit;
}
.lang-item:hover { background: var(--paper-3); }
.lang-item.is-current { color: var(--accent-2); font-weight: 700; }
.lang-item small { color: var(--muted); }
.lang-item > span { display: inline-flex; align-items: center; gap: 6px; }
/* 正文尚未翻译的语种：一个低调的 EN 角标 */
.lang-tag {
  font-style: normal; font-size: 10px; line-height: 1.6; letter-spacing: .02em;
  padding: 0 6px; border-radius: 999px; white-space: nowrap;
  background: var(--paper-3); color: var(--muted); border: 1px solid var(--line);
}

/* 移动端汉堡 */
.menu-toggle { display: none; }

/* -------------------------------------------------------------------- 主体栅格 */
.page { padding-block: 26px 60px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
}
.layout.has-side { grid-template-columns: minmax(0, 1fr) 300px; }

.article { min-width: 0; }
.article > .text-col { max-width: var(--maxw-text); }

.sidebar { display: none; }
.layout.has-side .sidebar { display: block; }
.side-sticky { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px; }

/* -------------------------------------------------------------------- 页脚 */
.site-footer {
  margin-top: 50px; padding-block: 40px 30px;
  background: var(--paper-3); border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.footer-title { font-family: var(--font-display); font-size: 15px; margin-bottom: 10px; color: var(--ink); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; font-size: 14.5px; }
.footer-grid a { color: var(--ink-2); }
.footer-bottom {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px 20px;
  justify-content: space-between;
}
.footer-contact a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.footer-contact a:hover { text-decoration: underline; }

/* 返回顶部按钮 */
.to-top {
  position: fixed; inset-inline-end: 18px; bottom: 84px; z-index: 55;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink-2); box-shadow: var(--shadow);
  cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* 未翻译提示条 */
.tr-notice {
  display: none; margin-bottom: 20px; padding: 10px 14px;
  background: var(--accent-soft); border: 1px dashed var(--accent);
  border-radius: var(--radius-s); font-size: 14px; color: var(--ink-2);
}
.tr-notice.show { display: block; }
