/* ============================================================
   李新海·民间百科  —  全局设计系统
   设计概念：个人词条档案馆（宣纸 × 黛青 × 朱砂印）
   字体：全站思源黑体（标题与正文同一套）
   ============================================================ */

:root {
  /* 色板 */
  --paper: #F6F1E7;          /* 宣纸米白 */
  --paper-2: #EFE7D8;        /* 深一档宣纸 */
  --card: #FFFDF8;           /* 卡片纸白 */
  --ink: #2B2B26;            /* 墨色正文 */
  --ink-2: #4A4A42;
  --muted: #8A877C;
  --primary: #1F3D4C;        /* 黛青主色 */
  --primary-deep: #152E3A;
  --primary-soft: #E4EBED;
  --seal: #C03A2B;           /* 朱砂印章红 */
  --seal-deep: #9C2F22;
  --seal-soft: #F8E7E2;
  --gold: #B08D3F;           /* 点缀金 */
  --border: #E2D9C6;
  --border-soft: #ECE5D4;

  /* 字体 */
  --font-sans: system-ui, "Noto Sans SC", "Source Han Sans SC", sans-serif;

  /* 布局 */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 14px rgba(31, 61, 76, 0.09);
  --shadow-lg: 0 10px 34px rgba(31, 61, 76, 0.14);
  --container: 1180px;
  --header-h: 62px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.85;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--seal); }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 700; line-height: 1.45; color: var(--ink); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }

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

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-sans); }

.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--primary); color: #F6F1E7;
  display: grid; place-items: center;
  font-family: var(--font-sans); font-size: 18px; font-weight: 700;
  border-bottom: 2px solid var(--seal);
}

.brand-name { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 2px; display: block; margin-top: -2px; }

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

.nav-item { position: relative; }

.nav-link {
  display: block; padding: 8px 13px;
  font-size: 15px; color: var(--ink-2);
  border-radius: var(--radius-sm);
  transition: all .2s;
}

.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-soft); }

.nav-link .arrow { font-size: 10px; margin-left: 4px; opacity: .6; }

/* 二级下拉菜单 */
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 168px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0; visibility: hidden;
  transition: all .22s ease;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.dropdown a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink-2);
}
.dropdown a:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown a .num { font-size: 11px; color: var(--muted); font-family: var(--font-sans); }

.dropdown::before {
  content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 10px;
}

/* 导航操作区（搜索 + 汉堡） */
.nav-actions { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--paper-2); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 5px 12px;
}
.search-box input {
  border: none; outline: none; background: transparent;
  font-family: var(--font-sans); font-size: 13px; color: var(--ink);
  width: 130px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box .icon { color: var(--muted); font-size: 13px; }

.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 17px; cursor: pointer; color: var(--ink); }

/* 移动端菜单 */
.mobile-menu {
  display: none; flex-direction: column;
  background: var(--card); border-top: 1px solid var(--border-soft);
  padding: 10px 22px 18px;
}
.mobile-menu.show { display: flex; }
.mobile-menu .m-item > a {
  display: block; padding: 10px 4px; font-size: 15px; color: var(--ink-2);
  border-bottom: 1px dashed var(--border-soft);
}
.mobile-menu .m-item > a.active { color: var(--primary); font-weight: 700; }
.mobile-menu .m-sub { padding: 2px 0 10px 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-menu .m-sub a { font-size: 13px; color: var(--muted); padding: 4px 10px; background: var(--paper); border-radius: 999px; }
.mobile-menu .m-sub a:hover { color: var(--seal); }

/* ---------- 词条头（首页 Hero） ---------- */
.entry-header {
  background:
    linear-gradient(120deg, rgba(31,61,76,.96), rgba(31,61,76,.86)),
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255,255,255,.03) 18px 36px);
  color: #F6F1E7;
  padding: 52px 0 44px;
  border-bottom: 3px solid var(--seal);
}

.entry-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.entry-title { font-size: clamp(40px, 6vw, 62px); font-weight: 700; color: #F6F1E7; letter-spacing: 8px; line-height: 1.2; }
.entry-pinyin { font-size: 14px; letter-spacing: 3px; color: rgba(246,241,231,.72); margin-top: 6px; font-family: var(--font-sans); }
.entry-tagline { margin-top: 14px; font-size: 16px; color: rgba(246,241,231,.9); max-width: 640px; }

.entry-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; font-size: 13px; color: rgba(246,241,231,.78); }
.entry-meta b { color: var(--gold); font-family: var(--font-sans); font-size: 15px; margin-right: 4px; }

.entry-seal {
  flex-shrink: 0;
  width: 84px; height: 84px; border-radius: 50%;
  border: 2px solid var(--seal);
  color: var(--seal);
  display: grid; place-items: center;
  font-family: var(--font-sans);
  font-size: 20px; font-weight: 700; letter-spacing: 2px;
  transform: rotate(-6deg);
  box-shadow: 0 0 0 5px rgba(192,58,43,.18);
  text-align: center; line-height: 1.3;
}

/* ---------- 通用页头（内页） ---------- */
.page-head {
  background: linear-gradient(120deg, var(--primary-deep), var(--primary));
  color: #F6F1E7; padding: 38px 0 34px;
  border-bottom: 3px solid var(--seal);
}
.page-head h1 { color: #F6F1E7; font-size: clamp(28px, 4vw, 38px); letter-spacing: 3px; }
.page-head .sub { color: rgba(246,241,231,.85); margin-top: 8px; font-size: 15px; max-width: 760px; }
.page-head .years { color: var(--gold); font-family: var(--font-sans); font-size: 15px; margin-top: 10px; display: inline-block; background: rgba(255,255,255,.08); padding: 3px 14px; border-radius: 999px; }

.breadcrumb { padding: 16px 0 0; font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--seal); }
.breadcrumb .sep { margin: 0 8px; color: var(--border); }
.breadcrumb .cur { color: var(--primary); font-weight: 600; }

/* ---------- 二级页签导航 ---------- */
.sub-tabs {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 22px 0 4px;
}
.sub-tabs a {
  padding: 8px 20px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--ink-2); font-size: 14px;
  transition: all .2s;
}
.sub-tabs a:hover { border-color: var(--primary); color: var(--primary); }
.sub-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 主布局：百科信息栏 + 正文 ---------- */
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 34px; padding: 34px 0 60px; align-items: start; }

.sidebar { position: sticky; top: calc(var(--header-h) + 20px); }

.info-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}

.portrait-wrap { position: relative; }
/* height:auto 覆盖 img 的 height 属性：不支持 aspect-ratio 的旧内核按原图比例显示，避免头像被裁成大脸 */
.portrait-wrap img { width: 100%; height: auto; aspect-ratio: 4/4.4; object-fit: cover; }
.portrait-badge {
  position: absolute; bottom: 14px; left: 14px;
  background: var(--seal); color: #fff;
  font-family: var(--font-sans); font-size: 13px; letter-spacing: 1px;
  padding: 5px 14px; border-radius: 999px;
}

.info-table { padding: 16px 20px 6px; }
.info-table .row {
  display: flex; padding: 9px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 14px;
}
.info-table .row:last-child { border-bottom: none; }
.info-table .k { flex: 0 0 76px; color: var(--muted); }
.info-table .v { flex: 1; color: var(--ink-2); }

.side-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--border-soft); margin-top: 14px; }
.side-stats .stat { background: var(--card); padding: 12px 6px; text-align: center; }
.side-stats .n { font-family: var(--font-sans); font-size: 20px; font-weight: 700; color: var(--primary); }
.side-stats .l { font-size: 12px; color: var(--muted); margin-top: 2px; }

.side-note { margin-top: 14px; background: var(--seal-soft); border: 1px solid #EFD3C9; border-radius: var(--radius); padding: 12px 16px; font-size: 13px; color: var(--seal-deep); }
.side-note .t { font-weight: 700; font-family: var(--font-sans); display: block; margin-bottom: 2px; }

/* ---------- 正文区块 ---------- */
.entry-body { min-width: 0; }

.section { margin-bottom: 44px; }

.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 24px; letter-spacing: 2px;
  margin-bottom: 6px;
}
.section-title::before {
  content: ""; width: 5px; height: 24px; background: var(--seal); border-radius: 3px;
}
.section-title .en { font-family: var(--font-sans); font-size: 13px; color: var(--muted); letter-spacing: 3px; font-weight: 400; }

.section-lead { color: var(--ink-2); font-size: 15px; margin-bottom: 20px; }

/* 目录（词条特色） */
.toc {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow);
}
.toc-title { font-family: var(--font-sans); font-weight: 700; font-size: 16px; color: var(--primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.toc-title::before { content: "目 录"; }
.toc ol { counter-reset: toc; }
.toc li { counter-increment: toc; padding: 7px 0; border-bottom: 1px dashed var(--border-soft); font-size: 15px; }
.toc li:last-child { border-bottom: none; }
.toc li::before {
  content: counter(toc) ".";
  font-family: var(--font-sans); color: var(--seal);
  margin-right: 10px; font-weight: 700;
}
.toc li a { color: var(--ink-2); }
.toc li a:hover { color: var(--seal); }

/* 概述段落 */
.summary p { text-indent: 2em; margin-bottom: 14px; color: var(--ink-2); }
.summary .hl { color: var(--seal); font-weight: 600; }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--primary), var(--border));
}

.tl-item { position: relative; padding: 0 0 26px 8px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -27px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--seal);
}
.tl-year { font-family: var(--font-sans); font-weight: 700; color: var(--primary); font-size: 16px; display: inline-block; margin-bottom: 3px; }
.tl-item .badge {
  display: inline-block; font-size: 12px; color: var(--seal);
  background: var(--seal-soft); border-radius: 999px; padding: 1px 10px;
  margin-left: 8px; vertical-align: 2px; font-family: var(--font-sans);
}
.tl-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.tl-desc { font-size: 14px; color: var(--muted); margin-top: 3px; }

/* ---------- 经历卡片 ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.exp-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: block; color: var(--ink);
}
.exp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }

.exp-card .icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 22px;
  margin-bottom: 14px;
}
.exp-card h3 { font-size: 19px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: baseline; }
.exp-card h3 .y { font-size: 13px; color: var(--muted); font-family: var(--font-sans); font-weight: 400; }
.exp-card p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.exp-card .more { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--seal); font-weight: 600; }
.exp-card:hover .more { text-decoration: underline; }

/* ---------- 标签 / 徽章 ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  padding: 5px 14px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; border: 1px solid transparent;
  transition: all .2s;
}
.tag:hover { border-color: var(--primary); }

.achieve-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.achieve-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px 18px;
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow);
}
.achieve-card .yr { font-family: var(--font-sans); color: var(--seal); font-size: 13px; }
.achieve-card h4 { font-size: 15.5px; margin: 3px 0 4px; }
.achieve-card p { font-size: 13px; color: var(--muted); }

/* ---------- 详情页故事卡片 ---------- */
.story-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 26px 28px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.story-card .head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.story-card h3 { font-size: 20px; }
.story-card .head .y { font-family: var(--font-sans); color: var(--muted); font-size: 14px; }
.story-card p { font-size: 15px; color: var(--ink-2); margin-bottom: 10px; }
.story-card p:last-child { margin-bottom: 0; }
.story-card p.quote {
  border-left: 3px solid var(--seal);
  background: var(--seal-soft); border-radius: 0 8px 8px 0;
  padding: 10px 16px; color: var(--seal-deep);
  font-family: var(--font-sans); font-size: 14px;
}
.story-card .keyline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.story-card .keyline .k { font-size: 12.5px; background: var(--primary-soft); color: var(--primary); padding: 3px 12px; border-radius: 999px; }

/* 细节清单 */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 14px 0 22px; }
.detail-item { background: var(--paper-2); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; }
.detail-item b { color: var(--primary); display: block; font-size: 13px; font-family: var(--font-sans); }
.detail-item span { color: var(--ink-2); }

/* 图片占位（故事配图） */
.pic-placeholder {
  background:
    linear-gradient(135deg, var(--primary-soft), var(--paper-2));
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  height: 180px;
  display: grid; place-items: center;
  color: var(--muted); font-size: 13px; letter-spacing: 2px;
  margin: 16px 0;
}

/* ---------- 页脚 ---------- */
.site-footer { background: var(--primary-deep); color: rgba(246,241,231,.75); padding: 34px 0 28px; margin-top: 20px; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand { font-family: var(--font-sans); font-size: 16px; color: #F6F1E7; letter-spacing: 2px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: rgba(246,241,231,.75); }
.footer-links a:hover { color: var(--gold); }
.footer-beian { text-align: center; margin-top: 14px; color: rgba(246,241,231,.45); font-size: 12px; letter-spacing: 1px; }

/* ---------- 动效 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

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

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .info-card { display: grid; grid-template-columns: 260px 1fr; }
  .portrait-wrap img { aspect-ratio: auto; height: 100%; object-fit: cover; }
  .side-stats { grid-column: 1 / -1; }
  .info-table { padding-top: 14px; }
  .side-note { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav-menu, .search-box { display: none; }
  .menu-toggle { display: block; }
  .info-card { grid-template-columns: 1fr; }
  .entry-head-row { flex-direction: column; align-items: flex-start; }
  .entry-seal { align-self: flex-end; width: 64px; height: 64px; font-size: 15px; }
  .section-title { font-size: 21px; }
  .exp-grid { grid-template-columns: 1fr; }
  .sub-tabs { gap: 8px; }
  .sub-tabs a { padding: 7px 15px; font-size: 13px; }
}

/* ---------- 联系方式（本站特有区块） ---------- */
.contact-list { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; background: var(--card);
  border: 1px solid var(--border-soft); border-radius: 999px;
  color: var(--ink); font-size: 14px; text-decoration: none;
  transition: border-color .2s, transform .2s;
}
a.contact-item:hover { border-color: var(--seal); transform: translateY(-1px); }
.contact-item svg { width: 15px; height: 15px; color: var(--seal); flex: 0 0 auto; }
.contact-item b { color: var(--ink-2); font-weight: 600; margin-right: 2px; }
