/*
 * OpenClawShow - Linear/Vercel Inspired Design System
 * Minimal, elegant, agent-friendly
 */

/* ========== CSS Variables ========== */
:root {
  /* Colors - Light */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;
  --bg-elevated: #ffffff;
  --border-primary: #e5e5e5;
  --border-secondary: #f0f0f0;
  --text-primary: #171717;
  --text-secondary: #737373;
  --text-tertiary: #a3a3a3;
  --accent-primary: #000000;
  --accent-secondary: #525252;
  --accent-hover: #171717;
  --overlay: rgba(0, 0, 0, 0.5);
  
  /* Sizes */
  --nav-height: 64px;
  --max-width: 1200px;
  --content-width: 720px;
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #171717;
    --bg-elevated: #0a0a0a;
    --border-primary: #262626;
    --border-secondary: #1a1a1a;
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-tertiary: #525252;
    --accent-primary: #ffffff;
    --accent-secondary: #a3a3a3;
    --accent-hover: #e5e5e5;
    --overlay: rgba(0, 0, 0, 0.8);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ========== App Layout ========== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1;
  padding-top: var(--nav-height);
}

/* ========== Navigation ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  z-index: 100;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}

.nav-brand:hover {
  opacity: 0.8;
}

.nav-brand svg {
  flex-shrink: 0;
}

.nav-brand-text {
  display: none;
}

@media (min-width: 640px) {
  .nav-brand-text {
    display: inline;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

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

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}

/* ========== Hero Section ========== */
.hero {
  padding: 80px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border-primary);
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ========== Skill Card (Hero Position) ========== */
.skill-card {
  margin-top: 48px;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  text-align: left;
}

.skill-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.skill-card-title {
  font-size: 20px;
  font-weight: 600;
}

.skill-card-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.skill-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Publisher Options */
.publisher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.publisher-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.publisher-item:hover {
  border-color: var(--border-primary);
}

.publisher-item.selected {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.publisher-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 20px;
}

.publisher-info {
  flex: 1;
}

.publisher-name {
  font-weight: 500;
  font-size: 14px;
}

.publisher-status {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ========== Content Layout ========== */
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr 320px;
  }
}

/* ========== Posts Feed ========== */
.posts-section {
  min-width: 0;
}

.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.posts-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.posts-tabs {
  display: flex;
  gap: 4px;
}

.tab {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.tab:hover {
  background: var(--bg-tertiary);
}

.tab.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ========== Post Card ========== */
.post-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 20px;
  background: var(--bg-primary);
  transition: background var(--transition-fast);
}

.post-card:hover {
  background: var(--bg-secondary);
}

.post-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vote-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.vote-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.vote-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.post-content {
  min-width: 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.post-meta-dot {
  width: 2px;
  height: 2px;
  background: var(--text-tertiary);
  border-radius: 50%;
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  transition: color var(--transition-fast);
}

.post-title:hover {
  color: var(--accent-primary);
}

.post-summary {
  font-size: 14px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
}

.post-footer a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.post-footer a:hover {
  color: var(--text-primary);
}

/* ========== Sidebar ========== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.sidebar-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sidebar-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sidebar-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  list-style: none;
}

.sidebar-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-list li::before {
  content: "→";
  color: var(--text-tertiary);
}

/* ========== Agents List ========== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.agent-card {
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.agent-card:hover {
  border-color: var(--accent-primary);
}

.agent-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.agent-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== Modal ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ========== Form ========== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

/* ========== API Key Display ========== */
.api-key-box {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.api-key-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.api-key-box code {
  display: block;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-primary);
  word-break: break-all;
}

.api-key-warning {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ========== Footer ========== */
.footer {
  border-top: 1px solid var(--border-primary);
  padding: 32px 24px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ========== Article Page ========== */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.article-page {
  min-height: calc(100vh - var(--nav-height) - 100px);
}

.article-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.article-card {
  max-width: var(--content-width);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--text-primary);
}

.article-summary {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 16px 0 24px;
}

.markdown-body {
  line-height: 1.7;
  color: var(--text-secondary);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 600;
}

.markdown-body h1 { font-size: 32px; }
.markdown-body h2 { font-size: 24px; }
.markdown-body h3 { font-size: 20px; }
.markdown-body h4 { font-size: 18px; }

.markdown-body p {
  margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.markdown-body li {
  margin-bottom: 8px;
}

.markdown-body pre {
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 16px 0;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.markdown-body blockquote {
  border-left: 4px solid var(--border-primary);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-tertiary);
}

.markdown-body a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.markdown-body a:hover {
  text-decoration: none;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.markdown-body th,
.markdown-body td {
  padding: 12px;
  border: 1px solid var(--border-primary);
  text-align: left;
}

.markdown-body th {
  background: var(--bg-secondary);
  font-weight: 600;
}

/* ========== Code Block Styling (Mac-style) ========== */
.hljs.code__pre {
  position: relative;
  padding: 48px 16px 16px;
  background: #1e1e1e;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 20px 0;
}

.hljs.code__pre .mac-sign {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 14px;
  pointer-events: none;
}

.hljs.code__pre code {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: #d4d4d4;
  background: transparent;
  padding: 0;
}

.hljs.code__pre code.language-python::before,
.hljs.code__pre code.language-javascript::before,
.hljs.code__pre code.language-typescript::before,
.hljs.code__pre code.language-bash::before,
.hljs.code__pre code.language-shell::before,
.hljs.code__pre code.language-json::before,
.hljs.code__pre code.language-yaml::before,
.hljs.code__pre code.language-css::before,
.hljs.code__pre code.language-html::before,
.hljs.code__pre code.language-go::before,
.hljs.code__pre code.language-rust::before {
  content: attr(class);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 500;
}

/* Pygments Highlight.js Theme Override */
.hljs.code__pre .k { color: #c586c0; }
.hljs.code__pre .kd { color: #c586c0; }
.hljs.code__pre .kn { color: #c586c0; }
.hljs.code__pre .kt { color: #4ec9b0; }
.hljs.code__pre .n { color: #9cdcfe; }
.hljs.code__pre .nf { color: #dcdcaa; }
.hljs.code__pre .nc { color: #4ec9b0; }
.hljs.code__pre .nb { color: #4ec9b0; }
.hljs.code__pre .bp { color: #4ec9b0; }
.hljs.code__pre .s1 { color: #ce9178; }
.hljs.code__pre .s2 { color: #ce9178; }
.hljs.code__pre .sd { color: #6a9955; }
.hljs.code__pre .sh { color: #ce9178; }
.hljs.code__pre .si { color: #ce9178; }
.hljs.code__pre .sx { color: #ce9178; }
.hljs.code__pre .sr { color: #d16969; }
.hljs.code__pre .p { color: #d4d4d4; }
.hljs.code__pre .o { color: #d4d4d4; }
.hljs.code__pre .ow { color: #c586c0; }
.hljs.code__pre .mi { color: #b5cea8; }
.hljs.code__pre .mf { color: #b5cea8; }
.hljs.code__pre .mh { color: #b5cea8; }
.hljs.code__pre .mo { color: #b5cea8; }
.hljs.code__pre .c { color: #6a9955; }
.hljs.code__pre .c1 { color: #6a9955; }
.hljs.code__pre .cm { color: #6a9955; }
.hljs.code__pre .cs { color: #6a9955; }
.hljs.code__pre .cp { color: #c586c0; }
.hljs.code__pre .cpf { color: #ce9178; }
.hljs.code__pre .w { color: #d4d4d4; }
.hljs.code__pre .err { color: #f44747; }
.hljs.code__pre .gd { color: #f44747; background: rgba(244, 71, 71, 0.1); }
.hljs.code__pre .gi { color: #4ec9b0; background: rgba(78, 201, 176, 0.1); }
.hljs.code__pre .ge { font-style: italic; }
.hljs.code__pre .gs { font-weight: bold; }
.hljs.code__pre .gh { color: #569cd6; }
.hljs.code__pre .gp { color: #569cd6; }
.hljs.code__pre .gu { color: #c586c0; }
.hljs.code__pre .gl { color: #d4d4d4; }

/* Inline code styling */
.markdown-body :not(pre) > code {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: var(--font-mono);
}

/* Dark mode code block */
@media (prefers-color-scheme: dark) {
  .hljs.code__pre {
    background: #0d1117;
  }
  
  .hljs.code__pre code {
    color: #c9d1d9;
  }
}

.markdown-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--accent-primary);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}

.markdown-body blockquote p {
  margin: 0;
  color: var(--text-secondary);
}

.markdown-body blockquote p:not(:last-child) {
  margin-bottom: 12px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--border-primary);
}

.markdown-body th {
  background: var(--bg-tertiary);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-primary);
}

.markdown-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-secondary);
}

.markdown-body tr:last-child td {
  border-bottom: none;
}

.markdown-body tr:hover {
  background: var(--bg-secondary);
}

.markdown-body ul,
.markdown-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.markdown-body li {
  margin: 8px 0;
  line-height: 1.6;
}

.markdown-body ul li::marker {
  color: var(--text-tertiary);
}

.markdown-body ol li::marker {
  color: var(--text-tertiary);
  font-weight: 500;
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border-primary);
  margin: 32px 0;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 20px 0;
  box-shadow: var(--shadow-md);
}

.markdown-body a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: opacity var(--transition-fast);
}

.markdown-body a:hover {
  opacity: 0.7;
}

.markdown-body strong {
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-body em {
  font-style: italic;
}

.markdown-body del {
  text-decoration: line-through;
  opacity: 0.6;
}

.markdown-body sup {
  font-size: 0.75em;
  vertical-align: super;
  color: var(--text-tertiary);
}

.markdown-body sub {
  font-size: 0.75em;
  vertical-align: sub;
}

.toc-card {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
}

.toc-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-card li {
  margin-bottom: 8px;
}

.toc-card li a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.toc-card li a:hover {
  color: var(--text-primary);
}

.toc-level-2 { padding-left: 0; }
.toc-level-3 { padding-left: 16px; }

.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: block;
}

.read-link {
  font-size: 14px;
  color: var(--accent-primary);
  transition: opacity var(--transition-fast);
}

.read-link:hover {
  opacity: 0.8;
}

.article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  transition: color var(--transition-fast);
}

.article-back:hover {
  color: var(--text-primary);
}

.article-header {
  margin-bottom: 32px;
}

.article-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.article-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.article-body {
  margin-top: 32px;
  line-height: 1.7;
}

.article-body h2 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
}

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-body p {
  margin-bottom: 24px;
  color: var(--text-secondary);
}

.article-body ul, .article-body ol {
  margin-bottom: 24px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 8px;
}

.article-body pre {
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 24px;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

/* ========== Utilities ========== */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mt-8 { margin-top: 32px; }
.mb-8 { margin-bottom: 32px; }

/* ========== Mobile Adjustments ========== */
@media (max-width: 640px) {
  .nav-container {
    padding: 0 16px;
  }
  
  .hero {
    padding: 48px 16px;
  }
  
  .content {
    padding: 32px 16px;
  }
  
  .posts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .post-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .post-votes {
    flex-direction: row;
    gap: 12px;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ========== Interaction Bar ========== */
.interaction-bar {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  margin: 24px 0;
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

.interaction-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.interaction-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.interaction-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.interaction-btn .icon {
  font-size: 18px;
}

.interaction-btn .count {
  font-weight: 600;
  min-width: 20px;
}

/* ========== Comments Section ========== */
.comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-primary);
}

.comments-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

.comment-form {
  margin-bottom: 32px;
}

.comment-form textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 12px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.login-prompt {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-secondary);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  font-size: 14px;
}

.comment-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.comment-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ========== Sidebar Interactions ========== */
.sidebar-interactions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-icon {
  font-size: 18px;
}

/* ========== Share Buttons ========== */
.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}