/* ============================================
   SCI.AI Report — WeChat Official Account Style
   Based on: doocs/md, wechat-mp-article
   ============================================ */

:root {
  --text-body: #3f3f3f;
  --text-heading: #333333;
  --text-secondary: #595959;
  --text-muted: #888888;
  --color-accent: #0F4C81;
  --color-link: #576b95;
  --color-bg: #ffffff;
  --color-bg-subtle: #f8f8f8;
  --color-bg-quote: #fbf9fd;
  --color-border: rgba(204, 204, 204, 0.5);
  --color-border-light: #f0f0f0;

  --font-sans: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    "Microsoft YaHei", Arial, sans-serif;
  --font-mono: Menlo, Consolas, Monaco, "Courier New", monospace;

  --max-width: 677px;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--color-bg);
  letter-spacing: 0.034em;
  word-break: break-word;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* ===== Site Header ===== */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}
.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-heading);
  text-decoration: none;
}
.site-logo:hover { color: var(--color-accent); }
.site-nav { display: flex; gap: 20px; }
.site-nav a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--text-body); }

/* ===== Site Main ===== */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px 80px;
}

/* ===== Site Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border-light);
}
.site-footer .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text-secondary); }

/* ===== Report Page Meta ===== */
.report-meta {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}
.report-meta .date-type {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.report-meta h1 {
  font-size: 22px;
  font-weight: bold;
  color: var(--text-heading);
  line-height: 1.4;
  margin-bottom: 8px;
}
.report-meta .subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   Article Body — WeChat Article Typography
   font-size: 16px, line-height: 1.75,
   color: #3f3f3f, letter-spacing: 0.034em
   ============================================ */
.article-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
  letter-spacing: 0.034em;
}

/* -- Paragraphs -- */
.article-body p {
  margin: 0;
  padding: 8px 0;
  text-align: justify;
}

/* -- Headings -- */

/* H1: hidden (duplicate of report-meta) */
.article-body > h1:first-child {
  display: none;
}
.article-body > h1:first-child + p:has(> strong:only-child) {
  display: none;
}

.article-body h1 {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  color: var(--text-heading);
  margin: 2em 0 1em;
  line-height: 1.4;
}

/* H2: colored pill/tag — WeChat signature style */
.article-body h2 {
  display: inline-block;
  margin: 2em 0 1em;
  padding: 4px 16px;
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.5;
  border-radius: 4px;
}

/* H3: left border accent */
.article-body h3 {
  padding-left: 10px;
  border-left: 3px solid var(--color-accent);
  margin: 1.8em 0 0.6em;
  color: var(--text-heading);
  font-size: 17px;
  font-weight: bold;
  line-height: 1.4;
}

/* H4: accent color text */
.article-body h4 {
  margin: 1.5em 0 0.5em;
  color: var(--color-accent);
  font-size: 16px;
  font-weight: bold;
}

/* -- Links — WeChat's native blue -- */
.article-body a {
  color: var(--color-link);
  text-decoration: none;
  word-wrap: break-word;
}
.article-body a:hover {
  text-decoration: underline;
}

/* -- Bold -- accent color for emphasis */
.article-body strong, .article-body b {
  color: var(--color-accent);
  font-weight: bold;
}

/* -- Italic -- */
.article-body em {
  font-style: italic;
}

/* -- Blockquote -- */
.article-body blockquote {
  margin: 1em 0;
  padding: 10px 10px 10px 20px;
  border-left: 3px solid var(--color-accent);
  background-color: var(--color-bg-quote);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
  border-radius: 0;
}
.article-body blockquote p {
  margin: 0;
  padding: 4px 0;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: left;
}

/* -- Lists -- */
.article-body ul {
  list-style-type: disc;
  padding-left: 2em;
  margin: 8px 0;
}
.article-body ol {
  list-style-type: decimal;
  padding-left: 2em;
  margin: 8px 0;
}
.article-body li {
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.034em;
  color: var(--text-secondary);
  margin: 4px 0;
}

/* -- Tables -- */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 15px;
  color: var(--text-secondary);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article-body thead th {
  background-color: #f0f0f0;
  font-weight: bold;
  color: var(--text-heading);
  text-align: left;
  min-width: 85px;
}
.article-body th, .article-body td {
  border: 1px solid var(--color-border);
  padding: 6px 12px;
  vertical-align: top;
}
.article-body tbody tr:nth-child(even) {
  background-color: var(--color-bg-subtle);
}

/* -- Horizontal Rule -- */
.article-body hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 1.5em 0;
}

/* -- Code -- */
.article-body code {
  font-family: var(--font-mono);
  font-size: 90%;
  color: #d14;
  background-color: rgba(27, 31, 35, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
}
.article-body pre {
  margin: 10px 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.article-body pre code {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  padding: 15px 1em;
  background: #282c34;
  color: #abb2bf;
  border-radius: 5px;
  overflow-x: auto;
  white-space: pre;
}

/* -- Images -- */
.article-body img {
  display: block;
  max-width: 100%;
  margin: 10px auto;
  border-radius: 4px;
}

/* ===== Daily Report ===== */
.daily-report {
  white-space: pre-wrap;
}

/* ============================================
   Index Page — Report Listing
   ============================================ */
.index-hero {
  margin-bottom: 40px;
  text-align: center;
}
.index-hero h1 {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-heading);
  margin-bottom: 8px;
}
.index-hero p {
  font-size: 15px;
  color: var(--text-secondary);
}

.section-label {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}

/* Weekly report cards */
.report-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}
.report-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.report-card .card-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.report-card .card-title {
  font-size: 17px;
  font-weight: bold;
  color: var(--text-heading);
  margin-bottom: 8px;
  line-height: 1.4;
}
.report-card:hover .card-title { color: var(--color-accent); }
.report-card .card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Daily briefing list */
.daily-list { list-style: none; }
.daily-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.daily-item:last-child { border-bottom: none; }
.daily-item:hover .item-title { color: var(--color-accent); }
.daily-item .item-date {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
  width: 90px;
}
.daily-item .item-title {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.5;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .site-main { padding: 24px 16px 60px; }
  .report-meta h1 { font-size: 20px; }
  .article-body { font-size: 15px; }
  .article-body h2 { font-size: 16px; padding: 3px 12px; }
  .article-body h3 { font-size: 15px; }
  .article-body table { font-size: 13px; }
  .article-body th, .article-body td { padding: 4px 8px; }
  .index-hero h1 { font-size: 20px; }
  .report-card { padding: 16px; }
}
