/* ============================================================
   LGL Family —— 站点样式
   想换主色，只改 :root 里 --accent 那一行就够了。
   ============================================================ */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #22201c;
  --ink-soft: #4a443c;
  --muted: #7c736a;
  --line: #e7e0d6;
  --accent: #b4492b;
  --accent-soft: #f6ece7;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --surface: #1c1a16;
    --ink: #f2ede5;
    --ink-soft: #d8d0c5;
    --muted: #9a9086;
    --line: #2e2a24;
    --accent: #e0745a;
    --accent-soft: #2a1d18;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

.stage { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶栏 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.nav { display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--muted); }
.nav a { transition: color 0.16s ease; }
.nav a:hover, .nav a.is-active { color: var(--ink); }

/* ---------- 头部介绍 ---------- */

.hero { padding: 68px 0 44px; border-bottom: 1px solid var(--line); }

.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-kicker::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 60px;
  background: var(--line);
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(34px, 5.6vw, 56px);
  line-height: 1.14;
  letter-spacing: -0.028em;
  font-weight: 600;
  max-width: 780px;
  text-wrap: balance;
}

.hero p {
  margin: 0;
  max-width: 600px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.hero-stats {
  margin-top: 30px;
  display: flex;
  gap: 34px;
  font-size: 13px;
  color: var(--muted);
}

.hero-stats strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- 工具条 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  flex-wrap: wrap;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
  line-height: 1.4;
}

.chip:hover { border-color: var(--muted); color: var(--ink); }

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.search-wrap { position: relative; }

.search {
  width: 200px;
  padding: 9px 14px 9px 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s ease, width 0.2s ease;
}

.search:focus { border-color: var(--accent); width: 240px; }

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  pointer-events: none;
}

/* ---------- 时间线 ---------- */

.year-block { margin-bottom: 8px; }

.year-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 0 4px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.year-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.entry {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.entry:last-child { border-bottom: none; }

.entry-date {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding-top: 4px;
}

.entry-date span { display: block; font-size: 11px; letter-spacing: 0.1em; opacity: 0.7; }

.entry-body { display: flex; gap: 30px; align-items: flex-start; }

.entry-text { flex: 1; min-width: 0; }

.entry h2 {
  margin: 0 0 10px;
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.42;
  font-weight: 600;
  letter-spacing: -0.014em;
  transition: color 0.16s ease;
  text-wrap: balance;
}

.entry:hover h2 { color: var(--accent); }

.entry p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }

.entry-thumb {
  width: 176px;
  height: 118px;
  border-radius: 10px;
  overflow: hidden;
  flex: none;
  background: linear-gradient(135deg, var(--accent-soft), var(--line));
}

.entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.entry:hover .entry-thumb img { transform: scale(1.05); }

/* ---------- 空状态 ---------- */

.empty {
  padding: 70px 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 文章页 ---------- */

.post-view { padding: 40px 0 80px; max-width: 680px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 34px;
  transition: color 0.16s ease;
}

.back:hover { color: var(--accent); }
.back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.post-head { max-width: 100%; margin-bottom: 34px; }

.post-head h1 {
  margin: 0 0 20px;
  font-size: clamp(27px, 4.4vw, 42px);
  line-height: 1.3;
  letter-spacing: -0.024em;
  font-weight: 600;
  text-wrap: balance;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.tag {
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.post-cover {
  margin: 0 0 48px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), var(--line));
}

.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.prose { max-width: 100%; font-size: 16.5px; line-height: 1.95; color: var(--ink-soft); }

.prose > *:first-child { margin-top: 0; }

.prose p { margin: 0 0 1.45em; }

.prose h2 {
  margin: 2.4em 0 0.9em;
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: -0.012em;
  font-weight: 600;
  color: var(--ink);
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 15.5px;
}

.prose blockquote p { margin: 0; }

.prose ul { margin: 0 0 1.45em; padding-left: 0; list-style: none; }

.prose li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 0.5em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
}

.prose img {
  width: 100%;
  border-radius: 10px;
  margin: 2em 0;
  background: var(--line);
}

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- 上下篇 ---------- */

.post-nav {
  max-width: 100%;
  margin-top: 60px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.post-nav a {
  display: block;
  padding: 14px 0;
  min-width: 0;
}

.post-nav .label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; display: block; margin-bottom: 5px; }
.post-nav .title { font-size: 14.5px; font-weight: 500; line-height: 1.6; transition: color 0.16s ease; }
.post-nav a:hover .title { color: var(--accent); }
.post-nav .next { text-align: right; }

/* ---------- 关于页 ---------- */

.about-view { padding: 60px 0 90px; max-width: 660px; }
.about-view h1 { font-size: clamp(28px, 4.4vw, 40px); margin: 0 0 26px; letter-spacing: -0.024em; font-weight: 600; }

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a:hover { color: var(--accent); }

/* ---------- 入场动画 ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.entry, .post-view > * { animation: rise 0.45s ease both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  .stage { padding: 0 18px; }
  .header-inner { padding: 12px 18px; }
  .nav { gap: 16px; font-size: 13px; }
  .hero { padding: 44px 0 32px; }
  .hero-stats { gap: 26px; }

  .entry { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .entry-date { display: flex; gap: 8px; align-items: baseline; padding-top: 0; }
  .entry-date span { display: inline; }
  .entry-body { gap: 16px; }
  .entry-thumb { width: 104px; height: 78px; }

  .search { width: 100%; }
  .search:focus { width: 100%; }
  .search-wrap { flex: 1; min-width: 150px; }
  .toolbar { padding: 18px 0; }

  .post-nav { grid-template-columns: 1fr; gap: 8px; }
  .post-nav .next { text-align: left; }
}

@media (max-width: 460px) {
  .entry-thumb { display: none; }
  .brand-sub { display: none; }
}
