/* ============================================================
   唐子轩 · 个人网站
   设计取向：系统字体、留白、1px 分割线、克制的强调色。
   ============================================================ */

:root {
  --bg: #ffffff;
  --soft: #f7f8fa;
  --soft-2: #f1f3f5;
  --panel: #ffffff;
  --ink: #101114;
  --text: #1c1f24;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --border: #eaebee;
  --border-strong: #dcdfe4;
  --accent: #2b64f6;
  --accent-soft: #eef2ff;
  --live: #16a34a;
  --done: #2b64f6;
  --wip: #d97706;
  --archive: #9aa1ab;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 12px 32px -12px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.04);
  --wrap: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e10;
    --soft: #141619;
    --soft-2: #191c20;
    --panel: #141619;
    --ink: #f4f5f6;
    --text: #dfe2e6;
    --muted: #9aa1ab;
    --faint: #71787f;
    --border: #23262b;
    --border-strong: #2f333a;
    --accent: #6f97ff;
    --accent-soft: #17203a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus {
  left: 16px;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.topbar-inner {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-name {
  font-size: 15px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--muted);
  transition: color 0.16s ease, background-color 0.16s ease;
}

.nav a:hover {
  color: var(--ink);
  background: var(--soft);
}

.nav a.is-active {
  color: var(--ink);
  font-weight: 550;
}

.nav-admin {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--faint);
  border: 1px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
  flex: none;
}

.nav-admin:hover {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--border);
}

/* ---------------- 首页 ---------------- */

.hero {
  padding: 84px 0 56px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 560;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero-title {
  margin: 0;
  font-size: clamp(40px, 7vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 620;
  color: var(--ink);
}

.hero-sub {
  margin: 14px 0 0;
  font-size: 18px;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.hero-intro {
  margin: 22px 0 0;
  max-width: 60ch;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  font-size: 13px;
  color: var(--faint);
}

.hero-meta .now {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.hero-meta .sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 520;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--soft);
  border-color: var(--border-strong);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--ink) 88%, var(--bg));
  border-color: color-mix(in srgb, var(--ink) 88%, var(--bg));
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--soft);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-danger {
  color: #dc2626;
  border-color: color-mix(in srgb, #dc2626 24%, var(--border));
  background: transparent;
}

.btn-danger:hover {
  background: color-mix(in srgb, #dc2626 7%, transparent);
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: 8px;
}

/* ---------------- 区块 ---------------- */

.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--faint);
  transition: color 0.16s ease;
}

.more:hover {
  color: var(--ink);
}

.more svg {
  transition: transform 0.16s ease;
}

.more:hover svg {
  transform: translateX(2px);
}

/* ---------------- 列表行 ---------------- */

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 62px 44px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 15px 12px;
  border-radius: 10px;
  color: var(--text);
  transition: background-color 0.16s ease;
}

.row::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: var(--border);
}

.rows .row:last-child::after {
  display: none;
}

.row:hover {
  background: var(--soft);
}

.row-date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.row-kind {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.row-title {
  font-size: 15.5px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-go {
  color: var(--faint);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  display: grid;
  place-items: center;
}

.row:hover .row-go {
  opacity: 1;
  transform: none;
}

/* 笔记列表：堆叠行 */
.row-stack {
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-areas:
    "date title"
    "date desc"
    "date tags";
  align-items: start;
  row-gap: 6px;
  padding: 20px 12px;
}

.row-stack .row-date {
  grid-area: date;
  padding-top: 3px;
}

.row-stack .row-title {
  grid-area: title;
  white-space: normal;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.row-stack .row-desc {
  grid-area: desc;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.row-stack .row-tags {
  grid-area: tags;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.row-tags span {
  font-size: 11.5px;
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}

/* ---------------- 卡片 ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.card-media {
  aspect-ratio: 16 / 10;
  background: var(--soft);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-media-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--soft) 0%, var(--soft-2) 100%);
  border-bottom: 1px solid var(--border);
}

.card-media-empty span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 16px;
  text-align: center;
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
}

.card-year {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.card h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 580;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  display: inline-block;
  flex: none;
}

.status.is-live .dot {
  background: var(--live);
}
.status.is-done .dot {
  background: var(--done);
}
.status.is-wip .dot {
  background: var(--wip);
}
.status.is-archive .dot {
  background: var(--archive);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 11.5px;
  color: var(--faint);
  background: var(--soft);
  border-radius: 6px;
  padding: 2px 7px;
}

/* ---------------- 页面头 ---------------- */

.page-head {
  padding: 72px 0 32px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 610;
  color: var(--ink);
}

.lede {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 62ch;
}

/* ---------------- 筛选 ---------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 24px;
}

.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.chip span {
  opacity: 0.6;
  margin-left: 2px;
}

.grid-list {
  padding-bottom: 64px;
}

.filter-item[hidden] {
  display: none;
}

/* ---------------- 详情 ---------------- */

.detail {
  padding: 56px 0 40px;
  max-width: 860px;
}

.detail-narrow {
  max-width: 720px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 28px;
  transition: color 0.16s ease;
}

.back:hover {
  color: var(--ink);
}

.detail-head h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 610;
  color: var(--ink);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--faint);
}

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

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  align-items: center;
}

.file-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.file-card:hover {
  border-color: var(--border-strong);
  background: var(--panel);
}

.file-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
}

.file-body {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.file-body strong {
  font-size: 13.5px;
  font-weight: 520;
  color: var(--ink);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-body small {
  font-size: 11.5px;
  color: var(--faint);
}

/* ---------------- 正文 ---------------- */

.prose {
  margin-top: 40px;
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--text);
}

.prose > :first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose h2 {
  margin: 2.2em 0 0.7em;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
}

.prose h3 {
  margin: 1.8em 0 0.6em;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.prose h4 {
  margin: 1.6em 0 0.5em;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--border-strong);
  color: var(--muted);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
}

.prose li {
  margin: 0.35em 0;
}

.prose li::marker {
  color: var(--faint);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.855em;
  background: var(--soft-2);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  color: var(--ink);
}

.prose pre {
  margin: 1.6em 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  overflow-x: auto;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
}

.prose hr {
  height: 1px;
  border: 0;
  background: var(--border);
  margin: 2.6em 0;
}

.prose img {
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 1.4em 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose mark {
  background: color-mix(in srgb, #facc15 35%, transparent);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.md-table {
  margin: 1.6em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.prose th,
.prose td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.prose th {
  background: var(--soft);
  font-weight: 560;
  color: var(--ink);
  font-size: 13px;
}

.prose tr:last-child td {
  border-bottom: 0;
}

/* ---------------- 翻页 ---------------- */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 64px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  max-width: 860px;
}

.pager a:hover {
  color: var(--ink);
}

.pager span {
  color: var(--faint);
  font-size: 12px;
}

.card-plain .card-body {
  padding: 20px 20px 20px;
  gap: 9px;
}

.pager div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
  text-align: right;
}

/* ---------------- 日报 ---------------- */

.timeline {
  padding-bottom: 64px;
}

.month {
  margin: 34px 0 10px;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.daily {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 14px;
  border-radius: 12px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.16s ease;
}

.timeline .daily:last-child {
  border-bottom: 0;
}

.daily:hover {
  background: var(--soft);
}

.daily-date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding-top: 2px;
}

.daily-date strong {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.daily-date small {
  font-size: 11px;
  color: var(--faint);
}

.daily-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.daily-title {
  font-size: 16px;
  font-weight: 540;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.daily-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------- 站点导航 ---------------- */

.link-groups {
  padding-bottom: 64px;
}

.link-group {
  margin-bottom: 40px;
}

.link-group h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.link-list a:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.link-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 540;
  color: var(--ink);
}

.link-name .dot.is-on {
  background: var(--live);
}
.link-name .dot.is-off {
  background: var(--faint);
}

.link-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

.link-url {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 2px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.link-card:hover {
  border-color: var(--border-strong);
  background: var(--soft);
}

.link-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--faint);
}

.link-title {
  font-size: 14px;
  font-weight: 530;
  color: var(--ink);
}

.link-card .link-desc {
  font-size: 12.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------- 关于 ---------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 56px;
  padding-bottom: 72px;
}

.about-aside {
  padding-top: 44px;
}

.facts {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.facts dt {
  color: var(--faint);
}

.facts dd {
  margin: 0;
  color: var(--ink);
}

.aside-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  font-size: 13px;
}

.aside-links a {
  color: var(--muted);
}

.aside-links a:hover {
  color: var(--ink);
}

/* ---------------- 空状态 / 404 ---------------- */

.empty {
  padding: 40px 0;
  color: var(--faint);
  font-size: 14px;
}

.notfound {
  padding: 120px 0 140px;
  max-width: 520px;
}

.notfound h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: -0.03em;
  font-weight: 610;
  color: var(--ink);
}

/* ---------------- 页脚 ---------------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  margin-top: 24px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--faint);
}

.footer p {
  margin: 0;
}

/* ---------------- 入场动效 ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-title,
  .hero-sub,
  .hero-intro,
  .hero-actions,
  .hero-meta {
    animation: rise 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hero-sub {
    animation-delay: 0.02s;
  }
  .hero-intro {
    animation-delay: 0.04s;
  }
  .hero-actions {
    animation-delay: 0.06s;
  }
  .hero-meta {
    animation-delay: 0.08s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .about-aside {
    padding-top: 8px;
  }
}

@media (max-width: 680px) {
  .wrap {
    padding: 0 18px;
  }
  .topbar-inner {
    height: 56px;
    gap: 12px;
  }
  .brand-name {
    display: none;
  }
  .nav {
    gap: 0;
  }
  .nav a {
    padding: 6px 8px;
    font-size: 13.5px;
  }
  .nav-admin {
    width: 30px;
    height: 30px;
  }
  .hero {
    padding: 48px 0 40px;
  }
  .hero-intro {
    font-size: 15.5px;
  }
  .section {
    padding: 40px 0;
  }
  .grid,
  .link-grid {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 52px 38px minmax(0, 1fr);
    padding: 13px 8px;
  }
  .row-go {
    display: none;
  }
  .row-stack {
    grid-template-columns: 1fr;
    grid-template-areas:
      "date"
      "title"
      "desc"
      "tags";
    gap: 4px;
    padding: 18px 8px;
  }
  .page-head {
    padding: 44px 0 24px;
  }
  .link-list {
    grid-template-columns: 1fr;
  }
  .detail {
    padding: 36px 0 24px;
  }
  .prose {
    font-size: 16px;
    margin-top: 28px;
  }
  .daily {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 8px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ============================================================
   管理后台
   ============================================================ */

.auth-body {
  background: var(--soft);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth {
  width: 100%;
  max-width: 360px;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px 24px;
  box-shadow: var(--shadow-sm);
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 15px;
}

.auth-card h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
}

.auth-sub {
  margin: 4px 0 22px;
  font-size: 13px;
  color: var(--faint);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-error {
  margin: 0;
  font-size: 12.5px;
  color: #dc2626;
}

.auth-foot {
  margin: 18px 0 0;
  font-size: 12.5px;
  text-align: center;
}

.auth-foot a {
  color: var(--faint);
}

.auth-foot a:hover {
  color: var(--ink);
}

/* 表单元素 */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.field > span {
  color: var(--muted);
}

.input,
.textarea,
.select {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.7;
}

.textarea.code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
}

.admin-body {
  background: var(--soft);
  color: var(--text);
}

.admin-app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-loading {
  padding: 60px;
  color: var(--faint);
  font-size: 14px;
}

.side {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 560;
  color: var(--ink);
}

.side-brand small {
  font-weight: 400;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav a,
.side-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--muted);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.side-nav a:hover,
.side-nav button:hover {
  background: var(--soft);
  color: var(--ink);
}

.side-nav a.is-on {
  background: var(--soft-2);
  color: var(--ink);
  font-weight: 520;
}

.side-nav .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.side-foot a,
.side-foot button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--faint);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.side-foot a:hover,
.side-foot button:hover {
  background: var(--soft);
  color: var(--ink);
}

.main {
  padding: 26px 32px 60px;
  min-width: 0;
}

.main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.main-head h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
}

.main-head .sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--faint);
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.stat span {
  display: block;
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 6px;
}

.stat strong {
  font-size: 26px;
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.list {
  display: flex;
  flex-direction: column;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
}

.item:last-child {
  border-bottom: 0;
}

.item-main {
  min-width: 0;
  flex: 1;
}

.item-title {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 2px;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  background: var(--soft-2);
  color: var(--muted);
  white-space: nowrap;
}

.badge.is-draft {
  background: color-mix(in srgb, #d97706 12%, transparent);
  color: #b45309;
}

.badge.is-on {
  background: color-mix(in srgb, #16a34a 12%, transparent);
  color: #15803d;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
  flex-wrap: wrap;
}

.hint {
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.6;
}

.drop {
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
  background: var(--bg);
}

.drop:hover,
.drop.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  color: var(--muted);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip-list .chip {
  height: 26px;
  font-size: 12px;
}

.preview-pane {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  background: var(--bg);
  min-height: 200px;
  overflow: auto;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.tabs button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.tabs button.is-on {
  background: var(--soft-2);
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
  box-shadow: var(--shadow);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-wrap {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, #000 32%, transparent);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 200;
}

.modal {
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 22px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.modal h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.modal p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.kv {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px 14px;
  font-size: 13px;
  align-items: center;
}

.kv dt {
  color: var(--faint);
}

.kv dd {
  margin: 0;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.thumb {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--soft);
}

.thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.thumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 7px;
  font-size: 10.5px;
  color: var(--faint);
}

.thumb-bar button {
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}

.thumb-bar button:hover {
  color: #dc2626;
}

@media (max-width: 1000px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .admin-app {
    grid-template-columns: 1fr;
    padding-bottom: 62px;
  }
  .side {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    z-index: 90;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--border);
    overflow-x: auto;
  }
  .side-brand,
  .side-foot {
    display: none;
  }
  .side-nav {
    flex-direction: row;
    gap: 2px;
    width: 100%;
  }
  .side-nav a,
  .side-nav button {
    flex-direction: column;
    gap: 3px;
    font-size: 10.5px;
    padding: 6px 4px;
    justify-content: center;
    flex: 1;
    min-width: 54px;
    text-align: center;
  }
  .side-nav .count {
    display: none;
  }
  .main {
    padding: 16px 14px 40px;
  }
  .panel {
    padding: 14px;
    border-radius: 12px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .kv {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  .stat strong {
    font-size: 22px;
  }
  .auth-body {
    padding: 16px;
  }
}
