:root {
  color-scheme: light;
  --paper: #f6f2e9;
  --card: #fffcf6;
  --ink: #262820;
  --muted: #635f52;
  --line: #ded7c7;
  --accent: #a43e23;
  --accent-soft: #f6e1d6;
  font: 16px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  font: 700 19px/1 Inter, system-ui, sans-serif;
  vertical-align: middle;
}
.brand-label { margin-left: 11px; font-size: 15px; font-weight: 700; vertical-align: middle; }
.login-screen { display: grid; grid-template-rows: auto 1fr; max-width: 1040px; min-height: 100svh; margin: auto; padding: 35px 40px 65px; }
.login-panel { align-self: center; display: grid; grid-template-columns: 1.12fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.login-art {
  display: grid;
  min-height: 425px;
  place-items: center;
  overflow: hidden;
  background: repeating-linear-gradient(130deg, #ffffff0c 0 1px, transparent 1px 23px), #a43e23;
  color: #f8c9af;
}
.login-art span { font: 800 clamp(175px, 28vw, 325px)/.88 Inter, system-ui, sans-serif; transform: skew(-8deg) rotate(-9deg); }
.login-content { align-self: center; padding: clamp(28px, 6vw, 64px); }
h1 { margin: 0; font-size: clamp(36px, 6vw, 63px); font-weight: 750; letter-spacing: -.06em; line-height: 1.12; }
.login-content h1 { margin-bottom: 34px; font-size: clamp(31px, 5vw, 48px); }
.login-content label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 650; }
input { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; background: #fffefa; color: var(--ink); }
input:focus { outline: none; }
.login-content input { width: 100%; }
.primary { display: flex; width: 100%; margin-top: 14px; justify-content: space-between; border: 0; border-radius: 9px; padding: 11px 14px; background: var(--accent); color: white; font-weight: 700; }
.primary:hover { background: #83311c; }
.error { margin: 10px 0 0; color: var(--accent); font-size: 14px; }

.shell { max-width: 1080px; margin: auto; padding-inline: 26px; }
.top { border-bottom: 1px solid var(--line); }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 71px; gap: 12px; }
.owner { margin-left: 16px; color: var(--muted); font-size: 13px; }
.plain { border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; background: transparent; color: var(--muted); font-size: 13px; }
.plain:hover { background: var(--card); }
.archive { padding-top: 42px; padding-bottom: 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.search { display: flex; flex: 0 1 370px; gap: 7px; }
.search input { width: 100%; font-size: 14px; }
.search button { flex: none; border: 1px solid var(--line); border-radius: 9px; padding: 0 17px; background: var(--card); color: var(--ink); font-weight: 650; }
.tabs { display: flex; gap: 24px; margin: 22px 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 0 11px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 650; }
.tabs span { margin-left: 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.tabs a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.results { color: var(--muted); font-size: 13px; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; align-items: start; }
.card { min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 13px; padding: 18px; background: var(--card); }
.post-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.post-head time { color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.byline, .person h2 a { font-weight: 750; }
.byline:hover, .person a:hover, .source:hover { text-decoration: underline; }
.post-kind { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.post-kind > span { border-radius: 4px; padding: 2px 7px; background: #eee8db; }
.post-kind .topic { background: var(--accent-soft); color: #863318; }
.card h2 { margin: 12px 0 2px; font-size: 18px; line-height: 1.38; }
.post-text { margin: 10px 0; white-space: pre-wrap; font-size: 14px; }
.post-text a, .post-links a, .bio a { color: var(--accent); text-decoration: underline; }
.post-links { padding-left: 19px; margin: 10px 0; font-size: 13px; }
.source { display: inline-block; margin-top: 7px; color: var(--accent); font-size: 13px; font-weight: 650; }
.media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 12px 0 5px; }
.image-trigger { display: block; align-self: start; min-width: 0; padding: 0; border: 0; border-radius: 6px; background: #eee8db; cursor: zoom-in; }
.image-trigger img { display: block; width: 100%; height: auto; border-radius: inherit; }
.media video { justify-self: center; display: block; width: auto; height: auto; max-width: 100%; max-height: min(70svh, 650px); object-fit: contain; border-radius: 6px; background: #27251f; }
body:has(.lightbox[open]) { overflow: hidden; }
.lightbox { width: min(960px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 12px; border: 0; border-radius: 13px; background: #24211e; color: #fff8ef; }
.lightbox::backdrop { background: #14100edb; }
.lightbox-bar, .lightbox-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lightbox-bar { margin-bottom: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.lightbox-nav { justify-content: center; margin-top: 8px; }
.lightbox-nav[hidden] { display: none; }
.lightbox img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100svh - 145px); margin-inline: auto; object-fit: contain; }
.lightbox button { min-height: 38px; border: 1px solid #73645b; border-radius: 7px; background: #352f2a; color: inherit; padding: 5px 12px; }
.lightbox button:disabled { opacity: .45; cursor: default; }
.lightbox button:focus-visible { outline-color: #f0ad90; }
#image-close { min-width: 40px; padding: 0; font-size: 22px; }
.person { display: flex; gap: 13px; min-height: 112px; }
.person h2 { margin: 0; font-size: 16px; }
.avatar { display: grid; place-items: center; flex: 0 0 41px; height: 41px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 16px; font-weight: 750; }
.handle, .bio { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.bio { color: var(--ink); }
.archive-loader { min-height: 1px; margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.archive-loader p { margin: 0 0 6px; }
.archive-loader a, .archive-loader button { color: var(--accent); }
.archive-loader button { border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; background: var(--card); }
.empty { grid-column: 1 / -1; padding-block: 28px; text-align: center; color: var(--muted); }

@media (max-width: 650px) {
  .login-screen { padding: 23px 17px 45px; }
  .login-panel { grid-template-columns: 1fr; margin-top: 20px; }
  .login-art { min-height: 165px; }
  .login-art span { font-size: 175px; }
  .login-content { padding: 26px; }
  .login-content h1 { margin-bottom: 22px; }
  .shell { padding-inline: 15px; }
  .owner { margin-left: 8px; }
  .archive { padding-top: 25px; }
  .section-head { display: grid; align-items: start; gap: 14px; }
  .tabs { gap: 18px; margin-top: 13px; }
}
