:root {
  --bg: #08090b;
  --panel: #11141b;
  --panel-strong: #151a24;
  --line: #273142;
  --line-soft: #1d2532;
  --text: #e7eaf0;
  --muted: #a8afbd;
  --faint: #778092;
  --blue: #7eb8ff;
  --cyan: #68d8d6;
  --green: #98d779;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.75;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 9, 11, 0.86);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  font-size: 13px;
  color: var(--muted);
}

.nav a {
  padding: 13px 0;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  color: var(--blue);
}

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

.lang-switch button {
  width: 38px;
  min-height: 30px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.lang-switch button.active {
  color: #07101d;
  background: var(--blue);
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  width: min(100%, 1240px);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 48px;
  align-self: start;
  height: calc(100vh - 48px);
  padding: 48px 0 28px;
  border-right: 1px solid var(--line-soft);
  background: #090a0d;
}

.profile-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 24px;
  padding: 0 24px 0 72px;
}

.avatar {
  width: 112px;
  height: 112px;
  border: 1px solid #243246;
  border-radius: 8px;
  background: #2c89cf;
  object-fit: contain;
  object-position: center;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 27px;
  line-height: 1.2;
}

.english-name {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.role,
.muted {
  color: var(--muted);
}

.quick-facts {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.quick-facts span:nth-child(2) {
  color: var(--blue);
  font-weight: 700;
}

.contact-list {
  display: grid;
  gap: 17px;
  font-size: 13px;
}

.label {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-list a:hover {
  color: var(--blue);
}

.resume-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.resume-link:hover {
  border-color: var(--blue);
}

.resume-link span:last-child {
  color: var(--blue);
  font-size: 12px;
}

.content {
  width: min(100%, 820px);
  padding: 108px 64px 80px 52px;
}

.section {
  scroll-margin-top: 78px;
  margin-bottom: 86px;
}

.section.compact {
  margin-bottom: 70px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.lead {
  max-width: 780px;
  color: #d8dde6;
  font-size: 15.5px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.metric-card,
.project-card,
.timeline-card,
.skill-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card {
  padding: 16px;
  border-left: 2px solid var(--blue);
}

.metric-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.metric-card p,
.project-card p,
.timeline-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.skill-groups {
  display: grid;
  gap: 16px;
}

.skill-group {
  padding: 18px;
}

.skill-group h3 {
  color: var(--muted);
  font-size: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 8px;
  background: #1a2035;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.project-list,
.timeline {
  display: grid;
  gap: 14px;
}

.timeline-group-label {
  width: fit-content;
  margin-top: 4px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101521;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.project-card {
  padding: 24px 26px;
}

.project-card.featured {
  border-color: #2f5b86;
  background: linear-gradient(180deg, rgba(21, 30, 45, 0.98), rgba(15, 18, 25, 0.98));
}

.project-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.project-card ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: #cbd2df;
  font-size: 13.5px;
}

.project-card li + li {
  margin-top: 8px;
}

.timeline-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 22px;
}

.time {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--blue);
  cursor: pointer;
}

.back-top.visible {
  display: block;
}

@media (max-width: 960px) {
  .topbar {
    justify-content: space-between;
  }

  .layout {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    padding: 34px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .profile-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px 20px;
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
  }

  .quick-facts,
  .contact-list,
  .resume-link {
    grid-column: 1 / -1;
  }

  .contact-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 58px 24px 70px;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: stretch;
    gap: 8px;
    padding: 0 12px;
  }

  .nav {
    flex: 1;
    justify-content: flex-start;
    gap: 0 17px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    padding: 12px 0;
    font-size: 12px;
  }

  .lang-switch {
    align-self: center;
  }

  .profile-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .avatar {
    width: 92px;
    height: 92px;
  }

  h1 {
    font-size: 24px;
  }

  .contact-list,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .section {
    margin-bottom: 64px;
  }

  .section-title {
    gap: 12px;
  }

  h2 {
    font-size: 22px;
  }

  .project-card,
  .timeline-card,
  .skill-group {
    padding: 18px;
  }

  .project-head,
  .timeline-card {
    grid-template-columns: 1fr;
  }

  .project-head {
    display: grid;
  }

  .pill {
    width: fit-content;
  }
}

@media (max-width: 420px) {
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sidebar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }
}
