﻿/* ===========================================================
   zhujiaofan91.com — 个人站点样式
   设计：纸感底色 + 朱砂色强调 + 中文优先的无衬线排版
   无外部字体/图标依赖，国内访问不卡
   =========================================================== */

:root {
  --bg: #fbfaf7;
  --bg-soft: #f4f1eb;
  --ink: #1c1b19;
  --ink-soft: #4a4642;
  --muted: #7b756e;
  --line: rgba(28, 27, 25, 0.1);
  --line-strong: rgba(28, 27, 25, 0.18);
  --accent: #b4532c;
  --accent-soft: rgba(180, 83, 44, 0.1);
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(28, 27, 25, 0.04), 0 12px 32px -18px rgba(28, 27, 25, 0.28);
  --radius: 16px;
  --maxw: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --font-serif: Georgia, "Songti SC", "SimSun", "Noto Serif CJK SC", serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

html[data-theme="dark"] {
  --bg: #14140f;
  --bg-soft: #1c1b15;
  --ink: #ece8e1;
  --ink-soft: #c3bdb3;
  --muted: #928c82;
  --line: rgba(236, 232, 225, 0.12);
  --line-strong: rgba(236, 232, 225, 0.22);
  --accent: #e08a5f;
  --accent-soft: rgba(224, 138, 95, 0.12);
  --card: #1b1a14;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.6);
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1;
}

/* 头像版：品牌位改成圆形头像图片 */
img.brand-mark {
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

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

.nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

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

.nav a.is-active {
  color: var(--ink);
  font-weight: 600;
}

.nav a.is-active::after { content: ""; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ---------- hero ---------- */
.hero {
  padding: 92px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% 24% auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle at center, var(--accent-soft), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero .wrap { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.hero .lede {
  margin: 0;
  max-width: 34em;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.6;
  color: var(--ink-soft);
  font-weight: 500;
}

.hero .sub {
  margin: 22px 0 0;
  max-width: 40em;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

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

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.hero-meta div {
  background: var(--bg);
  padding: 20px 4px 20px 0;
}

.hero-meta dt {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-meta dd {
  margin: 6px 0 0;
  font-size: 15.5px;
  color: var(--ink-soft);
}

/* ---------- sections ---------- */
.section { padding: 76px 0; }

.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.section-head .more {
  font-size: 14.5px;
  color: var(--muted);
  white-space: nowrap;
}

.section-head .more:hover { color: var(--accent); }

.section-no {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-right: 12px;
}

/* ---------- cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 22px 44px -22px rgba(0, 0, 0, 0.35);
}

.card .tag,
.tag {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.card h3 {
  margin: 0;
  font-size: 19.5px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.8px;
  line-height: 1.8;
}

.card .card-foot {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card .card-foot .arrow { color: var(--accent); transition: transform 0.2s ease; }
.card:hover .card-foot .arrow { transform: translateX(4px); }

/* ---------- list (文章列表) ---------- */
.post-list { display: flex; flex-direction: column; }

.post-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.post-item:last-child { border-bottom: 1px solid var(--line); }

.post-item .date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.post-item h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
}

.post-item p { margin: 0; color: var(--muted); font-size: 14.5px; }

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

.post-item .arrow { color: var(--muted); transition: transform 0.2s ease, color 0.2s ease; }
.post-item:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* ---------- 文章正文 ---------- */
.article { padding: 56px 0 24px; }

.article-head { max-width: 720px; margin: 0 auto 44px; }

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

.article-head h1 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  line-height: 1.3;
  font-weight: 600;
}

.article-head .dek {
  margin: 0;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  font-size: 16.8px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.prose h2 {
  margin: 52px 0 18px;
  font-size: 23px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

.prose h3 {
  margin: 36px 0 12px;
  font-size: 18.5px;
  font-weight: 600;
  color: var(--ink);
}

.prose p { margin: 0 0 20px; }

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

.prose a:hover { border-bottom-color: var(--accent); }

.prose ul,
.prose ol { margin: 0 0 22px; padding-left: 1.3em; }

.prose li { margin-bottom: 8px; }

.prose blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: normal;
}

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

.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}

.prose pre code { background: none; padding: 0; }

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 44px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 26px;
  font-size: 14.5px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose th { color: var(--ink); font-weight: 600; }

.article-foot {
  max-width: 720px;
  margin: 56px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- about 资料卡 ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.info-card {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.info-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.info-card ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); font-size: 15px; }
.info-card li { margin-bottom: 8px; }
.info-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- contact / footer ---------- */
.contact {
  padding: 84px 0 96px;
  border-top: 1px solid var(--line);
}

.contact h2 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  font-weight: 600;
}

.contact p { margin: 0 0 28px; color: var(--muted); max-width: 34em; }

.mail-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 6px;
}

.mail-link:hover { color: var(--accent); border-color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 13.5px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer a:hover { color: var(--accent); }

/* ---------- 动效 ---------- */
/* 只用位移做渐显：内容始终可见，禁用 JS 时也不会白屏 */
.reveal {
  transform: translateY(14px);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 60px 0 44px; }
  .hero-meta { grid-template-columns: 1fr; gap: 0; }
  .hero-meta div { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .hero-meta div:last-child { border-bottom: none; }
  .section { padding: 54px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .post-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 22px 0;
  }
  .post-item .arrow { display: none; }
  .article-foot { flex-direction: column; }
  .site-header .wrap { height: 58px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 9px; font-size: 13.5px; }
  .brand span.name { display: none; }
}

@media (max-width: 400px) {
  .nav a { padding: 6px 7px; font-size: 13px; }
}
