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

:root {
  --color-primary: #7c3aed;
  --color-secondary: #5b21b6;
  --color-accent: #ddd6fe;
  --color-bg: #fefeff;
  --color-surface: #f5f3ff;
  --color-text: #2e1065;
  --color-text-muted: #7c6f9b;
  --color-border: #d8d0e8;
  --font-main: 'Courier New', 'Lucida Console', Monaco, monospace;
  --max-width: 1100px;
  --radius: 8px;
  --shadow-sm: inset 0 1px 3px rgba(123, 58, 237, 0.08);
  --shadow-md: 0 2px 8px rgba(123, 58, 237, 0.12);
  --shadow-lg: 0 4px 16px rgba(123, 58, 237, 0.16);
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-bg) 0%, #f8f6ff 100%);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 0.75em;
  color: var(--color-secondary);
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 0.5rem;
  margin-top: 1.5em;
}

h3 {
  font-size: 1.5rem;
  color: var(--color-primary);
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1.25em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  padding: 0 2px;
}

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

a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 700;
  color: var(--color-secondary);
}

em {
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  background: var(--color-surface);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-style: italic;
  color: var(--color-text-muted);
  position: relative;
}

blockquote::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.05) 0%, transparent 100%);
  border-radius: var(--radius);
  pointer-events: none;
}

::selection {
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

.site-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-header h1 {
  margin: 0;
  font-size: 1.75rem;
  background: white;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: white;
  padding: 0.5rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-nav a:focus-visible {
  outline: 3px solid white;
  outline-offset: 2px;
}

.breadcrumbs {
  padding: 1rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.breadcrumbs ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: '→';
  margin-left: 0.5rem;
  color: var(--color-border);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  border: none;
  padding: 0;
}

.breadcrumbs a:hover {
  color: var(--color-primary);
  background: none;
}

.site-main {
  padding: 2rem 0;
}

.site-footer {
  background: var(--color-surface);
  border-top: 3px solid var(--color-accent);
  padding: 2rem 0;
  margin-top: 4rem;
  box-shadow: var(--shadow-sm);
}

.site-footer p {
  text-align: center;
  color: var(--color-text-muted);
  margin: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

table thead {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
}

table th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 3px solid var(--color-secondary);
}

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

table tbody tr {
  transition: background-color 0.2s ease;
}

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

table tbody tr:hover {
  background: var(--color-accent);
  cursor: pointer;
}

details {
  margin: 1.5rem 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

details:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

details[open] {
  border-color: var(--color-primary);
}

summary {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--color-surface) 0%, white 100%);
  cursor: pointer;
  font-weight: 700;
  color: var(--color-secondary);
  transition: background-color 0.2s ease;
  user-select: none;
  position: relative;
}

summary:hover {
  background: var(--color-accent);
}

summary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: -3px;
}

summary::marker {
  color: var(--color-primary);
}

details[open] summary {
  border-bottom: 2px solid var(--color-accent);
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-surface) 100%);
}

details > *:not(summary) {
  padding: 1.5rem;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

ul:not(.site-nav ul):not(.breadcrumbs ul), ol {
  margin: 1rem 0 1.5rem 2rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  background: var(--color-surface);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-main);
  color: var(--color-secondary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

pre {
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

pre code {
  background: none;
  padding: 0;
  border: none;
  box-shadow: none;
}

hr {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--color-accent) 50%, transparent 100%);
  margin: 2rem 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

button, input[type="submit"], input[type="button"] {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

button:active, input[type="submit"]:active, input[type="button"]:active {
  transform: translateY(0);
}

button:focus-visible, input[type="submit"]:focus-visible, input[type="button"]:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

input[type="text"], input[type="email"], input[type="search"], textarea, select {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: white;
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

input[type="text"]:focus, input[type="email"]:focus, input[type="search"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent);
}

@media (min-width: 768px) {
  body {
    font-size: 18px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .site-main {
    padding: 3rem 0;
  }

  .card {
    padding: 2rem;
  }

  table th, table td {
    padding: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }

  .site-main {
    padding: 4rem 0;
  }

  .card {
    padding: 2.5rem;
  }

  blockquote {
    margin: 2.5rem 0;
    padding: 2rem 2rem 2rem 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header, .site-nav, .site-footer, .breadcrumbs {
    display: none;
  }

  body {
    background: white;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    border: 1px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    color: #000;
  }
}