:root {
  --bg: #f5f9ff;
  --bg-deep: #eaf2ff;
  --paper: #ffffff;
  --paper-soft: #f8fbff;
  --text: #1b2735;
  --muted: #607287;
  --primary: #0f8f98;
  --primary-strong: #0a737d;
  --accent: #33ae7e;
  --border: #d7e3f2;
  --border-strong: #c4d7eb;
  --shadow-lg: 0 16px 38px rgba(16, 46, 79, 0.12);
  --shadow-md: 0 8px 20px rgba(16, 46, 79, 0.09);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(900px 520px at 4% -8%, #dbf2ff 0%, transparent 62%),
    radial-gradient(860px 500px at 96% 0%, #e3ffef 0%, transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 82%);
  opacity: 0.35;
  z-index: -1;
}

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

main {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(199, 218, 238, 0.9);
}

.header-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  background: linear-gradient(140deg, #10a2b0, #58c3d2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px rgba(16, 146, 162, 0.33);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  text-decoration: none;
  color: #395773;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 11px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--primary-strong);
  background: #edf6ff;
}

.hero {
  padding: 56px 0 30px;
  text-align: center;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 3.2vw + 1rem, 3.35rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.35rem, 1.45vw + 1rem, 2rem);
}

h3 {
  font-size: clamp(1.02rem, 0.4vw + 0.9rem, 1.18rem);
}

p {
  margin: 0;
}

.lead {
  margin: 14px auto 0;
  max-width: 780px;
  color: var(--muted);
  font-size: clamp(1rem, 0.45vw + 0.9rem, 1.12rem);
}

.tool-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, var(--paper), var(--paper-soft));
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(15, 143, 152, 0.8), rgba(51, 174, 126, 0.8));
  opacity: 0.45;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(16, 46, 79, 0.16);
  border-color: var(--border-strong);
}

.card-body {
  padding: 20px;
}

.stack {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: #3f617f;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid #c4d9ee;
  border-radius: var(--radius-md);
  font: inherit;
  color: var(--text);
  background: #ffffff;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.08s ease;
}

input::placeholder,
select::placeholder {
  color: #88a0b8;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 143, 152, 0.14);
}

input:active,
select:active {
  transform: translateY(1px);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 11px;
  padding: 10px 13px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.18s ease;
}

.btn-secondary {
  background: linear-gradient(135deg, #e7f2fd, #ddeeff);
  color: #325978;
}

.btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.result {
  color: var(--primary-strong);
  font-size: 1.03rem;
  font-weight: 800;
}

.result small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.84rem;
}

.formula-list {
  display: grid;
  gap: 10px;
}

.formula-item {
  border: 1px solid #d5e5f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #f3f9ff, #edf6ff);
  padding: 10px 12px;
  color: #224968;
  font-weight: 700;
}

.related-grid,
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tool-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-link:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 13px 26px rgba(16, 46, 79, 0.13);
}

.tool-link h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.tool-link p {
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  margin: 18px 0;
}

.section .card {
  background: #fff;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: #3c5973;
}

.list li {
  margin: 7px 0;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.site-footer {
  margin-top: 30px;
  border-top: 1px solid #cfe2f2;
  background: rgba(255, 255, 255, 0.84);
}

.footer-wrap {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: #355a76;
  font-size: 0.89rem;
  font-weight: 700;
}

.footer-links a:hover {
  text-decoration: underline;
  color: var(--primary-strong);
}

.copy {
  color: var(--muted);
  font-size: 0.86rem;
}

.mini {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .tool-layout,
  .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header-wrap {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }

  .hero {
    padding-top: 36px;
  }

  .card-body {
    padding: 16px;
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
