/* ================================================================
   hycent · 个人学术主页
   暖纸底 + 白卡片 · 配色与 cairnova.net 同源（绿 #1C5E40 / 红 #8A3324）
   系统字体栈（谷歌字体在大陆被墙，弃用）
   ================================================================ */

:root {
  --paper:      #FAF8F2;
  --card:       #FFFFFF;
  --ink:        #212B23;
  --muted:      #5A6157;
  --faint:      #9AA093;
  --line:       #E8E3D6;
  --green:      #1C5E40;
  --green-soft: #EDF3EE;
  --red:        #8A3324;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
          Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 28px 56px;
  position: relative;
}

a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
a:hover, a:focus { color: var(--red); border-bottom-color: currentColor; }

p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

/* ---------- 名字行（名字 + 右侧「语言切换 ❘ Cairnova」一簇）---------- */
.name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 6px;
}
.name-row h1 { margin: 0; }
.name-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.name-right .sep {
  width: 1px;
  height: 15px;
  background: var(--line);
}
.lang {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border-bottom: none;
}
.lang:hover { color: var(--green); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border-bottom: none;
  white-space: nowrap;
}
.brand img { width: 26px; height: 26px; display: block; }
.brand:hover { color: var(--green); }

/* ---------- 头部 ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 10px 0 8px;
}
.hero-text { flex: 1; min-width: 0; }
.name-row h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .01em;
  margin: 0;
}
.name-row h1 .alt { color: var(--muted); font-weight: 400; }
.name-row h1 .ename { font-size: .4em; font-weight: 400; color: var(--muted); }
.hero p { color: var(--ink); font-size: 15px; }
.hero-photo { flex: 0 0 224px; }
.hero-photo img {
  width: 224px; height: 224px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 6px 24px rgba(33, 43, 35, .12);
  border: 4px solid var(--card);
}
.hero-links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-links a {
  font-size: 13.5px;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--green);
}
.hero-links a:hover { border-color: var(--green); }

/* ---------- 区块 ---------- */
section { margin-top: 44px; }
h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::before {
  content: "";
  width: 5px; height: 20px;
  border-radius: 3px;
  background: var(--green);
}
.subhead {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 6px;
}

/* ---------- 出版物 ---------- */
.pub {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.pub:last-of-type { border-bottom: none; }
.pub.selected {
  background: var(--green-soft);
  border: none;
  border-left: 4px solid var(--green);
  border-radius: 10px;
  margin: 6px 0;
}
/* 有代表图的论文：左图右文（无图的照旧纯文字全宽） */
.pub.has-fig { display: flex; gap: 18px; align-items: flex-start; }
.pub-fig { flex: 0 0 170px; }
.pub-fig img {
  width: 170px; height: auto; max-height: 150px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: block;
}
[data-full] { cursor: zoom-in; }
.pub-main { flex: 1; min-width: 0; }

/* 点缩略图放大：灯箱预览 */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(20, 22, 20, .82);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  /* 矢量 SVG：撑满视口并等比放大（object-fit 保持比例、SVG 放大不失真） */
  width: 95vw; height: 92vh;
  object-fit: contain;
  filter: drop-shadow(0 14px 44px rgba(0, 0, 0, .5));
}
.pub-title { font-size: 16px; font-weight: 650; margin: 0 0 3px; line-height: 1.45; }
.pub-authors { font-size: 14px; color: var(--muted); margin: 0 0 2px; }
.pub-authors b { color: var(--ink); }
.pub-venue { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
/* 标题即链接：保持深色加粗，悬停转绿，无下划线 */
.pub-title a { color: inherit; border-bottom: none; }
.pub-title a:hover { color: var(--green); }
.pub-abs { margin-top: 8px; font-size: 13.5px; }
.pub-abs summary {
  cursor: pointer;
  color: var(--faint);
  font-size: 12.5px;
  user-select: none;
}
.pub-abs summary:hover { color: var(--green); }
.pub-abs p { margin-top: 6px; color: var(--muted); line-height: 1.6; }

/* ---------- 卡片（创业 / 项目）---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}
.card + .card { margin-top: 14px; }

.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head img { display: block; }
.card-title { font-size: 18px; font-weight: 700; color: var(--green); }
a.card-title { border-bottom: none; }
a.card-title:hover { color: var(--red); }
.card-role { color: var(--muted); font-size: 14px; }
.tagline { color: var(--muted); font-style: italic; margin: 10px 0 14px; font-size: 14.5px; }

.products { display: flex; flex-direction: column; gap: 20px; margin-top: 16px; }
.product { display: flex; gap: 22px; align-items: flex-start; }
.product-logo img {
  width: 104px; height: 104px;
  object-fit: contain;
  /* 无边框；轻柔阴影托起、定义边缘，克制不喧宾夺主（近 JMIH 的淡淡浮起） */
  filter: drop-shadow(0 3px 7px rgba(33, 43, 35, .11));
}
.product-body { flex: 1; min-width: 0; }
.product-name { font-weight: 650; font-size: 16px; margin: 2px 0 4px; }
.product-desc { font-size: 14px; color: var(--muted); margin: 0; }
/* logo/名字 点击直达产品页：名字保持深色、悬停转绿；去掉链接下划线 */
.product-logo a { display: block; border-bottom: none; }
.product-name .product-link { color: inherit; border-bottom: none; }
.product-name .product-link:hover { color: var(--green); }

.badge {
  font-size: 11.5px;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  padding: 1px 9px;
  margin-left: 7px;
  vertical-align: 2px;
  white-space: nowrap;
}

/* ---------- 项目（JMIH）---------- */
.project { display: flex; gap: 22px; align-items: flex-start; }
.project-logo img { width: 104px; height: 104px; }  /* 无边框；白卡片+阴影为图片自带（悬浮） */
.project-body { flex: 1; min-width: 0; }
.project-title { font-size: 16px; font-weight: 650; margin: 0 0 2px; }
.project-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }
.project-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.project-links a, .project-links span {
  font-size: 12.5px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}
.project-links span { color: var(--faint); }
.project-body p { font-size: 14px; color: var(--muted); }

/* ---------- 时间线（教育 / 经历）---------- */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item img {
  width: 52px; height: 52px;
  object-fit: contain;
  flex: 0 0 52px;
}
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-weight: 650; font-size: 15px; }
.timeline-sub { color: var(--muted); font-size: 13.5px; }

/* ---------- 列表（服务 / 荣誉 / 奖项）---------- */
.flatlist { list-style: none; margin: 0; padding: 0; }
.flatlist li {
  padding: 7px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.flatlist li:last-child { border-bottom: none; }
.flatlist .year { color: var(--faint); font-size: 13px; margin-left: 6px; }
.flatlist a {
  font-size: 12px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-left: 6px;
  background: var(--card);
}

.note { color: var(--muted); }
.hl { background: var(--green-soft); border-radius: 4px; padding: 0 4px; }

/* ---------- 页脚 ---------- */
footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
}

/* ---------- 响应式 ---------- */
@media (max-width: 680px) {
  .page { padding: 28px 18px 44px; }
  .hero { flex-direction: column-reverse; text-align: center; gap: 20px; padding-top: 40px; }
  .name-row h1 { font-size: 28px; }
  .name-row { justify-content: center; }
  .hero-links { justify-content: center; }
  .hero-photo { flex-basis: auto; }
  .hero-photo img { width: 170px; height: 170px; }
  .project, .product { flex-direction: column; }
  .pub.has-fig { flex-direction: column; gap: 12px; }
  .pub-fig { flex-basis: auto; }
  .pub-fig img { width: 100%; max-height: 220px; }
  .timeline-item img { width: 44px; height: 44px; flex-basis: 44px; }
}
