/* ============================================================
   留白小说 · 布局层
   页头 / 导航 / 抽屉 / 页脚 / 页面容器
   ============================================================ */

.lb-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.lb-page {
  min-height: calc(100vh - var(--lb-header-h));
  padding: 48px 0 88px;
}

.lb-page--tight {
  padding-top: 36px;
}

.lb-section {
  margin-top: 60px;
}

.lb-section:first-child {
  margin-top: 0;
}

/* ---------- 页头 ---------- */

.lb-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--lb-header-h);
  background: rgba(251, 247, 236, .86);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  transition: border-color .25s var(--lb-ease), background .25s var(--lb-ease);
}

.lb-header.is-scrolled {
  border-bottom-color: var(--lb-line);
  background: rgba(251, 247, 236, .94);
}

.lb-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
}

.lb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.lb-brand:hover {
  color: var(--lb-ink);
}

.lb-brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 14px 14px 14px 4px;
  background: var(--lb-coral-soft);
  color: var(--lb-coral-deep);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transition: transform .25s var(--lb-ease), background .25s var(--lb-ease);
}

.lb-brand:hover .lb-brand__mark {
  transform: rotate(-6deg);
  background: var(--lb-coral);
  color: #fff;
}

.lb-brand__text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lb-brand__text strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .06em;
}

.lb-brand__text small {
  color: var(--lb-muted);
  font-size: 10px;
  letter-spacing: .1em;
}

.lb-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.lb-nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--lb-ink-2);
  font-size: 14px;
  white-space: nowrap;
  transition: background .2s var(--lb-ease), color .2s var(--lb-ease);
}

.lb-nav a:hover {
  background: var(--lb-coral-soft);
  color: var(--lb-coral-deep);
}

.lb-nav a.is-active {
  background: var(--lb-coral-soft);
  color: var(--lb-coral-deep);
  font-weight: 500;
}

.lb-header__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.lb-quick-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 188px;
  height: 38px;
  border: 1px solid var(--lb-line);
  border-radius: 999px;
  background: var(--lb-surface);
  transition: border-color .2s var(--lb-ease), width .25s var(--lb-ease);
}

.lb-quick-search:focus-within {
  width: 224px;
  border-color: var(--lb-coral);
}

.lb-quick-search input {
  width: 100%;
  height: 100%;
  padding: 0 40px 0 16px;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
}

.lb-quick-search input::placeholder {
  color: var(--lb-muted);
}

.lb-quick-search button {
  position: absolute;
  right: 3px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--lb-muted);
  transition: color .2s var(--lb-ease), background .2s var(--lb-ease);
}

.lb-quick-search button:hover {
  background: var(--lb-coral-soft);
  color: var(--lb-coral-deep);
}

.lb-account {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--lb-muted);
  white-space: nowrap;
}

.lb-account a {
  color: var(--lb-ink-2);
}

.lb-account a:hover {
  color: var(--lb-coral-deep);
}

.lb-account__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 150px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--lb-line);
  border-radius: 999px;
  background: var(--lb-surface);
  color: var(--lb-ink);
}

.lb-account__avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lb-mint-soft);
  color: var(--lb-mint-deep);
  font-size: 12px;
  font-weight: 600;
}

.lb-account__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-menu-btn {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--lb-line);
  border-radius: 50%;
  background: var(--lb-surface);
  color: var(--lb-ink-2);
}

.lb-lang-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--lb-line);
  border-radius: 50%;
  background: var(--lb-surface);
  color: var(--lb-ink-2);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.lb-lang-btn:hover {
  border-color: var(--lb-coral);
  color: var(--lb-coral-deep);
}

/* ---------- 移动端抽屉 ---------- */

.lb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(330px, 86vw);
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--lb-surface);
  box-shadow: -20px 0 60px rgba(100, 80, 50, .14);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .3s var(--lb-ease), visibility 0s linear .3s;
}

.lb-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .3s var(--lb-ease);
}

.lb-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.lb-drawer__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--lb-line);
  border-radius: 50%;
  background: transparent;
  color: var(--lb-ink-2);
}

.lb-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lb-drawer__nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--lb-ink-2);
}

.lb-drawer__nav a:hover,
.lb-drawer__nav a.is-active {
  background: var(--lb-coral-soft);
  color: var(--lb-coral-deep);
}

.lb-drawer__form {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.lb-drawer__lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 10px 8px 10px 14px;
  border: 1px dashed var(--lb-line-strong);
  border-radius: 12px;
  color: var(--lb-muted);
  font-size: 13px;
}

.lb-drawer__lang .lb-lang-btn {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.lb-drawer__foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px dashed var(--lb-line-strong);
  color: var(--lb-muted);
  font-size: 12px;
}

.lb-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(70, 60, 40, .3);
  opacity: 0;
  transition: opacity .25s var(--lb-ease);
}

.lb-scrim.is-open {
  opacity: 1;
}

/* ---------- 页脚 ---------- */

.lb-footer {
  margin-top: 72px;
  padding: 52px 0 34px;
  border-top: 1px dashed var(--lb-line-strong);
  background: var(--lb-bg-soft);
}

.lb-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

.lb-footer__brand p {
  max-width: 300px;
  margin-top: 14px;
  color: var(--lb-muted);
  font-size: 13px;
  line-height: 1.9;
}

.lb-footer h4 {
  margin-bottom: 14px;
  color: var(--lb-ink);
  font-size: 13px;
  font-weight: 600;
}

.lb-footer ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.lb-footer ul a {
  color: var(--lb-muted);
  font-size: 13px;
}

.lb-footer ul a:hover {
  color: var(--lb-coral-deep);
}

.lb-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px dashed var(--lb-line-strong);
  color: var(--lb-muted);
  font-size: 12px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1024px) {
  .lb-container { padding: 0 22px; }
  .lb-header__inner { gap: 20px; }
  .lb-nav { gap: 0; }
  .lb-nav a { padding: 7px 9px; font-size: 13px; }
  .lb-quick-search { width: 160px; }
  .lb-quick-search:focus-within { width: 184px; }
  .lb-brand__text small { display: none; }
  .lb-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (max-width: 860px) {
  .lb-nav,
  .lb-quick-search {
    display: none;
  }
  .lb-menu-btn {
    display: grid;
  }
  .lb-header__inner {
    justify-content: space-between;
  }
  .lb-account {
    display: none;
  }
  .lb-page {
    padding: 32px 0 60px;
  }
  .lb-section {
    margin-top: 44px;
  }
  .lb-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .lb-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  :root { --lb-header-h: 58px; }
  .lb-container { padding: 0 16px; }
  .lb-brand__mark { width: 30px; height: 30px; border-radius: 12px 12px 12px 4px; font-size: 14px; }
  .lb-brand__text strong { font-size: 15px; }
  .lb-page { padding: 24px 0 48px; }
  .lb-footer { padding: 38px 0 26px; }
  .lb-footer__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .lb-footer__bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}
