*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary-color: #1F2937;
  --accent-color: #3B82F6;
  --background: #FFFFFF;
  --surface: #F9FAFB;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --border-color: #E5E7EB;
  --code-bg: #F3F4F6;
  --table-stripe: #F9FAFB;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #1F2937;
    --accent-color: #60A5FA;
    --background: #0F172A;
    --surface: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border-color: #334155;
    --code-bg: #1E293B;
    --table-stripe: #334155;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
}

header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #374151 100%);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subtitle {
  margin: 0;
  font-size: 1.125rem;
  opacity: 0.9;
  font-weight: 300;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

section {
  margin-bottom: 3rem;
}

h2 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 700;
  margin: 2.5rem 0 1.25rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent-color);
}

h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
}

p {
  margin: 1rem 0;
  color: var(--text-primary);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover {
  border-bottom-color: var(--accent-color);
}

ul, ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin: 0.5rem 0;
}

.step-list {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.step-list > li {
  counter-increment: step;
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--surface);
  border-left: 4px solid var(--accent-color);
  border-radius: 0.5rem;
  position: relative;
}

.step-list > li::before {
  content: counter(step);
  position: absolute;
  left: -1rem;
  top: 1rem;
  width: 2rem;
  height: 2rem;
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.step-list > li h3 {
  margin-top: 0;
}

.info-box {
  background-color: var(--surface);
  border-left: 4px solid var(--accent-color);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

.info-box h3 {
  margin-top: 0;
  color: var(--accent-color);
}

code {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Mono", "Droid Sans Mono", "Source Code Pro", monospace;
  font-size: 0.875em;
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  color: var(--text-primary);
}

pre {
  background-color: var(--code-bg);
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

pre code {
  background-color: transparent;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background-color: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

thead {
  background-color: var(--primary-color);
  color: white;
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border-color);
}

tbody tr:nth-child(even) {
  background-color: var(--table-stripe);
}

tbody tr:hover {
  background-color: var(--surface);
}

.note {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-style: italic;
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

footer {
  background-color: var(--surface);
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

footer a {
  color: var(--accent-color);
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  main {
    padding: 1.5rem 1rem 3rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .step-list > li {
    padding: 1rem;
    padding-left: 0.5rem;
  }

  .step-list > li::before {
    left: -0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.625rem 0.75rem;
  }

  pre {
    padding: 1rem;
    font-size: 0.8125rem;
  }
}

@media print {
  body {
    background-color: white;
    color: black;
  }

  header {
    background: var(--primary-color);
    color: white;
    page-break-after: avoid;
  }

  section {
    page-break-inside: avoid;
  }

  h2 {
    page-break-after: avoid;
    color: var(--primary-color);
  }

  a {
    color: var(--accent-color);
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.875em;
    color: var(--text-secondary);
  }

  .info-box, .step-list > li {
    page-break-inside: avoid;
    border: 1px solid var(--border-color);
  }

  pre, code {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
  }

  table {
    page-break-inside: avoid;
  }

  thead {
    background-color: var(--primary-color);
    color: white;
  }

  footer {
    page-break-before: always;
  }
}