/* ==========================================================================
   半山手记 · 设计系统 v3
   结构：粘性导航 / 深色首屏 / 卡片栅格 / 长文阅读版式
   ========================================================================== */

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

:root {
  --bg:          #faf9f7;
  --surface:     #ffffff;
  --ink:         #14171f;
  --ink-2:       #4b5261;
  --ink-3:       #8a909d;
  --ink-4:       #b6bac2;
  --line:        #e8e6e2;
  --line-soft:   #f0eeea;
  --accent:      #14524a;
  --accent-2:    #1c6a5f;
  --accent-soft: #eef4f2;
  --dark:        #0c1a18;
  --dark-2:      #17332e;
  --radius:      16px;
  --radius-lg:   22px;
  --radius-sm:   10px;
  --shadow:      0 1px 2px rgba(20,23,31,.04), 0 10px 26px -14px rgba(20,23,31,.14);
  --shadow-lg:   0 2px 6px rgba(20,23,31,.05), 0 22px 44px -20px rgba(20,23,31,.24);
  --serif:       Georgia, "Times New Roman", "Songti SC", serif;
  --sans:        -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.shell { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 249, 247, .84);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .bar {
  max-width: 980px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: baseline; gap: 9px;
  font-size: 17.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink);
}
.logo em {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 12.5px; letter-spacing: 0; color: var(--ink-4);
}
.nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px; }
.nav a {
  font-size: 13.5px; padding: 6px 12px; border-radius: 8px;
  color: var(--ink-2); transition: background .18s, color .18s, box-shadow .18s;
}
.nav a:hover { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(20,23,31,.07); }
.nav a.active { background: var(--accent); color: #fff; }

/* -------------------------------------------------------------------- 首屏 */
.hero {
  position: relative; overflow: hidden;
  margin-top: 30px; padding: 58px 44px 50px;
  border-radius: var(--radius-lg);
  color: #e6efec;
  background:
    radial-gradient(900px 340px at 84% -20%, rgba(64, 168, 146, .30), transparent 62%),
    radial-gradient(600px 300px at 6% 110%, rgba(56, 120, 168, .18), transparent 60%),
    linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 76%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 76%);
}
.hero > * { position: relative; z-index: 1; }
.hero .kicker {
  font-size: 12px; letter-spacing: .26em; text-transform: uppercase;
  color: #7fb4a7; font-weight: 600;
}
.hero h1 {
  margin: 16px 0 0;
  font-size: clamp(29px, 4.6vw, 44px);
  line-height: 1.28; font-weight: 700; letter-spacing: .01em; color: #fff;
}
.hero .sub {
  margin-top: 18px; max-width: 620px;
  font-size: 16px; line-height: 2; color: #b7cdc7;
}
.hero .chips { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .chips span {
  font-size: 12.5px; padding: 6px 14px; border-radius: 99px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #cfe1dc; letter-spacing: .03em;
}

/* -------------------------------------------------------------- 区块标题栏 */
.sec-head { display: flex; align-items: baseline; gap: 12px; margin: 54px 0 20px; }
.sec-head h2 { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.sec-head .en { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-4); }
.sec-head .more { margin-left: auto; font-size: 13px; color: var(--ink-3); transition: color .18s; }
.sec-head .more:hover { color: var(--accent); }

/* ---------------------------------------------------------------- 卡片栅格 */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 24px 20px;
  box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s, border-color .22s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d9d6d0; }
.card .cat {
  font-size: 11.5px; font-weight: 700; letter-spacing: .17em;
  text-transform: uppercase; color: var(--accent-2);
}
.card h3 { margin: 11px 0 9px; font-size: 17px; line-height: 1.62; font-weight: 650; color: var(--ink); }
.card .desc { flex: 1; font-size: 13.8px; line-height: 1.88; color: var(--ink-3); }
.card .foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-3);
}
.card .foot .date { font-family: var(--serif); font-variant-numeric: tabular-nums; }
.card .foot .go { margin-left: auto; color: var(--accent-2); font-weight: 600; letter-spacing: .02em; }

/* 精选大卡 */
.card.feature { grid-column: 1 / -1; flex-direction: row; padding: 0; overflow: hidden; }
.card.feature .body { flex: 1 1 62%; padding: 34px 34px 30px; display: flex; flex-direction: column; }
.card.feature .body h3 { font-size: 23px; line-height: 1.5; margin: 12px 0 10px; }
.card.feature .body .desc { font-size: 14.5px; }
.card.feature .aside {
  flex: 1 1 38%; min-width: 240px;
  background: linear-gradient(155deg, #eef4f2 0%, #e2eeea 100%);
  border-left: 1px solid var(--line);
  padding: 30px; display: flex; flex-direction: column; justify-content: center; gap: 12px;
}
.card.feature .aside .q {
  font-family: var(--serif); font-size: 15px; line-height: 1.95;
  color: #2c4b45; font-style: italic;
}
.card.feature .aside .who { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }

/* 列表式卡片（好文推荐） */
.stack { display: flex; flex-direction: column; gap: 14px; }
.item {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
}
.item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d9d6d0; }
.item .idx {
  font-family: var(--serif); font-size: 13px; color: var(--ink-4);
  padding-top: 3px; min-width: 20px;
}
.item .txt h4 { font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.65; }
.item .txt p { margin-top: 5px; font-size: 13.5px; color: var(--ink-3); line-height: 1.85; }
.item .txt .src { display: block; margin-top: 7px; font-size: 12.5px; color: var(--ink-4); }
.item .ext { margin-left: auto; font-size: 13px; color: var(--ink-4); padding-top: 2px; }

/* 工具卡 */
.tool {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px;
  box-shadow: var(--shadow); transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s, border-color .22s;
}
.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.tool .badge {
  flex: none; width: 46px; height: 46px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 19px; font-weight: 700;
}
.tool b { display: block; font-size: 16.5px; font-weight: 650; color: var(--ink); }
.tool span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--ink-3); }
.tool .arrow { margin-left: auto; color: var(--ink-4); font-size: 18px; transition: transform .2s, color .2s; }
.tool:hover .arrow { transform: translateX(3px); color: var(--accent); }

/* ------------------------------------------------------------ 长文阅读版式 */
.article { max-width: 700px; margin: 0 auto; padding-top: 46px; }
.article .eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-2);
}
.article h1 {
  margin: 14px 0 14px; font-size: clamp(23px, 3.4vw, 31px);
  line-height: 1.5; font-weight: 700; color: var(--ink); letter-spacing: .005em;
}
.article .meta {
  font-size: 13px; color: var(--ink-4); font-family: var(--serif);
  padding-bottom: 22px; margin-bottom: 30px; border-bottom: 1px solid var(--line);
  letter-spacing: .03em;
}
.article h2 { margin: 36px 0 12px; font-size: 18px; font-weight: 650; color: var(--ink); letter-spacing: .02em; }
.article h3 { margin: 26px 0 9px; font-size: 15.5px; font-weight: 650; color: var(--ink); }
.article p { margin-bottom: 17px; }
.article ul, .article ol { margin: 0 0 17px 22px; }
.article li { margin-bottom: 7px; }
.article strong { color: var(--ink); font-weight: 650; }
.article hr { border: none; border-top: 1px solid var(--line); margin: 34px 0; }
.article blockquote {
  margin: 0 0 17px; padding: 14px 20px;
  background: var(--accent-soft); border-radius: var(--radius-sm);
  color: #2b4a44; font-size: 15px;
}
.article code {
  font-family: Consolas, Monaco, "Courier New", monospace; font-size: 13.5px;
  background: #f3f2ef; color: #1d534a; padding: 2px 6px; border-radius: 4px;
}
.article .tail {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-3);
}
.article .tail a:hover { color: var(--accent); }

/* 页面级标题（归档页） */
.page-head { padding: 48px 0 0; }
.page-head .eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-2);
}
.page-head h1 { margin: 12px 0 10px; font-size: clamp(24px, 3.6vw, 32px); font-weight: 700; color: var(--ink); }
.page-head p { color: var(--ink-3); font-size: 14.5px; max-width: 620px; }
.page-head .rule { margin-top: 26px; border-top: 1px solid var(--line); }

/* -------------------------------------------------------------------- 页脚 */
.foot {
  margin-top: 76px; border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, #f4f3f0);
}
.foot .inner {
  max-width: 980px; margin: 0 auto; padding: 30px 24px 44px;
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center;
  font-size: 12.5px; color: var(--ink-4); letter-spacing: .02em;
}
.foot .copy { font-family: var(--serif); }
.foot .links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.foot a:hover { color: var(--accent-2); }
.foot .icon { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; opacity: .7; }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 760px) {
  .hero { padding: 40px 26px 36px; border-radius: var(--radius); }
  .card.feature { flex-direction: column; }
  .card.feature .aside { border-left: none; border-top: 1px solid var(--line); min-width: 0; }
  .card.feature .body { padding: 26px 24px 22px; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .shell { padding: 0 18px; }
  .topbar .bar { padding: 11px 18px; gap: 10px; }
  .nav { margin-left: 0; width: 100%; }
  .nav a { padding: 5px 10px; font-size: 13px; }
  .hero { margin-top: 18px; }
  .sec-head { margin: 40px 0 16px; }
  .item { padding: 17px 18px; gap: 12px; }
  .tool { padding: 20px; gap: 14px; }
  .foot .links { margin-left: 0; }
}
