:root {
  --primary-color: #2563eb;
  --primary-light: #eff6ff;
  --primary-dark: #1e40af;
  --secondary-color: #10b981;
  --text-main: #334155;
  --text-light: #64748b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --border-radius: 12px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body, html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}
img, video { max-width: 100%; height: auto; display: block; }
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }
a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.2s ease;
}
a:hover {
  color: var(--primary-dark);
}
.site-header {
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span {
  color: var(--secondary-color);
}
.nav-links {
  display: flex;
  gap: 1.5rem;
}
.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
.nav-links a:hover, .nav-links a.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}
.main-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2.5rem;
  align-items: start;
}
.content-area {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--primary-color);
}
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.article-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 1rem;
}
.article-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  gap: 1rem;
  align-items: center;
}
.content-image {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  max-width: 100%;
  display: block;
}
figure.content-figure {
  margin: 2rem 0;
  width: 100%;
}
figure.content-figure img {
  margin-bottom: 0.5rem;
}
figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
  padding: 0 1rem;
}
.content-area h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 80px;
}
.content-area h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 1.5rem 0 0.75rem;
}
.content-area p {
  margin-bottom: 1.25rem;
}
.content-area ul, .content-area ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.content-area li {
  margin-bottom: 0.5rem;
}
.content-area strong {
  color: #0f172a;
  font-weight: 600;
}
.content-area blockquote {
  border-left: 4px solid var(--primary-color);
  background-color: var(--primary-light);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--primary-dark);
}
.highlight-box {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}
.highlight-box h4 {
  color: #166534;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}
.sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.widget {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #0f172a;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}
.related-posts {
  list-style: none;
  padding: 0;
}
.related-posts li {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}
.related-posts li:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}
.related-posts a {
  display: block;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.related-posts a:hover {
  color: var(--primary-color);
}
.related-posts span {
  font-size: 0.8rem;
  color: var(--text-light);
}
.site-footer {
  background-color: #0f172a;
  color: #cbd5e1;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}
.footer-content .footer-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}
.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: #ffffff;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.custom-table th, .custom-table td {
  padding: 1rem 1.25rem;
  text-align: left;
}
.custom-table th {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
}
.custom-table tr {
  border-bottom: 1px solid var(--border-color);
}
.custom-table tr:last-of-type {
  border-bottom: none;
}
.custom-table tbody tr:hover {
  background-color: #f1f5f9;
}
.faq-accordion {
  margin: 2rem 0;
}
.faq-accordion details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.faq-accordion summary {
  padding: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #0f172a;
}
.faq-accordion summary::-webkit-details-marker {
  display: none;
}
.faq-accordion summary::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary-color);
  line-height: 1;
}
.faq-accordion details[open] summary::after {
  content: '−';
}
.faq-accordion .faq-content {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 1rem;
}
.flowchart-wrapper {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin: 2rem 0;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: center;
}
.mermaid text {
  font-weight: 700 !important;
}
.mermaid .edgePath .path {
  stroke-width: 2.5px !important;
}
.mermaid .node rect, .mermaid .node polygon, .mermaid .node circle, .mermaid .node ellipse {
  stroke-width: 2.5px !important;
}
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.state-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.state-card:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
@media (max-width: 992px) {
  .main-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}
@media (max-width: 768px) {
  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    position: relative;
  }
  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
  }
  .nav-toggle-label span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: 0.3s;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    padding: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
  }
  .nav-links a {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  
  .article-title { font-size: 1.5rem; line-height: 1.4; }
  .main-container { padding: 0 1.25rem; width: 100%; box-sizing: border-box; }
  .content-area { padding: 1.5rem 1.25rem; width: 100%; box-sizing: border-box; overflow-wrap: break-word; }
  .flowchart-wrapper { width: 100%; overflow-x: scroll; }
}