:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;
  --accent: #1e3a8a;
  --accent-soft: #eff6ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.72;
  font-size: 17px;
}
header.topbar {
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 3px solid #1d4ed8;
  padding: 1.2rem 1.5rem;
}
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-decoration: none;
}
.brand-sub {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  color: #cbd5e1;
  display: block;
}
nav.nav-links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}
nav.nav-links a {
  color: #e2e8f0;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
nav.nav-links a:hover {
  background: #1e293b;
  color: #ffffff;
}
main {
  padding: 2.5rem 0 3.5rem;
}
.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.2rem 2.4rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.badge {
  display: inline-block;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #bfdbfe;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
h1 {
  font-size: 1.95rem;
  line-height: 1.28;
  margin: 0.2rem 0 0.9rem;
  color: #0f172a;
}
h2 {
  font-size: 1.38rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-top: 2.1rem;
  color: #0f172a;
}
h3 {
  font-size: 1.14rem;
  margin-top: 1.5rem;
  color: #1e293b;
}
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  color: #1d4ed8;
}
.meta-line {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
}
tr:nth-child(even) td {
  background: #f8fafc;
}
.formula-box {
  background: #f8fafc;
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.2rem 0;
  font-family: 'Cambria Math', 'Georgia', serif;
}
.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  font-family: system-ui, -apple-system, sans-serif;
  margin-top: 1rem;
}
.sim-grid label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.3rem;
}
.sim-grid input, .sim-grid select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  font-size: 0.95rem;
}
.sim-result {
  margin-top: 1.1rem;
  padding: 1rem 1.2rem;
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.94rem;
}
.ref-list li {
  margin-bottom: 0.7rem;
}
footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 2rem 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.88rem;
}
footer a {
  color: #93c5fd;
}
@media (max-width: 640px) {
  .paper-card { padding: 1.35rem 1.15rem; }
  h1 { font-size: 1.5rem; }
}
