:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 8px 14px;
}

button:hover {
  background: var(--accent-dark);
}

.floating-logout {
  position: fixed;
  right: 20px;
  top: 16px;
  z-index: 10;
}

.floating-logout button {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 12px;
}

.floating-logout button:hover {
  background: var(--panel);
  color: var(--text);
}

.page {
  margin: 0 auto;
  max-width: 920px;
  padding: 40px 20px 64px;
}

.flash {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #991b1b;
  margin-bottom: 18px;
  padding: 10px 12px;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 12vh auto 0;
  max-width: 380px;
  padding: 28px;
}

.login-panel h1 {
  margin: 0 0 22px;
}

.login-form {
  display: grid;
  gap: 16px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  gap: 6px;
}

input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
  width: 100%;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.check-row input {
  height: 16px;
  width: 16px;
}

.article-tree {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.tree-root,
.tree-children,
.tree-articles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-node {
  scroll-margin-top: 24px;
}

.tree-node + .tree-node {
  margin-top: 2px;
}

.tree-children {
  margin: 2px 0 2px 14px;
  padding-left: 12px;
  position: relative;
}

.tree-children::before {
  background: var(--line);
  bottom: 8px;
  content: "";
  left: 0;
  position: absolute;
  top: 6px;
  width: 1px;
}

.tree-articles {
  display: grid;
  gap: 2px;
  margin: 2px 0 4px 14px;
  padding-left: 12px;
  position: relative;
}

.tree-articles::before {
  background: var(--line);
  bottom: 8px;
  content: "";
  left: 0;
  position: absolute;
  top: 6px;
  width: 1px;
}

.tree-row {
  align-items: center;
  border-radius: 6px;
  display: flex;
  min-height: 30px;
  padding: 5px 8px;
}

.tree-row:hover {
  background: #f1f5f9;
  text-decoration: none;
}

.tree-row-dir {
  color: var(--text);
  font-weight: 650;
}

.tree-level-0 > .tree-row-dir {
  background: #f8fafc;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  min-height: 38px;
  padding: 7px 10px;
}

.tree-row-dir::before,
.tree-row-file::before {
  color: var(--muted);
  display: inline-block;
  font-size: 13px;
  margin-right: 8px;
  width: 16px;
}

.tree-row-dir::before {
  content: "▾";
  text-align: center;
}

.tree-row-file::before {
  content: "";
  margin-right: 0;
  width: 0;
}

.tree-dir,
.tree-dir-current,
.tree-row-file {
  color: var(--text);
}

.tree-dir-current {
  overflow-wrap: anywhere;
}

.tree-path {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  line-height: 1.5;
}

.tree-path-root {
  color: var(--accent);
}

.tree-separator {
  color: #94a3b8;
  margin: 0 7px;
}

.tree-row-file {
  font-weight: 400;
}

.tree-row-file span {
  overflow-wrap: anywhere;
}

.tree-row-file:hover,
.tree-dir:hover {
  text-decoration: none;
}

.empty {
  color: var(--muted);
}

.post {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 42px);
}

.breadcrumb {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.breadcrumb a,
.breadcrumb span {
  display: inline-block;
}

.crumb-separator {
  color: #94a3b8;
  margin: 0 6px;
}

.post h1,
.post h2,
.post h3 {
  line-height: 1.3;
}

.post img {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  height: auto;
  margin: 18px 0;
  max-width: 100%;
}

.post table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

.post th,
.post td {
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.post blockquote {
  border-left: 4px solid var(--line);
  color: var(--muted);
  margin-left: 0;
  padding-left: 16px;
}

.post ul,
.post ol {
  padding-left: 1.45rem;
}

.post li + li {
  margin-top: 0.25rem;
}

.post li > ul,
.post li > ol {
  margin-top: 0.25rem;
}

.post .task-list {
  list-style: disc;
  padding-left: 1.45rem;
}

.post .task-list-item {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.post .task-list-item input[type="checkbox"] {
  height: 15px;
  margin: 0 0.5rem 0 0;
  transform: translateY(2px);
  width: 15px;
}

.post .task-list-item p {
  display: inline;
  margin: 0;
}

.post code {
  background: #eef2f7;
  border-radius: 4px;
  padding: 2px 5px;
}

.codehilite {
  margin: 18px 0;
  position: relative;
}

.post pre {
  border-radius: 8px;
  overflow-x: auto;
  padding: 14px 16px;
}

.post pre code {
  background: transparent;
  padding: 0;
}

.copy-code {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  padding: 6px 8px;
  position: absolute;
  right: 10px;
  top: 10px;
  transition: opacity 0.15s ease;
}

.codehilite:hover .copy-code,
.copy-code:focus {
  opacity: 1;
}

.codehilite .linenos {
  color: #64748b;
  min-width: 2.5em;
  padding-right: 14px;
  text-align: right;
  user-select: none;
}

.codehilite .linenodiv pre {
  border-radius: 8px 0 0 8px;
  padding-right: 0;
}

.codehilite table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

.codehilite td {
  border: 0;
  padding: 0;
  vertical-align: top;
}

@media (max-width: 640px) {
  .floating-logout {
    right: 14px;
    top: 12px;
  }

  .page {
    padding: 34px 14px 48px;
  }

  .article-tree {
    padding: 10px;
  }

  .tree-children {
    margin-left: 10px;
    padding-left: 10px;
  }

  .tree-articles {
    margin-left: 10px;
    padding-left: 10px;
  }
}
