
/* ========== Reset & Base ========== */
.rr-wrap, .rr-wrap *, .rr-wrap::before, .rr-wrap::after { box-sizing: border-box; margin: 0; padding: 0; }
.rr-wrap {
  position: relative;
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Noto Sans SC", sans-serif;
  color: #1f2d3d;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  margin: 0;
  padding: 28px 26px;
  background: linear-gradient(160deg, #f8fafc 0%, #ffffff 45%, #cfe0f5 100%);
  min-height: auto;
  border-radius: 14px;
}
.rr-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 45% 35% at 18% 8%, rgba(255,255,255,0.55) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 88% 90%, rgba(255,255,255,0.45) 0%, transparent 55%);
}
.rr-wrap > * { position: relative; z-index: 1; }

/* ========== 封面 Hero ========== */
.title {
  position: relative;
  overflow: hidden;
  padding: 56px 40px;
  text-align: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 50%, #4f8ef7 100%);
  color: #ffffff;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.title::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 18% 82%, rgba(255,255,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 82% 18%, rgba(255,255,255,0.08) 0%, transparent 55%);
  pointer-events: none;
}
.title > * { position: relative; z-index: 1; }
.title h1 { font-size: 28px; font-weight: 800; margin: 0 0 14px 0; letter-spacing: 1px; color: #ffffff; }
.title .accent-line { width: 48px; height: 3px; background: rgba(255,255,255,0.85); margin: 0 auto 18px; border-radius: 2px; }
.title p { font-size: 15px; color: rgba(255,255,255,0.85); margin: 0; line-height: 1.7; }
.title .meta { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 16px; }

/* ========== 章节标题 ========== */
h1.heading {
  font-size: 26px;
  color: #0f1e33;
  margin: 36px 0 16px 0;
  font-weight: 700;
  border-left: 4px solid #3b82f6;
  padding-left: 16px;
}
h2.heading {
  font-size: 21px;
  color: #0f1e33;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #c9d6f3;
  font-weight: 600;
}
h3.heading {
  font-size: 17px;
  color: #2563eb;
  margin: 20px 0 10px;
  font-weight: 600;
}

/* ========== 正文 / 列表 ========== */
.paragraph { font-size: 15px; color: #1f2d3d; line-height: 1.8; margin: 0 0 16px 0; }
.list { margin: 0 0 16px 0; padding-left: 24px; font-size: 15px; color: #1f2d3d; line-height: 1.8; }
.list li { margin-bottom: 8px; }
.list li::marker { color: #3b82f6; }

/* ========== callout ========== */
.callout {
  margin: 0 0 16px 0;
  padding: 16px 24px;
  background: #e8f0fe;
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
}
.callout[data-variant="warning"] { background: #FFF3E0; border-left-color: #d97706; }
.callout p { font-size: 15px; color: #1f2d3d; margin: 0; line-height: 1.8; }
.callout strong { color: #0a1626; }

/* ========== 深挖折叠 ========== */
details.deep-dive {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin: 0 0 16px 0;
  padding: 4px 0;
  border-left: 3px solid #3b82f6;
}
details.deep-dive summary {
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #0f1e33;
  cursor: pointer;
}
details.deep-dive .content { padding: 0 20px 16px; }

/* ========== 表格 ========== */
table.table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 13px;
  margin: 0 0 16px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
table.table th {
  background: linear-gradient(180deg, #c9d6f3 0%, #e8f0fe 100%);
  color: #0a1626;
  padding: 10px 10px;
  text-align: left;
  font-size: 13px;
  border-bottom: 2px solid #c9d6f3;
}
table.table td {
  padding: 9px 10px;
  border-bottom: 1px solid #dbe4ef;
  color: #1f2d3d;
  vertical-align: top;
  line-height: 1.6;
}
table.table tr:last-child td { border-bottom: none; }
table.table tr:nth-child(even) td { background: #f8fafc; }
table.table td code, table.table td .fn {
  font-family: 'Cascadia Code', 'Fira Code', 'SF Mono', Consolas, monospace;
  font-size: 12px;
  color: #2563eb;
  background: #eef5ff;
  padding: 1px 4px;
  border-radius: 3px;
}
table.table td .ok { color: #16a34a; font-weight: 600; }
table.table td .bad { color: #C62828; font-weight: 600; }

/* ========== code ========== */
pre.code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0 0 16px 0;
  font-family: 'Cascadia Code', 'Fira Code', 'SF Mono', 'Source Code Pro', Consolas, monospace;
}
pre.code .cm { color: #7dd3fc; }
pre.code .kw { color: #fbbf24; }

/* ========== 卡片 ========== */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 20px 24px;
  margin: 0 0 16px 0;
}
.card h3 { font-size: 16px; color: #0f1e33; margin: 0 0 10px 0; font-weight: 700; }
.card p { font-size: 14px; color: #1f2d3d; line-height: 1.8; margin: 0 0 10px 0; }
.card .loc {
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  color: #2563eb;
  background: #eef5ff;
  border-radius: 4px;
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 10px;
}

/* ========== 时间线 ========== */
.timeline { list-style: none; padding: 0; margin: 0 0 16px 0; }
.timeline li {
  position: relative;
  padding-left: 28px;
  padding-bottom: 18px;
  border-left: 2px solid #e8f0fe;
  margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -7px; top: 5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #f4f7fb;
  box-shadow: 0 0 0 2px #e8f0fe;
}
.timeline strong { font-size: 14px; color: #2563eb; }
.timeline p { font-size: 14px; color: #1f2d3d; margin: 4px 0 0 0; line-height: 1.8; }

/* ========== 引用与来源 ========== */
a.cite {
  font-size: 11px;
  color: #2563eb;
  text-decoration: none;
  vertical-align: super;
  margin-left: 2px;
  cursor: pointer;
}
a.cite:hover { text-decoration: underline; }
.source-list { margin: 0 0 16px 0; }
.source-list ol.list { padding-left: 24px; font-size: 13px; color: #5b6b80; line-height: 1.8; }
.source-list ol.list li { margin-bottom: 6px; }
.source-list .src-id { color: #2563eb; font-weight: 700; }
.source-list a.source-link { color: #2563eb; text-decoration: none; }
.source-list a.source-link:hover { text-decoration: underline; }

/* ========== 尾页 ========== */
.end_page {
  margin-top: 24px;
  padding: 56px 24px;
  text-align: center;
  background: linear-gradient(135deg, #c9d6f3 0%, #e8f0fe 100%);
  border-radius: 16px;
}
.end_page h1 { font-size: 26px; color: #0f1e33; margin: 0 0 16px 0; font-weight: 800; }
.end_page p { font-size: 14px; color: #5b6b80; margin: 0; line-height: 1.8; }

/* ========== 响应式 ========== */
@media screen and (max-width: 600px) {
  body { padding: 16px !important; }
  h1 { font-size: 22px !important; }
  h2 { font-size: 18px !important; }
  h3 { font-size: 15px !important; }
  table.table { font-size: 12px; }
  table.table th, table.table td { padding: 7px 6px; }
  table.table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.table th, table.table td { white-space: normal; word-break: break-word; }
  .paragraph, .card, .callout, .timeline li p { word-break: break-word; }
}

/* ========== 打印优化 ========== */
@media print {
  body {
    padding: 0 !important;
    margin: 0 !important;
    background: #f4f7fb;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .rr-wrap::before { display: none; }
  .title, .end_page { border-radius: 0; box-shadow: none; }
  .faq-item, details.deep-dive { box-shadow: none; border: 1px solid #dbe4ef; }
  details.deep-dive { break-inside: avoid; }
  pre.code { white-space: pre-wrap; word-break: break-all; }
}
