:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #f0f4f8;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e1ea;
  --blue: #1f6feb;
  --green: #188864;
  --gold: #b7791f;
  --red: #c2413b;
  --shadow: 0 18px 42px rgba(20, 32, 48, 0.1);
  font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

main,
.site-header,
.site-footer,
.hero,
.section,
.page-hero {
  max-width: 100vw;
  overflow-x: clip;
}

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

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p,
a,
button,
li,
td,
th {
  overflow-wrap: break-word;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem max(1rem, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: max-content;
  font-weight: 800;
}

.brand-symbol {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
}

.site-nav a {
  min-height: 2.3rem;
  min-width: 0;
  padding: 0.55rem 0.8rem;
  color: var(--muted);
  border-radius: 7px;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-strong);
  outline: none;
}

.nav-github {
  color: #fff !important;
  background: var(--ink);
}

.back-to-top {
  position: fixed;
  right: clamp(1rem, 2.5vw, 1.8rem);
  bottom: clamp(1rem, 2.5vw, 1.8rem);
  z-index: 15;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.18);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--green);
  outline: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 5.25rem max(1rem, calc((100vw - 1180px) / 2)) 4.25rem;
  background:
    linear-gradient(90deg, rgba(31, 111, 235, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 111, 235, 0.08) 1px, transparent 1px),
    #ffffff;
  background-size: 44px 44px;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 58%, rgba(24, 136, 100, 0.11) 58% 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.34));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.95rem, 3.4vw, 2.75rem);
  line-height: 1.12;
}

.hero h1 span {
  margin-left: 0.65rem;
  color: var(--muted);
  font-size: 0.46em;
  font-weight: 750;
  vertical-align: baseline;
}

.hero-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 720px;
}

.compact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.58rem 0.85rem;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.hero-lead,
.page-hero p,
.section-heading p,
.score-card p,
.capability-list p,
.feature-project p,
.repo-card p,
.timeline p,
.achievement-grid p {
  color: var(--muted);
  line-height: 1.78;
}

.hero-lead {
  max-width: 640px;
  margin: 1.2rem 0 0;
  font-size: 1.08rem;
}

.education-list {
  display: grid;
  gap: 0.75rem;
  max-width: 720px;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}

.education-list li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.education-list span {
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 900;
}

.education-list strong {
  color: var(--ink);
  line-height: 1.55;
}

.button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--ink);
}

.button.secondary,
.text-link {
  color: var(--ink);
  background: #fff;
}

.button:hover,
.button:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 32, 48, 0.12);
  outline: none;
}

.hero-avatar {
  position: absolute;
  right: max(1rem, calc((100vw - 1180px) / 2));
  bottom: 3.5rem;
  z-index: 1;
  width: 8.5rem;
  height: 8.5rem;
  object-fit: cover;
  border: 6px solid #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.section,
.page-hero {
  padding: 5rem max(1rem, calc((100vw - 1180px) / 2));
  scroll-margin-top: 6rem;
}

.page-hero {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.3rem);
}

.page-hero p {
  max-width: 780px;
  margin: 1rem 0 0;
}

.muted-section {
  background: var(--surface-strong);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 2rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.15;
}

.section-heading p {
  margin: 0.8rem 0 0;
}

.inline-heading {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.score-card,
.contest-card,
.feature-project,
.repo-card,
.capability-list article,
.timeline article,
.fit-grid article,
.achievement-grid article {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(20, 32, 48, 0.07);
}

.score-card {
  padding: 1.15rem;
}

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

.contest-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
}

.contest-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.35rem;
  content: "";
  background: linear-gradient(180deg, var(--blue), var(--green));
}

.contest-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contest-title span {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
}

.contest-title strong {
  padding: 0.35rem 0.55rem;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.contest-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.contest-note {
  margin: -0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.contest-results {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.contest-results div {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.8rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.contest-results dt {
  color: var(--blue);
  font-weight: 900;
}

.contest-results dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.contest-results dd:has(.contest-region) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.contest-region {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.12rem 0.38rem;
  color: var(--green);
  background: rgba(8, 120, 102, 0.08);
  border: 1px solid rgba(8, 120, 102, 0.18);
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
}

.score-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.score-card-head span,
.repo-meta,
.project-type {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-card-head strong {
  color: var(--green);
  font-size: 0.9rem;
  white-space: nowrap;
}

.score-value {
  margin: 1.2rem 0 0.8rem;
  color: var(--ink);
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.score-unit {
  font-size: 0.8em;
  font-weight: 850;
  vertical-align: 0.04em;
}

.progress {
  height: 0.65rem;
  overflow: hidden;
  background: #e8edf3;
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: inherit;
  transition: width 900ms ease;
}

.score-card p {
  margin: 0.9rem 0 0;
  font-size: 0.94rem;
}

.capability-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.capability-list article {
  padding: 1.25rem;
}

.capability-index {
  display: inline-flex;
  margin-bottom: 1.1rem;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 900;
}

.capability-list h3,
.feature-project h3,
.repo-card h3,
.timeline h3,
.fit-grid h3,
.achievement-grid h3 {
  margin: 0 0 0.65rem;
  font-size: 1.18rem;
}

.capability-list p,
.feature-project p,
.repo-card p,
.timeline p,
.achievement-grid p {
  margin: 0;
}

.repo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.repo-strip a {
  min-width: 0;
  min-height: 8rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(20, 32, 48, 0.07);
}

.repo-strip a:hover,
.repo-strip a:focus-visible,
.repo-card a:hover,
.repo-card a:focus-visible {
  color: var(--blue);
  outline: none;
}

.repo-strip span,
.repo-strip small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.repo-strip strong {
  display: block;
  margin: 0.6rem 0 1rem;
  font-size: 1.06rem;
}

.feature-projects {
  display: grid;
  gap: 1rem;
}

.feature-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.35fr);
  gap: 1rem;
  align-items: start;
  padding: 1.3rem;
}

.project-type {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--green);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.35rem 0.55rem;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-button {
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  outline: none;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.repo-card {
  padding: 1rem;
}

.repo-card[hidden] {
  display: none;
}

.repo-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.repo-card h3 {
  font-size: 1.05rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0.85rem;
  max-width: 900px;
}

.timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.2rem 1.1rem 1.35rem;
  box-shadow: 0 10px 26px rgba(20, 32, 48, 0.055);
}

.timeline article::before {
  position: absolute;
  left: 0;
  top: 1rem;
  bottom: 1rem;
  width: 0.28rem;
  content: "";
  background: linear-gradient(180deg, var(--blue), var(--green));
  border-radius: 999px;
}

.timeline time {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  color: var(--blue);
  background: #eef5ff;
  border: 1px solid #d7e7ff;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 32, 48, 0.06);
}

.score-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.score-table th,
.score-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.score-table th {
  color: var(--muted);
  background: #fbfcfe;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.score-table tr:last-child td {
  border-bottom: 0;
}

.achievement-grid,
.fit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.achievement-grid article,
.fit-grid article {
  padding: 1.2rem;
}

.plain-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.fit-grid p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.78;
}

.plain-list li {
  position: relative;
  padding-left: 1rem;
}

.plain-list li::before {
  position: absolute;
  left: 0;
  color: var(--green);
  content: "•";
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem max(1rem, calc((100vw - 1180px) / 2));
  color: #fff;
  background: var(--ink);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #cfe2ff;
  font-weight: 800;
}

@media (max-width: 1060px) {
  .score-grid,
  .repo-strip,
  .repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capability-list,
  .achievement-grid,
  .contest-grid {
    grid-template-columns: 1fr;
  }

  .hero-avatar {
    opacity: 0.18;
    right: 1rem;
    bottom: 2rem;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    overflow-x: hidden;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.5rem;
  }

  .site-nav a {
    padding-right: 0.4rem;
    padding-left: 0.4rem;
    text-align: center;
  }

  .nav-github {
    grid-column: 1 / -1;
  }

  .hero,
  .section,
  .page-hero {
    padding-top: 3rem;
    padding-bottom: 3rem;
    width: 100%;
  }

  .hero-name-row {
    display: block;
  }

  .hero h1 span {
    display: block;
    margin: 0.35rem 0 0;
    font-size: 0.58em;
  }

  .hero .eyebrow,
  .hero-lead {
    max-width: calc(100vw - 2rem);
  }

  .hero .eyebrow {
    white-space: normal;
  }

  .compact-link {
    margin-top: 1rem;
  }

  .hero-content,
  .hero-lead,
  .section-heading,
  .page-hero p {
    max-width: 100%;
    min-width: 0;
  }

  .score-card-head {
    display: block;
  }

  .score-card-head strong {
    display: block;
    margin-top: 0.35rem;
  }

  .score-grid,
  .repo-strip,
  .repo-grid,
  .fit-grid {
    grid-template-columns: 1fr;
  }

  .inline-heading,
  .feature-project,
  .timeline article,
  .site-footer {
    display: block;
  }

  .text-link,
  .filter-group {
    margin-top: 1rem;
  }

  .hero-avatar {
    display: none;
  }

  .education-list li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Personal introduction mode */
.project-link,
.project-content-hidden {
  display: none !important;
}

.eyebrow {
  letter-spacing: 0;
}

body[data-page="home"] {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-strong: #edf2f7;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e3e7;
  --blue: #2563eb;
  --green: #147a66;
  min-height: 100vh;
  background: var(--bg);
}

body[data-page="home"] .site-header {
  background: rgba(247, 249, 251, 0.9);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

body[data-page="home"] .brand {
  font-size: 0.94rem;
  font-weight: 850;
}

body[data-page="home"] .brand-symbol {
  width: 2.05rem;
  height: 2.05rem;
  background: linear-gradient(135deg, #111827, #147a66);
  border-radius: 6px;
}

body[data-page="home"] .site-nav a {
  min-height: 2.15rem;
  border-radius: 6px;
  font-size: 0.92rem;
}

body[data-page="home"] .language-link,
body[data-page="home"] .theme-toggle {
  min-height: 2.15rem;
  padding: 0.52rem 0.78rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 800;
}

body[data-page="home"] .language-link:hover,
body[data-page="home"] .language-link:focus-visible,
body[data-page="home"] .theme-toggle:hover,
body[data-page="home"] .theme-toggle:focus-visible {
  color: #07130f;
  background: #dcefe9;
  border-color: rgba(20, 122, 102, 0.28);
  outline: none;
}

body[data-page="home"] .home-main {
  display: grid;
  min-height: calc(100vh - 4.1rem);
  place-items: center;
  padding: clamp(2rem, 8vw, 6rem) 1rem;
}

body[data-page="home"] .home-shell {
  display: grid;
  place-items: center;
  text-align: center;
}

body[data-page="home"] .hello-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 8vw, 6rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

body[data-page="profile"] {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-strong: #eef4f2;
  --ink: #111827;
  --muted: #5f6b76;
  --line: #d9e3e7;
  --blue: #2563eb;
  --green: #147a66;
  --gold: #9a6a22;
  --shadow: 0 18px 44px rgba(17, 24, 39, 0.08);
  background: linear-gradient(180deg, #fbfcfd 0%, #eef4f5 44%, #f8fafb 100%);
}

body[data-page="profile"] .site-header {
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
  background: rgba(250, 252, 253, 0.9);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

body[data-page="profile"] .brand {
  font-size: 0.94rem;
  font-weight: 850;
}

body[data-page="profile"] .brand-symbol {
  width: 2.05rem;
  height: 2.05rem;
  background: linear-gradient(135deg, #111827, #147a66);
  border-radius: 6px;
}

body[data-page="profile"] .site-nav a {
  min-height: 2.15rem;
  border-radius: 6px;
  font-size: 0.92rem;
}

body[data-page="profile"] .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem;
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: end;
  padding-top: clamp(4rem, 8vw, 6.5rem);
  padding-bottom: clamp(3.25rem, 7vw, 5rem);
  background:
    linear-gradient(90deg, rgba(20, 122, 102, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f6f9fa 100%);
  background-size: 128px 100%, auto;
}

body[data-page="profile"] .hero-content {
  max-width: 820px;
}

body[data-page="profile"] .hero-name-row {
  max-width: none;
  align-items: center;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}

body[data-page="profile"] .hero h1 {
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 850;
  line-height: 1.2;
}

body[data-page="profile"] .hero h1 .name-zh,
body[data-page="profile"] .hero h1 .name-en {
  display: block;
  margin: 0;
}

body[data-page="profile"] .hero h1 .name-zh {
  color: var(--ink);
  font-size: 1em;
}

body[data-page="profile"] .hero h1 .name-en {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.58em;
  font-weight: 750;
}

body[data-page="profile"] .nav-github {
  background: #111827;
  border-radius: 6px;
}

body[data-page="profile"] .compact-link {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

body[data-page="profile"] .hero-avatar {
  position: static;
  justify-self: end;
  width: 7.25rem;
  height: 7.25rem;
  border: 4px solid #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 1;
}

body[data-page="profile"] .education-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
  margin-top: 1.35rem;
}

body[data-page="profile"] .education-list li {
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 1rem;
  background: #fff;
  border-color: #dce6e8;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.045);
}

body[data-page="profile"] .education-list span {
  color: var(--green);
  font-size: 0.8rem;
}

body[data-page="profile"] .education-list strong {
  font-size: 0.98rem;
}

body[data-page="profile"] .section {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding-top: clamp(3.25rem, 6vw, 4.75rem);
  padding-bottom: clamp(3.25rem, 6vw, 4.75rem);
  background: transparent;
  border-bottom: 1px solid var(--line);
}

body[data-page="profile"] .muted-section {
  background: rgba(255, 255, 255, 0.62);
}

body[data-page="profile"] .section-heading {
  margin: 0;
  max-width: none;
}

body[data-page="profile"] .section-heading h2 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.25;
}

body[data-page="profile"] .section-heading .eyebrow {
  margin-bottom: 0.45rem;
}

body[data-page="profile"] .score-grid,
body[data-page="profile"] .contest-grid,
body[data-page="profile"] .timeline,
body[data-page="profile"] .cert-grid {
  grid-column: 2;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cert-card {
  position: relative;
  min-width: 0;
  min-height: 8.2rem;
  padding: 1.2rem;
  background: linear-gradient(180deg, #ffffff, #f9fbfb);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
}

.cert-card::before {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.4rem;
  height: 0.24rem;
  content: "";
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 999px;
}

.cert-type {
  display: block;
  margin-bottom: 1.3rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.cert-card strong {
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.1;
}

body[data-page="profile"] .score-grid {
  gap: 0.85rem;
}

body[data-page="profile"] .score-card,
body[data-page="profile"] .contest-card,
body[data-page="profile"] .timeline article {
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.055);
}

body[data-page="profile"] .score-card {
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff, #f9fbfb);
}

body[data-page="profile"] .score-card-head span,
body[data-page="profile"] .repo-meta,
body[data-page="profile"] .project-type {
  letter-spacing: 0;
  text-transform: none;
}

body[data-page="profile"] .score-value {
  margin-top: 1rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
}

body[data-page="profile"] .progress {
  height: 0.5rem;
  background: #e4ebee;
}

body[data-page="profile"] .contest-grid {
  gap: 1rem;
}

body[data-page="profile"] .contest-card {
  padding: 1.2rem;
  background: #fff;
}

body[data-page="profile"] .contest-card::before {
  width: 0.28rem;
  background: var(--green);
}

body[data-page="profile"] .contest-card:nth-child(2)::before {
  background: var(--blue);
}

body[data-page="profile"] .contest-card:nth-child(3)::before {
  background: var(--gold);
}

body[data-page="profile"] .contest-title span {
  font-size: 1.25rem;
}

body[data-page="profile"] .contest-title strong {
  border-radius: 6px;
  background: #111827;
  font-size: 0.8rem;
}

body[data-page="profile"] .contest-results div {
  grid-template-columns: 3.7rem minmax(0, 1fr);
}

body[data-page="profile"] .contest-note {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: -0.35rem 0 0.8rem;
  padding: 0.28rem 0.5rem;
  color: var(--green);
  background: #edf7f4;
  border: 1px solid #d2ebe3;
  border-radius: 6px;
}

body[data-page="profile"] .timeline {
  max-width: none;
  gap: 0.75rem;
}

body[data-page="profile"] .timeline article {
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
  padding: 1rem 1.1rem 1rem 1.25rem;
  background: #fff;
}

body[data-page="profile"] .timeline article::before {
  top: 0.9rem;
  bottom: 0.9rem;
  width: 0.22rem;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

body[data-page="profile"] .timeline time,
body[data-page="profile"] .timeline-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 0.34rem 0.5rem;
  color: var(--green);
  background: #edf7f4;
  border: 1px solid #d2ebe3;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 850;
}

body[data-page="profile"] .timeline h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

body[data-page="profile"] .site-footer {
  background: #111827;
}

@media (max-width: 980px) {
  body[data-page="profile"] .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="profile"] .hero-avatar {
    display: none;
  }

  body[data-page="profile"] .education-list {
    grid-template-columns: 1fr;
  }

  body[data-page="profile"] .section {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  body[data-page="profile"] .score-grid,
  body[data-page="profile"] .contest-grid,
  body[data-page="profile"] .timeline,
  body[data-page="profile"] .cert-grid {
    grid-column: auto;
  }

  body[data-page="profile"] .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="profile"] .contest-grid,
  body[data-page="profile"] .cert-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body[data-page="profile"] .site-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="profile"] .nav-github {
    grid-column: auto;
  }

  body[data-page="profile"] .hero-name-row {
    display: block;
  }

  body[data-page="profile"] .compact-link {
    width: auto;
  }

  body[data-page="profile"] .score-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="profile"] .timeline article {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
}

/* Compact resume redesign */
body[data-page="profile"] {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-strong: #f1f5f7;
  --ink: #101828;
  --muted: #667085;
  --line: #d7e0e5;
  --blue: #235fd6;
  --green: #087866;
  --gold: #9c6a1d;
  --shadow: none;
  background: var(--bg);
}

body[data-page="profile"] .site-header {
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
  background: rgba(247, 249, 251, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

body[data-page="profile"] .brand {
  gap: 0.55rem;
  font-size: 0.94rem;
}

body[data-page="profile"] .brand-symbol {
  width: 1.95rem;
  height: 1.95rem;
  background: #0f172a;
}

body[data-page="profile"] .site-nav a {
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  border-radius: 5px;
  font-size: 0.9rem;
}

body[data-page="profile"] .language-link {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 850;
}

body[data-page="profile"] .language-link:hover,
body[data-page="profile"] .language-link:focus-visible {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

body[data-page="profile"] .theme-toggle {
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 850;
}

body[data-page="profile"] .theme-toggle:hover,
body[data-page="profile"] .theme-toggle:focus-visible {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  outline: none;
}

body[data-page="home"] .site-header {
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
  background: rgba(247, 249, 251, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

body[data-page="home"] .brand {
  gap: 0.55rem;
  font-size: 0.94rem;
}

body[data-page="home"] .brand-symbol {
  width: 1.95rem;
  height: 1.95rem;
  background: #0f172a;
}

body[data-page="home"] .site-nav a {
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  border-radius: 5px;
  font-size: 0.9rem;
}

body[data-page="home"] .language-link {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 850;
}

body[data-page="home"] .language-link:hover,
body[data-page="home"] .language-link:focus-visible {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

body[data-page="home"] .theme-toggle {
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 850;
}

body[data-page="home"] .theme-toggle:hover,
body[data-page="home"] .theme-toggle:focus-visible {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  outline: none;
}

body[data-page="profile"] main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2.2rem;
}

body[data-page="profile"] .hero,
body[data-page="profile"] .section {
  padding-right: 0;
  padding-left: 0;
}

body[data-page="profile"] .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: 1.25rem;
  align-items: start;
  padding-top: 0.7rem;
  padding-bottom: 1rem;
  background: transparent;
  background-size: auto;
  border-bottom: 1px solid var(--line);
}

body[data-page="profile"] .hero-content {
  max-width: none;
}

body[data-page="profile"] .hero .eyebrow {
  margin-bottom: 0.45rem;
  color: var(--green);
  font-size: 0.76rem;
}

body[data-page="profile"] .hero-name-row {
  display: flex;
  max-width: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0;
  border-bottom: 0;
}

body[data-page="profile"] .hero h1 {
  font-size: clamp(1.28rem, 2vw, 1.65rem);
}

body[data-page="profile"] .hero h1 .name-en {
  margin-top: 0.12rem;
  font-size: 0.58em;
}

body[data-page="profile"] .compact-link {
  min-height: 2rem;
  padding: 0.44rem 0.72rem;
  color: #fff;
  background: #0f172a;
  border: 0;
}

body[data-page="profile"] .hero-avatar {
  width: 5.25rem;
  height: 5.25rem;
  border-width: 3px;
  border-radius: 10px;
}

body[data-page="profile"] .education-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: start;
  margin-top: 0;
}

body[data-page="profile"] .education-list li {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0.78rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 7px;
  box-shadow: none;
}

body[data-page="profile"] .edu-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
}

body[data-page="profile"] .has-edu-lab .edu-label {
  max-width: calc(48% - 0.25rem);
}

body[data-page="profile"] .edu-school {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
}

body[data-page="profile"] .edu-detail {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.4;
}

body[data-page="profile"] .edu-lab {
  position: absolute;
  top: 0.72rem;
  right: 0.75rem;
  max-width: 52%;
  padding: 0.18rem 0.48rem;
  color: var(--green);
  background: rgba(8, 120, 102, 0.08);
  border: 1px solid rgba(8, 120, 102, 0.18);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="profile"] .section {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

body[data-page="profile"] .muted-section {
  background: transparent;
}

body[data-page="profile"] .section-heading {
  margin: 0;
  padding-top: 0.1rem;
}

body[data-page="profile"] .section-heading .eyebrow {
  margin: 0 0 0.34rem;
  color: #536173;
  font-size: 0.72rem;
}

body[data-page="profile"] .section-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

body[data-page="profile"] .score-grid,
body[data-page="profile"] .contest-grid,
body[data-page="profile"] .timeline,
body[data-page="profile"] .cert-grid {
  grid-column: 2;
}

body[data-page="profile"] .cert-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

body[data-page="profile"] .cert-card {
  min-height: 0;
  padding: 0.82rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 7px;
  box-shadow: none;
}

body[data-page="profile"] .cert-card::before {
  display: none;
}

body[data-page="profile"] .cert-type {
  margin-bottom: 0.38rem;
  font-size: 0.78rem;
  font-weight: 850;
}

body[data-page="profile"] .cert-card strong {
  display: block;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.3;
}

body[data-page="profile"] .score-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

body[data-page="profile"] .score-card {
  padding: 0.82rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: none;
}

body[data-page="profile"] .score-card::before {
  display: none;
}

body[data-page="profile"] .score-card-head {
  display: grid;
  gap: 0.25rem;
}

body[data-page="profile"] .score-card-head span {
  display: block;
  padding-left: 0;
  color: #536173;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.3;
}

body[data-page="profile"] .score-card-head span::before {
  display: none;
}

body[data-page="profile"] .score-card-head strong {
  color: var(--green);
  font-size: 0.86rem;
  white-space: nowrap;
}

body[data-page="profile"] .score-value {
  margin: 0.62rem 0 0.58rem;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
}

body[data-page="profile"] .progress {
  height: 0.34rem;
}

body[data-page="profile"] .contest-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

body[data-page="profile"] .contest-card {
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: 7px;
  box-shadow: none;
}

body[data-page="profile"] .contest-card::before {
  display: none;
}

body[data-page="profile"] .contest-card:nth-child(2) {
  border-top-color: var(--blue);
}

body[data-page="profile"] .contest-card:nth-child(3) {
  border-top-color: var(--gold);
}

body[data-page="profile"] .contest-title {
  margin-bottom: 0.58rem;
}

body[data-page="profile"] .contest-title span {
  font-size: 1.1rem;
}

body[data-page="profile"] .contest-title strong {
  padding: 0.24rem 0.46rem;
  border-radius: 5px;
  font-size: 0.76rem;
}

body[data-page="profile"] .contest-note {
  margin: -0.18rem 0 0.55rem;
  padding: 0.2rem 0.42rem;
  border-radius: 5px;
  font-size: 0.78rem;
}

body[data-page="profile"] .contest-title .contest-note {
  margin: 0;
}

body[data-page="profile"] .contest-results {
  gap: 0;
}

body[data-page="profile"] .contest-results div {
  grid-template-columns: 3.35rem minmax(0, 1fr);
  gap: 0.55rem;
  padding-top: 0.46rem;
  padding-bottom: 0.46rem;
}

body[data-page="profile"] .contest-results dt,
body[data-page="profile"] .contest-results dd {
  font-size: 0.9rem;
}

body[data-page="profile"] .timeline {
  gap: 0;
  border-top: 1px solid var(--line);
}

body[data-page="profile"] .timeline article {
  display: grid;
  grid-template-columns: minmax(132px, 172px) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 0.78rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

body[data-page="profile"] .timeline article::before {
  display: none;
}

body[data-page="profile"] .timeline time,
body[data-page="profile"] .timeline-label {
  padding: 0;
  color: #536173;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

body[data-page="profile"] .experience-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 0.3rem 0.8rem;
  min-width: 0;
}

body[data-page="profile"] .experience-org {
  grid-column: 1;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}

body[data-page="profile"] .experience-role {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  margin: 0;
  padding: 0.22rem 0.5rem;
  color: var(--green);
  background: #edf7f4;
  border: 1px solid #cfe8e1;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
}

body[data-page="profile"] .experience-role-list {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-self: end;
  justify-content: flex-end;
}

body[data-page="profile"] .experience-role-list .experience-role {
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
}

body[data-page="profile"] .experience-team {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

body[data-page="profile"] .site-footer {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

@media (max-width: 980px) {
  body[data-page="profile"] main {
    padding-top: 1rem;
  }

  body[data-page="profile"] .hero {
    grid-template-columns: 1fr;
  }

  body[data-page="profile"] .hero-avatar {
    display: none;
  }

  body[data-page="profile"] .education-list,
  body[data-page="profile"] .cert-grid,
  body[data-page="profile"] .contest-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="profile"] .section {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  body[data-page="profile"] .score-grid,
  body[data-page="profile"] .contest-grid,
  body[data-page="profile"] .timeline,
  body[data-page="profile"] .cert-grid {
    grid-column: auto;
  }

  body[data-page="profile"] .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body[data-page="profile"] main {
    padding-top: 0.75rem;
  }

  body[data-page="profile"] .hero-name-row {
    display: grid;
    gap: 0.65rem;
  }

  body[data-page="profile"] .compact-link {
    width: max-content;
  }

  body[data-page="profile"] .score-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="profile"] .timeline article,
  body[data-page="profile"] .experience-body {
    grid-template-columns: 1fr;
  }

  body[data-page="profile"] .experience-role {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    white-space: normal;
  }

  body[data-page="profile"] .experience-role-list {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    justify-content: flex-start;
  }
}

/* Profile photo */
body[data-page="profile"] .hero {
  display: block;
}

body[data-page="profile"] .hero-avatar {
  display: block;
  width: 6.25rem;
  height: 6.25rem;
  min-height: 0;
  object-fit: cover;
  object-position: center 70%;
  border: 1px solid var(--line);
  border-radius: 10px;
}

body[data-page="profile"] .hero-content {
  display: block;
}

body[data-page="profile"] .hero-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

body[data-page="profile"] .education-list {
  width: 100%;
}

@media (max-width: 980px) {
  body[data-page="profile"] .hero {
    display: block;
  }

  body[data-page="profile"] .hero-avatar {
    display: block;
    width: 5.75rem;
    height: 5.75rem;
    max-height: none;
  }
}

@media (max-width: 640px) {
  body[data-page="profile"] .hero {
    display: block;
  }

  body[data-page="profile"] .hero-avatar {
    width: 5rem;
    height: 5rem;
  }
}

/* Keep language switching in the top-right area */
@media (max-width: 760px) {
  body[data-page="home"] .site-header,
  body[data-page="profile"] .site-header {
    align-items: center;
    flex-direction: row;
  }

  body[data-page="home"] .site-nav,
  body[data-page="profile"] .site-nav {
    display: flex;
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-left: auto;
  }

  body[data-page="home"] .site-nav a,
  body[data-page="home"] .theme-toggle,
  body[data-page="profile"] .site-nav a,
  body[data-page="profile"] .theme-toggle {
    padding-right: 0.58rem;
    padding-left: 0.58rem;
    white-space: nowrap;
  }

  body[data-page="home"] .nav-github,
  body[data-page="home"] .language-link,
  body[data-page="home"] .theme-toggle,
  body[data-page="profile"] .nav-github,
  body[data-page="profile"] .language-link,
  body[data-page="profile"] .theme-toggle {
    grid-column: auto;
  }
}

@media (max-width: 460px) {
  body[data-page="home"] .brand span:not(.brand-symbol) {
    display: none;
  }

  body[data-page="home"] .site-nav a,
  body[data-page="home"] .theme-toggle {
    padding-right: 0.48rem;
    padding-left: 0.48rem;
    font-size: 0.82rem;
  }

  body[data-page="profile"] .brand span:not(.brand-symbol) {
    display: none;
  }

  body[data-page="profile"] .site-nav a,
  body[data-page="profile"] .theme-toggle {
    padding-right: 0.48rem;
    padding-left: 0.48rem;
    font-size: 0.82rem;
  }
}

/* Dark mode */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  color: #e5edf5;
  background: #0d1117;
}

html[data-theme="dark"] body[data-page="home"] {
  --bg: #0d1117;
  --surface: #151b23;
  --surface-strong: #1b2430;
  --ink: #e6edf3;
  --muted: #9aa7b4;
  --line: #2b3745;
  --blue: #65a4ff;
  --green: #4fc3a1;
  background: var(--bg);
}

html[data-theme="dark"] body[data-page="home"] .site-header {
  background: rgba(13, 17, 23, 0.93);
  border-color: var(--line);
}

html[data-theme="dark"] body[data-page="home"] .brand-symbol,
html[data-theme="dark"] body[data-page="home"] .nav-github {
  color: #f6f8fa;
  background: #05070a;
}

html[data-theme="dark"] body[data-page="home"] .site-nav a {
  color: var(--muted);
}

html[data-theme="dark"] body[data-page="home"] .site-nav a:hover,
html[data-theme="dark"] body[data-page="home"] .site-nav a:focus-visible,
html[data-theme="dark"] body[data-page="home"] .site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-strong);
}

html[data-theme="dark"] body[data-page="home"] .language-link,
html[data-theme="dark"] body[data-page="home"] .theme-toggle {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="dark"] body[data-page="home"] .language-link:hover,
html[data-theme="dark"] body[data-page="home"] .language-link:focus-visible,
html[data-theme="dark"] body[data-page="home"] .theme-toggle:hover,
html[data-theme="dark"] body[data-page="home"] .theme-toggle:focus-visible {
  color: #07130f;
  background: var(--green);
  border-color: var(--green);
}

html[data-theme="dark"] .back-to-top {
  color: var(--ink);
  background: var(--surface-strong);
  border-color: var(--line);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .back-to-top:hover,
html[data-theme="dark"] .back-to-top:focus-visible {
  color: #07130f;
  background: var(--green);
  border-color: var(--green);
}

html[data-theme="dark"] body[data-page="profile"] {
  --bg: #0d1117;
  --surface: #151b23;
  --surface-strong: #1b2430;
  --ink: #e6edf3;
  --muted: #9aa7b4;
  --line: #2b3745;
  --blue: #65a4ff;
  --green: #4fc3a1;
  --gold: #d7a34d;
  --shadow: none;
  background: #0d1117;
}

html[data-theme="dark"] body[data-page="profile"] .site-header {
  background: rgba(13, 17, 23, 0.93);
  border-color: var(--line);
}

html[data-theme="dark"] body[data-page="profile"] .brand-symbol,
html[data-theme="dark"] body[data-page="profile"] .nav-github,
html[data-theme="dark"] body[data-page="profile"] .site-footer {
  color: #f6f8fa;
  background: #05070a;
}

html[data-theme="dark"] body[data-page="profile"] .site-nav a {
  color: var(--muted);
}

html[data-theme="dark"] body[data-page="profile"] .site-nav a:hover,
html[data-theme="dark"] body[data-page="profile"] .site-nav a:focus-visible,
html[data-theme="dark"] body[data-page="profile"] .site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-strong);
}

html[data-theme="dark"] body[data-page="profile"] .language-link,
html[data-theme="dark"] body[data-page="profile"] .theme-toggle {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="dark"] body[data-page="profile"] .language-link:hover,
html[data-theme="dark"] body[data-page="profile"] .language-link:focus-visible {
  color: #07130f;
  background: var(--green);
  border-color: var(--green);
}

html[data-theme="dark"] body[data-page="profile"] .theme-toggle:hover,
html[data-theme="dark"] body[data-page="profile"] .theme-toggle:focus-visible {
  color: #07111f;
  background: var(--blue);
  border-color: var(--blue);
}

html[data-theme="dark"] body[data-page="profile"] .hero,
html[data-theme="dark"] body[data-page="profile"] .section {
  border-color: var(--line);
}

html[data-theme="dark"] body[data-page="profile"] .hero-avatar,
html[data-theme="dark"] body[data-page="profile"] .education-list li,
html[data-theme="dark"] body[data-page="profile"] .cert-card,
html[data-theme="dark"] body[data-page="profile"] .score-card,
html[data-theme="dark"] body[data-page="profile"] .contest-card {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="dark"] body[data-page="profile"] .hero h1 .name-en,
html[data-theme="dark"] body[data-page="profile"] .edu-detail,
html[data-theme="dark"] body[data-page="profile"] .cert-type,
html[data-theme="dark"] body[data-page="profile"] .score-card-head span,
html[data-theme="dark"] body[data-page="profile"] .contest-results dd,
html[data-theme="dark"] body[data-page="profile"] .timeline time,
html[data-theme="dark"] body[data-page="profile"] .timeline-label,
html[data-theme="dark"] body[data-page="profile"] .experience-team {
  color: var(--muted);
}

html[data-theme="dark"] body[data-page="profile"] .edu-label,
html[data-theme="dark"] body[data-page="profile"] .education-list span,
html[data-theme="dark"] body[data-page="profile"] .score-card-head strong,
html[data-theme="dark"] body[data-page="profile"] .contest-note,
html[data-theme="dark"] body[data-page="profile"] .experience-role {
  color: var(--green);
}

html[data-theme="dark"] body[data-page="profile"] .experience-role,
html[data-theme="dark"] body[data-page="profile"] .contest-note {
  background: rgba(79, 195, 161, 0.12);
  border-color: rgba(79, 195, 161, 0.28);
}

html[data-theme="dark"] body[data-page="profile"] .progress {
  background: #26313d;
}

html[data-theme="dark"] body[data-page="profile"] .progress span {
  background: linear-gradient(90deg, var(--blue), var(--green));
}

html[data-theme="dark"] body[data-page="profile"] .timeline,
html[data-theme="dark"] body[data-page="profile"] .timeline article,
html[data-theme="dark"] body[data-page="profile"] .contest-results div {
  border-color: var(--line);
}

html[data-theme="dark"] body[data-page="profile"] .edu-lab {
  color: var(--green);
  background: rgba(79, 195, 161, 0.1);
  border-color: rgba(79, 195, 161, 0.22);
}

html[data-theme="dark"] body[data-page="projects"] {
  color: #e5edf5;
  background: #0d1117;
}
