/* ==========================================================================
   稼轩长短句 · 个人博客样式表
   基于设计稿重构（paper / modern / midnight 三主题）
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Serif SC", "STSong", Georgia, serif;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.4s, color 0.4s;
  line-height: 1.85;
  min-height: 100vh;
}

/* ── Themes ─────────────────────────────────────────────────────────────── */
body[data-theme="paper"] {
  --bg: #f5f0e4;
  --bg2: #ede7d5;
  --bg3: #e4dcc5;
  --fg: #2c2010;
  --fgm: #6b5c44;
  --fgs: #7c6b53;
  --acc: #866934;
  --brd: #d4c9a8;
  --tagbg: rgba(134, 105, 52, 0.11);
  --nav: #f5f0e4ee;
  --shadow: 0 2px 18px rgba(44, 32, 16, 0.09);
  --dot: #866934;
}

body[data-theme="modern"] {
  --bg: #fafaf8;
  --bg2: #f2f0ed;
  --bg3: #e8e4de;
  --fg: #1a1a18;
  --fgm: #5e5c50;
  --fgs: #757365;
  --acc: #a32a16;
  --brd: #dddad4;
  --tagbg: rgba(163, 42, 22, 0.08);
  --nav: #fafaf8ee;
  --shadow: 0 2px 18px rgba(0, 0, 0, 0.07);
  --dot: #a32a16;
}

body[data-theme="midnight"] {
  --bg: #141210;
  --bg2: #1e1c18;
  --bg3: #252218;
  --fg: #e8dcc8;
  --fgm: #b0a48c;
  --fgs: #9a8e78;
  --acc: #d9b45c;
  --brd: #2e2a22;
  --tagbg: rgba(217, 180, 92, 0.11);
  --nav: #141210f0;
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
  --dot: #d9b45c;
}

a {
  color: var(--acc);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--acc);
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--brd);
  height: 58px;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-title {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--fg);
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.nav-title:hover {
  color: var(--acc);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  font-size: 14px;
  color: var(--fgm);
  transition: color 0.2s;
  padding: 6px 10px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--acc);
  text-decoration: none;
}

.nav-link.active {
  font-weight: 500;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--brd);
  background: var(--bg2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
  color: var(--fgm);
  margin-left: 4px;
}

.icon-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.main {
  max-width: 780px;
  margin: 0 auto;
  padding: 80px 28px 100px;
}

/* ── Section label ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 12px;
  color: var(--fgm);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--brd);
}

/* ── Profile card (home) ────────────────────────────────────────────────── */
.profile-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: 6px;
  margin-bottom: 40px;
}

.profile-av {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--acc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 28px;
  flex-shrink: 0;
  border: 1px solid var(--brd);
  overflow: hidden;
}

.profile-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 20px;
  color: var(--fg);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.profile-line {
  font-size: 13px;
  color: var(--fgm);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.profile-more {
  font-size: 12px;
  color: var(--acc);
  letter-spacing: 0.06em;
}

.profile-more:hover {
  text-decoration: underline;
}

/* ── Search / tag pill ──────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  border: 1px solid var(--brd);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--fg);
  font-family: "Noto Serif SC", serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--tagbg);
}

.search-input::placeholder {
  color: var(--fgm);
}

.search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fgm);
  pointer-events: none;
  font-size: 15px;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fgm);
  background: none;
  border: none;
  font-size: 14px;
  transition: color 0.2s;
  padding: 2px 4px;
}

.search-clear:hover {
  color: var(--acc);
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 32px;
  align-items: center;
}

.tag-pill {
  padding: 4px 13px;
  border-radius: 2px;
  font-size: 12px;
  background: var(--tagbg);
  color: var(--fgm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  letter-spacing: 0.03em;
}

.tag-pill:hover {
  color: var(--acc);
  border-color: var(--acc);
}

.tag-pill.on {
  color: var(--acc);
  border-color: var(--acc);
  font-weight: 600;
}

.tag-clear-btn {
  font-size: 12px;
  color: var(--fgm);
  background: none;
  border: none;
  transition: color 0.2s;
  letter-spacing: 0.03em;
  padding: 2px 6px;
}

.tag-clear-btn:hover {
  color: var(--acc);
}

/* ── Timeline ───────────────────────────────────────────────────────────── */
.tl-wrap {
  position: relative;
  padding-left: 96px;
}

.tl-wrap::before {
  content: "";
  position: absolute;
  left: 88px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--brd);
}

.year-sep {
  position: relative;
  display: flex;
  align-items: center;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 18px;
  color: var(--fgm);
  letter-spacing: 0.1em;
  margin-bottom: 24px;
  margin-top: 8px;
  left: -96px;
  width: calc(100% + 96px);
}

.year-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--brd);
  margin-left: 12px;
}

.year-sep:not(:first-child) {
  margin-top: 36px;
}

.tl-item {
  position: relative;
  margin-bottom: 36px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
  opacity: 0.75;
  transition: opacity 0.2s, transform 0.2s;
}

.tl-item:hover::before {
  opacity: 1;
  transform: scale(1.25);
}

.tl-date {
  position: absolute;
  left: -96px;
  top: 3px;
  width: 78px;
  text-align: right;
  font-size: 11px;
  color: var(--fgm);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.tl-date-month,
.tl-date-day {
  display: block;
}

.tl-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
  transition: color 0.2s;
  line-height: 1.55;
  letter-spacing: 0.03em;
  margin-bottom: 7px;
  display: block;
}

.tl-title:hover {
  color: var(--acc);
  text-decoration: none;
}

.tl-excerpt {
  font-size: 13.5px;
  color: var(--fgm);
  line-height: 1.8;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.m-tag {
  font-size: 11px;
  color: var(--acc);
  padding: 2px 8px;
  background: var(--tagbg);
  border-radius: 2px;
  letter-spacing: 0.04em;
}

.m-rt {
  font-size: 11px;
  color: var(--fgs);
}

.empty {
  text-align: center;
  padding: 64px 0;
  color: var(--fgm);
  font-size: 14px;
  line-height: 2;
}

/* ── Article ────────────────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fgm);
  background: none;
  border: none;
  transition: color 0.2s;
  margin-bottom: 36px;
  padding: 0;
  letter-spacing: 0.03em;
}

.back-btn:hover {
  color: var(--acc);
  text-decoration: none;
}

.art-h1 {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 18px;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-wrap: pretty;
}

.art-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--fgm);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--brd);
  margin-bottom: 36px;
}

.art-body {
  font-size: 16px;
  line-height: 2.05;
  color: var(--fg);
  letter-spacing: 0.05em;
  text-wrap: pretty;
}

.art-body p {
  margin-bottom: 1.6em;
}

.art-body h2 {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 400;
  margin: 2em 0 0.8em;
  letter-spacing: 0.04em;
  color: var(--fg);
}

.art-body h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 1.6em 0 0.6em;
  color: var(--fg);
  letter-spacing: 0.04em;
}

.art-body ul,
.art-body ol {
  margin: 0 0 1.6em 1.4em;
}

.art-body li {
  margin-bottom: 0.4em;
}

.art-body blockquote {
  border-left: 1px solid var(--brd);
  border-right: 1px solid var(--brd);
  padding: 0.2em 1.2em;
  margin: 1.4em 0;
  color: var(--fgm);
  background: var(--bg2);
  font-style: italic;
}

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

.art-body .thought-note {
  margin: 1.7em 0 2em;
  padding: 1em 1.25em 1.05em 1.35em;
  border: 1px solid var(--brd);
  border-top: 2px solid var(--acc);
  background: var(--tagbg);
  box-shadow: var(--shadow);
}

.art-body .thought-note-title {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0.08em;
  color: var(--acc);
  margin-bottom: 0.55em;
}

.art-body .thought-note p:last-child {
  margin-bottom: 0;
}

.art-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: var(--bg2);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--acc);
}

.art-body pre {
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: 4px;
  padding: 14px 18px;
  overflow-x: auto;
  margin: 1.4em 0;
  line-height: 1.7;
}

.art-body pre code {
  background: transparent;
  padding: 0;
  color: var(--fg);
  font-size: 13.5px;
}

.art-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.2em 0;
  border: 1px solid var(--brd);
}

.art-body hr {
  border: none;
  border-top: 1px solid var(--brd);
  margin: 2em 0;
}

.art-body a {
  border-bottom: 1px solid var(--acc);
}

.art-body a:hover {
  background: var(--tagbg);
  text-decoration: none;
}

.art-divider {
  text-align: center;
  color: var(--brd);
  margin: 36px 0;
  letter-spacing: 0.4em;
  font-size: 18px;
}

/* ── Prev / Next nav ────────────────────────────────────────────────────── */
.art-nav {
  display: flex;
  gap: 12px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--brd);
}

.art-nav-btn {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--brd);
  border-radius: 4px;
  background: var(--bg2);
  transition: all 0.2s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: inherit;
}

.art-nav-btn.next {
  text-align: right;
  align-items: flex-end;
}

.art-nav-btn:hover {
  border-color: var(--acc);
  background: var(--tagbg);
  text-decoration: none;
}

.art-nav-btn:hover .anb-title {
  color: var(--acc);
}

.art-nav-btn.empty-slot {
  pointer-events: none;
  opacity: 0;
}

.anb-dir {
  font-size: 11px;
  color: var(--fgm);
  letter-spacing: 0.08em;
}

.anb-title {
  font-size: 13px;
  color: var(--fg);
  transition: color 0.2s;
  letter-spacing: 0.03em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 260px;
}

/* ── Comments (Giscus wrapper) ──────────────────────────────────────────── */
.cmt-section {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--brd);
}

.cmt-hd {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 28px;
  color: var(--fg);
  letter-spacing: 0.04em;
}

/* ── About ──────────────────────────────────────────────────────────────── */
.about-hero {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--brd);
}

.about-av {
  width: 110px;
  height: 110px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--brd);
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 48px;
  color: var(--acc);
  overflow: hidden;
}

.about-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}

.about-name {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 30px;
  font-weight: 400;
  margin-bottom: 6px;
  color: var(--fg);
  letter-spacing: 0.06em;
}

.about-line {
  font-size: 14px;
  color: var(--acc);
  margin-bottom: 14px;
  font-style: italic;
  letter-spacing: 0.04em;
}

.about-bio {
  font-size: 15px;
  line-height: 1.95;
  color: var(--fg);
  text-wrap: pretty;
}

.about-bio p {
  margin-bottom: 1em;
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-sec-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--fgm);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.interest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.int-chip {
  padding: 5px 14px;
  border: 1px solid var(--brd);
  border-radius: 2px;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg2);
  letter-spacing: 0.04em;
}

/* ── Archive ────────────────────────────────────────────────────────────── */
.arc-year {
  margin-bottom: 40px;
}

.arc-year-title {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--brd);
  letter-spacing: 0.06em;
}

.arc-month {
  margin-bottom: 22px;
}

.arc-month-title {
  font-size: 12px;
  color: var(--fgm);
  margin-bottom: 9px;
  letter-spacing: 0.12em;
}

.arc-art {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  color: inherit;
}

.arc-art:hover {
  text-decoration: none;
}

.arc-art:hover .arc-t {
  color: var(--acc);
}

.arc-d {
  font-size: 11px;
  color: var(--fgm);
  min-width: 28px;
  flex-shrink: 0;
}

.arc-t {
  font-size: 15px;
  color: var(--fg);
  transition: color 0.2s;
  flex: 1;
  letter-spacing: 0.03em;
}

.arc-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.arc-tag {
  font-size: 10px;
  color: var(--fgm);
  padding: 1px 6px;
  background: var(--tagbg);
  border-radius: 2px;
}

/* ── Tags page ──────────────────────────────────────────────────────────── */
.tag-group {
  margin-bottom: 36px;
}

.tag-group-title {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--brd);
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.tag-group-count {
  font-size: 12px;
  color: var(--fgm);
  letter-spacing: 0.04em;
}

.tag-group-list {
  list-style: none;
}

.tag-group-list li {
  padding: 6px 0;
}

.tag-group-list a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: inherit;
}

.tag-group-list a:hover {
  text-decoration: none;
}

.tag-group-list a:hover .t {
  color: var(--acc);
}

.tag-group-list .d {
  font-size: 11px;
  color: var(--fgm);
  min-width: 78px;
  flex-shrink: 0;
}

.tag-group-list .t {
  font-size: 14px;
  color: var(--fg);
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

/* ── Reading Progress ───────────────────────────────────────────────────── */
.read-prog {
  position: fixed;
  top: 58px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--acc);
  z-index: 99;
  transition: width 0.12s;
}

/* ── Back to top ────────────────────────────────────────────────────────── */
.btt {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 98;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--acc);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow);
  transition: opacity 0.3s, transform 0.3s;
}

.btt.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 40px 20px 60px;
  color: var(--fgm);
  font-size: 12px;
  letter-spacing: 0.06em;
  border-top: 1px solid var(--brd);
  margin-top: 40px;
}

.site-footer p {
  margin-bottom: 6px;
}

.footer-ornament {
  color: var(--fgs);
  letter-spacing: 0.2em;
}

/* ── Page transitions ───────────────────────────────────────────────────── */
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-enter {
  animation: pageIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Pagefind overrides (if used) ───────────────────────────────────────── */
:root {
  --pagefind-ui-primary: var(--acc);
  --pagefind-ui-text: var(--fg);
  --pagefind-ui-background: var(--bg2);
  --pagefind-ui-border: var(--brd);
  --pagefind-ui-tag: var(--tagbg);
  --pagefind-ui-border-radius: 4px;
  --pagefind-ui-font: "Noto Serif SC", serif;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .main {
    padding: 72px 16px 80px;
  }
  .tl-wrap {
    padding-left: 72px;
  }
  .tl-wrap::before {
    left: 64px;
  }
  .tl-date {
    left: -72px;
    width: 58px;
  }
  .tl-title {
    font-size: 16px;
  }
  .about-hero {
    flex-direction: column;
    gap: 20px;
  }
  .art-h1 {
    font-size: 24px;
  }
  .profile-card {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }
  .btt {
    bottom: 20px;
    right: 20px;
  }
  .nav-inner {
    padding: 0 16px;
  }
  .nav-link {
    padding: 6px 7px;
    font-size: 13px;
  }
}
