:root {
  /* Warm, friendly palette */
  --bg: #fffaf3;
  --surface: #ffffff;
  --fg: #3f2d20;
  --muted: #7a5f4d;
  --line: #ead9c7;
  --accent: #b93800;
  --accent-ink: #ffffff;

  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(185, 56, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}

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

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

.container {
  width: min(100%, 720px);
  margin: 0 auto;
  padding-inline: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.title {
  margin: 22px 0 10px;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.tagline {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 18px;
  overflow-wrap: anywhere;
}

/* Header */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 250, 243, 0.96);
  border-bottom: 1px solid rgba(234, 217, 199, 0.8);
  backdrop-filter: blur(6px);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand language"
    "search search";
  align-items: center;
  gap: 8px 14px;
  padding-block: 10px;
}

.brand-link {
  grid-area: brand;
  min-width: 0;
  color: var(--fg);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.i18n {
  grid-area: language;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 10px;
  max-width: 48vw;
  font-size: 13px;
  line-height: 1.4;
}

.i18n a {
  color: var(--muted);
  white-space: nowrap;
}

.i18n a.on {
  color: var(--fg);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quick-search {
  grid-area: search;
  min-width: 0;
}

.quick-search input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}

.quick-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 56, 0, 0.16);
}

.quick-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* Main content */
.main-col {
  padding-top: 24px;
  padding-bottom: 28px;
}

/* Month groups and compact list */
.month {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}

.q-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.q-list li {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(234, 217, 199, 0.72);
}

.q-list li:last-child {
  border-bottom: 0;
}

.q-list time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.q-list a {
  min-width: 0;
  color: var(--fg);
}

.q-list.small {
  margin-top: 4px;
}

.q-list.small li {
  grid-template-columns: minmax(0, 1fr);
}

.q-list.small a {
  color: var(--accent);
}

.empty-state {
  margin: 24px 0;
}

/* Post page */
.meta-line {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.short-answer {
  margin: 12px 0 18px;
  padding: 14px 16px;
  color: var(--fg);
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.short-answer strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
}

.short-answer p {
  margin: 0;
  font-weight: 600;
}

/* Body content */
.content {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.content :is(h2, h3, h4) {
  margin: 20px 0 8px;
  line-height: 1.35;
}

.content p {
  margin: 10px 0;
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  background: #f5eadc;
  border-radius: 8px;
}

.content code,
.content pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

.content blockquote {
  margin: 12px 0;
  padding: 6px 12px;
  color: var(--muted);
  border-inline-start: 3px solid var(--line);
}

/* FAQ-like details */
.content details {
  margin: 10px 0;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.content summary {
  position: relative;
  padding: 12px 42px 12px 14px;
  color: var(--fg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.content summary::-webkit-details-marker {
  display: none;
}

.content details[open] summary {
  border-bottom: 1px dashed var(--line);
}

.content summary::after {
  content: "▾";
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%) rotate(-90deg);
}

.content details[open] summary::after {
  transform: translateY(-50%) rotate(0);
}

.content details > *:not(summary) {
  padding-inline: 14px;
}

/* Source, related content and CTA */
.source-link {
  margin: 18px 0 0;
}

.related {
  margin-top: 26px;
}

.h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.post-cta {
  margin-top: 28px;
  padding: 16px;
  background: #fff1e5;
  border: 1px dashed #d48a62;
  border-radius: var(--radius);
}

.post-cta .contact-text,
.promo-footer .contact-text {
  margin: 0 0 10px;
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* Footer */
.site-footer {
  margin-top: 20px;
  padding: 22px 0 34px;
  color: var(--muted);
}

.promo-footer {
  margin: 0 0 18px;
}

.button {
  display: inline-block;
  max-width: 100%;
  padding: 8px 14px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.button:hover {
  color: var(--accent-ink);
  text-decoration: none;
  opacity: 0.95;
}

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

.cats-footer {
  margin: 12px 0 8px;
}

.cats-footer .tiny {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.cats-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cats-footer li {
  max-width: 100%;
}

.cats-footer a {
  color: var(--fg);
}

.cats-footer a.on {
  color: var(--accent);
  font-weight: 700;
}

.cats-footer .count {
  color: var(--muted);
  font-size: 12px;
}

.foot-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal ul {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal a,
.links > a {
  color: var(--muted);
}

/* Pagination */
.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.pager .page-num {
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.pager .nav-prev {
  justify-self: start;
}

.pager .nav-next {
  justify-self: end;
}

/* Floating contact */
.float-cta {
  position: fixed;
  right: max(16px, calc((100vw - 720px) / 2 + 20px));
  bottom: 16px;
  z-index: 20;
  max-width: min(70vw, 300px);
  padding: 10px 14px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.float-cta:hover {
  color: var(--accent-ink);
  text-decoration: none;
}

.float-cta.note {
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
}

/* Small screens */
@media (max-width: 520px) {
  .container {
    padding-inline: 16px;
  }

  .bar-row {
    gap: 8px 10px;
  }

  .i18n {
    max-width: 52vw;
  }

  .title {
    font-size: 28px;
  }

  .tagline {
    font-size: 16px;
  }

  .q-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .q-list time {
    font-size: 12px;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
  }

  .float-cta {
    right: 16px;
    bottom: 16px;
  }
}
