/* LaTeX Converter Documentation — Stylesheet */

:root {
  --bg: #ffffff;
  --sidebar-bg: #f8f9fa;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --code-bg: #f1f3f5;
  --tip-bg: #eff6ff;
  --tip-border: #93c5fd;
  --warning-bg: #fefce8;
  --warning-border: #fde68a;
  --sidebar-width: 260px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  display: flex;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 10;
}

.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-brand a {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.sidebar-brand .version {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-section { padding: 8px 0; }
.sidebar-section h3 {
  padding: 8px 20px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.sidebar-section ul { list-style: none; }
.sidebar-section li a {
  display: block;
  padding: 6px 20px 6px 28px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-section li a:hover,
.sidebar-section li a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}

/* ── Main Content ── */
.content {
  margin-left: var(--sidebar-width);
  padding: 48px 56px;
  max-width: 860px;
  width: 100%;
}

.content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.content p, .content li { margin-bottom: 10px; }
.content a { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; }

.lead { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 32px; }

code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", monospace;
}

pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code { background: none; padding: 0; color: inherit; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { font-weight: 600; background: var(--sidebar-bg); }

/* ── Components ── */
.steps { margin: 20px 0; }
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.step-number {
  width: 32px; height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.tip {
  background: var(--tip-bg);
  border-left: 4px solid var(--tip-border);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
  font-size: 0.9rem;
}

.warning {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning-border);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
  font-size: 0.9rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.feature-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: box-shadow 0.2s;
}

.feature-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.feature-card h3 { margin-top: 0; font-size: 1rem; }
.feature-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-item summary {
  padding: 14px 20px;
  font-weight: 600;
  cursor: pointer;
  background: var(--sidebar-bg);
  user-select: none;
}

.faq-item .faq-answer { padding: 14px 20px; font-size: 0.9rem; }

.template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.template-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}

.template-card .name { font-weight: 600; }
.template-card .discipline { color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; }
.template-card .meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 8px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 24px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
}
