:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #20242c;
  background: #ffffff;
  --text: #20242c;
  --muted: #667085;
  --line: #e6e8ec;
  --soft: #f6f7f9;
  --accent: #1d4ed8;
  --accent-dark: #163ea8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav {
  width: min(1080px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover,
.text-link:hover,
.nav-contact a:hover {
  color: var(--accent);
}

.nav-contact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-link,
.email-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.icon-link {
  width: 36px;
}

.email-link {
  gap: 8px;
  max-width: 260px;
  padding: 0 10px;
  color: #263140;
  font-size: 13px;
  font-weight: 700;
}

.icon-link img,
.email-link img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.email-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-contact a:hover {
  border-color: var(--accent);
}

main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  min-height: 400px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 40px;
  padding: 46px 0 40px;
  border-bottom: 1px solid var(--line);
}

.intro-content {
  max-width: 680px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 40px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.lead {
  max-width: 620px;
  margin-top: 14px;
  color: #3d4654;
  font-size: 17px;
  line-height: 1.7;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #263140;
  font-weight: 700;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button:hover {
  border-color: var(--accent);
}

.button.primary:hover {
  background: var(--accent-dark);
}

.profile-card,
.project-card,
.list-item,
.content-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.profile-card {
  padding: 20px;
}

.avatar {
  width: 64px;
  height: 64px;
  display: block;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

dl {
  margin: 0;
}

dl div + div {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd {
  margin: 6px 0 0;
  line-height: 1.6;
}

.section {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 34px;
  padding: 42px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  align-self: start;
}

.content-block {
  padding: 20px;
  color: #3d4654;
  line-height: 1.7;
}

.content-block p + p {
  margin-top: 12px;
}

.resume-panel {
  display: grid;
  gap: 22px;
}

.resume-subsection h3 {
  color: var(--text);
  font-size: 17px;
}

.education-timeline,
.language-grid {
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.education-timeline {
  display: grid;
  gap: 12px;
}

.education-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0 14px 20px;
  border-top: 1px solid var(--line);
}

.education-timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #ffffff;
}

.timeline-period {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.education-timeline strong {
  display: block;
  color: var(--text);
  line-height: 1.4;
}

.education-timeline span:not(.timeline-period) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.language-grid li {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.language-grid img {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.language-grid span {
  min-width: 0;
  color: var(--text);
  font-weight: 700;
}

.text-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 700;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.list-item p,
.project-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.tag {
  align-self: flex-start;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  min-height: 185px;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.project-card .text-link {
  margin-top: auto;
  padding-top: 14px;
}

.site-footer {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 32px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .nav {
    min-height: auto;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .nav-links {
    width: 100%;
    margin-left: 0;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-contact {
    width: 100%;
  }

  .email-link {
    max-width: min(100%, 300px);
  }

  .intro,
  .section {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .intro {
    min-height: auto;
    padding: 34px 0;
  }

  h1 {
    font-size: 34px;
  }

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

  .language-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  main,
  .nav,
  .site-footer {
    width: min(100% - 24px, 1080px);
  }

  .intro-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .nav-contact {
    align-items: stretch;
  }

  .email-link {
    flex: 1 1 auto;
  }

  .list-item {
    flex-direction: column;
    gap: 10px;
  }

  .education-timeline li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
