/* ── 白卷 ──────────────────────────────────────────────────────────────
   版式依据：参考图 Minimal Chinese Portfolio Homepage（1024×1536）。
   极简黑白灰：纸底 + 墨字 + 细线；无阴影、无渐变、无彩色点缀、无卡片底色。
   层级只靠字号、字重、留白与细线。字号与间距全部取自下方 token。
   ──────────────────────────────────────────────────────────────────── */

/* ── 色彩 / 字体 / 字号 / 布局 token 已抽到 tokens.css ──
   本文件只消费 var(--…)，不定义颜色。 */

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--w-normal);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(43, 38, 32, 0.1); }

/* ── 容器 ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-narrow { max-width: calc(var(--reading) + var(--gutter) * 2); }

/* ── Header：品牌左 / 导航中 / 状态右 ──────────────────── */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); }

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding-top: var(--header-py);
  padding-bottom: var(--header-py);
}

/* 顶部这条线必须和区块标题下的线同宽（参考图里两者都是内容宽度，不是通栏） */
.header-inner::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-serif);
  font-size: var(--fs-logo);
  font-weight: var(--w-bold);
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
}

.brand-avatar {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-links { display: flex; align-items: center; gap: var(--sp-5); }

.nav-links a {
  padding-bottom: 2px;
  color: var(--text-soft);
  font-size: var(--fs-nav);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--ink); }

.nav-links a.active {
  padding-bottom: 1px;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.nav-links a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.status {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-left: auto;      /* 品牌与导航整体靠左，状态贴右端（参考图版式） */
  font-size: var(--fs-small);
  color: var(--text-soft);
  line-height: 1.6;
}

.status-now { display: flex; flex-direction: column; white-space: nowrap; }
.status-now span:first-child { color: var(--ink); }

.status-list { list-style: none; display: grid; gap: 2px; }
.status-list li { display: flex; gap: 6px; white-space: nowrap; }
.status-list li::before { content: "·"; color: var(--text-soft); }

/* ── Hero：12 栏，左文右图 ─────────────────────────────── */
/* Hero 下方留白比上方小一档：这块内容结束后最容易显空 */
.hero { padding: var(--sp-5) 0 var(--sp-3); }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: var(--sp-5);
}

.hero-text { grid-column: span 6; }

.hero-rule {
  display: block;
  width: 32px;
  height: 2px;
  margin-bottom: var(--sp-4);
  background: var(--ink);
}

.hero h1 {
  font-size: var(--fs-hero);
  font-weight: var(--w-bold);
  line-height: var(--lh-hero);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-subtitle {
  margin-top: var(--sp-3);
  font-size: var(--fs-subtitle);
  font-weight: var(--w-medium);
  line-height: var(--lh-title);
  color: var(--ink);
}

.hero-lead {
  margin-top: var(--sp-4);
  font-size: var(--fs-body);
  color: var(--text-soft);
}

.hero-cta {
  display: flex;
  gap: var(--sp-5);
  margin-top: var(--sp-5);
  font-size: var(--fs-nav);
  font-weight: var(--w-medium);
}

.hero-cta a { color: var(--ink); text-decoration: none; }
.hero-cta a:hover { text-decoration: underline; }

.hero-media { grid-column: span 6; }

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* 其余页面沿用的按钮（作品集 / 产品页） */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid var(--line);
  font-size: var(--fs-small);
  font-weight: var(--w-medium);
  color: var(--ink);
  text-decoration: none;
}

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

/* ── Section ──────────────────────────────────────────── */
/* 模块之间的分割线：落在内容宽度上（不是通栏），与其余细线同色同宽 */
.section { padding: var(--section-py) 0; }

/* 「关于我 / 联系我」不再单独画线：它上方那条由最后一篇文章的下线充当
   （参考图 y=1280 那条线同时是文章列表底线与关于区块的分隔） */
.section:not(#about) > .container { position: relative; }

.section:not(#about) > .container::before {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 0;
  height: 1px;
  background: var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.section-title { display: flex; align-items: baseline; gap: 0; }

.section-title-en {
  font-family: var(--font-serif);
  font-size: var(--fs-section-en);
  font-weight: var(--w-bold);
  letter-spacing: 0.01em;
  color: var(--ink);
}

.section-title-cn::before {
  content: "/";
  margin: 0 8px;
  color: var(--text-soft);
}

.section-title-cn {
  font-size: var(--fs-section-cn);
  font-weight: var(--w-normal);
  color: var(--text-soft);
}

.section-more {
  font-size: var(--fs-small);
  color: var(--text-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

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

/* ── NOW / 正在做：三栏，无卡片底色 ───────────────────── */
.now-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

/* 三栏之间的竖线，与横线同色（第一栏左侧不留线） */
.now-item {
  padding: 0 var(--sp-5);
}

.now-item:first-child { padding-left: 0; }
.now-item:last-child { padding-right: 0; }

.now-item + .now-item {
  border-left: 1px solid var(--line);
}

.now-icon {
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: var(--sp-3);
  color: var(--ink);
}

.now-icon svg { display: block; width: 100%; height: 100%; }

.now-item h3 {
  margin-bottom: var(--sp-1);
  font-size: var(--fs-item-title);
  font-weight: var(--w-bold);
  line-height: var(--lh-title);
  color: var(--ink);
}

.now-item p {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-small);
  line-height: var(--lh-tight);
  color: var(--text-soft);
}

.now-item p.now-tags {
  margin-bottom: 0;
  font-size: var(--fs-micro);
  color: var(--text-soft);
}

/* ── SELECTED WORK：三栏图文 ───────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}

.card-image { margin-bottom: var(--sp-3); }

.card-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-tag {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-micro);
  color: var(--text-soft);
}

.card h3 {
  margin-bottom: var(--sp-1);
  font-size: var(--fs-card-title);
  font-weight: var(--w-bold);
  line-height: var(--lh-title);
  color: var(--ink);
}

.card p {
  margin-bottom: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-tight);
  color: var(--text-soft);
}

.card-link {
  font-size: var(--fs-micro);
  color: var(--text-soft);
  text-decoration: none;
}

.card-link:hover { color: var(--ink); }

/* ── WRITING：日期左 / 标题摘要 / 箭头右 ───────────────── */
/* 列表自带顶线：位置在「WRITING / 最新文章」标题下方（参考图 y=1135 那条） */
.post-list { border-top: 1px solid var(--line); }

.post-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 0.15s;
}

.post-row:hover { background: var(--line-soft); }

.post-row-date {
  flex: 0 0 112px;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text-soft);
}

.post-row-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.post-row-title {
  font-size: var(--fs-card-title);
  font-weight: var(--w-bold);
  line-height: var(--lh-title);
  color: var(--ink);
}

.post-row-desc {
  font-size: var(--fs-small);
  line-height: var(--lh-tight);
  color: var(--text-soft);
}

.post-row-arrow { color: var(--text-soft); }

/* ── ABOUT / CONTACT：7 : 5，带左竖线 ─────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line);
}

.about-col { grid-column: span 7; }

.contact-col {
  grid-column: span 5;
  padding-left: var(--sp-5);
  border-left: 1px solid var(--line);
}

.about-grid h3 {
  margin-bottom: var(--sp-3);
  font-size: var(--fs-card-title);
  font-weight: var(--w-bold);
  color: var(--ink);
}

.about-text p {
  font-size: var(--fs-nav);
  line-height: var(--lh-tight);
  color: var(--text-soft);
}

.about-text p + p { margin-top: var(--sp-1); }

.about-more {
  display: inline-block;
  margin-top: var(--sp-4);
  font-size: var(--fs-small);
  font-weight: var(--w-bold);
  color: var(--ink);
  text-decoration: none;
}

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

.contact-lead {
  margin-bottom: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--text-soft);
}

.contact-list { list-style: none; display: grid; gap: var(--sp-1); }

.contact-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-small);
  color: var(--text-soft);
}

.contact-list svg { flex: none; width: 16px; height: 16px; color: var(--text-soft); }

.contact-list a { color: inherit; text-decoration: none; }
.contact-list a:hover { color: var(--ink); }

/* ── 内页（文章列表 / 作品集 / 产品 / 文章页）──────────── */
.page-head { padding-bottom: var(--sp-4); }

.page-head h1 {
  font-family: var(--font-serif);
  font-size: var(--fs-section-en);
  font-weight: var(--w-bold);
  color: var(--ink);
}

.page-head p {
  max-width: var(--reading);
  margin-top: var(--sp-2);
  font-size: var(--fs-nav);
  color: var(--text-soft);
}

.post { padding: var(--sp-6) 0; }

.post-header h1 {
  font-size: var(--fs-subtitle);
  font-weight: var(--w-bold);
  line-height: var(--lh-title);
  color: var(--ink);
}

.post-date {
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text-soft);
}

.post-content { margin-top: var(--sp-5); }
.post-content h2 {
  margin: var(--sp-5) 0 var(--sp-2);
  font-size: var(--fs-item-title);
  font-weight: var(--w-bold);
  color: var(--ink);
}

.post-content h3 {
  margin: var(--sp-4) 0 var(--sp-2);
  font-size: var(--fs-card-title);
  font-weight: var(--w-bold);
}

.post-content p { margin: var(--sp-3) 0; }
.post-content ul,
.post-content ol { margin: var(--sp-3) 0; padding-left: var(--sp-4); }
.post-content li { margin: var(--sp-1) 0; }
.post-content a { color: var(--ink); }

.post-content img { max-width: 100%; margin: var(--sp-4) 0; }

.post-content blockquote {
  margin: var(--sp-4) 0;
  padding-left: var(--sp-4);
  border-left: 1px solid var(--line);
  color: var(--text-soft);
}

.post-content code {
  padding: 2px 5px;
  background: rgba(43, 38, 32, 0.05);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.post-content pre {
  margin: var(--sp-4) 0;
  padding: var(--sp-4);
  overflow-x: auto;
  background: rgba(43, 38, 32, 0.05);
}

.post-content pre code { background: none; padding: 0; }

.post-content hr {
  margin: var(--sp-5) 0;
  border: none;
  border-top: 1px solid var(--line);
}

/* ── Footer：slogan 左 / 标语右 ───────────────────────── */
.site-footer { padding: var(--sp-5) 0; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-micro);
  color: var(--text-soft);
}

/* ── Mobile ≤768px ────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --gutter: 16px;        /* px-4 */
    --fs-hero: 48px;       /* text-5xl */
    --fs-subtitle: 20px;   /* text-xl */
    --section-py: 20px;    /* 手机：相邻 section 之间 40px */
  }

  .status { display: none; }
  .header-inner { gap: var(--sp-3); }
  .nav-links { gap: var(--sp-3); }
  .nav-links a { font-size: var(--fs-micro); }

  .hero { padding: var(--sp-4) 0; }
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero-text,
  .hero-media { grid-column: auto; }

  .now-grid,
  .card-grid { grid-template-columns: 1fr; gap: var(--sp-5); }

  /* 单列时取消三栏的左右内边距与竖线 */
  .now-item,
  .now-item:first-child,
  .now-item:last-child { padding-left: 0; padding-right: 0; }
  .now-item + .now-item { border-left: none; }

  /* 文章行改为纵向：日期与内容上下排列 */
  .post-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-1);
  }
  .post-row-date { flex: none; }
  .post-row-arrow { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .about-col,
  .contact-col { grid-column: auto; }
  .contact-col { padding-left: 0; border-left: none; }

  .site-footer { padding: var(--sp-4) 0; }
  .footer-inner { font-size: var(--fs-micro); }
}

/* ── 降低动效偏好 ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ── 打印 ──────────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .hero-cta,
  .hero-media,
  .btn { display: none; }

  body { font-size: 12pt; background: var(--print-bg); }
}
