/* ===== 纸上 · 编辑排版风博客 ===== */
:root {
  --paper: #f7f4ec;
  --paper-2: #efe9dd;
  --ink: #1c1a16;
  --ink-2: #5c564a;
  --line: #d8d0c0;
  --accent: #b3382c;
  --accent-soft: #b3382c1a;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --sans: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}
[data-theme="dark"] {
  --paper: #191714;
  --paper-2: #211e19;
  --ink: #e8e2d4;
  --ink-2: #a39a88;
  --line: #3a352c;
  --accent: #e0604f;
  --accent-soft: #e0604f1f;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  transition: background .4s, color .4s;
  min-width: 375px;
}
::selection { background: var(--accent); color: #fff; }

/* ===== 顶部导航 ===== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 0 28px; height: 60px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 21px;
  color: var(--ink); text-decoration: none; letter-spacing: .04em;
  display: flex; align-items: baseline; gap: 8px;
}
.brand span {
  font-family: var(--sans); font-size: 9px; font-weight: 500;
  letter-spacing: .32em; color: var(--ink-2);
}
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  color: var(--ink-2); text-decoration: none; font-size: 13px;
  letter-spacing: .1em; position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .3s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* 主题切换 */
.theme-btn {
  width: 38px; height: 22px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--paper-2);
  cursor: pointer; position: relative; font-size: 11px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5px; color: var(--ink-2);
}
.theme-btn::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); transition: left .3s cubic-bezier(.6,0,.3,1.4);
}
[data-theme="dark"] .theme-btn::after { left: 18px; }

/* ===== 头版 ===== */
.front {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 300px;
  border-bottom: 2px solid var(--ink);
}
.headline {
  padding: 44px 40px 40px 28px;
  border-right: 1px solid var(--line);
  cursor: pointer;
}
.headline .kicker {
  display: inline-block; font-size: 11px; letter-spacing: .3em;
  color: var(--accent); margin-bottom: 18px;
  border: 1px solid var(--accent); padding: 3px 10px; border-radius: 999px;
}
.headline h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 52px); line-height: 1.28;
  margin-bottom: 18px; transition: color .25s;
}
.headline:hover h1 { color: var(--accent); }
.headline .dek {
  color: var(--ink-2); font-size: 16px; line-height: 1.9;
  font-family: var(--serif); margin-bottom: 24px; max-width: 560px;
}
.byline {
  display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-2);
}
.byline .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 15px;
  border: 1px solid var(--accent);
}
.byline b { color: var(--ink); font-weight: 600; }
.byline .dot::before { content: "·"; margin: 0 6px; }

.front-side { padding: 40px 24px 36px; display: flex; flex-direction: column; gap: 32px; }
.side-title {
  font-family: var(--serif); font-size: 14px; letter-spacing: .2em;
  padding-bottom: 10px; border-bottom: 1px solid var(--ink);
  margin-bottom: 6px;
}
.pick {
  display: flex; gap: 12px; padding: 12px 4px;
  border-bottom: 1px dashed var(--line); cursor: pointer;
}
.pick:last-child { border-bottom: none; }
.pick .n {
  font-family: var(--serif); font-size: 20px; font-style: italic;
  color: var(--line); line-height: 1.2; flex-shrink: 0; width: 22px;
}
.pick h4 {
  font-family: var(--serif); font-size: 15px; line-height: 1.5;
  transition: color .25s;
}
.pick:hover h4 { color: var(--accent); }
.pick p { font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.side-about { font-size: 13px; color: var(--ink-2); line-height: 1.9; }
.stats { display: flex; gap: 24px; margin-top: 16px; }
.stats b { font-family: var(--serif); font-size: 26px; display: block; }
.stats span { font-size: 11px; color: var(--ink-2); letter-spacing: .15em; }

/* ===== 轮播条 ===== */
.ticker-wrap {
  border-bottom: 1px solid var(--line);
  overflow: hidden; white-space: nowrap;
  background: var(--ink); color: var(--paper);
}
.ticker {
  display: inline-flex; gap: 0;
  animation: tick 40s linear infinite;
  padding: 9px 0;
}
.ticker:hover { animation-play-state: paused; }
.ticker span {
  font-size: 12px; letter-spacing: .12em; padding: 0 34px;
  display: inline-flex; align-items: center; gap: 34px; cursor: pointer;
}
.ticker span::after { content: "◈"; color: var(--accent); font-size: 10px; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ===== 主体 ===== */
.container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.latest { padding: 56px 0 20px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 18px;
}
.section-head h2, .columns-sec h2 {
  font-family: var(--serif); font-size: 28px; font-weight: 700;
}
.section-head h2::before {
  content: ""; display: inline-block; width: 10px; height: 10px;
  background: var(--accent); margin-right: 12px; transform: rotate(45deg) translateY(-2px);
}
.search-box { position: relative; }
.search-box input {
  width: 230px; height: 38px; padding: 0 34px 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-2); color: var(--ink);
  font: inherit; font-size: 13px; outline: none;
  transition: border-color .25s, width .3s;
}
.search-box input:focus { border-color: var(--accent); width: 270px; }
.search-icon {
  position: absolute; right: 14px; top: 50%; translate: 0 -54%;
  color: var(--ink-2); font-size: 16px; pointer-events: none;
}

/* 标签筛选 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  font-size: 12px; letter-spacing: .08em; padding: 5px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: all .25s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* 文章列表 */
.post-list { list-style: none; }
.post {
  display: grid; grid-template-columns: 88px 1fr auto;
  gap: 22px; align-items: center;
  padding: 24px 8px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .3s, padding-left .3s;
}
.post:hover { background: var(--accent-soft); padding-left: 20px; }
.post .date {
  font-family: var(--serif); text-align: center; line-height: 1.2;
  border-right: 1px solid var(--line); padding-right: 18px;
}
.post .date b { display: block; font-size: 26px; font-weight: 700; }
.post .date span { font-size: 11px; color: var(--ink-2); letter-spacing: .1em; }
.post h3 {
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  margin-bottom: 5px; transition: color .25s;
}
.post:hover h3 { color: var(--accent); }
.post .excerpt {
  font-size: 13px; color: var(--ink-2); line-height: 1.8;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post .meta { font-size: 11px; color: var(--ink-2); margin-top: 6px; letter-spacing: .06em; }
.post .meta i { font-style: normal; color: var(--accent); margin-right: 4px; }
.post .arrow { font-family: var(--serif); font-size: 20px; color: var(--line); transition: all .3s; }
.post:hover .arrow { color: var(--accent); transform: translateX(6px); }

.empty { text-align: center; color: var(--ink-2); padding: 48px 0; font-size: 14px; }
.more-btn {
  display: block; margin: 34px auto 0; padding: 11px 42px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; letter-spacing: .2em; cursor: pointer;
  transition: all .3s; border-radius: 999px;
}
.more-btn:hover { background: var(--ink); color: var(--paper); letter-spacing: .3em; }
.more-btn[hidden] { display: none; }

/* 专栏标签云 */
.columns-sec { padding: 44px 0 30px; border-top: 1px solid var(--line); }
.columns-sec h2 { margin-bottom: 24px; }
.columns-sec h2::before {
  content: ""; display: inline-block; width: 10px; height: 10px;
  background: var(--accent); margin-right: 12px; transform: rotate(45deg) translateY(-2px);
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: baseline; }
.tag-cloud button {
  background: none; border: none; cursor: pointer;
  font-family: var(--serif); color: var(--ink-2);
  transition: color .25s, transform .25s; padding: 2px 4px;
}
.tag-cloud button:hover { color: var(--accent); transform: translateY(-3px); }
.tag-cloud button i { font-style: normal; font-size: 11px; font-family: var(--sans); vertical-align: super; color: var(--accent); }

/* 订阅 */
.newsletter {
  margin: 40px 0 0; padding: 64px 24px 72px;
  border-top: 2px solid var(--ink); text-align: center;
}
.nl-kicker { font-size: 11px; letter-spacing: .5em; color: var(--accent); margin-bottom: 16px; }
.newsletter h2 {
  font-family: var(--serif); font-size: clamp(26px, 4vw, 40px);
  line-height: 1.4; margin-bottom: 14px;
}
.nl-sub { color: var(--ink-2); margin-bottom: 30px; }
.nl-form { display: flex; justify-content: center; gap: 10px; max-width: 460px; margin: 0 auto; }
.nl-form input {
  flex: 1; height: 46px; padding: 0 18px;
  border: 1px solid var(--line); background: var(--paper-2);
  font: inherit; color: var(--ink); outline: none; border-radius: 3px;
  transition: border-color .25s;
}
.nl-form input:focus { border-color: var(--accent); }
.nl-form button {
  padding: 0 30px; border: none; background: var(--accent); color: #fff;
  font: inherit; font-size: 14px; letter-spacing: .2em; cursor: pointer;
  border-radius: 3px; transition: opacity .25s, letter-spacing .3s;
}
.nl-form button:hover { opacity: .85; letter-spacing: .35em; }
.nl-msg { margin-top: 16px; color: var(--accent); font-size: 13px; letter-spacing: .1em; }

/* 页脚 */
.foot {
  border-top: 1px solid var(--line); padding: 26px 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-2); letter-spacing: .08em;
}
.foot-links { display: flex; gap: 20px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* ===== 阅读弹层 ===== */
.reader { position: fixed; inset: 0; z-index: 100; }
.reader-mask { position: absolute; inset: 0; background: rgb(0 0 0 / .45); backdrop-filter: blur(4px); }
.reader-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(680px, 92vw); background: var(--paper);
  box-shadow: -20px 0 60px rgb(0 0 0 / .25);
  overflow-y: auto; overscroll-behavior: contain;
  animation: slideIn .45s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } }
.reader-close {
  position: sticky; top: 14px; float: right; margin-right: 14px;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font-size: 22px; cursor: pointer; z-index: 2;
  transition: all .25s;
}
.reader-close:hover { background: var(--accent); color: #fff; border-color: var(--accent); rotate: 90deg; }
.reader-body { padding: 10px 56px 90px; }
.reader-body .r-meta { font-size: 12px; color: var(--accent); letter-spacing: .25em; margin-bottom: 14px; }
.reader-body h2 {
  font-family: var(--serif); font-size: 34px; line-height: 1.35;
  margin-bottom: 12px;
}
.reader-body .r-byline { font-size: 12px; color: var(--ink-2); margin-bottom: 34px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.reader-body p.para {
  font-family: var(--serif); font-size: 16px; line-height: 2.05;
  margin-bottom: 22px; color: var(--ink);
}
.reader-body .r-byline + p.para::first-letter {
  font-size: 52px; font-weight: 700; float: left;
  line-height: .9; padding: 6px 10px 0 0; color: var(--accent);
}
.reader-body blockquote {
  border-left: 3px solid var(--accent); padding: 6px 0 6px 20px;
  margin: 28px 0; font-family: var(--serif); font-style: italic;
  color: var(--ink-2); font-size: 17px;
}
.reader-progress { position: sticky; bottom: 0; height: 3px; background: var(--line); }
.reader-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* ===== 显现动画 ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .front { grid-template-columns: 1fr; }
  .headline { border-right: none; border-bottom: 1px solid var(--line); padding-right: 28px; }
  .front-side { flex-direction: row; flex-wrap: wrap; }
  .side-block { flex: 1; min-width: 240px; }
}
@media (max-width: 640px) {
  .topnav { gap: 16px; padding: 0 18px; }
  .nav-links { display: none; }
  .post { grid-template-columns: 62px 1fr; gap: 14px; }
  .post .arrow { display: none; }
  .post .date b { font-size: 20px; }
  .post .date { padding-right: 12px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .search-box input { width: 100%; }
  .search-box { width: 100%; }
  .nl-form { flex-direction: column; }
  .nl-form button { height: 46px; }
  .reader-body { padding: 10px 24px 80px; }
  .foot { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
