/* ============================================================
   个人简历网站 · 大框架样式
   结构：左栏（头像 + 基本介绍） / 中栏（滑动内容区） / 右栏（板块导航）
   修改配色与间距：只改 :root 变量即可
   ============================================================ */

:root {
  --canvas: #f4f4f2;
  --paper: #ffffff;
  --ink: #17191c;
  --ink-2: #5b616b;
  --ink-3: #8d939c;
  --line: #e3e3df;
  --line-2: #d2d2cb;
  --accent: #b0432c;
  --accent-soft: #f8ede9;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(23, 25, 28, .05);
  --shadow: 0 1px 3px rgba(23, 25, 28, .05), 0 10px 30px rgba(23, 25, 28, .05);
  --sidebar-w: 292px;
  --rail-w: 176px;
  --gap: 18px;
  --pad: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, dt, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- 总体框架 ---------------- */
.frame {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  gap: var(--gap);
  height: 100vh;
  padding: var(--gap);
}

/* ---------------- 左栏 ---------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.sidebar__label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-2); padding: 2px 2px 0;
}
.sidebar__label span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--ink-3);
}

/* 头像 */
.avatar {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: grid; place-items: center;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar img[hidden] { display: none; }
.avatar__placeholder {
  font-size: 15px; font-weight: 600; letter-spacing: .08em; color: var(--ink-3);
}

/* 基本介绍 */
.profile {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--pad) 20px;
}
.profile__name { font-size: 26px; line-height: 1.25; letter-spacing: .02em; font-weight: 700; }
.profile__tagline {
  margin-top: 6px; font-size: 13px; color: var(--ink-2);
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}

.profile__facts { margin-top: 14px; display: grid; gap: 2px; }
.profile__facts > div {
  display: grid; grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px; padding: 6px 0; align-items: baseline;
}
.profile__facts dt { font-size: 12.5px; color: var(--ink-3); }
.profile__facts dd { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.profile__facts dd.is-todo { color: var(--ink-3); }

.profile__contact { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.profile__contact li { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; }
.profile__contact li span { font-size: 11px; color: var(--ink-3); min-width: 34px; }
.profile__contact a { border-bottom: 1px solid var(--line-2); overflow-wrap: anywhere; }
.profile__contact a:hover { border-color: var(--accent); color: var(--accent); }

.profile__resume { margin-top: 16px; }
.resume-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  transition: background .2s var(--ease);
}
.resume-btn:hover { background: var(--accent); }

.sidebar__foot { font-size: 11px; color: var(--ink-3); padding: 0 2px; font-family: var(--mono); letter-spacing: .04em; }

/* ---------------- 中栏：内容舞台 ---------------- */
.board {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

/* ---------------- 右栏：板块导航 ---------------- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.rail__label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-2); padding: 2px 2px 0;
}
.rail__label span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--ink-3);
}

/* 竖排板块按钮：点选 + 滚轮 + 上下键都可切换 */
.tabbar {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tabbar::-webkit-scrollbar { width: 6px; }
.tabbar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.tab {
  flex: none;
  display: flex; align-items: center; gap: 9px;
  padding: 13px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}
.tab:hover { border-color: var(--line-2); transform: translateX(-2px); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab__no {
  flex: none;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-3);
}
.tab[aria-selected="true"] .tab__no { color: rgba(255, 255, 255, .55); }
.tab__text { flex: 1 1 auto; min-width: 0; }

/* 内容舞台 */
.stage {
  position: relative;
  min-height: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage__panels { position: absolute; inset: 0; }
.stage:focus { outline: none; }

/* 单个板块（一屏一页，上下滑动切换） */
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: var(--pad) 26px calc(var(--pad) + 4px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6%);
  transition: opacity .32s var(--ease), transform .42s var(--ease), visibility .42s;
}
.panel.is-active { opacity: 1; visibility: visible; transform: none; }
.panel.is-before { transform: translateY(-6%); }

.panel__head { flex: none; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel__no {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--accent);
  text-transform: uppercase;
}
.panel__title { font-size: 25px; font-weight: 700; letter-spacing: .02em; margin-top: 4px; }
.panel__desc { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); max-width: 76ch; }

.panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 4px 8px 0;
  margin-right: -4px;
}
.panel__body::-webkit-scrollbar { width: 8px; }
.panel__body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.panel__body::-webkit-scrollbar-track { background: transparent; }

/* 翻页控件（固定在右栏底部） */
.pager {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: var(--paper);
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.pager__btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: transparent; color: var(--ink-2);
  cursor: pointer; display: grid; place-items: center; font-size: 14px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.pager__btn:hover { background: var(--ink); color: #fff; }
.pager__btn:disabled { opacity: .3; cursor: default; }
.pager__btn:disabled:hover { background: transparent; color: var(--ink-2); }
.pager__count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.pager__count b { color: var(--ink); }

/* ---------------- 内容：时间线（学历 / 工作 / 校内） ---------------- */
.timeline { display: grid; gap: 14px; }
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdfdfc;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.entry:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.entry__date { font-family: var(--mono); font-size: 12px; color: var(--ink-3); line-height: 1.9; }
.entry__title { font-size: 16.5px; font-weight: 700; }
.entry__org { margin-top: 2px; font-size: 13px; color: var(--accent); font-weight: 600; }
.entry__text { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.entry__points { margin-top: 8px; display: grid; gap: 5px; }
.entry__points li { position: relative; padding-left: 14px; font-size: 13.5px; color: var(--ink-2); }
.entry__points li::before {
  content: ""; position: absolute; left: 2px; top: .68em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--line-2);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags li {
  font-size: 11.5px; color: var(--ink-2);
  background: var(--canvas); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px;
}
.entry__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12.5px; }
.entry__links a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }

/* ---------------- 内容：卡片（精选项目 / 个人项目） ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdfdfc;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.card__top { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--ink-3); }
.card__title { margin-top: 10px; font-size: 16.5px; font-weight: 700; }
.card__text { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); flex: 1 1 auto; }
.card__result { margin-top: 12px; display: flex; align-items: baseline; gap: 10px; }
.card__result strong { font-size: 20px; letter-spacing: -.01em; }
.card__result span { font-size: 12px; color: var(--ink-3); line-height: 1.45; }

/* ---------------- 内容：能力矩阵 ---------------- */
.matrix { display: grid; gap: 10px; }
.matrix__row {
  display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 16px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fdfdfc;
}
.matrix__label { font-size: 13.5px; font-weight: 700; }
.matrix__value { font-size: 13.5px; color: var(--ink-2); }
.matrix__value .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.matrix__value .chips span {
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  background: var(--canvas); border: 1px solid var(--line);
}

/* ---------------- 空状态占位（数据填好后自动消失） ---------------- */
.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: repeating-linear-gradient(135deg, #fcfcfb, #fcfcfb 12px, #f9f9f7 12px, #f9f9f7 24px);
}
.empty__head { display: flex; align-items: center; gap: 10px; }
.empty__badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 3px 9px; font-weight: 700;
}
.empty__title { font-size: 15px; font-weight: 700; }
.empty__text { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.empty__list { margin-top: 10px; display: grid; gap: 6px; }
.empty__list li { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.empty__list code {
  font-family: var(--mono); font-size: 12px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; color: var(--ink);
  overflow-wrap: anywhere; word-break: break-word; max-width: 100%;
}
.ghost { display: grid; gap: 10px; margin-top: 14px; }
.ghost__item {
  height: 58px; border-radius: var(--radius);
  border: 1px dashed var(--line); background: #fcfcfb;
}
.ghost--cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ghost--cards .ghost__item { height: 118px; }
.cards + .empty, .timeline + .empty { margin-top: 14px; }

/* ---------------- 窄屏 / 手机 ---------------- */
@media (max-width: 1180px) {
  :root { --rail-w: 152px; }
  .tab { font-size: 13px; padding: 11px 10px; gap: 7px; }
}

@media (max-width: 980px) {
  :root { --sidebar-w: 248px; --rail-w: 138px; --gap: 12px; --pad: 18px; }
  .tab { font-size: 12.5px; padding: 10px 9px; gap: 6px; }
  .tab__no { display: none; }
}

@media (max-width: 860px) {
  body { overflow-x: hidden; }
  .frame {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 12px;
  }
  .sidebar { order: 1; gap: 10px; }
  .avatar { aspect-ratio: 1 / 1; width: 128px; border-radius: 12px; }
  .profile { overflow: visible; margin-top: 10px; }

  /* 导航：手机上变成顶部可横向滑动的胶囊条，滑动 / 点选都顺手 */
  .rail {
    order: 2;
    position: sticky; top: 0; z-index: 6;
    margin-top: 12px;
    padding: 8px 0;
    background: var(--canvas);
  }
  .rail__label, .pager { display: none; }
  .tabbar {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    padding: 10px 13px;
    font-size: 13.5px;
    scroll-snap-align: start;
  }
  .tab:hover { transform: none; }
  .tab__text { white-space: nowrap; }

  .board { order: 3; margin-top: 10px; grid-template-rows: none; }
  .stage { background: transparent; border: none; box-shadow: none; overflow: visible; }
  .stage__panels { position: static; }
  .panel {
    position: static; display: none; padding: 16px 16px 22px;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); opacity: 1; visibility: visible; transform: none; transition: none;
  }
  .panel.is-active { display: flex; }
  .panel__body { overflow: visible; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .matrix__row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .profile__facts > div { grid-template-columns: 62px minmax(0, 1fr); }
}

/* ---------------- 打印 / 导出 PDF：展开全部板块 ---------------- */
@media print {
  :root { --canvas: #fff; }
  body { background: #fff; font-size: 11.5pt; }
  .frame { display: block; height: auto; padding: 0; }
  .sidebar { display: block; }
  .avatar { width: 150px; aspect-ratio: 4 / 5; float: right; margin: 0 0 12px 16px; }
  .profile { border: none; box-shadow: none; padding: 0; overflow: visible; }
  .rail, .tabbar, .pager, .skip-link, .sidebar__foot { display: none !important; }
  .stage { border: none; box-shadow: none; overflow: visible; }
  .stage__panels { position: static; }
  .panel {
    position: static; display: block; visibility: visible; opacity: 1; transform: none;
    break-inside: avoid; page-break-before: always; padding: 0 0 12mm;
  }
  .panel:first-child { page-break-before: auto; }
  .panel__body { overflow: visible; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
