:root {
  --purple: #6B21A8;
  --deep: #14061f;
  --deeper: #07030c;
  --panel: rgba(42, 13, 69, 0.55);
  --panel-border: #6b3d8c;
  --gold: #EAB308;
  --gold2: #FACC15;
  --text: #f4eef8;
  --muted: #9b86b3;
  --link: #d7c4ee;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #4a1a6b 0%, var(--deep) 55%, var(--deeper) 100%);
  color: var(--text);
  line-height: 1.5;
}

h1, h2, h3, .brand-text {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.site-header {
  border-bottom: 1px solid rgba(107, 61, 140, 0.5);
  background: rgba(10, 3, 18, 0.55);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  width: min(1080px, 100%);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.25);
  object-fit: cover;
  background: #1a0a28;
}

.brand-text span.p { color: #c9a0e8; }
.brand-text span.g { color: var(--gold); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.9rem;
}

.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  color: #1a0a05;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.28);
}

.btn:hover { text-decoration: none; filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
  box-shadow: none;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(6px);
}

.hero h1 { margin: 0 0 0.35rem; }
.muted { color: var(--muted); }
.meta { font-size: 0.85rem; margin-top: 1.25rem; }

.layout-2 {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 1rem;
}

@media (max-width: 800px) {
  .layout-2 { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}

.page-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.page-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(107, 61, 140, 0.35);
}

.page-list li:last-child { border-bottom: none; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.page-header h1 { margin: 0; }

.prose h1, .prose h2, .prose h3 { color: #f0e6ff; }
.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.25rem; margin-top: 1.4rem; }
.prose h3 { font-size: 1.05rem; margin-top: 1.1rem; }
.prose p, .prose ul, .prose ol { color: var(--text); }
.prose code {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}
.prose pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.9rem 1rem;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid rgba(107, 61, 140, 0.45);
}
.prose pre code { background: none; padding: 0; }
.prose blockquote {
  margin: 1rem 0;
  padding: 0.4rem 0 0.4rem 1rem;
  border-left: 3px solid var(--gold);
  color: var(--muted);
}
.prose hr {
  border: none;
  border-top: 1px solid rgba(107, 61, 140, 0.5);
  margin: 1.5rem 0;
}

.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-stack input,
.form-stack textarea {
  width: 100%;
  background: rgba(8, 3, 14, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.form-stack textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-stack input:disabled {
  opacity: 0.7;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.flash-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 1rem 2.5rem;
}

.site-footer a { color: var(--link); }
