:root {
  --font: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 16px;
  --shadow: 0 14px 36px rgba(16, 40, 28, .12);
  --gutter: clamp(12px, 4vw, 20px);
  --max: 1120px;
  --fs: 16px;
  --fs-sm: 13px;
  --fs-meta: 13px;
  --fs-h1: clamp(1.4rem, 1.1rem + 1.6vw, 2rem);
  --fs-h2: clamp(1.15rem, 1rem + 0.8vw, 1.45rem);
  --fs-h3: 0.95rem;
}
html[data-theme="verdant"] {
  --bg: #eef7f1;
  --bg2: #d7efe3;
  --ink: #143028;
  --muted: #4c6b5d;
  --accent: #0f8a5f;
  --accent2: #c6f54a;
  --glass: rgba(255,255,255,.62);
  --glass2: rgba(255,255,255,.82);
  --line: rgba(20, 80, 50, .12);
  --code-bg: #10241c;
  --code-ink: #d7ffe8;
  --danger: #c4412b;
  --ok: #0f8a5f;
  --orb-a: rgba(15, 138, 95, .28);
  --orb-b: rgba(198, 245, 74, .35);
  --btn-ink: #062016;
}
html[data-theme="aureum"] {
  --bg: #0c0b09;
  --bg2: #17140f;
  --ink: #f4e7c8;
  --muted: #b9a57a;
  --accent: #e2b657;
  --accent2: #8a6a2a;
  --glass: rgba(22, 18, 12, .72);
  --glass2: rgba(36, 30, 20, .86);
  --line: rgba(226, 182, 87, .18);
  --code-bg: #120f0a;
  --code-ink: #f8e7b0;
  --danger: #e05a3c;
  --ok: #d4b056;
  --orb-a: rgba(226, 182, 87, .18);
  --orb-b: rgba(80, 50, 10, .45);
  --btn-ink: #1a1408;
}
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: var(--fs);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg2), var(--bg));
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
img, video, svg, iframe { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: var(--fs-h1); margin: 0 0 .5em; }
h2 { font-size: var(--fs-h2); margin: 1.2em 0 .4em; }
h3 { font-size: var(--fs-h3); margin: 1em 0 .4em; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.bg-orb { position: fixed; z-index: -1; filter: blur(40px); border-radius: 50%; pointer-events: none; }
.orb-a { width: min(420px, 70vw); height: min(420px, 70vw); background: var(--orb-a); top: -80px; right: 4%; }
.orb-b { width: min(520px, 80vw); height: min(520px, 80vw); background: var(--orb-b); bottom: -120px; left: -60px; }

.adminbar { background: color-mix(in srgb, var(--ink) 88%, transparent); color: var(--bg); font-family: var(--sans); font-size: var(--fs-sm); }
.adminbar .wrap { display: flex; gap: 12px; padding: 8px 0; align-items: center; flex-wrap: wrap; }
.adminbar a { color: inherit; white-space: nowrap; }
.adminbar span { margin-left: auto; }

.site-header {
  position: sticky;
  top: 8px;
  z-index: 40;
  margin: 8px auto;
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  border-radius: 20px;
}
.head-row {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  padding: 10px 14px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  flex: 1 1 auto;
}
.brand:hover { text-decoration: none; }
.brand img.logo { width: 36px; height: 36px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--btn-ink);
  font-family: var(--sans); font-weight: 800; font-size: 12px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small {
  color: var(--muted); font-size: 11px; font-family: var(--sans); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw;
}
.nav-toggle {
  display: none;
  width: 42px; height: 42px; padding: 10px; margin-left: auto;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--glass2); cursor: pointer; flex: 0 0 auto;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px;
}
.primary { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 auto; }
.primary .menu {
  display: flex; gap: 4px 14px; list-style: none; margin: 0; padding: 0;
  font-family: var(--sans); font-size: 14px; flex-wrap: nowrap;
}
.primary .menu a { color: inherit; padding: 6px 2px; white-space: nowrap; }
.head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.mini-search { display: flex; }
.mini-search input { width: 140px; max-width: 28vw; }

label { display: grid; gap: 6px; font-family: var(--sans); font-size: 14px; }
.mini-search input, .search-form input, input, textarea, select {
  background: var(--glass2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 10px 12px; font: inherit; width: 100%; max-width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; padding: 0; }
textarea { min-height: 120px; resize: vertical; }
.btn, button, input[type=submit] {
  font-family: var(--sans); border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--btn-ink);
  font-weight: 650; font-size: 14px; line-height: 1.2; white-space: nowrap;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  padding: 20px 0 64px;
  align-items: start;
}
.content-col { min-width: 0; display: grid; gap: 16px; }
.posts { display: grid; gap: 14px; }
.card { border-radius: var(--radius); padding: 18px 18px 16px; min-width: 0; }
.card h2 { margin: 0 0 8px; font-size: var(--fs-h2); }
.card h2 a { color: inherit; }
.meta { color: var(--muted); font-family: var(--sans); font-size: var(--fs-meta); display: flex; gap: 8px 12px; flex-wrap: wrap; }
.excerpt { color: var(--ink); opacity: .92; margin: 10px 0 0; font-size: 15px; line-height: 1.65; }
.sidebar { display: grid; gap: 14px; align-content: start; min-width: 0; }
.widget { border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.widget h3 {
  margin: 0 0 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  font-family: var(--sans); font-weight: 700; color: var(--muted);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; font-family: var(--sans); }
.widget li:last-child { border-bottom: 0; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a {
  margin: 0; display: inline-flex; align-items: center;
  font-size: 13px !important; font-family: var(--sans);
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: inherit;
}
.search-form { display: flex; gap: 8px; align-items: stretch; }
.search-form input { flex: 1 1 auto; width: auto; min-width: 0; }
.search-form button { flex: 0 0 auto; }

.hero { padding: clamp(18px, 4vw, 28px); border-radius: 22px; }
.hero h1 { margin: 0 0 6px; }
.hero p { margin: 0; font-size: 15px; color: var(--muted); }
.entry { padding: clamp(16px, 3.5vw, 28px); border-radius: 22px; min-width: 0; }
.entry h1 { margin-top: 0; }
.entry .content { font-size: 16px; }
.entry .content h2 { margin-top: 1.4em; font-size: 1.2rem; }
.entry .content h3 { font-size: 1.05rem; }
.entry .content p, .entry .content li { font-size: 16px; }
.entry .content pre, pre {
  background: var(--code-bg); color: var(--code-ink); padding: 14px; border-radius: 12px;
  overflow-x: auto; max-width: 100%; font-family: var(--mono); font-size: 13px; line-height: 1.55;
}
code { font-family: var(--mono); font-size: .9em; }
.crumbs { font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted); margin-bottom: 10px; }
.comments { margin-top: 28px; }
.comments h2 { font-size: 1.15rem; }
.comment { padding: 12px 0; border-top: 1px solid var(--line); }
.comment.depth-1 { margin-left: 16px; }
.comment.depth-2 { margin-left: 28px; }
.comment.depth-3, .comment.depth-4, .comment.depth-5 { margin-left: 36px; }
.comment-form { margin-top: 16px; }
.pager {
  display: flex; gap: 6px; padding: 8px; border-radius: 999px; justify-content: center;
  margin-top: 8px; flex-wrap: wrap;
}
.pager a { padding: 6px 12px; border-radius: 999px; color: inherit; font-family: var(--sans); font-size: 13px; }
.pager a.current { background: var(--accent); color: var(--btn-ink); text-decoration: none; }

.site-footer {
  margin: 0 auto 20px;
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  border-radius: 20px;
}
.foot-row {
  padding: 14px 16px; display: flex; justify-content: space-between; gap: 8px 16px;
  font-family: var(--sans); font-size: var(--fs-sm); flex-wrap: wrap;
}
.foot-row p { margin: 0; }
.muted { color: var(--muted); }
.notice { padding: 12px 16px; border-radius: 12px; margin: 12px 0; font-family: var(--sans); font-size: 14px; }
.notice.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.notice.error { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.auth-card, .install {
  width: min(440px, calc(100% - 2 * var(--gutter)));
  margin: 8vh auto; padding: clamp(20px, 5vw, 32px); border-radius: 24px;
}
.install { width: min(640px, calc(100% - 2 * var(--gutter))); }
.auth-card h1, .install h1 { margin-top: 0; }
.auth-links { font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted); margin: 12px 0 0; }
.empty-home h2 { margin-top: 0; }
.stack { display: grid; gap: 12px; }
.calendar { font-family: var(--sans); font-size: 14px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 16px; padding: 16px 0 48px; }
}
@media (max-width: 820px) {
  .head-row { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .primary {
    display: none;
    width: 100%;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 0 6px;
    border-top: 1px solid var(--line);
  }
  body.nav-open .primary { display: flex; }
  .primary .menu { flex-direction: column; gap: 0; }
  .primary .menu a { display: block; padding: 10px 4px; }
  .head-actions { margin: 0; width: 100%; flex-direction: column; align-items: stretch; }
  .mini-search input { width: 100%; max-width: none; }
  .head-actions .btn { text-align: center; }
  .brand-text small { max-width: 52vw; }
  .comment.depth-1, .comment.depth-2, .comment.depth-3, .comment.depth-4, .comment.depth-5 { margin-left: 12px; }
  .search-form { flex-direction: column; }
}
@media (max-width: 480px) {
  .head-row { padding: 8px 10px; }
  .card, .widget { padding: 14px; }
  .hero, .entry { padding: 14px; border-radius: 16px; }
  .brand-text small { display: none; }
  .orb-a, .orb-b { opacity: .7; }
}
