/* ==========================================================================
   imaoba.com · 缠论资料库（极简版）
   典籍学院风：宣纸底 #FBFAF7 / 墨黑 #1A1A1A / 朱红 #C0392B
   零阴影 · 统一 2px 圆角 · 发丝分隔线
   ========================================================================== */

:root {
  --bg: #FBFAF7;
  --ink: #1A1A1A;
  --ink-2: #5C5C5C;
  --ink-3: #9B9B9B;
  --accent: #C0392B;
  --accent-dark: #A32E22;
  --line: #D6D2C8;
  --line-soft: #E8E5DE;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-num: Inter, "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  --gutter: 72px;   /* 版心左右留白 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ---------- 页头（首页） ---------- */
.page-head {
  padding: 72px var(--gutter) 32px;
  border-bottom: 1px solid var(--line);
}
.site-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.25;
}
.site-sub {
  margin-top: 14px;
  font-size: 15px;
  line-height: 26px;
  color: var(--ink-2);
}

/* ---------- 资料清单（首页） ---------- */
.list { padding: 0 var(--gutter) 64px; }
.row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
}
.row__name {
  flex: 1;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 17px;
  transition: color .15s ease;
}
.row__meta {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.row__arrow { color: var(--ink-3); transition: color .15s ease; }
.row:hover .row__name,
.row:hover .row__arrow { color: var(--accent); }

/* ---------- 详情页 ----------
   两栏：正文（可收缩，阅读宽度上限 760px） + 侧栏 300px
   窄屏塌成单栏，侧栏落到正文下方 */
.detail {
  padding: 64px var(--gutter) 72px;
  max-width: 1240px;      /* 宽屏收起版心居中，避免正文与侧栏被拉得过开 */
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: 72px;
  align-items: start;
}
.d-main { min-width: 0; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.back:hover { opacity: .72; }

.d-head { margin-top: 28px; max-width: 760px; }
.d-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 44px;
}
.d-meta {
  margin-top: 12px;
  font-family: var(--font-num);
  font-size: 14px;
  color: var(--ink-3);
}
.d-rule {
  margin-top: 14px;
  border: 0;
  border-top: 1px solid var(--line);
}

.d-body {
  margin-top: 28px;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.d-body p { font-size: 16px; line-height: 30px; }
.d-body .lead { color: var(--ink); }
.d-body p:not(.lead) { color: var(--ink-2); }

.d-dl { margin-top: 28px; }
.btn-dl {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
  padding: 16px 32px;
  border-radius: 2px;
  transition: background .15s ease;
}
.btn-dl:hover { background: var(--accent-dark); color: var(--bg); }
.dl-hint { margin-top: 14px; font-size: 13px; color: var(--ink-3); }

/* ---------- 详情页侧栏：随机资料 ---------- */
.d-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 4px;
}
.d-side__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 22px;
  letter-spacing: .04em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.side-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.side-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}
.side-item__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  transition: color .15s ease;
}
.side-item__meta {
  font-family: var(--font-num);
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-3);
}
.side-item:hover .side-item__name { color: var(--accent); }

/* ---------- 广告位 ----------
   设计要点：
   1. 固定最小高度 → 广告加载后不撑动版式，避免 CLS 影响体验与 SEO
   2. 「广告」标签常驻 → 满足 AdSense 可识别要求与《互联网广告管理办法》标识义务
   3. 白底 + 发丝边框 → 与宣纸底区分，但不喧宾夺主
*/
.ad-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ad-slot__label {
  align-self: flex-start;
  font-size: 10px;
  line-height: 14px;
  letter-spacing: .08em;
  color: var(--ink-3);
  background: var(--line-soft);
  border-radius: 2px;
  padding: 2px 6px;
}
.ad-slot__box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 0 16px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
}
.ad-slot__box--banner { min-height: 90px; }
.ad-slot__box--feed { min-height: 120px; }
.ad-slot__box--square { min-height: 250px; }

/* 位置变体 */
.ad-slot--top { padding: 24px var(--gutter) 0; }
.ad-slot--feed { padding: 22px 0 26px; }
.ad-slot--content { margin-top: 28px; max-width: 760px; }
.ad-slot--side { margin-top: 2px; }

/* 详情页正文中的文章内广告：上下间距由 .d-body 的 gap 统一控制 */
.ad-slot--inline { margin-top: 0; }

/* 侧栏广告位锁定 AdSense 固定尺寸 300×250。
   写死宽高，广告加载后不会撑高侧栏；
   窄屏加 max-width 兜底，避免极端小屏横向溢出 */
.ad-slot--side .ad-slot__box--square {
  width: 300px;
  max-width: 100%;
  height: 250px;
  padding: 0 12px;
}

/* ---------- 页脚 ---------- */
.foot {
  padding: 28px var(--gutter) 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-3);
}
.foot--ruled { border-top: 1px solid var(--line); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  /* 两栏塌成单栏，侧栏落到正文下方 */
  .detail { grid-template-columns: minmax(0, 1fr); row-gap: 52px; }
  .d-side { border-top: 1px solid var(--line); padding-top: 34px; }
  .d-side__title { border-bottom: 0; padding-bottom: 0; }
  .side-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; }
  .ad-slot--side { max-width: 320px; }
}
@media (max-width: 900px) {
  :root { --gutter: 40px; }
}
@media (max-width: 640px) {
  :root { --gutter: 24px; }
  .page-head { padding-top: 48px; }
  .site-title { font-size: 28px; }
  .row { flex-wrap: wrap; gap: 8px; padding: 18px 0; }
  .row__meta { order: 3; width: 100%; white-space: normal; }
  .row__arrow { display: none; }
  .detail { padding-top: 40px; }
  .d-title { font-size: 26px; line-height: 38px; }
  .side-list { grid-template-columns: minmax(0, 1fr); }
  .foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  /* 移动端改用 320×100 横幅，留出更紧凑的上下间距 */
  .ad-slot__box--banner { min-height: 100px; }
  .ad-slot--top { padding-top: 20px; }
  .ad-slot--feed { padding: 18px 0 22px; }
}
