* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  background-color: #f5f7fa;
  color: #1f2933;
  padding-bottom: 4rem;
}

header {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
}

nav {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem;
  background-color: #e5e7eb;
  flex-wrap: wrap;
}

nav button {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s, transform 0.1s;
}

nav button:hover {
  background-color: #1e40af;
  transform: translateY(-1px);
}

section {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1.5rem;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

section + section {
  margin-top: 2.5rem;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #1e3a8a;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: #1e40af;
}

p {
  margin-bottom: 0.75rem;
}

ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.4rem;
}

.tip {
  background-color: #eff6ff;
  border-left: 4px solid #2563eb;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 6px;
}

label {
  font-weight: 500;
  margin-right: 0.5rem;
}

input[type="number"],
select {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

button {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background-color 0.2s, transform 0.1s;
}

button:hover {
  background-color: #1e40af;
  transform: translateY(-1px);
}

canvas {
  display: block;
  margin: 1.5rem auto 0 auto;
  background-color: #f9fafb;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.text-error {
    color: red;
}

@media (max-width: 768px) {
  section {
    margin: 1rem;
    padding: 1rem;
  }

  header h1 {
    font-size: 1.6rem;
  }

  nav {
    gap: 0.5rem;
  }
}
