/* ==========================================================
   大橙小站 · dachengyunfuwu.online
   一个轻量的个人静态博客样式表
   ========================================================== */

:root {
  --bg: #faf6f0;
  --bg-soft: #f3ece2;
  --surface: #ffffff;
  --ink: #241d17;
  --ink-soft: #4a4038;
  --muted: #8a7f74;
  --line: #eae0d3;
  --accent: #e8590c;
  --accent-ink: #c24a06;
  --accent-soft: #fdeee3;
  --shadow: 0 1px 2px rgba(60, 40, 20, .04), 0 8px 24px rgba(60, 40, 20, .06);
  --radius: 18px;
  --wrap: 760px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15110d;
    --bg-soft: #211a14;
    --surface: #1d1712;
    --ink: #f3eade;
    --ink-soft: #d8cabb;
    --muted: #9e9182;
    --line: #332a21;
    --accent: #ff8a3d;
    --accent-ink: #ffa066;
    --accent-soft: #33200f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .28);
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --bg: #15110d;
  --bg-soft: #211a14;
  --surface: #1d1712;
  --ink: #f3eade;
  --ink-soft: #d8cabb;
  --muted: #9e9182;
  --line: #332a21;
  --accent: #ff8a3d;
  --accent-ink: #ffa066;
  --accent-soft: #33200f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

*,
*::before,
*::after { 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-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 99;
}
.skip-link:focus { left: 0; }

/* ---------- 头部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff9a4d, #e8590c);
  box-shadow: 0 4px 12px rgba(232, 89, 12, .32);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  user-select: none;
}

.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .12em;
}

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

.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 14.5px;
  white-space: nowrap;
}
.nav a:hover { background: var(--bg-soft); text-decoration: none; }
.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.theme-btn {
  margin-left: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
  transition: border-color .18s, color .18s, transform .18s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }

/* ---------- 通用容器 ---------- */

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

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

.hero {
  padding: 64px 0 40px;
  border-bottom: 1px dashed var(--line);
}

.eyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--accent-ink);
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0 16px;
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.26;
  letter-spacing: -.012em;
}

.hl {
  position: relative;
  isolation: isolate;
  color: var(--accent);
}

/* 标题里的浅橙色高亮条，放在文字下层 */
.hl::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -.04em;
  right: -.04em;
  bottom: .1em;
  height: .34em;
  border-radius: .1em;
  background: #ffd9bd;
}

html[data-theme="dark"] .hl::after { background: #5a3418; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hl::after { background: #5a3418; }
}

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

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
}
.chip b { color: var(--ink-soft); font-weight: 600; }

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

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 46px 0 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .02em;
}

.count { font-size: 13px; color: var(--muted); }

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

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.post-card:hover { transform: translateY(-2px); border-color: #e6d3bd; }

.post-card > a {
  display: block;
  padding: 22px 24px;
  color: inherit;
  text-decoration: none;
}
.post-card > a:hover { text-decoration: none; }

.post-card time {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}

.post-card h3 {
  margin: 6px 0 8px;
  font-size: 20px;
  line-height: 1.42;
}

.post-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.8px;
  line-height: 1.72;
}

.more {
  display: inline-block;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-ink);
}

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

.article { padding: 46px 0 6px; }

.article-head {
  padding-bottom: 22px;
  margin-bottom: 28px;
  border-bottom: 1px dashed var(--line);
}

.article-head h1 {
  margin: 10px 0 12px;
  font-size: clamp(26px, 4.4vw, 36px);
  line-height: 1.34;
  letter-spacing: -.01em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13.5px;
  color: var(--muted);
}

.prose {
  font-size: 16.8px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.prose h2 {
  margin: 40px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
}

.prose h3 {
  margin: 28px 0 10px;
  font-size: 18px;
  color: var(--ink);
}

.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.35em; }
.prose li { margin: 6px 0; }

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: .9em;
}

.prose pre {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #201a15;
  color: #f3e9dd;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.prose blockquote {
  margin: 22px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  color: var(--ink-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr { margin: 32px 0; border: 0; border-top: 1px dashed var(--line); }

.prose a { border-bottom: 1px solid var(--accent-soft); }
.prose a:hover { border-bottom-color: var(--accent); text-decoration: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 34px;
  font-size: 14px;
  color: var(--muted);
}
.back-link:hover { color: var(--accent-ink); text-decoration: none; }

/* ---------- 关于 / 归档 ---------- */

.info-card {
  margin: 26px 0;
  padding: 8px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.info-list li:last-child { border-bottom: 0; }
.info-list .k { color: var(--muted); white-space: nowrap; }
.info-list .v { color: var(--ink-soft); text-align: right; }

.archive-year {
  margin: 38px 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--accent-ink);
}

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

.archive-list li {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.archive-list time {
  flex: 0 0 96px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.archive-list a { font-size: 15.5px; }

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

.site-footer {
  margin-top: 72px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner p { margin: 0; }

.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent-ink); }

/* ---------- 404 ---------- */

.notfound {
  min-height: 62vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 60px 20px;
}
.notfound .code {
  margin: 0;
  font-size: clamp(76px, 16vw, 128px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--accent);
  opacity: .18;
}
.notfound h1 { margin: -18px 0 10px; font-size: 24px; }
.notfound p { margin: 0 0 24px; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(232, 89, 12, .28);
}
.btn:hover { background: var(--accent-ink); color: #fff; text-decoration: none; }

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

@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; gap: 8px; }
  .brand-sub { display: none; }
  .brand { font-size: 16px; }
  .brand-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .wrap, .footer-inner { padding: 0 16px; }
  .hero { padding: 44px 0 30px; }
  .post-card > a { padding: 18px 18px; }
  .post-card h3 { font-size: 18.5px; }
  .article { padding-top: 34px; }
  .prose { font-size: 16.2px; }
  .archive-list time { flex-basis: 84px; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
