:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --line: #e6eaf0;
  --text: #1f2937;
  --muted: #4b5563;
  --accent: #2563eb;
  --heading: #111827;
  --subtitle: #374151;
  --accent-bg: #eff6ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.layout {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  padding: 56px 0;
}

.sidebar {
  position: sticky;
  top: 48px;
  height: fit-content;
}

.sidebar h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--subtitle);
  font-weight: 600;
  font-style: italic;
}

.intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

nav {
  margin-top: 26px;
  display: grid;
  gap: 8px;
}

nav a {
  width: fit-content;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: color 150ms ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

nav a.active {
  color: var(--accent);
}


.content section + section {
  margin-top: 48px;
}

.content section > p:last-of-type {
  margin-bottom: 0;
}

h2 {
  margin: 0 0 18px;
  color: var(--heading);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

p {
  margin: 0 0 14px;
  color: var(--muted);
}

.timeline-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
}

.timeline-item:last-child {
  border-bottom: 1px solid var(--line);
}

.time {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-top: 2px;
}

.time::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

h3 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.project-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 18px;
  align-items: center;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  min-height: 166px;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-2px);
  border-color: #b8c8e0;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.project-card p {
  margin: 0;
  line-height: 1.5;
}

.project-card.no-image {
  grid-template-columns: 1fr;
}

.subheading {
  margin: 28px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline-item + .subheading {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  margin-top: 0;
}

ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

li + li {
  margin-top: 8px;
}

/* ── JD Card ─────────────────────────────────────────────── */

.jd-card {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}

.jd-header {
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.jd-title {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.jd-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.jd-meta-dot {
  color: var(--line);
}

.jd-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #d1fae5;
  color: #065f46;
}

@media (prefers-color-scheme: dark) {
  .jd-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
  }
}

.jd-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.jd-section-title {
  margin: 0 0 14px;
  color: var(--heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.jd-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.jd-list li {
  padding-left: 4px;
}

.jd-list li + li {
  margin-top: 6px;
}

.jd-list li::marker {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9em;
}

.jd-apply {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.jd-apply-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.jd-apply-btn {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.jd-apply-btn:hover,
.jd-apply-btn:focus-visible {
  opacity: 0.7;
  text-decoration: underline;
}

.wechat-block {
  margin-top: 10px;
}

.wechat-block img {
  width: 180px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-footer {
  margin-top: 54px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inline {
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.footer-inline a {
  color: var(--muted);
  font-weight: 600;
}

.footer-inline a:hover,
.footer-inline a:focus-visible {
  color: var(--accent);
}

/* ── Dark mode ──────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --line: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --heading: #f0f6fc;
    --subtitle: #9ca3af;
    --accent-bg: rgba(88, 166, 255, 0.1);
  }

  .project-card:hover,
  .project-card:focus-visible {
    border-color: #58a6ff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .layout {
    width: calc(100% - 32px);
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px 0 48px;
  }

  .sidebar {
    position: static;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  nav a {
    width: 100%;
    display: block;
    text-align: center;
    padding: 9px 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.9rem;
  }

  nav a:hover,
  nav a:focus-visible {
    background: var(--accent-bg);
    border-color: var(--accent);
    text-decoration: none;
  }

  nav a.active {
    background: var(--accent-bg);
    border-color: var(--accent);
  }

  .project-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .project-card img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
  }

  .content section + section {
    margin-top: 40px;
  }
}

@media (max-width: 600px) {
  .layout {
    width: calc(100% - 28px);
    gap: 28px;
    padding: 24px 0 40px;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .time {
    font-size: 0.82rem;
  }

  .project-card {
    padding: 12px;
    gap: 12px;
  }

  .footer-inline {
    flex-wrap: wrap;
    white-space: normal;
    gap: 6px 8px;
  }

  .content section + section {
    margin-top: 32px;
  }
}

@media (max-width: 480px) {
  .layout {
    width: calc(100% - 24px);
    gap: 24px;
    padding: 20px 0 36px;
  }

  .sidebar h1 {
    font-size: 1.85rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .intro {
    font-size: 0.9rem;
  }

  nav {
    margin-top: 18px;
    gap: 7px;
  }

  nav a {
    padding: 8px 4px;
    font-size: 0.85rem;
  }

  h2 {
    font-size: 1.2rem;
    margin-bottom: 14px;
  }

  h3 {
    font-size: 1rem;
  }

  .project-card {
    padding: 10px;
    gap: 10px;
    border-radius: 10px;
  }

  .project-card img {
    max-height: 140px;
    border-radius: 6px;
  }

  .site-footer {
    margin-top: 36px;
  }

  .wechat-block img {
    width: 150px;
  }
}
