:root {
  --bg: #f7f7fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --soft-blue: #eff6ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: linear-gradient(135deg, #172554, #2563eb);
  color: white;
  padding: 56px 0;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.04em;
}

.site-tagline {
  margin-top: 16px;
  font-size: 1.2rem;
  opacity: 0.95;
}

.site-subtitle {
  margin-top: 8px;
  opacity: 0.8;
}

main {
  padding: 40px 0 80px;
}

.article-list h2 {
  margin-bottom: 20px;
}

.article-card {
  display: block;
  text-decoration: none;
  color: inherit;

  background: var(--card);
  border: 1px solid var(--line);

  border-radius: 18px;

  padding: 24px;

  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;

  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.article-card:hover {
  transform: translateY(-2px);

  border-color: #bfdbfe;

  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.08);
}

.article-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.article-card p {
  margin: 0;
  color: var(--muted);
}

header .wrap,
main {
  max-width: 1100px;
  margin: 0 auto;
}

section,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  margin: 18px 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

h2 {
  font-size: 1.7rem;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

h3 {
  margin: 22px 0 8px;
  font-size: 1.15rem;
}

.formula {
  display: inline-block;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 3px 7px;
  border-radius: 8px;
}

.callout {
  border-left: 5px solid var(--accent);
  background: var(--soft-blue);
  padding: 14px 16px;
  border-radius: 12px;
  margin: 16px 0;
}

.home-link {
  color: white;
  text-decoration: none;
  opacity: 0.9;
}

.home-link:hover {
  opacity: 1;
}

:root {
  --pos: #16a34a;
  --neg: #dc2626;
  --warn: #d97706;
  --soft-green: #ecfdf5;
  --soft-red: #fef2f2;
  --soft-yellow: #fffbeb;
  --code: #111827;
}

.muted { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fafafa;
}

.mini strong {
  display: block;
  margin-bottom: 4px;
}

.big-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin: 7px 0 3px;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.callout.warn {
  border-left-color: var(--warn);
  background: var(--soft-yellow);
}

.callout.good {
  border-left-color: var(--pos);
  background: var(--soft-green);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 12px;
  font-size: 0.96rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: #f3f4f6;
  font-weight: 700;
}

.confusion {
  max-width: 620px;
  margin: 18px auto;
}

.confusion th,
.confusion td {
  text-align: center;
  font-size: 1rem;
}

.tp {
  background: var(--soft-green);
  color: #166534;
  font-weight: 700;
}

.fp {
  background: var(--soft-red);
  color: #991b1b;
  font-weight: 700;
}

.fn {
  background: var(--soft-yellow);
  color: #92400e;
  font-weight: 700;
}

.tn {
  background: var(--soft-blue);
  color: #1e40af;
  font-weight: 700;
}

.axis-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.scatter {
  position: relative;
  height: 190px;
  background: linear-gradient(to right, #fee2e2 0 50%, #dcfce7 50% 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 10px;
}

.dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dot.pos { background: var(--pos); }
.dot.neg { background: var(--neg); }

.threshold {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #111827;
  left: 50%;
}

.threshold::after {
  content: "threshold";
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.caption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  margin: 16px 0;
}

.chart-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
}

svg.chart {
  width: 100%;
  min-width: 520px;
  max-height: 420px;
  display: block;
}

.axis-label {
  font-size: 13px;
  fill: var(--muted);
}

.tick-label {
  font-size: 11px;
  fill: var(--muted);
}

.curve-label {
  font-size: 12px;
  font-weight: 700;
  fill: var(--ink);
}

.footer-note {
  color: var(--muted);
  text-align: center;
  margin-top: 28px;
}

@media (max-width: 760px) {
  .axis-demo {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 8px;
    font-size: 0.88rem;
  }
}

.article-hero {
  background: linear-gradient(135deg, #172554, #2563eb);
  color: white;
  padding: 48px 24px;
}

.article-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.article-hero p {
  max-width: 760px;
  font-size: 1.15rem;
  opacity: 0.92;
  margin: 0;
}

.topbar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar .wrap {
  padding-top: 12px;
  padding-bottom: 12px;
}

.home-link {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 120ms ease;
}

.home-link:hover {
  opacity: 1;
}

.article-hero {
  background: linear-gradient(135deg, #172554, #2563eb);
  color: white;
  padding: 48px 24px;
}

.article-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.article-hero p {
  max-width: 760px;
  font-size: 1.15rem;
  opacity: 0.92;
  margin: 0;
}