:root {
  color-scheme: light;
  --theme: #fafafa;
  --entry: #fff;
  --content: #1f2328;
  --job-title: #4a5561;
  --secondary: #59636e;
  --tertiary: #d5d9de;
  --accent: #2f67d8;
  --accent-soft: #eef4ff;
  --surface: #f3f5f7;
  --code-bg: #f4f4f5;
  --shadow: 0 10px 30px rgba(15,23,42,0.08);
  --radius: 18px;
  --header-height: 72px;
}
html[data-theme='dark'] {
  color-scheme: dark;
  --theme: #0f1115;
  --entry: #161b22;
  --content: #edf2f7;
  --job-title: #d4dde7;
  --secondary: #a7b0ba;
  --tertiary: #28303a;
  --accent: #77a8ff;
  --accent-soft: rgba(119,168,255,0.12);
  --surface: #0b0d11;
  --code-bg: #1d232c;
  --shadow: 0 12px 36px rgba(0,0,0,0.32);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--theme);
  color: var(--content);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  transition: background-color 0.25s ease, color 0.25s ease;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
img {
  max-width: 100%;
  display: block;
}
.site-shell {
  min-height: 100vh;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(18px);
  background: rgba(250,250,250,0.84);
  border-bottom: 1px solid var(--tertiary);
}
.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  min-height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--content);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}
.nav-link {
  color: var(--secondary);
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--content);
  border-color: var(--accent);
}
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: var(--entry);
  color: var(--content);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.theme-icon {
  position: absolute;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
html[data-theme='light'] .theme-icon-light,
html[data-theme='dark'] .theme-icon-dark {
  opacity: 1;
  transform: scale(1);
}
html[data-theme='dark'] .site-header {
  background: rgba(15,17,21,0.88);
}
.main-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}
.profile-mode {
  margin-bottom: 48px;
}
.profile-card {
  background: linear-gradient(180deg, var(--entry), var(--surface));
  border: 1px solid var(--tertiary);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 34px 40px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  align-items: center;
  gap: 34px;
  text-align: left;
}
.profile-avatar {
  width: 176px;
  height: 176px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--entry);
  box-shadow: 0 12px 32px rgba(47,103,216,0.18);
  justify-self: start;
}
.profile-main {
  min-width: 0;
  padding-left: 4px;
}
.profile-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  line-height: 1.18;
}
.name-latin {
  font-weight: 650;
  letter-spacing: -0.03em;
}
.name-cjk {
  color: var(--secondary);
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: 0;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", serif;
}
.name-cjk-item {
  font-family: inherit;
}
.profile-subtitle {
  margin: 10px 0 0;
  color: var(--secondary);
  font-size: 1rem;
}
.profile-note {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--secondary);
  font-size: 0.98rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--tertiary);
  font-weight: 600;
}
.button.primary {
  background: var(--content);
  color: var(--theme);
}
.button.secondary {
  background: var(--entry);
  color: var(--content);
}
.button-muted {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(47,103,216,0.16);
  box-shadow: none;
}
.button-muted:hover {
  background: rgba(47,103,216,0.16);
  color: var(--accent);
}
html[data-theme='dark'] .button-muted {
  border-color: rgba(119,168,255,0.18);
}
.contact-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.contact-link {
  color: var(--secondary);
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.7;
  letter-spacing: 0.015em;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}
.contact-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.social-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.social-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--tertiary);
  background: var(--entry);
  color: var(--content);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.social-link.is-disabled {
  color: var(--secondary);
  opacity: 0.55;
  cursor: not-allowed;
}
.social-link:hover,
.button:hover,
.section-pill:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.social-link.is-disabled:hover {
  background: var(--entry);
  color: var(--secondary);
}
.social-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--tertiary);
  background: var(--entry);
  color: var(--content);
  font-size: 0.92rem;
  font-weight: 500;
}
.social-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.social-button i {
  font-size: 0.92rem;
}
.section-pills {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.section-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--tertiary);
  background: var(--entry);
  color: var(--secondary);
  font-size: 0.95rem;
}
.section-pill.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.article-entry {
  background: var(--entry);
  border: 1px solid var(--tertiary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
}
.list-page {
  max-width: 860px;
  margin: 0 auto;
}
.list-header {
  margin-bottom: 24px;
}
.list-description {
  margin: 10px 0 0;
  color: var(--secondary);
  font-size: 1rem;
}
.post-list {
  display: grid;
  gap: 18px;
}
.post-card {
  background: var(--entry);
  border: 1px solid var(--tertiary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
}
.post-meta {
  color: var(--secondary);
  font-size: 0.9rem;
}
.post-card-title {
  margin: 10px 0 10px;
  font-size: 1.35rem;
  line-height: 1.3;
}
.post-card-title a {
  color: var(--content);
  border-bottom: none;
}
.post-card-title a:hover {
  color: var(--accent);
}
.post-card-excerpt {
  margin: 0 0 14px;
  color: var(--secondary);
  font-size: 0.98rem;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.post-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
}
.empty-state {
  background: var(--entry);
  border: 1px solid var(--tertiary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}
.empty-state p {
  margin: 12px 0 0;
  color: var(--secondary);
}
.single-entry {
  max-width: 860px;
  margin: 0 auto;
}
.entry-actions {
  margin-bottom: 24px;
}
.entry-title {
  margin: 0 0 24px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
}
.inline-link {
  color: var(--secondary);
}
.inline-link:hover {
  color: var(--accent);
}
.article-entry h1,
.article-entry h2,
.article-entry h3,
.article-entry h4 {
  color: var(--content);
  line-height: 1.25;
}
.article-entry h2 {
  margin: 44px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tertiary);
  font-size: 1.7rem;
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.article-entry h2:first-child {
  margin-top: 0;
}
.article-entry h3 {
  margin: 28px 0 12px;
  font-size: 1.25rem;
}
.article-entry p,
.article-entry li {
  color: var(--content);
  font-size: 1rem;
}
.article-entry p {
  margin: 0 0 16px;
}
.article-entry .research-question {
  margin-top: 28px;
  margin-bottom: 18px;
}
.article-entry ul,
.article-entry ol {
  margin: 0 0 20px;
  padding-left: 22px;
}
.article-entry li + li {
  margin-top: 8px;
}
.article-entry strong {
  font-weight: 700;
}
.article-entry .job-title {
  font-weight: 700;
  color: var(--job-title);
}
.article-entry .paper-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 600;
  line-height: 1.35;
  vertical-align: middle;
}
.article-entry .paper-badge-oral {
  color: #b42318;
  background: #fee4e2;
}
html[data-theme='dark'] .article-entry .paper-badge-oral {
  color: #ffb4ab;
  background: rgba(255,120,120,0.16);
}
.article-entry a {
  color: var(--accent);
  border-bottom: 1px solid rgba(47,103,216,0.35);
}
.article-entry a:hover {
  border-color: var(--accent);
}
.article-entry .headerlink {
  display: none;
}
.article-entry sup {
  font-size: 0.72em;
}
.article-entry code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--code-bg);
  color: var(--content);
  padding: 0.2em 0.45em;
  border-radius: 6px;
}
.article-entry mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}
.article-entry mjx-container[jax='CHTML'][display='true'] {
  margin: 1.3rem 0;
}
.article-entry blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 12px 12px 0;
}
.article-entry font[color='red'] {
  color: #cf222e;
}
html[data-theme='dark'] .article-entry a {
  border-bottom-color: rgba(119,168,255,0.4);
}
.site-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 32px;
}
.footer-copy {
  margin: 0;
  text-align: center;
  color: var(--secondary);
  font-size: 0.92rem;
}
@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 16px;
    flex-direction: column;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}
@media (max-width: 700px) {
  .main-content {
    padding: 32px 16px 56px;
  }
  .profile-card {
    padding: 28px 20px;
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  .article-entry {
    padding: 24px 20px;
  }
  .post-card {
    padding: 20px;
  }
  .site-nav {
    gap: 10px;
  }
  .nav-link {
    font-size: 0.9rem;
  }
  .profile-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto;
  }
  .contact-list {
    align-items: center;
  }
  .contact-link {
    font-size: 0.9rem;
  }
  .social-actions {
    justify-content: center;
  }
}
@media (max-width: 560px) {
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav {
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
  }
  .theme-toggle {
    align-self: flex-end;
  }
  .profile-actions {
    flex-direction: column;
  }
  .button {
    width: 100%;
  }
  .social-button {
    min-height: 36px;
    font-size: 0.88rem;
  }
}
