:root {
  --bg: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1f2940;
  --bg-input: #2a3550;
  --text: #e0e0e0;
  --text-muted: #8892a4;
  --primary: #e74c3c;
  --primary-hover: #c0392b;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --border: #2d3748;
  --radius: 8px;
  --transition: 0.25s ease;
  --sidebar-w: 260px;
  --header-h: 60px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.header.hide {
  transform: translateY(-100%);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.header-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.sidebar-logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.header-nav {
  display: flex;
  gap: 1rem;
  margin-left: 2rem;
}

.header-nav a {
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text);
  background: var(--bg-card);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

#container {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  padding-top: var(--header-h);
}

#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 2rem 1.2rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: stretch;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  margin-bottom: 1rem;
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.03em;
}

#sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#sidebar nav ul li {
  margin-bottom: 1.1rem;
  width: 100%;
}

#sidebar nav ul li a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 1.08rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

#sidebar nav ul li a:hover,
#sidebar nav ul li a.active {
  background: var(--bg-card);
  color: var(--text);
}

#content {
  flex: 1;
  padding: 2.5rem 3.5rem;
  width: auto;
  max-width: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.14);
}

h1, h2, h3 {
  color: var(--text);
  font-weight: 700;
}

h1 {
  margin-bottom: 1rem;
}

p, li {
  color: var(--text);
}

ul {
  margin-left: 1rem;
  margin-bottom: 1.5rem;
}

ol {
  margin-left: 1.25rem;
  margin-bottom: 1.5rem;
}

code {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 0.15rem 0.3rem;
  border-radius: 0.35rem;
}

pre {
  background: rgba(255,255,255,0.06);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
}

#sidebar {
  padding-top: 1.5rem;
}

.header-nav a.active,
.header-nav a:hover {
  color: var(--text);
  background: var(--bg-card);
}

blockquote,
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

@media (max-width: 900px) {
  #container {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  #content {
    padding: 1.5rem;
  }
  .header {
    padding: 0 1rem;
  }
}
