/*
 * 小杨的博客空间：首页第一版
 * 目标：保留 AnZhiYu 的功能，采用安静、清晰、以文章为核心的内容布局。
 */

:root {
  --xiaoyang-accent: #2f9b4d;
  --xiaoyang-accent-soft: #e2f6de;
  --xiaoyang-page-bg: #eaf7ee;
  --xiaoyang-card-bg: #fffef8;
  --xiaoyang-border: #d7ead5;
  --xiaoyang-text: #23352a;
  --xiaoyang-muted: #66796d;
  --xiaoyang-shadow: 0 14px 40px rgba(54, 109, 68, 0.12);
  --anzhiyu-theme: var(--xiaoyang-accent);
  --anzhiyu-main: var(--xiaoyang-accent);
  --anzhiyu-fontcolor: var(--xiaoyang-text);
  --anzhiyu-secondtext: var(--xiaoyang-muted);
  --anzhiyu-card-bg: var(--xiaoyang-card-bg);
  --anzhiyu-background: var(--xiaoyang-page-bg);
}

[data-theme="dark"] {
  --xiaoyang-accent: #f0b84b;
  --xiaoyang-accent-soft: #30325f;
  --xiaoyang-page-bg: #08132e;
  --xiaoyang-card-bg: #121f3f;
  --xiaoyang-border: #293a69;
  --xiaoyang-text: #edf3ff;
  --xiaoyang-muted: #aab8d6;
  --xiaoyang-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
  --anzhiyu-theme: var(--xiaoyang-accent);
  --anzhiyu-main: var(--xiaoyang-accent);
  --anzhiyu-fontcolor: var(--xiaoyang-text);
  --anzhiyu-secondtext: var(--xiaoyang-muted);
  --anzhiyu-card-bg: var(--xiaoyang-card-bg);
  --anzhiyu-background: var(--xiaoyang-page-bg);
}

body {
  background:
    radial-gradient(circle at 8% 20%, rgba(76, 185, 104, 0.16), transparent 30rem),
    radial-gradient(circle at 92% 60%, rgba(255, 205, 84, 0.12), transparent 28rem),
    var(--xiaoyang-page-bg);
  color: var(--xiaoyang-text) !important;
  transition: background-color 0.35s ease, color 0.35s ease;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 15% 18%, rgba(72, 92, 184, 0.2), transparent 30rem),
    radial-gradient(circle at 86% 58%, rgba(119, 65, 159, 0.18), transparent 28rem),
    var(--xiaoyang-page-bg);
}

#web_bg {
  background:
    linear-gradient(180deg, rgba(219, 246, 226, 0.56), rgba(238, 248, 239, 0.92))
    !important;
}

[data-theme="dark"] #web_bg {
  background:
    radial-gradient(circle at 20% 12%, rgba(77, 89, 184, 0.22), transparent 35rem),
    linear-gradient(180deg, rgba(8, 19, 46, 0.9), rgba(8, 15, 35, 0.97))
    !important;
}

/* 首页图片横幅 */
#page-header.full_page {
  min-height: 440px;
  background-position: center 56%;
  box-shadow: inset 0 -120px 100px -80px rgba(13, 35, 42, 0.62);
  animation: xiaoyang-hero-drift 16s ease-in-out infinite alternate;
}

[data-theme="dark"] #page-header.full_page {
  background: url("/img/xiaoyang/night-wolf-castle.png") center 58% / cover no-repeat
    !important;
}

#page-header.full_page::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 32, 42, 0.12), rgba(9, 32, 42, 0.5));
  content: "";
  pointer-events: none;
}

#page-header.full_page::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 16% 27%, rgba(255, 255, 255, 0.24) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.2) 0 3px, transparent 4px),
    radial-gradient(circle at 67% 72%, rgba(255, 224, 111, 0.24) 0 2px, transparent 3px);
  background-size: 180px 160px, 260px 220px, 220px 190px;
  content: "";
  pointer-events: none;
  animation: xiaoyang-sparkles 8s ease-in-out infinite alternate;
}

[data-theme="dark"] #page-header.full_page::before {
  background: linear-gradient(180deg, rgba(3, 9, 32, 0.08), rgba(3, 9, 32, 0.5));
}

#page-header.full_page #site-title {
  display: none;
}

#page-header.full_page #site-info {
  z-index: 1;
  padding: 0 20px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.42);
}

#page-header.full_page #site-title {
  color: #fff !important;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
}

#page-header.full_page #site-subtitle {
  color: rgba(255, 255, 255, 0.92) !important;
  min-height: 3rem;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  font-weight: 650;
  letter-spacing: 0.08em;
}

#page-header.full_page #site-subtitle .typed-cursor {
  color: #fff;
  font-weight: 400;
}

@keyframes xiaoyang-hero-drift {
  0% {
    background-position: center 55%;
  }
  100% {
    background-position: center 61%;
  }
}

@keyframes xiaoyang-sparkles {
  0% {
    opacity: 0.35;
    transform: translate3d(-6px, 0, 0);
  }
  100% {
    opacity: 0.8;
    transform: translate3d(8px, -5px, 0);
  }
}

/* 简洁、稳定的顶部导航 */
#page-header.not-top-img {
  margin-bottom: 0;
  background: color-mix(in srgb, var(--xiaoyang-card-bg) 92%, transparent);
  border-bottom: 1px solid var(--xiaoyang-border);
  box-shadow: none;
}

#page-header #nav {
  width: 100%;
  max-width: none;
  height: 64px;
  margin: 0;
  padding: 0 clamp(20px, 4vw, 64px);
}

#page-header.full_page #nav {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

#page-header.nav-fixed #nav {
  background: rgba(255, 254, 248, 0.88) !important;
  border-bottom: 1px solid var(--xiaoyang-border) !important;
  box-shadow: 0 8px 26px rgba(38, 72, 48, 0.1) !important;
  outline: 0 !important;
  backdrop-filter: blur(16px) saturate(150%);
}

[data-theme="dark"] #page-header.nav-fixed #nav {
  background: rgba(11, 22, 51, 0.9) !important;
  border-bottom-color: rgba(93, 112, 176, 0.28) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28) !important;
}

#page-header.nav-fixed .mask-name-container,
#page-header.nav-fixed #name-container,
#page-header.nav-fixed #page-name {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#page-header.not-top-img #nav #site-name,
#page-header.not-top-img #nav .site-page {
  color: var(--xiaoyang-text) !important;
}

#page-header.full_page #nav #site-name,
#page-header.full_page #nav .site-page,
#page-header.full_page #nav .nav-button a,
#page-header.full_page #nav #toggle-menu {
  color: #fff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

#page-header.full_page.nav-fixed #nav #site-name,
#page-header.full_page.nav-fixed #nav .site-page,
#page-header.full_page.nav-fixed #nav .nav-button a,
#page-header.full_page.nav-fixed #nav #toggle-menu {
  color: var(--xiaoyang-text) !important;
  text-shadow: none;
}

#page-header.full_page.nav-fixed #center-console + label i {
  background: var(--xiaoyang-text) !important;
}

#nav #site-name {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#nav .menus_items .menus_item .site-page {
  display: flex;
  height: 36px;
  padding: 0 13px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  align-items: center;
  justify-content: center;
}

#nav .menus_items .menus_item {
  display: flex;
  align-items: center;
  justify-content: center;
}

#nav .menus_items .menus_item .site-page:hover {
  color: var(--xiaoyang-accent) !important;
}

/* 首页主体：窄一些、留白更多 */
#content-inner.layout {
  max-width: 1080px;
  padding: 52px 20px 72px;
  gap: 28px;
}

#content-inner #recent-posts {
  width: calc(100% - 292px);
}

#categoryBar {
  display: none !important;
}

/* 单栏图文文章列表 */
#recent-posts > .recent-post-item,
#recent-posts > .recent-post-item:not(:first-child) {
  display: grid;
  height: auto;
  min-height: 224px;
  margin: 0 0 20px;
  overflow: hidden;
  grid-template-columns: minmax(210px, 34%) 1fr;
  background: var(--xiaoyang-card-bg);
  border: 1px solid var(--xiaoyang-border);
  border-radius: 10px;
  box-shadow: var(--xiaoyang-shadow);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#recent-posts > .recent-post-item:hover {
  border-color: color-mix(in srgb, var(--xiaoyang-accent) 42%, var(--xiaoyang-border));
  box-shadow: 0 14px 38px rgba(38, 50, 56, 0.09);
  transform: translateY(-2px);
}

[data-theme="dark"] #recent-posts > .recent-post-item:hover {
  border-color: rgba(240, 184, 75, 0.55);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
}

#recent-posts > .recent-post-item > .post_cover {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 224px;
  overflow: hidden;
}

#recent-posts > .recent-post-item > .post_cover a {
  height: 100% !important;
}

#recent-posts > .recent-post-item > .post_cover img.post_bg {
  width: 100%;
  height: 100%;
  min-height: 224px;
  border-radius: 0;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}

#recent-posts > .recent-post-item:hover > .post_cover img.post_bg {
  filter: brightness(0.95) saturate(1.06) !important;
  transform: scale(1.035) !important;
}

#recent-posts > .recent-post-item > .recent-post-info,
#recent-posts > .recent-post-item > .recent-post-info.no-cover {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 224px;
  padding: 28px 30px 24px;
  overflow: visible;
  flex-direction: column;
}

#recent-posts .recent-post-info .recent-post-info-top {
  padding: 0;
}

#recent-posts .recent-post-info .recent-post-info-top-tips {
  min-height: 20px;
  margin: 0 0 8px;
}

#recent-posts .recent-post-info .article-categories-original {
  padding: 2px 9px;
  color: var(--xiaoyang-accent);
  background: var(--xiaoyang-accent-soft);
  border-radius: 999px;
  font-size: 0.76rem;
}

#recent-posts .recent-post-info .newPost,
#recent-posts .recent-post-info .unvisited-post {
  display: none;
}

#recent-posts .recent-post-info .article-title {
  margin: 0;
  color: var(--xiaoyang-text) !important;
  font-size: 1.36rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

#content-inner #recent-posts > .recent-post-item > .recent-post-info > .content {
  display: -webkit-box;
  height: auto;
  margin: 13px 0 18px;
  overflow: hidden;
  color: var(--xiaoyang-muted);
  font-size: 0.93rem;
  line-height: 1.8;
  opacity: 1;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#recent-posts > .recent-post-item > .recent-post-info > .article-meta-wrap {
  position: static;
  display: flex;
  width: 100%;
  margin-top: auto;
  padding: 0;
  color: var(--xiaoyang-muted);
  align-items: center;
  flex-direction: row;
  justify-content: flex-start;
}

#recent-posts .article-meta-wrap .post-meta-date,
#recent-posts .article-meta-wrap .article-meta,
#recent-posts .article-meta-wrap a {
  color: var(--xiaoyang-muted) !important;
  font-size: 0.8rem !important;
}

/* 侧栏只保留标签和归档，视觉上弱于文章 */
#aside-content {
  width: 264px;
}

#aside-content .card-widget {
  padding: 22px;
  background: var(--xiaoyang-card-bg);
  border: 1px solid var(--xiaoyang-border);
  border-radius: 10px;
  box-shadow: none;
}

[data-theme="dark"] #aside-content .card-widget {
  background: linear-gradient(145deg, #142448, #101c39);
}

#aside-content,
#aside-content * {
  color: var(--xiaoyang-text);
}

#aside-content .item-headline {
  margin-bottom: 14px;
  color: var(--xiaoyang-text);
  font-size: 0.95rem;
  font-weight: 650;
}

#aside-content .card-tag-cloud a {
  color: var(--xiaoyang-muted) !important;
}

#aside-content .card-tag-cloud a:hover {
  color: var(--xiaoyang-accent) !important;
}

/* 文章详情页：正文加宽，目录向右展开，整体保持居中 */
@media screen and (min-width: 1201px) {
  .page #content-inner.layout:has(> #recent-posts) {
    width: 100%;
    max-width: 1400px;
    padding-right: 28px;
    padding-left: 28px;
    gap: 40px;
    justify-content: center;
  }

  .page #content-inner.layout > #recent-posts {
    width: calc(100% - 304px);
    min-width: 0;
  }

  .page #content-inner.layout:has(> #recent-posts) > #aside-content {
    width: 264px;
    min-width: 264px;
    padding-left: 0;
    flex: 0 0 264px;
  }

  .post #content-inner.layout {
    width: 100%;
    max-width: 1400px;
    padding-right: 28px;
    padding-left: 28px;
    gap: 40px;
    justify-content: center;
  }

  .post #content-inner.layout > #post {
    width: calc(100% - 304px);
    min-width: 0;
  }

  .post #content-inner.layout > #aside-content {
    width: 264px;
    min-width: 264px;
    padding-left: 0;
    flex: 0 0 264px;
  }
}

#footer {
  background: transparent !important;
  border-top: 1px solid var(--xiaoyang-border);
}

#footer-wrap,
#footer-wrap a {
  color: var(--xiaoyang-muted);
}

/* 昼夜切换收拢到顶部中控台右侧 */
#rightside {
  display: none !important;
}

#nav-right .xiaoyang-theme-toggle {
  display: flex;
  width: 36px;
  min-width: 36px;
  height: 32px;
  margin-left: 8px;
  padding: 0;
  color: #fff;
  background: rgba(21, 99, 51, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(13, 55, 28, 0.22);
  cursor: pointer;
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.25s ease, box-shadow 0.25s ease;
}

#nav-right .xiaoyang-theme-toggle:hover {
  background: rgba(24, 122, 59, 0.9);
  box-shadow: 0 8px 22px rgba(13, 55, 28, 0.3);
  transform: translateY(-1px);
}

#nav-right .xiaoyang-theme-toggle__icon {
  display: block;
  width: 1em;
  height: 1em;
  font-size: 1.18rem;
  line-height: 0.92;
  text-align: center;
}

[data-theme="dark"] #nav-right .xiaoyang-theme-toggle {
  color: #172345;
  background: rgba(255, 211, 101, 0.9);
  border-color: rgba(255, 234, 174, 0.8);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #nav-right .xiaoyang-theme-toggle:hover {
  background: #ffd163;
}

/* 主题切换不显示顶部 Snackbar 进度提示 */
html.xiaoyang-theme-switching .snackbar-container {
  display: none !important;
}

/* 中控台：用当前昼夜世界作为背景，卡片保持清晰 */
#console .console-mask {
  background:
    linear-gradient(135deg, rgba(217, 246, 224, 0.7), rgba(224, 243, 255, 0.78)),
    url("/img/xiaoyang/day-grassland.png") center 58% / cover !important;
  backdrop-filter: blur(10px) saturate(135%) !important;
}

[data-theme="dark"] #console .console-mask {
  background:
    linear-gradient(135deg, rgba(6, 14, 39, 0.76), rgba(24, 26, 70, 0.76)),
    url("/img/xiaoyang/night-wolf-castle.png") center 58% / cover !important;
}

#console .console-card-group {
  width: min(820px, calc(100vw - 40px));
  max-width: 820px;
  max-height: 76vh;
  padding: 24px;
  background: rgba(255, 254, 248, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(31, 86, 49, 0.24);
  backdrop-filter: blur(22px) saturate(145%);
}

[data-theme="dark"] #console .console-card-group {
  background: rgba(11, 22, 52, 0.72);
  border-color: rgba(143, 158, 218, 0.22);
  box-shadow: 0 26px 76px rgba(0, 0, 0, 0.48);
}

#console .console-card-group-left:empty {
  display: none;
}

#console .console-card-group-right {
  display: grid;
  width: 100%;
  min-width: 0;
  height: auto;
  overflow: visible;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

#console .console-card {
  height: auto !important;
  padding: 28px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid rgba(76, 148, 91, 0.16) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 30px rgba(50, 102, 62, 0.1) !important;
}

[data-theme="dark"] #console .console-card {
  background: rgba(17, 31, 67, 0.86) !important;
  border-color: rgba(126, 144, 211, 0.2) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24) !important;
}

#console .console-card.tags .card-tag-cloud {
  max-height: 180px;
}

#console .console-card.tags .card-tag-cloud a {
  padding: 5px 10px;
  background: var(--xiaoyang-accent-soft);
  border-radius: 999px;
}

#console .button-group {
  grid-column: 1 / -1;
  margin-top: 2px;
}

#console .button-group .console-btn-item a {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--xiaoyang-border);
  box-shadow: 0 8px 22px rgba(45, 103, 60, 0.12);
}

[data-theme="dark"] #console .button-group .console-btn-item a {
  background: rgba(19, 34, 71, 0.9);
  border-color: rgba(127, 144, 207, 0.24);
}

/* 文章版权卡片：沿用主题原结构，只校正配色和个人标识 */
.post-copyright {
  color: var(--xiaoyang-text) !important;
  background: var(--xiaoyang-card-bg) !important;
  border: 1px solid var(--xiaoyang-border) !important;
  box-shadow: var(--xiaoyang-shadow);
}

[data-theme="dark"] .post-copyright {
  background: var(--xiaoyang-card-bg) !important;
}

.post-copyright .post-copyright__author_img {
  display: grid;
  color: #23713a;
  background: linear-gradient(145deg, #fffef8, #dff3da);
  place-items: center;
}

[data-theme="dark"] .post-copyright .post-copyright__author_img {
  color: #f2b94b;
  background: linear-gradient(145deg, #1c2b52, #101b39);
}

.post-copyright .post-copyright__author_img img {
  display: none !important;
}

.post-copyright .post-copyright__author_img::after {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  content: "杨";
}

.post-copyright .post-copyright__author_name,
.post-copyright .post-copyright__author_desc {
  color: var(--xiaoyang-text) !important;
}

@media screen and (max-width: 900px) {
  #content-inner.layout {
    display: block;
    padding-top: 34px;
  }

  #content-inner #recent-posts {
    width: 100%;
  }

  #aside-content {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  #page-header.full_page {
    min-height: 390px;
    background-position: center center;
  }

  #page-header #nav {
    height: 58px;
    padding: 0 16px;
  }

  #content-inner.layout {
    padding: 24px 14px 52px;
  }

  #recent-posts > .recent-post-item,
  #recent-posts > .recent-post-item:not(:first-child) {
    display: flex;
    min-height: 0;
    margin: 0 0 14px !important;
    border-radius: 9px;
    flex-direction: column;
  }

  #recent-posts > .recent-post-item > .post_cover {
    width: 100%;
    height: 178px;
    min-height: 178px;
  }

  #recent-posts > .recent-post-item > .post_cover img.post_bg {
    min-height: 178px;
  }

  #recent-posts > .recent-post-item > .recent-post-info,
  #recent-posts > .recent-post-item > .recent-post-info.no-cover {
    min-height: 0;
    padding: 22px 20px;
  }

  #recent-posts .recent-post-info .article-title {
    font-size: 1.16rem;
  }

  #content-inner #recent-posts > .recent-post-item > .recent-post-info > .content {
    margin: 10px 0 15px;
    font-size: 0.88rem;
    line-height: 1.7;
  }

  #nav-right .xiaoyang-theme-toggle {
    min-width: 34px;
    width: 34px;
    height: 30px;
    margin-left: 5px;
    padding: 0;
    border-radius: 16px;
    justify-content: center;
  }

  #nav-right .xiaoyang-theme-toggle__icon {
    font-size: 1.08rem;
  }

  #console .console-card-group {
    width: calc(100vw - 24px);
    padding: 12px;
    border-radius: 20px;
  }

  #console .console-card-group-right {
    display: flex;
    max-height: 72vh;
    flex-direction: column;
    overflow-y: auto;
  }

  #console .console-card {
    padding: 20px !important;
  }

}

@media (prefers-reduced-motion: reduce) {
  body,
  #recent-posts > .recent-post-item,
  #page-header.full_page {
    transition: none !important;
    animation: none !important;
  }
}
