/* ==========================================================================
   Replay Bulletin — 站点样式
   版式：报刊风（衬线报头 + 黑色导航 + 三列卡片 + 深色页脚）
   纯手写，无框架、无外部字体、无 CDN 依赖
   ========================================================================== */

/* ---------- 设计变量 ---------- */

:root {
  --ink: #111111;
  --ink-soft: #1a1a1a;
  --body: #333333;
  --muted: #666666;
  --muted-2: #888888;
  --rule: #dddddd;
  --rule-strong: #111111;

  --accent: #0b5fa5;
  --accent-dark: #084a82;

  --paper: #ffffff;
  --tint: #f7f7f7;
  --tint-2: #f0f0f0;
  --cage-border: #e5e5e5;

  --serif: Georgia, "Times New Roman", "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, "PingFang SC", sans-serif;

  --wrap: 960px;
}

/* ---------- 基础 ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

p { margin: 0 0 16px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }

.container {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 报头 ---------- */

.masthead {
  border-bottom: 3px solid var(--rule-strong);
  padding: 22px 0 12px;
  text-align: center;
}

.masthead__brand {
  display: inline-block;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.masthead__brand:hover { text-decoration: none; }

.masthead__tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.masthead__dateline {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 13px;
}

/* ---------- 导航 ---------- */

.main-nav {
  background: var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}

.main-nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--wrap);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a {
  display: block;
  padding: 11px 18px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--accent);
  text-decoration: none;
}

/* ---------- 主体 ---------- */

main { padding: 28px 0 40px; }

h1 {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--ink);
}

h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 28px 0 10px;
  color: var(--ink);
}

h3 {
  font-size: 19px;
  margin: 20px 0 8px;
}

.section-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 6px;
  margin: 30px 0 18px;
}

/* ---------- 头条 ---------- */

.featured {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 24px;
  margin-bottom: 8px;
}

.featured__kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.featured h1 a { color: var(--ink); }
.featured h1 a:hover { color: var(--accent); text-decoration: none; }

.featured__summary {
  font-size: 18px;
  color: #444444;
  margin-bottom: 10px;
}

/* ---------- 卡片列表 ---------- */

.article-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-card {
  border-top: 3px solid var(--rule-strong);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
}

.article-card__cat {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-card h3 {
  margin: 6px 0;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
}
.article-card h3 a { color: var(--ink); }
.article-card h3 a:hover { color: var(--accent); text-decoration: none; }

.article-card p {
  margin: 0 0 8px;
  color: #555555;
  font-size: 15px;
}

.meta {
  margin-top: auto;
  color: var(--muted-2);
  font-size: 13px;
}

/* ---------- 封面占位（无图时的渐变块） ---------- */

.thumb {
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 1px;
  user-select: none;
}

/* 按位置轮换配色，避免整版一个色 */
.article-list > .article-card:nth-child(6n + 1) .thumb { background: linear-gradient(140deg, #1d3f6e, #3c6f9e); }
.article-list > .article-card:nth-child(6n + 2) .thumb { background: linear-gradient(140deg, #5b3a29, #94704f); }
.article-list > .article-card:nth-child(6n + 3) .thumb { background: linear-gradient(140deg, #24463c, #4a7d68); }
.article-list > .article-card:nth-child(6n + 4) .thumb { background: linear-gradient(140deg, #4a2d4f, #7d5a83); }
.article-list > .article-card:nth-child(6n + 5) .thumb { background: linear-gradient(140deg, #6b3116, #a05a33); }
.article-list > .article-card:nth-child(6n)     .thumb { background: linear-gradient(140deg, #2b3a4a, #546b81); }

.featured .thumb {
  aspect-ratio: 21 / 9;
  margin: 16px 0 10px;
  font-size: 44px;
}

.thumb--hero {
  aspect-ratio: 16 / 9;
  margin: 0 0 10px;
  font-size: 40px;
}

/* 真实图片用这两个类名，替换 .thumb 即可 */
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 12px;
}
.featured-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  margin: 16px 0 4px;
}

/* ---------- 分类胶囊 ---------- */

.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 4px;
}

.cat-chips a {
  background: var(--tint-2);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.cat-chips a:hover {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

/* ---------- 文章正文 ---------- */

.article-body {
  max-width: 720px;
  margin: 0 auto;
}

.article-body h1 { margin-bottom: 10px; }

.article-body .kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-body .byline {
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
  margin-bottom: 22px;
}

.article-body p { font-size: 18px; }

.article-body h2 { margin-top: 32px; }

.article-body figure { margin: 22px 0; }
.article-body figcaption { color: var(--muted-2); font-size: 13px; margin-top: 8px; }

blockquote {
  border-left: 4px solid var(--accent);
  padding: 6px 0 6px 18px;
  margin: 20px 0;
  color: #444444;
  font-style: italic;
  font-family: var(--serif);
  font-size: 19px;
}

.article-body ul,
.article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 7px; }

.related {
  background: var(--tint);
  padding: 18px 22px;
  margin-top: 32px;
  border-radius: 6px;
}
.related h3 { margin-top: 0; }
.related ul { margin: 0; padding-left: 20px; }
.related li { margin-bottom: 6px; }

/* ---------- 静态页 ---------- */

.page-body {
  max-width: 720px;
  margin: 0 auto;
}

.page-body h1 { margin-bottom: 16px; }
.page-body h2 { font-size: 21px; margin-top: 30px; }
.page-body ul,
.page-body ol { margin: 0 0 16px; padding-left: 24px; }
.page-body li { margin-bottom: 6px; }

.contact-form label {
  display: block;
  font-weight: 600;
  margin: 14px 0 4px;
  font-size: 15px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink-soft);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(11, 95, 165, 0.18);
  border-color: var(--accent);
}

.contact-form textarea { min-height: 150px; resize: vertical; }

.contact-form button {
  margin-top: 16px;
  background: var(--accent);
  color: #ffffff;
  border: 0;
  padding: 12px 26px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
.contact-form button:hover { background: var(--accent-dark); }

.form-note { color: var(--muted); font-size: 14px; margin-top: 12px; }

.notice {
  background: #fff8e6;
  border: 1px solid #f0e0b8;
  color: #7a5c10;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 14.5px;
  margin: 20px 0;
}

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

.site-footer {
  background: var(--ink);
  color: #bbbbbb;
  padding: 30px 0;
  font-size: 14px;
}

.site-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
}

.site-footer h4 {
  color: #ffffff;
  margin: 0 0 10px;
  font-size: 15px;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #dddddd; }

.site-footer__brand {
  font-family: var(--serif);
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 8px;
}

.site-footer__bottom {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #333333;
  color: var(--muted-2);
  font-size: 13px;
}

/* ==========================================================================
   广告位
   ========================================================================== */

.ad-cage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 28px auto;
  padding: 12px;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--cage-border);
  border-radius: 12px;
}
.ad-cage[hidden] { display: none !important; }

.ad-label {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.ad-slot {
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

/* 尺寸由 data 属性对应的类决定 */
.ad-slot--728x90 { min-height: 90px;  width: 728px; max-width: 100%; }
.ad-slot--300x250 { min-height: 250px; width: 300px; max-width: 100%; }
.ad-slot--468x60 { min-height: 60px;  width: 468px; max-width: 100%; }
.ad-slot--320x50 { height: 50px;      width: 320px; max-width: 100%; }
.ad-slot--native  { min-height: 180px; width: 100%; }

/* 预览环境的占位外观 */
.ad-slot.is-placeholder {
  border: 1px dashed #c3cbd8;
  border-radius: 8px;
  background: repeating-linear-gradient(
    45deg, #fbfbfc, #fbfbfc 10px, #f1f3f7 10px, #f1f3f7 20px
  );
  color: #8a93a3;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 底部粘性条 320×50 */
.ad-anchor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 12px 8px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
}
.ad-anchor[hidden] { display: none !important; }
.ad-anchor.is-collapsed { transform: translateY(100%); }

.ad-anchor .ad-slot { margin: 0; }

.ad-anchor__close {
  position: absolute;
  top: 2px;
  right: 8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: #ffffff;
  color: #666666;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

body.has-anchor { padding-bottom: 76px; }

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

@media (max-width: 900px) {
  .article-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  .masthead { padding: 16px 0 10px; }
  .masthead__brand { font-size: 30px; }
  .masthead__tagline { font-size: 13px; }

  h1 { font-size: 26px; }
  .featured__summary { font-size: 17px; }

  .article-list { grid-template-columns: 1fr; }
  .article-list > .article-card .thumb { font-size: 26px; }

  .article-body p { font-size: 17px; }

  .main-nav a { padding: 10px 12px; font-size: 13px; }

  .site-footer__cols { gap: 22px; }
}

/* 打印：去掉广告与粘性条 */
@media print {
  .ad-cage,
  .ad-anchor,
  .main-nav { display: none !important; }
  body.has-anchor { padding-bottom: 0; }
}
