/* ============================================
   Sud0x67 · Resume — 简洁工程风 / clean engineering
   ============================================ */

:root {
  --accent: #0b6e4f;          /* 同济绿 Tongji green */
  --accent-soft: #e3f1ec;
  --accent-border: #b9dccd;
  --ink: #1c2b26;
  --ink-2: #46574f;
  --ink-3: #71827a;
  --bg: #f2f5f3;
  --paper: #ffffff;
  --line: #e2e8e4;
  --line-2: #d0d9d4;
  --card-shadow: 0 1px 2px rgba(28, 43, 38, 0.04), 0 4px 14px rgba(28, 43, 38, 0.05);
  --radius: 10px;
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部工具栏 ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.toolbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-home {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.toolbar-home .dot { color: var(--accent); }
.toolbar-home:hover { text-decoration: none; color: var(--accent); }

.toolbar-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.lang-switch button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  font: 600 13px var(--font-sans);
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-switch button.active {
  background: var(--accent);
  color: #fff;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: 600 13px var(--font-sans);
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover { background: #095b41; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.65; cursor: wait; }
.btn-primary svg { flex: 0 0 auto; }

/* ---------- 页面框架 ---------- */

.page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(28, 43, 38, 0.05), 0 16px 40px rgba(28, 43, 38, 0.07);
  padding: 40px 44px 28px;
}

.layout {
  display: grid;
  grid-template-columns: 296px 1fr;
  gap: 36px;
  align-items: start;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- 左栏 ---------- */

.id-card {
  text-align: center;
  padding: 26px 22px 20px;
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft) 0%, #fff 42%);
}

.avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(11, 110, 79, 0.25);
  object-fit: cover;
  background: var(--accent-soft);
}

.name {
  margin: 14px 0 2px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.headline { font-size: 14.5px; font-weight: 600; color: var(--ink-2); }

.focus {
  margin-top: 6px;
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 3px 12px;
  letter-spacing: 0.02em;
}

.contact {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-2);
  font-size: 13px;
  min-width: 0;
}

a.contact-item:hover { color: var(--accent); text-decoration: none; }

.ci-icon { width: 15px; height: 15px; flex: 0 0 auto; display: inline-flex; color: var(--accent); }
.ci-icon svg { width: 100%; height: 100%; }
.ci-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-card { margin-top: 16px; padding: 16px 18px; }

.side-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

/* GitHub 统计 */
.gh-stats { display: flex; }
.gh-stat { flex: 1; text-align: center; padding: 4px 0; }
.gh-stat + .gh-stat { border-left: 1px solid var(--line); }
.gh-stat .num { display: block; font-size: 19px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.gh-stat .lbl { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }

/* 技能 */
.skill-group + .skill-group { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

.skill-cat { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }

.skill-items { display: flex; flex-wrap: wrap; gap: 5px; }

.skill-tag {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}

/* 开源社区 */
.os-item + .os-item { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

.os-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.os-org { font-size: 13.5px; font-weight: 600; }
.os-role {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 5px;
  padding: 1px 7px;
}
.os-desc { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.55; }

/* ---------- 右栏正文 ---------- */

.section { padding: 20px 24px; }
.section + .section { margin-top: 16px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.section-title svg { width: 17px; height: 17px; color: var(--accent); flex: 0 0 auto; }

/* 个人简介 */
.about-text p { margin: 0 0 10px; color: var(--ink-2); }
.about-text p:last-child { margin-bottom: 0; }

/* 时间线条目（工作 / 教育 / 研究） */
.entry { position: relative; padding-left: 20px; }
.entry::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.entry::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 22px;
  bottom: 2px;
  width: 1px;
  background: var(--line-2);
}
.entry:last-child::after { display: none; }

.entry + .entry { margin-top: 18px; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-title { font-size: 15.5px; font-weight: 700; }
.entry-title a { color: var(--ink); }
.entry-title a:hover { color: var(--accent); }

.entry-sub { font-size: 13px; color: var(--ink-2); margin-top: 1px; }

.entry-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.period { font-family: var(--mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
.loc { display: inline-flex; align-items: center; gap: 4px; }

.entry-desc { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); }

.bullets { margin: 8px 0 0; padding: 0; list-style: none; }

.bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent-border);
}

/* 开源项目（GitHub 动态） */
.projects-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  margin: -4px 0 12px;
}
.projects-hint svg { width: 13px; height: 13px; }

.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.repo-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink-2);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.repo-card:hover {
  text-decoration: none;
  border-color: var(--accent-border);
  box-shadow: 0 3px 12px rgba(11, 110, 79, 0.1);
  transform: translateY(-1px);
}

.repo-name {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.repo-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin: 4px 0 8px;
  min-height: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-meta { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--ink-3); }

.repo-lang { display: inline-flex; align-items: center; gap: 5px; }
.repo-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.repo-stars { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.repo-stars svg { width: 11px; height: 11px; color: #e8a317; }
.repo-updated { margin-left: auto; }

.repo-empty { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); margin: 4px 0; }

/* ---------- 页脚 ---------- */

.footer { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 12px; }
.footer p { margin: 0; font-size: 11.5px; color: var(--ink-3); text-align: center; }

/* ---------- 响应式 ---------- */

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sheet { padding: 26px 20px 20px; }
  .section { padding: 16px 18px; }
  .repo-grid { grid-template-columns: 1fr; }
  .toolbar-inner { padding: 9px 16px; }
  .page { padding: 18px 12px 30px; }
  .toolbar-home { display: none; }
}

@media (max-width: 480px) {
  .btn-primary span { display: none; }
  .btn-primary { padding: 7px 12px; }
}

/* ---------- PDF 导出 / 打印 ---------- */

/* 导出时隐藏工具栏，去掉阴影与圆角（html2canvas 截图基于 .sheet） */
body.exporting .toolbar { display: none; }

@media print {
  .toolbar { display: none; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .sheet { border: 0; border-radius: 0; box-shadow: none; padding: 0; }
}

/* 分页时尽量不把卡片拦腰截断 */
.card, .entry, .repo-card, .skill-group, .os-item, .bullets li {
  break-inside: avoid;
  page-break-inside: avoid;
}
