/*-----------------------------------
  全局变量 - 贴近 Read 模板配色
------------------------------------*/
:root {
  --color-body: #444444;
  --color-heading: #111111;
  --color-muted: #777777;
  --color-border: #e5e5e5;
  --color-link: #111111;
  --color-link-hover: #000000;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Lora', Georgia, serif;
  --body-bg: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 修复 Footer 固定底部 */
html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-body);
  background-color: var(--body-bg);
  -webkit-font-smoothing: antialiased;
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
}

/* 标题字体 */
h1, h2, h3, h4, h5,
.post-title,
.navbar-brand {
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--color-heading);
  line-height: 1.35;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: all 0.2s ease;
}

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

/*-----------------------------------
  导航栏
------------------------------------*/
.navbar {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent !important;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.nav-link {
  font-size: 0.95rem;
  color: #333 !important;
  padding: 0.4rem 1rem !important;
}

.nav-link:hover {
  color: #000 !important;
}

/*-----------------------------------
  Banner
------------------------------------*/
.blog-banner {
  background-color: #f8f9fa;
  padding: 3rem 0;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3rem;
}

.blog-banner h1 {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.blog-banner p {
  font-size: 1rem;
  color: var(--color-muted);
  max-width: 600px;
  margin: 0 auto;
}

/*-----------------------------------
  文章列表卡片
------------------------------------*/
.post-card {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.post-title a {
  color: var(--color-heading);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card p {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 0;
}

/*-----------------------------------
  侧边栏
------------------------------------*/
.sidebar-widget {
  margin-bottom: 2.5rem;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #111;
  color: #111;
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget li {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.sidebar-widget li a {
  color: #333;
}

.sidebar-widget li a:hover {
  padding-left: 2px;
}

/*-----------------------------------
  文章详情
------------------------------------*/
.post-detail {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content {
  color: #333;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
}

.post-content pre {
  background: #f6f6f6;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content code {
  background: #f6f6f6;
  padding: 2px 5px;
  border-radius: 3px;
}

/* 点赞 & 分享 */
.post-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: #555;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.action-item .material-icons {
  font-size: 19px;
}

.action-item:hover {
  color: #111;
}

/*-----------------------------------
  上一篇 / 下一篇 导航（统一等宽、单行截断、完美布局）
------------------------------------*/
.post-navigation {
  display: flex;
  width: 100%;
  gap: 16px;
  margin-bottom: 2.5rem;
}
.nav-box {
  flex: 1;
}
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 文字与箭头左右分布 */
  gap: 8px;
  padding: 14px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 15px;
  color: #222;
  text-decoration: none;
  width: 100%;
  min-height: 52px;
}
.nav-btn.empty {
  color: #999;
  background: #fafafa;
  cursor: default;
}
.nav-btn:hover:not(.empty) {
  background: #e9ecef;
}
.nav-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left; /* 文字永远靠左 */
}

/* 上一篇：箭头在左，文字在右 */
.nav-box.prev .nav-btn {
  flex-direction: row;
}

/* 下一篇：文字在左，箭头在右 */
.nav-box.next .nav-btn {
  flex-direction: row;
}
/*-----------------------------------
  Footer 深色三栏布局
------------------------------------*/
.blog-footer {
  padding: 2.5rem 0;
  border-top: 1px solid #333;
  background-color: #1a1a1a;
  color: #ccc;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left,
.footer-middle,
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-footer .material-icons {
  font-size: 1rem;
  color: #999;
  transition: color 0.2s ease;
}

.footer-left a {
  color: #ccc;
  text-decoration: none;
}

.footer-right span {
  font-size: 0.85rem;
}

.footer-left:hover .material-icons,
.footer-left a:hover,
.footer-middle:hover .material-icons,
.footer-right:hover .material-icons {
  color: #fff;
}

/*-----------------------------------
  响应式优化
------------------------------------*/
@media (max-width: 991px) {
  .blog-banner {
    padding: 2.5rem 0;
  }

  .blog-banner h1 {
    font-size: 2rem;
  }

  .post-title {
    font-size: 1.5rem;
  }

  .navbar {
    padding: 1rem 0;
  }
}

@media (max-width: 767px) {
  .blog-banner h1 {
    font-size: 1.7rem;
  }

  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.8rem;
  }

  .footer-right span {
    font-size: 0.8rem;
  }

  .post-navigation {
    flex-direction: column;
  }
}


/*-----------------------------------
  分页器样式 - 极简博客风格
------------------------------------*/
.pagination-nav {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #555;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination li a {
  background: #f8f9fa;
}

.pagination li a:hover {
  background: #e9ecef;
  color: #111;
}

.pagination li.active span {
  background: #111;
  color: #fff;
}

.pagination li.disabled span {
  color: #ccc;
  cursor: default;
}

/*-----------------------------------
  分享弹窗样式（灰白极简主题）
-----------------------------------*/
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.06);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.share-modal.show {
  display: flex;
}
.share-card {
  background: #fff;
  border-radius: 14px;
  width: 300px;
  padding: 24px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}
.share-title {
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 20px;
}

/* 微信二维码区域 */
.wechat-qr-box {
  text-align: center;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 10px;
  margin-bottom: 18px;
}
.qr-title {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
}
.qrcode {
  margin: 0 auto;
}
.qr-tip {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* 其他分享按钮 */
.share-other {
  display: flex;
  justify-content: space-around;
}
.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #555;
  text-decoration: none;
}
.share-item:hover {
  background: #f5f5f5;
}
.share-item .material-icons {
  font-size: 20px;
}
.share-item span:last-child {
  font-size: 13px;
}


/*-----------------------------------
  侧边栏搜索框
------------------------------------*/
.sidebar-widget .search-form {
  position: relative;
  width: 100%;
  display: block;
}

.sidebar-widget .search-input {
  width: 100% !important;
  height: 46px !important;
  padding: 0 18px !important;
  padding-right: 50px !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 23px !important;
  font-size: 14px !important;
  outline: none !important;
  font-family: var(--font-body) !important;
  color: var(--color-body) !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease !important;
}

.sidebar-widget .search-input:focus {
  border-color: var(--color-heading) !important;
}

.sidebar-widget .search-btn {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  width: 46px !important;
  height: 46px !important;
  border: none !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: var(--color-muted) !important;
  z-index: 9 !important;
}

.sidebar-widget .search-btn:hover {
  color: var(--color-heading) !important;
}

.sidebar-widget .search-btn .material-icons {
  font-size: 20px !important;
}


/*------------------------------
回到顶部
-------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: #f8f9fa;
}

/*------------------------------------
 相册列表， 瀑布流相册
 -------------------------------------*/
/*------------------------------------
 相册列表卡片样式（修复布局错乱）
 -------------------------------------*/
.album-list-page .album-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}
.album-card:hover {
  transform: translateY(-3px);
}

/* 相册封面：固定高度 + 居中裁剪，不拉伸 */
.album-cover {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}
.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 关键：自动裁剪不变形 */
  display: block;
}

/* 相册信息 */
.album-info {
  padding: 12px 15px;
}
.album-title {
  font-size: 16px;
  margin-bottom: 4px;
}
.album-desc {
  font-size: 13px;
  color: #666;
  margin: 0;
}
/* ===================== 瀑布流相册 ===================== */
.masonry-grid {
  column-count: 3;
  column-gap: 1rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s;
}

.masonry-item img:hover {
  transform: scale(1.04);
}

/* 移动端自适应 */
@media (max-width: 768px) {
  .masonry-grid {
    column-count: 2;
  }
}
@media (max-width: 480px) {
  .masonry-grid {
    column-count: 1;
  }
}

/* 弹窗样式保留不动 */
.photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.photo-modal.show {
  opacity: 1;
  visibility: visible;
}
.modal-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
}
.modal-img {
  max-width: 90%;
  max-height: 90vh;
  z-index: 10;
  border-radius: 8px;
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 24px;
  border: none;
  cursor: pointer;
  z-index: 10;
}
.modal-prev,
.modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 24px;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-prev { left: 20px; }
.modal-next { right: 20px; }
.modal-prev:hover, .modal-next:hover { background: rgba(255,255,255,0.2); }