:root {
  --bg-light: #ffffff; --bg-dark: #121212; 
  --text-light: #111; --text-dark: #f1f1f1;
  --text-muted-light: #6b7280; --text-muted-dark: #9ca3af; 
  --accent: #007aff;
  --border-light: #e5e7eb; --border-dark: #374151;
  --code-bg-light: #f3f4f6; --code-bg-dark: #1f2937;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg-light);
  color: var(--text-light);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}
body.dark {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

.page-container {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  max-width: 1440px;
  margin: 0 auto;
}

.left-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--border-light);
  transition: border-color 0.3s ease;
}
body.dark .left-sidebar { border-right-color: var(--border-dark); }
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-bottom: 24px; }
.logo-img { height: 32px; }
.logo-link h1 { margin: 0; font-weight: 700; font-size: 1.5rem; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.nav-section-header { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted-light); padding: 16px 12px 4px; margin-top: 16px; }
body.dark .nav-section-header { color: var(--text-muted-dark); }
.sidebar-nav a { display: block; padding: 8px 12px; text-decoration: none; color: var(--text-light); border-radius: 6px; font-size: 0.95rem; transition: color 0.2s ease, background-color 0.2s ease; }
body.dark .sidebar-nav a { color: var(--text-dark); }
.sidebar-nav a:hover { background-color: var(--code-bg-light); }
body.dark .sidebar-nav a:hover { background-color: var(--code-bg-dark); }
.sidebar-nav a.active { color: var(--accent); font-weight: 600; }

.main-content { padding: 48px 64px; max-width: 800px; width: 100%; }
.main-content section { margin-bottom: 64px; }
.page-title { font-size: 3rem; font-weight: 800; margin-bottom: 48px; }
.version-entry { padding-bottom: 24px; border-bottom: 1px solid var(--border-light); margin-bottom: 32px; transition: border-color 0.3s ease; }
body.dark .version-entry { border-bottom-color: var(--border-dark); }
.version-entry:last-of-type { border-bottom: none; }
.version-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.version-header h3 { font-size: 1.75rem; font-weight: 600; margin: 0; }
.version-header time { font-size: 0.9rem; color: var(--text-muted-light); }
body.dark .version-header time { color: var(--text-muted-dark); }
.changelog-list { list-style: none; padding-left: 0; }
.changelog-list li { margin-bottom: 8px; color: var(--text-muted-light); }
body.dark .changelog-list li { color: var(--text-muted-dark); }
.contact-section-item { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.contact-section-item:last-of-type { border-bottom: none; }
body.dark .contact-section-item { border-bottom-color: var(--border-dark); }
.contact-section-item h3 { font-size: 1.5rem; margin: 0 0 16px 0; font-weight: 600; }
.contact-section-item p { margin: 0;}
.contact-section-item a { color: var(--accent); font-weight: 500; text-decoration: none; }
.contact-section-item a:hover { text-decoration: underline; }
.qr-code { max-width: 180px; border-radius: 8px; border: 1px solid var(--border-light); padding: 5px; background: #fff; display: block; margin-top: 16px; }
body.dark .qr-code { border-color: var(--border-dark); }

.page-footer { display: flex; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border-light); margin-top: 32px; }
body.dark .page-footer { border-top-color: var(--border-dark); }
.page-footer a { color: var(--text-muted-light); text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
body.dark .page-footer a { color: var(--text-muted-dark); }
.page-footer a:hover { color: var(--accent); }

.right-sidebar { position: sticky; top: 0; height: 100vh; padding-top: 48px; }
#themeToggleContainer { text-align: right; padding: 0 24px 16px; }
#themeToggle { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; padding: 6px; border-radius: 50%; cursor: pointer; color: var(--text-muted-light); transition: all 0.2s ease; }
body.dark #themeToggle { color: var(--text-muted-dark); }
#themeToggle:hover { color: var(--accent); background-color: var(--code-bg-light); }
body.dark #themeToggle:hover { background-color: var(--code-bg-dark); }
.sun-icon { display: block; } .moon-icon { display: none; }
body.dark .sun-icon { display: none; } body.dark .moon-icon { display: block; }
.toc-container { font-size: 0.85rem; }
.toc-container h4 { margin: 0 0 16px 24px; font-weight: 700; text-transform: uppercase; color: var(--text-muted-light); }
body.dark .toc-container h4 { color: var(--text-muted-dark); }
.toc-container ul { list-style: none; padding-left: 0; }
.toc-container ul ul { padding-left: 16px; margin-top: 8px; }
.toc-container li { margin-bottom: 8px; }
.toc-container a { display: block; padding: 4px 24px; color: var(--text-muted-light); text-decoration: none; transition: color 0.2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.dark .toc-container a { color: var(--text-muted-dark); }
.toc-container a:hover, .toc-container a.active { color: var(--text-light); font-weight: 500; }
body.dark .toc-container a:hover, body.dark .toc-container a.active { color: var(--text-dark); }

@media (max-width: 1024px) {
  .page-container { grid-template-columns: 220px 1fr; }
  .right-sidebar { display: none; }
  .main-content { padding: 32px; }
}
@media (max-width: 768px) {
  .page-container { display: block; }
  .left-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border-light); padding: 16px; }
  body.dark .left-sidebar { border-bottom-color: var(--border-dark); }
  .main-content { padding: 32px 16px; }
  .page-title { font-size: 2.5rem; }
  .version-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}