:root {
  color-scheme: light;
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-soft: #f6f9fb;
  --text: #29323d;
  --muted: #6f7d8d;
  --heading: #18222f;
  --border: #d9e3ea;
  --accent: #2f9a67;
  --accent-strong: #1f7f54;
  --accent-soft: #e4f5ed;
  --blue: #3178b8;
  --shadow: 0 12px 28px rgba(24, 34, 47, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101820;
  --surface: #17212b;
  --surface-soft: #1f2b36;
  --text: #e3eaf1;
  --muted: #a6b4c1;
  --heading: #f6f9fb;
  --border: #2d3b48;
  --accent: #70d49c;
  --accent-strong: #9be5b8;
  --accent-soft: #173325;
  --blue: #83b9ed;
  --shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-strong);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

p {
  margin: 0 0 14px;
}

ul {
  margin-top: 0;
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
}

.header {
  background: var(--surface);
  border-top: 8px solid var(--accent);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 32px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.profile-image {
  width: 116px;
  height: 116px;
  flex: 0 0 116px;
  border: 4px solid var(--surface-soft);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(24, 34, 47, 0.14);
}

.profile-content {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.name {
  margin: 0;
  color: var(--heading);
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
}

.desc {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

.quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 0;
}

.quick-facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.quick-facts span {
  min-width: 0;
}

.quick-facts .fa {
  color: var(--accent);
}

.social {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.social li {
  margin: 0;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
}

.social a:hover,
.social a:focus {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.site-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.control-button:hover,
.control-button:focus,
.control-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.theme-button {
  gap: 7px;
  border-color: var(--border);
  background: var(--surface-soft);
}

.sections-wrapper {
  padding-top: 30px;
  padding-bottom: 30px;
}

.resume-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}

.section {
  margin-bottom: 28px;
}

.section-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.heading {
  margin: 0 0 20px;
  color: var(--heading);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}

.content,
.timeline-body,
.project-card,
.contact-list,
.plain-list {
  overflow-wrap: anywhere;
}

.feature-list {
  margin-bottom: 0;
}

.timeline {
  display: grid;
  gap: 24px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.timeline-body h3,
.project-card h3,
.education-item h3 {
  margin: 0 0 6px;
  color: var(--heading);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.role,
.project-meta,
.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.timeline-body ul {
  margin-bottom: 0;
}

.project-list {
  display: grid;
  gap: 18px;
}

.project-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.project-card p:last-child {
  margin-bottom: 0;
}

.project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 20px;
}

.contact-list {
  margin-bottom: 0;
}

.contact-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.contact-list li:last-child {
  margin-bottom: 0;
}

.contact-list .fa {
  color: var(--accent);
  text-align: center;
}

.skillset {
  display: grid;
  gap: 18px;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
}

.skill-label span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.level-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.level-bar-inner {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.education-item p:last-child,
.plain-list {
  margin-bottom: 0;
}

.plain-list {
  padding-left: 18px;
}

.footer {
  padding: 20px 0 32px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 991px) {
  .header-inner {
    flex-direction: column;
  }

  .site-controls {
    width: 100%;
    justify-content: flex-start;
  }

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

@media (max-width: 767px) {
  body {
    font-size: 15px;
    line-height: 1.7;
  }

  .container {
    width: 100%;
  }

  .header-inner {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .profile {
    width: 100%;
    align-items: flex-start;
    gap: 14px;
  }

  .profile-image {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
    border-width: 3px;
  }

  .name {
    font-size: 30px;
  }

  .desc {
    font-size: 17px;
  }

  .quick-facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .site-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .segmented-control,
  .theme-button {
    width: 100%;
  }

  .segmented-control .control-button,
  .theme-button {
    flex: 1;
  }

  .sections-wrapper {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .section {
    margin-bottom: 18px;
  }

  .section-inner {
    padding: 20px;
  }

  .heading {
    font-size: 20px;
    margin-bottom: 16px;
  }

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

  .timeline-meta {
    color: var(--accent-strong);
  }

  .project-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .project-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 420px) {
  .profile {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .site-controls {
    grid-template-columns: 1fr;
  }

  .section-inner {
    padding: 18px;
  }
}
