/* ==========================================================
   07-reading-body.css — 文章正文排版
   只服务 .reading-body 内部元素,改文章样式只动这个文件
   ========================================================== */

.reading-body {
  padding: 40px 64px 64px;
  font-size: 17px;
  line-height: 1.9;
  color: #333;
}

/* ── 段落 ── */
.reading-body p {
  margin-bottom: 24px;
}
.reading-body p.indent {
  text-indent: 2em;
}
.reading-body .dropcap::first-letter {
  font-size: 3.2em;
  font-weight: 800;
  float: left;
  line-height: 0.8;
  margin-right: 8px;
  margin-top: 6px;
  color: var(--brand);
}

/* ── 标题层级 ── */
.reading-body h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 56px 0 24px;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--brand);
  line-height: 1.25;
}
.reading-body h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 48px 0 20px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  line-height: 1.3;
}
.reading-body h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--text-primary);
  line-height: 1.35;
}
.reading-body h4 {
  font-size: 19px;
  font-weight: 700;
  margin: 36px 0 14px;
  color: var(--text-primary);
  line-height: 1.4;
}
.reading-body h5 {
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 32px 0 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.reading-body h6 {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 28px 0 10px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ── 行内元素 ── */
.reading-body strong {
  font-weight: 700;
  color: var(--text-primary);
}
.reading-body em {
  font-style: italic;
  color: var(--text-secondary);
}
.reading-body a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 192, 0, 0.3);
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
  font-weight: 500;
}
.reading-body a:hover {
  border-bottom-color: var(--brand);
  color: #e0a800;
}
.reading-body del {
  text-decoration: line-through;
  color: var(--text-tertiary);
  opacity: 0.7;
}
.reading-body mark {
  background: linear-gradient(
    120deg,
    rgba(255, 192, 0, 0.25) 0%,
    rgba(255, 192, 0, 0.35) 100%
  );
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}
.reading-body sup {
  font-size: 0.75em;
  vertical-align: super;
}
.reading-body sub {
  font-size: 0.75em;
  vertical-align: sub;
}
.reading-body kbd {
  display: inline-block;
  background: #f5f5f7;
  border: 1px solid #d1d1d6;
  border-bottom-width: 1px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.82em;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--text-primary);
  box-shadow: none;
  line-height: 1.6;
  vertical-align: baseline;
}

/* ── 代码 ── */
.reading-body code {
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: "SF Mono", "Fira Code", monospace;
  color: #c7254e;
}
.reading-body pre {
  background: #1d1d1f;
  color: #e0e0e0;
  padding: 24px 28px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 32px 0;
  font-size: 14px;
  line-height: 1.7;
}
.reading-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* ── 引用 / 插图 / 分隔线 ── */
.reading-body blockquote {
  margin: 40px 0;
  padding: 24px 32px;
  border-left: 4px solid var(--brand);
  background: rgba(255, 192, 0, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-primary);
}
.reading-body blockquote p {
  margin-bottom: 12px;
}
.reading-body blockquote p:last-child {
  margin-bottom: 0;
}
.reading-body figure {
  margin: 40px 0;
  padding: 0;
  background: none;
  border-radius: 0;
  text-align: center;
  border: none;
}
.reading-body figure img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
  box-shadow: none;
}
.reading-body figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 16px;
  font-style: italic;
  line-height: 1.6;
  padding: 0 12px;
}
.reading-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 0, 0, 0.12),
    transparent
  );
  margin: 48px 0;
}

/* ── 列表 / 任务列表 ── */
.reading-body ul,
.reading-body ol {
  margin: 20px 0 24px 24px;
}
.reading-body li {
  margin-bottom: 8px;
}
.reading-body .task-list {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.reading-body .task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}
.reading-body .task-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #d1d1d6;
  border-radius: 6px;
  margin-top: 4px;
  cursor: default;
  position: relative;
  transition: all 0.2s ease;
  background: #fff;
}
.reading-body .task-item input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.reading-body .task-item input[type="checkbox"]:checked::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  color: #1d1d1f;
}

/* ── 表格 ── */
.reading-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 15px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}
.reading-body thead {
  background: #f5f5f7;
}
.reading-body th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  font-size: 14px;
  letter-spacing: 0.5px;
}
.reading-body td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
}
.reading-body tbody tr:hover {
  background: rgba(255, 192, 0, 0.03);
}
.reading-body tbody tr:last-child td {
  border-bottom: none;
}

/* ── 响应式 ── */
@media (max-width: 1024px) {
  .reading-body {
    padding: 32px 40px 48px;
  }
  .reading-body table {
    font-size: 14px;
  }
  .reading-body th,
  .reading-body td {
    padding: 10px 14px;
  }
  .reading-body figure {
    margin: 32px 0;
    padding: 0;
  }
}
@media (max-width: 768px) {
  .reading-body {
    padding: 24px 24px 40px;
    font-size: 16px;
  }
  .reading-body blockquote {
    padding: 16px 20px;
    font-size: 16px;
  }
  .reading-body h1 {
    font-size: 26px;
  }
  .reading-body h2 {
    font-size: 22px;
  }
  .reading-body h3 {
    font-size: 19px;
  }
  .reading-body table {
    display: block;
    overflow-x: auto;
  }
  .reading-body figure {
    margin: 24px 0;
    padding: 0;
  }
  .reading-body figcaption {
    font-size: 13px;
    margin-top: 12px;
  }
}
