@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..700&family=Karla:ital,wght@0,300..700;1,400&display=swap');

/* =========================================================
   rnadow.top · Stillpoint 风格
   暖纸底 · 衬线大标题 · 陶土色 · 拱形图片 · 编号小节
   ========================================================= */

:root {
  --paper: #F6F1E7;
  --bg: var(--paper);
  --bg-card: #FCF9F1;
  --bg-inset: #EFE8D8;
  --sand: #E4DAC5;
  --text: #2C2820;
  --text-muted: #5C564A;
  --accent: #B4623D;
  --accent-deep: #9C5130;
  --dusk: #D8A192;
  --sage: #7C8A6E;
  --border: #E4DAC5;
  --shadow: 0 14px 34px rgba(44, 40, 32, 0.09);
  --header-bg: rgba(246, 241, 231, 0.88);
  --serif: 'Fraunces', Georgia, 'Songti SC', 'STSong', 'Noto Serif SC', 'SimSun', serif;
  --sans: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

[data-theme="dark"] {
  --bg: #1B1712;
  --bg-card: #241E17;
  --bg-inset: #2D251D;
  --sand: #3B322A;
  --text: #EDE5D5;
  --text-muted: #AC9D88;
  --accent: #CE7350;
  --accent-deep: #B4623D;
  --dusk: #D8A192;
  --sage: #8C9B7D;
  --border: #3B322A;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  --header-bg: rgba(27, 23, 18, 0.88);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background 0.3s ease, color 0.3s ease;
}

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

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

.mono { font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace; }

::selection { background: var(--dusk); color: #2C2820; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 5px; }

/* ================= 通用元素 ================= */

/* 小号大写字距标签（Stillpoint eyebrow） */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow strong, .eyebrow em { color: var(--accent); font-style: normal; }

/* ================= 顶部导航 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.site-header nav { display: flex; align-items: center; gap: 20px; height: 68px; }

.logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.logo span { color: var(--accent); font-weight: 400; }

.nav-links { display: flex; list-style: none; gap: 8px; margin-left: auto; }
.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.theme-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* ================= Hero ================= */
.hero {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 56px;
  align-items: center;
  padding: 72px 24px 64px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-top: 18px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.tagline {
  margin-top: 20px;
  max-width: 480px;
  color: var(--text-muted);
  font-size: 1.04rem;
}

.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 30px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #FCF9F1;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.link-underline {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.link-underline:hover { color: var(--accent-deep); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 30px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.socials { display: flex; gap: 12px; margin-top: 24px; }
.socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}
.socials a:hover {
  color: #FCF9F1;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.socials svg { width: 18px; height: 18px; }

/* Hero 右侧：拱形图片 + 圆形徽章 + 图注 */
.hero-art { position: relative; max-width: 420px; justify-self: end; width: 100%; }

.arch {
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 14px 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  box-shadow: var(--shadow);
}
.arch img { width: 100%; height: 100%; object-fit: cover; display: block; }

.badge-circle {
  position: absolute;
  left: -28px;
  bottom: 84px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
  transform: rotate(-8deg);
}

.art-caption {
  margin: 16px 4px 0;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: center;
}

/* ================= 区块 ================= */
.section { padding: 56px 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 26px;
}

.section h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 8px;
}

/* 搜索框 */
.search-box { position: relative; }
.search-box svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-box input {
  width: 240px;
  padding: 10px 16px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, width 0.25s;
}
.search-box input:focus {
  width: 280px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 98, 61, 0.15);
}
.search-box input::placeholder { color: var(--text-muted); }

/* 标签云 */
.tags-eyebrow { margin-bottom: 12px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }

.tag {
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag.active { background: var(--accent); border-color: var(--accent); color: #FCF9F1; }

/* ================= 文章卡片 ================= */
.post-list { display: flex; flex-direction: column; gap: 18px; }

.post-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.post-num {
  position: absolute;
  top: 14px;
  right: 20px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--sand);
  line-height: 1;
  pointer-events: none;
}

.post-link { display: block; padding: 24px 28px; }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tags-mini { display: inline-flex; gap: 6px; }
.mini-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-inset);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.post-title {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.post-link:hover .post-title { color: var(--accent); }

.post-excerpt { color: var(--text-muted); font-size: 0.96rem; }

.read-time {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.85;
}

.hidden { display: none !important; }

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 44px 0;
  font-family: var(--serif);
  font-style: italic;
}

/* ================= 关于 ================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  align-items: start;
  margin-top: 4px;
}

.about-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  padding: 28px;
}

.about-text p + p { margin-top: 12px; }

.about-side h3 {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.skills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.skill {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--bg-inset);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.site-info { list-style: none; }
.site-info li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}
.site-info li:last-child { border-bottom: none; }
.site-info li span:first-child { color: var(--text-muted); }
.site-info a { color: var(--accent); }
.site-info a:hover { text-decoration: underline; }

/* ================= 文章内页 ================= */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--dusk));
  z-index: 100;
  pointer-events: none;
}

.article { max-width: 800px; padding: 48px 0 56px; }

.article-header { margin-bottom: 36px; }
.article-header .post-meta { margin-bottom: 14px; }
.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.article-lead {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 1.05rem;
  border-left: 3px solid var(--dusk);
  padding-left: 16px;
}

.article-body { font-size: 1rem; counter-reset: art-h2; }

.article-body h2 {
  counter-increment: art-h2;
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 42px 0 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.article-body h2::before {
  content: counter(art-h2, decimal-leading-zero);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.article-body h3 {
  font-family: var(--serif);
  font-size: 1.14rem;
  font-weight: 600;
  margin: 26px 0 10px;
}
.article-body p { margin: 13px 0; line-height: 1.95; }
.article-body ul, .article-body ol { margin: 13px 0; padding-left: 26px; }
.article-body li { margin: 6px 0; line-height: 1.85; }
.article-body a { color: var(--accent); }
.article-body a:hover { text-decoration: underline; }
.article-body strong { font-weight: 700; }

.article-body blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-inset);
  border-radius: 0 10px 10px 0;
  color: var(--text-muted);
  font-family: var(--serif);
  font-style: italic;
}
.article-body blockquote p { margin: 4px 0; }

.article-body code {
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-size: 0.86em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
}
.article-body pre {
  margin: 18px 0;
  padding: 16px 20px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.65;
}
.article-body pre code { background: none; border: none; padding: 0; font-size: 0.85rem; }

.article-body hr { margin: 32px 0; border: none; border-top: 1px dashed var(--border); }

.article-footer { margin-top: 52px; }

.article-tip {
  padding: 16px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.article-tip a { color: var(--accent); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.post-nav-item {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.post-nav-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.post-nav-item .nav-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.post-nav-item .nav-title {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
}
.post-nav-item.next { text-align: right; }
.post-nav-item.empty-nav { visibility: hidden; }

.back-home {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.back-home:hover { color: var(--accent-deep); }

/* ================= 页脚 ================= */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 44px 0 52px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.foot-logo {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 8px;
}
.foot-logo span { color: var(--accent); font-weight: 400; }
.site-footer p + p { margin-top: 6px; font-size: 0.84rem; opacity: 0.9; }
.site-footer a { color: var(--accent); }
.site-footer a:hover { text-decoration: underline; }

/* ================= 响应式 ================= */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 44px; }
  .hero-art { justify-self: center; max-width: 400px; }
  .badge-circle { left: -12px; }
}

@media (max-width: 680px) {
  .site-header nav { gap: 8px; height: 60px; }
  .logo { font-size: 1.15rem; }
  .nav-links a { padding: 8px 8px; font-size: 0.74rem; }

  .hero { padding: 48px 20px 48px; }
  .hero-actions { gap: 18px; }
  .hero-art { max-width: 320px; }
  .badge-circle { width: 88px; height: 88px; font-size: 1rem; left: -8px; bottom: 64px; }

  .section { padding: 44px 0; }
  .section-head { flex-direction: column; align-items: stretch; }
  .search-box { flex: 1; }
  .search-box input,
  .search-box input:focus { width: 100%; }

  .post-link { padding: 20px; }
  .post-num { font-size: 1.5rem; top: 16px; right: 16px; }

  .article { padding: 36px 0 44px; }
  .about-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.next { text-align: left; }
  .post-nav-item.empty-nav { display: none; }
}
