/* =========================================================
   IanZhi Blog — 设计系统（传统主题 / Bootstrap 5）
   品牌紫 #503AA8 贯穿全站；移动端优先；所有改动集中于本文件。
   ========================================================= */

:root {
  --ianzhi-purple: #503AA8;
  --ianzhi-purple-dark: #3d2c82;
  --ianzhi-purple-darker: #2f2266;
  --ianzhi-lavender: #F1ECFB;
  --ianzhi-purple-soft: #E4DBF7;
  --ianzhi-text: #2A2438;
  --ianzhi-muted: #6B6B73;
  --ianzhi-paper: #FBFAF7;
  --ianzhi-border: #ECEAF3;
  --ianzhi-bg: #ffffff;
  --ianzhi-radius: 16px;
  --ianzhi-shadow: 0 14px 34px -14px rgba(80, 58, 168, .28);
  --ianzhi-shadow-sm: 0 6px 18px -10px rgba(80, 58, 168, .22);

  /* 让 Bootstrap 主色同步为品牌紫 */
  --bs-primary: #503AA8;
  --bs-primary-rgb: 80, 58, 168;
  --bs-link-color: #503AA8;
  --bs-link-hover-color: #3d2c82;
  --bs-border-radius: 14px;
}

/* 让 Bootstrap 按钮使用品牌紫 */
.btn-primary {
  --bs-btn-bg: #503AA8;
  --bs-btn-border-color: #503AA8;
  --bs-btn-hover-bg: #3d2c82;
  --bs-btn-hover-border-color: #3d2c82;
  --bs-btn-active-bg: #2f2266;
  --bs-btn-active-border-color: #2f2266;
  --bs-btn-focus-shadow-rgb: 80, 58, 168;
}
.btn-outline-primary {
  --bs-btn-color: #503AA8;
  --bs-btn-border-color: #503AA8;
  --bs-btn-hover-bg: #503AA8;
  --bs-btn-hover-border-color: #503AA8;
  --bs-btn-active-bg: #3d2c82;
  --bs-btn-active-border-color: #3d2c82;
}

/* ---------- 基础 ---------- */
html {
  scroll-behavior: smooth;
}
body {
  color: var(--ianzhi-text);
  background-color: var(--ianzhi-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img,
video,
svg {
  max-width: 100%;
  height: auto;
}
::selection {
  background: var(--ianzhi-purple);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--ianzhi-purple);
  outline-offset: 2px;
}
a {
  color: var(--ianzhi-purple);
  text-decoration: none;
  transition: color .2s ease;
}
a:hover {
  color: var(--ianzhi-purple-dark);
}

/* 跳转链接（可访问性） */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1000;
  padding: .5rem 1rem;
  background: var(--ianzhi-purple);
  color: #fff;
  border-radius: 0 0 .5rem 0;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ---------- 头部 / 导航 ---------- */
.site-header {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ianzhi-border);
  transition: box-shadow .25s ease, background .25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 4px 20px -12px rgba(80, 58, 168, .35);
}
.site-title,
.navbar-brand.site-title {
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ianzhi-purple);
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
}
.site-title:hover {
  color: var(--ianzhi-purple-dark);
}
.site-header .custom-logo {
  height: 40px;
  width: auto;
}
.navbar-nav .nav-link {
  font-weight: 600;
  color: var(--ianzhi-text);
  padding-inline: .85rem;
  position: relative;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active,
.navbar-nav .nav-link.current-menu-item > a,
.navbar-nav .current-menu-item > .nav-link {
  color: var(--ianzhi-purple);
}
.navbar-nav .nav-link.active::after,
.navbar-nav .current-menu-item > .nav-link::after {
  content: "";
  position: absolute;
  left: .85rem;
  right: .85rem;
  bottom: .35rem;
  height: 2px;
  background: var(--ianzhi-purple);
  border-radius: 2px;
}
.dropdown-menu {
  border-color: var(--ianzhi-border);
  box-shadow: var(--ianzhi-shadow-sm);
  border-radius: 12px;
  overflow: hidden;
}
.dropdown-item:focus,
.dropdown-item:hover {
  background: var(--ianzhi-lavender);
  color: var(--ianzhi-purple);
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 .2rem rgba(80, 58, 168, .25);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 420px at 50% -12%, var(--ianzhi-purple-soft), transparent 72%),
    var(--ianzhi-paper);
  border-bottom: 1px solid var(--ianzhi-border);
  overflow: hidden;
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ianzhi-purple);
  margin-bottom: 1rem;
}
.hero__title {
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--ianzhi-text);
}
.hero__lead {
  color: var(--ianzhi-muted);
  font-size: 1.15rem;
  max-width: 48ch;
  margin-inline: auto;
}
.hero .search-form .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.hero .search-form .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* 区块标题 */
.section-title {
  position: relative;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ianzhi-purple);
  padding-bottom: .6rem;
  margin-bottom: 1.5rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--ianzhi-purple);
}

/* ---------- 文章卡片 ---------- */
.post-card {
  background: #fff;
  border: 1px solid var(--ianzhi-border) !important;
  border-radius: var(--ianzhi-radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ianzhi-shadow);
  border-color: var(--ianzhi-purple-soft) !important;
}
.post-card .post-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
}
.post-card .post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-card__media img {
  transform: scale(1.05);
}
.post-card .post-card__title a {
  background-image: linear-gradient(var(--ianzhi-purple), var(--ianzhi-purple));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s ease;
  color: var(--ianzhi-text);
}
.post-card:hover .post-card__title a {
  background-size: 100% 1.5px;
  color: var(--ianzhi-purple);
}
.post-card__more {
  color: var(--ianzhi-purple);
  font-weight: 600;
}
.post-card__more:hover {
  color: var(--ianzhi-purple-dark);
}

/* 分类 / 标签 胶囊（全站统一视觉语言） */
.post-card__cats,
.single-post__cats,
.featured-post__cats,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.taxonomy-category a,
.taxonomy-post_tag a,
.post-card__cats a,
.single-post__cats a,
.featured-post__cats a,
.post-tags a,
.cat-links a,
.tag-links a {
  display: inline-block;
  padding: .28em .85em;
  border-radius: 999px;
  background: var(--ianzhi-lavender);
  color: var(--ianzhi-purple);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.taxonomy-category a:hover,
.taxonomy-post_tag a:hover,
.post-card__cats a:hover,
.single-post__cats a:hover,
.featured-post__cats a:hover,
.post-tags a:hover,
.cat-links a:hover,
.tag-links a:hover {
  background: var(--ianzhi-purple);
  color: #fff;
}

.post-card__meta,
.featured-post__meta {
  color: var(--ianzhi-muted);
}
.post-meta__sep {
  margin: 0 .4rem;
  color: var(--ianzhi-border);
}

/* ---------- 精选文章 ---------- */
.featured-post {
  background: #fff;
  border: 1px solid var(--ianzhi-border);
  border-radius: var(--ianzhi-radius);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.featured-post:hover {
  border-color: var(--ianzhi-purple-soft);
  box-shadow: var(--ianzhi-shadow-sm);
}
.featured-post__media {
  display: block;
  overflow: hidden;
  border-radius: var(--ianzhi-radius);
}
.featured-post__media img {
  transition: transform .4s ease;
}
.featured-post:hover .featured-post__media img {
  transform: scale(1.03);
}
.featured-post__title a {
  color: var(--ianzhi-text);
}
.featured-post__title a:hover {
  color: var(--ianzhi-purple);
}

/* ---------- 文章元信息（卡片用） ---------- */
.post-card__meta a,
.featured-post__meta a {
  color: var(--ianzhi-muted);
}
.post-card__meta a:hover,
.featured-post__meta a:hover {
  color: var(--ianzhi-purple);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  background: transparent;
  padding-inline: 0;
  --bs-breadcrumb-divider-color: var(--ianzhi-muted);
}
.breadcrumb-item a {
  color: var(--ianzhi-muted);
}
.breadcrumb-item.active {
  color: var(--ianzhi-purple);
}

/* ---------- 单篇文章 ---------- */
.single-post__title {
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.single-post__content {
  font-size: 1.075rem;
  line-height: 1.9;
}
.single-post__content img {
  border-radius: 12px;
}
.single-post__content h2,
.single-post__content h3,
.single-post__content h4 {
  font-weight: 700;
  margin-top: 1.8em;
  margin-bottom: .6em;
  letter-spacing: -.01em;
}
.single-post__content blockquote {
  border-left: 4px solid var(--ianzhi-purple);
  background: var(--ianzhi-lavender);
  padding: 1rem 1.25rem;
  border-radius: 0 12px 12px 0;
  color: var(--ianzhi-text);
}
.single-post__content pre,
.single-post__content code {
  background: #2A2438;
  color: #F1ECFB;
  border-radius: 8px;
}
.single-post__content pre {
  padding: 1rem 1.15rem;
  overflow-x: auto;
}
.single-post__content :not(pre) > code {
  padding: .15em .4em;
  font-size: .9em;
}
.single-post__content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-tags {
  margin-top: 2rem;
}

/* 上一篇 / 下一篇 */
.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.post-navigation .nav-previous,
.post-navigation .nav-next {
  flex: 1 1 240px;
  border: 1px solid var(--ianzhi-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.post-navigation .nav-next {
  text-align: right;
}
.post-navigation .nav-previous:hover,
.post-navigation .nav-next:hover {
  border-color: var(--ianzhi-purple-soft);
  box-shadow: var(--ianzhi-shadow-sm);
}
.post-navigation .nav-label {
  display: block;
  font-size: .78rem;
  color: var(--ianzhi-muted);
  font-weight: 600;
}
.post-navigation a {
  font-weight: 700;
  color: var(--ianzhi-text);
}

/* 作者卡 */
.author-box {
  background: var(--ianzhi-paper);
  border: 1px solid var(--ianzhi-border);
  border-radius: var(--ianzhi-radius);
}
.author-box__avatar img {
  border-radius: 50%;
}
.author-box__name a {
  color: var(--ianzhi-text);
}
.author-box__name a:hover {
  color: var(--ianzhi-purple);
}

/* ---------- 阅读进度条 ---------- */
#ianzhi-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--ianzhi-purple);
  z-index: 1080;
  transition: width .1s linear;
}

/* ---------- 分页（Bootstrap 风格） ---------- */
.pagination .page-item .page-link {
  color: var(--ianzhi-purple);
  border-radius: 10px;
  margin: 0 .15rem;
  border-color: var(--ianzhi-border);
}
.pagination .page-item.active .page-link {
  background: var(--ianzhi-purple);
  border-color: var(--ianzhi-purple);
  color: #fff;
}
.pagination .page-item.disabled .page-link {
  color: var(--ianzhi-muted);
}

/* ---------- 小工具（侧边栏 / 页脚） ---------- */
.widget {
  background: #fff;
  border: 1px solid var(--ianzhi-border);
  border-radius: var(--ianzhi-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.widget-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ianzhi-text);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--ianzhi-border);
}
.widget ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.widget ul li {
  padding: .35rem 0;
  border-bottom: 1px dashed var(--ianzhi-border);
}
.widget ul li:last-child {
  border-bottom: 0;
}
.widget a {
  color: var(--ianzhi-text);
}
.widget a:hover {
  color: var(--ianzhi-purple);
}
.widget select,
.widget input[type="search"],
.widget .form-control {
  width: 100%;
}
.widget .tagcloud a {
  display: inline-block;
  margin: .2rem;
  padding: .25em .7em;
  border-radius: 999px;
  background: var(--ianzhi-lavender);
  color: var(--ianzhi-purple);
  font-size: .8rem !important;
}

/* ---------- 搜索表单 ---------- */
.search-form .form-control:focus {
  border-color: var(--ianzhi-purple);
  box-shadow: 0 0 0 .2rem rgba(80, 58, 168, .2);
}

/* ---------- 评论 ---------- */
.comments-area .comment-list .comment {
  border: 0;
}
.comment-body {
  border-bottom: 1px solid var(--ianzhi-border);
  padding-bottom: 1rem;
}
.comment-content a {
  word-wrap: break-word;
}
.comment-reply-link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ianzhi-purple);
}
.comment-author .says {
  display: none;
}
.comment-meta a {
  color: var(--ianzhi-muted);
  font-size: .85rem;
}
#respond .form-control:focus {
  border-color: var(--ianzhi-purple);
  box-shadow: 0 0 0 .2rem rgba(80, 58, 168, .2);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--ianzhi-paper);
  border-top: 1px solid var(--ianzhi-border);
  padding-top: 3rem;
  padding-bottom: 2rem;
  margin-top: 3rem;
  color: var(--ianzhi-text);
}
.site-footer__title {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ianzhi-purple);
}
.site-footer__tagline {
  color: var(--ianzhi-muted);
  margin-top: .35rem;
}
.site-footer__heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .75rem;
}
.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
}
.footer-menu a {
  color: var(--ianzhi-text);
}
.footer-menu a:hover {
  color: var(--ianzhi-purple);
}
.site-footer__bottom {
  margin-top: 1.5rem;
}
.site-footer__links a {
  color: var(--ianzhi-muted);
}
.site-footer__links a:hover {
  color: var(--ianzhi-purple);
}

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ianzhi-purple);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: var(--ianzhi-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 1080;
}
.back-to-top:hover {
  color: #fff;
  background: var(--ianzhi-purple-dark);
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- 通用排版 ---------- */
.page-title {
  font-weight: 800;
  letter-spacing: -.01em;
}
.archive-description {
  font-size: 1rem;
}
.lead {
  color: var(--ianzhi-muted);
}

/* ---------- 移动端（窄屏）适配 ---------- */
@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: .5rem;
  }
  .navbar-nav .nav-link.active::after,
  .navbar-nav .current-menu-item > .nav-link::after {
    display: none;
  }
}
@media (max-width: 600px) {
  .hero__title {
    font-size: 1.9rem;
  }
  .hero__lead {
    font-size: 1rem;
  }
  .post-card {
    padding: 0;
  }
  .single-post__content {
    font-size: 1rem;
  }
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

/* ---------- 标签文章标题列表（短代码 [ianzhi_tag_posts]） ---------- */
.ianzhi-tag-posts__item {
  padding: .5rem 0;
  border-bottom: 1px solid var(--ianzhi-border);
}
.ianzhi-tag-posts__item:last-child {
  border-bottom: 0;
}
.ianzhi-tag-posts__item a {
  color: var(--ianzhi-text);
  text-decoration: none;
  font-weight: 500;
}
.ianzhi-tag-posts__item a:hover {
  color: var(--ianzhi-purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ianzhi-tag-posts__date {
  font-size: .8rem;
  margin-left: .35rem;
}
