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

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

: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: 'Georgia', 'Times New Roman', 'Palatino', serif;
  --max-width: 1100px;
  --radius: 6px;
  --shadow-sm: inset 0 1px 2px rgba(123, 58, 237, 0.06);
  --shadow-md: 0 2px 8px rgba(123, 58, 237, 0.08);
  --shadow-lg: 0 4px 16px rgba(123, 58, 237, 0.12);
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-bg) 0%, #f9f8ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(123, 58, 237, 0.04);
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

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

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

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

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

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

blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(221, 214, 254, 0.3) 100%);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

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

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

.site-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 243, 255, 0.95) 100%);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-header h1 {
  font-size: 1.75rem;
  margin: 0;
  text-shadow: none;
}

.site-header h1 a {
  color: var(--color-text);
  border-bottom: none;
}

.site-header h1 a:hover {
  color: var(--color-primary);
}

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

.site-nav li {
  display: inline-block;
}

.site-nav a {
  display: block;
  padding: 0.5rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 0.95rem;
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
  box-shadow: var(--shadow-sm);
}

.site-nav a:hover {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-color: var(--color-secondary);
  color: white;
  box-shadow: var(--shadow-md);
}

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

.site-footer {
  background: linear-gradient(180deg, var(--color-surface) 0%, rgba(221, 214, 254, 0.4) 100%);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  margin-top: 4rem;
  box-shadow: inset 0 2px 4px rgba(123, 58, 237, 0.04);
}

.site-footer .container {
  display: grid;
  gap: 2rem;
}

.site-footer p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

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

.breadcrumbs a:hover {
  color: var(--color-secondary);
}

.breadcrumbs li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: '›';
  color: var(--color-text-muted);
  font-weight: 400;
}

.breadcrumbs li:last-child {
  color: var(--color-text-muted);
}

.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, var(--color-surface) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.card h2,
.card h3 {
  margin-top: 0;
}

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

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

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--color-secondary);
  letter-spacing: 0.02em;
}

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

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

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

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

tbody tr:last-child td {
  border-bottom: none;
}

details {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

details[open] {
  box-shadow: var(--shadow-md);
}

summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-text);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, var(--color-surface) 100%);
  border-radius: var(--radius);
  transition: background-color var(--transition), color var(--transition);
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform var(--transition);
  color: var(--color-primary);
  font-size: 1.1em;
}

details[open] summary::before {
  transform: rotate(90deg);
}

summary:hover {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-surface) 100%);
  color: var(--color-secondary);
}

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

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

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

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 rgba(124, 58, 237, 0.1), var(--shadow-sm);
}

button,
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

button:hover,
.button:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  border-color: var(--color-primary);
  color: white;
}

button:active,
.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  .site-header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

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

  .site-nav {
    gap: 0.75rem;
  }

  .site-footer .container {
    grid-template-columns: repeat(2, 1fr);
  }

  .container {
    padding: 0 2rem;
  }

  .card {
    padding: 2.5rem;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-nav a {
    padding: 0.625rem 1.25rem;
  }

  .site-footer .container {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .card {
    padding: 3rem;
  }

  table {
    font-size: 1rem;
  }

  th {
    padding: 1.25rem;
  }

  td {
    padding: 1rem 1.25rem;
  }
}

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

  details > *:not(summary) {
    animation: none;
  }
}

@media print {
  body {
    background: white;
  }

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

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

  .site-main {
    padding: 0;
  }

  a {
    color: var(--color-text);
    border-bottom: none;
  }

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

  table {
    page-break-inside: avoid;
  }

  details[open] summary ~ * {
    display: block;
  }
}