:root {
  --xuan-card-bg: rgba(255, 255, 255, 0.88);
  --xuan-border: rgba(70, 101, 116, 0.16);
  --xuan-text: #263238;
  --xuan-muted: #66777f;
  --xuan-main: #3d7c98;
  --xuan-accent: #d97745;
  --xuan-paper: #f6fafb;
  --xuan-soft: rgba(61, 124, 152, 0.08);
  --xuan-shadow: 0 16px 42px rgba(40, 67, 80, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--xuan-text);
  background-size: cover;
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(246, 250, 251, 0.72), rgba(238, 245, 247, 0.92)),
    linear-gradient(135deg, rgba(217, 119, 69, 0.08), rgba(61, 124, 152, 0.1));
}

::selection {
  color: #fff;
  background: var(--xuan-main);
}

#page-header:not(.not-top-img)::before {
  background: linear-gradient(180deg, rgba(18, 28, 34, 0.26), rgba(18, 28, 34, 0.62));
}

#page-header #site-title {
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  font-weight: 800;
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
}

#page-header #site-subtitle {
  margin-top: 1rem;
  font-size: clamp(1rem, 2vw, 1.35rem);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

#nav {
  letter-spacing: 0;
}

#nav .menus_items .menus_item .menus_item_child,
#nav .site-page:not(.child) {
  border-radius: 8px;
}

#nav .site-page {
  transition: color 0.2s ease, background 0.2s ease;
}

#nav .site-page:hover {
  color: var(--xuan-main);
  background: rgba(255, 255, 255, 0.16);
}

#page-header.nav-fixed #nav,
#page-header.fixed #nav {
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 30px rgba(31, 52, 63, 0.1);
  backdrop-filter: blur(14px);
}

.layout {
  max-width: 1180px;
  gap: 1.25rem;
}

.layout > div:first-child:not(.nc),
#recent-posts .recent-post-item,
#aside-content .card-widget,
.layout .pagination > *:not(.space) {
  border: 1px solid var(--xuan-border);
  border-radius: 8px;
  background: var(--xuan-card-bg);
  box-shadow: var(--xuan-shadow);
  backdrop-filter: blur(16px);
}

#recent-posts {
  display: grid;
  gap: 1.1rem;
}

#recent-posts .recent-post-items {
  display: grid;
  gap: 1rem;
}

.xuan-academic-home {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.xuan-home-profile,
.xuan-home-group {
  border: 1px solid var(--xuan-border);
  border-radius: 8px;
  background: var(--xuan-card-bg);
  box-shadow: var(--xuan-shadow);
  backdrop-filter: blur(16px);
}

.xuan-home-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.35rem;
}

.xuan-home-avatar {
  width: 5.25rem;
  height: 5.25rem;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 14px 30px rgba(40, 67, 80, 0.18);
}

.xuan-home-kicker {
  display: inline-flex;
  margin-bottom: 0.42rem;
  border-radius: 8px;
  padding: 0.24rem 0.5rem;
  color: var(--xuan-main);
  background: var(--xuan-soft);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.xuan-home-title {
  margin: 0;
  color: var(--xuan-text);
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 820;
  line-height: 1.08;
}

.xuan-home-intro {
  margin: 0.5rem 0 0;
  color: var(--xuan-muted);
  line-height: 1.72;
}

.xuan-home-intro.en {
  color: var(--xuan-text);
  font-size: 1.02rem;
}

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

.xuan-home-group {
  padding: 1rem;
}

.xuan-home-group h3 {
  margin: 0 0 0.75rem;
  color: var(--xuan-text);
  font-size: 0.95rem;
  font-weight: 820;
  line-height: 1.2;
}

.xuan-home-grid {
  display: grid;
  gap: 0.65rem;
}

.xuan-home-entry {
  display: grid;
  gap: 0.4rem;
  min-height: 8.4rem;
  border: 1px solid rgba(61, 124, 152, 0.14);
  border-radius: 8px;
  padding: 0.82rem;
  color: var(--xuan-text);
  background: rgba(255, 255, 255, 0.48);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

a.xuan-home-entry:hover {
  border-color: rgba(61, 124, 152, 0.34);
  color: var(--xuan-text);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.xuan-home-entry.is-placeholder {
  border-style: dashed;
  color: var(--xuan-muted);
  background: rgba(61, 124, 152, 0.05);
}

.xuan-home-entry-type {
  color: var(--xuan-main);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
}

.xuan-home-entry-title {
  min-width: 0;
  color: var(--xuan-text);
  font-size: 1rem;
  line-height: 1.35;
}

.xuan-home-entry-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--xuan-muted);
  font-size: 0.86rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.xuan-home-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  color: var(--xuan-muted);
  font-size: 0.76rem;
}

.xuan-home-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.xuan-home-tags span {
  border-radius: 8px;
  padding: 0.16rem 0.4rem;
  color: var(--xuan-main);
  background: var(--xuan-soft);
  font-size: 0.7rem;
  font-weight: 780;
  line-height: 1.2;
}

.xuan-academic-home + #recent-posts .recent-post-item {
  min-height: 0;
}

.xuan-academic-home + #recent-posts .recent-post-item .post_cover {
  display: none;
}

.xuan-academic-home + #recent-posts .recent-post-item > .recent-post-info,
.xuan-academic-home + #recent-posts .recent-post-item > .recent-post-info.no-cover {
  width: 100%;
  padding: 1rem 1.1rem;
}

.xuan-academic-home + #recent-posts .recent-post-item > .recent-post-info > .article-title {
  font-size: 1.08rem;
}

.xuan-academic-home + #recent-posts .recent-post-item > .recent-post-info > .content {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 0.45rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#recent-posts .recent-post-item {
  overflow: hidden;
  margin-bottom: 0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.workspace-card {
  padding: 1.15rem;
}

.workspace-table {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.workspace-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border-radius: 8px;
  padding: 0.62rem 0.7rem;
  color: var(--xuan-text);
  background: var(--xuan-soft);
}

a.workspace-row:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--xuan-main), var(--xuan-accent));
}

.workspace-row strong,
.workspace-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-row strong {
  font-size: 0.88rem;
}

.workspace-row span:last-child {
  border-radius: 8px;
  padding: 0.25rem 0.48rem;
  color: var(--xuan-main);
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
}

#recent-posts .recent-post-item:hover,
#aside-content .card-widget:hover,
.layout > div:first-child:not(.nc):hover {
  box-shadow: 0 20px 52px rgba(40, 67, 80, 0.16);
  transform: translateY(-2px);
}

#recent-posts .recent-post-item:hover {
  border-color: rgba(61, 124, 152, 0.3);
}

#recent-posts .recent-post-item .post_cover .post-bg {
  transition: transform 0.45s ease, filter 0.45s ease;
}

#recent-posts .recent-post-item:hover .post_cover .post-bg {
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.04);
}

#recent-posts .recent-post-item > .recent-post-info > .article-title {
  color: var(--xuan-text);
  font-weight: 760;
  line-height: 1.35;
}

#recent-posts .recent-post-item > .recent-post-info > .article-title:hover {
  color: var(--xuan-main);
}

#recent-posts .recent-post-item > .recent-post-info > .content,
#recent-posts .recent-post-item > .recent-post-info > .article-meta-wrap,
#aside-content .card-info .author-info-description {
  color: var(--xuan-muted);
}

#recent-posts .recent-post-item > .recent-post-info > .article-meta-wrap {
  font-size: 0.82rem;
}

#recent-posts .recent-post-item > .recent-post-info > .content {
  line-height: 1.8;
}

#aside-content .card-info .avatar-img {
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 24px rgba(40, 67, 80, 0.18);
}

#aside-content .item-headline span,
#aside-content .card-widget .card-info-data > .card-info-data-item a .headline {
  letter-spacing: 0;
}

#aside-content .aside-list > .aside-list-item .content > .title,
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a,
#aside-content .card-tags .card-tag-cloud a {
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

#aside-content .card-tags .card-tag-cloud a:hover,
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:hover,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a:hover {
  color: #fff !important;
  background: var(--xuan-main);
  transform: translateX(2px);
}

#aside-content .card-info #card-info-btn {
  border-radius: 8px;
  background: linear-gradient(135deg, var(--xuan-main), var(--xuan-accent));
  box-shadow: 0 10px 22px rgba(61, 124, 152, 0.26);
}

.xuan-calendar {
  padding: 1.25rem;
}

.xuan-calendar-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0.85rem 0 0.75rem;
}

.xuan-calendar-month {
  color: var(--xuan-text);
  font-size: 1.35rem;
  font-weight: 780;
  line-height: 1;
}

.xuan-calendar-date {
  color: var(--xuan-muted);
  font-size: 0.9rem;
  line-height: 1;
}

.xuan-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.xuan-calendar-weeks {
  margin-bottom: 0.35rem;
}

.xuan-calendar-week,
.xuan-calendar-day {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1;
}

.xuan-calendar-week {
  color: var(--xuan-muted);
  font-weight: 700;
}

.xuan-calendar-day {
  color: var(--xuan-text);
  background: var(--xuan-soft);
}

a.xuan-calendar-day {
  text-decoration: none;
}

.xuan-calendar-day.is-muted {
  color: rgba(102, 119, 127, 0.45);
  background: transparent;
}

.xuan-calendar-day.has-post {
  color: var(--xuan-main);
  font-weight: 800;
  background: rgba(61, 124, 152, 0.15);
  box-shadow: inset 0 0 0 1px rgba(61, 124, 152, 0.25);
}

.xuan-calendar-day.has-post:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--xuan-main), var(--xuan-accent));
}

.xuan-calendar-day.is-today {
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--xuan-main), var(--xuan-accent));
  box-shadow: 0 8px 18px rgba(61, 124, 152, 0.28);
}

.xuan-calendar-posts {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.xuan-calendar-posts a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  color: var(--xuan-text);
  background: var(--xuan-soft);
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xuan-calendar-posts a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--xuan-main), var(--xuan-accent));
}

#article-container {
  font-size: 1.02rem;
  line-height: 1.9;
}

#article-container a {
  color: var(--xuan-main);
  border-bottom: 1px solid rgba(61, 124, 152, 0.3);
  text-decoration: none;
}

#article-container a:hover {
  color: var(--xuan-accent);
  border-color: var(--xuan-accent);
}

#article-container h1,
#article-container h2,
#article-container h3,
#article-container h4 {
  color: #20343d;
  font-weight: 780;
  letter-spacing: 0;
}

#article-container h2 {
  border-left: 4px solid var(--xuan-main);
  padding-left: 0.72rem;
}

#article-container blockquote {
  border-left: 4px solid var(--xuan-main);
  border-radius: 0 8px 8px 0;
  background: rgba(61, 124, 152, 0.1);
}

#article-container table {
  overflow: hidden;
  border-radius: 8px;
}

#article-container code {
  border-radius: 6px;
}

#post-comment,
#pagination.pagination-post,
#post {
  border-radius: 8px;
}

#card-toc .toc-content .toc-link.active {
  border-radius: 8px;
  color: #fff;
  background: var(--xuan-main);
}

#card-toc .toc-content .toc-link:hover {
  color: var(--xuan-main);
}

#footer {
  background: rgba(20, 32, 38, 0.72);
  backdrop-filter: blur(12px);
}

[data-theme="dark"] {
  --xuan-card-bg: rgba(26, 32, 38, 0.84);
  --xuan-border: rgba(183, 213, 224, 0.14);
  --xuan-text: #e7edf0;
  --xuan-muted: #aebdc4;
  --xuan-paper: #151a1f;
  --xuan-soft: rgba(183, 213, 224, 0.08);
  --xuan-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] body::before {
  background:
    linear-gradient(180deg, rgba(18, 23, 28, 0.86), rgba(15, 20, 24, 0.95)),
    linear-gradient(135deg, rgba(217, 119, 69, 0.08), rgba(61, 124, 152, 0.1));
}

[data-theme="dark"] #article-container h1,
[data-theme="dark"] #article-container h2,
[data-theme="dark"] #article-container h3,
[data-theme="dark"] #article-container h4 {
  color: #edf5f7;
}

@media (max-width: 768px) {
  #page-header.full_page {
    height: 72vh;
  }

  .layout {
    padding: 1rem;
    gap: 1rem;
  }

  .xuan-home-profile,
  .xuan-home-preview {
    grid-template-columns: 1fr;
  }

  .xuan-home-profile {
    padding: 1.05rem;
  }

  .xuan-home-avatar {
    width: 4.7rem;
    height: 4.7rem;
  }

  #page-header #site-title {
    font-size: clamp(2.1rem, 14vw, 3.8rem);
  }

  #page-header #site-subtitle {
    padding: 0 1rem;
  }

  #recent-posts .recent-post-item:hover,
  #aside-content .card-widget:hover,
  .layout > div:first-child:not(.nc):hover {
    transform: none;
  }

  #article-container {
    font-size: 1rem;
    line-height: 1.85;
  }

  .xuan-calendar {
    padding: 1rem;
  }

}

/* Academic homepage correction */
:root {
  --xuan-card-bg: rgba(255, 255, 255, 0.94);
  --xuan-border: rgba(39, 55, 66, 0.13);
  --xuan-text: #1f2a30;
  --xuan-muted: #6b747a;
  --xuan-main: #2d6578;
  --xuan-accent: #9a5b37;
  --xuan-paper: #f7f8f6;
  --xuan-soft: rgba(45, 101, 120, 0.07);
  --xuan-shadow: 0 8px 24px rgba(30, 42, 48, 0.07);
}

body {
  background-attachment: scroll;
}

body::before {
  background:
    linear-gradient(180deg, rgba(247, 248, 246, 0.9), rgba(244, 246, 245, 0.96)),
    linear-gradient(135deg, rgba(154, 91, 55, 0.035), rgba(45, 101, 120, 0.05));
}

#page-header.full_page {
  height: 54vh;
  min-height: 24rem;
}

#page-header:not(.not-top-img)::before {
  background: linear-gradient(180deg, rgba(18, 28, 34, 0.2), rgba(18, 28, 34, 0.52));
}

#page-header #site-title {
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  font-weight: 760;
  letter-spacing: 0;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

#page-header #site-subtitle {
  max-width: 44rem;
  margin: 1rem auto 0;
  padding: 0 1rem;
  font-size: clamp(0.95rem, 1.6vw, 1.18rem);
  line-height: 1.7;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.layout {
  max-width: 1120px;
  gap: 1rem;
}

.layout > div:first-child:not(.nc),
#recent-posts .recent-post-item,
#aside-content .card-widget,
.layout .pagination > *:not(.space),
.xuan-home-overview,
.xuan-home-group {
  border-color: var(--xuan-border);
  background: var(--xuan-card-bg);
  box-shadow: var(--xuan-shadow);
  backdrop-filter: blur(10px);
}

.xuan-academic-home {
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.xuan-home-overview {
  border: 1px solid var(--xuan-border);
  border-radius: 8px;
  padding: 1.05rem 1.15rem;
}

.xuan-home-kicker {
  margin-bottom: 0.35rem;
  padding: 0;
  background: transparent;
  color: var(--xuan-main);
  font-size: 0.7rem;
  font-weight: 800;
}

.xuan-home-title,
.xuan-home-profile,
.xuan-home-avatar {
  display: none;
}

.xuan-home-intro {
  max-width: 42rem;
  margin: 0.28rem 0 0;
  line-height: 1.68;
}

.xuan-home-intro.en {
  font-size: 1rem;
}

.xuan-home-group {
  padding: 0.95rem;
}

.xuan-home-entry {
  min-height: 7.3rem;
  gap: 0.34rem;
  border-color: rgba(45, 101, 120, 0.12);
  padding: 0.78rem 0.82rem;
  background: rgba(255, 255, 255, 0.36);
  transition: border-color 0.2s ease, background 0.2s ease;
}

a.xuan-home-entry:hover {
  border-color: rgba(45, 101, 120, 0.32);
  background: rgba(255, 255, 255, 0.66);
  transform: none;
}

.xuan-home-entry-type {
  font-weight: 760;
}

#recent-posts .recent-post-item:hover,
#aside-content .card-widget:hover,
.layout > div:first-child:not(.nc):hover {
  box-shadow: 0 10px 28px rgba(30, 42, 48, 0.09);
  transform: none;
}

a.workspace-row:hover,
#aside-content .card-info #card-info-btn,
.xuan-calendar-day.has-post:hover,
.xuan-calendar-day.is-today,
.xuan-calendar-posts a:hover {
  background: var(--xuan-main);
}

#aside-content .card-info #card-info-btn {
  box-shadow: none;
}

#aside-content .card-info .avatar-img {
  border-width: 2px;
  box-shadow: 0 8px 18px rgba(40, 67, 80, 0.12);
}

[data-theme="dark"] body::before {
  background:
    linear-gradient(180deg, rgba(18, 23, 28, 0.88), rgba(15, 20, 24, 0.96)),
    linear-gradient(135deg, rgba(154, 91, 55, 0.05), rgba(45, 101, 120, 0.08));
}

@media (max-width: 768px) {
  #page-header.full_page {
    height: 46vh;
    min-height: 20rem;
  }

  .xuan-home-preview {
    grid-template-columns: 1fr;
  }

  .xuan-home-overview {
    padding: 0.95rem;
  }
}
