/* ============================================================
   陈俊旭个人网页 — 「年报印刷 × 风控终端」
   宣纸底 + 墨色字 + 印章红点缀；STIX Two（拉丁衬线）+ 系统宋体（中文标题）
   ============================================================ */

:root {
  --paper: #f6f2ea; /* 宣纸底色 */
  --paper-deep: #efe9dc; /* 略深一层的纸色 */
  --ink: #1b1812; /* 墨色主文字 */
  --ink-soft: #57503f; /* 次级文字 */
  --seal: #b13a2a; /* 印章红 */
  --seal-deep: #8e2d20;
  --hairline: #d8d0bd; /* 细分隔线 */
  --serif-cn: "Songti SC", "Noto Serif SC", "STSong", serif;
  --serif-en: "STIX Two Text", "Songti SC", serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --rail-w: 264px;
}

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

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: var(--seal);
  color: var(--paper);
}

/* 纸张颗粒感：SVG 噪点叠加 */
.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.52 0 0 0 0 0.45 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

/* ============ 左侧固定栏 ============ */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 0 36px;
  z-index: 30;
  background: linear-gradient(
    180deg,
    rgba(246, 242, 234, 0.9),
    rgba(246, 242, 234, 0.65)
  );
  backdrop-filter: blur(2px);
}

/* 竖排名字，兼作回顶锚点 */
.rail-name {
  writing-mode: vertical-rl;
  letter-spacing: 0.45em;
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: 30px;
  margin: 8px 0 auto;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.rail-name:hover {
  color: var(--seal);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 28px 0;
}
.rail-nav a {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  transition: color 0.2s;
}
.rail-nav a i {
  font-style: normal;
  font-size: 10px;
  color: var(--seal);
}
.rail-nav a:hover,
.rail-nav a.active {
  color: var(--ink);
}
.rail-nav a.active {
  font-weight: 500;
}

.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.rail-foot a {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.rail-foot a:hover {
  color: var(--seal);
  border-bottom-color: var(--seal);
}

/* ============ 主内容 ============ */
main {
  margin-left: var(--rail-w);
  padding: 0 clamp(28px, 6vw, 96px);
  max-width: 1080px;
}

/* ———— 首屏：左文右图 ———— */
.hero {
  min-height: 68vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(30px, 6vw, 80px);
  padding: 84px 0 64px;
  border-bottom: 1px solid var(--hairline);
}
.hero-text {
  flex: 1;
}

.hero-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.38em;
  color: var(--seal);
  margin-bottom: 22px;
}
.hero h1 {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-cn {
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 108px);
  line-height: 1.1;
  letter-spacing: 0.06em;
}
.hero-en {
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 3vw, 30px);
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  list-style: none;
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.hero-meta li + li::before {
  content: "/";
  margin: 0 10px 0 4px;
  color: var(--hairline);
}

/* 首屏头像 */
.hero-portrait {
  flex-shrink: 0;
  width: clamp(190px, 24vw, 280px);
}
.hero-portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  filter: saturate(0.92) contrast(1.02);
  box-shadow:
    12px 12px 0 var(--paper-deep),
    12px 12px 0 1px var(--hairline);
}

/* ———— 章节通用 ———— */
.section {
  padding: 88px 0 40px;
  border-bottom: 1px solid var(--hairline);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 46px;
}
.section-head i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--seal);
  letter-spacing: 0.1em;
}
.section-head h2 {
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.08em;
}
.section-head h2 span {
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: 0.5em;
  color: var(--ink-soft);
  margin-left: 10px;
  letter-spacing: 0.03em;
}

/* ———— 01 简介 ———— */
.about-grid {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.lede {
  font-family: var(--serif-cn);
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 2;
}
.lede b,
.about-grid b {
  color: var(--ink);
}
.about-note {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  border-left: 3px solid var(--seal);
  padding-left: 14px;
  line-height: 1.9;
}

/* ———— 02 经历：台账时间线 ———— */
.timeline {
  list-style: none;
}
.entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 30px;
  padding: 34px 0;
  border-top: 1px dashed var(--hairline);
}
.entry:first-child {
  border-top: 0;
  padding-top: 0;
}
.entry-when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--seal);
  line-height: 1.9;
  font-variant-numeric: tabular-nums;
}
.entry-body h3 {
  font-family: var(--serif-cn);
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.entry-body .role {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 10px;
  letter-spacing: 0.05em;
}
.entry-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.entry-body li {
  padding-left: 18px;
  position: relative;
  color: var(--ink-soft);
  font-size: 15px;
}
.entry-body li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--seal);
  font-size: 10px;
  top: 6px;
}
.entry-body b {
  color: var(--ink);
  font-weight: 600;
}

/* ———— 03 资历 ———— */
.creds {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 26px;
  align-items: start;
}
.cert {
  position: relative;
}
.cert img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  border: 1px solid var(--hairline);
  background: #fff;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(27, 24, 18, 0.08);
  transition: transform 0.3s ease;
}
.cert:hover img {
  transform: scale(1.02) rotate(0.4deg);
}
.cert figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 10px;
  letter-spacing: 0.06em;
}
.edu h3 {
  font-family: var(--serif-cn);
  font-size: 17px;
  margin-bottom: 14px;
  color: var(--seal);
}
.edu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--hairline);
  margin-bottom: 8px;
  font-size: 14px;
}
.edu-item b {
  font-family: var(--serif-cn);
  font-size: 16px;
}
.edu-item span {
  color: var(--ink-soft);
}
.edu-item .edu-when {
  font-family: var(--mono);
  font-size: 12px;
}
.edu h3:nth-of-type(2) {
  margin-top: 26px;
}

/* ———— 04 联系 ———— */
.contact {
  border-bottom: 0;
  padding-bottom: 80px;
}
.contact-lede {
  font-family: var(--serif-cn);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 2;
  max-width: 640px;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}
.contact-btn {
  font-family: var(--mono);
  font-size: 14px;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  padding: 13px 26px;
  border-radius: 3px;
  transition:
    background 0.25s,
    transform 0.25s;
}
.contact-btn:hover {
  background: var(--seal);
  transform: translateY(-2px);
}
.contact-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.contact-btn.ghost:hover {
  border-color: var(--seal);
  color: var(--seal);
  background: transparent;
}

.footer {
  padding: 26px 0 34px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* ============ 入场与滚动显现动画 ============ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.hero .reveal:nth-child(1) {
  transition-delay: 0.05s;
}
.hero .reveal:nth-child(2) {
  transition-delay: 0.15s;
}
.hero .reveal:nth-child(3) {
  transition-delay: 0.3s;
}
.hero-portrait.reveal {
  transition-delay: 0.35s;
}

.section .section-head,
.entry,
.cert,
.edu,
.contact-lede,
.contact-links {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.in-view .section-head,
.in-view .entry,
.in-view .cert,
.in-view .edu,
.in-view .contact-lede,
.in-view .contact-links {
  opacity: 1;
  transform: none;
}
.in-view .entry:nth-child(2) {
  transition-delay: 0.12s;
}
.in-view .entry:nth-child(3) {
  transition-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .section .section-head,
  .entry,
  .cert,
  .edu,
  .contact-lede,
  .contact-links {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .creds {
    grid-template-columns: 1fr 1fr;
  }
  .edu {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  :root {
    --rail-w: 0px;
  }
  .rail {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    background: rgba(246, 242, 234, 0.92);
  }
  .rail-name {
    writing-mode: horizontal-tb;
    margin: 0 auto 0 0;
    font-size: 19px;
    letter-spacing: 0.2em;
  }
  .rail-nav {
    flex-direction: row;
    gap: 12px;
    margin: 0;
    overflow-x: auto;
  }
  .rail-nav a i {
    display: none;
  }
  .rail-foot {
    display: none;
  }
  main {
    margin-left: 0;
  }
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    min-height: auto;
    padding-top: 48px;
    gap: 32px;
  }
  .hero-portrait {
    width: 170px;
  }
  .entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .entry-when br {
    display: none;
  }
  .creds {
    grid-template-columns: 1fr;
  }
}
