:root {
  color-scheme: dark;
  --page: #070d18;
  --surface: #0d1626;
  --surface-2: #111e32;
  --surface-3: #16253c;
  --line: rgba(138, 166, 211, 0.22);
  --line-strong: rgba(138, 166, 211, 0.38);
  --text: #eef4ff;
  --muted: #aebbd0;
  --accent: #db5153;
  --accent-soft: rgba(219, 81, 83, 0.13);
  --answer: #f5b85b;
  --answer-soft: rgba(245, 184, 91, 0.12);
  --success: #69d39f;
  --shadow: 0 24px 55px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(47, 77, 126, 0.19), transparent 34rem),
    radial-gradient(circle at 88% 30%, rgba(219, 81, 83, 0.08), transparent 32rem),
    var(--page);
  color: var(--text);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.68;
}

a {
  color: inherit;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.94);
}

.header-inner {
  display: flex;
  width: min(1180px, calc(100% - 36px));
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
}

.logo {
  display: block;
  width: clamp(220px, 27vw, 360px);
  height: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-nav a,
.action-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(25, 37, 59, 0.95), rgba(15, 24, 40, 0.98));
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.site-nav a:hover,
.action-link:hover,
.site-nav a:focus-visible,
.action-link:focus-visible {
  border-color: rgba(219, 81, 83, 0.72);
  color: #ff8587;
  transform: translateY(-1px);
}

.toolbar {
  border-bottom: 1px solid var(--line);
  background: rgba(13, 22, 38, 0.92);
}

.toolbar-inner {
  display: flex;
  width: min(1060px, calc(100% - 36px));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  padding: 12px 0;
}

.toolbar-title {
  color: var(--muted);
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-link {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.91rem;
}

.page-shell {
  width: min(1060px, calc(100% - 36px));
  margin: 32px auto 64px;
}

.resolution {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15, 27, 46, 0.98), rgba(8, 16, 29, 0.99));
  box-shadow: var(--shadow);
}

.resolution-heading {
  padding: 34px clamp(22px, 5vw, 58px) 30px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(130deg, rgba(40, 64, 104, 0.48), rgba(11, 20, 35, 0.72)),
    radial-gradient(circle at 85% 15%, rgba(219, 81, 83, 0.2), transparent 18rem);
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ff8a8c;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 4.7vw, 3.2rem);
  line-height: 1.12;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.item-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 18px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 14, 25, 0.75);
}

.item-nav a {
  min-width: 42px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.item-nav a:hover,
.item-nav a:focus-visible {
  border-color: var(--accent);
  color: #ff8a8c;
}

.resolution-content {
  display: grid;
  gap: 22px;
  padding: 30px clamp(18px, 5vw, 54px) 50px;
}

.item {
  scroll-margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(10, 19, 33, 0.78);
}

.item > h2 {
  margin: 0;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), rgba(20, 36, 59, 0.64));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
}

.item-body {
  padding: 18px 20px 22px;
}

.item-body > :first-child {
  margin-top: 0;
}

.item-body > :last-child {
  margin-bottom: 0;
}

p,
ul,
ol {
  margin: 0.8em 0;
}

li + li {
  margin-top: 0.35em;
}

.answer {
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(245, 184, 91, 0.34);
  border-left: 5px solid var(--answer);
  border-radius: 12px;
  background: var(--answer-soft);
  color: #ffe0a8;
  font-weight: 800;
}

.note {
  margin: 14px 0;
  padding: 12px 15px;
  border-left: 4px solid #70a7f5;
  border-radius: 8px;
  background: rgba(75, 130, 205, 0.1);
  color: #cfe1fa;
}

.formula {
  overflow-x: auto;
  padding: 9px 3px;
  text-align: center;
}

.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: rgba(5, 12, 23, 0.72);
  font-size: 0.93rem;
}

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

th {
  background: rgba(38, 61, 96, 0.62);
  color: #f5f8ff;
  font-weight: 800;
}

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

.compact-table table {
  min-width: 440px;
}

.diagram {
  margin: 18px auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 12, 23, 0.68);
}

.diagram svg {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
  margin: 0 auto;
}

.diagram .axis,
.diagram .edge {
  stroke: #9eb1cf;
  stroke-width: 2;
  fill: none;
}

.diagram .guide {
  stroke: #6f819d;
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}

.diagram .curve {
  stroke: #ff8587;
  stroke-width: 4;
  fill: none;
}

.diagram .node {
  fill: #172b46;
  stroke: #89a8d5;
  stroke-width: 2;
}

.diagram text {
  fill: #e9f1ff;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 15px;
}

.diagram .accent-text {
  fill: #ff9b9d;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mini-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 34, 56, 0.56);
}

.mini-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.source-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #050a14;
}

.footer-inner {
  display: flex;
  width: min(1060px, calc(100% - 36px));
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner img {
  display: block;
  width: 190px;
  height: auto;
}

@media (max-width: 760px) {
  .header-inner,
  .toolbar-inner,
  .footer-inner {
    flex-direction: column;
    justify-content: center;
    padding: 18px 0;
    text-align: center;
  }

  .site-nav,
  .toolbar-actions {
    justify-content: center;
  }

  .page-shell {
    width: min(100% - 22px, 1060px);
    margin-top: 18px;
  }

  .resolution {
    border-radius: 20px;
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .header-inner,
  .toolbar-inner,
  .footer-inner {
    width: min(100% - 22px, 1060px);
  }

  .site-nav a,
  .action-link {
    padding-inline: 12px;
  }

  .resolution-heading {
    padding-inline: 18px;
  }

  .item-body {
    padding-inline: 15px;
  }

  .item > h2 {
    padding-inline: 15px;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .toolbar,
  .item-nav,
  .site-footer {
    display: none;
  }

  .page-shell {
    width: 100%;
    margin: 0;
  }

  .resolution,
  .item {
    border-color: #bbb;
    background: #fff;
    box-shadow: none;
  }

  .resolution-heading,
  .item > h2,
  .answer,
  .note,
  th,
  .mini-card,
  .diagram,
  table {
    background: #fff;
    color: #111;
  }

  .item {
    break-inside: avoid;
  }
}
