/* ==========================================================================
   layout.css —— 页头 / 导航 / 搜索 / 主体栅格 / 页脚 / 广告位
   ========================================================================== */

/* ---------- 页头 ---------- */
.site-header {
  background: #fbfcfc;
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: var(--header-h);
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.logo__text {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-gold);
}

/* ---------- 主导航 ---------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  position: relative;
  display: inline-block;
  padding: 0 12px;
  line-height: var(--header-h);
  font-size: 15px;
  color: #3a4548;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--color-green);
}

.main-nav a.active {
  color: var(--color-green);
  font-weight: 600;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--color-green);
}

/* ---------- 搜索框 ---------- */
.search {
  position: relative;
  margin-left: auto;
  width: 340px;
  flex-shrink: 0;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 44px 0 18px;
  border: none;
  border-radius: 19px;
  background: #eceff0;
  font-size: 13px;
  color: #3a4548;
  outline: none;
  transition: background 0.2s;
}

.search input::placeholder {
  color: var(--color-muted);
}

.search input:focus {
  background: #e6eaec;
}

.search__btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #8a9499;
}

.search__btn:hover {
  color: var(--color-green);
}

.search__btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- 主体两栏栅格 ---------- */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
  padding-top: 24px;
  padding-bottom: 8px;
}

.page-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  margin: 2px 0 14px;
  font-size: 13px;
  color: var(--color-muted);
}

.breadcrumb a:hover {
  color: var(--color-green);
}

.breadcrumb .sep {
  margin: 0 6px;
  color: var(--color-faint);
}

/* ---------- 广告位（离线占位，模拟 Google Ads 预留区域） ---------- */
.ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--color-ad-bg);
  border: 1px solid var(--color-ad-border);
  border-radius: var(--radius);
  color: var(--color-ad-text);
}

.ad-slot__tag {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 11px;
  color: #adb9c0;
}

.ad-slot__title {
  font-size: 26px;
  font-weight: 400;
  color: var(--color-ad-text);
}

.ad-slot__size {
  margin-top: 6px;
  font-size: 14px;
}

.ad-slot__note {
  margin-top: 6px;
  font-size: 11px;
  color: #b6c1c7;
}

/* PC 顶部横幅 728×90：在主栏内水平居中 */
.ad--leaderboard {
  width: 728px;
  max-width: 100%;
  height: 90px;
  margin: 0 auto;
}

.ad--leaderboard .ad-slot__title {
  font-size: 22px;
}

.ad--leaderboard .ad-slot__size,
.ad--leaderboard .ad-slot__note {
  margin-top: 2px;
  font-size: 11px;
}

/* 移动端横幅广告位（约 320×100） */
.ad--banner {
  width: 100%;
  height: 100px;
}

.ad--banner .ad-slot__title {
  font-size: 20px;
}

.ad--banner .ad-slot__size,
.ad--banner .ad-slot__note {
  margin-top: 2px;
  font-size: 11px;
}

/* 矩形广告位 300×250：宽度自适应，按比例缩放 */
.ad--rect {
  width: 100%;
  aspect-ratio: 300 / 250;
}

/* 摩天大楼广告位 300×600 */
.ad--sky {
  width: 100%;
  aspect-ratio: 300 / 600;
}

/* 页面流中的广告位间距 */
.ad-top {
  margin-bottom: 28px;
}

.section-ad {
  margin: 8px 0 32px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 48px;
  padding: 28px 0 36px;
  border-top: 1px solid #e2e6e8;
  text-align: center;
  color: #a5aeb2;
  font-size: 13px;
}

.site-footer p + p {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-faint);
}

/* 后台配置了真实广告时，图片铺满整个广告位。
   广告位高度来自 aspect-ratio，百分比高度解析不到，
   所以用绝对定位铺满，保证图片不会把广告位撑高。 */
.ad-slot--filled {
  padding: 0;
  border: none;
  background: transparent;
  overflow: hidden;
}

.ad-slot__link {
  position: absolute;
  inset: 0;
  display: block;
}

.ad-slot__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   页脚信息链接（关于我们 / 服务条款 …）
   -------------------------------------------------------------------------- */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 13px;
}

.footer-links a {
  color: #8a8f99;
  text-decoration: none;
}

.footer-links a:hover {
  color: #f5a623;
}

/* 链接之间的竖线分隔 */
.footer-links a + a::before {
  content: "｜";
  margin: 0 8px;
  color: #c9ccd2;
}

/* --------------------------------------------------------------------------
   说明文档页（关于我们、隐私政策等）
   -------------------------------------------------------------------------- */
.doc-page {
  max-width: 860px;
  margin: 24px auto 40px;
  padding: 32px 36px 28px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.doc-title {
  margin: 14px 0 18px;
  font-size: 26px;
  line-height: 1.4;
  color: #1f2329;
}

.doc-body {
  font-size: 15px;
  line-height: 1.9;
  color: #3a3f47;
}

.doc-body p {
  margin: 0 0 14px;
}

.doc-body h2 {
  margin: 28px 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #1f2329;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

/* 全局重置把 list-style 去掉了，这里补回来 */
.doc-body ul {
  list-style: disc;
}

.doc-body ol {
  list-style: decimal;
}

.doc-body li {
  margin-bottom: 6px;
}

.doc-body li::marker {
  color: #f5a623;
}

.doc-body a {
  color: #1677ff;
  word-break: break-all;
}

.doc-meta {
  margin-bottom: 22px;
  font-size: 13px;
  color: #909399;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid #eef0f3;
  font-size: 13px;
}

.doc-nav__label {
  color: #909399;
}

.doc-nav a {
  color: #1677ff;
  text-decoration: none;
}

.doc-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .doc-page {
    margin: 12px 0 24px;
    padding: 20px 16px;
    border-radius: 8px;
  }

  .doc-title {
    font-size: 22px;
  }
}