:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #57606a;
  --line: #d8dee4;
  --link: #0969da;
  --link-hover: #0550ae;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.7;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.page-shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.site-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: start;
}

.hero-copy {
  min-width: 0;
}

.hero-photo {
  width: 220px;
}

.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.98rem;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.lang-button {
  padding: 6px 12px;
  border: 0;
  background: #fff;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.lang-button + .lang-button {
  border-left: 1px solid var(--line);
}

.lang-button.is-active {
  background: #f6f8fa;
  color: var(--text);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: #111827;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

/* default (English page): 拼音为主，中文为浅灰 */
h1 .name-en {
  color: #111827;
  font-size: 1em;
  order: 1;
}

h1 .name-zh {
  color: #9aa4af;
  font-size: 0.72em;
  order: 2;
}

/* 中文页面：中文为主、在前，拼音为浅灰、在后 */
html[lang="zh-CN"] h1 .name-zh {
  color: #111827;
  font-size: 1em;
  order: 1;
}

html[lang="zh-CN"] h1 .name-en {
  color: #b8c0c9;
  font-size: 0.72em;
  order: 2;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.intro {
  margin: 14px 0 0;
  font-size: 1rem;
}

.icon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.icon-link:hover {
  color: var(--link-hover);
  border-color: #b6c2cf;
  background: #f6f8fa;
  text-decoration: none;
}

.icon-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.icon-link__label {
  white-space: nowrap;
}

.wechat-dialog {
  width: min(360px, calc(100% - 32px));
  padding: 0;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(31, 35, 40, 0.22);
}

.wechat-dialog::backdrop {
  background: rgba(31, 35, 40, 0.42);
}

.wechat-dialog__body {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.wechat-dialog__body h2 {
  margin-bottom: 0;
}

.wechat-dialog__body p {
  color: var(--muted);
  font-size: 0.95rem;
}

.wechat-dialog__body img {
  display: block;
  width: min(260px, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wechat-dialog__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.wechat-dialog__close:hover {
  color: var(--text);
  background: #f6f8fa;
}

.wechat-dialog__close svg {
  width: 18px;
  height: 18px;
}

.wechat-id {
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-block {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.section-block:last-child {
  border-bottom: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0;
}

.news-list,
.tag-list {
  margin: 0;
  padding-left: 20px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-left: 0;
  list-style: none;
}

.news-list li,
.tag-list li {
  margin: 10px 0;
}

.tag-list li {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 5px 12px;
  color: #24292f;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06);
  transition: color 160ms ease, background-color 160ms ease,
    border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tag-list li:hover {
  color: var(--link-hover);
  background: #eef6ff;
  border-color: #0969da;
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.12);
  transform: translateY(-1px);
}

.item-date {
  display: inline-block;
  min-width: 96px;
  white-space: nowrap;
  color: var(--muted);
}

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

.entry-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
}

.publication-list {
  display: grid;
  gap: 20px;
}

.publication-item p {
  margin-top: 8px;
}

.publication-meta {
  color: var(--muted);
}

.callout {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #f6f8fa;
  border-left: 3px solid var(--link);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.96rem;
}

.entry-item--inline {
  display: block;
}

.entry-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.entry-head .item-date {
  flex: 0 0 130px;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.88rem;
}

.entry-head h3 {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 24px, 860px);
    padding-top: 20px;
  }

  .hero-layout,
  .header-row,
  .entry-item {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-photo {
    width: min(220px, 100%);
  }

  .item-date {
    min-width: 0;
    margin-bottom: 4px;
  }

  .entry-head .item-date {
    flex-basis: 100%;
    margin-bottom: 2px;
  }
}
