/* ===== walle-yiwa — 布局(layout)=====
页面骨架:.container 宽度约束、header 导航/搜索框/主题切换、main 主区、footer。
移动端媒体查询随选择器归属本文件(container/main/header/footer 相关)。===== */

/* 通用容器:页面宽度约束(header/main/footer 共用) */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ===== 页头 ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 76px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
}
.logo-text { line-height: 1; }
.ring-mark {
  display: block;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}
.site-nav { display: flex; align-items: center; gap: 24px; }
.header-search { display: flex; align-items: center; }
.header-search-input {
  width: 150px; padding: 6px 12px; font-size: 14px;
  border: 1px solid var(--header-input-border); border-radius: 999px;
  background: var(--surface); color: var(--text-main);
  outline: none; transition: width 0.2s, border-color 0.2s;
}
.header-search-input:focus { width: 190px; border-color: var(--walle-yellow); }
.nav-link { color: var(--text-main); text-decoration: none; font-size: 16px; }
.nav-link:hover { color: var(--walle-yellow-deep); }
.link-btn {
  background: none; border: none; color: var(--text-sub);
  font-size: 13.5px; cursor: pointer; padding: 0; font-family: inherit;
}
.link-btn:hover { color: var(--error); }

/* 主题切换按钮(导航右侧,icon-only;SVG 线条,不用 emoji) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover {
  background: var(--soft-hover-bg);
  border-color: var(--border);
  color: var(--walle-yellow-deep);
}
.theme-toggle svg { display: block; width: 18px; height: 18px; }
/* 图标语义:显示点击后将切换到的主题(浅色模式显示月亮 → 切深色;深色模式显示太阳 → 切浅色) */
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
/* ===== 主区 ===== */
.main { flex: 1; padding-top: 32px; padding-bottom: 64px; }


/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 28px;
  color: var(--text-faint);
  font-size: 13px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-copy { color: var(--text-faint); }
.footer-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-link {
  color: var(--text-faint);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}
.footer-link:hover { color: var(--walle-yellow-deep); }

/* ===== 响应式:header/main/footer 相关 ===== */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .main { padding-top: 32px; padding-bottom: 48px; }
  .site-name { font-size: 24px; }
  .ring-mark { width: 30px; height: 30px; }
  .site-nav { gap: 12px; }
  .nav-link { font-size: 14px; }
  .header-search-input { width: 96px; padding: 5px 10px; font-size: 13px; }
  .header-search-input:focus { width: 110px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 480px) {
  .header-inner { gap: 8px; }
  .site-name { font-size: 22px; }
  .ring-mark { width: 26px; height: 26px; }
  .site-nav { gap: 8px; }
  .nav-link { font-size: 12.5px; }
  .theme-toggle { width: 30px; height: 30px; }
  .header-search { display: none; } /* 手机端隐藏页头搜索,保证一行放下(搜索页仍有完整搜索框) */
}
