/* 光灵一起看世界 —— 个人博客样式 */

:root {
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --ink: #2A2620;
  --ink-soft: #585147;
  --muted: #93897B;
  --line: #E9E2D5;
  --accent: #A85C2E;
  --accent-soft: #F4E8DC;
  --glow-1: rgba(214, 158, 96, 0.16);
  --glow-2: rgba(120, 150, 140, 0.12);
  --shadow: 0 1px 2px rgba(42, 38, 32, 0.04), 0 10px 30px -18px rgba(42, 38, 32, 0.25);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", sans-serif;
}

[data-theme="dark"] {
  --bg: #141310;
  --surface: #1C1A16;
  --ink: #EDE7DB;
  --ink-soft: #BDB4A4;
  --muted: #8A8274;
  --line: #2D2A23;
  --accent: #D99A62;
  --accent-soft: #2B231A;
  --glow-1: rgba(214, 158, 96, 0.10);
  --glow-2: rgba(120, 150, 140, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px -18px rgba(0, 0, 0, 0.7);
}

* { 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: 17px;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(46rem 26rem at 12% -8%, var(--glow-1), transparent 68%),
    radial-gradient(38rem 22rem at 96% 4%, var(--glow-2), transparent 70%);
}

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

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

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

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 748px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- 顶部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 248, 243, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.35s ease;
}

[data-theme="dark"] .site-header { background: rgba(20, 19, 16, 0.86); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--bg); }
}

.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14.5px;
  color: var(--muted);
}

.nav a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav a:hover, .nav a.active { color: var(--ink); }

.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-btn:hover { color: var(--accent); border-color: var(--accent); transform: rotate(-12deg); }
.theme-btn svg { width: 15px; height: 15px; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ---------- 首页头部 ---------- */

.hero { padding: 62px 0 8px; }

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 5.6vw, 42px);
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero .lead {
  margin: 0;
  max-width: 34em;
  font-size: 16.5px;
  color: var(--ink-soft);
}

.hero .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--muted);
}

.hero .meta-line span { display: inline-flex; align-items: center; gap: 6px; }

.hero .meta-line i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
  font-style: normal;
}

/* ---------- 区块标题 ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 54px 0 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

.section-head .more {
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.section-head .more:hover { color: var(--accent); }

/* ---------- 文章列表 ---------- */

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

.post-item { border-bottom: 1px solid var(--line); }
.post-item:last-child { border-bottom: none; }

.post-link {
  display: block;
  padding: 26px 4px 26px 0;
  transition: transform 0.25s ease;
}

.post-link:hover { transform: translateX(4px); }

.post-link .row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.post-link .cat {
  color: var(--accent);
  font-weight: 600;
}

.post-link h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.post-link:hover h3 { color: var(--accent); }

.post-link p {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* ---------- 文章页 ---------- */

.post-header { padding: 54px 0 0; }

.post-header .kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.post-header .kicker .cat {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.post-header h1 {
  margin: 0 0 20px;
  font-size: clamp(26px, 4.6vw, 34px);
  line-height: 1.42;
  font-weight: 700;
}

.post-header .desc {
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  font-size: 15.5px;
  color: var(--ink-soft);
}

.post-body {
  padding: 40px 0 10px;
  font-size: 17px;
  line-height: 1.95;
}

.post-body p { margin: 0 0 1.5em; }

.post-body h2 {
  margin: 2.2em 0 0.9em;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  line-height: 1.6;
}

.post-body blockquote {
  margin: 1.8em 0;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 16px;
  box-shadow: var(--shadow);
}

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

.post-body ol, .post-body ul { margin: 0 0 1.5em; padding-left: 1.4em; }
.post-body li { margin-bottom: 0.5em; }

.post-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

.post-body .note {
  font-size: 14.5px;
  color: var(--muted);
}

.post-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 44px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 36px 0 0;
  font-size: 14.5px;
  color: var(--muted);
  transition: color 0.2s ease, gap 0.2s ease;
}

.back-link:hover { color: var(--accent); gap: 11px; }

/* ---------- 归档 ---------- */

.archive-group { margin-bottom: 26px; }

.archive-group h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.archive-group h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

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

.archive-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 16px;
}

.archive-list li:last-child { border-bottom: none; }

.archive-list time {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.archive-list a { transition: color 0.2s ease; }
.archive-list a:hover { color: var(--accent); }

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

.about-card {
  margin-top: 34px;
  padding: 30px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about-card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.about-card p { margin: 0 0 1em; font-size: 16px; color: var(--ink-soft); }
.about-card p:last-child { margin-bottom: 0; }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.facts li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  font-size: 15.5px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.facts li:last-child { border-bottom: none; padding-bottom: 0; }
.facts .k { color: var(--muted); font-size: 14px; }

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

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 72px;
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}

.footer-left { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }

.footer-left .sep { opacity: 0.4; }

.site-footer a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.footer-icp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.footer-icp:hover { color: var(--accent); border-bottom-color: var(--accent); }

.footer-icp svg { width: 14px; height: 14px; opacity: 0.85; flex: none; }

.footer-note {
  margin: 20px 0 0;
  max-width: 44em;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
  opacity: 0.8;
}

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

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 20px; }
  .header-inner { height: 60px; }
  .brand { font-size: 15px; letter-spacing: 0.04em; }
  .nav { gap: 15px; font-size: 13.5px; }
  .hero { padding: 40px 0 4px; }
  .hero h1 { margin-bottom: 14px; }
  .hero .lead { font-size: 15.5px; }
  .section-head { margin-top: 40px; }
  .post-link { padding: 22px 0; }
  .post-link h3 { font-size: 18px; }
  .post-link p { font-size: 14.5px; }
  .post-header { padding-top: 38px; }
  .post-body { padding-top: 30px; font-size: 16.5px; line-height: 1.9; }
  .about-card { padding: 24px 22px; }
  .facts li { grid-template-columns: 70px 1fr; gap: 10px; }
  .site-footer { margin-top: 54px; padding-bottom: 36px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
