:root {
  --color-primary: #1E4D5C;
  --color-secondary: #7A4E2D;
  --color-accent: #C46A2B;
  --color-background: #F6F3EE;
  --color-surface: #FFFFFF;
  --color-text: #1B1F23;
  --color-text-muted: #4B5560;
  --color-border: #D7D0C6;
  --radius: 4px;
  --shadow: 0 2px 8px rgba(27, 31, 35, 0.08);
  --space: 1.5rem;
  --maxw: 68ch;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 100%;
}

header {
  background-color: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  padding: var(--space) 5vw;
  box-shadow: var(--shadow);
}

header .header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

header .site-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

header .site-name:hover {
  color: var(--color-accent);
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s ease;
  position: relative;
}

nav a:hover {
  color: var(--color-primary);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--space) * 2) 5vw;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: 0.75em;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  max-width: var(--maxw);
}

h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  color: var(--color-secondary);
}

h3 {
  font-size: 1.375rem;
  margin-top: 2rem;
}

p {
  max-width: var(--maxw);
  margin-bottom: 1.25rem;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

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

button:focus-visible,
summary:focus-visible,
details:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

nav[aria-label="Breadcrumb"] {
  margin-bottom: calc(var(--space) * 1.5);
  font-size: 0.9375rem;
}

nav[aria-label="Breadcrumb"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

nav[aria-label="Breadcrumb"] li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--color-text-muted);
}

nav[aria-label="Breadcrumb"] a {
  color: var(--color-text-muted);
  text-decoration: none;
}

nav[aria-label="Breadcrumb"] a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

blockquote {
  max-width: var(--maxw);
  margin: calc(var(--space) * 1.5) 0;
  padding: 1.25rem 1.5rem;
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  font-style: italic;
  color: var(--color-text-muted);
  box-shadow: var(--shadow);
}

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

table {
  width: 100%;
  max-width: 100%;
  margin: calc(var(--space) * 1.5) 0;
  border-collapse: collapse;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 1rem;
}

caption {
  font-weight: 700;
  text-align: left;
  padding: 1rem;
  background-color: var(--color-primary);
  color: var(--color-surface);
  font-size: 1.125rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

thead {
  background-color: var(--color-secondary);
  color: var(--color-surface);
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--color-border);
}

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

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

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

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

tbody tr:hover {
  background-color: rgba(30, 77, 92, 0.05);
}

.table-wrapper {
  overflow-x: auto;
  margin: calc(var(--space) * 1.5) 0;
  border-radius: var(--radius);
}

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

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

summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: var(--color-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  transition: transform 0.3s ease;
}

details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

summary:hover {
  background-color: rgba(30, 77, 92, 0.05);
  color: var(--color-accent);
}

details div {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--color-border);
}

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

ul, ol {
  max-width: var(--maxw);
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

footer {
  background-color: var(--color-surface);
  border-top: 2px solid var(--color-border);
  padding: calc(var(--space) * 1.5) 5vw;
  margin-top: calc(var(--space) * 3);
}

footer .footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

section {
  margin-bottom: calc(var(--space) * 2.5);
}

@media (min-width: 768px) {
  h1 {
    font-size: 2.75rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  header .header-inner {
    flex-wrap: nowrap;
  }
  
  nav ul {
    gap: 2rem;
  }
  
  table {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
  
  main {
    padding: calc(var(--space) * 3) 5vw;
  }
}

@media print {
  body {
    background-color: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }
  
  header, footer, nav {
    display: none;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.875em;
  }
  
  details {
    border: 1px solid #ccc;
  }
  
  details[open] summary {
    border-bottom: 1px solid #ccc;
  }
  
  summary::after {
    display: none;
  }
  
  table {
    border: 1px solid black;
  }
  
  th, td {
    border: 1px solid black;
    padding: 0.5rem;
  }
  
  thead {
    background-color: #eee;
  }
  
  tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  table, figure, blockquote {
    page-break-inside: avoid;
  }
}