/* ==========================================================
   断记 duanji.icu — 全站样式
   设计语：墨与朱砂，纸与光
   ========================================================== */

:root {
  --bg: #f6f4ee;
  --bg-soft: #efece2;
  --bg-a: rgba(246, 244, 238, 0.86);
  --card: #fffefa;
  --text: #2c2a25;
  --text-2: #857e72;
  --accent: #b0443a;          /* 朱砂 */
  --accent-2: #8a5a33;        /* 黛褐 */
  --accent-soft: rgba(176, 68, 58, 0.09);
  --line: #e5dfd2;
  --shadow: 0 1px 2px rgba(46, 40, 28, 0.05), 0 10px 30px rgba(46, 40, 28, 0.07);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #17161a;
  --bg-soft: #201f25;
  --bg-a: rgba(23, 22, 26, 0.86);
  --card: #211f26;
  --text: #e9e4da;
  --text-2: #968f85;
  --accent: #d4695c;
  --accent-2: #cfa06b;
  --accent-soft: rgba(212, 105, 92, 0.13);
  --line: #2e2c33;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.35s ease, color 0.35s ease;
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-a);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.seal {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px var(--accent-soft);
  user-select: none;
}

.site-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14.5px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

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

#themeToggle {
  margin-left: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

#themeToggle:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ============ 主体 ============ */
main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 22px 90px;
}

/* ============ 首页 Hero ============ */
.hero {
  text-align: center;
  padding: 84px 0 30px;
}

.hero .seal-big {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  font-size: 32px;
  margin: 0 auto 22px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 10px;
  text-indent: 10px;
  line-height: 1.2;
}

.hero .tagline {
  font-family: var(--serif);
  font-size: 17.5px;
  color: var(--text-2);
  margin-top: 16px;
  letter-spacing: 1.5px;
}

.hero .hero-desc {
  font-size: 14.5px;
  color: var(--text-2);
  max-width: 480px;
  margin: 18px auto 0;
}

.hero .hero-ornament {
  margin: 34px auto 0;
  width: 120px;
  height: 12px;
  background:
    linear-gradient(90deg, transparent, var(--line) 20%, var(--accent) 50%, var(--line) 80%, transparent);
  opacity: 0.55;
  clip-path: polygon(0 50%, 38% 50%, 50% 0, 62% 50%, 100% 50%);
}

/* ============ 文章列表 ============ */
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 54px 0 6px;
}

.list-head h2 {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 4px;
  font-weight: 700;
}

.list-head .count { font-size: 13px; color: var(--text-2); }

.year-title {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-2);
  letter-spacing: 3px;
  margin: 34px 0 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.year-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.post-item {
  display: flex;
  gap: 26px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: background 0.25s, transform 0.25s;
  border-radius: 10px;
}

.post-item:hover { background: var(--accent-soft); transform: translateX(4px); }

.post-date {
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 5px;
  width: 62px;
  flex-shrink: 0;
}

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

.post-title {
  font-family: var(--serif);
  font-size: 20.5px;
  font-weight: 600;
  line-height: 1.45;
}

.post-item:hover .post-title { color: var(--accent); }

.post-excerpt {
  color: var(--text-2);
  font-size: 14.5px;
  margin-top: 7px;
  line-height: 1.7;
}

.post-meta {
  margin-top: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.tag {
  background: var(--bg-soft);
  color: var(--text-2);
  padding: 2px 11px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* ============ 文章页 ============ */
.article { max-width: 700px; margin: 0 auto; }

.article-header { text-align: center; padding: 56px 0 34px; }

.article-header .kicker {
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.article-title {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.45;
}

.article-meta {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 13.5px;
  display: flex;
  justify-content: center;
  gap: 8px 16px;
  flex-wrap: wrap;
}

.article-meta .dot::before { content: "·"; margin-right: 16px; color: var(--line); }

.article-body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2.0;
}

.article-body p { margin-bottom: 1.35em; }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--card);
  padding: 15px 20px;
  margin: 1.7em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-2);
  font-size: 16px;
  box-shadow: var(--shadow);
}

.article-body h2 {
  font-size: 21.5px;
  margin: 2.1em 0 0.85em;
  padding-left: 13px;
  border-left: 4px solid var(--accent);
  line-height: 1.4;
}

.article-body ul, .article-body ol { margin: 0 0 1.4em 1.6em; }
.article-body li { margin-bottom: 0.55em; }
.article-body li::marker { color: var(--accent); }

.article-body strong { color: var(--accent-2); font-weight: 600; }

.article-body .divider {
  text-align: center;
  color: var(--text-2);
  letter-spacing: 10px;
  margin: 2.2em 0;
  font-size: 13px;
}

.article-tags { margin-top: 36px; display: flex; gap: 8px; }

/* 上一篇 / 下一篇 */
.post-nav {
  display: flex;
  gap: 16px;
  margin: 44px 0 6px;
}

.post-nav a {
  flex: 1;
  min-width: 0;
  padding: 15px 19px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.post-nav a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post-nav .label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.post-nav .next { text-align: right; }

/* ============ 关于页 / 通用卡片 ============ */
.page-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 46px 48px;
  box-shadow: var(--shadow);
  margin-top: 48px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 2.05;
}

.page-card h1 {
  font-size: 26px;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.page-card p { margin-bottom: 1.1em; }

.page-card blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 18px;
  margin: 1.4em 0;
  color: var(--text-2);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}

.page-card .sig {
  text-align: right;
  color: var(--text-2);
  font-size: 14.5px;
  margin-top: 26px;
}

/* ============ 404 ============ */
.notfound {
  text-align: center;
  padding: 110px 0 60px;
}

.notfound .nf-code {
  font-family: var(--serif);
  font-size: 96px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 8px;
  line-height: 1;
}

.notfound p { color: var(--text-2); margin: 20px 0 30px; }

.btn-home {
  display: inline-block;
  padding: 10px 26px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  text-decoration: none;
  font-size: 14.5px;
  transition: background 0.25s, color 0.25s;
}

.btn-home:hover { background: var(--accent); color: #fff; }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 22px 42px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  line-height: 2;
}

.site-footer .foot-seal { color: var(--accent); font-family: var(--serif); letter-spacing: 2px; }

/* ============ 滚动显现动画 ============ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .hero { padding: 56px 0 20px; }
  .hero h1 { font-size: 36px; letter-spacing: 7px; text-indent: 7px; }
  .post-item { flex-direction: column; gap: 5px; padding: 22px 4px; }
  .post-date { width: auto; padding-top: 0; }
  .post-title { font-size: 18.5px; }
  .article-header { padding: 40px 0 26px; }
  .article-title { font-size: 25px; }
  .article-body { font-size: 16px; }
  .page-card { padding: 30px 26px; margin-top: 32px; }
  .post-nav { flex-direction: column; }
  .post-nav .next { text-align: left; }
  .site-name { letter-spacing: 2px; }
}
