:root {
  --paper: #fff;
  --ink: #171717;
  --secondary: #5f5f5f;
  --faint: #858585;
  --rule: #d9d9d9;
  --soft-rule: #ececec;
  --link: #173f66;
  --max-width: 900px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

button, input, textarea { font: inherit; }
a { color: inherit; text-underline-offset: 3px; }

.page {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.name-link {
  font-family: var(--serif);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.controls {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--secondary);
  font-size: 13px;
}

.controls button {
  border: 0;
  background: none;
  padding: 3px 0;
  color: inherit;
  cursor: pointer;
}

.lang.is-active { color: var(--ink); font-weight: 700; }
.slash { color: #aaa; }
.print { margin-left: 13px; border-bottom: 1px solid #bdbdbd !important; }
.controls button:hover { color: var(--ink); }

.intro {
  padding: 58px 0 42px;
  border-bottom: 1px solid var(--rule);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.45rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.profile-block {
  max-width: 760px;
  margin-top: 24px;
}

.bio {
  margin: 0;
  color: #333;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.75;
}

.inline-link,
.item-title a,
.contact-value {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-decoration-color: #a9b8c6;
}
.inline-link:hover,
.item-title a:hover,
.contact-value:hover { text-decoration-color: currentColor; }

.interest-line {
  margin: 17px 0 0;
  font-family: var(--serif);
  font-size: 1rem;
}
.interest-line strong { margin-right: 5px; }

.contacts {
  margin-top: 14px;
  color: var(--secondary);
  font-size: 14px;
}
.contact-row { margin: 2px 0; }
.contact-label {
  display: inline-block;
  min-width: 62px;
  color: var(--ink);
  font-weight: 700;
}
.contact-value { margin-left: 5px; }

.cv-section {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 34px;
  padding: 39px 0 42px;
  border-bottom: 1px solid var(--soft-rule);
}
.cv-section:last-child { border-bottom: 0; }

.section-heading {
  margin: 2px 0 0;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.105em;
}
.section-body { min-width: 0; }

.education-item,
.paper,
.project { padding: 0 0 28px; }
.education-item:last-child,
.paper:last-child,
.project:last-child { padding-bottom: 0; }

.row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
}

.item-title,
.paper-title,
.project-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.13rem;
  line-height: 1.42;
  font-weight: 700;
}
.item-title a { text-decoration: none; }
.item-title a:hover { text-decoration: underline; }

.item-date,
.award-date {
  color: var(--faint);
  white-space: nowrap;
  font-size: 13.5px;
}
.item-subtitle,
.paper-meta,
.project-meta {
  margin: 4px 0 0;
  color: var(--secondary);
  font-size: 14px;
}

.paper-label,
.project-label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.authors {
  margin: 9px 0 0;
  color: #3f3f3f;
  font-family: var(--serif);
  font-size: 0.99rem;
}
.authors strong { color: var(--ink); }

.paper-note,
.project-status {
  margin: 7px 0 0;
  color: var(--secondary);
  font-size: 13.5px;
  font-style: italic;
}

.abstract {
  margin: 14px 0 0;
  color: #353535;
}
.abstract-label,
.keywords-label { font-weight: 700; }
.keywords {
  margin: 9px 0 0;
  color: var(--secondary);
  font-size: 14px;
}
.paper-description,
.project-description {
  margin: 11px 0 0;
  color: #353535;
}

.award-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  padding: 0 0 17px;
}
.award-title {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.45;
}
.award-name {
  margin-top: 2px;
  color: var(--secondary);
  font-size: 13.5px;
}
.award-details {
  margin-top: 0;
  border-top: 1px solid var(--soft-rule);
  padding-top: 12px;
}
.award-summary {
  width: fit-content;
  cursor: pointer;
  color: var(--secondary);
  font-size: 13px;
  user-select: none;
}
.award-summary:hover { color: var(--ink); }
.award-hidden { padding-top: 18px; }

.credentials { display: grid; gap: 12px; }
.credential-row { color: #353535; }
.credential-label { margin-right: 6px; }
.credential-text { color: var(--secondary); }

.footer {
  padding: 20px 0 34px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 12px;
}

@media (max-width: 700px) {
  .page { width: min(calc(100% - 28px), var(--max-width)); }
  .intro { padding: 42px 0 34px; }
  .profile-block { margin-top: 20px; }
  .cv-section {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 31px 0 34px;
  }
  .section-heading { margin: 0; }
  .row-head,
  .award-row { grid-template-columns: 1fr; gap: 2px; }
  .item-date,
  .award-date { grid-row: 1; }
  .print { display: none; }
  .contact-label { min-width: 58px; }
}

@media print {
  @page { size: A4; margin: 14mm 16mm; }
  body { font-size: 10.2pt; line-height: 1.48; color: #000; }
  .topbar, .footer { display: none !important; }
  .page { width: 100%; max-width: none; }
  .intro { padding: 0 0 12pt; }
  h1 { font-size: 28pt; }
  .profile-block { margin-top: 10pt; max-width: none; }
  .bio { font-size: 10.2pt; line-height: 1.5; }
  .interest-line { margin-top: 7pt; }
  .contacts { margin-top: 6pt; }
  .cv-section {
    grid-template-columns: 105pt 1fr;
    gap: 18pt;
    padding: 13pt 0 14pt;
  }
  .education-item, .paper, .project, .award-row { break-inside: avoid; }
  .paper { padding-bottom: 12pt; }
  .abstract { margin-top: 7pt; }
  .keywords { margin-top: 5pt; }
  .award-details { border-top: 0; padding-top: 0; }
  .award-summary { display: none; }
  .award-details:not([open]) > .award-hidden { display: block; padding-top: 0; }
}
