/* === Global CSS Variables === */
:root {
  --bg-1:#0b0c0f;
  --bg-2:#14161b;
  --card:#101216;
  --ink:#e8e9ee;
  --muted:#a9adba;
  --border:#1e2127;
  --accent:#ff4d4d;
  --focus: rgba(255,77,77,.35);
  --sidebar-width: 280px;
}

/* === Base Styles === */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{height:100%;margin:0;padding:0}
body {
  color:var(--ink);
  font-family:Inter,system-ui,sans-serif;
  line-height:1.6;
  background:linear-gradient(180deg,var(--bg-1),var(--bg-2)) fixed;
  background-size:100% 100%;
}

/* === Layout === */
.layout {display: flex;min-height: 100vh;position: relative;}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--card);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg,rgba(255,77,77,.08),rgba(255,77,77,0));
}
.sidebar-title {
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--accent);
}
.sidebar-subtitle {font-size: 13px;color: var(--muted);margin: 0;}
.sidebar-nav {flex: 1;padding: 16px 0;}
.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s ease;
  border-left: 3px solid transparent;
  gap: 12px;
  font-weight: 500;
}
.nav-item:hover {background: rgba(255,255,255,.04);border-left-color: var(--accent);}
.nav-item.active {background: rgba(255,77,77,.1);border-left-color: var(--accent);color: var(--accent);}
.nav-icon {width: 20px;height: 20px;flex-shrink: 0;}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* === Sidebar Toggle === */
.sidebar-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  color: var(--ink);
  transition: left 0.3s ease;
}
.sidebar-toggle.sidebar-open {left: calc(var(--sidebar-width) - 50px);}
.sidebar-toggle svg {width: 24px;height: 24px;}
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}

/* === Main Content (Centered) === */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 0 56px;
}
.main-content > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 18px;
  padding-right: 18px;
}

/* === Common Page Elements === */
header{text-align:center; margin-bottom:32px}
h1{
  font-family:Manrope,sans-serif;
  font-weight:700;
  font-size:clamp(26px,3.8vw,40px);
  margin:0 0 8px
}
.subtitle{
  color:var(--muted);
  font-size:clamp(14px,1.9vw,16px);
  margin:0 auto;
  max-width:840px
}
footer{margin-top:48px; text-align:center; color:var(--muted); font-size:13px}
a{color:#4da3ff}
a:hover{color:#82c4ff}

/* === Content Card Styles === */
.content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  line-height: 1.75;
}

.guide-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  line-height: 1.75;
}
.guide-content h2 {
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 24px);
  margin: 1.5em 0 0.5em;
  color: var(--accent);
  scroll-margin-top: 80px;
}
.guide-content h3 {
  font-family: Manrope, sans-serif;
  font-weight: 600;
  font-size: clamp(16px, 2vw, 20px);
  margin: 1.2em 0 0.5em;
  color: var(--ink);
  scroll-margin-top: 80px;
}
.guide-content p {margin: 1em 0;}
.guide-content ul, .guide-content ol {margin: 1em 0;padding-left: 24px;}
.guide-content li {margin: 0.5em 0;}
.guide-content code {
  background: #0f1217;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}
.guide-content pre {
  background: #0f1217;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.guide-content pre code {background: none;padding: 0;}
.guide-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 1.5em 0;
  color: var(--muted);
  font-style: italic;
}
.guide-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.5em 0;
  display: block;
}
.guide-content a {color: var(--accent);text-decoration: none;}
.guide-content a:hover {text-decoration: underline;}
.guide-content strong {font-weight: 600;color: var(--ink);}

/* === Blog Post Styles === */
.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  scroll-margin-top: 80px;
}
.post-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.post-title {
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 32px);
  margin: 0 0 8px;
  color: var(--accent);
}
.post-date {color: var(--muted);font-size: 14px;font-weight: 600;}
.post-content {line-height: 1.75;}
.post-content h2 {
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 24px);
  margin: 1.5em 0 0.5em;
  color: var(--ink);
}
.post-content h3 {
  font-family: Manrope, sans-serif;
  font-weight: 600;
  font-size: clamp(16px, 2vw, 20px);
  margin: 1.2em 0 0.5em;
  color: var(--ink);
}
.post-content p {margin: 1em 0;}
.post-content ul, .post-content ol {margin: 1em 0;padding-left: 24px;}
.post-content li {margin: 0.5em 0;}
.post-content code {
  background: #0f1217;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}
.post-content pre {
  background: #0f1217;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.post-content pre code {background: none;padding: 0;}
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 1.5em 0;
  color: var(--muted);
  font-style: italic;
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.5em 0;
  display: block;
}
.post-content a {color: var(--accent);text-decoration: none;}
.post-content a:hover {text-decoration: underline;}
.post-content strong {font-weight: 600;color: var(--ink);}

[data-markdown] {visibility: hidden;}
[data-markdown].rendered {visibility: visible;}

/* === Gallery Styles (for GPTs page) === */
.gallery {display:grid; grid-template-columns:1fr; gap:22px;}
figure {
  margin:0;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--card);
  transition:.2s ease;
}
.media {position:relative; width:100%; height:320px}
.media img {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover
}
figcaption {
  padding:10px 12px 12px;
  text-align:center;
  color:var(--muted);
  font-weight:600;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.gpt-icon {width:20px; height:20px; flex-shrink:0;}
.gallery a {display:block; text-decoration:none; color:inherit;}
.gallery a:hover figure {transform:scale(1.02); box-shadow:0 8px 20px rgba(0,0,0,.35);}
.warning {
  background:rgba(255,77,77,0.15);
  border:1px solid rgba(255,77,77,0.3);
  border-radius:8px;
  padding:8px 12px;
  font-size:13px;
  color:#ffb3b3;
  margin-top:8px;
}

@media(min-width:780px) {
  .gallery {grid-template-columns:repeat(2,1fr)}
  .media {height:420px}
}

/* === Collapsed State === */
.sidebar.collapsed {transform: translateX(-100%);}
.sidebar.collapsed ~ .main-content {margin-left: 0;}
.sidebar.collapsed ~ .sidebar-toggle {left: 16px;}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .sidebar {transform: translateX(-100%);}
  .sidebar.open {transform: translateX(0);}
  .sidebar-overlay.show {display: block;}
  .main-content {margin-left: 0;padding-top: 64px;}
  figcaption {font-size:20px; padding:12px 12px 15px;}
  h1 {font-size:28px;}
  .subtitle {font-size:18px;}
  .gpt-icon {width:24px; height:24px;}
}
