:root {
  --text: #1a1a1a;
  --muted: #777;
  --border: #e2e2e2;
  --surface: #f6f6f6;
  --max: 720px;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: var(--sans); font-size: 17px; line-height: 1.75; color: var(--text); background: #fff; }

/* Nav */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; z-index: 10;
}
.brand { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; color: var(--text); text-decoration: none; }
.nav-links a { color: var(--text); text-decoration: none; font-size: 15px; margin-left: 28px; opacity: 0.5; }
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; font-weight: 600; }

/* Layout */
article { max-width: var(--max); margin: 0 auto; padding: 56px 24px 80px; }

/* Paper header */
.paper-title { font-size: 26px; font-weight: 700; line-height: 1.3; letter-spacing: -0.5px; margin-bottom: 20px; }
.author { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.affil { color: var(--muted); font-size: 15px; }
.date { color: var(--muted); font-size: 15px; margin-top: 2px; margin-bottom: 14px; }
.kw { color: var(--muted); font-size: 15px; margin-bottom: 32px; }

/* Abstract */
.abstract {
  border-left: 3px solid var(--text); background: var(--surface);
  padding: 20px 24px; font-size: 16px; line-height: 1.7; margin-bottom: 48px;
}

/* Typography */
p { margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
em { font-style: italic; }
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:hover { opacity: 0.7; }

h2 {
  font-size: 19px; font-weight: 700; letter-spacing: -0.3px;
  margin: 52px 0 14px; padding-top: 24px; border-top: 1px solid var(--border);
}
h3 { font-size: 16px; font-weight: 700; margin: 32px 0 10px; }

/* Lists */
ul, ol { padding-left: 26px; margin-bottom: 16px; }
li { margin-bottom: 6px; }

/* Code */
code { font-family: var(--mono); font-size: 14px; background: var(--surface); padding: 2px 6px; border-radius: 3px; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 16px 20px; overflow-x: auto; margin: 20px 0; }
pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.55; }

/* Math */
.math-block { overflow-x: auto; padding: 4px 0; margin: 20px 0; text-align: center; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { background: var(--surface); font-weight: 600; text-align: left; padding: 9px 14px; border: 1px solid var(--border); }
td { padding: 8px 14px; border: 1px solid var(--border); vertical-align: top; }
tfoot td { font-weight: 600; background: var(--surface); }

/* References */
.references { font-size: 15px; line-height: 1.65; }
.references p { margin-bottom: 8px; }

/* Report-specific */
.report-header {
  border: 1px solid var(--border); border-radius: 5px;
  padding: 20px 24px; margin-bottom: 36px;
}
.report-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 16px; }
.rh-row { display: flex; gap: 8px; margin-bottom: 5px; font-size: 15px; }
.rh-label { font-weight: 600; min-width: 120px; }
.rh-val { color: var(--muted); }

.hash-block {
  font-family: var(--mono); font-size: 13px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 14px 16px; line-height: 2; margin: 12px 0; overflow-x: auto;
}
.pdf-link { display: inline-block; margin: 8px 0 0; font-size: 15px; }

/* Footer */
footer { max-width: var(--max); margin: 0 auto; padding: 0 24px 40px; font-size: 14px; color: var(--muted); }
footer a { color: var(--muted); }

/* Responsive */
@media (max-width: 600px) {
  .paper-title { font-size: 21px; }
  h2 { font-size: 17px; }
  article { padding: 32px 16px 64px; }
  nav { padding: 12px 16px; }
  .nav-links a { margin-left: 16px; }
}

/* Print (for PDF export of report) */
@media print {
  nav, footer { display: none; }
  body { font-size: 12pt; color: #000; }
  article { max-width: 100%; padding: 0; }
  h2 { font-size: 14pt; border-top: 1pt solid #ccc; padding-top: 12pt; margin-top: 24pt; }
  h3 { font-size: 12pt; }
  a { text-decoration: none; }
  .table-wrap { overflow: visible; }
  .hash-block { font-size: 9pt; line-height: 1.7; }
  .report-header { border: 1pt solid #ccc; }
}
