/* ============================================================
   不止一叶代码屋 —— 现代简约 · 浅色/深色双主题
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-elev: #ffffff;
  --text: #14161a;
  --text-soft: #3d434b;
  --muted: #656c76;
  --faint: #9aa1ab;
  --line: #e7e9ee;
  --line-strong: #d7dae1;
  --accent: #2f6feb;
  --accent-soft: #eef3fe;
  --accent-text: #1b4fc4;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --radius: 12px;
  --radius-sm: 8px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --bg-soft: #15181e;
  --bg-elev: #171a21;
  --text: #e8eaee;
  --text-soft: #c5cad3;
  --muted: #99a1ad;
  --faint: #6e7683;
  --line: #262b34;
  --line-strong: #333945;
  --accent: #6b9bff;
  --accent-soft: #1b2333;
  --accent-text: #a8c3ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --bg-soft: #15181e;
    --bg-elev: #171a21;
    --text: #e8eaee;
    --text-soft: #c5cad3;
    --muted: #99a1ad;
    --faint: #6e7683;
    --line: #262b34;
    --line-strong: #333945;
    --accent: #6b9bff;
    --accent-soft: #1b2333;
    --accent-text: #a8c3ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.5px;
}
.brand-mark-lg { width: 46px; height: 46px; border-radius: 13px; font-size: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: .01em; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.topnav a:hover { color: var(--text); background: var(--bg-soft); }
.topnav a.is-active { color: var(--accent-text); background: var(--accent-soft); }

.topbar-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.search { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.search input {
  width: 176px;
  height: 38px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  transition: width .2s ease, border-color .15s ease, background .15s ease;
}
.search input::placeholder { color: var(--faint); }
.search input:focus {
  outline: none;
  width: 230px;
  background: var(--bg);
  border-color: var(--accent);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}

.main { padding-top: 8px; padding-bottom: 8px; min-height: 60vh; }

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .topnav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .topnav::-webkit-scrollbar { display: none; }
  .topbar-tools { margin-left: auto; }
  .search { flex: 1; min-width: 0; }
  .search input, .search input:focus { width: 100%; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .topnav a { padding: 7px 11px; font-size: 13.5px; }
  .brand-sub { display: none; }
}

/* ---------------- hero ---------------- */
.hero { padding: 62px 0 52px; border-bottom: 1px solid var(--line); margin-bottom: 48px; }
.hero-eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
}
.hero-title {
  margin: 0 0 18px;
  font-size: 44px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.02em;
}
.br-mobile { display: none; }
.hero-sub { margin: 0 0 34px; max-width: 620px; font-size: 17px; color: var(--muted); line-height: 1.75; }
.hero-stats { display: flex; gap: 42px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.hero-stats li { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.hero-stats strong { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { font-size: 14px; color: var(--muted); }

@media (max-width: 640px) {
  .hero { padding: 40px 0 34px; margin-bottom: 34px; }
  .hero-title { font-size: 30px; }
  .br-mobile { display: inline; }
  .hero-stats { gap: 24px; }
  .hero-stats strong { font-size: 22px; }
  .hero-stats span { font-size: 13px; }
}

/* ---------------- layout ---------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 56px; align-items: start; }
.side-column { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 32px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .side-column { position: static; }
}

/* ---------------- section head ---------------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.section-more { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.section-more:hover { color: var(--accent); }

/* ---------------- card list ---------------- */
.card-list { display: flex; flex-direction: column; gap: 16px; }
.card {
  display: flex;
  gap: 20px;
  padding: 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-cover {
  flex: 0 0 140px;
  height: 88px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card-cover .cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover .cover-initial {
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  opacity: .75;
  letter-spacing: -.02em;
}
.card-body { flex: 1; min-width: 0; }
.card-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 9px; font-size: 12.5px; color: var(--muted); }
.card-date, .card-time { font-variant-numeric: tabular-nums; }
.dot { color: var(--faint); }
.card-title { margin: 0 0 8px; font-size: 19.5px; line-height: 1.45; font-weight: 700; letter-spacing: -.01em; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { margin: 0 0 13px; font-size: 14.8px; color: var(--muted); line-height: 1.7; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; flex-wrap: wrap; }
.card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.read-more { font-size: 13.5px; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.read-more:hover { color: var(--accent); }

.card-list-compact .card { padding: 16px 18px; }
.card-list-compact .card-cover { flex-basis: 0; display: none; }
.card-list-compact .card-title { font-size: 17px; }
.card-list-compact .card-excerpt { display: none; }

@media (max-width: 640px) {
  .card { padding: 18px; gap: 15px; }
  .card-cover { flex-basis: 104px; height: 66px; }
  .card-cover .cover-initial { font-size: 24px; }
  .card-title { font-size: 17.5px; }
}

@media (max-width: 480px) {
  .card { flex-direction: column; gap: 14px; }
  .card-cover { flex-basis: auto; width: 100%; height: auto; aspect-ratio: 16 / 7; }
  .card-kicker { flex-wrap: wrap; gap: 7px; }
  .card-foot { align-items: flex-start; }
}
.list-end { margin: 28px 0 0; text-align: center; }

/* ---------------- chips / tags ---------------- */
.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.chip:hover { color: var(--accent); }
.chip-sm { font-size: 11.5px; padding: 2px 9px; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.tag:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tag em { font-style: normal; color: var(--faint); font-size: 11.5px; }
.tag-lg { font-size: 13.5px; padding: 5px 13px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; }
.tag-cloud-lg { gap: 11px; }

/* ---------------- sidebar ---------------- */
.side-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--text-soft);
}
.side-list a:hover { background: var(--bg-soft); color: var(--accent); }
.side-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.side-block.side-subscribe {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.side-text { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* ---------------- page head ---------------- */
.page-head { padding: 52px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.page-kicker {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.page-title { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.page-sub { margin: 12px 0 0; font-size: 14.5px; color: var(--muted); }
.page-sub a { color: var(--accent-text); }
@media (max-width: 640px) {
  .page-head { padding: 34px 0 20px; margin-bottom: 28px; }
  .page-title { font-size: 26px; }
}

/* ---------------- empty ---------------- */
.empty {
  padding: 46px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  background: var(--bg-soft);
}
.empty a { color: var(--accent-text); }

/* ---------------- category grid ---------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cat-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-card-name { font-size: 16.5px; font-weight: 700; }
.cat-card-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tags-section { margin-top: 52px; }

/* ---------------- archive ---------------- */
.archive-group { margin-bottom: 40px; }
.archive-year {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.archive-year span { font-size: 12.5px; font-weight: 500; color: var(--faint); }
.archive-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.archive-list li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}
.archive-date { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.archive-link { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 500; }
.archive-cat { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
@media (max-width: 640px) {
  .archive-list li { flex-wrap: wrap; gap: 6px 12px; }
  .archive-link { flex: 1 1 100%; order: -1; }
}

/* ---------------- post ---------------- */
.post { max-width: 760px; }
.post-head { padding: 52px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.post-kicker { margin: 0 0 16px; }
.post-title { margin: 0 0 18px; font-size: 36px; line-height: 1.3; font-weight: 800; letter-spacing: -.025em; }
.post-meta { margin: 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.post-meta time { font-variant-numeric: tabular-nums; }

.post-cover {
  margin: 0 0 34px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.post-cover img { display: block; width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }

.post-body { font-size: 16.5px; line-height: 1.85; color: var(--text-soft); }
.post-body > *:first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.3em; }
.post-body h2 {
  margin: 2.1em 0 .8em;
  font-size: 23px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -.015em;
  color: var(--text);
}
.post-body h3 {
  margin: 1.7em 0 .65em;
  font-size: 18.5px;
  font-weight: 700;
  color: var(--text);
}
.post-body ul, .post-body ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.post-body li { margin-bottom: .5em; }
.post-body li::marker { color: var(--faint); }
.post-body a { color: var(--accent-text); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.post-body a:hover { color: var(--accent); border-color: var(--accent); }
.post-body strong { color: var(--text); font-weight: 700; }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
.post-body img { border-radius: var(--radius-sm); border: 1px solid var(--line); }

.post-body code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}
.post-body pre {
  margin: 0 0 1.4em;
  padding: 18px 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
}
.post-body pre code { background: none; border: none; padding: 0; font-size: inherit; color: var(--text-soft); }
.post-body blockquote {
  margin: 1.5em 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 14.5px;
  display: block;
  overflow-x: auto;
}
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
.post-body th { background: var(--bg-soft); font-weight: 700; color: var(--text); }

.post-tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 40px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.post-share {
  margin-top: 34px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.share-title { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; }
.share-text { margin: 0 0 16px; font-size: 13.8px; color: var(--muted); }

@media (max-width: 640px) {
  .post-head { padding: 34px 0 22px; margin-bottom: 26px; }
  .post-title { font-size: 26px; }
  .post-body { font-size: 16px; }
  .post-body h2 { font-size: 20px; }
}

/* ---------------- post nav ---------------- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 44px auto 0;
  max-width: 760px;
}
.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.post-nav-item:not(.is-empty):hover { border-color: var(--accent); box-shadow: var(--shadow); }
.post-nav-item.is-next { text-align: right; }
.post-nav-item.is-empty { border: none; background: none; padding: 0; }
.post-nav-label { font-size: 12px; color: var(--faint); font-weight: 600; }
.post-nav-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.is-next { text-align: left; }
}

.related { max-width: 760px; margin: 56px auto 0; }
.back-home { max-width: 760px; margin: 40px auto 0; font-size: 14px; color: var(--muted); }

/* ---------------- prose (about) ---------------- */
.about-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 52px; align-items: start; }
.prose { font-size: 16.5px; line-height: 1.85; color: var(--text-soft); }
.prose p { margin: 0 0 1.2em; }
.prose h2 {
  margin: 1.9em 0 .7em;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.01em;
  color: var(--text);
}
.prose ul { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--faint); }
.prose a { color: var(--accent-text); }
.prose code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}
.about-side { display: flex; flex-direction: column; gap: 12px; }
.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
}
.stat-num { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat-label { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 900px) {
  .about-layout { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .about-side { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1; min-width: 100px; }
}

/* ---------------- footer ---------------- */
.site-footer { margin-top: 88px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 1fr 1fr;
  gap: 42px;
  padding-top: 48px;
  padding-bottom: 38px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.footer-desc { margin: 0; font-size: 13.8px; color: var(--muted); line-height: 1.7; max-width: 380px; }
.footer-col h4 {
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-links a { font-size: 14px; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line);
}
.footer-bottom p { margin: 0; font-size: 13px; color: var(--muted); }
.footer-beian a { color: var(--muted); }
.footer-beian a:hover { color: var(--accent); }
@media (max-width: 760px) {
  .site-footer { margin-top: 60px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; padding-top: 36px; }
}

/* ---------------- forms / buttons ---------------- */
.form { display: flex; flex-direction: column; gap: 20px; }
.form-wide { max-width: 820px; margin-bottom: 40px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.field-label em { font-style: normal; font-size: 11.5px; color: var(--accent); font-weight: 600; }
.form input[type="text"], .form input[type="search"], .form input[type="password"], .form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.form textarea { resize: vertical; font-family: var(--mono); font-size: 13.8px; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-actions { display: flex; gap: 12px; padding-top: 4px; }
.form-error {
  margin: 0 0 20px;
  max-width: 820px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, #d93025 35%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #d93025 8%, var(--bg));
  color: #c0261c;
  font-size: 14px;
}
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-text); border-color: var(--accent-text); color: #fff; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--bg-elev); border-color: var(--line-strong); color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn-sm { padding: 8px 15px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------------- login ---------------- */
.login-wrap { display: grid; place-items: center; padding: 60px 0 40px; }
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 38px 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card .brand-mark { margin: 0 auto 18px; }
.login-title { margin: 0 0 8px; font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.login-sub { margin: 0 0 26px; font-size: 14px; color: var(--muted); }
.login-card .form { text-align: left; }
.login-back { margin: 22px 0 0; font-size: 13.5px; }

/* ---------------- admin ---------------- */
.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.admin-actions { display: flex; gap: 10px; padding-bottom: 4px; }
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--bg-elev);
}
.admin-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.admin-table th, .admin-table td { padding: 14px 16px; text-align: left; vertical-align: top; }
.admin-table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table tbody tr { border-bottom: 1px solid var(--line); }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-soft); }
.admin-table .col-no { width: 52px; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.cell-title { font-size: 14.8px; }
.cell-title a { font-weight: 600; }
.cell-tags { display: block; margin-top: 4px; font-size: 11.5px; color: var(--faint); }
.admin-table .col-cat, .admin-table .col-time, .admin-table .col-date { white-space: nowrap; font-size: 13.5px; color: var(--muted); }
.admin-table .col-time, .admin-table .col-date { font-variant-numeric: tabular-nums; }
.admin-table .col-ops { white-space: nowrap; }
.op-link { background: none; border: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent-text); cursor: pointer; }
.op-link:hover { color: var(--accent); text-decoration: underline; }
.op-danger { color: #c0261c; }
.op-danger:hover { color: #d93025; }
.inline { display: inline; margin-left: 14px; }
@media (max-width: 640px) { .admin-head { padding-top: 32px; } }

/* ---------------- 404 ---------------- */
.error-page { padding: 88px 0 60px; text-align: center; }
.error-code {
  margin: 0 0 10px;
  font-size: 88px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--accent);
  opacity: .22;
}
.error-title { margin: 0 0 12px; font-size: 24px; font-weight: 750; }
.error-text { margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.error-actions { display: flex; gap: 12px; justify-content: center; }

/* ---------------- motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card:hover, .cat-card:hover, .btn:active { transform: none; }
}
